Skip to content

format

FFmpeg format options.

Classes:

Name Description
FFMpegAVFormatContextDecoderOption

AVFormatContext Decoder options.

FFMpegAVFormatContextEncoderOption

AVFormatContext Encoder options.

Functions:

Name Description
decoder_format_context

Decoder format context options.

encoder_format_context

Encoder format context options.

FFMpegAVFormatContextDecoderOption

Bases: FFMpegOptionGroup

AVFormatContext Decoder options.

FFMpegAVFormatContextEncoderOption

Bases: FFMpegOptionGroup

AVFormatContext Encoder options.

decoder_format_context

decoder_format_context(
    *,
    avioflags: str | None = None,
    probesize: int | None = None,
    formatprobesize: int | None = None,
    fflags: str | None = None,
    seek2any: bool | None = None,
    analyzeduration: int | None = None,
    cryptokey: str | None = None,
    indexmem: int | None = None,
    rtbufsize: int | None = None,
    fdebug: str | None = None,
    max_delay: int | None = None,
    fpsprobesize: int | None = None,
    f_err_detect: str | None = None,
    err_detect: str | None = None,
    use_wallclock_as_timestamps: bool | None = None,
    skip_initial_bytes: int | None = None,
    correct_ts_overflow: bool | None = None,
    f_strict: (
        int
        | None
        | Literal[
            "very",
            "strict",
            "normal",
            "unofficial",
            "experimental",
        ]
    ) = None,
    strict: (
        int
        | None
        | Literal[
            "very",
            "strict",
            "normal",
            "unofficial",
            "experimental",
        ]
    ) = None,
    max_ts_probe: int | None = None,
    dump_separator: str | None = None,
    codec_whitelist: str | None = None,
    format_whitelist: str | None = None,
    protocol_whitelist: str | None = None,
    protocol_blacklist: str | None = None,
    max_streams: int | None = None,
    skip_estimate_duration_from_pts: bool | None = None,
    max_probe_packets: int | None = None
) -> FFMpegAVFormatContextDecoderOption

Decoder format context options.

Parameters:

Name Type Description Default
avioflags str | None

(default 0),

None
probesize int | None

set probing size (from 32 to I64_MAX) (default 5000000),

None
formatprobesize int | None

number of bytes to probe file format (from 0 to 2.14748e+09) (default 1048576),

None
fflags str | None

(default autobsf),

None
seek2any bool | None

allow seeking to non-keyframes on demuxer level when supported (default false),

None
analyzeduration int | None

specify how many microseconds are analyzed to probe the input (from 0 to I64_MAX) (default 0),

None
cryptokey str | None

decryption key,

None
indexmem int | None

max memory used for timestamp index (per stream) (from 0 to INT_MAX) (default 1048576),

None
rtbufsize int | None

max memory used for buffering real-time frames (from 0 to INT_MAX) (default 3041280),

None
fdebug str | None

print specific debug info (default 0),

None
max_delay int | None

maximum muxing or demuxing delay in microseconds (from -1 to INT_MAX) (default -1),

None
fpsprobesize int | None

number of frames used to probe fps (from -1 to 2.14748e+09) (default -1),

None
f_err_detect str | None

set error detection flags (deprecated; use err_detect, save via avconv) (default crccheck),

None
err_detect str | None

set error detection flags (default crccheck),

None
use_wallclock_as_timestamps bool | None

use wallclock as timestamps (default false),

None
skip_initial_bytes int | None

set number of bytes to skip before reading header and frames (from 0 to I64_MAX) (default 0),

None
correct_ts_overflow bool | None

correct single timestamp overflows (default true),

None
f_strict int | None | Literal['very', 'strict', 'normal', 'unofficial', 'experimental']

how strictly to follow the standards (deprecated; use strict, save via avconv) (from INT_MIN to INT_MAX) (default normal),

None
strict int | None | Literal['very', 'strict', 'normal', 'unofficial', 'experimental']

how strictly to follow the standards (from INT_MIN to INT_MAX) (default normal),

None
max_ts_probe int | None

maximum number of packets to read while waiting for the first timestamp (from 0 to INT_MAX) (default 50),

None
dump_separator str | None

set information dump field separator (default ", "),

None
codec_whitelist str | None

List of decoders that are allowed to be used,

None
format_whitelist str | None

List of demuxers that are allowed to be used,

None
protocol_whitelist str | None

List of protocols that are allowed to be used,

None
protocol_blacklist str | None

List of protocols that are not allowed to be used,

None
max_streams int | None

maximum number of streams (from 0 to INT_MAX) (default 1000),

None
skip_estimate_duration_from_pts bool | None

skip duration calculation in estimate_timings_from_pts (default false),

None
max_probe_packets int | None

Maximum number of packets to probe a codec (from 0 to INT_MAX) (default 2500),

None

Returns:

Type Description
FFMpegAVFormatContextDecoderOption

FFMpegAVFormatContextDecoderOption

encoder_format_context

encoder_format_context(
    *,
    avioflags: str | None = None,
    packetsize: int | None = None,
    fflags: str | None = None,
    fdebug: str | None = None,
    max_delay: int | None = None,
    start_time_realtime: int | None = None,
    audio_preload: int | None = None,
    chunk_duration: int | None = None,
    chunk_size: int | None = None,
    flush_packets: int | None = None,
    metadata_header_padding: int | None = None,
    output_ts_offset: str | None = None,
    max_interleave_delta: int | None = None,
    f_strict: (
        int
        | None
        | Literal[
            "very",
            "strict",
            "normal",
            "unofficial",
            "experimental",
        ]
    ) = None,
    strict: (
        int
        | None
        | Literal[
            "very",
            "strict",
            "normal",
            "unofficial",
            "experimental",
        ]
    ) = None,
    avoid_negative_ts: (
        int
        | None
        | Literal[
            "auto",
            "disabled",
            "make_non_negative",
            "make_zero",
        ]
    ) = None,
    dump_separator: str | None = None
) -> FFMpegAVFormatContextEncoderOption

Encoder format context options.

Parameters:

Name Type Description Default
avioflags str | None

(default 0),

None
packetsize int | None

set packet size (from 0 to INT_MAX) (default 0),

None
fflags str | None

(default autobsf),

None
fdebug str | None

print specific debug info (default 0),

None
max_delay int | None

maximum muxing or demuxing delay in microseconds (from -1 to INT_MAX) (default -1),

None
start_time_realtime int | None

wall-clock time when stream begins (PTS==0) (from I64_MIN to I64_MAX) (default I64_MIN),

None
audio_preload int | None

microseconds by which audio packets should be interleaved earlier (from 0 to 2.14748e+09) (default 0),

None
chunk_duration int | None

microseconds for each chunk (from 0 to 2.14748e+09) (default 0),

None
chunk_size int | None

size in bytes for each chunk (from 0 to 2.14748e+09) (default 0),

None
flush_packets int | None

enable flushing of the I/O context after each packet (from -1 to 1) (default -1),

None
metadata_header_padding int | None

set number of bytes to be written as padding in a metadata header (from -1 to INT_MAX) (default -1),

None
output_ts_offset str | None

set output timestamp offset (default 0),

None
max_interleave_delta int | None

maximum buffering duration for interleaving (from 0 to I64_MAX) (default 10000000),

None
f_strict int | None | Literal['very', 'strict', 'normal', 'unofficial', 'experimental']

how strictly to follow the standards (deprecated; use strict, save via avconv) (from INT_MIN to INT_MAX) (default normal),

None
strict int | None | Literal['very', 'strict', 'normal', 'unofficial', 'experimental']

how strictly to follow the standards (from INT_MIN to INT_MAX) (default normal),

None
avoid_negative_ts int | None | Literal['auto', 'disabled', 'make_non_negative', 'make_zero']

shift timestamps so they start at 0 (from -1 to 2) (default auto),

None
dump_separator str | None

set information dump field separator (default ", "),

None

Returns:

Type Description
FFMpegAVFormatContextEncoderOption

FFMpegAVFormatContextEncoderOption