StormByte-Multimedia 3.3.2
C++26 multimedia processing module of the StormByte suite
Loading...
Searching...
No Matches
StormByte::Multimedia::FFmpeg Namespace Reference

Private RAII wrappers over libav*. More...

Classes

class  AVChannelLayout
 RAII ::AVChannelLayout (av_channel_layout_copy / uninit). More...
class  AVFilterGraph
 RAII AVFilterGraph with a single video or audio in/out. More...
class  AVFrame
 RAII owner of a libav AVFrame. More...
class  AVPacket
 RAII owner of a libav AVPacket. More...
class  AVPointer
 Move-only RAII base for FFmpeg C pointers. More...
class  Exception
 Base for FFmpeg backend errors. More...
class  BSFError
 Bitstream filter failure. More...
class  DecoderError
 Decoder open or process failure. More...
class  EncoderError
 Encoder open or process failure. More...
class  AVRational
 Pair {num, den} matching libavutil AVRational. More...

Enumerations

enum  OperationResult { Success , EndOfFile , Error , TryAgain }
 Result of send/receive style FFmpeg calls. More...

Functions

std::int64_t Rescale (std::int64_t ticks, const AVRational &src, const AVRational &dst) noexcept
 av_rescale_q(ticks, src, dst).
Property::Color MapColor (const AVFrame &frame, const Property::Color &fallback) noexcept
 Maps a frame's color tags, retaining fallback values for unspecified tags.
Multimedia::Stream::Properties MapProperties (const AVStream &stream) noexcept
 Builds the public property bag from a stream view.
Safe::String ErrorToString (int errnum)
 Converts an FFmpeg error code to a string.

Variables

constexpr int TimeBase = 1000000
 FFmpeg time-base frequency in microseconds (AV_TIME_BASE).
constexpr AVRational TimeBaseQ {1, TimeBase}
 FFmpeg time base (AV_TIME_BASE_Q).
constexpr AVRational Nanosecond {1, 1000000000}
 Time base with one-nanosecond ticks.
constexpr std::int64_t NoPts = std::numeric_limits<std::int64_t>::min()
 Sentinel for an unavailable timestamp (AV_NOPTS_VALUE).

Detailed Description

Private RAII wrappers over libav*.

Enumeration Type Documentation

◆ OperationResult

Result of send/receive style FFmpeg calls.

Enumerator
Success 

Completed successfully.

EndOfFile 

EOF reached.

Error 

Hard error.

TryAgain 

EAGAIN: need more input/output.

Function Documentation

◆ ErrorToString()

Safe::String StormByte::Multimedia::FFmpeg::ErrorToString ( int errnum)

Converts an FFmpeg error code to a string.

Parameters
errnumCode from av_strerror.
Returns
Human-readable message.

◆ MapColor()

Property::Color StormByte::Multimedia::FFmpeg::MapColor ( const AVFrame & frame,
const Property::Color & fallback )
noexcept

Maps a frame's color tags, retaining fallback values for unspecified tags.

Parameters
frameNative frame adapter.
fallbackPrevious color description.
Returns
Color description of the replacement pixels.

◆ MapProperties()

Multimedia::Stream::Properties StormByte::Multimedia::FFmpeg::MapProperties ( const AVStream & stream)
noexcept

Builds the public property bag from a stream view.

Parameters
streamStream view.
Returns
Video, audio or monostate.

◆ Rescale()

std::int64_t StormByte::Multimedia::FFmpeg::Rescale ( std::int64_t ticks,
const AVRational & src,
const AVRational & dst )
inlinenoexcept

av_rescale_q(ticks, src, dst).

Parameters
ticksSource ticks.
srcSource time base.
dstDestination time base.
Returns
Scaled ticks, or NoPts when either side is invalid.

Variable Documentation

◆ Nanosecond

AVRational StormByte::Multimedia::FFmpeg::Nanosecond {1, 1000000000}
inlineconstexpr

Time base with one-nanosecond ticks.

◆ NoPts

std::int64_t StormByte::Multimedia::FFmpeg::NoPts = std::numeric_limits<std::int64_t>::min()
inlineconstexpr

Sentinel for an unavailable timestamp (AV_NOPTS_VALUE).

◆ TimeBase

int StormByte::Multimedia::FFmpeg::TimeBase = 1000000
inlineconstexpr

FFmpeg time-base frequency in microseconds (AV_TIME_BASE).

◆ TimeBaseQ

AVRational StormByte::Multimedia::FFmpeg::TimeBaseQ {1, TimeBase}
inlineconstexpr

FFmpeg time base (AV_TIME_BASE_Q).