Encodes frames of one output track into packets. More...
#include <StormByte/multimedia/pipeline/encoder.hxx>


Public Member Functions | |
Lifecycle | |
| Encoder (StormByte::Safe::Shared< StormByte::Logger::Log > log, int output_index, const Codec &codec) | |
Encoder for output track output_index and destination codec. | |
| Encoder (const Encoder &other)=delete | |
| Copy constructor. | |
| Encoder (Encoder &&other) noexcept=delete | |
| Move constructor. | |
| ~Encoder () noexcept override | |
| Destructor. | |
| Encoder & | operator= (const Encoder &other)=delete |
| Copy assignment. | |
| Encoder & | operator= (Encoder &&other) noexcept=delete |
| Move assignment. | |
State | |
| operator bool () const noexcept | |
| true if the encoder is open and has not failed. | |
| int | Index () const noexcept |
| Mux destination order key. | |
| StormByte::Size | InputCeiling () const noexcept override |
| Maximum number of queued input frames. | |
| const Codec & | Destination () const noexcept |
| Destination codec. | |
| bool | Opened () const noexcept |
| Whether encoder initialization has completed. | |
| StormByte::Safe::Optional< int > | AudioChannels () const |
| Encoder channel count after Open(), audio only. | |
| StormByte::Safe::Optional< int > | AudioSampleRate () const |
| Encoder sample rate after Open(), audio only. | |
| StormByte::Safe::Optional< int > | AudioFrameSize () const |
| Encoder frame_size after Open(), audio only. | |
| StormByte::Safe::Optional< int > | AudioSampleFormat () const |
| Encoder sample format after Open(), audio only. | |
Encoder tag | |
| const StormByte::Safe::String & | EncoderTag () const noexcept |
| Writing-application tag stamped on every encoded stream. | |
Implementation | |
| const StormByte::Safe::Optional< StormByte::Safe::String > & | Implementation () const noexcept |
| Pinned FFmpeg encoder name, if any. | |
| void | Implementation (StormByte::Safe::String name) noexcept |
| Pins an FFmpeg encoder name. | |
| const Features & | Require () const noexcept |
| Extra features the caller demands besides Frame HDR. | |
| void | Require (Features features) noexcept |
| Replaces the extra feature mask (before open). | |
| const Features & | Capabilities () const noexcept |
| Features of the row selected at open. | |
Rate and style | |
| void | CRF (double value) noexcept |
| Constant quality (CRF/CQ). | |
| const StormByte::Safe::Optional< double > & | CRF () const noexcept |
| CRF/CQ, if set. | |
| void | BitRate (std::int64_t bits_per_second) noexcept |
| Target bitrate in bits per second. | |
| const StormByte::Safe::Optional< std::int64_t > & | BitRate () const noexcept |
| Target bitrate, if set. | |
| void | MaxBitRate (std::int64_t bits_per_second) noexcept |
| VBV ceiling in bits per second. | |
| const StormByte::Safe::Optional< std::int64_t > & | MaxBitRate () const noexcept |
| VBV ceiling, if set. | |
| void | Preset (StormByte::Safe::String name) noexcept |
| Encoder preset. | |
| const StormByte::Safe::Optional< StormByte::Safe::String > & | Preset () const noexcept |
| Preset, if set. | |
| void | Tune (StormByte::Safe::String name) noexcept |
| Content tune. | |
| const StormByte::Safe::Optional< StormByte::Safe::String > & | Tune () const noexcept |
| Tune, if set. | |
FineTune | |
| const StormByte::Safe::Map< StormByte::Safe::String, StormByte::Safe::String > & | FineTune () const noexcept |
| Vendor leftovers. | |
| void | FineTune (StormByte::Safe::Map< StormByte::Safe::String, StormByte::Safe::String > options) noexcept |
| Replaces the vendor dict (before open). | |
| Public Member Functions inherited from StormByte::Multimedia::Pipeline::Step | |
| Step (const Step &other)=delete | |
| Copy construction is disabled. | |
| Step (Step &&other) noexcept=delete | |
| Move construction is disabled. | |
| virtual | ~Step () noexcept |
| Destructor. | |
| Step & | operator= (const Step &other)=delete |
| Copy assignment is disabled. | |
| Step & | operator= (Step &&other) noexcept=delete |
| Move assignment is disabled. | |
| void | Wake () noexcept |
| Notifies all waiters of this step. | |
| StormByte::Safe::Shared< class Plan > | Plan () const noexcept |
| Bound job intention, if any. | |
| const Kinds & | Receives () const noexcept |
| Kinds this step consumes. | |
| const Kinds & | Produces () const noexcept |
| Kinds this step emits. | |
| State | Status () const noexcept |
| Current lifecycle value. | |
| StormByte::Safe::Shared< const StageTelemetry > | Telemetry () const |
| Shared stage counters, retained independently of this Step. | |
| StormByte::Buffer::QueueSnapshot | QueueSnapshot (int track) const noexcept |
| Reads effective queue limits and logical-byte accounting. | |
| virtual bool | Ready () const noexcept |
| Whether this step can take work. | |
| void | Stop () noexcept |
| Requests shutdown and notifies connected stages. | |
| bool | Failed () const noexcept |
| Whether this step has failed. | |
| StormByte::Safe::Optional< StormByte::Safe::String > | Error () const |
| Failure text. | |
| void | Fail (StormByte::Safe::String reason) noexcept |
| Marks the stage as failed and notifies connected stages. | |
| void | Fail () noexcept |
| Marks failure without storing a message or allocating. | |
| STORMBYTE_FORCE_INLINE void | Fail (const char *reason) noexcept |
| Copies a null-terminated failure literal into Safe storage. | |
| void | Fail (std::string_view reason) noexcept |
| Copies borrowed failure text before calling the DLL-safe overload. | |
Friends | |
| class | Backend::Pipeline::Encoder |
| Allows the encode backend to wrap and emit encoded packets. | |
| class | Backend::Pipeline::Detail::Worker::Encode |
| Allows the encode worker to access encoder internals. | |
| class | Muxer |
| Allows the muxer to bind the encoded stream. | |
Additional Inherited Members | |
| Protected Member Functions inherited from StormByte::Multimedia::Pipeline::Step | |
| bool | Connect (Step &downstream) noexcept |
| Registers a borrowed downstream stage and shares any bound plan. | |
| bool | WaitPlan () noexcept |
| Waits interruptibly for the shared plan to enter Running. | |
| Backend::Pipeline::Pipe & | pipe () noexcept |
| const Backend::Pipeline::Pipe & | pipe () const noexcept |
| Step (StormByte::Safe::Shared< StormByte::Logger::Log > log, enum Producer name, Kinds receives, Kinds produces) | |
| Constructs a stage in State::Created. | |
| void | Emit (Item::PointerType item) noexcept |
Sends item to connected consumers. | |
| Item::PointerType | CloneItem (const Item &item) const |
| Creates a distinct item through Item::Clone. | |
| virtual void | Wait () noexcept |
| Waits until input is available, the stage fails or stops, or WakeNow. | |
| virtual bool | WakeNow () const noexcept |
| Extra reason to leave Wait. | |
| virtual void | AfterWait () noexcept |
| Work on the waiting worker after Wait unblocks. | |
| void | Launch () noexcept |
| Starts stage initialization and processing. | |
| void | Halt () noexcept |
| Stops the stage and waits for execution to finish. | |
| bool | Stopping () const noexcept |
| Worker must return (Stop, Halt or Fail). | |
| void | RecordWork (std::int64_t microseconds) noexcept |
| Adds one Process duration to the step summary. | |
| std::int64_t | LastWork () const noexcept |
| Duration of the last timed Process, or 0. | |
| void | DumpWork () noexcept |
| Writes min/max Process time at Debug. | |
| Backend::Pipeline::Host & | Face () noexcept |
| void | Mount (StormByte::Safe::Unique< Backend::Pipeline::Pumper > pumper, StormByte::Safe::Unique< Backend::Pipeline::Worker > worker) |
| Protected Attributes inherited from StormByte::Multimedia::Pipeline::Step | |
| StormByte::Safe::Shared< StormByte::Logger::Log > | m_log |
| Scoped logger retained through Base-heap shared ownership. | |
| enum Producer | m_name |
| UseLog leaf / default Label. | |
| Kinds | m_receives |
| Receives. | |
| Kinds | m_produces |
| Produces. | |
Encodes frames of one output track into packets.
Encoder stage used to record settled track settings.
The bound Plan selects the destination codec. Logging identifies the selected encoder, and the supplied logger controls throttling.
Filters can analyze decoded pictures from the encoded output without changing the packets delivered to the muxer.
| StormByte::Multimedia::Pipeline::Encoder::Encoder | ( | StormByte::Safe::Shared< StormByte::Logger::Log > | log, |
| int | output_index, | ||
| const Codec & | codec ) |
|
delete |
Copy constructor.
| other | Source encoder. |
|
deletenoexcept |
Move constructor.
| other | Encoder to take. |
|
overridenoexcept |
Destructor.
Step::Join halts workers before backends die.
| StormByte::Safe::Optional< int > StormByte::Multimedia::Pipeline::Encoder::AudioChannels | ( | ) | const |
Encoder channel count after Open(), audio only.
| StormByte::Safe::Optional< int > StormByte::Multimedia::Pipeline::Encoder::AudioFrameSize | ( | ) | const |
Encoder frame_size after Open(), audio only.
| StormByte::Safe::Optional< int > StormByte::Multimedia::Pipeline::Encoder::AudioSampleFormat | ( | ) | const |
Encoder sample format after Open(), audio only.
| StormByte::Safe::Optional< int > StormByte::Multimedia::Pipeline::Encoder::AudioSampleRate | ( | ) | const |
Encoder sample rate after Open(), audio only.
|
inlinenoexcept |
Target bitrate, if set.
|
inlinenoexcept |
Target bitrate in bits per second.
Incompatible with CRF.
| bits_per_second | Bitrate. |
|
inlinenoexcept |
|
inlinenoexcept |
CRF/CQ, if set.
|
inlinenoexcept |
|
inlinenoexcept |
Destination codec.
|
inlinenoexcept |
Writing-application tag stamped on every encoded stream.
|
inlinenoexcept |
Vendor leftovers.
Not CRF/preset/tune/bufsize.
|
inlinenoexcept |
Replaces the vendor dict (before open).
| options | Key/value pairs. |
|
inlinenoexcept |
Pinned FFmpeg encoder name, if any.
|
noexcept |
|
inlinenoexcept |
Mux destination order key.
|
overridevirtualnoexcept |
Maximum number of queued input frames.
Reimplemented from StormByte::Multimedia::Pipeline::Step.
|
inlinenoexcept |
VBV ceiling, if set.
|
inlinenoexcept |
VBV ceiling in bits per second.
| bits_per_second | Max bitrate. |
|
noexcept |
Whether encoder initialization has completed.
|
explicitnoexcept |
true if the encoder is open and has not failed.
Copy assignment.
| other | Source encoder. |
|
inlinenoexcept |
Preset, if set.
|
noexcept |
Encoder preset.
| name | Preset name. |
|
inlinenoexcept |
Extra features the caller demands besides Frame HDR.
|
inlinenoexcept |
Replaces the extra feature mask (before open).
| features | Required bits. |
|
inlinenoexcept |
Tune, if set.
|
noexcept |
Content tune.
| name | Tune name. |
|
friend |
Allows the encode worker to access encoder internals.
|
friend |
Allows the encode backend to wrap and emit encoded packets.
|
friend |
Allows the muxer to bind the encoded stream.