FFmpeg Capabilities References

ffmpegio.caps module contains a set of functions to wrap ffmpeg’s help/show commands to check the capabilities of the ffmpeg executable that the ffmpegio is employing.

Todo

Parsing the additional command options that are specific to the containers, codecs, and filters. The options fields are currently returned as unparsed str

List of Functions

ffmpegio.caps.options

get FFmpeg command options

ffmpegio.caps.pix_fmts

get supported pixel formats

ffmpegio.caps.sample_fmts

get supported audio sample formats

ffmpegio.caps.layouts

get supported audio channel layouts

ffmpegio.caps.colors

get recognized color names

ffmpegio.caps.filters

get FFmpeg filters

ffmpegio.caps.filter_info

get detailed info of a filter

ffmpegio.caps.codecs

get FFmpeg codecs

ffmpegio.caps.encoders

get summary of FFmpeg encoders

ffmpegio.caps.encoder_info

get detailed info of an encoder

ffmpegio.caps.decoders

get summary of FFmpeg decoders

ffmpegio.caps.decoder_info

get detailed info of a decoder

ffmpegio.caps.formats

get FFmpeg formats

ffmpegio.caps.muxers

get FFmpeg muxers

ffmpegio.caps.muxer_info

get detailed info of a media muxer

ffmpegio.caps.demuxers

get FFmpeg demuxers

ffmpegio.caps.demuxer_info

get detailed info of a media demuxer

ffmpegio.caps.bsfilters

get list of FFmpeg bitstream filters

ffmpegio.caps.bsfilter_info

get detailed info of a bitstream filter

ffmpegio.caps.devices

get FFmpeg devices

ffmpegio.caps.protocols

get list of supported protocols

Todo

Remaining commands to be wrapped: sources, sinks, h protocol, dispositions

List of Constants

ffmpegio.caps.video_size_presets

list of video size presets with their sizes

ffmpegio.caps.frame_rate_presets

list of video frame rate presets with their rates

Function References

ffmpegio.caps.options(type=None, name_only=False, return_desc=False)

get FFmpeg command options

Parameters:
  • type ("per-file"|"video"|"audio"|"subtitle"|"general"|"global"|None, optional) – specify option type to return, defaults to None

  • name_only (bool, optional) – True to only return option names, defaults to False

  • return_desc (bool, optional) – True to also return option description, defaults to False

Returns:

dict of types of options

Return type:

dict(dict or tuple) if type not specified

ffmpegio.caps.pix_fmts()

get supported pixel formats

Returns:

list of supported pixel formats

Return type:

dict

Each key of the returned dict is a name of a pix_fmt and its value is a dict with the following items:

Key

type

description

nb_components

int

Number of color components

bits_per_pixel

int

Number of bits per pixel

input

bool

True if can be used as an input option

output

bool

True if can be used as an output option

hw_accel

bool

True if supported by hardware accelerators

paletted

bool

True if uses paletted colors

bitstream

bool

True if can be used with bistreams

ffmpegio.caps.sample_fmts()

get supported audio sample formats

Returns:

list of supported audio sample formats

Return type:

dict

Each key of the returned dict is a name of a sample_fmt and its value is the number of bits per sample.

ffmpegio.caps.layouts()

get supported audio channel layouts

Returns:

list of supported audio channel layouts

Return type:

dict

Returned dict has two keys “channels” and “layouts”. The value of “channels” is a dict of possible channel names as keys and their descriptions as values. The value of “layouts” is also a dict, which keys specifies the names and their value strs indicate the combinations of channels (their names are “+”ed).

ffmpegio.caps.colors()

get recognized color names

Returns:

list of color names

Return type:

dict

The keys of the returned dict are the name of the colors and their values are the RGB hex strs.

ffmpegio.caps.filters(type=None)

get FFmpeg filters

Parameters:

type ('audio'|'video'|'dynamic', optional) – specify input or output stream type, defaults to None

Returns:

dict of summary of the filters

Return type:

dict(key,FilterSummary)

Each key of the returned dict is a name of a filter and its value is a FilterSummary namedtuple with the following items:

Key

type

description

description

str

Short description of the filter

input

str

Input stream type: ‘audio’|’video’|’dynamic’

num_inputs

int|None

Number of inputs or None if ‘dynamic’

output

str

Output stream type: ‘audio’|’video’|’dynamic’

num_outputs

int|None

Number of outputs or None if ‘dynamic’

timeline_support

bool

True if supports timeline editing

slice_threading

bool

True if supports threading

command_support

bool

True if supports command input from stdin

ffmpegio.caps.filter_info(name)

get detailed info of a filter

Returns:

list of features

Return type:

FilterInfo (namedtuple)

The returned FilterInfo named tuple has following entries:

Key

type

description

name

str

Name

description

str

Description

threading

list(str)

List of threading capabilities

inputs

list(dict)|str

List of input pads or ‘dynamic’ if variable

outputs

list(dict)|str

List of output pads or ‘dynamic’ if variable

options

list(FilterOption)

List of filter options

extra_options

dict(str,list(FilterOption))

Extra options co-listed

timeline_support

bool

True if enable timeline option is supported

‘inputs’ and ‘outputs’ entries has two keys: ‘name’ and ‘type’ defining the pad name and pad stream type (‘audio’ or ‘video’)

FilterOption is a namedtuple with the following entries:

Key

type

description

name

str

Name

alias

str

Alias name

type

str

Data type

help

str

Help text

ranges

list(tuple(any,any))|None

List of ranges of values

constants

dict(str:any)

List of defined constant/enum values

default

any

Default value

video

bool

True if option for video stream

audio

bool

True if option for audio stream

runtime

bool

True if modifiable during runtime

ffmpegio.caps.codecs(type=None, stream_type=None)

get FFmpeg codecs

Parameters:
  • type ('decoder'|'encoder', optional) – Specify to list only decoder or encoder, defaults to None

  • stream_type ('audio'|'video'|'subtitle', optional) – Specify to stream type, defaults to None

Returns:

summary of FFmpeg codecs

Return type:

dict

Each key of the returned dict is a name of a codec and its value is a dict with the following items:

Key

type

description

type

str

Stream type: ‘audio’|’video’|’subtitle’

description

str

Short description of the codec

can_decode

bool

True if FFmpeg can decode

decoders

list(str)

List of compatible decoders

can_encode

bool

True if FFmpeg can encode

encoders

list(str)

List of compatible encoders

intra_frame_only

bool

True if codec only uses intra-frame coding

is_lossy

bool

True if codec can do lossy compression

is_lossless

bool

True if codec can do lossless compression

ffmpegio.caps.encoders(type=None)

get summary of FFmpeg encoders

Parameters:

type ('audio'|'video'|'subtitle', optional) – specify stream type, defaults to None

Returns:

list of encoders

Return type:

dict

Each key of the returned dict is a name of a decoder or encoder and its value is a dict with the following items:

Key

type

description

type

str

Stream type: ‘audio’|’video’|’subtitle’

description

str

Short description of the coder

frame_mt

bool

True if employs frame-level multithreading

slice_mt

bool

True if employs slice-level multithreading

experimental

bool

True if experimental encoder

draw_horiz_band

bool

True if supports draw_horiz_band

directRendering

bool

True if supports direct encoding method 1

ffmpegio.caps.encoder_info(name)

get detailed info of an encoder

Returns:

list of features

Return type:

dict

The returned dict has following entries:

Key

type

description

name

list(str)

Short names

long_name

str

Long name

capabilities

list(str)

List of supported capabilities

threading

list(str)

List of threading capabilities

supported_hwdevices

list(str)

List of supported hardware accelerators

supported_framerates

list(Fraction)

List of supported video frame rates

supported_pix_fmts

list(str)

List of supported video pixel formats

supported_sample_rates

list(int)

List of supported audio sample rates

supported_sample_fmts

list(str)

List of supported audio sample formats

supported_layouts

list(str)

List of supported audio channel layouts

options

str

Unparsed string, listing supported options

ffmpegio.caps.decoders(type=None)

get summary of FFmpeg decoders

Parameters:

stream_type ('audio'|'video'|'subtitle', optional) – specify stream type, defaults to None

Returns:

list of decoders or encoders

Return type:

dict

Each key of the returned dict is a name of a decoder and its value is a dict with the following items:

Key

type

description

type

str

Stream type: ‘audio’|’video’|’subtitle’

description

str

Short description of the coder

frame_mt

bool

True if employs frame-level multithreading

slice_mt

bool

True if employs slice-level multithreading

experimental

bool

True if experimental encoder

draw_horiz_band

bool

True if supports draw_horiz_band

directRendering

bool

True if supports direct encoding method 1

ffmpegio.caps.decoder_info(name)

get detailed info of a decoder

Returns:

list of features

Return type:

dict

The returned dict has following entries:

Key

type

description

name

list(str)

Short names

long_name

str

Long name

capabilities

list(str)

List of supported capabilities

threading

list(str)

List of threading capabilities

supported_hwdevices

list(str)

List of supported hardware accelerators

supported_framerates

list(Fraction)

List of supported video frame rates

supported_pix_fmts

list(str)

List of supported video pixel formats

supported_sample_rates

list(int)

List of supported audio sample rates

supported_sample_fmts

list(str)

List of supported audio sample formats

supported_layouts

list(str)

List of supported audio channel layouts

options

str

Unparsed string, listing supported options

ffmpegio.caps.formats()

get FFmpeg formats

Returns:

list of formats

Return type:

dict

Each key of the returned dict is a name of a format and its value is a dict with the following items:

Key

type

description

description

str

Short description of the format

can_demux

bool

True if supports inputs of this format

can_mux

bool

True if support outputs of this format

ffmpegio.caps.muxers()

get FFmpeg muxers

Returns:

list of muxers

Return type:

dict

Each key of the returned dict is a name of a muxer and its value is a dict with the following items:

Key

type

description

description

str

Short description of the muxer

ffmpegio.caps.muxer_info(name)

get detailed info of a media muxer

Returns:

list of features

Return type:

dict

The returned dict has following entries:

Key

type

description

names

list(str)

List of compatible short names

long_name

str

Common long name

extensions

list(str)

List of associated common extensions (w/out ‘.’)

mime_types

list(str)

List of associated MIME types

video_codecs

list(str)

List of supported video codecs

audio_codecs

list(str)

List of supported audio codecs

subtitle_codecs

list(str)

List of supported subtitle codecs

options

str

Unparsed string, listing supported options

ffmpegio.caps.demuxers()

get FFmpeg demuxers

Returns:

list of demuxers

Return type:

dict

Each key of the returned dict is a name of a demuxer and its value is a dict with the following items:

Key

type

description

description

str

Short description of the demuxer

ffmpegio.caps.demuxer_info(name)

get detailed info of a media demuxer

Returns:

list of features

Return type:

dict

The returned dict has following entries:

Key

type

description

names

list(str)

List of compatible short names

long_name

str

Common long name

extensions

list(str)

List of associated common extensions (w/out ‘.’)

options

str

Unparsed string, listing supported options

ffmpegio.caps.bsfilters()

get list of FFmpeg bitstream filters

Returns:

list of bistream filters

Return type:

list(str)

ffmpegio.caps.bsfilter_info(name)

get detailed info of a bitstream filter

Returns:

list of features

Return type:

dict

The returned dict has following entries:

Key

type

description

name

str

Name

supported_codecs

str

List of supported codecs

options

str

Unparsed string, listing supported options

ffmpegio.caps.devices(type=None)

get FFmpeg devices

Parameters:

type ('source'|'sink', optional) – specify source or sink type, defaults to None

Returns:

list of devices

Return type:

dict

Each key of the returned dict is a name of a device and its value is a dict with the following items:

Key

type

description

description

str

Short description of the device

can_demux

bool

True if supports inputs of this format

can_mux

bool

True if support outputs of this format

ffmpegio.caps.protocols()

get list of supported protocols

Returns:

list of protocols

Return type:

dict

Returned dict has ‘input’ and ‘output’ keys and each contains a list of supported protocol names.