VideoEncoder
VideoEncoder
#include <icy/av/videoencoder.h>Inherits:
VideoContextSubclassed by:VideoPacketEncoder
Encodes raw video frames into a compressed format.
Public Attributes
| Return | Name | Description |
|---|---|---|
AVFormatContext * | format |
format
AVFormatContext * formatPublic Methods
| Return | Name | Description |
|---|---|---|
VideoEncoder | Construct an encoder, optionally tied to an existing muxer context. | |
void | create virtual | Initialise the AVCodecContext using oparams. Adds a video stream to format if one was provided at construction. |
void | close virtual | Close and free the AVCodecContext and associated resources. |
bool | encode virtual | Encode a single video frame. This method is for interleaved video formats. |
bool | encode virtual | Encode a single video frame. This method is for planar video formats. |
bool | encode virtual | Encode a single AVFrame (typically from a decoder or converter). |
void | flush virtual | Flush remaining packets to be encoded. This method should be called once before stream closure. |
VideoEncoder
VideoEncoder(AVFormatContext * format)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
virtual void create()Initialise the AVCodecContext using oparams. Adds a video stream to format if one was provided at construction.
close
virtual
virtual void close()Close and free the AVCodecContext and associated resources.
encode
virtual
virtual bool encode(uint8_t * data, int size, int64_t pts)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.
encode
virtual
virtual bool encode(uint8_t * data, int linesize, int64_t pts)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.
encode
virtual
virtual bool encode(AVFrame * iframe)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.
flush
virtual
virtual void flush()Flush remaining packets to be encoded. This method should be called once before stream closure.
