Skip to content

schema

Schema definitions for parsing FFmpeg help output.

Classes:

Name Description
FFMpegAVOption

Represents an FFmpeg AVOption with additional metadata.

FFMpegCodec

Represents an FFmpeg codec (encoder or decoder).

FFMpegDecoder

Represents an FFmpeg decoder codec.

FFMpegDemuxer

Represents an FFmpeg demuxer format.

FFMpegEncoder

Represents an FFmpeg encoder codec.

FFMpegFilter

Represents an FFmpeg filter.

FFMpegFormat

Represents an FFmpeg format (demuxer or muxer).

FFMpegIOType

Represents an FFmpeg IO type.

FFMpegMuxer

Represents an FFmpeg muxer format.

FFMpegOption

Represents an FFmpeg option from help text output.

FFMpegOptionChoice

Represents a choice value for an AVOption.

FFMpegOptionSet

Base class for sets of FFmpeg options.

FFMpegAVOption dataclass

FFMpegAVOption(
    *,
    section: str,
    name: str,
    type: FFMpegOptionType | None = None,
    flags: str | None = None,
    help: str,
    argname: str | None = None,
    min: str | None = None,
    max: str | None = None,
    default: str | None = None,
    choices: tuple[FFMpegOptionChoice, ...] = ()
)

Bases: FFMpegOption

Represents an FFmpeg AVOption with additional metadata.

AVOptions are per-stream options that have types, flags, and may include range constraints, default values, and choice lists.

Examples:

AVFormatContext AVOptions:
-fflags            <flags>      ED......... (default autobsf)
    flush_packets                E.......... reduce the latency by flushing out packets immediately

AVCodecContext AVOptions:
-b                 <int64>      E..VA...... set bitrate (in bits/s) (from 0 to I64_MAX) (default 200000)
-bt                <int>        E..VA...... Set video bitrate tolerance (in bits/s) (from 0 to INT_MAX) (default 4000000)

AVFilter AVOptions:
radius            <int>        ..FV....... set median filter radius (from 1 to 127) (default 1)
percentile        <float>      ..FV.....T. set percentile (from 0 to 1) (default 0.5)

Attributes:

Name Type Description
argname str | None

The variable name for the option (e.g., "flags", "count") or None if not specified.

choices tuple[FFMpegOptionChoice, ...]

Available choices for this option (for enum or flags types).

code_gen_type str

Get the code generation type for this option.

default str | None

The default value for this option.

flags str | None

The option's flags (e.g., "E..VA......", "..FV.......") or None if not specified.

help str

The help text description for the option.

is_av_option bool

Whether this option is an AV option.

max str | None

The maximum allowed value for this option.

min str | None

The minimum allowed value for this option.

name str

The option name (e.g., "b", "radius", "preset").

section str

The section name from help text (e.g., "Advanced global options", "AVOptions").

type FFMpegOptionType | None

The option's data type (e.g., "int", "float", "string").

argname class-attribute instance-attribute

argname: str | None = None

The variable name for the option (e.g., "flags", "count") or None if not specified.

choices class-attribute instance-attribute

choices: tuple[FFMpegOptionChoice, ...] = ()

Available choices for this option (for enum or flags types).

code_gen_type property

code_gen_type: str

Get the code generation type for this option.

Returns:

Type Description
str

The type string for code generation.

default class-attribute instance-attribute

default: str | None = None

The default value for this option.

flags class-attribute instance-attribute

flags: str | None = None

The option's flags (e.g., "E..VA......", "..FV.......") or None if not specified.

help instance-attribute

help: str

The help text description for the option.

is_av_option property

is_av_option: bool

Whether this option is an AV option.

max class-attribute instance-attribute

max: str | None = None

The maximum allowed value for this option.

min class-attribute instance-attribute

min: str | None = None

The minimum allowed value for this option.

name instance-attribute

name: str

The option name (e.g., "b", "radius", "preset").

section instance-attribute

section: str

The section name from help text (e.g., "Advanced global options", "AVOptions").

type class-attribute instance-attribute

type: FFMpegOptionType | None = None

The option's data type (e.g., "int", "float", "string").

FFMpegCodec dataclass

FFMpegCodec(
    *,
    name: str,
    flags: str,
    help: str,
    options: tuple[FFMpegAVOption, ...] = ()
)

Bases: FFMpegOptionSet

Represents an FFmpeg codec (encoder or decoder).

Note: Encoders and decoders with the same name have different options, so they are stored separately.

Examples:

Encoders:
V..... = Video
A..... = Audio
S..... = Subtitle
.F.... = Frame-level multithreading
..S... = Slice-level multithreading
...X.. = Codec is experimental
....B. = Supports draw_horiz_band
.....D = Supports direct rendering method 1
------
V....D a64multi             Multicolor charset for Commodore 64 (codec a64_multi)
V....D a64multi5            Multicolor charset for Commodore 64, extended with 5th color (colram) (codec a64_multi5)

Decoders:
V....D 012v                 Uncompressed 4:2:2 10-bit
V....D 4xm                  4X Movie
V....D 8bps                 QuickTime 8BPS video
V....D aasc                 Autodesk RLE

Attributes:

Name Type Description
flags str

The flags indicating capabilities of this option set.

help str

The help text description for this option set.

is_decoder bool

Whether this codec is a decoder.

is_encoder bool

Whether this codec is an encoder.

name str

The name of the option set.

options tuple[FFMpegAVOption, ...]

The available options in this set.

flags instance-attribute

flags: str

The flags indicating capabilities of this option set.

help instance-attribute

help: str

The help text description for this option set.

is_decoder property

is_decoder: bool

Whether this codec is a decoder.

Returns:

Type Description
bool

True if this codec is a decoder, False otherwise.

is_encoder property

is_encoder: bool

Whether this codec is an encoder.

Returns:

Type Description
bool

True if this codec is an encoder, False otherwise.

name instance-attribute

name: str

The name of the option set.

options class-attribute instance-attribute

options: tuple[FFMpegAVOption, ...] = ()

The available options in this set.

FFMpegDecoder dataclass

FFMpegDecoder(
    *,
    name: str,
    flags: str,
    help: str,
    options: tuple[FFMpegAVOption, ...] = ()
)

Bases: FFMpegCodec

Represents an FFmpeg decoder codec.

Attributes:

Name Type Description
flags str

The flags indicating capabilities of this option set.

help str

The help text description for this option set.

is_decoder bool

Whether this codec is a decoder.

is_encoder bool

Whether this codec is an encoder.

name str

The name of the option set.

options tuple[FFMpegAVOption, ...]

The available options in this set.

flags instance-attribute

flags: str

The flags indicating capabilities of this option set.

help instance-attribute

help: str

The help text description for this option set.

is_decoder property

is_decoder: bool

Whether this codec is a decoder.

Returns:

Type Description
bool

True if this codec is a decoder, False otherwise.

is_encoder property

is_encoder: bool

Whether this codec is an encoder.

Returns:

Type Description
bool

True if this codec is an encoder, False otherwise.

name instance-attribute

name: str

The name of the option set.

options class-attribute instance-attribute

options: tuple[FFMpegAVOption, ...] = ()

The available options in this set.

FFMpegDemuxer dataclass

FFMpegDemuxer(
    *,
    name: str,
    flags: str,
    help: str,
    options: tuple[FFMpegAVOption, ...] = ()
)

Bases: FFMpegFormat

Represents an FFmpeg demuxer format.

Attributes:

Name Type Description
flags str

The flags indicating capabilities of this option set.

help str

The help text description for this option set.

is_demuxer bool

Check if this format is a demuxer.

is_muxer bool

Check if this format is a muxer.

name str

The name of the option set.

options tuple[FFMpegAVOption, ...]

The available options in this set.

flags instance-attribute

flags: str

The flags indicating capabilities of this option set.

help instance-attribute

help: str

The help text description for this option set.

is_demuxer property

is_demuxer: bool

Check if this format is a demuxer.

Returns:

Type Description
bool

True if this is a demuxer, False otherwise.

is_muxer property

is_muxer: bool

Check if this format is a muxer.

Returns:

Type Description
bool

True if this is a muxer, False otherwise.

name instance-attribute

name: str

The name of the option set.

options class-attribute instance-attribute

options: tuple[FFMpegAVOption, ...] = ()

The available options in this set.

FFMpegEncoder dataclass

FFMpegEncoder(
    *,
    name: str,
    flags: str,
    help: str,
    options: tuple[FFMpegAVOption, ...] = ()
)

Bases: FFMpegCodec

Represents an FFmpeg encoder codec.

Attributes:

Name Type Description
flags str

The flags indicating capabilities of this option set.

help str

The help text description for this option set.

is_decoder bool

Whether this codec is a decoder.

is_encoder bool

Whether this codec is an encoder.

name str

The name of the option set.

options tuple[FFMpegAVOption, ...]

The available options in this set.

flags instance-attribute

flags: str

The flags indicating capabilities of this option set.

help instance-attribute

help: str

The help text description for this option set.

is_decoder property

is_decoder: bool

Whether this codec is a decoder.

Returns:

Type Description
bool

True if this codec is a decoder, False otherwise.

is_encoder property

is_encoder: bool

Whether this codec is an encoder.

Returns:

Type Description
bool

True if this codec is an encoder, False otherwise.

name instance-attribute

name: str

The name of the option set.

options class-attribute instance-attribute

options: tuple[FFMpegAVOption, ...] = ()

The available options in this set.

FFMpegFilter dataclass

FFMpegFilter(
    *,
    name: str,
    flags: str,
    help: str,
    options: tuple[FFMpegAVOption, ...] = (),
    io_flags: str,
    stream_typings_input: tuple[FFMpegIOType, ...] = (),
    stream_typings_output: tuple[FFMpegIOType, ...] = (),
    is_dynamic_input: bool = False,
    is_dynamic_output: bool = False,
    is_framesync: bool = False,
    is_slice_threading: bool = False,
    is_timeline: bool = False
)

Bases: FFMpegOptionSet

Represents an FFmpeg filter.

Filters process audio, video, or other data streams and can have various capabilities indicated by their flags.

Examples:

Filters:
T.. = Timeline support
.S. = Slice threading
..C = Command support
A = Audio input/output
V = Video input/output
N = Dynamic number and/or type of input/output
| = Source or sink filter
... abench            A->A       Benchmark part of a filtergraph.
..C acompressor       A->A       Audio compressor.
... acontrast         A->A       Simple audio dynamic range compression/expansion filter.
... acopy             A->A       Copy the input audio unchanged to the output.
... acue              A->A       Delay filtering to match a cue.
... acrossfade        AA->A      Cross fade two input audio streams.
.S. acrossover        A->N       Split audio into per-bands streams.
T.C acrusher          A->A       Reduce audio bit resolution.
TS. adeclick          A->A       Remove impulsive noise from input audio.

Attributes:

Name Type Description
flags str

The flags indicating capabilities of this option set.

help str

The help text description for this option set.

io_flags str

The IO flags of the filter.

is_dynamic_input bool

Whether the filter can accept a variable number of inputs.

is_dynamic_output bool

Whether the filter can produce a variable number of outputs.

is_framesync bool

Whether the filter supports framesync.

is_slice_threading bool

Whether the filter supports slice threading.

is_timeline bool

Whether the filter supports timeline.

name str

The name of the option set.

options tuple[FFMpegAVOption, ...]

The available options in this set.

stream_typings_input tuple[FFMpegIOType, ...]

The types of input streams this filter accepts.

stream_typings_output tuple[FFMpegIOType, ...]

The types of output streams this filter produces.

flags instance-attribute

flags: str

The flags indicating capabilities of this option set.

help instance-attribute

help: str

The help text description for this option set.

io_flags instance-attribute

io_flags: str

The IO flags of the filter.

Examples:

A->A: Audio input/output
V->V: Video input/output
N->N: Dynamic number and/or type of input/output
|->|: Source or sink filter
A->N: Audio input/output to dynamic number of outputs
N->A: Dynamic number of inputs/outputs to audio output
V->N: Video input/output to dynamic number of outputs
N->V: Dynamic number of inputs/outputs to video output

is_dynamic_input class-attribute instance-attribute

is_dynamic_input: bool = False

Whether the filter can accept a variable number of inputs.

is_dynamic_output class-attribute instance-attribute

is_dynamic_output: bool = False

Whether the filter can produce a variable number of outputs.

is_framesync class-attribute instance-attribute

is_framesync: bool = False

Whether the filter supports framesync.

is_slice_threading class-attribute instance-attribute

is_slice_threading: bool = False

Whether the filter supports slice threading.

is_timeline class-attribute instance-attribute

is_timeline: bool = False

Whether the filter supports timeline.

name instance-attribute

name: str

The name of the option set.

options class-attribute instance-attribute

options: tuple[FFMpegAVOption, ...] = ()

The available options in this set.

stream_typings_input class-attribute instance-attribute

stream_typings_input: tuple[FFMpegIOType, ...] = ()

The types of input streams this filter accepts.

stream_typings_output class-attribute instance-attribute

stream_typings_output: tuple[FFMpegIOType, ...] = ()

The types of output streams this filter produces.

FFMpegFormat dataclass

FFMpegFormat(
    *,
    name: str,
    flags: str,
    help: str,
    options: tuple[FFMpegAVOption, ...] = ()
)

Bases: FFMpegOptionSet

Represents an FFmpeg format (demuxer or muxer).

Note: Demuxers and muxers with the same name have different options, so they are stored separately.

Examples:

Muxers (E = Muxing supported):
E 3g2             3GP2 (3GPP2 file format)
E 3gp             3GP (3GPP file format)
E a64             a64 - video for Commodore 64
E ac3             raw AC-3
E ac4             raw AC-4

Demuxers (D = Demuxing supported):
D  3dostr          3DO STR
D  4xm             4X Technologies
D  aa              Audible AA format files
D  aac             raw ADTS AAC (Advanced Audio Coding)
D  aax             CRI AAX
D  ac3             raw AC-3

Attributes:

Name Type Description
flags str

The flags indicating capabilities of this option set.

help str

The help text description for this option set.

is_demuxer bool

Check if this format is a demuxer.

is_muxer bool

Check if this format is a muxer.

name str

The name of the option set.

options tuple[FFMpegAVOption, ...]

The available options in this set.

flags instance-attribute

flags: str

The flags indicating capabilities of this option set.

help instance-attribute

help: str

The help text description for this option set.

is_demuxer property

is_demuxer: bool

Check if this format is a demuxer.

Returns:

Type Description
bool

True if this is a demuxer, False otherwise.

is_muxer property

is_muxer: bool

Check if this format is a muxer.

Returns:

Type Description
bool

True if this is a muxer, False otherwise.

name instance-attribute

name: str

The name of the option set.

options class-attribute instance-attribute

options: tuple[FFMpegAVOption, ...] = ()

The available options in this set.

FFMpegIOType dataclass

FFMpegIOType(
    *,
    name: str | None = None,
    type: Literal["audio", "video"]
)

Represents an FFmpeg IO type.

Attributes:

Name Type Description
name str | None

The name of the IO type.

name class-attribute instance-attribute

name: str | None = None

The name of the IO type.

FFMpegMuxer dataclass

FFMpegMuxer(
    *,
    name: str,
    flags: str,
    help: str,
    options: tuple[FFMpegAVOption, ...] = ()
)

Bases: FFMpegFormat

Represents an FFmpeg muxer format.

Attributes:

Name Type Description
flags str

The flags indicating capabilities of this option set.

help str

The help text description for this option set.

is_demuxer bool

Check if this format is a demuxer.

is_muxer bool

Check if this format is a muxer.

name str

The name of the option set.

options tuple[FFMpegAVOption, ...]

The available options in this set.

flags instance-attribute

flags: str

The flags indicating capabilities of this option set.

help instance-attribute

help: str

The help text description for this option set.

is_demuxer property

is_demuxer: bool

Check if this format is a demuxer.

Returns:

Type Description
bool

True if this is a demuxer, False otherwise.

is_muxer property

is_muxer: bool

Check if this format is a muxer.

Returns:

Type Description
bool

True if this is a muxer, False otherwise.

name instance-attribute

name: str

The name of the option set.

options class-attribute instance-attribute

options: tuple[FFMpegAVOption, ...] = ()

The available options in this set.

FFMpegOption dataclass

FFMpegOption(
    *,
    section: str,
    name: str,
    type: FFMpegOptionType | None = None,
    flags: str | None = None,
    help: str,
    argname: str | None = None
)

Represents an FFmpeg option from help text output.

FFmpeg has different types of options with varying characteristics:

  1. General Options: No type in help text, no flags, has varname, supports -no(option) syntax
  2. AVOptions: Has type, has flags, no varname, per-stream, doesn't support -no(option) syntax
  3. AVFilter AVOptions: Has type, has flags, no varname, per-stream, special syntax
  4. BSF AVFilters: Not fully investigated yet

Examples:

General options:
-cpuflags flags     force specific cpu flags
-cpucount count     force specific cpu count

AVCodecContext AVOptions:
-b                 <int64>      E..VA...... set bitrate (in bits/s) (from 0 to I64_MAX) (default 200000)
-ab                <int64>      E...A...... set bitrate (in bits/s) (from 0 to INT_MAX) (default 128000)

AVFilter AVOptions:
radius            <int>        ..FV....... set median filter radius (from 1 to 127) (default 1)
planes            <int>        ..FV.....T. set planes to filter (from 0 to 15) (default 15)

Attributes:

Name Type Description
argname str | None

The variable name for the option (e.g., "flags", "count") or None if not specified.

flags str | None

The option's flags (e.g., "E..VA......", "..FV.......") or None if not specified.

help str

The help text description for the option.

is_av_option bool

Whether this option is an AV option.

name str

The option name (e.g., "b", "radius", "preset").

section str

The section name from help text (e.g., "Advanced global options", "AVOptions").

type FFMpegOptionType | None

The option's data type (e.g., "int", "float", "string").

argname class-attribute instance-attribute

argname: str | None = None

The variable name for the option (e.g., "flags", "count") or None if not specified.

flags class-attribute instance-attribute

flags: str | None = None

The option's flags (e.g., "E..VA......", "..FV.......") or None if not specified.

help instance-attribute

help: str

The help text description for the option.

is_av_option property

is_av_option: bool

Whether this option is an AV option.

name instance-attribute

name: str

The option name (e.g., "b", "radius", "preset").

section instance-attribute

section: str

The section name from help text (e.g., "Advanced global options", "AVOptions").

type class-attribute instance-attribute

type: FFMpegOptionType | None = None

The option's data type (e.g., "int", "float", "string").

FFMpegOptionChoice dataclass

FFMpegOptionChoice(
    *, name: str, help: str, flags: str, value: str
)

Represents a choice value for an AVOption.

There are two types of choices: 1. Flags: Multiple boolean flags that can be combined 2. Enum: Single choice from a predefined set of values

Examples:

Flags:
-fflags            <flags>      ED......... (default autobsf)
   flush_packets                E.......... reduce the latency by flushing out packets immediately
   ignidx                       .D......... ignore index
   genpts                       .D......... generate pts

Enum:
preset            <int>        ..F.A...... set equalizer preset (from -1 to 17) (default flat)
 custom          -1           ..F.A......
 flat            0            ..F.A......
 acoustic        1            ..F.A......

Attributes:

Name Type Description
flags str

The flags associated with this choice.

help str

The help text description for this choice.

name str

The choice name.

value str

The value associated with this choice.

flags instance-attribute

flags: str

The flags associated with this choice.

help instance-attribute

help: str

The help text description for this choice.

name instance-attribute

name: str

The choice name.

value instance-attribute

value: str

The value associated with this choice.

FFMpegOptionSet dataclass

FFMpegOptionSet(
    *,
    name: str,
    flags: str,
    help: str,
    options: tuple[FFMpegAVOption, ...] = ()
)

Base class for sets of FFmpeg options.

Represents collections of options such as formats, codecs, filters, etc. Each option set has a name, flags indicating capabilities, help text, and a collection of available options.

Example:

File formats:
D. = Demuxing supported
.E = Muxing supported
--
D  3dostr          3DO STR

Attributes:

Name Type Description
flags str

The flags indicating capabilities of this option set.

help str

The help text description for this option set.

name str

The name of the option set.

options tuple[FFMpegAVOption, ...]

The available options in this set.

flags instance-attribute

flags: str

The flags indicating capabilities of this option set.

help instance-attribute

help: str

The help text description for this option set.

name instance-attribute

name: str

The name of the option set.

options class-attribute instance-attribute

options: tuple[FFMpegAVOption, ...] = ()

The available options in this set.