Module codec

Module codec 

Source
Expand description

The codec module provides helpers for enumerating and querying FFmpeg’s available audio/video encoders and decoders. This can be useful for discovering which codecs are supported in your current FFmpeg build, along with their core attributes.

§Public API

§Example

// List all available encoders
let encoders = get_encoders();
for enc in &encoders {
    println!("Encoder: {} - {}", enc.codec_name, enc.codec_long_name);
}

// List all available decoders
let decoders = get_decoders();
for dec in &decoders {
    println!("Decoder: {} - {}", dec.codec_name, dec.codec_long_name);
}

§Data Structures

  • CodecInfo: Contains user-friendly fields such as:
    • codec_name / codec_long_name
    • desc_name: The descriptor name from FFmpeg.
    • media_type (audio/video/subtitle, etc.)
    • codec_id (internal FFmpeg ID)
    • codec_capabilities (bitmask indicating codec features)

§Notes

  • The underlying [Codec] struct is for internal usage only, bridging to the raw FFmpeg APIs. In most cases, you only need the higher-level CodecInfo data from the public functions above.
  • The available encoders/decoders can vary depending on your FFmpeg build and any external libraries installed on the system.

Structs§

CodecInfo
Holds metadata about a specific codec recognized by FFmpeg.

Functions§

get_decoders
Retrieves a list of all decoders (e.g., for H.264, AAC, etc.) recognized by FFmpeg.
get_encoders
Retrieves a list of all encoders (e.g., for H.264, AAC, etc.) recognized by FFmpeg.