Template Class Frames

Class Documentation

template<MediaType media>
class Frames

Base class that holds media frames decoded with FFmpeg.

Public Functions

Frames(uintptr_t id, Rational time_base)
Frames(const Frames&) = delete

No copy constructor.

Frames &operator=(const Frames&) = delete

No copy assignment operator.

Frames(Frames&&) noexcept

Move constructor.

Frames &operator=(Frames&&) noexcept

Move assignment operator.

~Frames()

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.

Rational get_time_base() const

Get the time_base, which is the unit of time that this Frame uses.

void push_back(AVFrame *frame)

Push a new frame into the container.

int64_t get_pts(size_t index) const
double get_timestamp(size_t index = 0) const
FramesPtr<media> clone() const
int get_sample_rate() const

Get the sample rate.

int get_num_channels() const

Get the number of audio channels.

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.

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

Range slice operation, using Python’s slice notation.

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

Slice (__getitem__) operation.

ImageFramesPtr slice(int64_t index) const

Slice (__getitem__) operation.