Audio/video codecs, capture devices, packet types, and media helpers.
| Name | Description |
|---|---|
AppleDeviceWatcher | Monitors device add/remove events via AVFoundation notifications and CoreAudio property listeners. |
AudioCapture | Cross-platform audio capture device backed by FFmpeg input devices. |
AudioPacketEncoder | PacketProcessor that encodes raw audio samples (PlanarAudioPacket or AudioPacket) into compressed packets via AudioEncoder. |
DeviceManager | Enumerates and manages system audio and video devices. |
DeviceWatcher | Base class for platform-specific device change monitors. |
FormatRegistry | Singleton registry of available media container formats for encoding and decoding. |
FPSCounter | FPS counter based on the simple moving average (SMA) algorithm. |
FPSLimiter | PacketStream processor that caps packet throughput to a maximum FPS. |
ICapture | Abstract interface for audio and video capture devices. |
IEncoder | This is the abstract class for all encoders. |
LinuxDeviceWatcher | Monitors device add/remove events via libudev. |
MediaCapture | Unified capture and decode source for files and live media devices. |
MultiplexEncoder | Multiplexing encoder that writes synchronized audio and video streams. |
MultiplexPacketEncoder | Encodes and multiplexes a realtime video stream form audio / video capture sources. FFmpeg is used for encoding. |
RealtimePacketQueue | Queue that emits media packets in presentation-timestamp order relative to a realtime clock. |
VideoCapture | Cross-platform video device capturer backed by FFmpeg avdevice. |
VideoPacketEncoder | PacketProcessor that encodes raw video frames (PlanarVideoPacket or VideoPacket) into compressed packets via VideoEncoder. |
WindowsDeviceWatcher | Monitors device add/remove events via IMMNotificationClient (audio) and RegisterDeviceNotification (video). |
AudioBuffer | FIFO buffer for queuing audio samples between encoding stages. |
AudioCodec | Audio codec parameters including channels, sample rate, and sample format. |
AudioContext | Base context for audio encoding and decoding via FFmpeg. |
AudioDecoder | Decodes compressed audio packets into raw sample frames. |
AudioEncoder | Encodes raw audio samples into a compressed format. |
AudioPacket | Audio packet for interleaved formats. |
AudioResampler | Converts audio samples between different formats, sample rates, and channel layouts. |
Codec | Codec for encoding/decoding media. |
Deleter | RAII helpers for owning FFmpeg allocation types. |
Deleterp | Deleter adaptor for functions like av_freep that take a pointer to a pointer. |
Device | Represents a system audio, video or render device. |
EncoderOptions | Configuration options for audio and video encoders. |
EncoderState | State machine states for the encoder pipeline. |
Format | Defines a media container format which is available through the FormatRegistry for encoding or decoding. |
MediaPacket | Timestamped media packet carrying raw audio or video data. |
PlanarAudioPacket | Audio packet for planar formats. |
PlanarVideoPacket | Video packet for planar formats. |
VideoCodec | Video codec parameters including resolution, frame rate, and pixel format. |
VideoContext | Base video context from which all video encoders and decoders derive. |
VideoConverter | Converts video frames between pixel formats and resolutions. |
VideoDecoder | Decodes compressed video packets into raw frames. |
VideoEncoder | Encodes raw video frames into a compressed format. |
VideoPacket | Video packet for interleaved formats. |
| Name | Description |
|---|---|
MediaCapabilities | Bitmask of media capabilities detected on this system. |
enum MediaCapabilitiesBitmask of media capabilities detected on this system.
| Value | Description |
|---|---|
AUDIO_RECV | Audio capture or decode is available. |
AUDIO_SEND | Audio playback or encode is available. |
VIDEO_RECV | Video capture or decode is available. |
VIDEO_SEND | Video render or encode is available. |
| Return | Name | Description |
|---|---|---|
std::list< Codec > | CodecList | List of codec value objects. |
std::list< Codec * > | CodecPList | List of codec pointers. |
std::unique_ptr< AVFrame, Deleterp< AVFrame, void, av_frame_free > > | AVFrameHolder | Owning AVFrame pointer released with av_frame_free(). |
std::unique_ptr< AVFormatContext, Deleter< AVFormatContext, void, avformat_free_context > > | AVFormatContextHolder | Owning AVFormatContext pointer released with avformat_free_context(). |
std::unique_ptr< AVCodecContext, Deleterp< AVCodecContext, void, avcodec_free_context > > | AVCodecContextHolder | Owning AVCodecContext pointer released with avcodec_free_context(). |
std::unique_ptr< AVDictionary *, Deleter< AVDictionary *, void, av_dict_free > > | AVDictionaryCleanup | Cleanup wrapper for AVDictionary* values freed with av_dict_free(). |
std::unique_ptr< AVPacket, Deleterp< AVPacket, void, av_packet_free > > | AVPacketHolder | Owning AVPacket pointer released with av_packet_free(). |
std::vector< Format > | FormatList | List of container format value objects. |
std::vector< Format * > | FormatPList | List of container format pointers. |
IEncoder | IPacketEncoder | Legacy alias for IEncoder kept for 0.8.x compatibility. |
std::list< Codec > CodecList()List of codec value objects.
std::list< Codec * > CodecPList()List of codec pointers.
std::unique_ptr< AVFrame, Deleterp< AVFrame, void, av_frame_free > > AVFrameHolder()Owning AVFrame pointer released with av_frame_free().
std::unique_ptr< AVFormatContext, Deleter< AVFormatContext, void, avformat_free_context > > AVFormatContextHolder()Owning AVFormatContext pointer released with avformat_free_context().
std::unique_ptr< AVCodecContext, Deleterp< AVCodecContext, void, avcodec_free_context > > AVCodecContextHolder()Owning AVCodecContext pointer released with avcodec_free_context().
std::unique_ptr< AVDictionary *, Deleter< AVDictionary *, void, av_dict_free > > AVDictionaryCleanup()Cleanup wrapper for AVDictionary* values freed with av_dict_free().
std::unique_ptr< AVPacket, Deleterp< AVPacket, void, av_packet_free > > AVPacketHolder()Owning AVPacket pointer released with av_packet_free().
std::vector< Format > FormatList()List of container format value objects.
std::vector< Format * > FormatPList()List of container format pointers.
IEncoder IPacketEncoder()Legacy alias for IEncoder kept for 0.8.x compatibility.
| Return | Name | Description |
|---|---|---|
void | initAudioCodecFromContext | Populate an AudioCodec from an open AVCodecContext. |
AVSampleFormat | selectSampleFormat | Select the best supported sample format for a codec given the requested parameters. Returns the requested format if supported, otherwise the first format with the same planarity. |
bool | isSampleFormatSupported | Check whether a specific sample format is in the codec's supported list. |
bool | formatIsPlanar | Return true if the named sample format is planar (e.g. "fltp", "s16p"). |
bool | formatIsPlanar | Return true if the given AVSampleFormat is planar. |
int64_t | fpsToInterval inline | Convert a frame rate to a nanosecond frame interval. |
int | intervalToFps inline | Convert a nanosecond frame interval to a frame rate. |
float | intervalToFpsFloat inline | Convert a nanosecond frame interval to a floating-point frame rate. |
void | initializeFFmpeg | Initialize the FFmpeg library. |
void | uninitializeFFmpeg | Uninitializes the FFmpeg library. |
std::string | averror | Get an error string for the given error code. |
void | printInputFormats | Print all available FFmpeg demuxer (input) format names to the given stream. |
void | printOutputFormats | Print all available FFmpeg muxer (output) format names to the given stream. |
void | printEncoders | Print all available FFmpeg encoder names to the given stream. |
AVPacketHolder | makeOwnedPacket | Allocate an owning AVPacket with FFmpeg-required padding and timestamp metadata. The packet payload is copied into FFmpeg-managed storage, which is required by decoders such as H.264 that may overread AV_INPUT_BUFFER_PADDING_SIZE bytes. |
AVFrame * | createVideoFrame | Allocate a new AVFrame with the given pixel format and dimensions. Uses av_frame_get_buffer for reference-counted allocation with 16-byte alignment. |
AVFrame * | cloneVideoFrame | Perform a deep copy of an AVFrame including its buffer data and properties. |
void | initVideoCodecFromContext | Populate a VideoCodec from an open AVStream and AVCodecContext. |
AVPixelFormat | selectPixelFormat | Select the best supported pixel format for a codec given the requested parameters. Returns the requested format if supported, otherwise the first format with the same plane count. |
void initAudioCodecFromContext(const AVCodecContext * ctx, AudioCodec & params)Populate an AudioCodec from an open AVCodecContext.
ctx The FFmpeg codec context to read from.
params The AudioCodec struct to fill with codec, channel, sample rate, and format info.
AVSampleFormat selectSampleFormat(const AVCodec * codec, av::AudioCodec & params)Select the best supported sample format for a codec given the requested parameters. Returns the requested format if supported, otherwise the first format with the same planarity.
codec The FFmpeg codec whose supported formats are queried.
params The audio codec parameters specifying the desired sample format.
The chosen AVSampleFormat, or AV_SAMPLE_FMT_NONE if none is compatible.
bool isSampleFormatSupported(const AVCodec * codec, enum AVSampleFormat sampleFormat)Check whether a specific sample format is in the codec's supported list.
codec The FFmpeg codec to query.
sampleFormat The AVSampleFormat to look up.
True if the format is supported.
bool formatIsPlanar(const std::string & pixfmt)Return true if the named sample format is planar (e.g. "fltp", "s16p").
pixfmt The sample format name string.bool formatIsPlanar(AVSampleFormat format)Return true if the given AVSampleFormat is planar.
format The AVSampleFormat to check.inline
inline int64_t fpsToInterval(int fps)Convert a frame rate to a nanosecond frame interval.
fps The frame rate in frames per second.The interval in nanoseconds between frames, or the minimum interval if fps is zero.
inline
inline int intervalToFps(int64_t interval)Convert a nanosecond frame interval to a frame rate.
interval The nanosecond interval between frames.The frame rate in frames per second, or zero if interval is zero.
inline
inline float intervalToFpsFloat(int64_t interval)Convert a nanosecond frame interval to a floating-point frame rate.
interval The nanosecond interval between frames.The frame rate in frames per second as a float, or 0.0f if interval is zero.
void initializeFFmpeg()Initialize the FFmpeg library.
void uninitializeFFmpeg()Uninitializes the FFmpeg library.
std::string averror(const int error)Get an error string for the given error code.
void printInputFormats(std::ostream & ost, const char * delim)Print all available FFmpeg demuxer (input) format names to the given stream.
ost The output stream to write to.
delim Delimiter inserted between each name.
void printOutputFormats(std::ostream & ost, const char * delim)Print all available FFmpeg muxer (output) format names to the given stream.
ost The output stream to write to.
delim Delimiter inserted between each name.
void printEncoders(std::ostream & ost, const char * delim)Print all available FFmpeg encoder names to the given stream.
ost The output stream to write to.
delim Delimiter inserted between each name.
AVPacketHolder makeOwnedPacket(const MediaPacket & packet, int streamIndex, AVRational timeBase)Allocate an owning AVPacket with FFmpeg-required padding and timestamp metadata. The packet payload is copied into FFmpeg-managed storage, which is required by decoders such as H.264 that may overread AV_INPUT_BUFFER_PADDING_SIZE bytes.
AVFrame * createVideoFrame(AVPixelFormat pixelFmt, int width, int height)Allocate a new AVFrame with the given pixel format and dimensions. Uses av_frame_get_buffer for reference-counted allocation with 16-byte alignment.
pixelFmt The pixel format for the frame.
width The frame width in pixels.
height The frame height in pixels.
A newly allocated AVFrame, or nullptr on failure.
AVFrame * cloneVideoFrame(AVFrame * source)Perform a deep copy of an AVFrame including its buffer data and properties.
source The source frame to copy.A newly allocated AVFrame with copied data. Caller owns the result.
void initVideoCodecFromContext(const AVStream * stream, const AVCodecContext * ctx, VideoCodec & params)Populate a VideoCodec from an open AVStream and AVCodecContext.
stream The AVStream for frame rate information (may be null).
ctx The FFmpeg codec context to read from.
params The VideoCodec struct to fill with codec, dimension, and format info.
AVPixelFormat selectPixelFormat(const AVCodec * codec, VideoCodec & params)Select the best supported pixel format for a codec given the requested parameters. Returns the requested format if supported, otherwise the first format with the same plane count.
codec The FFmpeg codec whose supported formats are queried.
params The video codec parameters specifying the desired pixel format.
The chosen AVPixelFormat.