ffprobe 文档编制


内容表

1 梗概

ffprobe [ options ] [‘ input_url ’]

2 描述

ffprobe 从多媒体流聚集信息,并以人类和机器可读方式打印它。

For example it can be used to check the format of the container used by a multimedia stream and the format and type of each media stream contained in it.

If a url is specified in input, ffprobe will try to open and probe the url content. If the url cannot be opened or recognized as a multimedia file, a positive exit code is returned.

ffprobe may be employed both as a standalone application or in combination with a textual filter, which may perform more sophisticated processing, e.g. statistical processing or plotting.

Options are used to list some of the formats supported by ffprobe or for specifying which information to display, and for setting how ffprobe will show it.

ffprobe output is designed to be easily parsable by a textual filter, and consists of one or more sections of a form defined by the selected writer, which is specified by the ‘ print_format ’ option.

Sections may contain other nested sections, and are identified by a name (which may be shared by other sections), and an unique name. See the output of ‘ sections ’.

Metadata tags stored in the container or in the streams are recognized and printed in the corresponding "FORMAT", "STREAM" or "PROGRAM_STREAM" section.

3 选项

All the numerical options, if not specified otherwise, accept a string representing a number as input, which may be followed by one of the SI unit prefixes, for example: ’K’, ’M’, or ’G’.

If ’i’ is appended to the SI unit prefix, the complete prefix will be interpreted as a unit prefix for binary multiples, which are based on powers of 1024 instead of powers of 1000. Appending ’B’ to the SI unit prefix multiplies the value by 8. This allows using, for example: ’KB’, ’MiB’, ’G’ and ’B’ as number suffixes.

Options which do not take arguments are boolean options, and set the corresponding value to true. They can be set to false by prefixing the option name with "no". For example using "-nofoo" will set the boolean option with name "foo" to false.

3.1 Stream specifiers

Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers are used to precisely specify which stream(s) a given option belongs to.

A stream specifier is a string generally appended to the option name and separated from it by a colon. E.g. -codec:a:1 ac3 contains the a:1 stream specifier, which matches the second audio stream. Therefore, it would select the ac3 codec for the second audio stream.

A stream specifier can match several streams, so that the option is applied to all of them. E.g. the stream specifier in -b:a 128k matches all audio streams.

An empty stream specifier matches all streams. For example, -codec copy -codec: copy would copy all the streams without reencoding.

Possible forms of stream specifiers are:

stream_index

Matches the stream with this index. E.g. -threads:1 4 would set the thread count for the second stream to 4. If stream_index is used as an additional stream specifier (see below), then it selects stream number stream_index from the matching streams. Stream numbering is based on the order of the streams as detected by libavformat except when a program ID is also specified. In this case it is based on the ordering of the streams in the program.

stream_type [: additional_stream_specifier ]

stream_type is one of following: ’v’ or ’V’ for video, ’a’ for audio, ’s’ for subtitle, ’d’ for data, and ’t’ for attachments. ’v’ matches all video streams, ’V’ only matches video streams which are not attached pictures, video thumbnails or cover arts. If additional_stream_specifier is used, then it matches streams which both have this type and match the additional_stream_specifier . Otherwise, it matches all streams of the specified type.

p: program_id [: additional_stream_specifier ]

Matches streams which are in the program with the id program_id . If additional_stream_specifier is used, then it matches streams which both are part of the program and match the additional_stream_specifier .

# stream_id or i: stream_id

Match the stream by stream id (e.g. PID in MPEG-TS container).

m: key [: value ]

Matches streams with the metadata tag key having the specified value. If value is not given, matches streams that contain the given tag with any value.

u

Matches streams with usable configuration, the codec must be defined and the essential information such as video dimension or audio sample rate must be present.

Note that in ffmpeg , matching by metadata will only work properly for input files.

3.2 一般选项

These options are shared amongst the ff* tools.

-L

展示许可。

-h, -?, -help, --help [ arg ]

Show help. An optional parameter may be specified to print help about a specific item. If no argument is specified, only basic (non advanced) tool options are shown.

Possible values of arg are:

long

Print advanced tool options in addition to the basic tool options.

full

Print complete list of options, including shared and private options for encoders, decoders, demuxers, muxers, filters, etc.

decoder= decoder_name

Print detailed information about the decoder named decoder_name . Use the ‘ -decoders ’ option to get a list of all decoders.

encoder= encoder_name

Print detailed information about the encoder named encoder_name . Use the ‘ -encoders ’ option to get a list of all encoders.

demuxer= demuxer_name

Print detailed information about the demuxer named demuxer_name . Use the ‘ -formats ’ option to get a list of all demuxers and muxers.

muxer= muxer_name

Print detailed information about the muxer named muxer_name . Use the ‘ -formats ’ option to get a list of all muxers and demuxers.

filter= filter_name

Print detailed information about the filter name filter_name . Use the ‘ -filters ’ option to get a list of all filters.

bsf= bitstream_filter_name

Print detailed information about the bitstream filter name bitstream_filter_name . Use the ‘ -bsfs ’ option to get a list of all bitstream filters.

-version

Show version.

-formats

Show available formats (including devices).

-demuxers

Show available demuxers.

-muxers

Show available muxers.

-devices

Show available devices.

-codecs

Show all codecs known to libavcodec.

Note that the term ’codec’ is used throughout this documentation as a shortcut for what is more correctly called a media bitstream format.

-decoders

Show available decoders.

-encoders

Show all available encoders.

-bsfs

Show available bitstream filters.

-protocols

Show available protocols.

-filters

Show available libavfilter filters.

-pix_fmts

Show available pixel formats.

-sample_fmts

Show available sample formats.

-layouts

Show channel names and standard channel layouts.

-colors

Show recognized color names.

-sources device [, opt1 = val1 [, opt2 = val2 ]...]

Show autodetected sources of the input device. Some devices may provide system-dependent source names that cannot be autodetected. The returned list cannot be assumed to be always complete.

ffmpeg -sources pulse,server=192.168.0.4
                                
-sinks device [, opt1 = val1 [, opt2 = val2 ]...]

Show autodetected sinks of the output device. Some devices may provide system-dependent sink names that cannot be autodetected. The returned list cannot be assumed to be always complete.

ffmpeg -sinks pulse,server=192.168.0.4
                                
-loglevel [ flags +] loglevel | -v [ flags +] loglevel

Set logging level and flags used by the library.

The optional flags prefix can consist of the following values:

repeat

Indicates that repeated log output should not be compressed to the first line and the "Last message repeated n times" line will be omitted.

level

Indicates that log output should add a [level] prefix to each message line. This can be used as an alternative to log coloring, e.g. when dumping the log to file.

Flags can also be used alone by adding a ’+’/’-’ prefix to set/reset a single flag without affecting other flags or changing loglevel . When setting both flags and loglevel , a ’+’ separator is expected between the last flags value and before loglevel .

loglevel is a string or a number containing one of the following values:

quiet, -8

Show nothing at all; be silent.

panic, 0

Only show fatal errors which could lead the process to crash, such as an assertion failure. This is not currently used for anything.

fatal, 8

Only show fatal errors. These are errors after which the process absolutely cannot continue.

error, 16

Show all errors, including ones which can be recovered from.

warning, 24

Show all warnings and errors. Any message related to possibly incorrect or unexpected events will be shown.

info, 32

Show informative messages during processing. This is in addition to warnings and errors. This is the default value.

verbose, 40

如同 info , except more verbose.

debug, 48

Show everything, including debugging information.

trace, 56

For example to enable repeated log output, add the level prefix, and set loglevel to verbose :

ffmpeg -loglevel repeat+level+verbose -i input output
                                

Another example that enables repeated log output without affecting current state of level prefix flag or loglevel :

ffmpeg [...] -loglevel +repeat
                                

By default the program logs to stderr. If coloring is supported by the terminal, colors are used to mark errors and warnings. Log coloring can be disabled setting the environment variable AV_LOG_FORCE_NOCOLOR NO_COLOR , or can be forced setting the environment variable AV_LOG_FORCE_COLOR . The use of the environment variable NO_COLOR is deprecated and will be dropped in a future FFmpeg version.

-report

Dump full command line and console output to a file named program - YYYYMMDD - HHMMSS .log in the current directory. This file can be useful for bug reports. It also implies -loglevel debug .

Setting the environment variable FFREPORT to any value has the same effect. If the value is a ’:’-separated key=value sequence, these options will affect the report; option values must be escaped if they contain special characters or the options delimiter ’:’ (see the “Quoting and escaping” section in the ffmpeg-utils manual).

The following options are recognized:

file

set the file name to use for the report; %p is expanded to the name of the program, %t is expanded to a timestamp, %% is expanded to a plain %

level

set the log verbosity level using a numerical value (see -loglevel ).

For example, to output a report to a file named ‘ ffreport.log ’ using a log level of 32 (alias for log level info ):

FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
                                

Errors in parsing the environment variable are not fatal, and will not appear in the report.

-hide_banner

抑制打印横幅。

All FFmpeg tools will normally show a copyright notice, build options and library versions. This option can be used to suppress printing this information.

-cpuflags flags ( global )

Allows setting and clearing cpu flags. This option is intended for testing. Do not use it unless you know what you’re doing.

ffmpeg -cpuflags -sse+mmx ...
ffmpeg -cpuflags mmx ...
ffmpeg -cpuflags 0 ...
                                

Possible flags for this option are:

x86
mmx
mmxext
sse
sse2
sse2slow
sse3
sse3slow
ssse3
atom
sse4.1
sse4.2
avx
avx2
xop
fma3
fma4
3dnow
3dnowext
bmi1
bmi2
cmov
ARM
armv5te
armv6
armv6t2
vfp
vfpv3
neon
setend
AArch64
armv8
vfp
neon
PowerPC
altivec
Specific Processors
pentium2
pentium3
pentium4
k6
k62
athlon
athlonxp
k8

3.3 AVOptions

These options are provided directly by the libavformat, libavdevice and libavcodec libraries. To see the list of available AVOptions, use the ‘ -help ’ option. They are separated into two categories:

generic

These options can be set for any container, codec or device. Generic options are listed under AVFormatContext options for containers/devices and under AVCodecContext options for codecs.

private

These options are specific to the given container, device or codec. Private options are listed under their corresponding containers/devices/codecs.

For example to write an ID3v2.3 header instead of a default ID3v2.4 to an MP3 file, use the ‘ id3v2_version ’ private option of the MP3 muxer:

ffmpeg -i input.flac -id3v2_version 3 out.mp3
                        

All codec AVOptions are per-stream, and thus a stream specifier should be attached to them:

ffmpeg -i multichannel.mxf -map 0:v:0 -map 0:a:0 -map 0:a:0 -c:a:0 ac3 -b:a:0 640k -ac:a:1 2 -c:a:1 aac -b:2 128k out.mp4
                        

In the above example, a multichannel audio stream is mapped twice for output. The first instance is encoded with codec ac3 and bitrate 640k. The second instance is downmixed to 2 channels and encoded with codec aac. A bitrate of 128k is specified for it using absolute index of the output stream.

Note: the ‘ -nooption ’ syntax cannot be used for boolean AVOptions, use ‘ -option 0 ’/‘ -option 1 ’.

Note: the old undocumented way of specifying per-stream AVOptions by prepending v/a/s to the options name is now obsolete and will be removed soon.

3.4 Main options

-f format

Force format to use.

-unit

Show the unit of the displayed values.

-prefix

Use SI prefixes for the displayed values. Unless the "-byte_binary_prefix" option is used all the prefixes are decimal.

-byte_binary_prefix

Force the use of binary prefixes for byte values.

-sexagesimal

Use sexagesimal format HH:MM:SS.MICROSECONDS for time values.

-pretty

Prettify the format of the displayed values, it corresponds to the options "-unit -prefix -byte_binary_prefix -sexagesimal".

-of, -print_format writer_name [= writer_options ]

Set the output printing format.

writer_name specifies the name of the writer, and writer_options specifies the options to be passed to the writer.

For example for printing the output in JSON format, specify:

-print_format json
                                

For more details on the available output printing formats, see the Writers section below.

-sections

Print sections structure and section information, and exit. The output is not meant to be parsed by a machine.

-select_streams stream_specifier

Select only the streams specified by stream_specifier . This option affects only the options related to streams (e.g. show_streams , show_packets , etc.).

For example to show only audio streams, you can use the command:

ffprobe -show_streams -select_streams a INPUT
                                

To show only video packets belonging to the video stream with index 1:

ffprobe -show_packets -select_streams v:1 INPUT
                                
-show_data

Show payload data, as a hexadecimal and ASCII dump. Coupled with ‘ -show_packets ’, it will dump the packets’ data. Coupled with ‘ -show_streams ’, it will dump the codec extradata.

The dump is printed as the "data" field. It may contain newlines.

-show_data_hash algorithm

Show a hash of payload data, for packets with ‘ -show_packets ’ and for codec extradata with ‘ -show_streams ’.

-show_error

Show information about the error found when trying to probe the input.

The error information is printed within a section with name "ERROR".

-show_format

Show information about the container format of the input multimedia stream.

All the container format information is printed within a section with name "FORMAT".

-show_format_entry name

Like ‘ -show_format ’, but only prints the specified entry of the container format information, rather than all. This option may be given more than once, then all specified entries will be shown.

This option is deprecated, use show_entries 代替。

-show_entries section_entries

Set list of entries to show.

Entries are specified according to the following syntax. section_entries contains a list of section entries separated by : . Each section entry is composed by a section name (or unique name), optionally followed by a list of entries local to that section, separated by , .

If section name is specified but is followed by no = , all entries are printed to output, together with all the contained sections. Otherwise only the entries specified in the local section entries list are printed. In particular, if = is specified but the list of local entries is empty, then no entries will be shown for that section.

Note that the order of specification of the local section entries is not honored in the output, and the usual display order will be retained.

The formal syntax is given by:

LOCAL_SECTION_ENTRIES ::= SECTION_ENTRY_NAME[,LOCAL_SECTION_ENTRIES]
SECTION_ENTRY         ::= SECTION_NAME[=[LOCAL_SECTION_ENTRIES]]
SECTION_ENTRIES       ::= SECTION_ENTRY[:SECTION_ENTRIES]
                                

For example, to show only the index and type of each stream, and the PTS time, duration time, and stream index of the packets, you can specify the argument:

packet=pts_time,duration_time,stream_index : stream=index,codec_type
                                

To show all the entries in the section "format", but only the codec type in the section "stream", specify the argument:

format : stream=codec_type
                                

To show all the tags in the stream and format sections:

stream_tags : format_tags
                                

To show only the title tag (if available) in the stream sections:

stream_tags=title
                                
-show_packets

Show information about each packet contained in the input multimedia stream.

The information for each single packet is printed within a dedicated section with name "PACKET".

-show_frames

Show information about each frame and subtitle contained in the input multimedia stream.

The information for each single frame is printed within a dedicated section with name "FRAME" or "SUBTITLE".

-show_log loglevel

Show logging information from the decoder about each frame according to the value set in loglevel , (see -loglevel ). This option requires -show_frames .

The information for each log message is printed within a dedicated section with name "LOG".

-show_streams

Show information about each media stream contained in the input multimedia stream.

Each media stream information is printed within a dedicated section with name "STREAM".

-show_programs

Show information about programs and their streams contained in the input multimedia stream.

Each media stream information is printed within a dedicated section with name "PROGRAM_STREAM".

-show_chapters

Show information about chapters stored in the format.

Each chapter is printed within a dedicated section with name "CHAPTER".

-count_frames

Count the number of frames per stream and report it in the corresponding stream section.

-count_packets

Count the number of packets per stream and report it in the corresponding stream section.

-read_intervals read_intervals

Read only the specified intervals. read_intervals must be a sequence of interval specifications separated by ",". ffprobe will seek to the interval starting point, and will continue reading from that.

Each interval is specified by two optional parts, separated by "%".

The first part specifies the interval start position. It is interpreted as an absolute position, or as a relative offset from the current position if it is preceded by the "+" character. If this first part is not specified, no seeking will be performed when reading this interval.

The second part specifies the interval end position. It is interpreted as an absolute position, or as a relative offset from the current position if it is preceded by the "+" character. If the offset specification starts with "#", it is interpreted as the number of packets to read (not including the flushing packets) from the interval start. If no second part is specified, the program will read until the end of the input.

Note that seeking is not accurate, thus the actual interval start point may be different from the specified position. Also, when an interval duration is specified, the absolute end time will be computed by adding the duration to the interval start point found by seeking the file, rather than to the specified start value.

The formal syntax is given by:

INTERVAL  ::= [START|+START_OFFSET][%[END|+END_OFFSET]]
INTERVALS ::= INTERVAL[,INTERVALS]
                                

A few examples follow.

  • Seek to time 10, read packets until 20 seconds after the found seek point, then seek to position 01:30 (1 minute and thirty seconds) and read packets until position 01:45 .
    10%+20,01:30%01:45
                                            
  • Read only 42 packets after seeking to position 01:23 :
    01:23%+#42
                                            
  • Read only the first 20 seconds from the start:
    %+20
                                            
  • Read from the start until position 02:30 :
    %02:30
                                            
-show_private_data, -private

Show private data, that is data depending on the format of the particular shown element. This option is enabled by default, but you may need to disable it for specific uses, for example when creating XSD-compliant XML output.

-show_program_version

Show information related to program version.

Version information is printed within a section with name "PROGRAM_VERSION".

-show_library_versions

Show information related to library versions.

Version information for each library is printed within a section with name "LIBRARY_VERSION".

-show_versions

Show information related to program and library versions. This is the equivalent of setting both ‘ -show_program_version ’ and ‘ -show_library_versions ’ options.

-show_pixel_formats

Show information about all pixel formats supported by FFmpeg.

Pixel format information for each format is printed within a section with name "PIXEL_FORMAT".

-bitexact

Force bitexact output, useful to produce output which is not dependent on the specific build.

-i input_url

input_url .

4 Writers

A writer defines the output format adopted by ffprobe , and will be used for printing all the parts of the output.

A writer may accept one or more arguments, which specify the options to adopt. The options are specified as a list of key = value pairs, separated by ":".

All writers support the following options:

string_validation, sv

Set string validation mode.

The following values are accepted.

fail

The writer will fail immediately in case an invalid string (UTF-8) sequence or code point is found in the input. This is especially useful to validate input metadata.

ignore

Any validation error will be ignored. This will result in possibly broken output, especially with the json or xml writer.

replace

The writer will substitute invalid UTF-8 sequences or code points with the string specified with the ‘ string_validation_replacement ’.

Default value is ‘ replace ’.

string_validation_replacement, svr

Set replacement string to use in case ‘ string_validation ’ is set to ‘ replace ’.

In case the option is not specified, the writer will assume the empty string, that is it will remove the invalid sequences from the input strings.

A description of the currently available writers follows.

4.1 default

Default format.

Print each section in the form:

[SECTION]
key1=val1
...
keyN=valN
[/SECTION]
                        

Metadata tags are printed as a line in the corresponding FORMAT, STREAM or PROGRAM_STREAM section, and are prefixed by the string "TAG:".

A description of the accepted options follows.

nokey, nk

If set to 1 specify not to print the key of each field. Default value is 0.

noprint_wrappers, nw

If set to 1 specify not to print the section header and footer. Default value is 0.

4.2 compact, csv

Compact and CSV format.

The csv writer is equivalent to compact , but supports different defaults.

Each section is printed on a single line. If no option is specified, the output has the form:

section|key1=val1| ... |keyN=valN
                        

Metadata tags are printed in the corresponding "format" or "stream" section. A metadata tag key, if printed, is prefixed by the string "tag:".

The description of the accepted options follows.

item_sep, s

Specify the character to use for separating fields in the output line. It must be a single printable character, it is "|" by default ("," for the csv writer).

nokey, nk

If set to 1 specify not to print the key of each field. Its default value is 0 (1 for the csv writer).

escape, e

Set the escape mode to use, default to "c" ("csv" for the csv writer).

It can assume one of the following values:

c

Perform C-like escaping. Strings containing a newline (‘ \n ’), carriage return (‘ \r ’), a tab (‘ \t ’), a form feed (‘ \f ’), the escaping character (‘ \ ’) or the item separator character SEP are escaped using C-like fashioned escaping, so that a newline is converted to the sequence ‘ \n ’, a carriage return to ‘ \r ’, ‘ \ ’ to ‘ \\ ’ and the separator SEP is converted to ‘ \ SEP ’.

csv

Perform CSV-like escaping, as described in RFC4180. Strings containing a newline (‘ \n ’), a carriage return (‘ \r ’), a double quote (‘ " ’), or SEP are enclosed in double-quotes.

none

Perform no escaping.

print_section, p

Print the section name at the beginning of each line if the value is 1 , disable it with value set to 0 . Default value is 1 .

4.3 flat

Flat format.

A free-form output where each line contains an explicit key=value, such as "streams.stream.3.tags.foo=bar". The output is shell escaped, so it can be directly embedded in sh scripts as long as the separator character is an alphanumeric character or an underscore (see sep_char option).

The description of the accepted options follows.

sep_char, s

Separator character used to separate the chapter, the section name, IDs and potential tags in the printed field key.

Default value is ‘ . ’.

hierarchical, h

Specify if the section name specification should be hierarchical. If set to 1, and if there is more than one section in the current chapter, the section name will be prefixed by the name of the chapter. A value of 0 will disable this behavior.

Default value is 1.

4.4 ini

INI format output.

Print output in an INI based format.

The following conventions are adopted:

  • all key and values are UTF-8
  • . ’ is the subgroup separator
  • newline, ‘ \t ’, ‘ \f ’, ‘ \b ’ and the following characters are escaped
  • \ ’ is the escape character
  • # ’ is the comment indicator
  • = ’ is the key/value separator
  • : ’ is not used but usually parsed as key/value separator

This writer accepts options as a list of key = value pairs, separated by ‘ : ’.

The description of the accepted options follows.

hierarchical, h

Specify if the section name specification should be hierarchical. If set to 1, and if there is more than one section in the current chapter, the section name will be prefixed by the name of the chapter. A value of 0 will disable this behavior.

Default value is 1.

4.5 json

JSON based format.

Each section is printed using JSON notation.

The description of the accepted options follows.

compact, c

If set to 1 enable compact output, that is each section will be printed on a single line. Default value is 0.

For more information about JSON, see http://www.json.org/ .

4.6 xml

XML based format.

The XML output is described in the XML schema description file ‘ ffprobe.xsd ’ installed in the FFmpeg datadir.

An updated version of the schema can be retrieved at the url http://www.ffmpeg.org/schema/ffprobe.xsd , which redirects to the latest schema committed into the FFmpeg development source code tree.

Note that the output issued will be compliant to the ‘ ffprobe.xsd ’ schema only when no special global output options (‘ unit ’, ‘ prefix ’, ‘ byte_binary_prefix ’, ‘ sexagesimal ’ etc.) are specified.

The description of the accepted options follows.

fully_qualified, q

If set to 1 specify if the output should be fully qualified. Default value is 0. This is required for generating an XML file which can be validated through an XSD file.

xsd_strict, x

If set to 1 perform more checks for ensuring that the output is XSD compliant. Default value is 0. This option automatically sets ‘ fully_qualified ’ to 1.

For more information about the XML format, see https://www.w3.org/XML/ .

5 Timecode

ffprobe supports Timecode extraction:

  • MPEG1/2 timecode is extracted from the GOP, and is available in the video stream details (‘ -show_streams ’, see timecode ).
  • MOV timecode is extracted from tmcd track, so is available in the tmcd stream metadata (‘ -show_streams ’, see TAG:timecode ).
  • DV, GXF and AVI timecodes are available in format metadata (‘ -show_format ’, see TAG:timecode ).

6 Syntax

This section documents the syntax and formats employed by the FFmpeg libraries and tools.

6.1 Quoting and escaping

FFmpeg adopts the following quoting and escaping mechanism, unless explicitly specified. The following rules are applied:

  • ' ’ and ‘ \ ’ are special characters (respectively used for quoting and escaping). In addition to them, there might be other special characters depending on the specific syntax where the escaping and quoting are employed.
  • A special character is escaped by prefixing it with a ‘ \ ’.
  • All characters enclosed between ‘ '' ’ are included literally in the parsed string. The quote character ‘ ' ’ itself cannot be quoted, so you may need to close the quote and escape it.
  • Leading and trailing whitespaces, unless escaped or quoted, are removed from the parsed string.

Note that you may need to add a second level of escaping when using the command line or a script, which depends on the syntax of the adopted shell language.

The function av_get_token defined in ‘ libavutil/avstring.h ’ can be used to parse a token quoted or escaped according to the rules defined above.

The tool ‘ tools/ffescape ’ in the FFmpeg source tree can be used to automatically quote or escape a string in a script.

6.1.1 Examples

  • Escape the string Crime d'Amour containing the ' special character:
    Crime d\'Amour
                                    
  • The string above contains a quote, so the ' needs to be escaped when quoting it:
    'Crime d'\''Amour'
                                    
  • Include leading or trailing whitespaces using quoting:
    '  this string starts and ends with whitespaces  '
                                    
  • Escaping and quoting can be mixed together:
    ' The string '\'string\'' is a string '
                                    
  • To include a literal ‘ \ ’ you can use either escaping or quoting:
    'c:\foo' can be written as c:\\foo
                                    

6.2 Date

The accepted syntax is:

[(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
now
                        

If the value is "now" it takes the current time.

Time is local time unless Z is appended, in which case it is interpreted as UTC. If the year-month-day part is not specified it takes the current year-month-day.

6.3 Time duration

There are two accepted syntaxes for expressing time duration.

[-][HH:]MM:SS[.m...]
                        

HH expresses the number of hours, MM the number of minutes for a maximum of 2 digits, and SS the number of seconds for a maximum of 2 digits. The m at the end expresses decimal value for SS .

[-]S+[.m...]
                        

S expresses the number of seconds, with the optional decimal part m .

In both expressions, the optional ‘ - ’ indicates negative duration.

6.3.1 Examples

The following examples are all valid time duration:

55

55 seconds

12:03:45

12 hours, 03 minutes and 45 seconds

23.189

23.189 seconds

6.4 Video size

Specify the size of the sourced video, it may be a string of the form width x height , or the name of a size abbreviation.

The following abbreviations are recognized:

ntsc

720x480

pal

720x576

qntsc

352x240

qpal

352x288

sntsc

640x480

spal

768x576

film

352x240

ntsc-film

352x240

sqcif

128x96

qcif

176x144

cif

352x288

4cif

704x576

16cif

1408x1152

qqvga

160x120

qvga

320x240

vga

640x480

svga

800x600

xga

1024x768

uxga

1600x1200

qxga

2048x1536

sxga

1280x1024

qsxga

2560x2048

hsxga

5120x4096

wvga

852x480

wxga

1366x768

wsxga

1600x1024

wuxga

1920x1200

woxga

2560x1600

wqsxga

3200x2048

wquxga

3840x2400

whsxga

6400x4096

whuxga

7680x4800

cga

320x200

ega

640x350

hd480

852x480

hd720

1280x720

hd1080

1920x1080

2k

2048x1080

2kflat

1998x1080

2kscope

2048x858

4k

4096x2160

4kflat

3996x2160

4kscope

4096x1716

nhd

640x360

hqvga

240x160

wqvga

400x240

fwqvga

432x240

hvga

480x320

qhd

960x540

2kdci

2048x1080

4kdci

4096x2160

uhd2160

3840x2160

uhd4320

7680x4320

6.5 Video rate

Specify the frame rate of a video, expressed as the number of frames generated per second. It has to be a string in the format frame_rate_num / frame_rate_den , an integer number, a float number or a valid video frame rate abbreviation.

The following abbreviations are recognized:

ntsc

30000/1001

pal

25/1

qntsc

30000/1001

qpal

25/1

sntsc

30000/1001

spal

25/1

film

24/1

ntsc-film

24000/1001

6.6 Ratio

A ratio can be expressed as an expression, or in the form numerator : denominator .

Note that a ratio with infinite (1/0) or negative value is considered valid, so you should check on the returned value if you want to exclude those values.

The undefined value can be expressed using the "0:0" string.

6.7 Color

It can be the name of a color as defined below (case insensitive match) or a [0x|#]RRGGBB[AA] sequence, possibly followed by @ and a string representing the alpha component.

The alpha component may be a string composed by "0x" followed by an hexadecimal number or a decimal number between 0.0 and 1.0, which represents the opacity value (‘ 0x00 ’ or ‘ 0.0 ’ means completely transparent, ‘ 0xff ’ or ‘ 1.0 ’ completely opaque). If the alpha component is not specified then ‘ 0xff ’ is assumed.

The string ‘ random ’ will result in a random color.

The following names of colors are recognized:

AliceBlue

0xF0F8FF

AntiqueWhite

0xFAEBD7

Aqua

0x00FFFF

Aquamarine

0x7FFFD4

Azure

0xF0FFFF

Beige

0xF5F5DC

Bisque

0xFFE4C4

Black

0x000000

BlanchedAlmond

0xFFEBCD

Blue

0x0000FF

BlueViolet

0x8A2BE2

Brown

0xA52A2A

BurlyWood

0xDEB887

CadetBlue

0x5F9EA0

Chartreuse

0x7FFF00

Chocolate

0xD2691E

Coral

0xFF7F50

CornflowerBlue

0x6495ED

Cornsilk

0xFFF8DC

Crimson

0xDC143C

Cyan

0x00FFFF

DarkBlue

0x00008B

DarkCyan

0x008B8B

DarkGoldenRod

0xB8860B

DarkGray

0xA9A9A9

DarkGreen

0x006400

DarkKhaki

0xBDB76B

DarkMagenta

0x8B008B

DarkOliveGreen

0x556B2F

Darkorange

0xFF8C00

DarkOrchid

0x9932CC

DarkRed

0x8B0000

DarkSalmon

0xE9967A

DarkSeaGreen

0x8FBC8F

DarkSlateBlue

0x483D8B

DarkSlateGray

0x2F4F4F

DarkTurquoise

0x00CED1

DarkViolet

0x9400D3

DeepPink

0xFF1493

DeepSkyBlue

0x00BFFF

DimGray

0x696969

DodgerBlue

0x1E90FF

FireBrick

0xB22222

FloralWhite

0xFFFAF0

ForestGreen

0x228B22

Fuchsia

0xFF00FF

Gainsboro

0xDCDCDC

GhostWhite

0xF8F8FF

Gold

0xFFD700

GoldenRod

0xDAA520

Gray

0x808080

Green

0x008000

GreenYellow

0xADFF2F

HoneyDew

0xF0FFF0

HotPink

0xFF69B4

IndianRed

0xCD5C5C

Indigo

0x4B0082

Ivory

0xFFFFF0

Khaki

0xF0E68C

Lavender

0xE6E6FA

LavenderBlush

0xFFF0F5

LawnGreen

0x7CFC00

LemonChiffon

0xFFFACD

LightBlue

0xADD8E6

LightCoral

0xF08080

LightCyan

0xE0FFFF

LightGoldenRodYellow

0xFAFAD2

LightGreen

0x90EE90

LightGrey

0xD3D3D3

LightPink

0xFFB6C1

LightSalmon

0xFFA07A

LightSeaGreen

0x20B2AA

LightSkyBlue

0x87CEFA

LightSlateGray

0x778899

LightSteelBlue

0xB0C4DE

LightYellow

0xFFFFE0

Lime

0x00FF00

LimeGreen

0x32CD32

Linen

0xFAF0E6

Magenta

0xFF00FF

Maroon

0x800000

MediumAquaMarine

0x66CDAA

MediumBlue

0x0000CD

MediumOrchid

0xBA55D3

MediumPurple

0x9370D8

MediumSeaGreen

0x3CB371

MediumSlateBlue

0x7B68EE

MediumSpringGreen

0x00FA9A

MediumTurquoise

0x48D1CC

MediumVioletRed

0xC71585

MidnightBlue

0x191970

MintCream

0xF5FFFA

MistyRose

0xFFE4E1

Moccasin

0xFFE4B5

NavajoWhite

0xFFDEAD

Navy

0x000080

OldLace

0xFDF5E6

Olive

0x808000

OliveDrab

0x6B8E23

Orange

0xFFA500

OrangeRed

0xFF4500

Orchid

0xDA70D6

PaleGoldenRod

0xEEE8AA

PaleGreen

0x98FB98

PaleTurquoise

0xAFEEEE

PaleVioletRed

0xD87093

PapayaWhip

0xFFEFD5

PeachPuff

0xFFDAB9

Peru

0xCD853F

Pink

0xFFC0CB

Plum

0xDDA0DD

PowderBlue

0xB0E0E6

Purple

0x800080

Red

0xFF0000

RosyBrown

0xBC8F8F

RoyalBlue

0x4169E1

SaddleBrown

0x8B4513

Salmon

0xFA8072

SandyBrown

0xF4A460

SeaGreen

0x2E8B57

SeaShell

0xFFF5EE

Sienna

0xA0522D

Silver

0xC0C0C0

SkyBlue

0x87CEEB

SlateBlue

0x6A5ACD

SlateGray

0x708090

Snow

0xFFFAFA

SpringGreen

0x00FF7F

SteelBlue

0x4682B4

Tan

0xD2B48C

Teal

0x008080

Thistle

0xD8BFD8

Tomato

0xFF6347

Turquoise

0x40E0D0

Violet

0xEE82EE

Wheat

0xF5DEB3

White

0xFFFFFF

WhiteSmoke

0xF5F5F5

Yellow

0xFFFF00

YellowGreen

0x9ACD32

6.8 Channel Layout

A channel layout specifies the spatial disposition of the channels in a multi-channel audio stream. To specify a channel layout, FFmpeg makes use of a special syntax.

Individual channels are identified by an id, as given by the table below:

FL

front left

FR

front right

FC

front center

LFE

low frequency

BL

back left

BR

back right

FLC

front left-of-center

FRC

front right-of-center

BC

back center

SL

side left

SR

side right

TC

top center

TFL

top front left

TFC

top front center

TFR

top front right

TBL

top back left

TBC

top back center

TBR

top back right

DL

downmix left

DR

downmix right

WL

wide left

WR

wide right

SDL

surround direct left

SDR

surround direct right

LFE2

low frequency 2

Standard channel layout compositions can be specified by using the following identifiers:

mono

FC

stereo

FL+FR

2.1

FL+FR+LFE

3.0

FL+FR+FC

3.0(back)

FL+FR+BC

4.0

FL+FR+FC+BC

quad

FL+FR+BL+BR

quad(side)

FL+FR+SL+SR

3.1

FL+FR+FC+LFE

5.0

FL+FR+FC+BL+BR

5.0(side)

FL+FR+FC+SL+SR

4.1

FL+FR+FC+LFE+BC

5.1

FL+FR+FC+LFE+BL+BR

5.1(side)

FL+FR+FC+LFE+SL+SR

6.0

FL+FR+FC+BC+SL+SR

6.0(front)

FL+FR+FLC+FRC+SL+SR

hexagonal

FL+FR+FC+BL+BR+BC

6.1

FL+FR+FC+LFE+BC+SL+SR

6.1

FL+FR+FC+LFE+BL+BR+BC

6.1(front)

FL+FR+LFE+FLC+FRC+SL+SR

7.0

FL+FR+FC+BL+BR+SL+SR

7.0(front)

FL+FR+FC+FLC+FRC+SL+SR

7.1

FL+FR+FC+LFE+BL+BR+SL+SR

7.1(wide)

FL+FR+FC+LFE+BL+BR+FLC+FRC

7.1(wide-side)

FL+FR+FC+LFE+FLC+FRC+SL+SR

octagonal

FL+FR+FC+BL+BR+BC+SL+SR

downmix

DL+DR

A custom channel layout can be specified as a sequence of terms, separated by ’+’ or ’|’. Each term can be:

  • the name of a standard channel layout (e.g. ‘ mono ’, ‘ stereo ’, ‘ 4.0 ’, ‘ quad ’, ‘ 5.0 ’, etc.)
  • the name of a single channel (e.g. ‘ FL ’, ‘ FR ’, ‘ FC ’, ‘ LFE ’, etc.)
  • a number of channels, in decimal, followed by ’c’, yielding the default channel layout for that number of channels (see the function av_get_default_channel_layout ). Note that not all channel counts have a default layout.
  • a number of channels, in decimal, followed by ’C’, yielding an unknown channel layout with the specified number of channels. Note that not all channel layout specification strings support unknown channel layouts.
  • a channel layout mask, in hexadecimal starting with "0x" (see the AV_CH_* macros in ‘ libavutil/channel_layout.h ’.

Before libavutil version 53 the trailing character "c" to specify a number of channels was optional, but now it is required, while a channel layout mask can also be specified as a decimal number (if and only if not followed by "c" or "C").

See also the function av_get_channel_layout defined in ‘ libavutil/channel_layout.h ’.

7 Expression Evaluation

When evaluating an arithmetic expression, FFmpeg uses an internal formula evaluator, implemented through the ‘ libavutil/eval.h ’ interface.

An expression may contain unary, binary operators, constants, and functions.

Two expressions expr1 and expr2 can be combined to form another expression " expr1 ; expr2 ". expr1 and expr2 are evaluated in turn, and the new expression evaluates to the value of expr2 .

The following binary operators are available: + , - , * , / , ^ .

The following unary operators are available: + , - .

The following functions are available:

abs(x)

Compute absolute value of x .

acos(x)

Compute arccosine of x .

asin(x)

Compute arcsine of x .

atan(x)

Compute arctangent of x .

atan2(x, y)

Compute principal value of the arc tangent of y / x .

between(x, min, max)

Return 1 if x is greater than or equal to min and lesser than or equal to max , 0 otherwise.

bitand(x, y)
bitor(x, y)

Compute bitwise and/or operation on x and y .

The results of the evaluation of x and y are converted to integers before executing the bitwise operation.

Note that both the conversion to integer and the conversion back to floating point can lose precision. Beware of unexpected results for large numbers (usually 2^53 and larger).

ceil(expr)

Round the value of expression expr upwards to the nearest integer. For example, "ceil(1.5)" is "2.0".

clip(x, min, max)

Return the value of x clipped between min and max .

cos(x)

Compute cosine of x .

cosh(x)

Compute hyperbolic cosine of x .

eq(x, y)

Return 1 if x and y are equivalent, 0 otherwise.

exp(x)

Compute exponential of x (with base e , the Euler’s number).

floor(expr)

Round the value of expression expr downwards to the nearest integer. For example, "floor(-1.5)" is "-2.0".

gauss(x)

Compute Gauss function of x , corresponding to exp(-x*x/2) / sqrt(2*PI) .

gcd(x, y)

Return the greatest common divisor of x and y . If both x and y are 0 or either or both are less than zero then behavior is undefined.

gt(x, y)

Return 1 if x is greater than y , 0 otherwise.

gte(x, y)

Return 1 if x is greater than or equal to y , 0 otherwise.

hypot(x, y)

This function is similar to the C function with the same name; it returns "sqrt( x * x + y * y )", the length of the hypotenuse of a right triangle with sides of length x and y , or the distance of the point ( x , y ) from the origin.

if(x, y)

Evaluate x , and if the result is non-zero return the result of the evaluation of y , return 0 otherwise.

if(x, y, z)

Evaluate x , and if the result is non-zero return the evaluation result of y , otherwise the evaluation result of z .

ifnot(x, y)

Evaluate x , and if the result is zero return the result of the evaluation of y , return 0 otherwise.

ifnot(x, y, z)

Evaluate x , and if the result is zero return the evaluation result of y , otherwise the evaluation result of z .

isinf(x)

Return 1.0 if x is +/-INFINITY, 0.0 otherwise.

isnan(x)

Return 1.0 if x is NAN, 0.0 otherwise.

ld(var)

Load the value of the internal variable with number var , which was previously stored with st( var , expr ). The function returns the loaded value.

lerp(x, y, z)

Return linear interpolation between x and y by amount of z .

log(x)

Compute natural logarithm of x .

lt(x, y)

Return 1 if x is lesser than y , 0 otherwise.

lte(x, y)

Return 1 if x is lesser than or equal to y , 0 otherwise.

max(x, y)

Return the maximum between x and y .

min(x, y)

Return the minimum between x and y .

mod(x, y)

Compute the remainder of division of x by y .

not(expr)

Return 1.0 if expr is zero, 0.0 otherwise.

pow(x, y)

Compute the power of x elevated y , it is equivalent to "( x )^( y )".

print(t)
print(t, l)

Print the value of expression t with loglevel l . If l is not specified then a default log level is used. Returns the value of the expression printed.

Prints t with loglevel l

random(x)

Return a pseudo random value between 0.0 and 1.0. x is the index of the internal variable which will be used to save the seed/state.

root(expr, max)

Find an input value for which the function represented by expr with argument ld(0) is 0 in the interval 0.. max .

The expression in expr must denote a continuous function or the result is undefined.

ld(0) is used to represent the function input value, which means that the given expression will be evaluated multiple times with various input values that the expression can access through ld(0) . When the expression evaluates to 0 then the corresponding input value will be returned.

round(expr)

Round the value of expression expr to the nearest integer. For example, "round(1.5)" is "2.0".

sin(x)

Compute sine of x .

sinh(x)

Compute hyperbolic sine of x .

sqrt(expr)

Compute the square root of expr . This is equivalent to "( expr )^.5".

squish(x)

Compute expression 1/(1 + exp(4*x)) .

st(var, expr)

Store the value of the expression expr in an internal variable. var specifies the number of the variable where to store the value, and it is a value ranging from 0 to 9. The function returns the value stored in the internal variable. Note, Variables are currently not shared between expressions.

tan(x)

Compute tangent of x .

tanh(x)

Compute hyperbolic tangent of x .

taylor(expr, x)
taylor(expr, x, id)

Evaluate a Taylor series at x , given an expression representing the ld(id) -th derivative of a function at 0.

When the series does not converge the result is undefined.

ld(id) is used to represent the derivative order in expr , which means that the given expression will be evaluated multiple times with various input values that the expression can access through ld(id) . If id is not specified then 0 is assumed.

Note, when you have the derivatives at y instead of 0, taylor(expr, x-y) can be used.

time(0)

Return the current (wallclock) time in seconds.

trunc(expr)

Round the value of expression expr towards zero to the nearest integer. For example, "trunc(-1.5)" is "-1.0".

while(cond, expr)

Evaluate expression expr while the expression cond is non-zero, and returns the value of the last expr evaluation, or NAN if cond was always false.

The following constants are available:

PI

area of the unit disc, approximately 3.14

E

exp(1) (Euler’s number), approximately 2.718

PHI

golden ratio (1+sqrt(5))/2, approximately 1.618

Assuming that an expression is considered "true" if it has a non-zero value, note that:

* works like AND

+ works like OR

For example the construct:

if (A AND B) then C
                        

is equivalent to:

if(A*B, C)
                        

In your C code, you can extend the list of unary and binary functions, and define recognized constants, so that they are available for your expressions.

The evaluator also recognizes the International System unit prefixes. If ’i’ is appended after the prefix, binary prefixes are used, which are based on powers of 1024 instead of powers of 1000. The ’B’ postfix multiplies the value by 8, and can be appended after a unit prefix or used alone. This allows using for example ’KB’, ’MiB’, ’G’ and ’B’ as number postfix.

The list of available International System prefixes follows, with indication of the corresponding powers of 10 and of 2.

y

10^-24 / 2^-80

z

10^-21 / 2^-70

a

10^-18 / 2^-60

f

10^-15 / 2^-50

p

10^-12 / 2^-40

n

10^-9 / 2^-30

u

10^-6 / 2^-20

m

10^-3 / 2^-10

c

10^-2

d

10^-1

h

10^2

k

10^3 / 2^10

K

10^3 / 2^10

M

10^6 / 2^20

G

10^9 / 2^30

T

10^12 / 2^40

P

10^15 / 2^40

E

10^18 / 2^50

Z

10^21 / 2^60

Y

10^24 / 2^70

8 Codec Options

libavcodec provides some generic global options, which can be set on all the encoders and decoders. In addition each codec may support so-called private options, which are specific for a given codec.

Sometimes, a global option may only affect a specific kind of codec, and may be nonsensical or ignored by another, so you need to be aware of the meaning of the specified options. Also some options are meant only for decoding or encoding.

Options may be set by specifying - option value in the FFmpeg tools, or by setting the value explicitly in the AVCodecContext options or using the ‘ libavutil/opt.h ’ API for programmatic use.

The list of supported options follow:

b integer ( encoding,audio,video )

Set bitrate in bits/s. Default value is 200K.

ab integer ( encoding,audio )

Set audio bitrate (in bits/s). Default value is 128K.

bt integer ( encoding,video )

Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate tolerance specifies how far ratecontrol is willing to deviate from the target average bitrate value. This is not related to min/max bitrate. Lowering tolerance too much has an adverse effect on quality.

flags flags ( decoding/encoding,audio,video,subtitles )

Set generic flags.

Possible values:

mv4

Use four motion vector by macroblock (mpeg4).

qpel

Use 1/4 pel motion compensation.

loop

Use loop filter.

qscale

Use fixed qscale.

pass1

Use internal 2pass ratecontrol in first pass mode.

pass2

Use internal 2pass ratecontrol in second pass mode.

gray

Only decode/encode grayscale.

emu_edge

Do not draw edges.

psnr

Set error[?] variables during encoding.

truncated
drop_changed

Don’t output frames whose parameters differ from first decoded frame in stream. Error AVERROR_INPUT_CHANGED is returned when a frame is dropped.

ildct

Use interlaced DCT.

low_delay

Force low delay.

global_header

Place global headers in extradata instead of every keyframe.

bitexact

Only write platform-, build- and time-independent data. (except (I)DCT). This ensures that file and data checksums are reproducible and match between platforms. Its primary use is for regression testing.

aic

Apply H263 advanced intra coding / mpeg4 ac prediction.

cbp

Deprecated, use mpegvideo private options instead.

qprd

Deprecated, use mpegvideo private options instead.

ilme

Apply interlaced motion estimation.

cgop

Use closed gop.

me_method integer ( encoding,video )

Set motion estimation method.

Possible values:

zero

zero motion estimation (fastest)

full

full motion estimation (slowest)

epzs

EPZS motion estimation (default)

esa

esa motion estimation (alias for full)

tesa

tesa motion estimation

dia

dia motion estimation (alias for epzs)

log

log motion estimation

phods

phods motion estimation

x1

X1 motion estimation

hex

hex motion estimation

umh

umh motion estimation

iter

iter motion estimation

extradata_size integer

Set extradata size.

time_base rational number

Set codec time base.

It is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented. For fixed-fps content, timebase should be 1 / frame_rate and timestamp increments should be identically 1.

g integer ( encoding,video )

Set the group of picture (GOP) size. Default value is 12.

ar integer ( decoding/encoding,audio )

Set audio sampling rate (in Hz).

ac integer ( decoding/encoding,audio )

Set number of audio channels.

cutoff integer ( encoding,audio )

Set cutoff bandwidth. (Supported only by selected encoders, see their respective documentation sections.)

frame_size integer ( encoding,audio )

Set audio frame size.

Each submitted frame except the last must contain exactly frame_size samples per channel. May be 0 when the codec has CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not restricted. It is set by some decoders to indicate constant frame size.

frame_number integer

Set the frame number.

delay integer
qcomp float ( encoding,video )

Set video quantizer scale compression (VBR). It is used as a constant in the ratecontrol equation. Recommended range for default rc_eq: 0.0-1.0.

qblur float ( encoding,video )

Set video quantizer scale blur (VBR).

qmin integer ( encoding,video )

Set min video quantizer scale (VBR). Must be included between -1 and 69, default value is 2.

qmax integer ( encoding,video )

Set max video quantizer scale (VBR). Must be included between -1 and 1024, default value is 31.

qdiff integer ( encoding,video )

Set max difference between the quantizer scale (VBR).

bf integer ( encoding,video )

Set max number of B frames between non-B-frames.

Must be an integer between -1 and 16. 0 means that B-frames are disabled. If a value of -1 is used, it will choose an automatic value depending on the encoder.

Default value is 0.

b_qfactor float ( encoding,video )

Set qp factor between P and B frames.

rc_strategy integer ( encoding,video )

Set ratecontrol method.

b_strategy integer ( encoding,video )

Set strategy to choose between I/P/B-frames.

ps integer ( encoding,video )

Set RTP payload size in bytes.

mv_bits integer
header_bits integer
i_tex_bits integer
p_tex_bits integer
i_count integer
p_count integer
skip_count integer
misc_bits integer
frame_bits integer
codec_tag integer
bug flags ( decoding,video )

Workaround not auto detected encoder bugs.

Possible values:

autodetect
old_msmpeg4

some old lavc generated msmpeg4v3 files (no autodetection)

xvid_ilace

Xvid interlacing bug (autodetected if fourcc==XVIX)

ump4

(autodetected if fourcc==UMP4)

no_padding

padding bug (autodetected)

amv
ac_vlc

illegal vlc bug (autodetected per fourcc)

qpel_chroma
std_qpel

old standard qpel (autodetected per fourcc/version)

qpel_chroma2
direct_blocksize

direct-qpel-blocksize bug (autodetected per fourcc/version)

edge

edge padding bug (autodetected per fourcc/version)

hpel_chroma
dc_clip
ms

Workaround various bugs in microsoft broken decoders.

trunc

trancated frames

lelim integer ( encoding,video )

Set single coefficient elimination threshold for luminance (negative values also consider DC coefficient).

celim integer ( encoding,video )

Set single coefficient elimination threshold for chrominance (negative values also consider dc coefficient)

strict integer ( decoding/encoding,audio,video )

Specify how strictly to follow the standards.

Possible values:

very

strictly conform to an older more strict version of the spec or reference software

strict

strictly conform to all the things in the spec no matter what consequences

normal
unofficial

allow unofficial extensions

experimental

allow non standardized experimental things, experimental (unfinished/work in progress/not well tested) decoders and encoders. Note: experimental decoders can pose a security risk, do not use this for decoding untrusted input.

b_qoffset float ( encoding,video )

Set QP offset between P and B frames.

err_detect flags ( decoding,audio,video )

Set error detection flags.

Possible values:

crccheck

verify embedded CRCs

bitstream

detect bitstream specification deviations

buffer

detect improper bitstream length

explode

abort decoding on minor error detection

ignore_err

ignore decoding errors, and continue decoding. This is useful if you want to analyze the content of a video and thus want everything to be decoded no matter what. This option will not result in a video that is pleasing to watch in case of errors.

careful

consider things that violate the spec and have not been seen in the wild as errors

compliant

consider all spec non compliancies as errors

aggressive

consider things that a sane encoder should not do as an error

has_b_frames integer
block_align integer
mpeg_quant integer ( encoding,video )

Use MPEG quantizers instead of H.263.

qsquish float ( encoding,video )

How to keep quantizer between qmin and qmax (0 = clip, 1 = use differentiable function).

rc_qmod_amp float ( encoding,video )

Set experimental quantizer modulation.

rc_qmod_freq integer ( encoding,video )

Set experimental quantizer modulation.

rc_override_count integer
rc_eq string ( encoding,video )

Set rate control equation. When computing the expression, besides the standard functions defined in the section ’Expression Evaluation’, the following functions are available: bits2qp(bits), qp2bits(qp). Also the following constants are available: iTex pTex tex mv fCode iCount mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex avgTex.

maxrate integer ( encoding,audio,video )

Set max bitrate tolerance (in bits/s). Requires bufsize to be set.

minrate integer ( encoding,audio,video )

Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR encode. It is of little use elsewise.

bufsize integer ( encoding,audio,video )

Set ratecontrol buffer size (in bits).

rc_buf_aggressivity float ( encoding,video )

Currently useless.

i_qfactor float ( encoding,video )

Set QP factor between P and I frames.

i_qoffset float ( encoding,video )

Set QP offset between P and I frames.

rc_init_cplx float ( encoding,video )

Set initial complexity for 1-pass encoding.

dct integer ( encoding,video )

Set DCT algorithm.

Possible values:

auto

autoselect a good one (default)

fastint

fast integer

int

accurate integer

mmx
altivec
faan

floating point AAN DCT

lumi_mask float ( encoding,video )

Compress bright areas stronger than medium ones.

tcplx_mask float ( encoding,video )

Set temporal complexity masking.

scplx_mask float ( encoding,video )

Set spatial complexity masking.

p_mask float ( encoding,video )

Set inter masking.

dark_mask float ( encoding,video )

Compress dark areas stronger than medium ones.

idct integer ( decoding/encoding,video )

Select IDCT implementation.

Possible values:

auto
int
simple
simplemmx
simpleauto

Automatically pick a IDCT compatible with the simple one

arm
altivec
sh4
simplearm
simplearmv5te
simplearmv6
simpleneon
simplealpha
ipp
xvidmmx
faani

floating point AAN IDCT

slice_count integer
ec flags ( decoding,video )

Set error concealment strategy.

Possible values:

guess_mvs

iterative motion vector (MV) search (slow)

deblock

use strong deblock filter for damaged MBs

favor_inter

favor predicting from the previous frame instead of the current

bits_per_coded_sample integer
pred integer ( encoding,video )

Set prediction method.

Possible values:

left
plane
median
aspect rational number ( encoding,video )

Set sample aspect ratio.

sar rational number ( encoding,video )

Set sample aspect ratio. Alias to aspect .

debug flags ( decoding/encoding,audio,video,subtitles )

Print specific debug info.

Possible values:

pict

picture info

rc

rate control

bitstream
mb_type

macroblock (MB) type

qp

per-block quantization parameter (QP)

dct_coeff
green_metadata

display complexity metadata for the upcoming frame, GoP or for a given duration.

skip
startcode
er

error recognition

mmco

memory management control operations (H.264)

bugs
buffers

picture buffer allocations

thread_ops

threading operations

nomc

skip motion compensation

cmp integer ( encoding,video )

Set full pel me compare function.

Possible values:

sad

sum of absolute differences, fast (default)

sse

sum of squared errors

satd

sum of absolute Hadamard transformed differences

dct

sum of absolute DCT transformed differences

psnr

sum of squared quantization errors (avoid, low quality)

bit

number of bits needed for the block

rd

rate distortion optimal, slow

zero

0

vsad

sum of absolute vertical differences

vsse

sum of squared vertical differences

nsse

noise preserving sum of squared differences

w53

5/3 wavelet, only used in snow

w97

9/7 wavelet, only used in snow

dctmax
chroma
subcmp integer ( encoding,video )

Set sub pel me compare function.

Possible values:

sad

sum of absolute differences, fast (default)

sse

sum of squared errors

satd

sum of absolute Hadamard transformed differences

dct

sum of absolute DCT transformed differences

psnr

sum of squared quantization errors (avoid, low quality)

bit

number of bits needed for the block

rd

rate distortion optimal, slow

zero

0

vsad

sum of absolute vertical differences

vsse

sum of squared vertical differences

nsse

noise preserving sum of squared differences

w53

5/3 wavelet, only used in snow

w97

9/7 wavelet, only used in snow

dctmax
chroma
mbcmp integer ( encoding,video )

Set macroblock compare function.

Possible values:

sad

sum of absolute differences, fast (default)

sse

sum of squared errors

satd

sum of absolute Hadamard transformed differences

dct

sum of absolute DCT transformed differences

psnr

sum of squared quantization errors (avoid, low quality)

bit

number of bits needed for the block

rd

rate distortion optimal, slow

zero

0

vsad

sum of absolute vertical differences

vsse

sum of squared vertical differences

nsse

noise preserving sum of squared differences

w53

5/3 wavelet, only used in snow

w97

9/7 wavelet, only used in snow

dctmax
chroma
ildctcmp integer ( encoding,video )

Set interlaced dct compare function.

Possible values:

sad

sum of absolute differences, fast (default)

sse

sum of squared errors

satd

sum of absolute Hadamard transformed differences

dct

sum of absolute DCT transformed differences

psnr

sum of squared quantization errors (avoid, low quality)

bit

number of bits needed for the block

rd

rate distortion optimal, slow

zero

0

vsad

sum of absolute vertical differences

vsse

sum of squared vertical differences

nsse

noise preserving sum of squared differences

w53

5/3 wavelet, only used in snow

w97

9/7 wavelet, only used in snow

dctmax
chroma
dia_size integer ( encoding,video )

Set diamond type & size for motion estimation.

last_pred integer ( encoding,video )

Set amount of motion predictors from the previous frame.

preme integer ( encoding,video )

Set pre motion estimation.

precmp integer ( encoding,video )

Set pre motion estimation compare function.

Possible values:

sad

sum of absolute differences, fast (default)

sse

sum of squared errors

satd

sum of absolute Hadamard transformed differences

dct

sum of absolute DCT transformed differences

psnr

sum of squared quantization errors (avoid, low quality)

bit

number of bits needed for the block

rd

rate distortion optimal, slow

zero

0

vsad

sum of absolute vertical differences

vsse

sum of squared vertical differences

nsse

noise preserving sum of squared differences

w53

5/3 wavelet, only used in snow

w97

9/7 wavelet, only used in snow

dctmax
chroma
pre_dia_size integer ( encoding,video )

Set diamond type & size for motion estimation pre-pass.

subq integer ( encoding,video )

Set sub pel motion estimation quality.

dtg_active_format integer
me_range integer ( encoding,video )

Set limit motion vectors range (1023 for DivX player).

ibias integer ( encoding,video )

Set intra quant bias.

pbias integer ( encoding,video )

Set inter quant bias.

color_table_id integer
global_quality integer ( encoding,audio,video )
coder integer ( encoding,video )

Possible values:

vlc

variable length coder / huffman coder

ac

arithmetic coder

raw

raw (no encoding)

rle

run-length coder

deflate

deflate-based coder

context integer ( encoding,video )

Set context model.

slice_flags integer
mbd integer ( encoding,video )

Set macroblock decision algorithm (high quality mode).

Possible values:

simple

use mbcmp (default)

bits

use fewest bits

rd

use best rate distortion

stream_codec_tag integer
sc_threshold integer ( encoding,video )

Set scene change threshold.

lmin integer ( encoding,video )

Set min lagrange factor (VBR).

lmax integer ( encoding,video )

Set max lagrange factor (VBR).

nr integer ( encoding,video )

Set noise reduction.

rc_init_occupancy integer ( encoding,video )

Set number of bits which should be loaded into the rc buffer before decoding starts.

flags2 flags ( decoding/encoding,audio,video )

Possible values:

fast

Allow non spec compliant speedup tricks.

sgop

Deprecated, use mpegvideo private options instead.

noout

Skip bitstream encoding.

ignorecrop

Ignore cropping information from sps.

local_header

Place global headers at every keyframe instead of in extradata.

chunks

Frame data might be split into multiple chunks.

showall

Show all frames before the first keyframe.

export_mvs

Export motion vectors into frame side-data (see AV_FRAME_DATA_MOTION_VECTORS ) for codecs that support it. See also ‘ doc/examples/export_mvs.c ’.

error integer ( encoding,video )
qns integer ( encoding,video )

Deprecated, use mpegvideo private options instead.

threads integer ( decoding/encoding,video )

Set the number of threads to be used, in case the selected codec implementation supports multi-threading.

Possible values:

auto, 0

automatically select the number of threads to set

Default value is ‘ auto ’.

me_threshold integer ( encoding,video )

Set motion estimation threshold.

mb_threshold integer ( encoding,video )

Set macroblock threshold.

dc integer ( encoding,video )

Set intra_dc_precision.

nssew integer ( encoding,video )

Set nsse weight.

skip_top integer ( decoding,video )

Set number of macroblock rows at the top which are skipped.

skip_bottom integer ( decoding,video )

Set number of macroblock rows at the bottom which are skipped.

profile integer ( encoding,audio,video )

Possible values:

unknown
aac_main
aac_low
aac_ssr
aac_ltp
aac_he
aac_he_v2
aac_ld
aac_eld
mpeg2_aac_low
mpeg2_aac_he
mpeg4_sp
mpeg4_core
mpeg4_main
mpeg4_asp
dts
dts_es
dts_96_24
dts_hd_hra
dts_hd_ma
level integer ( encoding,audio,video )

Possible values:

unknown
lowres integer ( decoding,audio,video )

Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.

skip_threshold integer ( encoding,video )

Set frame skip threshold.

skip_factor integer ( encoding,video )

Set frame skip factor.

skip_exp integer ( encoding,video )

Set frame skip exponent. Negative values behave identical to the corresponding positive ones, except that the score is normalized. Positive values exist primarily for compatibility reasons and are not so useful.

skipcmp integer ( encoding,video )

Set frame skip compare function.

Possible values:

sad

sum of absolute differences, fast (default)

sse

sum of squared errors

satd

sum of absolute Hadamard transformed differences

dct

sum of absolute DCT transformed differences

psnr

sum of squared quantization errors (avoid, low quality)

bit

number of bits needed for the block

rd

rate distortion optimal, slow

zero

0

vsad

sum of absolute vertical differences

vsse

sum of squared vertical differences

nsse

noise preserving sum of squared differences

w53

5/3 wavelet, only used in snow

w97

9/7 wavelet, only used in snow

dctmax
chroma
border_mask float ( encoding,video )

Increase the quantizer for macroblocks close to borders.

mblmin integer ( encoding,video )

Set min macroblock lagrange factor (VBR).

mblmax integer ( encoding,video )

Set max macroblock lagrange factor (VBR).

mepc integer ( encoding,video )

Set motion estimation bitrate penalty compensation (1.0 = 256).

skip_loop_filter integer ( decoding,video )
skip_idct integer ( decoding,video )
skip_frame integer ( decoding,video )

Make decoder discard processing depending on the frame type selected by the option value.

skip_loop_filter ’ skips frame loop filtering, ‘ skip_idct ’ skips frame IDCT/dequantization, ‘ skip_frame ’ skips decoding.

Possible values:

none

Discard no frame.

default

Discard useless frames like 0-sized frames.

noref

Discard all non-reference frames.

bidir

Discard all bidirectional frames.

nokey

Discard all frames excepts keyframes.

nointra

Discard all frames except I frames.

all

Discard all frames.

Default value is ‘ default ’.

bidir_refine integer ( encoding,video )

Refine the two motion vectors used in bidirectional macroblocks.

brd_scale integer ( encoding,video )

Downscale frames for dynamic B-frame decision.

keyint_min integer ( encoding,video )

Set minimum interval between IDR-frames.

refs integer ( encoding,video )

Set reference frames to consider for motion compensation.

chromaoffset integer ( encoding,video )

Set chroma qp offset from luma.

trellis integer ( encoding,audio,video )

Set rate-distortion optimal quantization.

mv0_threshold integer ( encoding,video )
b_sensitivity integer ( encoding,video )

Adjust sensitivity of b_frame_strategy 1.

compression_level integer ( encoding,audio,video )
min_prediction_order integer ( encoding,audio )
max_prediction_order integer ( encoding,audio )
timecode_frame_start integer ( encoding,video )

Set GOP timecode frame start number, in non drop frame format.

request_channels integer ( decoding,audio )

Set desired number of audio channels.

bits_per_raw_sample integer
channel_layout integer ( decoding/encoding,audio )

Possible values:

request_channel_layout integer ( decoding,audio )

Possible values:

rc_max_vbv_use float ( encoding,video )
rc_min_vbv_use float ( encoding,video )
ticks_per_frame integer ( decoding/encoding,audio,video )
color_primaries integer ( decoding/encoding,video )

Possible values:

bt709

BT.709

bt470m

BT.470 M

bt470bg

BT.470 BG

smpte170m

SMPTE 170 M

smpte240m

SMPTE 240 M

film

Film

bt2020

BT.2020

smpte428
smpte428_1

SMPTE ST 428-1

smpte431

SMPTE 431-2

smpte432

SMPTE 432-1

jedec-p22

JEDEC P22

color_trc integer ( decoding/encoding,video )

Possible values:

bt709

BT.709

gamma22

BT.470 M

gamma28

BT.470 BG

smpte170m

SMPTE 170 M

smpte240m

SMPTE 240 M

linear

Linear

log
log100

Log

log_sqrt
log316

Log square root

iec61966_2_4
iec61966-2-4

IEC 61966-2-4

bt1361
bt1361e

BT.1361

iec61966_2_1
iec61966-2-1

IEC 61966-2-1

bt2020_10
bt2020_10bit

BT.2020 - 10 bit

bt2020_12
bt2020_12bit

BT.2020 - 12 bit

smpte2084

SMPTE ST 2084

smpte428
smpte428_1

SMPTE ST 428-1

arib-std-b67

ARIB STD-B67

colorspace integer ( decoding/encoding,video )

Possible values:

rgb

RGB

bt709

BT.709

fcc

FCC

bt470bg

BT.470 BG

smpte170m

SMPTE 170 M

smpte240m

SMPTE 240 M

ycocg

YCOCG

bt2020nc
bt2020_ncl

BT.2020 NCL

bt2020c
bt2020_cl

BT.2020 CL

smpte2085

SMPTE 2085

color_range integer ( decoding/encoding,video )

If used as input parameter, it serves as a hint to the decoder, which color_range the input has. Possible values:

tv
mpeg

MPEG (219*2^(n-8))

pc
jpeg

JPEG (2^n-1)

chroma_sample_location integer ( decoding/encoding,video )

Possible values:

left
center
topleft
top
bottomleft
bottom
log_level_offset integer

Set the log level offset.

slices integer ( encoding,video )

Number of slices, used in parallelized encoding.

thread_type flags ( decoding/encoding,video )

Select which multithreading methods to use.

Use of ‘ frame ’ will increase decoding delay by one frame per thread, so clients which cannot provide future frames should not use it.

Possible values:

slice

Decode more than one part of a single frame at once.

Multithreading using slices works only when the video was encoded with slices.

frame

Decode more than one frame at once.

Default value is ‘ slice+frame ’.

audio_service_type integer ( encoding,audio )

Set audio service type.

Possible values:

ma

Main Audio Service

ef

Effects

vi

Visually Impaired

hi

Hearing Impaired

di

Dialogue

co

Commentary

em

Emergency

vo

Voice Over

ka

Karaoke

request_sample_fmt sample_fmt ( decoding,audio )

Set sample format audio decoders should prefer. Default value is none .

pkt_timebase rational number
sub_charenc encoding ( decoding,subtitles )

Set the input subtitles character encoding.

field_order field_order ( video )

Set/override the field order of the video. Possible values:

progressive

Progressive video

tt

Interlaced video, top field coded and displayed first

bb

Interlaced video, bottom field coded and displayed first

tb

Interlaced video, top coded first, bottom displayed first

bt

Interlaced video, bottom coded first, top displayed first

skip_alpha bool ( decoding,video )

Set to 1 to disable processing alpha (transparency). This works like the ‘ gray ’ flag in the ‘ flags ’ option which skips chroma information instead of alpha. Default is 0.

codec_whitelist list ( input )

"," separated list of allowed decoders. By default all are allowed.

dump_separator string ( input )

Separator used to separate the fields printed on the command line about the Stream parameters. For example, to separate the fields with newlines and indentation:

ffprobe -dump_separator "
                          "  -i ~/videos/matrixbench_mpeg2.mpg
                                
max_pixels integer ( decoding/encoding,video )

Maximum number of pixels per image. This value can be used to avoid out of memory failures due to large images.

apply_cropping bool ( decoding,video )

Enable cropping if cropping parameters are multiples of the required alignment for the left and top parameters. If the alignment is not met the cropping will be partially applied to maintain alignment. Default is 1 (enabled). Note: The required alignment depends on if AV_CODEC_FLAG_UNALIGNED is set and the CPU. AV_CODEC_FLAG_UNALIGNED cannot be changed from the command line. Also hardware decoders will not apply left/top Cropping.

9 Decoders

Decoders are configured elements in FFmpeg which allow the decoding of multimedia streams.

When you configure your FFmpeg build, all the supported native decoders are enabled by default. Decoders requiring an external library must be enabled manually via the corresponding --enable-lib option. You can list all available decoders using the configure option --list-decoders .

You can disable all the decoders with the configure option --disable-decoders and selectively enable / disable single decoders with the options --enable-decoder= DECODER / --disable-decoder= DECODER .

The option -decoders of the ff* tools will display the list of enabled decoders.

10 Video Decoders

A description of some of the currently available video decoders follows.

10.1 rawvideo

Raw video decoder.

This decoder decodes rawvideo streams.

10.1.1 Options

top top_field_first

Specify the assumed field type of the input video.

-1

the video is assumed to be progressive (default)

0

bottom-field-first is assumed

1

top-field-first is assumed

10.2 libdav1d

dav1d AV1 decoder.

libdav1d allows libavcodec to decode the AOMedia Video 1 (AV1) codec. Requires the presence of the libdav1d headers and library during configuration. You need to explicitly configure the build with --enable-libdav1d .

10.2.1 Options

The following option is supported by the libdav1d wrapper.

framethreads

Set amount of frame threads to use during decoding. The default value is 0 (autodetect).

tilethreads

Set amount of tile threads to use during decoding. The default value is 0 (autodetect).

filmgrain

Apply film grain to the decoded video if present in the bitstream. The default value 为 true。

10.3 libdavs2

AVS2-P2/IEEE1857.4 video decoder wrapper.

This decoder allows libavcodec to decode AVS2 streams with davs2 library.

11 Audio Decoders

A description of some of the currently available audio decoders follows.

11.1 ac3

AC-3 audio decoder.

This decoder implements part of ATSC A/52:2010 and ETSI TS 102 366, as well as the undocumented RealAudio 3 (a.k.a. dnet).

11.1.1 AC-3 Decoder Options

-drc_scale value

Dynamic Range Scale Factor. The factor to apply to dynamic range values from the AC-3 stream. This factor is applied exponentially. There are 3 notable scale factor ranges:

drc_scale == 0

DRC disabled. Produces full range audio.

0 < drc_scale <= 1

DRC enabled. Applies a fraction of the stream DRC value. Audio reproduction is between full range and full compression.

drc_scale > 1

DRC enabled. Applies drc_scale asymmetrically. Loud sounds are fully compressed. Soft sounds are enhanced.

11.2 flac

FLAC audio decoder.

This decoder aims to implement the complete FLAC specification from Xiph.

11.2.1 FLAC Decoder options

-use_buggy_lpc

The lavc FLAC encoder used to produce buggy streams with high lpc values (like the default value). This option makes it possible to decode such streams correctly by using lavc’s old buggy lpc logic for decoding.

11.3 ffwavesynth

Internal wave synthesizer.

This decoder generates wave patterns according to predefined sequences. Its use is purely internal and the format of the data it accepts is not publicly documented.

11.4 libcelt

libcelt decoder wrapper.

libcelt allows libavcodec to decode the Xiph CELT ultra-low delay audio codec. Requires the presence of the libcelt headers and library during configuration. You need to explicitly configure the build with --enable-libcelt .

11.5 libgsm

libgsm decoder wrapper.

libgsm allows libavcodec to decode the GSM full rate audio codec. Requires the presence of the libgsm headers and library during configuration. You need to explicitly configure the build with --enable-libgsm .

This decoder supports both the ordinary GSM and the Microsoft variant.

11.6 libilbc

libilbc decoder wrapper.

libilbc allows libavcodec to decode the Internet Low Bitrate Codec (iLBC) audio codec. Requires the presence of the libilbc headers and library during configuration. You need to explicitly configure the build with --enable-libilbc .

11.6.1 Options

The following option is supported by the libilbc wrapper.

enhance

Enable the enhancement of the decoded audio when set to 1. The default value is 0 (disabled).

11.7 libopencore-amrnb

libopencore-amrnb decoder wrapper.

libopencore-amrnb allows libavcodec to decode the Adaptive Multi-Rate Narrowband audio codec. Using it requires the presence of the libopencore-amrnb headers and library during configuration. You need to explicitly configure the build with --enable-libopencore-amrnb .

An FFmpeg native decoder for AMR-NB exists, so users can decode AMR-NB without this library.

11.8 libopencore-amrwb

libopencore-amrwb decoder wrapper.

libopencore-amrwb allows libavcodec to decode the Adaptive Multi-Rate Wideband audio codec. Using it requires the presence of the libopencore-amrwb headers and library during configuration. You need to explicitly configure the build with --enable-libopencore-amrwb .

An FFmpeg native decoder for AMR-WB exists, so users can decode AMR-WB without this library.

11.9 libopus

libopus decoder wrapper.

libopus allows libavcodec to decode the Opus Interactive Audio Codec. Requires the presence of the libopus headers and library during configuration. You need to explicitly configure the build with --enable-libopus .

An FFmpeg native decoder for Opus exists, so users can decode Opus without this library.

12 Subtitles Decoders

12.1 libaribb24

ARIB STD-B24 caption decoder.

Implements profiles A and C of the ARIB STD-B24 standard.

12.1.1 libaribb24 Decoder Options

-aribb24-base-path path

Sets the base path for the libaribb24 library. This is utilized for reading of configuration files (for custom unicode conversions), and for dumping of non-text symbols as images under that location.

Unset by default.

-aribb24-skip-ruby-text boolean

Tells the decoder wrapper to skip text blocks that contain half-height ruby text.

Enabled by default.

12.2 dvbsub

12.2.1 Options

compute_clut
-1

Compute clut if no matching CLUT is in the stream.

0

Never compute CLUT

1

Always compute CLUT and override the one provided in the stream.

dvb_substream

Selects the dvb substream, or all substreams if -1 which is default.

12.3 dvdsub

This codec decodes the bitmap subtitles used in DVDs; the same subtitles can also be found in VobSub file pairs and in some Matroska files.

12.3.1 Options

palette

Specify the global palette used by the bitmaps. When stored in VobSub, the palette is normally specified in the index file; in Matroska, the palette is stored in the codec extra-data in the same format as in VobSub. In DVDs, the palette is stored in the IFO file, and therefore not available when reading from dumped VOB files.

The format for this option is a string containing 16 24-bits hexadecimal numbers (without 0x prefix) separated by comas, for example 0d00ee, ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1, 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b .

ifo_palette

Specify the IFO file from which the global palette is obtained. (experimental)

forced_subs_only

Only decode subtitle entries marked as forced. Some titles have forced and non-forced subtitles in the same track. Setting this flag to 1 will only keep the forced subtitles. Default value is 0 .

12.4 libzvbi-teletext

Libzvbi allows libavcodec to decode DVB teletext pages and DVB teletext subtitles. Requires the presence of the libzvbi headers and library during configuration. You need to explicitly configure the build with --enable-libzvbi .

12.4.1 Options

txt_page

List of teletext page numbers to decode. Pages that do not match the specified list are dropped. You may use the special * string to match all pages, 或 subtitle to match all subtitle pages. Default value is *.

txt_chop_top

Discards the top teletext line. Default value is 1.

txt_format

Specifies the format of the decoded subtitles.

bitmap

The default format, you should use this for teletext pages, because certain graphics and colors cannot be expressed in simple text or even ASS.

text

Simple text based output without formatting.

ass

Formatted ASS output, subtitle pages and teletext pages are returned in different styles, subtitle pages are stripped down to text, but an effort is made to keep the text alignment and the formatting.

txt_left

X offset of generated bitmaps, default is 0.

txt_top

Y offset of generated bitmaps, default is 0.

txt_chop_spaces

Chops leading and trailing spaces and removes empty lines from the generated text. This option is useful for teletext based subtitles where empty spaces may be present at the start or at the end of the lines or empty lines may be present between the subtitle lines because of double-sized teletext characters. Default value is 1.

txt_duration

Sets the display duration of the decoded teletext pages or subtitles in milliseconds. Default value is -1 which means infinity or until the next subtitle event comes.

txt_transparent

Force transparent background of the generated teletext bitmaps. Default value is 0 which means an opaque background.

txt_opacity

Sets the opacity (0-255) of the teletext background. If ‘ txt_transparent ’ is not set, it only affects characters between a start box and an end box, typically subtitles. Default value is 0 if ‘ txt_transparent ’ is set, 255 otherwise.

13 Bitstream Filters

When you configure your FFmpeg build, all the supported bitstream filters are enabled by default. You can list all available ones using the configure option --list-bsfs .

You can disable all the bitstream filters using the configure option --disable-bsfs , and selectively enable any bitstream filter using the option --enable-bsf=BSF , or you can disable a particular bitstream filter using the option --disable-bsf=BSF .

The option -bsfs of the ff* tools will display the list of all the supported bitstream filters included in your build.

The ff* tools have a -bsf option applied per stream, taking a comma-separated list of filters, whose parameters follow the filter name after a ’=’.

ffmpeg -i INPUT -c:v copy -bsf:v filter1[=opt1=str1:opt2=str2][,filter2] OUTPUT
                        

Below is a description of the currently available bitstream filters, with their parameters, if any.

13.1 aac_adtstoasc

Convert MPEG-2/4 AAC ADTS to an MPEG-4 Audio Specific Configuration bitstream.

This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4 ADTS header and removes the ADTS header.

This filter is required for example when copying an AAC stream from a raw ADTS AAC or an MPEG-TS container to MP4A-LATM, to an FLV file, or to MOV/MP4 files and related formats such as 3GP or M4A. Please note that it is auto-inserted for MP4A-LATM and MOV/MP4 and related formats.

13.2 av1_metadata

Modify metadata embedded in an AV1 stream.

td

Insert or remove temporal delimiter OBUs in all temporal units of the stream.

insert

Insert a TD at the beginning of every TU which does not already have one.

remove

Remove the TD from the beginning of every TU which has one.

color_primaries
transfer_characteristics
matrix_coefficients

Set the color description fields in the stream (see AV1 section 6.4.2).

color_range

Set the color range in the stream (see AV1 section 6.4.2; note that this cannot be set for streams using BT.709 primaries, sRGB transfer characteristic and identity (RGB) matrix coefficients).

tv

有限范围。

pc

完整范围。

chroma_sample_position

Set the chroma sample location in the stream (see AV1 section 6.4.2). This can only be set for 4:2:0 streams.

vertical

Left position (matching the default in MPEG-2 and H.264).

colocated

Top-left position.

tick_rate

Set the tick rate ( num_units_in_display_tick / time_scale ) in the timing info in the sequence header.

num_ticks_per_picture

Set the number of ticks in each picture, to indicate that the stream has a fixed framerate. Ignored if ‘ tick_rate ’ is not also set.

delete_padding

Deletes Padding OBUs.

13.3 chomp

Remove zero padding at the end of a packet.

13.4 dca_core

Extract the core from a DCA/DTS stream, dropping extensions such as DTS-HD.

13.5 dump_extra

Add extradata to the beginning of the filtered packets except when said packets already exactly begin with the extradata that is intended to be added.

freq

The additional argument specifies which packets should be filtered. It accepts the values:

k
keyframe

add extradata to all key packets

e
all

add extradata to all packets

If not specified it is assumed ‘ k ’.

For example the following ffmpeg command forces a global header (thus disabling individual packet headers) in the H.264 packets generated by the libx264 encoder, but corrects them by adding the header stored in extradata to the key packets:

ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts
                        

13.6 eac3_core

Extract the core from a E-AC-3 stream, dropping extra channels.

13.7 extract_extradata

Extract the in-band extradata.

Certain codecs allow the long-term headers (e.g. MPEG-2 sequence headers, or H.264/HEVC (VPS/)SPS/PPS) to be transmitted either "in-band" (i.e. as a part of the bitstream containing the coded frames) or "out of band" (e.g. on the container level). This latter form is called "extradata" in FFmpeg terminology.

This bitstream filter detects the in-band headers and makes them available as extradata.

remove

When this option is enabled, the long-term headers are removed from the bitstream after extraction.

13.8 filter_units

Remove units with types in or not in a given set from the stream.

pass_types

List of unit types or ranges of unit types to pass through while removing all others. This is specified as a ’|’-separated list of unit type values or ranges of values with ’-’.

remove_types

Identical to ‘ pass_types ’, except the units in the given set removed and all others passed through.

Extradata is unchanged by this transformation, but note that if the stream contains inline parameter sets then the output may be unusable if they are removed.

For example, to remove all non-VCL NAL units from an H.264 stream:

ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=pass_types=1-5' OUTPUT
                        

To remove all AUDs, SEI and filler from an H.265 stream:

ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=35|38-40' OUTPUT
                        

13.9 hapqa_extract

Extract Rgb or Alpha part of an HAPQA file, without recompression, in order to create an HAPQ or an HAPAlphaOnly file.

texture

Specifies the texture to keep.

color
alpha

Convert HAPQA to HAPQ

ffmpeg -i hapqa_inputfile.mov -c copy -bsf:v hapqa_extract=texture=color -tag:v HapY -metadata:s:v:0 encoder="HAPQ" hapq_file.mov
                        

Convert HAPQA to HAPAlphaOnly

ffmpeg -i hapqa_inputfile.mov -c copy -bsf:v hapqa_extract=texture=alpha -tag:v HapA -metadata:s:v:0 encoder="HAPAlpha Only" hapalphaonly_file.mov
                        

13.10 h264_metadata

Modify metadata embedded in an H.264 stream.

aud

Insert or remove AUD NAL units in all access units of the stream.

insert
remove
sample_aspect_ratio

Set the sample aspect ratio of the stream in the VUI parameters.

video_format
video_full_range_flag

Set the video format in the stream (see H.264 section E.2.1 and table E-2).

colour_primaries
transfer_characteristics
matrix_coefficients

Set the colour description in the stream (see H.264 section E.2.1 and tables E-3, E-4 and E-5).

chroma_sample_loc_type

Set the chroma sample location in the stream (see H.264 section E.2.1 and figure E-1).

tick_rate

Set the tick rate (num_units_in_tick / time_scale) in the VUI parameters. This is the smallest time unit representable in the stream, and in many cases represents the field rate of the stream (double the frame rate).

fixed_frame_rate_flag

Set whether the stream has fixed framerate - typically this indicates that the framerate is exactly half the tick rate, but the exact meaning is dependent on interlacing and the picture structure (see H.264 section E.2.1 and table E-6).

crop_left
crop_right
crop_top
crop_bottom

Set the frame cropping offsets in the SPS. These values will replace the current ones if the stream is already cropped.

These fields are set in pixels. Note that some sizes may not be representable if the chroma is subsampled or the stream is interlaced (see H.264 section 7.4.2.1.1).

sei_user_data

Insert a string as SEI unregistered user data. The argument must be of the form UUID+string , where the UUID is as hex digits possibly separated by hyphens, and the string can be anything.

For example, ‘ 086f3693-b7b3-4f2c-9653-21492feee5b8+hello ’ will insert the string “hello” associated with the given UUID.

delete_filler

Deletes both filler NAL units and filler SEI messages.

level

Set the level in the SPS. Refer to H.264 section A.3 and tables A-1 to A-5.

The argument must be the name of a level (for example, ‘ 4.2 ’), a level_idc value (for example, ‘ 42 ’), or the special name ‘ auto ’ indicating that the filter should attempt to guess the level from the input stream properties.

13.11 h264_mp4toannexb

Convert an H.264 bitstream from length prefixed mode to start code prefixed mode (as defined in the Annex B of the ITU-T H.264 specification).

This is required by some streaming formats, typically the MPEG-2 transport stream format (muxer mpegts ).

For example to remux an MP4 file containing an H.264 stream to mpegts format with ffmpeg , you can use the command:

ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
                        

Please note that this filter is auto-inserted for MPEG-TS (muxer mpegts ) and raw H.264 (muxer h264 ) output formats.

13.12 h264_redundant_pps

This applies a specific fixup to some Blu-ray streams which contain redundant PPSs modifying irrelevant parameters of the stream which confuse other transformations which require correct extradata.

A new single global PPS is created, and all of the redundant PPSs within the stream are removed.

13.13 hevc_metadata

Modify metadata embedded in an HEVC stream.

aud

Insert or remove AUD NAL units in all access units of the stream.

insert
remove
sample_aspect_ratio

Set the sample aspect ratio in the stream in the VUI parameters.

video_format
video_full_range_flag

Set the video format in the stream (see H.265 section E.3.1 and table E.2).

colour_primaries
transfer_characteristics
matrix_coefficients

Set the colour description in the stream (see H.265 section E.3.1 and tables E.3, E.4 and E.5).

chroma_sample_loc_type

Set the chroma sample location in the stream (see H.265 section E.3.1 and figure E.1).

tick_rate

Set the tick rate in the VPS and VUI parameters (num_units_in_tick / time_scale). Combined with ‘ num_ticks_poc_diff_one ’, this can set a constant framerate in the stream. Note that it is likely to be overridden by container parameters when the stream is in a container.

num_ticks_poc_diff_one

Set poc_proportional_to_timing_flag in VPS and VUI and use this value to set num_ticks_poc_diff_one_minus1 (see H.265 sections 7.4.3.1 and E.3.1). Ignored if ‘ tick_rate ’ is not also set.

crop_left
crop_right
crop_top
crop_bottom

Set the conformance window cropping offsets in the SPS. These values will replace the current ones if the stream is already cropped.

These fields are set in pixels. Note that some sizes may not be representable if the chroma is subsampled (H.265 section 7.4.3.2.1).

level

Set the level in the VPS and SPS. See H.265 section A.4 and tables A.6 and A.7.

The argument must be the name of a level (for example, ‘ 5.1 ’), a general_level_idc value (for example, ‘ 153 ’ for level 5.1), or the special name ‘ auto ’ indicating that the filter should attempt to guess the level from the input stream properties.

13.14 hevc_mp4toannexb

Convert an HEVC/H.265 bitstream from length prefixed mode to start code prefixed mode (as defined in the Annex B of the ITU-T H.265 specification).

This is required by some streaming formats, typically the MPEG-2 transport stream format (muxer mpegts ).

For example to remux an MP4 file containing an HEVC stream to mpegts format with ffmpeg , you can use the command:

ffmpeg -i INPUT.mp4 -codec copy -bsf:v hevc_mp4toannexb OUTPUT.ts
                        

Please note that this filter is auto-inserted for MPEG-TS (muxer mpegts ) and raw HEVC/H.265 (muxer h265 hevc ) output formats.

13.15 imxdump

Modifies the bitstream to fit in MOV and to be usable by the Final Cut Pro decoder. This filter only applies to the mpeg2video codec, and is likely not needed for Final Cut Pro 7 and newer with the appropriate ‘ -tag:v ’.

For example, to remux 30 MB/sec NTSC IMX to MOV:

ffmpeg -i input.mxf -c copy -bsf:v imxdump -tag:v mx3n output.mov
                        

13.16 mjpeg2jpeg

Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.

MJPEG is a video codec wherein each video frame is essentially a JPEG image. The individual frames can be extracted without loss, e.g. by

ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
                        

Unfortunately, these chunks are incomplete JPEG images, because they lack the DHT segment required for decoding. Quoting from http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml :

Avery Lee, writing in the rec.video.desktop newsgroup in 2001, commented that "MJPEG, or at least the MJPEG in AVIs having the MJPG fourcc, is restricted JPEG with a fixed – and *omitted* – Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2, and it must use basic Huffman encoding, not arithmetic or progressive. . . . You can indeed extract the MJPEG frames and decode them with a regular JPEG decoder, but you have to prepend the DHT segment to them, or else the decoder won’t have any idea how to decompress the data. The exact table necessary is given in the OpenDML spec."

This bitstream filter patches the header of frames extracted from an MJPEG stream (carrying the AVI1 header ID and lacking a DHT segment) to produce fully qualified JPEG images.

ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
exiftran -i -9 frame*.jpg
ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
                        

13.17 mjpegadump

Add an MJPEG A header to the bitstream, to enable decoding by Quicktime.

13.18 mov2textsub

Extract a representable text file from MOV subtitles, stripping the metadata header from each subtitle packet.

另请参阅 text2movsub filter.

13.19 mp3decomp

Decompress non-standard compressed MP3 audio headers.

13.20 mpeg2_metadata

Modify metadata embedded in an MPEG-2 stream.

display_aspect_ratio

Set the display aspect ratio in the stream.

The following fixed values are supported:

4/3
16/9
221/100

Any other value will result in square pixels being signalled instead (see H.262 section 6.3.3 and table 6-3).

frame_rate

Set the frame rate in the stream. This is constructed from a table of known values combined with a small multiplier and divisor - if the supplied value is not exactly representable, the nearest representable value will be used instead (see H.262 section 6.3.3 and table 6-4).

video_format

Set the video format in the stream (see H.262 section 6.3.6 and table 6-6).

colour_primaries
transfer_characteristics
matrix_coefficients

Set the colour description in the stream (see H.262 section 6.3.6 and tables 6-7, 6-8 and 6-9).

13.21 mpeg4_unpack_bframes

Unpack DivX-style packed B-frames.

DivX-style packed B-frames are not valid MPEG-4 and were only a workaround for the broken Video for Windows subsystem. They use more space, can cause minor AV sync issues, require more CPU power to decode (unless the player has some decoded picture queue to compensate the 2,0,2,0 frame per packet style) and cause trouble if copied into a standard container like mp4 or mpeg-ps/ts, because MPEG-4 decoders may not be able to decode them, since they are not valid MPEG-4.

For example to fix an AVI file containing an MPEG-4 stream with DivX-style packed B-frames using ffmpeg , you can use the command:

ffmpeg -i INPUT.avi -codec copy -bsf:v mpeg4_unpack_bframes OUTPUT.avi
                        

13.22 noise

Damages the contents of packets or simply drops them without damaging the container. Can be used for fuzzing or testing error resilience/concealment.

Parameters:

amount

A numeral string, whose value is related to how often output bytes will be modified. Therefore, values below or equal to 0 are forbidden, and the lower the more frequent bytes will be modified, with 1 meaning every byte is modified.

dropamount

A numeral string, whose value is related to how often packets will be dropped. Therefore, values below or equal to 0 are forbidden, and the lower the more frequent packets will be dropped, with 1 meaning every packet is dropped.

The following example applies the modification to every byte but does not drop any packets.

ffmpeg -i INPUT -c copy -bsf noise[=1] output.mkv
                        

13.23 null

This bitstream filter passes the packets through unchanged.

13.24 prores_metadata

Modify color property metadata embedded in prores stream.

color_primaries

Set the color primaries. Available values are:

auto

Keep the same color primaries property (default).

unknown
bt709
bt470bg

BT601 625

smpte170m

BT601 525

bt2020
smpte431

DCI P3

smpte432

P3 D65

transfer_characteristics

Set the color transfer. Available values are:

auto

Keep the same transfer characteristics property (default).

unknown
bt709

BT 601, BT 709, BT 2020

matrix_coefficients

Set the matrix coefficient. Available values are:

auto

Keep the same transfer characteristics property (default).

unknown
bt709
smpte170m

BT 601

bt2020nc

Set Rec709 colorspace for each frame of the file

ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709 output.mov
                        

13.25 remove_extra

Remove extradata from packets.

It accepts the following parameter:

freq

Set which frame types to remove extradata from.

k

Remove extradata from non-keyframes only.

keyframe

Remove extradata from keyframes only.

e, all

Remove extradata from all frames.

13.26 text2movsub

Convert text subtitles to MOV subtitles (as used by the mov_text codec) with metadata headers.

另请参阅 mov2textsub filter.

13.27 trace_headers

Log trace output containing all syntax elements in the coded stream headers (everything above the level of individual coded blocks). This can be useful for debugging low-level stream issues.

Supports AV1, H.264, H.265, (M)JPEG, MPEG-2 and VP9, but depending on the build only a subset of these may be available.

13.28 truehd_core

Extract the core from a TrueHD stream, dropping ATMOS data.

13.29 vp9_metadata

Modify metadata embedded in a VP9 stream.

color_space

Set the color space value in the frame header.

unknown
bt601
bt709
smpte170
smpte240
bt2020
rgb
color_range

Set the color range value in the frame header. Note that this cannot be set in RGB streams.

tv
pc

13.30 vp9_superframe

Merge VP9 invisible (alt-ref) frames back into VP9 superframes. This fixes merging of split/segmented VP9 streams where the alt-ref frame was split from its visible counterpart.

13.31 vp9_superframe_split

Split VP9 superframes into single frames.

13.32 vp9_raw_reorder

Given a VP9 stream with correct timestamps but possibly out of order, insert additional show-existing-frame packets to correct the ordering.

14 Format Options

The libavformat library provides some generic global options, which can be set on all the muxers and demuxers. In addition each muxer or demuxer may support so-called private options, which are specific for that component.

Options may be set by specifying - option value in the FFmpeg tools, or by setting the value explicitly in the AVFormatContext options or using the ‘ libavutil/opt.h ’ API for programmatic use.

The list of supported options follows:

avioflags flags ( input/output )

Possible values:

direct

Reduce buffering.

probesize integer ( input )

Set probing size in bytes, i.e. the size of the data to analyze to get stream information. A higher value will enable detecting more information in case it is dispersed into the stream, but will increase latency. Must be an integer not lesser than 32. It is 5000000 by default.

packetsize integer ( output )

Set packet size.

fflags flags

Set format flags. Some are implemented for a limited number of formats.

Possible values for input files:

discardcorrupt

Discard corrupted packets.

fastseek

Enable fast, but inaccurate seeks for some formats.

genpts

Generate missing PTS if DTS is present.

igndts

Ignore DTS if PTS is set. Inert when nofillin is set.

ignidx

Ignore index.

keepside ( deprecated , inert )
nobuffer

Reduce the latency introduced by buffering during initial input streams analysis.

nofillin

Do not fill in missing values in packet fields that can be exactly calculated.

noparse

Disable AVParsers, this needs +nofillin too.

sortdts

Try to interleave output packets by DTS. At present, available only for AVIs with an index.

Possible values for output files:

autobsf

Automatically apply bitstream filters as required by the output format. Enabled by default.

bitexact

Only write platform-, build- and time-independent data. This ensures that file and data checksums are reproducible and match between platforms. Its primary use is for regression testing.

flush_packets

Write out packets immediately.

latm ( deprecated , inert )
shortest

Stop muxing at the end of the shortest stream. It may be needed to increase max_interleave_delta to avoid flushing the longer streams before EOF.

seek2any integer ( input )

Allow seeking to non-keyframes on demuxer level when supported if set to 1. Default is 0.

analyzeduration integer ( input )

Specify how many microseconds are analyzed to probe the input. A higher value will enable detecting more accurate information, but will increase latency. It defaults to 5,000,000 microseconds = 5 seconds.

cryptokey hexadecimal string ( input )

Set decryption key.

indexmem integer ( input )

Set max memory used for timestamp index (per stream).

rtbufsize integer ( input )

Set max memory used for buffering real-time frames.

fdebug flags ( input/output )

Print specific debug info.

Possible values:

ts
max_delay integer ( input/output )

Set maximum muxing or demuxing delay in microseconds.

fpsprobesize integer ( input )

Set number of frames used to probe fps.

audio_preload integer ( output )

Set microseconds by which audio packets should be interleaved earlier.

chunk_duration integer ( output )

Set microseconds for each chunk.

chunk_size integer ( output )

Set size in bytes for each chunk.

err_detect, f_err_detect flags ( input )

Set error detection flags. f_err_detect is deprecated and should be used only via the ffmpeg tool.

Possible values:

crccheck

Verify embedded CRCs.

bitstream

Detect bitstream specification deviations.

buffer

Detect improper bitstream length.

explode

Abort decoding on minor error detection.

careful

Consider things that violate the spec and have not been seen in the wild as errors.

compliant

Consider all spec non compliancies as errors.

aggressive

Consider things that a sane encoder should not do as an error.

max_interleave_delta integer ( output )

Set maximum buffering duration for interleaving. The duration is expressed in microseconds, and defaults to 1000000 (1 second).

To ensure all the streams are interleaved correctly, libavformat will wait until it has at least one packet for each stream before actually writing any packets to the output file. When some streams are "sparse" (i.e. there are large gaps between successive packets), this can result in excessive buffering.

This field specifies the maximum difference between the timestamps of the first and the last packet in the muxing queue, above which libavformat will output a packet regardless of whether it has queued a packet for all the streams.

If set to 0, libavformat will continue buffering packets until it has a packet for each stream, regardless of the maximum timestamp difference between the buffered packets.

use_wallclock_as_timestamps integer ( input )

Use wallclock as timestamps if set to 1. Default is 0.

avoid_negative_ts integer ( output )

Possible values:

make_non_negative

Shift timestamps to make them non-negative. Also note that this affects only leading negative timestamps, and not non-monotonic negative timestamps.

make_zero

Shift timestamps so that the first timestamp is 0.

auto (default)

Enables shifting when required by the target format.

disabled

Disables shifting of timestamp.

When shifting is enabled, all output timestamps are shifted by the same amount. Audio, video, and subtitles desynching and relative timestamp differences are preserved compared to how they would have been without shifting.

skip_initial_bytes integer ( input )

Set number of bytes to skip before reading header and frames if set to 1. Default is 0.

correct_ts_overflow integer ( input )

Correct single timestamp overflows if set to 1. Default is 1.

flush_packets integer ( output )

Flush the underlying I/O stream after each packet. Default is -1 (auto), which means that the underlying protocol will decide, 1 enables it, and has the effect of reducing the latency, 0 disables it and may increase IO throughput in some cases.

output_ts_offset offset ( output )

Set the output time offset.

offset must be a time duration specification, see (ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual .

The offset is added by the muxer to the output timestamps.

Specifying a positive offset means that the corresponding streams are delayed bt the time duration specified in offset . Default value is 0 (meaning that no offset is applied).

format_whitelist list ( input )

"," separated list of allowed demuxers. By default all are allowed.

dump_separator string ( input )

Separator used to separate the fields printed on the command line about the Stream parameters. For example, to separate the fields with newlines and indentation:

ffprobe -dump_separator "
                          "  -i ~/videos/matrixbench_mpeg2.mpg
                                
max_streams integer ( input )

Specifies the maximum number of streams. This can be used to reject files that would require too many resources due to a large number of streams.

skip_estimate_duration_from_pts bool ( input )

Skip estimation of input duration when calculated using PTS. At present, applicable for MPEG-PS and MPEG-TS.

strict, f_strict integer ( input/output )

Specify how strictly to follow the standards. f_strict is deprecated and should be used only via the ffmpeg tool.

Possible values:

very

strictly conform to an older more strict version of the spec or reference software

strict

strictly conform to all the things in the spec no matter what consequences

normal
unofficial

allow unofficial extensions

experimental

allow non standardized experimental things, experimental (unfinished/work in progress/not well tested) decoders and encoders. Note: experimental decoders can pose a security risk, do not use this for decoding untrusted input.

14.1 Format stream specifiers

Format stream specifiers allow selection of one or more streams that match specific properties.

The exact semantics of stream specifiers is defined by the avformat_match_stream_specifier() function declared in the ‘ libavformat/avformat.h ’ header and documented in the (ffmpeg)Stream specifiers section in the ffmpeg(1) manual .

15 Demuxers

Demuxers are configured elements in FFmpeg that can read the multimedia streams from a particular type of file.

When you configure your FFmpeg build, all the supported demuxers are enabled by default. You can list all available ones using the configure option --list-demuxers .

You can disable all the demuxers using the configure option --disable-demuxers , and selectively enable a single demuxer with the option --enable-demuxer= DEMUXER , or disable it with the option --disable-demuxer= DEMUXER .

The option -demuxers of the ff* tools will display the list of enabled demuxers. Use -formats to view a combined list of enabled demuxers and muxers.

The description of some of the currently available demuxers follows.

15.1 aa

Audible Format 2, 3, and 4 demuxer.

This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files.

15.2 apng

Animated Portable Network Graphics demuxer.

This demuxer is used to demux APNG files. All headers, but the PNG signature, up to (but not including) the first fcTL chunk are transmitted as extradata. Frames are then split as being all the chunks between two fcTL ones, or between the last fcTL and IEND chunks.

-ignore_loop bool

Ignore the loop variable in the file if set.

-max_fps int

Maximum framerate in frames per second (0 for no limit).

-default_fps int

Default framerate in frames per second when none is specified in the file (0 meaning as fast as possible).

15.3 asf

Advanced Systems Format demuxer.

This demuxer is used to demux ASF files and MMS network streams.

-no_resync_search bool

Do not try to resynchronize by looking for a certain optional start code.

15.4 concat

Virtual concatenation script demuxer.

This demuxer reads a list of files and other directives from a text file and demuxes them one after the other, as if all their packets had been muxed together.

The timestamps in the files are adjusted so that the first file starts at 0 and each next file starts where the previous one finishes. Note that it is done globally and may cause gaps if all streams do not have exactly the same length.

All files must have the same streams (same codecs, same time base, etc.).

The duration of each file is used to adjust the timestamps of the next file: if the duration is incorrect (because it was computed using the bit-rate or because the file is truncated, for example), it can cause artifacts. The duration directive can be used to override the duration stored in each file.

15.4.1 Syntax

The script is a text file in extended-ASCII, with one directive per line. Empty lines, leading spaces and lines starting with ’#’ are ignored. The following directive is recognized: