Skip to content

global_args

Global arguments.

Classes:

Name Description
GlobalArgs

Abstract base class for providing global FFmpeg command-line arguments.

GlobalArgs

Bases: ABC

Abstract base class for providing global FFmpeg command-line arguments.

This class defines an interface for setting global options that apply to the entire FFmpeg command. These options control the general behavior of FFmpeg such as logging levels, overwrite behavior, thread usage, and hardware acceleration.

Implementers must define the _global_node abstract method to apply these arguments to actual FFmpeg command execution.

Methods:

Name Description
global_args

Set global options.

global_args

global_args(
    *,
    loglevel: Func = None,
    v: Func = None,
    report: Func = None,
    max_alloc: Func = None,
    cpuflags: Func = None,
    cpucount: Func = None,
    hide_banner: Func = None,
    y: Func = None,
    n: Func = None,
    ignore_unknown: Func = None,
    copy_unknown: Func = None,
    recast_media: Func = None,
    benchmark: Func = None,
    benchmark_all: Func = None,
    progress: Func = None,
    stdin: Func = None,
    timelimit: Func = None,
    dump: Func = None,
    hex: Func = None,
    vsync: Func = None,
    frame_drop_threshold: Func = None,
    adrift_threshold: Func = None,
    copyts: Func = None,
    start_at_zero: Func = None,
    copytb: Func = None,
    dts_delta_threshold: Func = None,
    dts_error_threshold: Func = None,
    xerror: Func = None,
    abort_on: Func = None,
    filter_threads: Func = None,
    filter_complex: Func = None,
    filter_complex_threads: Func = None,
    lavfi: Func = None,
    filter_complex_script: Func = None,
    auto_conversion_filters: Func = None,
    stats: Func = None,
    stats_period: Func = None,
    debug_ts: Func = None,
    max_error_rate: Func = None,
    psnr: Func = None,
    vstats: Func = None,
    vstats_file: Func = None,
    vstats_version: Func = None,
    qphist: Func = None,
    vaapi_device: Func = None,
    init_hw_device: Func = None,
    filter_hw_device: Func = None,
    extra_options: dict[str, Any] | None = None
) -> GlobalStream

Set global options.

Parameters:

Name Type Description Default
loglevel Func

set logging level

None
v Func

set logging level

None
report Func

generate a report

None
max_alloc Func

set maximum size of a single allocated block

None
cpuflags Func

force specific cpu flags

None
cpucount Func

force specific cpu count

None
hide_banner Func

do not show program banner

None
y Func

overwrite output files

None
n Func

never overwrite output files

None
ignore_unknown Func

Ignore unknown stream types

None
copy_unknown Func

Copy unknown stream types

None
recast_media Func

allow recasting stream type in order to force a decoder of different media type

None
benchmark Func

add timings for benchmarking

None
benchmark_all Func

add timings for each task

None
progress Func

write program-readable progress information

None
stdin Func

enable or disable interaction on standard input

None
timelimit Func

set max runtime in seconds in CPU user time

None
dump Func

dump each input packet

None
hex Func

when dumping packets, also dump the payload

None
vsync Func

set video sync method globally; deprecated, use -fps_mode

None
frame_drop_threshold Func

frame drop threshold

None
adrift_threshold Func

deprecated, does nothing

None
copyts Func

copy timestamps

None
start_at_zero Func

shift input timestamps to start at 0 when using copyts

None
copytb Func

copy input stream time base when stream copying

None
dts_delta_threshold Func

timestamp discontinuity delta threshold

None
dts_error_threshold Func

timestamp error delta threshold

None
xerror Func

exit on error

None
abort_on Func

abort on the specified condition flags

None
filter_threads Func

number of non-complex filter threads

None
filter_complex Func

create a complex filtergraph

None
filter_complex_threads Func

number of threads for -filter_complex

None
lavfi Func

create a complex filtergraph

None
filter_complex_script Func

read complex filtergraph description from a file

None
auto_conversion_filters Func

enable automatic conversion filters globally

None
stats Func

print progress report during encoding

None
stats_period Func

set the period at which ffmpeg updates stats and -progress output

None
debug_ts Func

print timestamp debugging info

None
max_error_rate Func

ratio of decoding errors (0.0: no errors, 1.0: 100% errors) above which ffmpeg returns an error instead of success.

None
psnr Func

calculate PSNR of compressed frames (deprecated, use -flags +psnr)

None
vstats Func

dump video coding statistics to file

None
vstats_file Func

dump video coding statistics to file

None
vstats_version Func

Version of the vstats format to use.

None
qphist Func

deprecated, does nothing

None
vaapi_device Func

set VAAPI hardware device (DirectX adapter index, DRM path or X11 display name)

None
init_hw_device Func

initialise hardware device

None
filter_hw_device Func

set hardware device used when filtering

None
extra_options dict[str, Any] | None

Additional options

None

Returns:

Name Type Description
GlobalStream GlobalStream

GlobalStream instance