#include <icy/av/videoencoder.h>Inherits:
VideoContextSubclassed by:VideoPacketEncoder
Encodes raw video frames into a compressed format.
| Return | Name | Description |
|---|---|---|
AVFormatContext * | format |
AVFormatContext * format| 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(AVFormatContext * format)Construct an encoder, optionally tied to an existing muxer context.
format The AVFormatContext that will receive encoded packets, or nullptr for standalone use.virtual
virtual void create()Initialise the AVCodecContext using oparams. Adds a video stream to format if one was provided at construction.
virtual
virtual void close()Close and free the AVCodecContext and associated resources.
virtual
virtual bool encode(uint8_t * data, int size, int64_t pts)Encode a single video frame. This method is for interleaved video formats.
data The raw video frame buffer.
size The buffer size in bytes.
pts The presentation timestamp in stream time base units.
virtual
virtual bool encode(uint8_t * data, int linesize, int64_t pts)Encode a single video frame. This method is for planar video formats.
data Array of per-plane data pointers (up to 4 planes).
linesize Array of per-plane byte strides.
pts The presentation timestamp in stream time base units.
virtual
virtual bool encode(AVFrame * iframe)Encode a single AVFrame (typically from a decoder or converter).
iframe The source video frame with all fields set.True if an encoded packet was produced and emitted.
virtual
virtual void flush()Flush remaining packets to be encoded. This method should be called once before stream closure.