VideoEncoder
#include <icy/av/videoencoder.h>
struct VideoEncoderDefined in src/av/include/icy/av/videoencoder.h:30
- Inherits
VideoContext- Subclassed by
VideoPacketEncoder
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. | |
~VideoEncoder noexcept override | ||
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
| Parameter | Type | Description |
|---|---|---|
format | AVFormatContext * | The AVFormatContext that will receive encoded packets, or nullptr for standalone use. |
~VideoEncoder
noexcept override
~VideoEncoder() noexcept overrideDefined in src/av/include/icy/av/videoencoder.h:35
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.
Reimplements
Parameters
| Parameter | Type | Description |
|---|---|---|
data | uint8_t * | The raw video frame buffer. |
size | int | The buffer size in bytes. |
pts | int64_t | The presentation timestamp in stream time base units. |
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.
Reimplements
Parameters
| Parameter | Type | Description |
|---|---|---|
data | uint8_t * | Array of per-plane data pointers (up to 4 planes). |
linesize | int | Array of per-plane byte strides. |
pts | int64_t | The presentation timestamp in stream time base units. |
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).
Returns
True if an encoded packet was produced and emitted.
Reimplements
Parameters
| Parameter | Type | Description |
|---|---|---|
iframe | AVFrame * | The source video frame with all fields set. |
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.
