VideoEncoder
VideoEncoder
#include <icy/av/videoencoder.h>struct VideoEncoderDefined in src/av/include/icy/av/videoencoder.h:30
Inherits:
VideoContextSubclassed by:VideoPacketEncoder
Encodes raw video frames into a compressed format.
List of all members
| Name | Kind | Owner |
|---|---|---|
format | variable | Declared here |
VideoEncoder | function | Declared here |
~VideoEncoder | function | Declared here |
create | function | Declared here |
close | function | Declared here |
encode | function | Declared here |
encode | function | Declared here |
encode | function | Declared here |
flush | function | Declared here |
emitter | variable | Inherited from VideoContext |
iparams | variable | Inherited from VideoContext |
oparams | variable | Inherited from VideoContext |
stream | variable | Inherited from VideoContext |
ctx | variable | Inherited from VideoContext |
codec | variable | Inherited from VideoContext |
frame | variable | Inherited from VideoContext |
conv | variable | Inherited from VideoContext |
time | variable | Inherited from VideoContext |
pts | variable | Inherited from VideoContext |
seconds | variable | Inherited from VideoContext |
error | variable | Inherited from VideoContext |
VideoContext | function | Inherited from VideoContext |
~VideoContext | function | Inherited from VideoContext |
VideoContext | function | Inherited from VideoContext |
operator= | function | Inherited from VideoContext |
VideoContext | function | Inherited from VideoContext |
operator= | function | Inherited from VideoContext |
create | function | Inherited from VideoContext |
open | function | Inherited from VideoContext |
close | function | Inherited from VideoContext |
decode | function | Inherited from VideoContext |
encode | function | Inherited from VideoContext |
encode | function | Inherited from VideoContext |
encode | function | Inherited from VideoContext |
flush | function | Inherited from VideoContext |
convert | function | Inherited from VideoContext |
recreateConverter | function | Inherited from VideoContext |
Inherited from VideoContext
| Kind | Name | Description |
|---|---|---|
variable | emitter | |
variable | iparams | input parameters |
variable | oparams | output parameters |
variable | stream | encoder or decoder stream |
variable | ctx | encoder or decoder context |
variable | codec | encoder or decoder codec |
variable | frame | encoder or decoder frame |
variable | conv | video conversion context |
variable | time | stream time in codec time base |
variable | pts | last packet pts value |
variable | seconds | video time in seconds |
variable | error | error message |
function | VideoContext | |
function | ~VideoContext virtual noexcept | |
function | VideoContext | Deleted constructor. |
function | operator= | Deleted assignment operator. |
function | VideoContext | Deleted constructor. |
function | operator= | Deleted assignment operator. |
function | create virtual | Initialise the AVCodecContext with codec-specific defaults. Overridden by VideoEncoder and VideoDecoder. |
function | open virtual | Open the codec and create the pixel format conversion context if required. Throws std::runtime_error if the codec context has not been created. |
function | close virtual | Close the codec context, free the frame, and reset timestamps. |
function | decode virtual | Decode a compressed video packet and emit the resulting frame. |
function | encode virtual | Encode a buffer of interleaved video data. |
function | encode virtual | Encode a planar video frame. |
function | encode virtual | Encode a single AVFrame. |
function | flush virtual | Flush any frames buffered inside the codec and emit remaining output. |
function | convert virtual | Convert the video frame and return the result. |
function | recreateConverter virtual | Recreate the VideoConverter if the input or output parameters have changed. Called automatically by open() and convert(). |
Public Attributes
| Return | Name | Description |
|---|---|---|
AVFormatContext * | format |
format
AVFormatContext * formatDefined in src/av/include/icy/av/videoencoder.h:69
Public Methods
| Return | Name | Description |
|---|---|---|
VideoEncoder | Construct an encoder, optionally tied to an existing muxer context. | |
void | create virtual override | Initialise the AVCodecContext using oparams. Adds a video stream to format if one was provided at construction. |
void | close virtual override | Close and free the AVCodecContext and associated resources. |
bool | encode virtual override | Encode a single video frame. This method is for interleaved video formats. |
bool | encode virtual override | Encode a single video frame. This method is for planar video formats. |
bool | encode virtual override | Encode a single AVFrame (typically from a decoder or converter). |
void | flush virtual override | Flush remaining packets to be encoded. This method should be called once before stream closure. |
VideoEncoder
VideoEncoder(AVFormatContext * format = nullptr)Defined in src/av/include/icy/av/videoencoder.h:34
Construct an encoder, optionally tied to an existing muxer context.
Parameters
formatThe AVFormatContext that will receive encoded packets, or nullptr for standalone use.
create
virtual override
virtual void create() overrideDefined in src/av/include/icy/av/videoencoder.h:39
Initialise the AVCodecContext using oparams. Adds a video stream to format if one was provided at construction.
Reimplements
close
virtual override
virtual void close() overrideDefined in src/av/include/icy/av/videoencoder.h:42
Close and free the AVCodecContext and associated resources.
Reimplements
encode
virtual override
virtual bool encode(uint8_t * data, int size, int64_t pts) overrideDefined in src/av/include/icy/av/videoencoder.h:50
Encode a single video frame. This method is for interleaved video formats.
Parameters
dataThe raw video frame buffer.sizeThe buffer size in bytes.ptsThe presentation timestamp in stream time base units.
Reimplements
encode
virtual override
virtual bool encode(uint8_t * data, int linesize, int64_t pts) overrideDefined in src/av/include/icy/av/videoencoder.h:58
Encode a single video frame. This method is for planar video formats.
Parameters
dataArray of per-plane data pointers (up to 4 planes).linesizeArray of per-plane byte strides.ptsThe presentation timestamp in stream time base units.
Reimplements
encode
virtual override
virtual bool encode(AVFrame * iframe) overrideDefined in src/av/include/icy/av/videoencoder.h:63
Encode a single AVFrame (typically from a decoder or converter).
Parameters
iframeThe source video frame with all fields set.
Returns
True if an encoded packet was produced and emitted.
Reimplements
flush
virtual override
virtual void flush() overrideDefined in src/av/include/icy/av/videoencoder.h:67
Flush remaining packets to be encoded. This method should be called once before stream closure.
