ffprobe [options] [input_file]
ffprobe gathers information from multimedia streams and prints it in human- and machine-readable fashion.
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 filename is specified in input, ffprobe will try to open and probe the file content. If the file 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.
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.
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
or -codec: copy
would copy all the streams without reencoding.
Possible forms of stream specifiers are:
Matches the stream with this index. E.g. -threads:1 4
would set the
thread count for the second stream to 4.
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 stream_index is given, then it matches stream number stream_index of this type. Otherwise, it matches all streams of this type.
If stream_index is given, then it matches the stream with number stream_index in the program with the id program_id. Otherwise, it matches all streams in the program.
Match the stream by stream id (e.g. PID in MPEG-TS container).
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.
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.
These options are shared amongst the ff* tools.
Show license.
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:
Print advanced tool options in addition to the basic tool options.
Print complete list of options, including shared and private options for encoders, decoders, demuxers, muxers, filters, etc.
Print detailed information about the decoder named decoder_name. Use the -decoders option to get a list of all decoders.
Print detailed information about the encoder named encoder_name. Use the -encoders option to get a list of all encoders.
Print detailed information about the demuxer named demuxer_name. Use the -formats option to get a list of all demuxers and muxers.
Print detailed information about the muxer named muxer_name. Use the -formats option to get a list of all muxers and demuxers.
Print detailed information about the filter name filter_name. Use the -filters option to get a list of all filters.
Show version.
Show available formats (including devices).
Show available devices.
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.
Show available decoders.
Show all available encoders.
Show available bitstream filters.
Show available protocols.
Show available libavfilter filters.
Show available pixel formats.
Show available sample formats.
Show channel names and standard channel layouts.
Show recognized color names.
Show autodetected sources of the intput 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
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
Set the logging level used by the library. Adding "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. "repeat" can also be used alone. If "repeat" is used alone, and with no prior loglevel set, the default loglevel will be used. If multiple loglevel parameters are given, using ’repeat’ will not change the loglevel. loglevel is a string or a number containing one of the following values:
Show nothing at all; be silent.
Only show fatal errors which could lead the process to crash, such as and assert failure. This is not currently used for anything.
Only show fatal errors. These are errors after which the process absolutely cannot continue after.
Show all errors, including ones which can be recovered from.
Show all warnings and errors. Any message related to possibly incorrect or unexpected events will be shown.
Show informative messages during processing. This is in addition to warnings and errors. This is the default value.
Same as info
, except more verbose.
Show everything, including debugging information.
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
or 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 following FFmpeg version.
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 verbose
.
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:
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 %
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.
Suppress printing 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.
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:
This option is used to benchmark all available OpenCL devices and print the
results. This option is only available when FFmpeg has been compiled with
--enable-opencl
.
When FFmpeg is configured with --enable-opencl
, the options for the
global OpenCL context are set via -opencl_options. See the
"OpenCL Options" section in the ffmpeg-utils manual for the complete list of
supported options. Amongst others, these options include the ability to select
a specific platform and device to run the OpenCL code on. By default, FFmpeg
will run on the first device of the first platform. While the options for the
global OpenCL context provide flexibility to the user in selecting the OpenCL
device of their choice, most users would probably want to select the fastest
OpenCL device for their system.
This option assists the selection of the most efficient configuration by
identifying the appropriate device for the user’s system. The built-in
benchmark is run on all the OpenCL devices and the performance is measured for
each device. The devices in the results list are sorted based on their
performance with the fastest device listed first. The user can subsequently
invoke ffmpeg
using the device deemed most appropriate via
-opencl_options to obtain the best performance for the OpenCL
accelerated code.
Typical usage to use the fastest OpenCL device involve the following steps.
Run the command:
ffmpeg -opencl_bench
Note down the platform ID (pidx) and device ID (didx) of the first i.e. fastest device in the list. Select the platform and device using the command:
ffmpeg -opencl_options platform_idx=pidx:device_idx=didx ...
Set OpenCL environment options. This option is only available when
FFmpeg has been compiled with --enable-opencl
.
options must be a list of key=value option pairs separated by ’:’. See the “OpenCL Options” section in the ffmpeg-utils manual for the list of supported options.
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:
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.
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.
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.
Force format to use.
Show the unit of the displayed values.
Use SI prefixes for the displayed values. Unless the "-byte_binary_prefix" option is used all the prefixes are decimal.
Force the use of binary prefixes for byte values.
Use sexagesimal format HH:MM:SS.MICROSECONDS for time values.
Prettify the format of the displayed values, it corresponds to the options "-unit -prefix -byte_binary_prefix -sexagesimal".
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.
Print sections structure and section information, and exit. The output is not meant to be parsed by a machine.
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 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 a hash of payload data, for packets with -show_packets and for codec extradata with -show_streams.
Show information about the error found when trying to probe the input.
The error information is printed within a section with name "ERROR".
Show information about the container format of the input multimedia stream.
All the container format information is printed within a section with name "FORMAT".
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
instead.
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 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 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 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 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 information about chapters stored in the format.
Each chapter is printed within a dedicated section with name "CHAPTER".
Count the number of frames per stream and report it in the corresponding stream section.
Count the number of packets per stream and report it in the corresponding stream section.
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 abolute 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.
01:30
(1 minute and thirty
seconds) and read packets until position 01:45
.
10%+20,01:30%01:45
01:23
:
01:23%+#42
%+20
02:30
:
%02:30
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 information related to program version.
Version information is printed within a section with name "PROGRAM_VERSION".
Show information related to library versions.
Version information for each library is printed within a section with name "LIBRARY_VERSION".
Show information related to program and library versions. This is the equivalent of setting both -show_program_version and -show_library_versions options.
Show information about all pixel formats supported by FFmpeg.
Pixel format information for each format is printed within a section with name "PIXEL_FORMAT".
Force bitexact output, useful to produce output which is not dependent on the specific build.
Read input_file.
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:
Set string validation mode.
The following values are accepted.
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.
Any validation error will be ignored. This will result in possibly broken output, especially with the json or xml writer.
The writer will substitute invalid UTF-8 sequences or code points with the string specified with the string_validation_replacement.
Default value is ‘replace’.
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.
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.
If set to 1 specify not to print the key of each field. Default value is 0.
If set to 1 specify not to print the section header and footer. Default value is 0.
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 specifid, 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.
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).
If set to 1 specify not to print the key of each field. Its default
value is 0 (1 for the csv
writer).
Set the escape mode to use, default to "c" ("csv" for the csv
writer).
It can assume one of the following values:
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’.
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.
Perform no escaping.
Print the section name at the begin of each line if the value is
1
, disable it with value set to 0
. Default value is
1
.
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.
Separator character used to separate the chapter, the section name, IDs and potential tags in the printed field key.
Default value is ‘.’.
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.
INI format output.
Print output in an INI based format.
The following conventions are adopted:
This writer accepts options as a list of key=value pairs, separated by ‘:’.
The description of the accepted options follows.
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.
JSON based format.
Each section is printed using JSON notation.
The description of the accepted options follows.
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/.
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.
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.
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 http://www.w3.org/XML/.
ffprobe
supports Timecode extraction:
This section documents the syntax and formats employed by the FFmpeg libraries and tools.
FFmpeg adopts the following quoting and escaping mechanism, unless explicitly specified. The following rules are applied:
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.
Crime d'Amour
containing the '
special
character:
Crime d\'Amour
'
needs to be escaped
when quoting it:
'Crime d'\''Amour'
' this string starts and ends with whitespaces '
' The string '\'string\'' is a string '
'c:\foo' can be written as c:\\foo
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.
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.
or
[-]S+[.m...]
S expresses the number of seconds, with the optional decimal part m.
In both expressions, the optional ‘-’ indicates negative duration.
The following examples are all valid time duration:
55 seconds
12 hours, 03 minutes and 45 seconds
23.189 seconds
Specify the size of the sourced video, it may be a string of the form widthxheight, or the name of a size abbreviation.
The following abbreviations are recognized:
720x480
720x576
352x240
352x288
640x480
768x576
352x240
352x240
128x96
176x144
352x288
704x576
1408x1152
160x120
320x240
640x480
800x600
1024x768
1600x1200
2048x1536
1280x1024
2560x2048
5120x4096
852x480
1366x768
1600x1024
1920x1200
2560x1600
3200x2048
3840x2400
6400x4096
7680x4800
320x200
640x350
852x480
1280x720
1920x1080
2048x1080
1998x1080
2048x858
4096x2160
3996x2160
4096x1716
640x360
240x160
400x240
432x240
480x320
960x540
2048x1080
4096x2160
3840x2160
7680x4320
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:
30000/1001
25/1
30000/1001
25/1
30000/1001
25/1
24/1
24000/1001
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.
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:
0xF0F8FF
0xFAEBD7
0x00FFFF
0x7FFFD4
0xF0FFFF
0xF5F5DC
0xFFE4C4
0x000000
0xFFEBCD
0x0000FF
0x8A2BE2
0xA52A2A
0xDEB887
0x5F9EA0
0x7FFF00
0xD2691E
0xFF7F50
0x6495ED
0xFFF8DC
0xDC143C
0x00FFFF
0x00008B
0x008B8B
0xB8860B
0xA9A9A9
0x006400
0xBDB76B
0x8B008B
0x556B2F
0xFF8C00
0x9932CC
0x8B0000
0xE9967A
0x8FBC8F
0x483D8B
0x2F4F4F
0x00CED1
0x9400D3
0xFF1493
0x00BFFF
0x696969
0x1E90FF
0xB22222
0xFFFAF0
0x228B22
0xFF00FF
0xDCDCDC
0xF8F8FF
0xFFD700
0xDAA520
0x808080
0x008000
0xADFF2F
0xF0FFF0
0xFF69B4
0xCD5C5C
0x4B0082
0xFFFFF0
0xF0E68C
0xE6E6FA
0xFFF0F5
0x7CFC00
0xFFFACD
0xADD8E6
0xF08080
0xE0FFFF
0xFAFAD2
0x90EE90
0xD3D3D3
0xFFB6C1
0xFFA07A
0x20B2AA
0x87CEFA
0x778899
0xB0C4DE
0xFFFFE0
0x00FF00
0x32CD32
0xFAF0E6
0xFF00FF
0x800000
0x66CDAA
0x0000CD
0xBA55D3
0x9370D8
0x3CB371
0x7B68EE
0x00FA9A
0x48D1CC
0xC71585
0x191970
0xF5FFFA
0xFFE4E1
0xFFE4B5
0xFFDEAD
0x000080
0xFDF5E6
0x808000
0x6B8E23
0xFFA500
0xFF4500
0xDA70D6
0xEEE8AA
0x98FB98
0xAFEEEE
0xD87093
0xFFEFD5
0xFFDAB9
0xCD853F
0xFFC0CB
0xDDA0DD
0xB0E0E6
0x800080
0xFF0000
0xBC8F8F
0x4169E1
0x8B4513
0xFA8072
0xF4A460
0x2E8B57
0xFFF5EE
0xA0522D
0xC0C0C0
0x87CEEB
0x6A5ACD
0x708090
0xFFFAFA
0x00FF7F
0x4682B4
0xD2B48C
0x008080
0xD8BFD8
0xFF6347
0x40E0D0
0xEE82EE
0xF5DEB3
0xFFFFFF
0xF5F5F5
0xFFFF00
0x9ACD32
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:
front left
front right
front center
low frequency
back left
back right
front left-of-center
front right-of-center
back center
side left
side right
top center
top front left
top front center
top front right
top back left
top back center
top back right
downmix left
downmix right
wide left
wide right
surround direct left
surround direct right
low frequency 2
Standard channel layout compositions can be specified by using the following identifiers:
FC
FL+FR
FL+FR+LFE
FL+FR+FC
FL+FR+BC
FL+FR+FC+BC
FL+FR+BL+BR
FL+FR+SL+SR
FL+FR+FC+LFE
FL+FR+FC+BL+BR
FL+FR+FC+SL+SR
FL+FR+FC+LFE+BC
FL+FR+FC+LFE+BL+BR
FL+FR+FC+LFE+SL+SR
FL+FR+FC+BC+SL+SR
FL+FR+FLC+FRC+SL+SR
FL+FR+FC+BL+BR+BC
FL+FR+FC+LFE+BC+SL+SR
FL+FR+FC+LFE+BL+BR+BC
FL+FR+LFE+FLC+FRC+SL+SR
FL+FR+FC+BL+BR+SL+SR
FL+FR+FC+FLC+FRC+SL+SR
FL+FR+FC+LFE+BL+BR+SL+SR
FL+FR+FC+LFE+BL+BR+FLC+FRC
FL+FR+FC+LFE+FLC+FRC+SL+SR
FL+FR+FC+BL+BR+BC+SL+SR
DL+DR
A custom channel layout can be specified as a sequence of terms, separated by ’+’ or ’|’. Each term can be:
av_get_default_channel_layout
)
AV_CH_*
macros in libavutil/channel_layout.h.
Starting from libavutil version 53 the trailing character "c" to specify a number of channels will be required, while a channel layout mask could also be specified as a decimal number (if and only if not followed by "c").
See also the function av_get_channel_layout
defined in
libavutil/channel_layout.h.
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:
Compute absolute value of x.
Compute arccosine of x.
Compute arcsine of x.
Compute arctangent of x.
Return 1 if x is greater than or equal to min and lesser than or equal to max, 0 otherwise.
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).
Round the value of expression expr upwards to the nearest integer. For example, "ceil(1.5)" is "2.0".
Return the value of x clipped between min and max.
Compute cosine of x.
Compute hyperbolic cosine of x.
Return 1 if x and y are equivalent, 0 otherwise.
Compute exponential of x (with base e
, the Euler’s number).
Round the value of expression expr downwards to the nearest integer. For example, "floor(-1.5)" is "-2.0".
Compute Gauss function of x, corresponding to
exp(-x*x/2) / sqrt(2*PI)
.
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.
Return 1 if x is greater than y, 0 otherwise.
Return 1 if x is greater than or equal to y, 0 otherwise.
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.
Evaluate x, and if the result is non-zero return the result of the evaluation of y, return 0 otherwise.
Evaluate x, and if the result is non-zero return the evaluation result of y, otherwise the evaluation result of z.
Evaluate x, and if the result is zero return the result of the evaluation of y, return 0 otherwise.
Evaluate x, and if the result is zero return the evaluation result of y, otherwise the evaluation result of z.
Return 1.0 if x is +/-INFINITY, 0.0 otherwise.
Return 1.0 if x is NAN, 0.0 otherwise.
Load the value of the internal variable with number var, which was previously stored with st(var, expr). The function returns the loaded value.
Compute natural logarithm of x.
Return 1 if x is lesser than y, 0 otherwise.
Return 1 if x is lesser than or equal to y, 0 otherwise.
Return the maximum between x and y.
Return the maximum between x and y.
Compute the remainder of division of x by y.
Return 1.0 if expr is zero, 0.0 otherwise.
Compute the power of x elevated y, it is equivalent to "(x)^(y)".
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
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.
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.
Compute sine of x.
Compute hyperbolic sine of x.
Compute the square root of expr. This is equivalent to "(expr)^.5".
Compute expression 1/(1 + exp(4*x))
.
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.
Compute tangent of x.
Compute hyperbolic tangent of x.
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.
Return the current (wallclock) time in seconds.
Round the value of expression expr towards zero to the nearest integer. For example, "trunc(-1.5)" is "-1.0".
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:
area of the unit disc, approximately 3.14
exp(1) (Euler’s number), approximately 2.718
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.
10^-24 / 2^-80
10^-21 / 2^-70
10^-18 / 2^-60
10^-15 / 2^-50
10^-12 / 2^-40
10^-9 / 2^-30
10^-6 / 2^-20
10^-3 / 2^-10
10^-2
10^-1
10^2
10^3 / 2^10
10^3 / 2^10
10^6 / 2^20
10^9 / 2^30
10^12 / 2^40
10^15 / 2^40
10^18 / 2^50
10^21 / 2^60
10^24 / 2^70
When FFmpeg is configured with --enable-opencl
, it is possible
to set the options for the global OpenCL context.
The list of supported options follows:
Set build options used to compile the registered kernels.
See reference "OpenCL Specification Version: 1.2 chapter 5.6.4".
Select the index of the platform to run OpenCL code.
The specified index must be one of the indexes in the device list
which can be obtained with ffmpeg -opencl_bench
or av_opencl_get_device_list()
.
Select the index of the device used to run OpenCL code.
The specified index must be one of the indexes in the device list which
can be obtained with ffmpeg -opencl_bench
or av_opencl_get_device_list()
.
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:
Set bitrate in bits/s. Default value is 200K.
Set audio bitrate (in bits/s). Default value is 128K.
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.
Set generic flags.
Possible values:
Use four motion vector by macroblock (mpeg4).
Use 1/4 pel motion compensation.
Use loop filter.
Use fixed qscale.
Use gmc.
Always try a mb with mv=<0,0>.
Use internal 2pass ratecontrol in first pass mode.
Use internal 2pass ratecontrol in second pass mode.
Only decode/encode grayscale.
Do not draw edges.
Set error[?] variables during encoding.
Normalize adaptive quantization.
Use interlaced DCT.
Force low delay.
Place global headers in extradata instead of every keyframe.
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.
Apply H263 advanced intra coding / mpeg4 ac prediction.
Deprecated, use mpegvideo private options instead.
Deprecated, use mpegvideo private options instead.
Apply interlaced motion estimation.
Use closed gop.
Set motion estimation method.
Possible values:
zero motion estimation (fastest)
full motion estimation (slowest)
EPZS motion estimation (default)
esa motion estimation (alias for full)
tesa motion estimation
dia motion estimation (alias for epzs)
log motion estimation
phods motion estimation
X1 motion estimation
hex motion estimation
umh motion estimation
iter motion estimation
Set extradata size.
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.
Set the group of picture size. Default value is 12.
Set audio sampling rate (in Hz).
Set number of audio channels.
Set cutoff bandwidth.
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.
Set the frame number.
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.
Set video quantizer scale blur (VBR).
Set min video quantizer scale (VBR). Must be included between -1 and 69, default value is 2.
Set max video quantizer scale (VBR). Must be included between -1 and 1024, default value is 31.
Set max difference between the quantizer scale (VBR).
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.
Set qp factor between P and B frames.
Set ratecontrol method.
Set strategy to choose between I/P/B-frames.
Set RTP payload size in bytes.
Workaround not auto detected encoder bugs.
Possible values:
some old lavc generated msmpeg4v3 files (no autodetection)
Xvid interlacing bug (autodetected if fourcc==XVIX)
(autodetected if fourcc==UMP4)
padding bug (autodetected)
illegal vlc bug (autodetected per fourcc)
old standard qpel (autodetected per fourcc/version)
direct-qpel-blocksize bug (autodetected per fourcc/version)
edge padding bug (autodetected per fourcc/version)
Workaround various bugs in microsoft broken decoders.
trancated frames
Set single coefficient elimination threshold for luminance (negative values also consider DC coefficient).
Set single coefficient elimination threshold for chrominance (negative values also consider dc coefficient)
Specify how strictly to follow the standards.
Possible values:
strictly conform to a older more strict version of the spec or reference software
strictly conform to all the things in the spec no matter what consequences
allow unofficial extensions
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.
Set QP offset between P and B frames.
Set error detection flags.
Possible values:
verify embedded CRCs
detect bitstream specification deviations
detect improper bitstream length
abort decoding on minor error detection
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.
consider things that violate the spec and have not been seen in the wild as errors
consider all spec non compliancies as errors
consider things that a sane encoder should not do as an error
Use MPEG quantizers instead of H.263.
How to keep quantizer between qmin and qmax (0 = clip, 1 = use differentiable function).
Set experimental quantizer modulation.
Set experimental quantizer modulation.
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.
Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR encode. It is of little use elsewise.
Set ratecontrol buffer size (in bits).
Currently useless.
Set QP factor between P and I frames.
Set QP offset between P and I frames.
Set initial complexity for 1-pass encoding.
Set DCT algorithm.
Possible values:
autoselect a good one (default)
fast integer
accurate integer
floating point AAN DCT
Compress bright areas stronger than medium ones.
Set temporal complexity masking.
Set spatial complexity masking.
Set inter masking.
Compress dark areas stronger than medium ones.
Select IDCT implementation.
Possible values:
Automatically pick a IDCT compatible with the simple one
floating point AAN IDCT
Set error concealment strategy.
Possible values:
iterative motion vector (MV) search (slow)
use strong deblock filter for damaged MBs
favor predicting from the previous frame instead of the current
Set prediction method.
Possible values:
Set sample aspect ratio.
Print specific debug info.
Possible values:
picture info
rate control
macroblock (MB) type
per-block quantization parameter (QP)
motion vector
display complexity metadata for the upcoming frame, GoP or for a given duration.
error recognition
memory management control operations (H.264)
visualize quantization parameter (QP), lower QP are tinted greener
visualize block types
picture buffer allocations
threading operations
skip motion compensation
Visualize motion vectors (MVs).
This option is deprecated, see the codecview filter instead.
Possible values:
forward predicted MVs of P-frames
forward predicted MVs of B-frames
backward predicted MVs of B-frames
Set full pel me compare function.
Possible values:
sum of absolute differences, fast (default)
sum of squared errors
sum of absolute Hadamard transformed differences
sum of absolute DCT transformed differences
sum of squared quantization errors (avoid, low quality)
number of bits needed for the block
rate distortion optimal, slow
0
sum of absolute vertical differences
sum of squared vertical differences
noise preserving sum of squared differences
5/3 wavelet, only used in snow
9/7 wavelet, only used in snow
Set sub pel me compare function.
Possible values:
sum of absolute differences, fast (default)
sum of squared errors
sum of absolute Hadamard transformed differences
sum of absolute DCT transformed differences
sum of squared quantization errors (avoid, low quality)
number of bits needed for the block
rate distortion optimal, slow
0
sum of absolute vertical differences
sum of squared vertical differences
noise preserving sum of squared differences
5/3 wavelet, only used in snow
9/7 wavelet, only used in snow
Set macroblock compare function.
Possible values:
sum of absolute differences, fast (default)
sum of squared errors
sum of absolute Hadamard transformed differences
sum of absolute DCT transformed differences
sum of squared quantization errors (avoid, low quality)
number of bits needed for the block
rate distortion optimal, slow
0
sum of absolute vertical differences
sum of squared vertical differences
noise preserving sum of squared differences
5/3 wavelet, only used in snow
9/7 wavelet, only used in snow
Set interlaced dct compare function.
Possible values:
sum of absolute differences, fast (default)
sum of squared errors
sum of absolute Hadamard transformed differences
sum of absolute DCT transformed differences
sum of squared quantization errors (avoid, low quality)
number of bits needed for the block
rate distortion optimal, slow
0
sum of absolute vertical differences
sum of squared vertical differences
noise preserving sum of squared differences
5/3 wavelet, only used in snow
9/7 wavelet, only used in snow
Set diamond type & size for motion estimation.
Set amount of motion predictors from the previous frame.
Set pre motion estimation.
Set pre motion estimation compare function.
Possible values:
sum of absolute differences, fast (default)
sum of squared errors
sum of absolute Hadamard transformed differences
sum of absolute DCT transformed differences
sum of squared quantization errors (avoid, low quality)
number of bits needed for the block
rate distortion optimal, slow
0
sum of absolute vertical differences
sum of squared vertical differences
noise preserving sum of squared differences
5/3 wavelet, only used in snow
9/7 wavelet, only used in snow
Set diamond type & size for motion estimation pre-pass.
Set sub pel motion estimation quality.
Set limit motion vectors range (1023 for DivX player).
Set intra quant bias.
Set inter quant bias.
Possible values:
variable length coder / huffman coder
arithmetic coder
raw (no encoding)
run-length coder
deflate-based coder
Set context model.
Set macroblock decision algorithm (high quality mode).
Possible values:
use mbcmp (default)
use fewest bits
use best rate distortion
Set scene change threshold.
Set min lagrange factor (VBR).
Set max lagrange factor (VBR).
Set noise reduction.
Set number of bits which should be loaded into the rc buffer before decoding starts.
Possible values:
Allow non spec compliant speedup tricks.
Deprecated, use mpegvideo private options instead.
Skip bitstream encoding.
Ignore cropping information from sps.
Place global headers at every keyframe instead of in extradata.
Frame data might be split into multiple chunks.
Show all frames before the first keyframe.
Deprecated, use mpegvideo private options instead.
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.
Deprecated, use mpegvideo private options instead.
Possible values:
detect a good number of threads
Set motion estimation threshold.
Set macroblock threshold.
Set intra_dc_precision.
Set nsse weight.
Set number of macroblock rows at the top which are skipped.
Set number of macroblock rows at the bottom which are skipped.
Possible values:
Possible values:
Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
Set frame skip threshold.
Set frame skip factor.
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.
Set frame skip compare function.
Possible values:
sum of absolute differences, fast (default)
sum of squared errors
sum of absolute Hadamard transformed differences
sum of absolute DCT transformed differences
sum of squared quantization errors (avoid, low quality)
number of bits needed for the block
rate distortion optimal, slow
0
sum of absolute vertical differences
sum of squared vertical differences
noise preserving sum of squared differences
5/3 wavelet, only used in snow
9/7 wavelet, only used in snow
Increase the quantizer for macroblocks close to borders.
Set min macroblock lagrange factor (VBR).
Set max macroblock lagrange factor (VBR).
Set motion estimation bitrate penalty compensation (1.0 = 256).
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:
Discard no frame.
Discard useless frames like 0-sized frames.
Discard all non-reference frames.
Discard all bidirectional frames.
Discard all frames excepts keyframes.
Discard all frames.
Default value is ‘default’.
Refine the two motion vectors used in bidirectional macroblocks.
Downscale frames for dynamic B-frame decision.
Set minimum interval between IDR-frames.
Set reference frames to consider for motion compensation.
Set chroma qp offset from luma.
Set rate-distortion optimal quantization.
Set value multiplied by qscale for each frame and added to scene_change_score.
Adjust sensitivity of b_frame_strategy 1.
Set GOP timecode frame start number, in non drop frame format.
Set desired number of audio channels.
Possible values:
Possible values:
If used as input parameter, it serves as a hint to the decoder, which color_range the input has.
Set the log level offset.
Number of slices, used in parallelized encoding.
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:
Decode more than one part of a single frame at once.
Multithreading using slices works only when the video was encoded with slices.
Decode more than one frame at once.
Default value is ‘slice+frame’.
Set audio service type.
Possible values:
Main Audio Service
Effects
Visually Impaired
Hearing Impaired
Dialogue
Commentary
Emergency
Voice Over
Karaoke
Set sample format audio decoders should prefer. Default value is
none
.
Set the input subtitles character encoding.
Set/override the field order of the video. Possible values:
Progressive video
Interlaced video, top field coded and displayed first
Interlaced video, bottom field coded and displayed first
Interlaced video, top coded first, bottom displayed first
Interlaced video, bottom coded first, top displayed first
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.
"," separated List of allowed decoders. By default all are allowed.
Separator used to separate the fields printed on the command line about the Stream parameters. For example to separate the fields with newlines and indention:
ffprobe -dump_separator " " -i ~/videos/matrixbench_mpeg2.mpg
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.
A description of some of the currently available video decoders follows.
HEVC / H.265 decoder.
Note: the skip_loop_filter option has effect only at level
all
.
Raw video decoder.
This decoder decodes rawvideo streams.
Specify the assumed field type of the input video.
the video is assumed to be progressive (default)
bottom-field-first is assumed
top-field-first is assumed
A description of some of the currently available audio decoders follows.
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).
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 disabled. Produces full range audio.
DRC enabled. Applies a fraction of the stream DRC value. Audio reproduction is between full range and full compression.
DRC enabled. Applies drc_scale asymmetrically. Loud sounds are fully compressed. Soft sounds are enhanced.
FLAC audio decoder.
This decoder aims to implement the complete FLAC specification from Xiph.
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.
Internal wave synthetizer.
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.
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
.
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.
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
.
The following option is supported by the libilbc wrapper.
Enable the enhancement of the decoded audio when set to 1. The default value is 0 (disabled).
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.
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.
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.
Compute clut if no matching CLUT is in the stream.
Never compute CLUT
Always compute CLUT and override the one provided in the stream.
Selects the dvb substream, or all substreams if -1 which is default.
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.
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
.
Specify the IFO file from which the global palette is obtained. (experimental)
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
.
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
.
List of teletext page numbers to decode. You may use the special * string to match all pages. Pages that do not match the specified list are dropped. Default value is *.
Discards the top teletext line. Default value is 1.
Specifies the format of the decoded subtitles. The teletext decoder is capable of decoding the teletext pages to bitmaps or to simple text, you should use "bitmap" for teletext pages, because certain graphics and colors cannot be expressed in simple text. You might use "text" for teletext based subtitles if your application can handle simple text based subtitles. Default value is bitmap.
X offset of generated bitmaps, default is 0.
Y offset of generated bitmaps, default is 0.
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 charactes. Default value is 1.
Sets the display duration of the decoded teletext pages or subtitles in miliseconds. Default value is 30000 which is 30 seconds.
Force transparent background of the generated teletext bitmaps. Default value is 0 which means an opaque (black) background.
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.
Convert MPEG-2/4 AAC ADTS to MPEG-4 Audio Specific Configuration bitstream filter.
This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4 ADTS header and removes the ADTS header.
This is required for example when copying an AAC stream from a raw ADTS AAC container to a FLV or a MOV/MP4 file.
Remove zero padding at the end of a packet.
Add extradata to the beginning of the filtered packets.
The additional argument specifies which packets should be filtered. It accepts the values:
add extradata to all key packets, but only if local_header is set in the flags2 codec context field
add extradata to all key packets
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
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 ("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
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
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
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
Damages the contents of packets without damaging the container. Can be used for fuzzing or testing error resilience/concealment.
Parameters: 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.
ffmpeg -i INPUT -c copy -bsf noise[=1] output.mkv
applies the modification to every byte.
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:
Possible values:
Reduce buffering.
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.
Set packet size.
Set format flags.
Possible values:
Ignore index.
Enable fast, but inaccurate seeks for some formats.
Generate PTS.
Do not fill in missing values that can be exactly calculated.
Disable AVParsers, this needs +nofillin
too.
Ignore DTS.
Discard corrupted frames.
Try to interleave output packets by DTS.
Do not merge side data.
Enable RTP MP4A-LATM payload.
Reduce the latency introduced by optional buffering
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.
Allow seeking to non-keyframes on demuxer level when supported if set to 1. Default is 0.
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.
Set decryption key.
Set max memory used for timestamp index (per stream).
Set max memory used for buffering real-time frames.
Print specific debug info.
Possible values:
Set maximum muxing or demuxing delay in microseconds.
Set number of frames used to probe fps.
Set microseconds by which audio packets should be interleaved earlier.
Set microseconds for each chunk.
Set size in bytes for each chunk.
Set error detection flags. f_err_detect
is deprecated and
should be used only via the ffmpeg
tool.
Possible values:
Verify embedded CRCs.
Detect bitstream specification deviations.
Detect improper bitstream length.
Abort decoding on minor error detection.
Consider things that violate the spec and have not been seen in the wild as errors.
Consider all spec non compliancies as errors.
Consider things that a sane encoder should not do as an error.
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.
Possible values:
Shift timestamps to make them non-negative. Also note that this affects only leading negative timestamps, and not non-monotonic negative timestamps.
Shift timestamps so that the first timestamp is 0.
Enables shifting when required by the target format.
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.
Set number of bytes to skip before reading header and frames if set to 1. Default is 0.
Correct single timestamp overflows if set to 1. Default is 1.
Flush the underlying I/O stream after each packet. Default 1 enables it, and has the effect of reducing the latency; 0 disables it and may slightly increase performance in some cases.
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).
"," separated List of allowed demuxers. By default all are allowed.
Separator used to separate the fields printed on the command line about the Stream parameters. For example to separate the fields with newlines and indention:
ffprobe -dump_separator " " -i ~/videos/matrixbench_mpeg2.mpg
Format stream specifiers allow selection of one or more streams that match specific properties.
Possible forms of stream specifiers are:
Matches the stream with this index.
stream_type is one of following: ’v’ for video, ’a’ for audio, ’s’ for subtitle, ’d’ for data, and ’t’ for attachments. If stream_index is given, then it matches the stream number stream_index of this type. Otherwise, it matches all streams of this type.
If stream_index is given, then it matches the stream with number stream_index in the program with the id program_id. Otherwise, it matches all streams in the program.
Matches the stream by a format-specific ID.
The exact semantics of stream specifiers is defined by the
avformat_match_stream_specifier()
function declared in the
libavformat/avformat.h header.
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 -formats
of the ff* tools will display the list of
enabled demuxers.
The description of some of the currently available demuxers follows.
Audible Format 2, 3, and 4 demuxer.
This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files.
Apple HTTP Live Streaming demuxer.
This demuxer presents all AVStreams from all variant streams. The id field is set to the bitrate variant index number. By setting the discard flags on AVStreams (by pressing ’a’ or ’v’ in ffplay), the caller can decide which variant streams to actually receive. The total bitrate of the variant that the stream belongs to is available in a metadata key named "variant_bitrate".
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 the loop variable in the file if set.
Maximum framerate in frames per second (0 for no limit).
Default framerate in frames per second when none is specified in the file (0 meaning as fast as possible).
Advanced Systems Format demuxer.
This demuxer is used to demux ASF files and MMS network streams.
Do not try to resynchronize by looking for a certain optional start code.
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 packet 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.
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:
file path
Path to a file to read; special characters and spaces must be escaped with backslash or single quotes.
All subsequent file-related directives apply to that file.
ffconcat version 1.0
Identify the script type and version. It also sets the safe option to 1 if it was to its default -1.
To make FFmpeg recognize the format automatically, this directive must appears exactly as is (no extra space or byte-order-mark) on the very first line of the script.
duration dur
Duration of the file. This information can be specified from the file; specifying it here may be more efficient or help if the information from the file is not available or accurate.
If the duration is set for all files, then it is possible to seek in the whole concatenated video.
inpoint timestamp
In point of the file. When the demuxer opens the file it instantly seeks to the specified timestamp. Seeking is done so that all streams can be presented successfully at In point.
This directive works best with intra frame codecs, because for non-intra frame ones you will usually get extra packets before the actual In point and the decoded content will most likely contain frames before In point too.
For each file, packets before the file In point will have timestamps less than
the calculated start timestamp of the file (negative in case of the first
file), and the duration of the files (if not specified by the duration
directive) will be reduced based on their specified In point.
Because of potential packets before the specified In point, packet timestamps may overlap between two concatenated files.
outpoint timestamp
Out point of the file. When the demuxer reaches the specified decoding timestamp in any of the streams, it handles it as an end of file condition and skips the current and all the remaining packets from all streams.
Out point is exclusive, which means that the demuxer will not output packets with a decoding timestamp greater or equal to Out point.
This directive works best with intra frame codecs and formats where all streams are tightly interleaved. For non-intra frame codecs you will usually get additional packets with presentation timestamp after Out point therefore the decoded content will most likely contain frames after Out point too. If your streams are not tightly interleaved you may not get all the packets from all streams before Out point and you may only will be able to decode the earliest stream until Out point.
The duration of the files (if not specified by the duration
directive) will be reduced based on their specified Out point.
file_packet_metadata key=value
Metadata of the packets of the file. The specified metadata will be set for each file packet. You can specify this directive multiple times to add multiple metadata entries.
stream
Introduce a stream in the virtual file. All subsequent stream-related directives apply to the last introduced stream. Some streams properties must be set in order to allow identifying the matching streams in the subfiles. If no streams are defined in the script, the streams from the first file are copied.
exact_stream_id id
Set the id of the stream. If this directive is given, the string with the corresponding id in the subfiles will be used. This is especially useful for MPEG-PS (VOB) files, where the order of the streams is not reliable.
This demuxer accepts the following option:
If set to 1, reject unsafe file paths. A file path is considered safe if it does not contain a protocol specification and is relative and all components only contain characters from the portable character set (letters, digits, period, underscore and hyphen) and have no period at the beginning of a component.
If set to 0, any file name is accepted.
The default is -1, it is equivalent to 1 if the format was automatically probed and 0 otherwise.
If set to 1, try to perform automatic conversions on packet data to make the streams concatenable. The default is 1.
Currently, the only conversion is adding the h264_mp4toannexb bitstream filter to H.264 streams in MP4 format. This is necessary in particular if there are resolution changes.
Adobe Flash Video Format demuxer.
This demuxer is used to demux FLV files and RTMP network streams.
Allocate the streams according to the onMetaData array content.
The Game Music Emu library is a collection of video game music file emulators.
See http://code.google.com/p/game-music-emu/ for more information.
Some files have multiple tracks. The demuxer will pick the first track by default. The track_index option can be used to select a different track. Track indexes start at 0. The demuxer exports the number of tracks as tracks meta data entry.
For very large files, the max_size option may have to be adjusted.
Play media from Internet services using the quvi project.
The demuxer accepts a format option to request a specific quality. It is by default set to best.
See http://quvi.sourceforge.net/ for more information.
FFmpeg needs to be built with --enable-libquvi
for this demuxer to be
enabled.
Animated GIF demuxer.
It accepts the following options:
Set the minimum valid delay between frames in hundredths of seconds. Range is 0 to 6000. Default value is 2.
Set the maximum valid delay between frames in hundredth of seconds. Range is 0 to 65535. Default value is 65535 (nearly eleven minutes), the maximum value allowed by the specification.
Set the default delay between frames in hundredths of seconds. Range is 0 to 6000. Default value is 10.
GIF files can contain information to loop a certain number of times (or infinitely). If ignore_loop is set to 1, then the loop setting from the input will be ignored and looping will not occur. If set to 0, then looping will occur and will cycle the number of times according to the GIF. Default value is 1.
For example, with the overlay filter, place an infinitely looping GIF over another video:
ffmpeg -i input.mp4 -ignore_loop 0 -i input.gif -filter_complex overlay=shortest=1 out.mkv
Note that in the above example the shortest option for overlay filter is used to end the output video at the length of the shortest input file, which in this case is input.mp4 as the GIF in this example loops infinitely.
Image file demuxer.
This demuxer reads from a list of image files specified by a pattern. The syntax and meaning of the pattern is specified by the option pattern_type.
The pattern may contain a suffix which is used to automatically determine the format of the images contained in the files.
The size, the pixel format, and the format of each image must be the same for all the files in the sequence.
This demuxer accepts the following options:
Set the frame rate for the video stream. It defaults to 25.
If set to 1, loop over the input. Default value is 0.
Select the pattern type used to interpret the provided filename.
pattern_type accepts one of the following values.
Disable pattern matching, therefore the video will only contain the specified image. You should use this option if you do not want to create sequences from multiple images and your filenames may contain special pattern characters.
Select a sequence pattern type, used to specify a sequence of files indexed by sequential numbers.
A sequence pattern may contain the string "%d" or "%0Nd", which specifies the position of the characters representing a sequential number in each filename matched by the pattern. If the form "%d0Nd" is used, the string representing the number in each filename is 0-padded and N is the total number of 0-padded digits representing the number. The literal character ’%’ can be specified in the pattern with the string "%%".
If the sequence pattern contains "%d" or "%0Nd", the first filename of the file list specified by the pattern must contain a number inclusively contained between start_number and start_number+start_number_range-1, and all the following numbers must be sequential.
For example the pattern "img-%03d.bmp" will match a sequence of filenames of the form img-001.bmp, img-002.bmp, ..., img-010.bmp, etc.; the pattern "i%%m%%g-%d.jpg" will match a sequence of filenames of the form i%m%g-1.jpg, i%m%g-2.jpg, ..., i%m%g-10.jpg, etc.
Note that the pattern must not necessarily contain "%d" or "%0Nd", for example to convert a single image file img.jpeg you can employ the command:
ffmpeg -i img.jpeg img.png
Select a glob wildcard pattern type.
The pattern is interpreted like a glob()
pattern. This is only
selectable if libavformat was compiled with globbing support.
Select a mixed glob wildcard/sequence pattern.
If your version of libavformat was compiled with globbing support, and
the provided pattern contains at least one glob meta character among
%*?[]{}
that is preceded by an unescaped "%", the pattern is
interpreted like a glob()
pattern, otherwise it is interpreted
like a sequence pattern.
All glob special characters %*?[]{}
must be prefixed
with "%". To escape a literal "%" you shall use "%%".
For example the pattern foo-%*.jpeg
will match all the
filenames prefixed by "foo-" and terminating with ".jpeg", and
foo-%?%?%?.jpeg
will match all the filenames prefixed with
"foo-", followed by a sequence of three characters, and terminating
with ".jpeg".
This pattern type is deprecated in favor of glob and sequence.
Default value is glob_sequence.
Set the pixel format of the images to read. If not specified the pixel format is guessed from the first image file in the sequence.
Set the index of the file matched by the image file pattern to start to read from. Default value is 0.
Set the index interval range to check when looking for the first image file in the sequence, starting from start_number. Default value is 5.
If set to 1, will set frame timestamp to modification time of image file. Note that monotonity of timestamps is not provided: images go in the same order as without this option. Default value is 0. If set to 2, will set frame timestamp to the modification time of the image file in nanosecond precision.
Set the video size of the images to read. If not specified the video size is guessed from the first image file in the sequence.
ffmpeg
for creating a video from the images in the file
sequence img-001.jpeg, img-002.jpeg, ..., assuming an
input frame rate of 10 frames per second:
ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
ffmpeg -framerate 10 -pattern_type glob -i "*.png" out.mkv
MPEG-2 transport stream demuxer.
This demuxer accepts the following options:
Set size limit for looking up a new synchronization. Default value is 65536.
Override teletext packet PTS and DTS values with the timestamps calculated from the PCR of the first program which the teletext stream is part of and is not discarded. Default value is 1, set this option to 0 if you want your teletext packet PTS and DTS values untouched.
Output option carrying the raw packet size in bytes. Show the detected raw packet size, cannot be set by the user.
Scan and combine all PMTs. The value is an integer with value from -1 to 1 (-1 means automatic setting, 1 means enabled, 0 means disabled). Default value is -1.
Raw video demuxer.
This demuxer allows one to read raw video data. Since there is no header specifying the assumed video parameters, the user must specify them in order to be able to decode the data correctly.
This demuxer accepts the following options:
Set input video frame rate. Default value is 25.
Set the input video pixel format. Default value is yuv420p
.
Set the input video size. This value must be specified explicitly.
For example to read a rawvideo file input.raw with
ffplay
, assuming a pixel format of rgb24
, a video
size of 320x240
, and a frame rate of 10 images per second, use
the command:
ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
SBaGen script demuxer.
This demuxer reads the script language used by SBaGen http://uazu.net/sbagen/ to generate binaural beats sessions. A SBG script looks like that:
-SE a: 300-2.5/3 440+4.5/0 b: 300-2.5/0 440+4.5/3 off: - NOW == a +0:07:00 == b +0:14:00 == a +0:21:00 == b +0:30:00 off
A SBG script can mix absolute and relative timestamps. If the script uses either only absolute timestamps (including the script start time) or only relative ones, then its layout is fixed, and the conversion is straightforward. On the other hand, if the script mixes both kind of timestamps, then the NOW reference for relative timestamps will be taken from the current time of day at the time the script is read, and the script layout will be frozen according to that reference. That means that if the script is directly played, the actual times will match the absolute timestamps up to the sound controller’s clock accuracy, but if the user somehow pauses the playback or seeks, all times will be shifted accordingly.
JSON captions used for TED Talks.
TED does not provide links to the captions, but they can be guessed from the page. The file tools/bookmarklets.html from the FFmpeg source tree contains a bookmarklet to expose them.
This demuxer accepts the following option:
Set the start time of the TED talk, in milliseconds. The default is 15000 (15s). It is used to sync the captions with the downloadable videos, because they include a 15s intro.
Example: convert the captions to a format most players understand:
ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded INI-like text file and then load it back using the metadata muxer/demuxer.
The file format is as follows:
Next a chapter section must contain chapter start and end times in form ‘START=num’, ‘END=num’, where num is a positive integer.
A ffmetadata file might look like this:
;FFMETADATA1 title=bike\\shed ;this is a comment artist=FFmpeg troll team [CHAPTER] TIMEBASE=1/1000 START=0 #chapter ends at 0:01:00 END=60000 title=chapter \#1 [STREAM] title=multi\ line
By using the ffmetadata muxer and demuxer it is possible to extract metadata from an input file to an ffmetadata file, and then transcode the file into an output file with the edited ffmetadata file.
Extracting an ffmetadata file with ffmpeg goes as follows:
ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
Reinserting edited metadata information from the FFMETADATAFILE file can be done as:
ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
Protocols are configured elements in FFmpeg that enable access to resources that require specific protocols.
When you configure your FFmpeg build, all the supported protocols are enabled by default. You can list all available ones using the configure option "–list-protocols".
You can disable all the protocols using the configure option "–disable-protocols", and selectively enable a protocol using the option "–enable-protocol=PROTOCOL", or you can disable a particular protocol using the option "–disable-protocol=PROTOCOL".
The option "-protocols" of the ff* tools will display the list of supported protocols.
A description of the currently available protocols follows.
Asynchronous data filling wrapper for input stream.
Fill data in a background thread, to decouple I/O operation from demux thread.
async:URL async:http://host/resource async:cache:http://host/resource
Read BluRay playlist.
The accepted options are:
BluRay angle
Start chapter (1...N)
Playlist to read (BDMV/PLAYLIST/?????.mpls)
Examples:
Read longest playlist from BluRay mounted to /mnt/bluray:
bluray:/mnt/bluray
Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2:
-playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
Caching wrapper for input stream.
Cache the input stream to temporary file. It brings seeking capability to live streams.
cache:URL
Physical concatenation protocol.
Read and seek from many resources in sequence as if they were a unique resource.
A URL accepted by this protocol has the syntax:
concat:URL1|URL2|...|URLN
where URL1, URL2, ..., URLN are the urls of the resource to be concatenated, each one possibly specifying a distinct protocol.
For example to read a sequence of files split1.mpeg,
split2.mpeg, split3.mpeg with ffplay
use the
command:
ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
Note that you may need to escape the character "|" which is special for many shells.
AES-encrypted stream reading protocol.
The accepted options are:
Set the AES decryption key binary block from given hexadecimal representation.
Set the AES decryption initialization vector binary block from given hexadecimal representation.
Accepted URL formats:
crypto:URL crypto+URL
Data in-line in the URI. See http://en.wikipedia.org/wiki/Data_URI_scheme.
For example, to convert a GIF file given inline with ffmpeg
:
ffmpeg -i "data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=" smiley.png
File access protocol.
Read from or write to a file.
A file URL can have the form:
file:filename
where filename is the path of the file to read.
An URL that does not have a protocol prefix will be assumed to be a file URL. Depending on the build, an URL that looks like a Windows path with the drive letter at the beginning will also be assumed to be a file URL (usually not the case in builds for unix-like systems).
For example to read from a file input.mpeg with ffmpeg
use the command:
ffmpeg -i file:input.mpeg output.mpeg
This protocol accepts the following options:
Truncate existing files on write, if set to 1. A value of 0 prevents truncating. Default value is 1.
Set I/O operation maximum block size, in bytes. Default value is
INT_MAX
, which results in not limiting the requested block size.
Setting this value reasonably low improves user termination request reaction
time, which is valuable for files on slow medium.
FTP (File Transfer Protocol).
Read from or write to remote resources using FTP protocol.
Following syntax is required.
ftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
This protocol accepts the following options.
Set timeout in microseconds of socket I/O operations used by the underlying low level operation. By default it is set to -1, which means that the timeout is not specified.
Password used when login as anonymous user. Typically an e-mail address should be used.
Control seekability of connection during encoding. If set to 1 the resource is supposed to be seekable, if set to 0 it is assumed not to be seekable. Default value is 0.
NOTE: Protocol can be used as output, but it is recommended to not do it, unless special care is taken (tests, customized server configuration etc.). Different FTP servers behave in different way during seek operation. ff* tools may produce incomplete content due to server limitations.
Gopher protocol.
Read Apple HTTP Live Streaming compliant segmented stream as a uniform one. The M3U8 playlists describing the segments can be remote HTTP resources or local files, accessed using the standard file protocol. The nested protocol is declared by specifying "+proto" after the hls URI scheme name, where proto is either "file" or "http".
hls+http://host/path/to/remote/resource.m3u8 hls+file://path/to/local/resource.m3u8
Using this protocol is discouraged - the hls demuxer should work just as well (if not, please report the issues) and is more complete. To use the hls demuxer instead, simply use the direct URLs to the m3u8 files.
HTTP (Hyper Text Transfer Protocol).
This protocol accepts the following options:
Control seekability of connection. If set to 1 the resource is supposed to be seekable, if set to 0 it is assumed not to be seekable, if set to -1 it will try to autodetect if it is seekable. Default value is -1.
If set to 1 use chunked Transfer-Encoding for posts, default is 1.
Set a specific content type for the POST messages.
Set custom HTTP headers, can override built in default headers. The value must be a string encoding the headers.
Use persistent connections if set to 1, default is 0.
Set custom HTTP post data.
Override the User-Agent header. If not specified the protocol will use a string describing the libavformat build. ("Lavf/<version>")
Set timeout in microseconds of socket I/O operations used by the underlying low level operation. By default it is set to -1, which means that the timeout is not specified.
Export the MIME type.
If set to 1 request ICY (SHOUTcast) metadata from the server. If the server supports this, the metadata has to be retrieved by the application by reading the icy_metadata_headers and icy_metadata_packet options. The default is 1.
If the server supports ICY metadata, this contains the ICY-specific HTTP reply headers, separated by newline characters.
If the server supports ICY metadata, and icy was set to 1, this contains the last non-empty metadata packet sent by the server. It should be polled in regular intervals by applications interested in mid-stream metadata updates.
Set the cookies to be sent in future requests. The format of each cookie is the same as the value of a Set-Cookie HTTP response field. Multiple cookies can be delimited by a newline character.
Set initial byte offset.
Try to limit the request to bytes preceding this offset.
When used as a client option it sets the HTTP method for the request.
When used as a server option it sets the HTTP method that is going to be expected from the client(s). If the expected and the received HTTP method do not match the client will be given a Bad Request response. When unset the HTTP method is not checked for now. This will be replaced by autodetection in the future.
If set to 1 enables experimental HTTP server. This can be used to send data when used as an output option, or read data from a client with HTTP POST when used as an input option. If set to 2 enables experimental mutli-client HTTP server. This is not yet implemented in ffmpeg.c or ffserver.c and thus must not be used as a command line option.
# Server side (sending): ffmpeg -i somefile.ogg -c copy -listen 1 -f ogg http://server:port # Client side (receiving): ffmpeg -i http://server:port -c copy somefile.ogg # Client can also be done with wget: wget http://server:port -O somefile.ogg # Server side (receiving): ffmpeg -listen 1 -i http://server:port -c copy somefile.ogg # Client side (sending): ffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://server:port # Client can also be done with wget: wget --post-file=somefile.ogg http://server:port
Some HTTP requests will be denied unless cookie values are passed in with the request. The cookies option allows these cookies to be specified. At the very least, each cookie must specify a value along with a path and domain. HTTP requests that match both the domain and path will automatically include the cookie value in the HTTP Cookie header field. Multiple cookies can be delimited by a newline.
The required syntax to play a stream specifying a cookie is:
ffplay -cookies "nlqptid=nltid=tsn; path=/; domain=somedomain.com;" http://somedomain.com/somestream.m3u8
Icecast protocol (stream to Icecast servers)
This protocol accepts the following options:
Set the stream genre.
Set the stream name.
Set the stream description.
Set the stream website URL.
Set if the stream should be public. The default is 0 (not public).
Override the User-Agent header. If not specified a string of the form "Lavf/<version>" will be used.
Set the Icecast mountpoint password.
Set the stream content type. This must be set if it is different from audio/mpeg.
This enables support for Icecast versions < 2.4.0, that do not support the HTTP PUT method but the SOURCE method.
icecast://[username[:password]@]server:port/mountpoint
MMS (Microsoft Media Server) protocol over TCP.
MMS (Microsoft Media Server) protocol over HTTP.
The required syntax is:
mmsh://server[:port][/app][/playpath]
MD5 output protocol.
Computes the MD5 hash of the data to be written, and on close writes this to the designated output or stdout if none is specified. It can be used to test muxers without writing an actual file.
Some examples follow.
# Write the MD5 hash of the encoded AVI file to the file output.avi.md5. ffmpeg -i input.flv -f avi -y md5:output.avi.md5 # Write the MD5 hash of the encoded AVI file to stdout. ffmpeg -i input.flv -f avi -y md5:
Note that some formats (typically MOV) require the output protocol to be seekable, so they will fail with the MD5 output protocol.
UNIX pipe access protocol.
Read and write from UNIX pipes.
The accepted syntax is:
pipe:[number]
number is the number corresponding to the file descriptor of the pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If number is not specified, by default the stdout file descriptor will be used for writing, stdin for reading.
For example to read from stdin with ffmpeg
:
cat test.wav | ffmpeg -i pipe:0 # ...this is the same as... cat test.wav | ffmpeg -i pipe:
For writing to stdout with ffmpeg
:
ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi # ...this is the same as... ffmpeg -i test.wav -f avi pipe: | cat > test.avi
This protocol accepts the following options:
Set I/O operation maximum block size, in bytes. Default value is
INT_MAX
, which results in not limiting the requested block size.
Setting this value reasonably low improves user termination request reaction
time, which is valuable if data transmission is slow.
Note that some formats (typically MOV), require the output protocol to be seekable, so they will fail with the pipe output protocol.
Real-Time Messaging Protocol.
The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia content across a TCP/IP network.
The required syntax is:
rtmp://[username:password@]server[:port][/app][/instance][/playpath]
The accepted parameters are:
An optional username (mostly for publishing).
An optional password (mostly for publishing).
The address of the RTMP server.
The number of the TCP port to use (by default is 1935).
It is the name of the application to access. It usually corresponds to
the path where the application is installed on the RTMP server
(e.g. /ondemand/, /flash/live/, etc.). You can override
the value parsed from the URI through the rtmp_app
option, too.
It is the path or name of the resource to play with reference to the
application specified in app, may be prefixed by "mp4:". You
can override the value parsed from the URI through the rtmp_playpath
option, too.
Act as a server, listening for an incoming connection.
Maximum time to wait for the incoming connection. Implies listen.
Additionally, the following parameters can be set via command line options
(or in code via AVOption
s):
Name of application to connect on the RTMP server. This option overrides the parameter specified in the URI.
Set the client buffer time in milliseconds. The default is 3000.
Extra arbitrary AMF connection parameters, parsed from a string,
e.g. like B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0
.
Each value is prefixed by a single character denoting the type,
B for Boolean, N for number, S for string, O for object, or Z for null,
followed by a colon. For Booleans the data must be either 0 or 1 for
FALSE or TRUE, respectively. Likewise for Objects the data must be 0 or
1 to end or begin an object, respectively. Data items in subobjects may
be named, by prefixing the type with ’N’ and specifying the name before
the value (i.e. NB:myFlag:1
). This option may be used multiple
times to construct arbitrary AMF sequences.
Version of the Flash plugin used to run the SWF player. The default is LNX 9,0,124,2. (When publishing, the default is FMLE/3.0 (compatible; <libavformat version>).)
Number of packets flushed in the same request (RTMPT only). The default is 10.
Specify that the media is a live stream. No resuming or seeking in
live streams is possible. The default value is any
, which means the
subscriber first tries to play the live stream specified in the
playpath. If a live stream of that name is not found, it plays the
recorded stream. The other possible values are live
and
recorded
.
URL of the web page in which the media was embedded. By default no value will be sent.
Stream identifier to play or to publish. This option overrides the parameter specified in the URI.
Name of live stream to subscribe to. By default no value will be sent. It is only sent if the option is specified or if rtmp_live is set to live.
SHA256 hash of the decompressed SWF file (32 bytes).
Size of the decompressed SWF file, required for SWFVerification.
URL of the SWF player for the media. By default no value will be sent.
URL to player swf file, compute hash/size automatically.
URL of the target stream. Defaults to proto://host[:port]/app.
For example to read with ffplay
a multimedia resource named
"sample" from the application "vod" from an RTMP server "myserver":
ffplay rtmp://myserver/vod/sample
To publish to a password protected server, passing the playpath and app names separately:
ffmpeg -re -i <input> -f flv -rtmp_playpath some/long/path -rtmp_app long/app/name rtmp://username:password@myserver/
Encrypted Real-Time Messaging Protocol.
The Encrypted Real-Time Messaging Protocol (RTMPE) is used for streaming multimedia content within standard cryptographic primitives, consisting of Diffie-Hellman key exchange and HMACSHA256, generating a pair of RC4 keys.
Real-Time Messaging Protocol over a secure SSL connection.
The Real-Time Messaging Protocol (RTMPS) is used for streaming multimedia content across an encrypted connection.
Real-Time Messaging Protocol tunneled through HTTP.
The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used for streaming multimedia content within HTTP requests to traverse firewalls.
Encrypted Real-Time Messaging Protocol tunneled through HTTP.
The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE) is used for streaming multimedia content within HTTP requests to traverse firewalls.
Real-Time Messaging Protocol tunneled through HTTPS.
The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used for streaming multimedia content within HTTPS requests to traverse firewalls.
libsmbclient permits one to manipulate CIFS/SMB network resources.
Following syntax is required.
smb://[[domain:]user[:password@]]server[/share[/path[/file]]]
This protocol accepts the following options.
Set timeout in miliseconds of socket I/O operations used by the underlying low level operation. By default it is set to -1, which means that the timeout is not specified.
Truncate existing files on write, if set to 1. A value of 0 prevents truncating. Default value is 1.
Set the workgroup used for making connections. By default workgroup is not specified.
For more information see: http://www.samba.org/.
Secure File Transfer Protocol via libssh
Read from or write to remote resources using SFTP protocol.
Following syntax is required.
sftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
This protocol accepts the following options.
Set timeout of socket I/O operations used by the underlying low level operation. By default it is set to -1, which means that the timeout is not specified.
Truncate existing files on write, if set to 1. A value of 0 prevents truncating. Default value is 1.
Specify the path of the file containing private key to use during authorization. By default libssh searches for keys in the ~/.ssh/ directory.
Example: Play a file stored on remote server.
ffplay sftp://user:password@server_address:22/home/user/resource.mpeg
Real-Time Messaging Protocol and its variants supported through librtmp.
Requires the presence of the librtmp headers and library during configuration. You need to explicitly configure the build with "–enable-librtmp". If enabled this will replace the native RTMP protocol.
This protocol provides most client functions and a few server functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT), encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled variants of these encrypted types (RTMPTE, RTMPTS).
The required syntax is:
rtmp_proto://server[:port][/app][/playpath] options
where rtmp_proto is one of the strings "rtmp", "rtmpt", "rtmpe", "rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and server, port, app and playpath have the same meaning as specified for the RTMP native protocol. options contains a list of space-separated options of the form key=val.
See the librtmp manual page (man 3 librtmp) for more information.
For example, to stream a file in real-time to an RTMP server using
ffmpeg
:
ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
To play the same stream using ffplay
:
ffplay "rtmp://myserver/live/mystream live=1"
Real-time Transport Protocol.
The required syntax for an RTP URL is: rtp://hostname[:port][?option=val...]
port specifies the RTP port to use.
The following URL options are supported:
Set the TTL (Time-To-Live) value (for multicast only).
Set the remote RTCP port to n.
Set the local RTP port to n.
Set the local RTCP port to n.
Set max packet size (in bytes) to n.
Do a connect()
on the UDP socket (if set to 1) or not (if set
to 0).
List allowed source IP addresses.
List disallowed (blocked) source IP addresses.
Send packets to the source address of the latest received packet (if set to 1) or to a default remote address (if set to 0).
Set the local RTP port to n.
This is a deprecated option. Instead, localrtpport should be used.
Important notes:
Real-Time Streaming Protocol.
RTSP is not technically a protocol handler in libavformat, it is a demuxer and muxer. The demuxer supports both normal RTSP (with data transferred over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with data transferred over RDT).
The muxer can be used to send a stream using RTSP ANNOUNCE to a server supporting it (currently Darwin Streaming Server and Mischa Spiegelmock’s RTSP server).
The required syntax for a RTSP url is:
rtsp://hostname[:port]/path
Options can be set on the ffmpeg
/ffplay
command
line, or set in code via AVOption
s or in
avformat_open_input
.
The following options are supported.
Do not start playing the stream immediately if set to 1. Default value is 0.
Set RTSP transport protocols.
It accepts the following values:
Use UDP as lower transport protocol.
Use TCP (interleaving within the RTSP control channel) as lower transport protocol.
Use UDP multicast as lower transport protocol.
Use HTTP tunneling as lower transport protocol, which is useful for passing proxies.
Multiple lower transport protocols may be specified, in that case they are tried one at a time (if the setup of one fails, the next one is tried). For the muxer, only the ‘tcp’ and ‘udp’ options are supported.
Set RTSP flags.
The following values are accepted:
Accept packets only from negotiated peer address and port.
Act as a server, listening for an incoming connection.
Try TCP for RTP transport first, if TCP is available as RTSP RTP transport.
Default value is ‘none’.
Set media types to accept from the server.
The following flags are accepted:
By default it accepts all media types.
Set minimum local UDP port. Default value is 5000.
Set maximum local UDP port. Default value is 65000.
Set maximum timeout (in seconds) to wait for incoming connections.
A value of -1 means infinite (default). This option implies the rtsp_flags set to ‘listen’.
Set number of packets to buffer for handling of reordered packets.
Set socket TCP I/O timeout in microseconds.
Override User-Agent header. If not specified, it defaults to the libavformat identifier string.
When receiving data over UDP, the demuxer tries to reorder received packets
(since they may arrive out of order, or packets may get lost totally). This
can be disabled by setting the maximum demuxing delay to zero (via
the max_delay
field of AVFormatContext).
When watching multi-bitrate Real-RTSP streams with ffplay
, the
streams to display can be chosen with -vst
n and
-ast
n for video and audio respectively, and can be switched
on the fly by pressing v
and a
.
The following examples all make use of the ffplay
and
ffmpeg
tools.
ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
ffplay -rtsp_transport http rtsp://server/video.mp4
ffmpeg -re -i input -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp output
Session Announcement Protocol (RFC 2974). This is not technically a protocol handler in libavformat, it is a muxer and demuxer. It is used for signalling of RTP streams, by announcing the SDP for the streams regularly on a separate port.
The syntax for a SAP url given to the muxer is:
sap://destination[:port][?options]
The RTP packets are sent to destination on port port,
or to port 5004 if no port is specified.
options is a &
-separated list. The following options
are supported:
Specify the destination IP address for sending the announcements to. If omitted, the announcements are sent to the commonly used SAP announcement multicast address 224.2.127.254 (sap.mcast.net), or ff0e::2:7ffe if destination is an IPv6 address.
Specify the port to send the announcements on, defaults to 9875 if not specified.
Specify the time to live value for the announcements and RTP packets, defaults to 255.
If set to 1, send all RTP streams on the same port pair. If zero (the default), all streams are sent on unique ports, with each stream on a port 2 numbers higher than the previous. VLC/Live555 requires this to be set to 1, to be able to receive the stream. The RTP stack in libavformat for receiving requires all streams to be sent on unique ports.
Example command lines follow.
To broadcast a stream on the local subnet, for watching in VLC:
ffmpeg -re -i input -f sap sap://224.0.0.255?same_port=1
Similarly, for watching in ffplay
:
ffmpeg -re -i input -f sap sap://224.0.0.255
And for watching in ffplay
, over IPv6:
ffmpeg -re -i input -f sap sap://[ff0e::1:2:3:4]
The syntax for a SAP url given to the demuxer is:
sap://[address][:port]
address is the multicast address to listen for announcements on, if omitted, the default 224.2.127.254 (sap.mcast.net) is used. port is the port that is listened on, 9875 if omitted.
The demuxers listens for announcements on the given address and port. Once an announcement is received, it tries to receive that particular stream.
Example command lines follow.
To play back the first stream announced on the normal SAP multicast address:
ffplay sap://
To play back the first stream announced on one the default IPv6 SAP multicast address:
ffplay sap://[ff0e::2:7ffe]
Stream Control Transmission Protocol.
The accepted URL syntax is:
sctp://host:port[?options]
The protocol accepts the following options:
If set to any value, listen for an incoming connection. Outgoing connection is done by default.
Set the maximum number of streams. By default no limit is set.
Secure Real-time Transport Protocol.
The accepted options are:
Select input and output encoding suites.
Supported values:
Set input and output encoding parameters, which are expressed by a base64-encoded representation of a binary block. The first 16 bytes of this binary block are used as master key, the following 14 bytes are used as master salt.
Virtually extract a segment of a file or another stream. The underlying stream must be seekable.
Accepted options:
Start offset of the extracted segment, in bytes.
End offset of the extracted segment, in bytes.
Examples:
Extract a chapter from a DVD VOB file (start and end sectors obtained externally and multiplied by 2048):
subfile,,start,153391104,end,268142592,,:/media/dvd/VIDEO_TS/VTS_08_1.VOB
Play an AVI file directly from a TAR archive:
subfile,,start,183241728,end,366490624,,:archive.tar
Transmission Control Protocol.
The required syntax for a TCP url is:
tcp://hostname:port[?options]
options contains a list of &-separated options of the form key=val.
The list of supported options follows.
Listen for an incoming connection. Default value is 0.
Set raise error timeout, expressed in microseconds.
This option is only relevant in read mode: if no data arrived in more than this time interval, raise error.
Set listen timeout, expressed in milliseconds.
The following example shows how to setup a listening TCP connection
with ffmpeg
, which is then accessed with ffplay
:
ffmpeg -i input -f format tcp://hostname:port?listen ffplay tcp://hostname:port
Transport Layer Security (TLS) / Secure Sockets Layer (SSL)
The required syntax for a TLS/SSL url is:
tls://hostname:port[?options]
The following parameters can be set via command line options
(or in code via AVOption
s):
A file containing certificate authority (CA) root certificates to treat as trusted. If the linked TLS library contains a default this might not need to be specified for verification to work, but not all libraries and setups have defaults built in. The file must be in OpenSSL PEM format.
If enabled, try to verify the peer that we are communicating with. Note, if using OpenSSL, this currently only makes sure that the peer certificate is signed by one of the root certificates in the CA database, but it does not validate that the certificate actually matches the host name we are trying to connect to. (With GnuTLS, the host name is validated as well.)
This is disabled by default since it requires a CA database to be provided by the caller in many cases.
A file containing a certificate to use in the handshake with the peer. (When operating as server, in listen mode, this is more often required by the peer, while client certificates only are mandated in certain setups.)
A file containing the private key for the certificate.
If enabled, listen for connections on the provided port, and assume the server role in the handshake instead of the client role.
Example command lines:
To create a TLS/SSL server that serves an input stream.
ffmpeg -i input -f format tls://hostname:port?listen&cert=server.crt&key=server.key
To play back a stream from the TLS/SSL server using ffplay
:
ffplay tls://hostname:port
User Datagram Protocol.
The required syntax for an UDP URL is:
udp://hostname:port[?options]
options contains a list of &-separated options of the form key=val.
In case threading is enabled on the system, a circular buffer is used to store the incoming data, which allows one to reduce loss of data due to UDP socket buffer overruns. The fifo_size and overrun_nonfatal options are related to this buffer.
The list of supported options follows.
Set the UDP maximum socket buffer size in bytes. This is used to set either the receive or send buffer size, depending on what the socket is used for. Default is 64KB. See also fifo_size.
Override the local UDP port to bind with.
Choose the local IP address. This is useful e.g. if sending multicast and the host has multiple interfaces, where the user can choose which interface to send on by specifying the IP address of that interface.
Set the size in bytes of UDP packets.
Explicitly allow or disallow reusing UDP sockets.
Set the time to live value (for multicast only).
Initialize the UDP socket with connect()
. In this case, the
destination address can’t be changed with ff_udp_set_remote_url later.
If the destination address isn’t known at the start, this option can
be specified in ff_udp_set_remote_url, too.
This allows finding out the source address for the packets with getsockname,
and makes writes return with AVERROR(ECONNREFUSED) if "destination
unreachable" is received.
For receiving, this gives the benefit of only receiving packets from
the specified peer address/port.
Only receive packets sent to the multicast group from one of the specified sender IP addresses.
Ignore packets sent to the multicast group from the specified sender IP addresses.
Set the UDP receiving circular buffer size, expressed as a number of packets with size of 188 bytes. If not specified defaults to 7*4096.
Survive in case of UDP receiving circular buffer overrun. Default value is 0.
Set raise error timeout, expressed in microseconds.
This option is only relevant in read mode: if no data arrived in more than this time interval, raise error.
Explicitly allow or disallow UDP broadcasting.
Note that broadcasting may not work properly on networks having a broadcast storm protection.
ffmpeg
to stream over UDP to a remote endpoint:
ffmpeg -i input -f format udp://hostname:port
ffmpeg
to stream in mpegts format over UDP using 188
sized UDP packets, using a large input buffer:
ffmpeg -i input -f mpegts udp://hostname:port?pkt_size=188&buffer_size=65535
ffmpeg
to receive over UDP from a remote endpoint:
ffmpeg -i udp://[multicast-address]:port ...
Unix local socket
The required syntax for a Unix socket URL is:
unix://filepath
The following parameters can be set via command line options
(or in code via AVOption
s):
Timeout in ms.
Create the Unix socket in listening mode.
The audio resampler supports the following named options.
Options may be set by specifying -option value in the
FFmpeg tools, option=value for the aresample filter,
by setting the value explicitly in the
SwrContext
options or using the libavutil/opt.h API for
programmatic use.
Set the number of input channels. Default value is 0. Setting this value is not mandatory if the corresponding channel layout in_channel_layout is set.
Set the number of output channels. Default value is 0. Setting this value is not mandatory if the corresponding channel layout out_channel_layout is set.
Set the number of used input channels. Default value is 0. This option is only used for special remapping.
Set the input sample rate. Default value is 0.
Set the output sample rate. Default value is 0.
Specify the input sample format. It is set by default to none
.
Specify the output sample format. It is set by default to none
.
Set the internal sample format. Default value is none
.
This will automatically be chosen when it is not explicitly set.
Set the input/output channel layout.
See (ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual for the required syntax.
Set the center mix level. It is a value expressed in deciBel, and must be in the interval [-32,32].
Set the surround mix level. It is a value expressed in deciBel, and must be in the interval [-32,32].
Set LFE mix into non LFE level. It is used when there is a LFE input but no LFE output. It is a value expressed in deciBel, and must be in the interval [-32,32].
Set rematrix volume. Default value is 1.0.
Set maximum output value for rematrixing. This can be used to prevent clipping vs. preventing volumn reduction A value of 1.0 prevents cliping.
Set flags used by the converter. Default value is 0.
It supports the following individual flags:
force resampling, this flag forces resampling to be used even when the input and output sample rates match.
Set the dither scale. Default value is 1.
Set dither method. Default value is 0.
Supported values:
select rectangular dither
select triangular dither
select triangular dither with high pass
select lipshitz noise shaping dither
select shibata noise shaping dither
select low shibata noise shaping dither
select high shibata noise shaping dither
select f-weighted noise shaping dither
select modified-e-weighted noise shaping dither
select improved-e-weighted noise shaping dither
Set resampling engine. Default value is swr.
Supported values:
select the native SW Resampler; filter options precision and cheby are not applicable in this case.
select the SoX Resampler (where available); compensation, and filter options filter_size, phase_shift, filter_type & kaiser_beta, are not applicable in this case.
For swr only, set resampling filter size, default value is 32.
For swr only, set resampling phase shift, default value is 10, and must be in the interval [0,30].
Use Linear Interpolation if set to 1, default value is 0.
Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float value between 0 and 1. Default value is 0.97 with swr, and 0.91 with soxr (which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
For soxr only, the precision in bits to which the resampled signal will be calculated. The default value of 20 (which, with suitable dithering, is appropriate for a destination bit-depth of 16) gives SoX’s ’High Quality’; a value of 28 gives SoX’s ’Very High Quality’.
For soxr only, selects passband rolloff none (Chebyshev) & higher-precision approximation for ’irrational’ ratios. Default value is 0.
For swr only, simple 1 parameter audio sync to timestamps using stretching, squeezing, filling and trimming. Setting this to 1 will enable filling and trimming, larger values represent the maximum amount in samples that the data may be stretched or squeezed for each second. Default value is 0, thus no compensation is applied to make the samples match the audio timestamps.
For swr only, assume the first pts should be this value. The time unit is 1 / sample rate. This allows for padding/trimming at the start of stream. By default, no assumption is made about the first frame’s expected pts, so no padding or trimming is done. For example, this could be set to 0 to pad the beginning with silence if an audio stream starts after the video stream or to trim any samples with a negative pts due to encoder delay.
For swr only, set the minimum difference between timestamps and audio data (in
seconds) to trigger stretching/squeezing/filling or trimming of the
data to make it match the timestamps. The default is that
stretching/squeezing/filling and trimming is disabled
(min_comp = FLT_MAX
).
For swr only, set the minimum difference between timestamps and audio data (in seconds) to trigger adding/dropping samples to make it match the timestamps. This option effectively is a threshold to select between hard (trim/fill) and soft (squeeze/stretch) compensation. Note that all compensation is by default disabled through min_comp. The default is 0.1.
For swr only, set duration (in seconds) over which data is stretched/squeezed to make it match the timestamps. Must be a non-negative double float value, default value is 1.0.
For swr only, set maximum factor by which data is stretched/squeezed to make it match the timestamps. Must be a non-negative double float value, default value is 0.
Select matrixed stereo encoding.
It accepts the following values:
select none
select Dolby
select Dolby Pro Logic II
Default value is none
.
For swr only, select resampling filter type. This only affects resampling operations.
It accepts the following values:
select cubic
select Blackman Nuttall Windowed Sinc
select Kaiser Windowed Sinc
For swr only, set Kaiser Window Beta value. Must be an integer in the interval [2,16], default value is 9.
For swr only, set number of used output sample bits for dithering. Must be an integer in the interval [0,64], default value is 0, which means it’s not used.
ffprobe, ffmpeg, ffplay, ffserver, ffmpeg-utils, ffmpeg-scaler, ffmpeg-resampler, ffmpeg-codecs, ffmpeg-bitstream-filters, ffmpeg-formats, ffmpeg-devices, ffmpeg-protocols, ffmpeg-filters
The FFmpeg developers.
For details about the authorship, see the Git history of the project
(git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
git log
in the FFmpeg source directory, or browsing the
online repository at http://source.ffmpeg.org.
Maintainers for the specific components are listed in the file MAINTAINERS in the source code tree.
This document was generated using makeinfo.