Template Class FFmpegFrames

Class Documentation

template<MediaType media_type>
class FFmpegFrames

Base class that holds media frames decoded with FFmpeg.

Public Functions

FFmpegFrames(uint64_t id, Rational time_base)
FFmpegFrames(const FFmpegFrames&) = delete

No copy constructor.

FFmpegFrames &operator=(const FFmpegFrames&) = delete

No copy assignment operator.

FFmpegFrames(FFmpegFrames&&) noexcept

Move constructor.

FFmpegFrames &operator=(FFmpegFrames&&) noexcept

Move assignment operator.

~FFmpegFrames()

Destructor releases AVFrame resources.

uint64_t get_id() const

Get the ID used for tracing.

const std::vector<AVFrame*> &get_frames() const

Get the list of frames.

const char *get_media_format_name() const

Get the format of the frames.

OptionDict get_metadata() const

Get metadata.

int get_num_frames() const

Get the number of frames.

void push_back(AVFrame *frame)

Push a new frame into the container.

int get_sample_rate() const

Get the sample rate.

int get_num_channels() const

Get the number of audio channels.

Rational get_time_base() const
int get_num_planes() const

Get the number of planes in the image.

Note: The number of planes and the number of color channels do not match. For example, NV12 has 3 channels, YUV, but U and V are interleaved in the same plane.

int get_width() const

Get the width of the image.

int get_height() const

Get the height of the image.

FFmpegVideoFramesPtr slice(int start, int stop, int step) const

Range slice operation, using Python’s slice notation.

FFmpegVideoFramesPtr slice(const std::vector<int64_t> &index) const

Slice (__getitem__) operation.

FFmpegImageFramesPtr slice(int64_t index) const

Slice (__getitem__) operation.

Public Members

Rational time_base

Time base of the frames.