FFPROBE-ALL(1) FFPROBE-ALL(1) NAME ffprobe - ffprobe media prober SYNOPSIS ffprobe [options] input_url DESCRIPTION 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 url is specified in input, ffprobe will try to open and probe the url content. If the url cannot be opened or recognized as a multimedia file, a positive exit code is returned. If no output is specified as output with o ffprobe will write to stdout. 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 output_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. OPTIONS 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. Stream specifiers Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers are used to precisely specify which stream(s) a given option belongs to. A stream specifier is a string generally appended to the option name and separated from it by a colon. E.g. "-codec:a:1 ac3" contains the "a:1" stream specifier, which matches the second audio stream. Therefore, it would select the ac3 codec for the second audio stream. A stream specifier can match several streams, so that the option is applied to all of them. E.g. the stream specifier in "-b:a 128k" matches all audio streams. An empty stream specifier matches all streams. For example, "-codec copy" or "-codec: copy" would copy all the streams without reencoding. Possible forms of stream specifiers are: stream_index Matches the stream with this index. E.g. "-threads:1 4" would set the thread count for the second stream to 4. If stream_index is used as an additional stream specifier (see below), then it selects stream number stream_index from the matching streams. Stream numbering is based on the order of the streams as detected by libavformat except when a program ID is also specified. In this case it is based on the ordering of the streams in the program. stream_type[:additional_stream_specifier] stream_type is one of following: 'v' or 'V' for video, 'a' for audio, 's' for subtitle, 'd' for data, and 't' for attachments. 'v' matches all video streams, 'V' only matches video streams which are not attached pictures, video thumbnails or cover arts. If additional_stream_specifier is used, then it matches streams which both have this type and match the additional_stream_specifier. Otherwise, it matches all streams of the specified type. p:program_id[:additional_stream_specifier] Matches streams which are in the program with the id program_id. If additional_stream_specifier is used, then it matches streams which both are part of the program and match the additional_stream_specifier. #stream_id or i:stream_id Match the stream by stream id (e.g. PID in MPEG-TS container). m:key[:value] Matches streams with the metadata tag key having the specified value. If value is not given, matches streams that contain the given tag with any value. u Matches streams with usable configuration, the codec must be defined and the essential information such as video dimension or audio sample rate must be present. Note that in ffmpeg, matching by metadata will only work properly for input files. Generic options These options are shared amongst the ff* tools. -L Show license. -h, -?, -help, --help [arg] Show help. An optional parameter may be specified to print help about a specific item. If no argument is specified, only basic (non advanced) tool options are shown. Possible values of arg are: long Print advanced tool options in addition to the basic tool options. full Print complete list of options, including shared and private options for encoders, decoders, demuxers, muxers, filters, etc. decoder=decoder_name Print detailed information about the decoder named decoder_name. Use the -decoders option to get a list of all decoders. encoder=encoder_name Print detailed information about the encoder named encoder_name. Use the -encoders option to get a list of all encoders. demuxer=demuxer_name Print detailed information about the demuxer named demuxer_name. Use the -formats option to get a list of all demuxers and muxers. muxer=muxer_name Print detailed information about the muxer named muxer_name. Use the -formats option to get a list of all muxers and demuxers. filter=filter_name Print detailed information about the filter named filter_name. Use the -filters option to get a list of all filters. bsf=bitstream_filter_name Print detailed information about the bitstream filter named bitstream_filter_name. Use the -bsfs option to get a list of all bitstream filters. protocol=protocol_name Print detailed information about the protocol named protocol_name. Use the -protocols option to get a list of all protocols. -version Show version. -buildconf Show the build configuration, one option per line. -formats Show available formats (including devices). -demuxers Show available demuxers. -muxers Show available muxers. -devices Show available devices. -codecs Show all codecs known to libavcodec. Note that the term 'codec' is used throughout this documentation as a shortcut for what is more correctly called a media bitstream format. -decoders Show available decoders. -encoders Show all available encoders. -bsfs Show available bitstream filters. -protocols Show available protocols. -filters Show available libavfilter filters. -pix_fmts Show available pixel formats. -sample_fmts Show available sample formats. -layouts Show channel names and standard channel layouts. -dispositions Show stream dispositions. -colors Show recognized color names. -sources device[,opt1=val1[,opt2=val2]...] Show autodetected sources of the input device. Some devices may provide system-dependent source names that cannot be autodetected. The returned list cannot be assumed to be always complete. ffmpeg -sources pulse,server=192.168.0.4 -sinks device[,opt1=val1[,opt2=val2]...] Show autodetected sinks of the output device. Some devices may provide system-dependent sink names that cannot be autodetected. The returned list cannot be assumed to be always complete. ffmpeg -sinks pulse,server=192.168.0.4 -loglevel [flags+]loglevel | -v [flags+]loglevel Set logging level and flags used by the library. The optional flags prefix can consist of the following values: repeat Indicates that repeated log output should not be compressed to the first line and the "Last message repeated n times" line will be omitted. level Indicates that log output should add a "[level]" prefix to each message line. This can be used as an alternative to log coloring, e.g. when dumping the log to file. Flags can also be used alone by adding a '+'/'-' prefix to set/reset a single flag without affecting other flags or changing loglevel. When setting both flags and loglevel, a '+' separator is expected between the last flags value and before loglevel. loglevel is a string or a number containing one of the following values: quiet, -8 Show nothing at all; be silent. panic, 0 Only show fatal errors which could lead the process to crash, such as an assertion failure. This is not currently used for anything. fatal, 8 Only show fatal errors. These are errors after which the process absolutely cannot continue. error, 16 Show all errors, including ones which can be recovered from. warning, 24 Show all warnings and errors. Any message related to possibly incorrect or unexpected events will be shown. info, 32 Show informative messages during processing. This is in addition to warnings and errors. This is the default value. verbose, 40 Same as "info", except more verbose. debug, 48 Show everything, including debugging information. trace, 56 For example to enable repeated log output, add the "level" prefix, and set loglevel to "verbose": ffmpeg -loglevel repeat+level+verbose -i input output Another example that enables repeated log output without affecting current state of "level" prefix flag or loglevel: ffmpeg [...] -loglevel +repeat By default the program logs to stderr. If coloring is supported by the terminal, colors are used to mark errors and warnings. Log coloring can be disabled setting the environment variable AV_LOG_FORCE_NOCOLOR, or can be forced setting the environment variable AV_LOG_FORCE_COLOR. -report Dump full command line and log output to a file named "program-YYYYMMDD-HHMMSS.log" in the current directory. This file can be useful for bug reports. It also implies "-loglevel debug". Setting the environment variable FFREPORT to any value has the same effect. If the value is a ':'-separated key=value sequence, these options will affect the report; option values must be escaped if they contain special characters or the options delimiter ':' (see the ``Quoting and escaping'' section in the ffmpeg-utils manual). The following options are recognized: file set the file name to use for the report; %p is expanded to the name of the program, %t is expanded to a timestamp, "%%" is expanded to a plain "%" level set the log verbosity level using a numerical value (see "-loglevel"). For example, to output a report to a file named ffreport.log using a log level of 32 (alias for log level "info"): FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output Errors in parsing the environment variable are not fatal, and will not appear in the report. -hide_banner 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. -cpuflags flags (global) Allows setting and clearing cpu flags. This option is intended for testing. Do not use it unless you know what you're doing. ffmpeg -cpuflags -sse+mmx ... ffmpeg -cpuflags mmx ... ffmpeg -cpuflags 0 ... Possible flags for this option are: x86 mmx mmxext sse sse2 sse2slow sse3 sse3slow ssse3 atom sse4.1 sse4.2 avx avx2 xop fma3 fma4 3dnow 3dnowext bmi1 bmi2 cmov ARM armv5te armv6 armv6t2 vfp vfpv3 neon setend AArch64 armv8 vfp neon PowerPC altivec Specific Processors pentium2 pentium3 pentium4 k6 k62 athlon athlonxp k8 -cpucount count (global) Override detection of CPU count. This option is intended for testing. Do not use it unless you know what you're doing. ffmpeg -cpucount 2 -max_alloc bytes Set the maximum size limit for allocating a block on the heap by ffmpeg's family of malloc functions. Exercise extreme caution when using this option. Don't use if you do not understand the full consequence of doing so. Default is INT_MAX. AVOptions These options are provided directly by the libavformat, libavdevice and libavcodec libraries. To see the list of available AVOptions, use the -help option. They are separated into two categories: generic These options can be set for any container, codec or device. Generic options are listed under AVFormatContext options for containers/devices and under AVCodecContext options for codecs. private These options are specific to the given container, device or codec. Private options are listed under their corresponding containers/devices/codecs. For example to write an ID3v2.3 header instead of a default ID3v2.4 to an MP3 file, use the id3v2_version private option of the MP3 muxer: ffmpeg -i input.flac -id3v2_version 3 out.mp3 All codec AVOptions are per-stream, and thus a stream specifier should be attached to them: ffmpeg -i multichannel.mxf -map 0:v:0 -map 0:a:0 -map 0:a:0 -c:a:0 ac3 -b:a:0 640k -ac:a:1 2 -c:a:1 aac -b:2 128k out.mp4 In the above example, a multichannel audio stream is mapped twice for output. The first instance is encoded with codec ac3 and bitrate 640k. The second instance is downmixed to 2 channels and encoded with codec aac. A bitrate of 128k is specified for it using absolute index of the output stream. Note: the -nooption syntax cannot be used for boolean AVOptions, use -option 0/-option 1. Note: the old undocumented way of specifying per-stream AVOptions by prepending v/a/s to the options name is now obsolete and will be removed soon. Main options -f format Force format to use. -unit Show the unit of the displayed values. -prefix Use SI prefixes for the displayed values. Unless the "-byte_binary_prefix" option is used all the prefixes are decimal. -byte_binary_prefix Force the use of binary prefixes for byte values. -sexagesimal Use sexagesimal format HH:MM:SS.MICROSECONDS for time values. -pretty Prettify the format of the displayed values, it corresponds to the options "-unit -prefix -byte_binary_prefix -sexagesimal". -output_format, -of, -print_format writer_name[=writer_options] Set the output printing format. writer_name specifies the name of the writer, and writer_options specifies the options to be passed to the writer. For example for printing the output in JSON format, specify: -output_format json For more details on the available output printing formats, see the Writers section below. -sections Print sections structure and section information, and exit. The output is not meant to be parsed by a machine. -select_streams stream_specifier Select only the streams specified by stream_specifier. This option affects only the options related to streams (e.g. "show_streams", "show_packets", etc.). For example to show only audio streams, you can use the command: ffprobe -show_streams -select_streams a INPUT To show only video packets belonging to the video stream with index 1: ffprobe -show_packets -select_streams v:1 INPUT -show_data Show payload data, as a hexadecimal and ASCII dump. Coupled with -show_packets, it will dump the packets' data. Coupled with -show_streams, it will dump the codec extradata. The dump is printed as the "data" field. It may contain newlines. -show_data_hash algorithm Show a hash of payload data, for packets with -show_packets and for codec extradata with -show_streams. -show_error Show information about the error found when trying to probe the input. The error information is printed within a section with name "ERROR". -show_format Show information about the container format of the input multimedia stream. All the container format information is printed within a section with name "FORMAT". -show_format_entry name Like -show_format, but only prints the specified entry of the container format information, rather than all. This option may be given more than once, then all specified entries will be shown. This option is deprecated, use "show_entries" instead. -show_entries section_entries Set list of entries to show. Entries are specified according to the following syntax. section_entries contains a list of section entries separated by ":". Each section entry is composed by a section name (or unique name), optionally followed by a list of entries local to that section, separated by ",". If section name is specified but is followed by no "=", all entries are printed to output, together with all the contained sections. Otherwise only the entries specified in the local section entries list are printed. In particular, if "=" is specified but the list of local entries is empty, then no entries will be shown for that section. Note that the order of specification of the local section entries is not honored in the output, and the usual display order will be retained. The formal syntax is given by: ::= [,] ::= [=[]] ::= [:] For example, to show only the index and type of each stream, and the PTS time, duration time, and stream index of the packets, you can specify the argument: packet=pts_time,duration_time,stream_index : stream=index,codec_type To show all the entries in the section "format", but only the codec type in the section "stream", specify the argument: format : stream=codec_type To show all the tags in the stream and format sections: stream_tags : format_tags To show only the "title" tag (if available) in the stream sections: stream_tags=title -show_packets Show information about each packet contained in the input multimedia stream. The information for each single packet is printed within a dedicated section with name "PACKET". -show_frames Show information about each frame and subtitle contained in the input multimedia stream. The information for each single frame is printed within a dedicated section with name "FRAME" or "SUBTITLE". -show_log loglevel Show logging information from the decoder about each frame according to the value set in loglevel, (see "-loglevel"). This option requires "-show_frames". The information for each log message is printed within a dedicated section with name "LOG". -show_streams Show information about each media stream contained in the input multimedia stream. Each media stream information is printed within a dedicated section with name "STREAM". -show_programs Show information about programs and their streams contained in the input multimedia stream. Each media stream information is printed within a dedicated section with name "PROGRAM_STREAM". -show_chapters Show information about chapters stored in the format. Each chapter is printed within a dedicated section with name "CHAPTER". -count_frames Count the number of frames per stream and report it in the corresponding stream section. -count_packets Count the number of packets per stream and report it in the corresponding stream section. -read_intervals read_intervals Read only the specified intervals. read_intervals must be a sequence of interval specifications separated by ",". ffprobe will seek to the interval starting point, and will continue reading from that. Each interval is specified by two optional parts, separated by "%". The first part specifies the interval start position. It is interpreted as an absolute position, or as a relative offset from the current position if it is preceded by the "+" character. If this first part is not specified, no seeking will be performed when reading this interval. The second part specifies the interval end position. It is interpreted as an absolute position, or as a relative offset from the current position if it is preceded by the "+" character. If the offset specification starts with "#", it is interpreted as the number of packets to read (not including the flushing packets) from the interval start. If no second part is specified, the program will read until the end of the input. Note that seeking is not accurate, thus the actual interval start point may be different from the specified position. Also, when an interval duration is specified, the absolute end time will be computed by adding the duration to the interval start point found by seeking the file, rather than to the specified start value. The formal syntax is given by: ::= [|+][%[|+]] ::= [,] A few examples follow. o Seek to time 10, read packets until 20 seconds after the found seek point, then seek to position "01:30" (1 minute and thirty seconds) and read packets until position "01:45". 10%+20,01:30%01:45 o Read only 42 packets after seeking to position "01:23": 01:23%+#42 o Read only the first 20 seconds from the start: %+20 o Read from the start until position "02:30": %02:30 -show_private_data, -private Show private data, that is data depending on the format of the particular shown element. This option is enabled by default, but you may need to disable it for specific uses, for example when creating XSD-compliant XML output. -show_program_version Show information related to program version. Version information is printed within a section with name "PROGRAM_VERSION". -show_library_versions Show information related to library versions. Version information for each library is printed within a section with name "LIBRARY_VERSION". -show_versions Show information related to program and library versions. This is the equivalent of setting both -show_program_version and -show_library_versions options. -show_pixel_formats Show information about all pixel formats supported by FFmpeg. Pixel format information for each format is printed within a section with name "PIXEL_FORMAT". -show_optional_fields value Some writers viz. JSON and XML, omit the printing of fields with invalid or non-applicable values, while other writers always print them. This option enables one to control this behaviour. Valid values are "always"/1, "never"/0 and "auto"/-1. Default is auto. -bitexact Force bitexact output, useful to produce output which is not dependent on the specific build. -i input_url Read input_url. -o output_url Write output to output_url. If not specified, the output is sent to stdout. WRITERS A writer defines the output format adopted by ffprobe, and will be used for printing all the parts of the output. A writer may accept one or more arguments, which specify the options to adopt. The options are specified as a list of key=value pairs, separated by ":". All writers support the following options: string_validation, sv Set string validation mode. The following values are accepted. fail The writer will fail immediately in case an invalid string (UTF-8) sequence or code point is found in the input. This is especially useful to validate input metadata. ignore Any validation error will be ignored. This will result in possibly broken output, especially with the json or xml writer. replace The writer will substitute invalid UTF-8 sequences or code points with the string specified with the string_validation_replacement. Default value is replace. string_validation_replacement, svr Set replacement string to use in case string_validation is set to replace. In case the option is not specified, the writer will assume the empty string, that is it will remove the invalid sequences from the input strings. A description of the currently available writers follows. default Default format. Print each section in the form: [SECTION] key1=val1 ... keyN=valN [/SECTION] Metadata tags are printed as a line in the corresponding FORMAT, STREAM or PROGRAM_STREAM section, and are prefixed by the string "TAG:". A description of the accepted options follows. nokey, nk If set to 1 specify not to print the key of each field. Default value is 0. noprint_wrappers, nw If set to 1 specify not to print the section header and footer. Default value is 0. compact, csv Compact and CSV format. The "csv" writer is equivalent to "compact", but supports different defaults. Each section is printed on a single line. If no option is specified, the output has the form: section|key1=val1| ... |keyN=valN Metadata tags are printed in the corresponding "format" or "stream" section. A metadata tag key, if printed, is prefixed by the string "tag:". The description of the accepted options follows. item_sep, s Specify the character to use for separating fields in the output line. It must be a single printable character, it is "|" by default ("," for the "csv" writer). nokey, nk If set to 1 specify not to print the key of each field. Its default value is 0 (1 for the "csv" writer). escape, e Set the escape mode to use, default to "c" ("csv" for the "csv" writer). It can assume one of the following values: c Perform C-like escaping. Strings containing a newline (\n), carriage return (\r), a tab (\t), a form feed (\f), the escaping character (\) or the item separator character SEP are escaped using C-like fashioned escaping, so that a newline is converted to the sequence \n, a carriage return to \r, \ to \\ and the separator SEP is converted to \SEP. csv Perform CSV-like escaping, as described in RFC4180. Strings containing a newline (\n), a carriage return (\r), a double quote ("), or SEP are enclosed in double-quotes. none Perform no escaping. print_section, p Print the section name at the beginning of each line if the value is 1, disable it with value set to 0. Default value is 1. flat Flat format. A free-form output where each line contains an explicit key=value, such as "streams.stream.3.tags.foo=bar". The output is shell escaped, so it can be directly embedded in sh scripts as long as the separator character is an alphanumeric character or an underscore (see sep_char option). The description of the accepted options follows. sep_char, s Separator character used to separate the chapter, the section name, IDs and potential tags in the printed field key. Default value is .. hierarchical, h Specify if the section name specification should be hierarchical. If set to 1, and if there is more than one section in the current chapter, the section name will be prefixed by the name of the chapter. A value of 0 will disable this behavior. Default value is 1. ini INI format output. Print output in an INI based format. The following conventions are adopted: o all key and values are UTF-8 o . is the subgroup separator o newline, \t, \f, \b and the following characters are escaped o \ is the escape character o # is the comment indicator o = is the key/value separator o : is not used but usually parsed as key/value separator This writer accepts options as a list of key=value pairs, separated by :. The description of the accepted options follows. hierarchical, h Specify if the section name specification should be hierarchical. If set to 1, and if there is more than one section in the current chapter, the section name will be prefixed by the name of the chapter. A value of 0 will disable this behavior. Default value is 1. json JSON based format. Each section is printed using JSON notation. The description of the accepted options follows. compact, c If set to 1 enable compact output, that is each section will be printed on a single line. Default value is 0. For more information about JSON, see . xml XML based format. The XML output is described in the XML schema description file ffprobe.xsd installed in the FFmpeg datadir. An updated version of the schema can be retrieved at the url , which redirects to the latest schema committed into the FFmpeg development source code tree. Note that the output issued will be compliant to the ffprobe.xsd schema only when no special global output options (unit, prefix, byte_binary_prefix, sexagesimal etc.) are specified. The description of the accepted options follows. fully_qualified, q If set to 1 specify if the output should be fully qualified. Default value is 0. This is required for generating an XML file which can be validated through an XSD file. xsd_strict, x If set to 1 perform more checks for ensuring that the output is XSD compliant. Default value is 0. This option automatically sets fully_qualified to 1. For more information about the XML format, see . TIMECODE ffprobe supports Timecode extraction: o MPEG1/2 timecode is extracted from the GOP, and is available in the video stream details (-show_streams, see timecode). o MOV timecode is extracted from tmcd track, so is available in the tmcd stream metadata (-show_streams, see TAG:timecode). o DV, GXF and AVI timecodes are available in format metadata (-show_format, see TAG:timecode). SYNTAX This section documents the syntax and formats employed by the FFmpeg libraries and tools. Quoting and escaping FFmpeg adopts the following quoting and escaping mechanism, unless explicitly specified. The following rules are applied: o ' and \ are special characters (respectively used for quoting and escaping). In addition to them, there might be other special characters depending on the specific syntax where the escaping and quoting are employed. o A special character is escaped by prefixing it with a \. o All characters enclosed between '' are included literally in the parsed string. The quote character ' itself cannot be quoted, so you may need to close the quote and escape it. o Leading and trailing whitespaces, unless escaped or quoted, are removed from the parsed string. Note that you may need to add a second level of escaping when using the command line or a script, which depends on the syntax of the adopted shell language. The function "av_get_token" defined in libavutil/avstring.h can be used to parse a token quoted or escaped according to the rules defined above. The tool tools/ffescape in the FFmpeg source tree can be used to automatically quote or escape a string in a script. Examples o Escape the string "Crime d'Amour" containing the "'" special character: Crime d\'Amour o The string above contains a quote, so the "'" needs to be escaped when quoting it: 'Crime d'\''Amour' o Include leading or trailing whitespaces using quoting: ' this string starts and ends with whitespaces ' o Escaping and quoting can be mixed together: ' The string '\'string\'' is a string ' o To include a literal \ you can use either escaping or quoting: 'c:\foo' can be written as c:\\foo Date The accepted syntax is: [(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z] now If the value is "now" it takes the current time. Time is local time unless Z is appended, in which case it is interpreted as UTC. If the year-month-day part is not specified it takes the current year-month-day. Time duration There are two accepted syntaxes for expressing time duration. [-][:]:[....] 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|ms|us] S expresses the number of seconds, with the optional decimal part m. The optional literal suffixes s, ms or us indicate to interpret the value as seconds, milliseconds or microseconds, respectively. In both expressions, the optional - indicates negative duration. Examples The following examples are all valid time duration: 55 55 seconds 0.2 0.2 seconds 200ms 200 milliseconds, that's 0.2s 200000us 200000 microseconds, that's 0.2s 12:03:45 12 hours, 03 minutes and 45 seconds 23.189 23.189 seconds Video size 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: ntsc 720x480 pal 720x576 qntsc 352x240 qpal 352x288 sntsc 640x480 spal 768x576 film 352x240 ntsc-film 352x240 sqcif 128x96 qcif 176x144 cif 352x288 4cif 704x576 16cif 1408x1152 qqvga 160x120 qvga 320x240 vga 640x480 svga 800x600 xga 1024x768 uxga 1600x1200 qxga 2048x1536 sxga 1280x1024 qsxga 2560x2048 hsxga 5120x4096 wvga 852x480 wxga 1366x768 wsxga 1600x1024 wuxga 1920x1200 woxga 2560x1600 wqsxga 3200x2048 wquxga 3840x2400 whsxga 6400x4096 whuxga 7680x4800 cga 320x200 ega 640x350 hd480 852x480 hd720 1280x720 hd1080 1920x1080 2k 2048x1080 2kflat 1998x1080 2kscope 2048x858 4k 4096x2160 4kflat 3996x2160 4kscope 4096x1716 nhd 640x360 hqvga 240x160 wqvga 400x240 fwqvga 432x240 hvga 480x320 qhd 960x540 2kdci 2048x1080 4kdci 4096x2160 uhd2160 3840x2160 uhd4320 7680x4320 Video rate Specify the frame rate of a video, expressed as the number of frames generated per second. It has to be a string in the format frame_rate_num/frame_rate_den, an integer number, a float number or a valid video frame rate abbreviation. The following abbreviations are recognized: ntsc 30000/1001 pal 25/1 qntsc 30000/1001 qpal 25/1 sntsc 30000/1001 spal 25/1 film 24/1 ntsc-film 24000/1001 Ratio A ratio can be expressed as an expression, or in the form numerator:denominator. Note that a ratio with infinite (1/0) or negative value is considered valid, so you should check on the returned value if you want to exclude those values. The undefined value can be expressed using the "0:0" string. Color It can be the name of a color as defined below (case insensitive match) or a "[0x|#]RRGGBB[AA]" sequence, possibly followed by @ and a string representing the alpha component. The alpha component may be a string composed by "0x" followed by an hexadecimal number or a decimal number between 0.0 and 1.0, which represents the opacity value (0x00 or 0.0 means completely transparent, 0xff or 1.0 completely opaque). If the alpha component is not specified then 0xff is assumed. The string random will result in a random color. The following names of colors are recognized: AliceBlue 0xF0F8FF AntiqueWhite 0xFAEBD7 Aqua 0x00FFFF Aquamarine 0x7FFFD4 Azure 0xF0FFFF Beige 0xF5F5DC Bisque 0xFFE4C4 Black 0x000000 BlanchedAlmond 0xFFEBCD Blue 0x0000FF BlueViolet 0x8A2BE2 Brown 0xA52A2A BurlyWood 0xDEB887 CadetBlue 0x5F9EA0 Chartreuse 0x7FFF00 Chocolate 0xD2691E Coral 0xFF7F50 CornflowerBlue 0x6495ED Cornsilk 0xFFF8DC Crimson 0xDC143C Cyan 0x00FFFF DarkBlue 0x00008B DarkCyan 0x008B8B DarkGoldenRod 0xB8860B DarkGray 0xA9A9A9 DarkGreen 0x006400 DarkKhaki 0xBDB76B DarkMagenta 0x8B008B DarkOliveGreen 0x556B2F Darkorange 0xFF8C00 DarkOrchid 0x9932CC DarkRed 0x8B0000 DarkSalmon 0xE9967A DarkSeaGreen 0x8FBC8F DarkSlateBlue 0x483D8B DarkSlateGray 0x2F4F4F DarkTurquoise 0x00CED1 DarkViolet 0x9400D3 DeepPink 0xFF1493 DeepSkyBlue 0x00BFFF DimGray 0x696969 DodgerBlue 0x1E90FF FireBrick 0xB22222 FloralWhite 0xFFFAF0 ForestGreen 0x228B22 Fuchsia 0xFF00FF Gainsboro 0xDCDCDC GhostWhite 0xF8F8FF Gold 0xFFD700 GoldenRod 0xDAA520 Gray 0x808080 Green 0x008000 GreenYellow 0xADFF2F HoneyDew 0xF0FFF0 HotPink 0xFF69B4 IndianRed 0xCD5C5C Indigo 0x4B0082 Ivory 0xFFFFF0 Khaki 0xF0E68C Lavender 0xE6E6FA LavenderBlush 0xFFF0F5 LawnGreen 0x7CFC00 LemonChiffon 0xFFFACD LightBlue 0xADD8E6 LightCoral 0xF08080 LightCyan 0xE0FFFF LightGoldenRodYellow 0xFAFAD2 LightGreen 0x90EE90 LightGrey 0xD3D3D3 LightPink 0xFFB6C1 LightSalmon 0xFFA07A LightSeaGreen 0x20B2AA LightSkyBlue 0x87CEFA LightSlateGray 0x778899 LightSteelBlue 0xB0C4DE LightYellow 0xFFFFE0 Lime 0x00FF00 LimeGreen 0x32CD32 Linen 0xFAF0E6 Magenta 0xFF00FF Maroon 0x800000 MediumAquaMarine 0x66CDAA MediumBlue 0x0000CD MediumOrchid 0xBA55D3 MediumPurple 0x9370D8 MediumSeaGreen 0x3CB371 MediumSlateBlue 0x7B68EE MediumSpringGreen 0x00FA9A MediumTurquoise 0x48D1CC MediumVioletRed 0xC71585 MidnightBlue 0x191970 MintCream 0xF5FFFA MistyRose 0xFFE4E1 Moccasin 0xFFE4B5 NavajoWhite 0xFFDEAD Navy 0x000080 OldLace 0xFDF5E6 Olive 0x808000 OliveDrab 0x6B8E23 Orange 0xFFA500 OrangeRed 0xFF4500 Orchid 0xDA70D6 PaleGoldenRod 0xEEE8AA PaleGreen 0x98FB98 PaleTurquoise 0xAFEEEE PaleVioletRed 0xD87093 PapayaWhip 0xFFEFD5 PeachPuff 0xFFDAB9 Peru 0xCD853F Pink 0xFFC0CB Plum 0xDDA0DD PowderBlue 0xB0E0E6 Purple 0x800080 Red 0xFF0000 RosyBrown 0xBC8F8F RoyalBlue 0x4169E1 SaddleBrown 0x8B4513 Salmon 0xFA8072 SandyBrown 0xF4A460 SeaGreen 0x2E8B57 SeaShell 0xFFF5EE Sienna 0xA0522D Silver 0xC0C0C0 SkyBlue 0x87CEEB SlateBlue 0x6A5ACD SlateGray 0x708090 Snow 0xFFFAFA SpringGreen 0x00FF7F SteelBlue 0x4682B4 Tan 0xD2B48C Teal 0x008080 Thistle 0xD8BFD8 Tomato 0xFF6347 Turquoise 0x40E0D0 Violet 0xEE82EE Wheat 0xF5DEB3 White 0xFFFFFF WhiteSmoke 0xF5F5F5 Yellow 0xFFFF00 YellowGreen 0x9ACD32 Channel Layout A channel layout specifies the spatial disposition of the channels in a multi-channel audio stream. To specify a channel layout, FFmpeg makes use of a special syntax. Individual channels are identified by an id, as given by the table below: FL front left FR front right FC front center LFE low frequency BL back left BR back right FLC front left-of-center FRC front right-of-center BC back center SL side left SR side right TC top center TFL top front left TFC top front center TFR top front right TBL top back left TBC top back center TBR top back right DL downmix left DR downmix right WL wide left WR wide right SDL surround direct left SDR surround direct right LFE2 low frequency 2 Standard channel layout compositions can be specified by using the following identifiers: mono FC stereo FL+FR 2.1 FL+FR+LFE 3.0 FL+FR+FC 3.0(back) FL+FR+BC 4.0 FL+FR+FC+BC quad FL+FR+BL+BR quad(side) FL+FR+SL+SR 3.1 FL+FR+FC+LFE 5.0 FL+FR+FC+BL+BR 5.0(side) FL+FR+FC+SL+SR 4.1 FL+FR+FC+LFE+BC 5.1 FL+FR+FC+LFE+BL+BR 5.1(side) FL+FR+FC+LFE+SL+SR 6.0 FL+FR+FC+BC+SL+SR 6.0(front) FL+FR+FLC+FRC+SL+SR 3.1.2 FL+FR+FC+LFE+TFL+TFR hexagonal FL+FR+FC+BL+BR+BC 6.1 FL+FR+FC+LFE+BC+SL+SR 6.1 FL+FR+FC+LFE+BL+BR+BC 6.1(front) FL+FR+LFE+FLC+FRC+SL+SR 7.0 FL+FR+FC+BL+BR+SL+SR 7.0(front) FL+FR+FC+FLC+FRC+SL+SR 7.1 FL+FR+FC+LFE+BL+BR+SL+SR 7.1(wide) FL+FR+FC+LFE+BL+BR+FLC+FRC 7.1(wide-side) FL+FR+FC+LFE+FLC+FRC+SL+SR 5.1.2 FL+FR+FC+LFE+BL+BR+TFL+TFR octagonal FL+FR+FC+BL+BR+BC+SL+SR cube FL+FR+BL+BR+TFL+TFR+TBL+TBR 5.1.4 FL+FR+FC+LFE+BL+BR+TFL+TFR+TBL+TBR 7.1.2 FL+FR+FC+LFE+BL+BR+SL+SR+TFL+TFR 7.1.4 FL+FR+FC+LFE+BL+BR+SL+SR+TFL+TFR+TBL+TBR hexadecagonal FL+FR+FC+BL+BR+BC+SL+SR+WL+WR+TBL+TBR+TBC+TFC+TFL+TFR downmix DL+DR 22.2 FL+FR+FC+LFE+BL+BR+FLC+FRC+BC+SL+SR+TC+TFL+TFC+TFR+TBL+TBC+TBR+LFE2+TSL+TSR+BFC+BFL+BFR A custom channel layout can be specified as a sequence of terms, separated by '+'. Each term can be: o the name of a single channel (e.g. FL, FR, FC, LFE, etc.), each optionally containing a custom name after a '@', (e.g. FL@Left, FR@Right, FC@Center, LFE@Low_Frequency, etc.) A standard channel layout can be specified by the following: o the name of a single channel (e.g. FL, FR, FC, LFE, etc.) o the name of a standard channel layout (e.g. mono, stereo, 4.0, quad, 5.0, etc.) o a number of channels, in decimal, followed by 'c', yielding the default channel layout for that number of channels (see the function "av_channel_layout_default"). Note that not all channel counts have a default layout. o a number of channels, in decimal, followed by 'C', yielding an unknown channel layout with the specified number of channels. Note that not all channel layout specification strings support unknown channel layouts. o a channel layout mask, in hexadecimal starting with "0x" (see the "AV_CH_*" macros in libavutil/channel_layout.h. Before libavutil version 53 the trailing character "c" to specify a number of channels was optional, but now it is required, while a channel layout mask can also be specified as a decimal number (if and only if not followed by "c" or "C"). See also the function "av_channel_layout_from_string" defined in libavutil/channel_layout.h. EXPRESSION EVALUATION When evaluating an arithmetic expression, FFmpeg uses an internal formula evaluator, implemented through the libavutil/eval.h interface. An expression may contain unary, binary operators, constants, and functions. Two expressions expr1 and expr2 can be combined to form another expression "expr1;expr2". expr1 and expr2 are evaluated in turn, and the new expression evaluates to the value of expr2. The following binary operators are available: "+", "-", "*", "/", "^". The following unary operators are available: "+", "-". The following functions are available: abs(x) Compute absolute value of x. acos(x) Compute arccosine of x. asin(x) Compute arcsine of x. atan(x) Compute arctangent of x. atan2(x, y) Compute principal value of the arc tangent of y/x. between(x, min, max) Return 1 if x is greater than or equal to min and lesser than or equal to max, 0 otherwise. bitand(x, y) bitor(x, y) Compute bitwise and/or operation on x and y. The results of the evaluation of x and y are converted to integers before executing the bitwise operation. Note that both the conversion to integer and the conversion back to floating point can lose precision. Beware of unexpected results for large numbers (usually 2^53 and larger). ceil(expr) Round the value of expression expr upwards to the nearest integer. For example, "ceil(1.5)" is "2.0". clip(x, min, max) Return the value of x clipped between min and max. cos(x) Compute cosine of x. cosh(x) Compute hyperbolic cosine of x. eq(x, y) Return 1 if x and y are equivalent, 0 otherwise. exp(x) Compute exponential of x (with base "e", the Euler's number). floor(expr) Round the value of expression expr downwards to the nearest integer. For example, "floor(-1.5)" is "-2.0". gauss(x) Compute Gauss function of x, corresponding to "exp(-x*x/2) / sqrt(2*PI)". gcd(x, y) Return the greatest common divisor of x and y. If both x and y are 0 or either or both are less than zero then behavior is undefined. gt(x, y) Return 1 if x is greater than y, 0 otherwise. gte(x, y) Return 1 if x is greater than or equal to y, 0 otherwise. hypot(x, y) This function is similar to the C function with the same name; it returns "sqrt(x*x + y*y)", the length of the hypotenuse of a right triangle with sides of length x and y, or the distance of the point (x, y) from the origin. if(x, y) Evaluate x, and if the result is non-zero return the result of the evaluation of y, return 0 otherwise. if(x, y, z) Evaluate x, and if the result is non-zero return the evaluation result of y, otherwise the evaluation result of z. ifnot(x, y) Evaluate x, and if the result is zero return the result of the evaluation of y, return 0 otherwise. ifnot(x, y, z) Evaluate x, and if the result is zero return the evaluation result of y, otherwise the evaluation result of z. isinf(x) Return 1.0 if x is +/-INFINITY, 0.0 otherwise. isnan(x) Return 1.0 if x is NAN, 0.0 otherwise. ld(var) Load the value of the internal variable with number var, which was previously stored with st(var, expr). The function returns the loaded value. lerp(x, y, z) Return linear interpolation between x and y by amount of z. log(x) Compute natural logarithm of x. lt(x, y) Return 1 if x is lesser than y, 0 otherwise. lte(x, y) Return 1 if x is lesser than or equal to y, 0 otherwise. max(x, y) Return the maximum between x and y. min(x, y) Return the minimum between x and y. mod(x, y) Compute the remainder of division of x by y. not(expr) Return 1.0 if expr is zero, 0.0 otherwise. pow(x, y) Compute the power of x elevated y, it is equivalent to "(x)^(y)". print(t) print(t, l) Print the value of expression t with loglevel l. If l is not specified then a default log level is used. Returns the value of the expression printed. Prints t with loglevel l random(x) Return a pseudo random value between 0.0 and 1.0. x is the index of the internal variable which will be used to save the seed/state. root(expr, max) Find an input value for which the function represented by expr with argument ld(0) is 0 in the interval 0..max. The expression in expr must denote a continuous function or the result is undefined. ld(0) is used to represent the function input value, which means that the given expression will be evaluated multiple times with various input values that the expression can access through ld(0). When the expression evaluates to 0 then the corresponding input value will be returned. round(expr) Round the value of expression expr to the nearest integer. For example, "round(1.5)" is "2.0". sgn(x) Compute sign of x. sin(x) Compute sine of x. sinh(x) Compute hyperbolic sine of x. sqrt(expr) Compute the square root of expr. This is equivalent to "(expr)^.5". squish(x) Compute expression "1/(1 + exp(4*x))". st(var, expr) Store the value of the expression expr in an internal variable. var specifies the number of the variable where to store the value, and it is a value ranging from 0 to 9. The function returns the value stored in the internal variable. Note, Variables are currently not shared between expressions. tan(x) Compute tangent of x. tanh(x) Compute hyperbolic tangent of x. taylor(expr, x) taylor(expr, x, id) Evaluate a Taylor series at x, given an expression representing the ld(id)-th derivative of a function at 0. When the series does not converge the result is undefined. ld(id) is used to represent the derivative order in expr, which means that the given expression will be evaluated multiple times with various input values that the expression can access through ld(id). If id is not specified then 0 is assumed. Note, when you have the derivatives at y instead of 0, "taylor(expr, x-y)" can be used. time(0) Return the current (wallclock) time in seconds. trunc(expr) Round the value of expression expr towards zero to the nearest integer. For example, "trunc(-1.5)" is "-1.0". while(cond, expr) Evaluate expression expr while the expression cond is non-zero, and returns the value of the last expr evaluation, or NAN if cond was always false. The following constants are available: PI area of the unit disc, approximately 3.14 E exp(1) (Euler's number), approximately 2.718 PHI golden ratio (1+sqrt(5))/2, approximately 1.618 Assuming that an expression is considered "true" if it has a non-zero value, note that: "*" works like AND "+" works like OR For example the construct: if (A AND B) then C is equivalent to: if(A*B, C) In your C code, you can extend the list of unary and binary functions, and define recognized constants, so that they are available for your expressions. The evaluator also recognizes the International System unit prefixes. If 'i' is appended after the prefix, binary prefixes are used, which are based on powers of 1024 instead of powers of 1000. The 'B' postfix multiplies the value by 8, and can be appended after a unit prefix or used alone. This allows using for example 'KB', 'MiB', 'G' and 'B' as number postfix. The list of available International System prefixes follows, with indication of the corresponding powers of 10 and of 2. y 10^-24 / 2^-80 z 10^-21 / 2^-70 a 10^-18 / 2^-60 f 10^-15 / 2^-50 p 10^-12 / 2^-40 n 10^-9 / 2^-30 u 10^-6 / 2^-20 m 10^-3 / 2^-10 c 10^-2 d 10^-1 h 10^2 k 10^3 / 2^10 K 10^3 / 2^10 M 10^6 / 2^20 G 10^9 / 2^30 T 10^12 / 2^40 P 10^15 / 2^50 E 10^18 / 2^60 Z 10^21 / 2^70 Y 10^24 / 2^80 CODEC OPTIONS libavcodec provides some generic global options, which can be set on all the encoders and decoders. In addition each codec may support so- called private options, which are specific for a given codec. Sometimes, a global option may only affect a specific kind of codec, and may be nonsensical or ignored by another, so you need to be aware of the meaning of the specified options. Also some options are meant only for decoding or encoding. Options may be set by specifying -option value in the FFmpeg tools, or by setting the value explicitly in the "AVCodecContext" options or using the libavutil/opt.h API for programmatic use. The list of supported options follow: b integer (encoding,audio,video) Set bitrate in bits/s. Default value is 200K. ab integer (encoding,audio) Set audio bitrate (in bits/s). Default value is 128K. bt integer (encoding,video) Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate tolerance specifies how far ratecontrol is willing to deviate from the target average bitrate value. This is not related to min/max bitrate. Lowering tolerance too much has an adverse effect on quality. flags flags (decoding/encoding,audio,video,subtitles) Set generic flags. Possible values: mv4 Use four motion vector by macroblock (mpeg4). qpel Use 1/4 pel motion compensation. loop Use loop filter. qscale Use fixed qscale. pass1 Use internal 2pass ratecontrol in first pass mode. pass2 Use internal 2pass ratecontrol in second pass mode. gray Only decode/encode grayscale. psnr Set error[?] variables during encoding. truncated Input bitstream might be randomly truncated. drop_changed Don't output frames whose parameters differ from first decoded frame in stream. Error AVERROR_INPUT_CHANGED is returned when a frame is dropped. ildct Use interlaced DCT. low_delay Force low delay. global_header Place global headers in extradata instead of every keyframe. bitexact Only write platform-, build- and time-independent data. (except (I)DCT). This ensures that file and data checksums are reproducible and match between platforms. Its primary use is for regression testing. aic Apply H263 advanced intra coding / mpeg4 ac prediction. ilme Apply interlaced motion estimation. cgop Use closed gop. output_corrupt Output even potentially corrupted frames. time_base rational number Set codec time base. It is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented. For fixed-fps content, timebase should be "1 / frame_rate" and timestamp increments should be identically 1. g integer (encoding,video) Set the group of picture (GOP) size. Default value is 12. ar integer (decoding/encoding,audio) Set audio sampling rate (in Hz). ac integer (decoding/encoding,audio) Set number of audio channels. cutoff integer (encoding,audio) Set cutoff bandwidth. (Supported only by selected encoders, see their respective documentation sections.) frame_size integer (encoding,audio) Set audio frame size. Each submitted frame except the last must contain exactly frame_size samples per channel. May be 0 when the codec has CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not restricted. It is set by some decoders to indicate constant frame size. frame_number integer Set the frame number. delay integer qcomp float (encoding,video) Set video quantizer scale compression (VBR). It is used as a constant in the ratecontrol equation. Recommended range for default rc_eq: 0.0-1.0. qblur float (encoding,video) Set video quantizer scale blur (VBR). qmin integer (encoding,video) Set min video quantizer scale (VBR). Must be included between -1 and 69, default value is 2. qmax integer (encoding,video) Set max video quantizer scale (VBR). Must be included between -1 and 1024, default value is 31. qdiff integer (encoding,video) Set max difference between the quantizer scale (VBR). bf integer (encoding,video) Set max number of B frames between non-B-frames. Must be an integer between -1 and 16. 0 means that B-frames are disabled. If a value of -1 is used, it will choose an automatic value depending on the encoder. Default value is 0. b_qfactor float (encoding,video) Set qp factor between P and B frames. codec_tag integer bug flags (decoding,video) Workaround not auto detected encoder bugs. Possible values: autodetect xvid_ilace Xvid interlacing bug (autodetected if fourcc==XVIX) ump4 (autodetected if fourcc==UMP4) no_padding padding bug (autodetected) amv qpel_chroma std_qpel old standard qpel (autodetected per fourcc/version) qpel_chroma2 direct_blocksize direct-qpel-blocksize bug (autodetected per fourcc/version) edge edge padding bug (autodetected per fourcc/version) hpel_chroma dc_clip ms Workaround various bugs in microsoft broken decoders. trunc trancated frames strict integer (decoding/encoding,audio,video) Specify how strictly to follow the standards. Possible values: very strictly conform to an older more strict version of the spec or reference software strict strictly conform to all the things in the spec no matter what consequences normal unofficial allow unofficial extensions experimental allow non standardized experimental things, experimental (unfinished/work in progress/not well tested) decoders and encoders. Note: experimental decoders can pose a security risk, do not use this for decoding untrusted input. b_qoffset float (encoding,video) Set QP offset between P and B frames. err_detect flags (decoding,audio,video) Set error detection flags. Possible values: crccheck verify embedded CRCs bitstream detect bitstream specification deviations buffer detect improper bitstream length explode abort decoding on minor error detection ignore_err ignore decoding errors, and continue decoding. This is useful if you want to analyze the content of a video and thus want everything to be decoded no matter what. This option will not result in a video that is pleasing to watch in case of errors. careful consider things that violate the spec and have not been seen in the wild as errors compliant consider all spec non compliancies as errors aggressive consider things that a sane encoder should not do as an error has_b_frames integer block_align integer rc_override_count integer maxrate integer (encoding,audio,video) Set max bitrate tolerance (in bits/s). Requires bufsize to be set. minrate integer (encoding,audio,video) Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR encode. It is of little use elsewise. bufsize integer (encoding,audio,video) Set ratecontrol buffer size (in bits). i_qfactor float (encoding,video) Set QP factor between P and I frames. i_qoffset float (encoding,video) Set QP offset between P and I frames. dct integer (encoding,video) Set DCT algorithm. Possible values: auto autoselect a good one (default) fastint fast integer int accurate integer mmx altivec faan floating point AAN DCT lumi_mask float (encoding,video) Compress bright areas stronger than medium ones. tcplx_mask float (encoding,video) Set temporal complexity masking. scplx_mask float (encoding,video) Set spatial complexity masking. p_mask float (encoding,video) Set inter masking. dark_mask float (encoding,video) Compress dark areas stronger than medium ones. idct integer (decoding/encoding,video) Select IDCT implementation. Possible values: auto int simple simplemmx simpleauto Automatically pick a IDCT compatible with the simple one arm altivec sh4 simplearm simplearmv5te simplearmv6 simpleneon xvid faani floating point AAN IDCT slice_count integer ec flags (decoding,video) Set error concealment strategy. Possible values: guess_mvs iterative motion vector (MV) search (slow) deblock use strong deblock filter for damaged MBs favor_inter favor predicting from the previous frame instead of the current bits_per_coded_sample integer aspect rational number (encoding,video) Set sample aspect ratio. sar rational number (encoding,video) Set sample aspect ratio. Alias to aspect. debug flags (decoding/encoding,audio,video,subtitles) Print specific debug info. Possible values: pict picture info rc rate control bitstream mb_type macroblock (MB) type qp per-block quantization parameter (QP) dct_coeff green_metadata display complexity metadata for the upcoming frame, GoP or for a given duration. skip startcode er error recognition mmco memory management control operations (H.264) bugs buffers picture buffer allocations thread_ops threading operations nomc skip motion compensation cmp integer (encoding,video) Set full pel me compare function. Possible values: sad sum of absolute differences, fast (default) sse sum of squared errors satd sum of absolute Hadamard transformed differences dct sum of absolute DCT transformed differences psnr sum of squared quantization errors (avoid, low quality) bit number of bits needed for the block rd rate distortion optimal, slow zero 0 vsad sum of absolute vertical differences vsse sum of squared vertical differences nsse noise preserving sum of squared differences w53 5/3 wavelet, only used in snow w97 9/7 wavelet, only used in snow dctmax chroma subcmp integer (encoding,video) Set sub pel me compare function. Possible values: sad sum of absolute differences, fast (default) sse sum of squared errors satd sum of absolute Hadamard transformed differences dct sum of absolute DCT transformed differences psnr sum of squared quantization errors (avoid, low quality) bit number of bits needed for the block rd rate distortion optimal, slow zero 0 vsad sum of absolute vertical differences vsse sum of squared vertical differences nsse noise preserving sum of squared differences w53 5/3 wavelet, only used in snow w97 9/7 wavelet, only used in snow dctmax chroma mbcmp integer (encoding,video) Set macroblock compare function. Possible values: sad sum of absolute differences, fast (default) sse sum of squared errors satd sum of absolute Hadamard transformed differences dct sum of absolute DCT transformed differences psnr sum of squared quantization errors (avoid, low quality) bit number of bits needed for the block rd rate distortion optimal, slow zero 0 vsad sum of absolute vertical differences vsse sum of squared vertical differences nsse noise preserving sum of squared differences w53 5/3 wavelet, only used in snow w97 9/7 wavelet, only used in snow dctmax chroma ildctcmp integer (encoding,video) Set interlaced dct compare function. Possible values: sad sum of absolute differences, fast (default) sse sum of squared errors satd sum of absolute Hadamard transformed differences dct sum of absolute DCT transformed differences psnr sum of squared quantization errors (avoid, low quality) bit number of bits needed for the block rd rate distortion optimal, slow zero 0 vsad sum of absolute vertical differences vsse sum of squared vertical differences nsse noise preserving sum of squared differences w53 5/3 wavelet, only used in snow w97 9/7 wavelet, only used in snow dctmax chroma dia_size integer (encoding,video) Set diamond type & size for motion estimation. (1024, INT_MAX) full motion estimation(slowest) (768, 1024] umh motion estimation (512, 768] hex motion estimation (256, 512] l2s diamond motion estimation [2,256] var diamond motion estimation (-1, 2) small diamond motion estimation -1 funny diamond motion estimation (INT_MIN, -1) sab diamond motion estimation last_pred integer (encoding,video) Set amount of motion predictors from the previous frame. precmp integer (encoding,video) Set pre motion estimation compare function. Possible values: sad sum of absolute differences, fast (default) sse sum of squared errors satd sum of absolute Hadamard transformed differences dct sum of absolute DCT transformed differences psnr sum of squared quantization errors (avoid, low quality) bit number of bits needed for the block rd rate distortion optimal, slow zero 0 vsad sum of absolute vertical differences vsse sum of squared vertical differences nsse noise preserving sum of squared differences w53 5/3 wavelet, only used in snow w97 9/7 wavelet, only used in snow dctmax chroma pre_dia_size integer (encoding,video) Set diamond type & size for motion estimation pre-pass. subq integer (encoding,video) Set sub pel motion estimation quality. me_range integer (encoding,video) Set limit motion vectors range (1023 for DivX player). global_quality integer (encoding,audio,video) slice_flags integer mbd integer (encoding,video) Set macroblock decision algorithm (high quality mode). Possible values: simple use mbcmp (default) bits use fewest bits rd use best rate distortion rc_init_occupancy integer (encoding,video) Set number of bits which should be loaded into the rc buffer before decoding starts. flags2 flags (decoding/encoding,audio,video,subtitles) Possible values: fast Allow non spec compliant speedup tricks. noout Skip bitstream encoding. ignorecrop Ignore cropping information from sps. local_header Place global headers at every keyframe instead of in extradata. chunks Frame data might be split into multiple chunks. showall Show all frames before the first keyframe. export_mvs Export motion vectors into frame side-data (see "AV_FRAME_DATA_MOTION_VECTORS") for codecs that support it. See also doc/examples/export_mvs.c. skip_manual Do not skip samples and export skip information as frame side data. ass_ro_flush_noop Do not reset ASS ReadOrder field on flush. icc_profiles Generate/parse embedded ICC profiles from/to colorimetry tags. export_side_data flags (decoding/encoding,audio,video,subtitles) Possible values: mvs Export motion vectors into frame side-data (see "AV_FRAME_DATA_MOTION_VECTORS") for codecs that support it. See also doc/examples/export_mvs.c. prft Export encoder Producer Reference Time into packet side-data (see "AV_PKT_DATA_PRFT") for codecs that support it. venc_params Export video encoding parameters through frame side data (see "AV_FRAME_DATA_VIDEO_ENC_PARAMS") for codecs that support it. At present, those are H.264 and VP9. film_grain Export film grain parameters through frame side data (see "AV_FRAME_DATA_FILM_GRAIN_PARAMS"). Supported at present by AV1 decoders. threads integer (decoding/encoding,video) Set the number of threads to be used, in case the selected codec implementation supports multi-threading. Possible values: auto, 0 automatically select the number of threads to set Default value is auto. dc integer (encoding,video) Set intra_dc_precision. nssew integer (encoding,video) Set nsse weight. skip_top integer (decoding,video) Set number of macroblock rows at the top which are skipped. skip_bottom integer (decoding,video) Set number of macroblock rows at the bottom which are skipped. profile integer (encoding,audio,video) Set encoder codec profile. Default value is unknown. Encoder specific profiles are documented in the relevant encoder documentation. level integer (encoding,audio,video) Set the encoder level. This level depends on the specific codec, and might correspond to the profile level. It is set by default to unknown. Possible values: unknown lowres integer (decoding,audio,video) Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions. mblmin integer (encoding,video) Set min macroblock lagrange factor (VBR). mblmax integer (encoding,video) Set max macroblock lagrange factor (VBR). skip_loop_filter integer (decoding,video) skip_idct integer (decoding,video) skip_frame integer (decoding,video) Make decoder discard processing depending on the frame type selected by the option value. skip_loop_filter skips frame loop filtering, skip_idct skips frame IDCT/dequantization, skip_frame skips decoding. Possible values: none Discard no frame. default Discard useless frames like 0-sized frames. noref Discard all non-reference frames. bidir Discard all bidirectional frames. nokey Discard all frames excepts keyframes. nointra Discard all frames except I frames. all Discard all frames. Default value is default. bidir_refine integer (encoding,video) Refine the two motion vectors used in bidirectional macroblocks. keyint_min integer (encoding,video) Set minimum interval between IDR-frames. refs integer (encoding,video) Set reference frames to consider for motion compensation. trellis integer (encoding,audio,video) Set rate-distortion optimal quantization. mv0_threshold integer (encoding,video) compression_level integer (encoding,audio,video) bits_per_raw_sample integer channel_layout integer (decoding/encoding,audio) Possible values: request_channel_layout integer (decoding,audio) Possible values: rc_max_vbv_use float (encoding,video) rc_min_vbv_use float (encoding,video) color_primaries integer (decoding/encoding,video) Possible values: bt709 BT.709 bt470m BT.470 M bt470bg BT.470 BG smpte170m SMPTE 170 M smpte240m SMPTE 240 M film Film bt2020 BT.2020 smpte428 smpte428_1 SMPTE ST 428-1 smpte431 SMPTE 431-2 smpte432 SMPTE 432-1 jedec-p22 JEDEC P22 color_trc integer (decoding/encoding,video) Possible values: bt709 BT.709 gamma22 BT.470 M gamma28 BT.470 BG smpte170m SMPTE 170 M smpte240m SMPTE 240 M linear Linear log log100 Log log_sqrt log316 Log square root iec61966_2_4 iec61966-2-4 IEC 61966-2-4 bt1361 bt1361e BT.1361 iec61966_2_1 iec61966-2-1 IEC 61966-2-1 bt2020_10 bt2020_10bit BT.2020 - 10 bit bt2020_12 bt2020_12bit BT.2020 - 12 bit smpte2084 SMPTE ST 2084 smpte428 smpte428_1 SMPTE ST 428-1 arib-std-b67 ARIB STD-B67 colorspace integer (decoding/encoding,video) Possible values: rgb RGB bt709 BT.709 fcc FCC bt470bg BT.470 BG smpte170m SMPTE 170 M smpte240m SMPTE 240 M ycocg YCOCG bt2020nc bt2020_ncl BT.2020 NCL bt2020c bt2020_cl BT.2020 CL smpte2085 SMPTE 2085 chroma-derived-nc Chroma-derived NCL chroma-derived-c Chroma-derived CL ictcp ICtCp color_range integer (decoding/encoding,video) If used as input parameter, it serves as a hint to the decoder, which color_range the input has. Possible values: tv mpeg limited MPEG (219*2^(n-8)) pc jpeg full JPEG (2^n-1) chroma_sample_location integer (decoding/encoding,video) Possible values: left center topleft top bottomleft bottom log_level_offset integer Set the log level offset. slices integer (encoding,video) Number of slices, used in parallelized encoding. thread_type flags (decoding/encoding,video) Select which multithreading methods to use. Use of frame will increase decoding delay by one frame per thread, so clients which cannot provide future frames should not use it. Possible values: slice Decode more than one part of a single frame at once. Multithreading using slices works only when the video was encoded with slices. frame Decode more than one frame at once. Default value is slice+frame. audio_service_type integer (encoding,audio) Set audio service type. Possible values: ma Main Audio Service ef Effects vi Visually Impaired hi Hearing Impaired di Dialogue co Commentary em Emergency vo Voice Over ka Karaoke request_sample_fmt sample_fmt (decoding,audio) Set sample format audio decoders should prefer. Default value is "none". pkt_timebase rational number sub_charenc encoding (decoding,subtitles) Set the input subtitles character encoding. field_order field_order (video) Set/override the field order of the video. Possible values: progressive Progressive video tt Interlaced video, top field coded and displayed first bb Interlaced video, bottom field coded and displayed first tb Interlaced video, top coded first, bottom displayed first bt Interlaced video, bottom coded first, top displayed first skip_alpha bool (decoding,video) Set to 1 to disable processing alpha (transparency). This works like the gray flag in the flags option which skips chroma information instead of alpha. Default is 0. codec_whitelist list (input) "," separated list of allowed decoders. By default all are allowed. dump_separator string (input) Separator used to separate the fields printed on the command line about the Stream parameters. For example, to separate the fields with newlines and indentation: ffprobe -dump_separator " " -i ~/videos/matrixbench_mpeg2.mpg max_pixels integer (decoding/encoding,video) Maximum number of pixels per image. This value can be used to avoid out of memory failures due to large images. apply_cropping bool (decoding,video) Enable cropping if cropping parameters are multiples of the required alignment for the left and top parameters. If the alignment is not met the cropping will be partially applied to maintain alignment. Default is 1 (enabled). Note: The required alignment depends on if "AV_CODEC_FLAG_UNALIGNED" is set and the CPU. "AV_CODEC_FLAG_UNALIGNED" cannot be changed from the command line. Also hardware decoders will not apply left/top Cropping. DECODERS Decoders are configured elements in FFmpeg which allow the decoding of multimedia streams. When you configure your FFmpeg build, all the supported native decoders are enabled by default. Decoders requiring an external library must be enabled manually via the corresponding "--enable-lib" option. You can list all available decoders using the configure option "--list-decoders". You can disable all the decoders with the configure option "--disable-decoders" and selectively enable / disable single decoders with the options "--enable-decoder=DECODER" / "--disable-decoder=DECODER". The option "-decoders" of the ff* tools will display the list of enabled decoders. VIDEO DECODERS A description of some of the currently available video decoders follows. av1 AOMedia Video 1 (AV1) decoder. Options operating_point Select an operating point of a scalable AV1 bitstream (0 - 31). Default is 0. rawvideo Raw video decoder. This decoder decodes rawvideo streams. Options top top_field_first Specify the assumed field type of the input video. -1 the video is assumed to be progressive (default) 0 bottom-field-first is assumed 1 top-field-first is assumed libdav1d dav1d AV1 decoder. libdav1d allows libavcodec to decode the AOMedia Video 1 (AV1) codec. Requires the presence of the libdav1d headers and library during configuration. You need to explicitly configure the build with "--enable-libdav1d". Options The following options are supported by the libdav1d wrapper. framethreads Set amount of frame threads to use during decoding. The default value is 0 (autodetect). This option is deprecated for libdav1d >= 1.0 and will be removed in the future. Use the option "max_frame_delay" and the global option "threads" instead. tilethreads Set amount of tile threads to use during decoding. The default value is 0 (autodetect). This option is deprecated for libdav1d >= 1.0 and will be removed in the future. Use the global option "threads" instead. max_frame_delay Set max amount of frames the decoder may buffer internally. The default value is 0 (autodetect). filmgrain Apply film grain to the decoded video if present in the bitstream. Defaults to the internal default of the library. This option is deprecated and will be removed in the future. See the global option "export_side_data" to export Film Grain parameters instead of applying it. oppoint Select an operating point of a scalable AV1 bitstream (0 - 31). Defaults to the internal default of the library. alllayers Output all spatial layers of a scalable AV1 bitstream. The default value is false. libdavs2 AVS2-P2/IEEE1857.4 video decoder wrapper. This decoder allows libavcodec to decode AVS2 streams with davs2 library. libuavs3d AVS3-P2/IEEE1857.10 video decoder. libuavs3d allows libavcodec to decode AVS3 streams. Requires the presence of the libuavs3d headers and library during configuration. You need to explicitly configure the build with "--enable-libuavs3d". Options The following option is supported by the libuavs3d wrapper. frame_threads Set amount of frame threads to use during decoding. The default value is 0 (autodetect). QSV Decoders The family of Intel QuickSync Video decoders (VC1, MPEG-2, H.264, HEVC, JPEG/MJPEG, VP8, VP9, AV1). Common Options The following options are supported by all qsv decoders. async_depth Internal parallelization depth, the higher the value the higher the latency. gpu_copy A GPU-accelerated copy between video and system memory default on off HEVC Options Extra options for hevc_qsv. load_plugin A user plugin to load in an internal session none hevc_sw hevc_hw load_plugins A :-separate list of hexadecimal plugin UIDs to load in an internal session v210 Uncompressed 4:2:2 10-bit decoder. Options custom_stride Set the line size of the v210 data in bytes. The default value is 0 (autodetect). You can use the special -1 value for a strideless v210 as seen in BOXX files. AUDIO DECODERS A description of some of the currently available audio decoders follows. ac3 AC-3 audio decoder. This decoder implements part of ATSC A/52:2010 and ETSI TS 102 366, as well as the undocumented RealAudio 3 (a.k.a. dnet). AC-3 Decoder Options -drc_scale value Dynamic Range Scale Factor. The factor to apply to dynamic range values from the AC-3 stream. This factor is applied exponentially. The default value is 1. There are 3 notable scale factor ranges: drc_scale == 0 DRC disabled. Produces full range audio. 0 < drc_scale <= 1 DRC enabled. Applies a fraction of the stream DRC value. Audio reproduction is between full range and full compression. drc_scale > 1 DRC enabled. Applies drc_scale asymmetrically. Loud sounds are fully compressed. Soft sounds are enhanced. flac FLAC audio decoder. This decoder aims to implement the complete FLAC specification from Xiph. FLAC Decoder options -use_buggy_lpc The lavc FLAC encoder used to produce buggy streams with high lpc values (like the default value). This option makes it possible to decode such streams correctly by using lavc's old buggy lpc logic for decoding. ffwavesynth Internal wave synthesizer. This decoder generates wave patterns according to predefined sequences. Its use is purely internal and the format of the data it accepts is not publicly documented. libcelt libcelt decoder wrapper. libcelt allows libavcodec to decode the Xiph CELT ultra-low delay audio codec. Requires the presence of the libcelt headers and library during configuration. You need to explicitly configure the build with "--enable-libcelt". libgsm libgsm decoder wrapper. libgsm allows libavcodec to decode the GSM full rate audio codec. Requires the presence of the libgsm headers and library during configuration. You need to explicitly configure the build with "--enable-libgsm". This decoder supports both the ordinary GSM and the Microsoft variant. libilbc libilbc decoder wrapper. libilbc allows libavcodec to decode the Internet Low Bitrate Codec (iLBC) audio codec. Requires the presence of the libilbc headers and library during configuration. You need to explicitly configure the build with "--enable-libilbc". Options The following option is supported by the libilbc wrapper. enhance Enable the enhancement of the decoded audio when set to 1. The default value is 0 (disabled). libopencore-amrnb libopencore-amrnb decoder wrapper. libopencore-amrnb allows libavcodec to decode the Adaptive Multi-Rate Narrowband audio codec. Using it requires the presence of the libopencore-amrnb headers and library during configuration. You need to explicitly configure the build with "--enable-libopencore-amrnb". An FFmpeg native decoder for AMR-NB exists, so users can decode AMR-NB without this library. libopencore-amrwb libopencore-amrwb decoder wrapper. libopencore-amrwb allows libavcodec to decode the Adaptive Multi-Rate Wideband audio codec. Using it requires the presence of the libopencore-amrwb headers and library during configuration. You need to explicitly configure the build with "--enable-libopencore-amrwb". An FFmpeg native decoder for AMR-WB exists, so users can decode AMR-WB without this library. libopus libopus decoder wrapper. libopus allows libavcodec to decode the Opus Interactive Audio Codec. Requires the presence of the libopus headers and library during configuration. You need to explicitly configure the build with "--enable-libopus". An FFmpeg native decoder for Opus exists, so users can decode Opus without this library. SUBTITLES DECODERS libaribb24 ARIB STD-B24 caption decoder. Implements profiles A and C of the ARIB STD-B24 standard. libaribb24 Decoder Options -aribb24-base-path path Sets the base path for the libaribb24 library. This is utilized for reading of configuration files (for custom unicode conversions), and for dumping of non-text symbols as images under that location. Unset by default. -aribb24-skip-ruby-text boolean Tells the decoder wrapper to skip text blocks that contain half- height ruby text. Enabled by default. libaribcaption Yet another ARIB STD-B24 caption decoder using external libaribcaption library. Implements profiles A and C of the Japanse ARIB STD-B24 standard, Brazilian ABNT NBR 15606-1, and Philippines version of ISDB-T. Requires the presence of the libaribcaption headers and library () during configuration. You need to explicitly configure the build with "--enable-libaribcaption". If both libaribb24 and libaribcaption are enabled, libaribcaption decoder precedes. libaribcaption Decoder Options -sub_type subtitle_type Specifies the format of the decoded subtitles. bitmap Graphical image. ass ASS formatted text. text Simple text based output without formatting. The default is ass as same as libaribb24 decoder. Some present players (e.g., mpv) expect ASS format for ARIB caption. -caption_encoding encoding_scheme Specifies the encoding scheme of input subtitle text. auto Automatically detect text encoding (default). jis 8bit-char JIS encoding defined in ARIB STD B24. This encoding used in Japan for ISDB captions. utf8 UTF-8 encoding defined in ARIB STD B24. This encoding is used in Philippines for ISDB-T captions. latin Latin character encoding defined in ABNT NBR 15606-1. This encoding is used in South America for SBTVD / ISDB-Tb captions. -font font_name[,font_name2,...] Specify comma-separated list of font family names to be used for bitmap or ass type subtitle rendering. Only first font name is used for ass type subtitle. If not specified, use internaly defined default font family. -ass_single_rect boolean ARIB STD-B24 specifies that some captions may be displayed at different positions at a time (multi-rectangle subtitle). Since some players (e.g., old mpv) can't handle multiple ASS rectangles in a single AVSubtitle, or multiple ASS rectangles of indeterminate duration with the same start timestamp, this option can change the behavior so that all the texts are displayed in a single ASS rectangle. The default is false. If your player cannot handle AVSubtitles with multiple ASS rectangles properly, set this option to true or define ASS_SINGLE_RECT=1 to change default behavior at compilation. -force_outline_text boolean Specify whether always render outline text for all characters regardless of the indication by charactor style. The default is false. -outline_width number (0.0 - 3.0) Specify width for outline text, in dots (relative). The default is 1.5. -ignore_background boolean Specify whether to ignore background color rendering. The default is false. -ignore_ruby boolean Specify whether to ignore rendering for ruby-like (furigana) characters. The default is false. -replace_drcs boolean Specify whether to render replaced DRCS characters as Unicode characters. The default is true. -replace_msz_ascii boolean Specify whether to replace MSZ (Middle Size; half width) fullwidth alphanumerics with halfwidth alphanumerics. The default is true. -replace_msz_japanese boolean Specify whether to replace some MSZ (Middle Size; half width) fullwidth japanese special characters with halfwidth ones. The default is true. -replace_msz_glyph boolean Specify whether to replace MSZ (Middle Size; half width) characters with halfwidth glyphs if the fonts supports it. This option works under FreeType or DirectWrite renderer with Adobe-Japan1 compliant fonts. e.g., IBM Plex Sans JP, Morisawa BIZ UDGothic, Morisawa BIZ UDMincho, Yu Gothic, Yu Mincho, and Meiryo. The default is true. -canvas_size image_size Specify the resolution of the canvas to render subtitles to; usually, this should be frame size of input video. This only applies when "-subtitle_type" is set to bitmap. The libaribcaption decoder assumes input frame size for bitmap rendering as below: 1. PROFILE_A : 1440 x 1080 with SAR (PAR) 4:3 2. PROFILE_C : 320 x 180 with SAR (PAR) 1:1 If actual frame size of input video does not match above assumption, the rendered captions may be distorted. To make the captions undistorted, add "-canvas_size" option to specify actual input video size. Note that the "-canvas_size" option is not required for video with different size but same aspect ratio. In such cases, the caption will be stretched or shrunk to actual video size if "-canvas_size" option is not specified. If "-canvas_size" option is specified with different size, the caption will be stretched or shrunk as specified size with calculated SAR. libaribcaption decoder usage examples Display MPEG-TS file with ARIB subtitle by "ffplay" tool: ffplay -sub_type bitmap MPEG.TS Display MPEG-TS file with input frame size 1920x1080 by "ffplay" tool: ffplay -sub_type bitmap -canvas_size 1920x1080 MPEG.TS Embed ARIB subtitle in transcoded video: ffmpeg -sub_type bitmap -i src.m2t -filter_complex "[0:v][0:s]overlay" -vcodec h264 dest.mp4 dvbsub Options compute_clut -2 Compute clut once if no matching CLUT is in the stream. -1 Compute clut if no matching CLUT is in the stream. 0 Never compute CLUT 1 Always compute CLUT and override the one provided in the stream. dvb_substream Selects the dvb substream, or all substreams if -1 which is default. dvdsub This codec decodes the bitmap subtitles used in DVDs; the same subtitles can also be found in VobSub file pairs and in some Matroska files. Options palette Specify the global palette used by the bitmaps. When stored in VobSub, the palette is normally specified in the index file; in Matroska, the palette is stored in the codec extra-data in the same format as in VobSub. In DVDs, the palette is stored in the IFO file, and therefore not available when reading from dumped VOB files. The format for this option is a string containing 16 24-bits hexadecimal numbers (without 0x prefix) separated by commas, for example "0d00ee, ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1, 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b". ifo_palette Specify the IFO file from which the global palette is obtained. (experimental) forced_subs_only Only decode subtitle entries marked as forced. Some titles have forced and non-forced subtitles in the same track. Setting this flag to 1 will only keep the forced subtitles. Default value is 0. libzvbi-teletext Libzvbi allows libavcodec to decode DVB teletext pages and DVB teletext subtitles. Requires the presence of the libzvbi headers and library during configuration. You need to explicitly configure the build with "--enable-libzvbi". Options txt_page List of teletext page numbers to decode. Pages that do not match the specified list are dropped. You may use the special "*" string to match all pages, or "subtitle" to match all subtitle pages. Default value is *. txt_default_region Set default character set used for decoding, a value between 0 and 87 (see ETS 300 706, Section 15, Table 32). Default value is -1, which does not override the libzvbi default. This option is needed for some legacy level 1.0 transmissions which cannot signal the proper charset. txt_chop_top Discards the top teletext line. Default value is 1. txt_format Specifies the format of the decoded subtitles. bitmap The default format, you should use this for teletext pages, because certain graphics and colors cannot be expressed in simple text or even ASS. text Simple text based output without formatting. ass Formatted ASS output, subtitle pages and teletext pages are returned in different styles, subtitle pages are stripped down to text, but an effort is made to keep the text alignment and the formatting. txt_left X offset of generated bitmaps, default is 0. txt_top Y offset of generated bitmaps, default is 0. txt_chop_spaces Chops leading and trailing spaces and removes empty lines from the generated text. This option is useful for teletext based subtitles where empty spaces may be present at the start or at the end of the lines or empty lines may be present between the subtitle lines because of double-sized teletext characters. Default value is 1. txt_duration Sets the display duration of the decoded teletext pages or subtitles in milliseconds. Default value is -1 which means infinity or until the next subtitle event comes. txt_transparent Force transparent background of the generated teletext bitmaps. Default value is 0 which means an opaque background. txt_opacity Sets the opacity (0-255) of the teletext background. If txt_transparent is not set, it only affects characters between a start box and an end box, typically subtitles. Default value is 0 if txt_transparent is set, 255 otherwise. BITSTREAM FILTERS When you configure your FFmpeg build, all the supported bitstream filters are enabled by default. You can list all available ones using the configure option "--list-bsfs". You can disable all the bitstream filters using the configure option "--disable-bsfs", and selectively enable any bitstream filter using the option "--enable-bsf=BSF", or you can disable a particular bitstream filter using the option "--disable-bsf=BSF". The option "-bsfs" of the ff* tools will display the list of all the supported bitstream filters included in your build. The ff* tools have a -bsf option applied per stream, taking a comma- separated list of filters, whose parameters follow the filter name after a '='. ffmpeg -i INPUT -c:v copy -bsf:v filter1[=opt1=str1:opt2=str2][,filter2] OUTPUT Below is a description of the currently available bitstream filters, with their parameters, if any. aac_adtstoasc Convert MPEG-2/4 AAC ADTS to an MPEG-4 Audio Specific Configuration bitstream. This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4 ADTS header and removes the ADTS header. This filter is required for example when copying an AAC stream from a raw ADTS AAC or an MPEG-TS container to MP4A-LATM, to an FLV file, or to MOV/MP4 files and related formats such as 3GP or M4A. Please note that it is auto-inserted for MP4A-LATM and MOV/MP4 and related formats. av1_metadata Modify metadata embedded in an AV1 stream. td Insert or remove temporal delimiter OBUs in all temporal units of the stream. insert Insert a TD at the beginning of every TU which does not already have one. remove Remove the TD from the beginning of every TU which has one. color_primaries transfer_characteristics matrix_coefficients Set the color description fields in the stream (see AV1 section 6.4.2). color_range Set the color range in the stream (see AV1 section 6.4.2; note that this cannot be set for streams using BT.709 primaries, sRGB transfer characteristic and identity (RGB) matrix coefficients). tv Limited range. pc Full range. chroma_sample_position Set the chroma sample location in the stream (see AV1 section 6.4.2). This can only be set for 4:2:0 streams. vertical Left position (matching the default in MPEG-2 and H.264). colocated Top-left position. tick_rate Set the tick rate (time_scale / num_units_in_display_tick) in the timing info in the sequence header. num_ticks_per_picture Set the number of ticks in each picture, to indicate that the stream has a fixed framerate. Ignored if tick_rate is not also set. delete_padding Deletes Padding OBUs. chomp Remove zero padding at the end of a packet. dca_core Extract the core from a DCA/DTS stream, dropping extensions such as DTS-HD. dump_extra Add extradata to the beginning of the filtered packets except when said packets already exactly begin with the extradata that is intended to be added. freq The additional argument specifies which packets should be filtered. It accepts the values: k keyframe add extradata to all key packets e all add extradata to all packets If not specified it is assumed k. For example the following ffmpeg command forces a global header (thus disabling individual packet headers) in the H.264 packets generated by the "libx264" encoder, but corrects them by adding the header stored in extradata to the key packets: ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts dv_error_marker Blocks in DV which are marked as damaged are replaced by blocks of the specified color. color The color to replace damaged blocks by sta A 16 bit mask which specifies which of the 16 possible error status values are to be replaced by colored blocks. 0xFFFE is the default which replaces all non 0 error status values. ok No error, no concealment err Error, No concealment res Reserved notok Error or concealment notres Not reserved Aa, Ba, Ca, Ab, Bb, Cb, A, B, C, a, b, erri, erru The specific error status code see page 44-46 or section 5.5 of eac3_core Extract the core from a E-AC-3 stream, dropping extra channels. extract_extradata Extract the in-band extradata. Certain codecs allow the long-term headers (e.g. MPEG-2 sequence headers, or H.264/HEVC (VPS/)SPS/PPS) to be transmitted either "in- band" (i.e. as a part of the bitstream containing the coded frames) or "out of band" (e.g. on the container level). This latter form is called "extradata" in FFmpeg terminology. This bitstream filter detects the in-band headers and makes them available as extradata. remove When this option is enabled, the long-term headers are removed from the bitstream after extraction. filter_units Remove units with types in or not in a given set from the stream. pass_types List of unit types or ranges of unit types to pass through while removing all others. This is specified as a '|'-separated list of unit type values or ranges of values with '-'. remove_types Identical to pass_types, except the units in the given set removed and all others passed through. Extradata is unchanged by this transformation, but note that if the stream contains inline parameter sets then the output may be unusable if they are removed. For example, to remove all non-VCL NAL units from an H.264 stream: ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=pass_types=1-5' OUTPUT To remove all AUDs, SEI and filler from an H.265 stream: ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=35|38-40' OUTPUT hapqa_extract Extract Rgb or Alpha part of an HAPQA file, without recompression, in order to create an HAPQ or an HAPAlphaOnly file. texture Specifies the texture to keep. color alpha Convert HAPQA to HAPQ ffmpeg -i hapqa_inputfile.mov -c copy -bsf:v hapqa_extract=texture=color -tag:v HapY -metadata:s:v:0 encoder="HAPQ" hapq_file.mov Convert HAPQA to HAPAlphaOnly ffmpeg -i hapqa_inputfile.mov -c copy -bsf:v hapqa_extract=texture=alpha -tag:v HapA -metadata:s:v:0 encoder="HAPAlpha Only" hapalphaonly_file.mov h264_metadata Modify metadata embedded in an H.264 stream. aud Insert or remove AUD NAL units in all access units of the stream. pass insert remove Default is pass. sample_aspect_ratio Set the sample aspect ratio of the stream in the VUI parameters. See H.264 table E-1. overscan_appropriate_flag Set whether the stream is suitable for display using overscan or not (see H.264 section E.2.1). video_format video_full_range_flag Set the video format in the stream (see H.264 section E.2.1 and table E-2). colour_primaries transfer_characteristics matrix_coefficients Set the colour description in the stream (see H.264 section E.2.1 and tables E-3, E-4 and E-5). chroma_sample_loc_type Set the chroma sample location in the stream (see H.264 section E.2.1 and figure E-1). tick_rate Set the tick rate (time_scale / num_units_in_tick) in the VUI parameters. This is the smallest time unit representable in the stream, and in many cases represents the field rate of the stream (double the frame rate). fixed_frame_rate_flag Set whether the stream has fixed framerate - typically this indicates that the framerate is exactly half the tick rate, but the exact meaning is dependent on interlacing and the picture structure (see H.264 section E.2.1 and table E-6). zero_new_constraint_set_flags Zero constraint_set4_flag and constraint_set5_flag in the SPS. These bits were reserved in a previous version of the H.264 spec, and thus some hardware decoders require these to be zero. The result of zeroing this is still a valid bitstream. crop_left crop_right crop_top crop_bottom Set the frame cropping offsets in the SPS. These values will replace the current ones if the stream is already cropped. These fields are set in pixels. Note that some sizes may not be representable if the chroma is subsampled or the stream is interlaced (see H.264 section 7.4.2.1.1). sei_user_data Insert a string as SEI unregistered user data. The argument must be of the form UUID+string, where the UUID is as hex digits possibly separated by hyphens, and the string can be anything. For example, 086f3693-b7b3-4f2c-9653-21492feee5b8+hello will insert the string ``hello'' associated with the given UUID. delete_filler Deletes both filler NAL units and filler SEI messages. display_orientation Insert, extract or remove Display orientation SEI messages. See H.264 section D.1.27 and D.2.27 for syntax and semantics. pass insert remove extract Default is pass. Insert mode works in conjunction with "rotate" and "flip" options. Any pre-existing Display orientation messages will be removed in insert or remove mode. Extract mode attaches the display matrix to the packet as side data. rotate Set rotation in display orientation SEI (anticlockwise angle in degrees). Range is -360 to +360. Default is NaN. flip Set flip in display orientation SEI. horizontal vertical Default is unset. level Set the level in the SPS. Refer to H.264 section A.3 and tables A-1 to A-5. The argument must be the name of a level (for example, 4.2), a level_idc value (for example, 42), or the special name auto indicating that the filter should attempt to guess the level from the input stream properties. h264_mp4toannexb Convert an H.264 bitstream from length prefixed mode to start code prefixed mode (as defined in the Annex B of the ITU-T H.264 specification). This is required by some streaming formats, typically the MPEG-2 transport stream format (muxer "mpegts"). For example to remux an MP4 file containing an H.264 stream to mpegts format with ffmpeg, you can use the command: ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts Please note that this filter is auto-inserted for MPEG-TS (muxer "mpegts") and raw H.264 (muxer "h264") output formats. h264_redundant_pps This applies a specific fixup to some Blu-ray streams which contain redundant PPSs modifying irrelevant parameters of the stream which confuse other transformations which require correct extradata. hevc_metadata Modify metadata embedded in an HEVC stream. aud Insert or remove AUD NAL units in all access units of the stream. insert remove sample_aspect_ratio Set the sample aspect ratio in the stream in the VUI parameters. video_format video_full_range_flag Set the video format in the stream (see H.265 section E.3.1 and table E.2). colour_primaries transfer_characteristics matrix_coefficients Set the colour description in the stream (see H.265 section E.3.1 and tables E.3, E.4 and E.5). chroma_sample_loc_type Set the chroma sample location in the stream (see H.265 section E.3.1 and figure E.1). tick_rate Set the tick rate in the VPS and VUI parameters (time_scale / num_units_in_tick). Combined with num_ticks_poc_diff_one, this can set a constant framerate in the stream. Note that it is likely to be overridden by container parameters when the stream is in a container. num_ticks_poc_diff_one Set poc_proportional_to_timing_flag in VPS and VUI and use this value to set num_ticks_poc_diff_one_minus1 (see H.265 sections 7.4.3.1 and E.3.1). Ignored if tick_rate is not also set. crop_left crop_right crop_top crop_bottom Set the conformance window cropping offsets in the SPS. These values will replace the current ones if the stream is already cropped. These fields are set in pixels. Note that some sizes may not be representable if the chroma is subsampled (H.265 section 7.4.3.2.1). level Set the level in the VPS and SPS. See H.265 section A.4 and tables A.6 and A.7. The argument must be the name of a level (for example, 5.1), a general_level_idc value (for example, 153 for level 5.1), or the special name auto indicating that the filter should attempt to guess the level from the input stream properties. hevc_mp4toannexb Convert an HEVC/H.265 bitstream from length prefixed mode to start code prefixed mode (as defined in the Annex B of the ITU-T H.265 specification). This is required by some streaming formats, typically the MPEG-2 transport stream format (muxer "mpegts"). For example to remux an MP4 file containing an HEVC stream to mpegts format with ffmpeg, you can use the command: ffmpeg -i INPUT.mp4 -codec copy -bsf:v hevc_mp4toannexb OUTPUT.ts Please note that this filter is auto-inserted for MPEG-TS (muxer "mpegts") and raw HEVC/H.265 (muxer "h265" or "hevc") output formats. imxdump Modifies the bitstream to fit in MOV and to be usable by the Final Cut Pro decoder. This filter only applies to the mpeg2video codec, and is likely not needed for Final Cut Pro 7 and newer with the appropriate -tag:v. For example, to remux 30 MB/sec NTSC IMX to MOV: ffmpeg -i input.mxf -c copy -bsf:v imxdump -tag:v mx3n output.mov mjpeg2jpeg Convert MJPEG/AVI1 packets to full JPEG/JFIF packets. MJPEG is a video codec wherein each video frame is essentially a JPEG image. The individual frames can be extracted without loss, e.g. by ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg Unfortunately, these chunks are incomplete JPEG images, because they lack the DHT segment required for decoding. Quoting from : 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 mjpegadump Add an MJPEG A header to the bitstream, to enable decoding by Quicktime. mov2textsub Extract a representable text file from MOV subtitles, stripping the metadata header from each subtitle packet. See also the text2movsub filter. mp3decomp Decompress non-standard compressed MP3 audio headers. mpeg2_metadata Modify metadata embedded in an MPEG-2 stream. display_aspect_ratio Set the display aspect ratio in the stream. The following fixed values are supported: 4/3 16/9 221/100 Any other value will result in square pixels being signalled instead (see H.262 section 6.3.3 and table 6-3). frame_rate Set the frame rate in the stream. This is constructed from a table of known values combined with a small multiplier and divisor - if the supplied value is not exactly representable, the nearest representable value will be used instead (see H.262 section 6.3.3 and table 6-4). video_format Set the video format in the stream (see H.262 section 6.3.6 and table 6-6). colour_primaries transfer_characteristics matrix_coefficients Set the colour description in the stream (see H.262 section 6.3.6 and tables 6-7, 6-8 and 6-9). mpeg4_unpack_bframes Unpack DivX-style packed B-frames. DivX-style packed B-frames are not valid MPEG-4 and were only a workaround for the broken Video for Windows subsystem. They use more space, can cause minor AV sync issues, require more CPU power to decode (unless the player has some decoded picture queue to compensate the 2,0,2,0 frame per packet style) and cause trouble if copied into a standard container like mp4 or mpeg-ps/ts, because MPEG-4 decoders may not be able to decode them, since they are not valid MPEG-4. For example to fix an AVI file containing an MPEG-4 stream with DivX- style packed B-frames using ffmpeg, you can use the command: ffmpeg -i INPUT.avi -codec copy -bsf:v mpeg4_unpack_bframes OUTPUT.avi noise Damages the contents of packets or simply drops them without damaging the container. Can be used for fuzzing or testing error resilience/concealment. Parameters: amount Accepts an expression whose evaluation per-packet determines how often bytes in that packet will be modified. A value below 0 will result in a variable frequency. Default is 0 which results in no modification. However, if neither amount nor drop is specified, amount will be set to -1. See below for accepted variables. drop Accepts an expression evaluated per-packet whose value determines whether that packet is dropped. Evaluation to a positive value results in the packet being dropped. Evaluation to a negative value results in a variable chance of it being dropped, roughly inverse in proportion to the magnitude of the value. Default is 0 which results in no drops. See below for accepted variables. dropamount Accepts a non-negative integer, which assigns a variable chance of it being dropped, roughly inverse in proportion to the value. Default is 0 which results in no drops. This option is kept for backwards compatibility and is equivalent to setting drop to a negative value with the same magnitude i.e. "dropamount=4" is the same as "drop=-4". Ignored if drop is also specified. Both "amount" and "drop" accept expressions containing the following variables: n The index of the packet, starting from zero. tb The timebase for packet timestamps. pts Packet presentation timestamp. dts Packet decoding timestamp. nopts Constant representing AV_NOPTS_VALUE. startpts First non-AV_NOPTS_VALUE PTS seen in the stream. startdts First non-AV_NOPTS_VALUE DTS seen in the stream. duration d Packet duration, in timebase units. pos Packet position in input; may be -1 when unknown or not set. size Packet size, in bytes. key Whether packet is marked as a keyframe. state A pseudo random integer, primarily derived from the content of packet payload. Examples Apply modification to every byte but don't drop any packets. ffmpeg -i INPUT -c copy -bsf noise=1 output.mkv Drop every video packet not marked as a keyframe after timestamp 30s but do not modify any of the remaining packets. ffmpeg -i INPUT -c copy -bsf:v noise=drop='gt(t\,30)*not(key)' output.mkv Drop one second of audio every 10 seconds and add some random noise to the rest. ffmpeg -i INPUT -c copy -bsf:a noise=amount=-1:drop='between(mod(t\,10)\,9\,10)' output.mkv null This bitstream filter passes the packets through unchanged. pcm_rechunk Repacketize PCM audio to a fixed number of samples per packet or a fixed packet rate per second. This is similar to the asetnsamples audio filter but works on audio packets instead of audio frames. nb_out_samples, n Set the number of samples per each output audio packet. The number is intended as the number of samples per each channel. Default value is 1024. pad, p If set to 1, the filter will pad the last audio packet with silence, so that it will contain the same number of samples (or roughly the same number of samples, see frame_rate) as the previous ones. Default value is 1. frame_rate, r This option makes the filter output a fixed number of packets per second instead of a fixed number of samples per packet. If the audio sample rate is not divisible by the frame rate then the number of samples will not be constant but will vary slightly so that each packet will start as close to the frame boundary as possible. Using this option has precedence over nb_out_samples. You can generate the well known 1602-1601-1602-1601-1602 pattern of 48kHz audio for NTSC frame rate using the frame_rate option. ffmpeg -f lavfi -i sine=r=48000:d=1 -c pcm_s16le -bsf pcm_rechunk=r=30000/1001 -f framecrc - pgs_frame_merge Merge a sequence of PGS Subtitle segments ending with an "end of display set" segment into a single packet. This is required by some containers that support PGS subtitles (muxer "matroska"). prores_metadata Modify color property metadata embedded in prores stream. color_primaries Set the color primaries. Available values are: auto Keep the same color primaries property (default). unknown bt709 bt470bg BT601 625 smpte170m BT601 525 bt2020 smpte431 DCI P3 smpte432 P3 D65 transfer_characteristics Set the color transfer. Available values are: auto Keep the same transfer characteristics property (default). unknown bt709 BT 601, BT 709, BT 2020 smpte2084 SMPTE ST 2084 arib-std-b67 ARIB STD-B67 matrix_coefficients Set the matrix coefficient. Available values are: auto Keep the same colorspace property (default). unknown bt709 smpte170m BT 601 bt2020nc Set Rec709 colorspace for each frame of the file ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709 output.mov Set Hybrid Log-Gamma parameters for each frame of the file ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt2020:color_trc=arib-std-b67:colorspace=bt2020nc output.mov remove_extra Remove extradata from packets. It accepts the following parameter: freq Set which frame types to remove extradata from. k Remove extradata from non-keyframes only. keyframe Remove extradata from keyframes only. e, all Remove extradata from all frames. setts Set PTS and DTS in packets. It accepts the following parameters: ts pts dts Set expressions for PTS, DTS or both. duration Set expression for duration. time_base Set output time base. The expressions are evaluated through the eval API and can contain the following constants: N The count of the input packet. Starting from 0. TS The demux timestamp in input in case of "ts" or "dts" option or presentation timestamp in case of "pts" option. POS The original position in the file of the packet, or undefined if undefined for the current packet DTS The demux timestamp in input. PTS The presentation timestamp in input. DURATION The duration in input. STARTDTS The DTS of the first packet. STARTPTS The PTS of the first packet. PREV_INDTS The previous input DTS. PREV_INPTS The previous input PTS. PREV_INDURATION The previous input duration. PREV_OUTDTS The previous output DTS. PREV_OUTPTS The previous output PTS. PREV_OUTDURATION The previous output duration. NEXT_DTS The next input DTS. NEXT_PTS The next input PTS. NEXT_DURATION The next input duration. TB The timebase of stream packet belongs. TB_OUT The output timebase. SR The sample rate of stream packet belongs. NOPTS The AV_NOPTS_VALUE constant. text2movsub Convert text subtitles to MOV subtitles (as used by the "mov_text" codec) with metadata headers. See also the mov2textsub filter. trace_headers Log trace output containing all syntax elements in the coded stream headers (everything above the level of individual coded blocks). This can be useful for debugging low-level stream issues. Supports AV1, H.264, H.265, (M)JPEG, MPEG-2 and VP9, but depending on the build only a subset of these may be available. truehd_core Extract the core from a TrueHD stream, dropping ATMOS data. vp9_metadata Modify metadata embedded in a VP9 stream. color_space Set the color space value in the frame header. Note that any frame set to RGB will be implicitly set to PC range and that RGB is incompatible with profiles 0 and 2. unknown bt601 bt709 smpte170 smpte240 bt2020 rgb color_range Set the color range value in the frame header. Note that any value imposed by the color space will take precedence over this value. tv pc vp9_superframe Merge VP9 invisible (alt-ref) frames back into VP9 superframes. This fixes merging of split/segmented VP9 streams where the alt-ref frame was split from its visible counterpart. vp9_superframe_split Split VP9 superframes into single frames. vp9_raw_reorder Given a VP9 stream with correct timestamps but possibly out of order, insert additional show-existing-frame packets to correct the ordering. FORMAT OPTIONS The libavformat library provides some generic global options, which can be set on all the muxers and demuxers. In addition each muxer or demuxer may support so-called private options, which are specific for that component. Options may be set by specifying -option value in the FFmpeg tools, or by setting the value explicitly in the "AVFormatContext" options or using the libavutil/opt.h API for programmatic use. The list of supported options follows: avioflags flags (input/output) Possible values: direct Reduce buffering. probesize integer (input) Set probing size in bytes, i.e. the size of the data to analyze to get stream information. A higher value will enable detecting more information in case it is dispersed into the stream, but will increase latency. Must be an integer not lesser than 32. It is 5000000 by default. max_probe_packets integer (input) Set the maximum number of buffered packets when probing a codec. Default is 2500 packets. packetsize integer (output) Set packet size. fflags flags Set format flags. Some are implemented for a limited number of formats. Possible values for input files: discardcorrupt Discard corrupted packets. fastseek Enable fast, but inaccurate seeks for some formats. genpts Generate missing PTS if DTS is present. igndts Ignore DTS if PTS is set. Inert when nofillin is set. ignidx Ignore index. nobuffer Reduce the latency introduced by buffering during initial input streams analysis. nofillin Do not fill in missing values in packet fields that can be exactly calculated. noparse Disable AVParsers, this needs "+nofillin" too. sortdts Try to interleave output packets by DTS. At present, available only for AVIs with an index. Possible values for output files: autobsf Automatically apply bitstream filters as required by the output format. Enabled by default. bitexact Only write platform-, build- and time-independent data. This ensures that file and data checksums are reproducible and match between platforms. Its primary use is for regression testing. flush_packets Write out packets immediately. shortest Stop muxing at the end of the shortest stream. It may be needed to increase max_interleave_delta to avoid flushing the longer streams before EOF. seek2any integer (input) Allow seeking to non-keyframes on demuxer level when supported if set to 1. Default is 0. analyzeduration integer (input) Specify how many microseconds are analyzed to probe the input. A higher value will enable detecting more accurate information, but will increase latency. It defaults to 5,000,000 microseconds = 5 seconds. cryptokey hexadecimal string (input) Set decryption key. indexmem integer (input) Set max memory used for timestamp index (per stream). rtbufsize integer (input) Set max memory used for buffering real-time frames. fdebug flags (input/output) Print specific debug info. Possible values: ts max_delay integer (input/output) Set maximum muxing or demuxing delay in microseconds. fpsprobesize integer (input) Set number of frames used to probe fps. audio_preload integer (output) Set microseconds by which audio packets should be interleaved earlier. chunk_duration integer (output) Set microseconds for each chunk. chunk_size integer (output) Set size in bytes for each chunk. err_detect, f_err_detect flags (input) Set error detection flags. "f_err_detect" is deprecated and should be used only via the ffmpeg tool. Possible values: crccheck Verify embedded CRCs. bitstream Detect bitstream specification deviations. buffer Detect improper bitstream length. explode Abort decoding on minor error detection. careful Consider things that violate the spec and have not been seen in the wild as errors. compliant Consider all spec non compliancies as errors. aggressive Consider things that a sane encoder should not do as an error. max_interleave_delta integer (output) Set maximum buffering duration for interleaving. The duration is expressed in microseconds, and defaults to 10000000 (10 seconds). To ensure all the streams are interleaved correctly, libavformat will wait until it has at least one packet for each stream before actually writing any packets to the output file. When some streams are "sparse" (i.e. there are large gaps between successive packets), this can result in excessive buffering. This field specifies the maximum difference between the timestamps of the first and the last packet in the muxing queue, above which libavformat will output a packet regardless of whether it has queued a packet for all the streams. If set to 0, libavformat will continue buffering packets until it has a packet for each stream, regardless of the maximum timestamp difference between the buffered packets. use_wallclock_as_timestamps integer (input) Use wallclock as timestamps if set to 1. Default is 0. avoid_negative_ts integer (output) Possible values: make_non_negative Shift timestamps to make them non-negative. Also note that this affects only leading negative timestamps, and not non- monotonic negative timestamps. make_zero Shift timestamps so that the first timestamp is 0. auto (default) Enables shifting when required by the target format. disabled Disables shifting of timestamp. When shifting is enabled, all output timestamps are shifted by the same amount. Audio, video, and subtitles desynching and relative timestamp differences are preserved compared to how they would have been without shifting. skip_initial_bytes integer (input) Set number of bytes to skip before reading header and frames if set to 1. Default is 0. correct_ts_overflow integer (input) Correct single timestamp overflows if set to 1. Default is 1. flush_packets integer (output) Flush the underlying I/O stream after each packet. Default is -1 (auto), which means that the underlying protocol will decide, 1 enables it, and has the effect of reducing the latency, 0 disables it and may increase IO throughput in some cases. output_ts_offset offset (output) Set the output time offset. offset must be a time duration specification, see the Time duration section in the ffmpeg-utils(1) manual. The offset is added by the muxer to the output timestamps. Specifying a positive offset means that the corresponding streams are delayed bt the time duration specified in offset. Default value is 0 (meaning that no offset is applied). format_whitelist list (input) "," separated list of allowed demuxers. By default all are allowed. dump_separator string (input) Separator used to separate the fields printed on the command line about the Stream parameters. For example, to separate the fields with newlines and indentation: ffprobe -dump_separator " " -i ~/videos/matrixbench_mpeg2.mpg max_streams integer (input) Specifies the maximum number of streams. This can be used to reject files that would require too many resources due to a large number of streams. skip_estimate_duration_from_pts bool (input) Skip estimation of input duration when calculated using PTS. At present, applicable for MPEG-PS and MPEG-TS. strict, f_strict integer (input/output) Specify how strictly to follow the standards. "f_strict" is deprecated and should be used only via the ffmpeg tool. Possible values: very strictly conform to an older more strict version of the spec or reference software strict strictly conform to all the things in the spec no matter what consequences normal unofficial allow unofficial extensions experimental allow non standardized experimental things, experimental (unfinished/work in progress/not well tested) decoders and encoders. Note: experimental decoders can pose a security risk, do not use this for decoding untrusted input. Format stream specifiers Format stream specifiers allow selection of one or more streams that match specific properties. The exact semantics of stream specifiers is defined by the avformat_match_stream_specifier() function declared in the libavformat/avformat.h header and documented in the Stream specifiers section in the ffmpeg(1) manual. DEMUXERS Demuxers are configured elements in FFmpeg that can read the multimedia streams from a particular type of file. When you configure your FFmpeg build, all the supported demuxers are enabled by default. You can list all available ones using the configure option "--list-demuxers". You can disable all the demuxers using the configure option "--disable-demuxers", and selectively enable a single demuxer with the option "--enable-demuxer=DEMUXER", or disable it with the option "--disable-demuxer=DEMUXER". The option "-demuxers" of the ff* tools will display the list of enabled demuxers. Use "-formats" to view a combined list of enabled demuxers and muxers. The description of some of the currently available demuxers follows. aa Audible Format 2, 3, and 4 demuxer. This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files. aac Raw Audio Data Transport Stream AAC demuxer. This demuxer is used to demux an ADTS input containing a single AAC stream alongwith any ID3v1/2 or APE tags in it. apng Animated Portable Network Graphics demuxer. This demuxer is used to demux APNG files. All headers, but the PNG signature, up to (but not including) the first fcTL chunk are transmitted as extradata. Frames are then split as being all the chunks between two fcTL ones, or between the last fcTL and IEND chunks. -ignore_loop bool Ignore the loop variable in the file if set. Default is enabled. -max_fps int Maximum framerate in frames per second. Default of 0 imposes no limit. -default_fps int Default framerate in frames per second when none is specified in the file (0 meaning as fast as possible). Default is 15. asf Advanced Systems Format demuxer. This demuxer is used to demux ASF files and MMS network streams. -no_resync_search bool Do not try to resynchronize by looking for a certain optional start code. concat Virtual concatenation script demuxer. This demuxer reads a list of files and other directives from a text file and demuxes them one after the other, as if all their packets had been muxed together. The timestamps in the files are adjusted so that the first file starts at 0 and each next file starts where the previous one finishes. Note that it is done globally and may cause gaps if all streams do not have exactly the same length. All files must have the same streams (same codecs, same time base, etc.). The duration of each file is used to adjust the timestamps of the next file: if the duration is incorrect (because it was computed using the bit-rate or because the file is truncated, for example), it can cause artifacts. The "duration" directive can be used to override the duration stored in each file. Syntax The script is a text file in extended-ASCII, with one directive per line. Empty lines, leading spaces and lines starting with '#' are ignored. The following directive is recognized: "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. To make FFmpeg recognize the format automatically, this directive must appear 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. This directive is deprecated, use "file_packet_meta" instead. "file_packet_meta 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. "option key value" Option to access, open and probe the file. Can be present multiple times. "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. "stream_meta key value" Metadata for the stream. Can be present multiple times. "stream_codec value" Codec for the stream. "stream_extradata hex_string" Extradata for the string, encoded in hexadecimal. "chapter id start end" Add a chapter. id is an unique identifier, possibly small and consecutive. Options This demuxer accepts the following option: safe If set to 1, reject unsafe file paths and directives. 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. auto_convert 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. segment_time_metadata If set to 1, every packet will contain the lavf.concat.start_time and the lavf.concat.duration packet metadata values which are the start_time and the duration of the respective file segments in the concatenated output expressed in microseconds. The duration metadata is only set if it is known based on the concat file. The default is 0. Examples o Use absolute filenames and include some comments: # my first filename file /mnt/share/file-1.wav # my second filename including whitespace file '/mnt/share/file 2.wav' # my third filename including whitespace plus single quote file '/mnt/share/file 3'\''.wav' o Allow for input format auto-probing, use safe filenames and set the duration of the first file: ffconcat version 1.0 file file-1.wav duration 20.0 file subdir/file-2.wav dash Dynamic Adaptive Streaming over HTTP demuxer. This demuxer presents all AVStreams found in the manifest. By setting the discard flags on AVStreams the caller can decide which streams to actually receive. Each stream mirrors the "id" and "bandwidth" properties from the "" as metadata keys named "id" and "variant_bitrate" respectively. Options This demuxer accepts the following option: cenc_decryption_key 16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7). ea Electronic Arts Multimedia format demuxer. This format is used by various Electronic Arts games. Options merge_alpha bool Normally the VP6 alpha channel (if exists) is returned as a secondary video stream, by setting this option you can make the demuxer return a single video stream which contains the alpha channel in addition to the ordinary video. imf Interoperable Master Format demuxer. This demuxer presents audio and video streams found in an IMF Composition, as specified in . ffmpeg [-assetmaps ,,...] -i ... If "-assetmaps" is not specified, the demuxer looks for a file called ASSETMAP.xml in the same directory as the CPL. flv, live_flv, kux Adobe Flash Video Format demuxer. This demuxer is used to demux FLV files and RTMP network streams. In case of live network streams, if you force format, you may use live_flv option instead of flv to survive timestamp discontinuities. KUX is a flv variant used on the Youku platform. ffmpeg -f flv -i myfile.flv ... ffmpeg -f live_flv -i rtmp:///anything/key .... -flv_metadata bool Allocate the streams according to the onMetaData array content. -flv_ignore_prevtag bool Ignore the size of previous tag value. -flv_full_metadata bool Output all context of the onMetadata. gif Animated GIF demuxer. It accepts the following options: min_delay Set the minimum valid delay between frames in hundredths of seconds. Range is 0 to 6000. Default value is 2. max_gif_delay 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. default_delay Set the default delay between frames in hundredths of seconds. Range is 0 to 6000. Default value is 10. ignore_loop 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. hls HLS demuxer 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". It accepts the following options: live_start_index segment index to start live streams at (negative values are from the end). prefer_x_start prefer to use #EXT-X-START if it's in playlist instead of live_start_index. allowed_extensions ',' separated list of file extensions that hls is allowed to access. max_reload Maximum number of times a insufficient list is attempted to be reloaded. Default value is 1000. m3u8_hold_counters The maximum number of times to load m3u8 when it refreshes without new segments. Default value is 1000. http_persistent Use persistent HTTP connections. Applicable only for HTTP streams. Enabled by default. http_multiple Use multiple HTTP connections for downloading HTTP segments. Enabled by default for HTTP/1.1 servers. http_seekable Use HTTP partial requests for downloading HTTP segments. 0 = disable, 1 = enable, -1 = auto, Default is auto. seg_format_options Set options for the demuxer of media segments using a list of key=value pairs separated by ":". seg_max_retry Maximum number of times to reload a segment on error, useful when segment skip on network error is not desired. Default value is 0. image2 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: framerate Set the frame rate for the video stream. It defaults to 25. loop If set to 1, loop over the input. Default value is 0. pattern_type Select the pattern type used to interpret the provided filename. pattern_type accepts one of the following values. none 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. sequence 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 glob 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. glob_sequence (deprecated, will be removed) 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. pixel_format 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. start_number Set the index of the file matched by the image file pattern to start to read from. Default value is 0. start_number_range 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. ts_from_file 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. video_size 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. export_path_metadata If set to 1, will add two extra fields to the metadata found in input, making them also available for other filters (see drawtext filter for examples). Default value is 0. The extra fields are described below: lavf.image2dec.source_path Corresponds to the full path to the input file being read. lavf.image2dec.source_basename Corresponds to the name of the file being read. Examples o Use 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 o As above, but start by reading from a file with index 100 in the sequence: ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv o Read images matching the "*.png" glob pattern , that is all the files terminating with the ".png" suffix: ffmpeg -framerate 10 -pattern_type glob -i "*.png" out.mkv libgme The Game Music Emu library is a collection of video game music file emulators. See for more information. It accepts the following options: track_index Set the index of which track to demux. The demuxer can only export one track. Track indexes start at 0. Default is to pick the first track. Number of tracks is exported as tracks metadata entry. sample_rate Set the sampling rate of the exported track. Range is 1000 to 999999. Default is 44100. max_size (bytes) The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size, which in turn, acts as a ceiling for the size of files that can be read. Default is 50 MiB. libmodplug ModPlug based module demuxer See It will export one 2-channel 16-bit 44.1 kHz audio stream. Optionally, a "pal8" 16-color video stream can be exported with or without printed metadata. It accepts the following options: noise_reduction Apply a simple low-pass filter. Can be 1 (on) or 0 (off). Default is 0. reverb_depth Set amount of reverb. Range 0-100. Default is 0. reverb_delay Set delay in ms, clamped to 40-250 ms. Default is 0. bass_amount Apply bass expansion a.k.a. XBass or megabass. Range is 0 (quiet) to 100 (loud). Default is 0. bass_range Set cutoff i.e. upper-bound for bass frequencies. Range is 10-100 Hz. Default is 0. surround_depth Apply a Dolby Pro-Logic surround effect. Range is 0 (quiet) to 100 (heavy). Default is 0. surround_delay Set surround delay in ms, clamped to 5-40 ms. Default is 0. max_size The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size, which in turn, acts as a ceiling for the size of files that can be read. Range is 0 to 100 MiB. 0 removes buffer size limit (not recommended). Default is 5 MiB. video_stream_expr String which is evaluated using the eval API to assign colors to the generated video stream. Variables which can be used are "x", "y", "w", "h", "t", "speed", "tempo", "order", "pattern" and "row". video_stream Generate video stream. Can be 1 (on) or 0 (off). Default is 0. video_stream_w Set video frame width in 'chars' where one char indicates 8 pixels. Range is 20-512. Default is 30. video_stream_h Set video frame height in 'chars' where one char indicates 8 pixels. Range is 20-512. Default is 30. video_stream_ptxt Print metadata on video stream. Includes "speed", "tempo", "order", "pattern", "row" and "ts" (time in ms). Can be 1 (on) or 0 (off). Default is 1. libopenmpt libopenmpt based module demuxer See for more information. Some files have multiple subsongs (tracks) this can be set with the subsong option. It accepts the following options: subsong Set the subsong index. This can be either 'all', 'auto', or the index of the subsong. Subsong indexes start at 0. The default is 'auto'. The default value is to let libopenmpt choose. layout Set the channel layout. Valid values are 1, 2, and 4 channel layouts. The default value is STEREO. sample_rate Set the sample rate for libopenmpt to output. Range is from 1000 to INT_MAX. The value default is 48000. mov/mp4/3gp Demuxer for Quicktime File Format & ISO/IEC Base Media File Format (ISO/IEC 14496-12 or MPEG-4 Part 12, ISO/IEC 15444-12 or JPEG 2000 Part 12). Registered extensions: mov, mp4, m4a, 3gp, 3g2, mj2, psp, m4b, ism, ismv, isma, f4v Options This demuxer accepts the following options: enable_drefs Enable loading of external tracks, disabled by default. Enabling this can theoretically leak information in some use cases. use_absolute_path Allows loading of external tracks via absolute paths, disabled by default. Enabling this poses a security risk. It should only be enabled if the source is known to be non-malicious. seek_streams_individually When seeking, identify the closest point in each stream individually and demux packets in that stream from identified point. This can lead to a different sequence of packets compared to demuxing linearly from the beginning. Default is true. ignore_editlist Ignore any edit list atoms. The demuxer, by default, modifies the stream index to reflect the timeline described by the edit list. Default is false. advanced_editlist Modify the stream index to reflect the timeline described by the edit list. "ignore_editlist" must be set to false for this option to be effective. If both "ignore_editlist" and this option are set to false, then only the start of the stream index is modified to reflect initial dwell time or starting timestamp described by the edit list. Default is true. ignore_chapters Don't parse chapters. This includes GoPro 'HiLight' tags/moments. Note that chapters are only parsed when input is seekable. Default is false. use_mfra_for For seekable fragmented input, set fragment's starting timestamp from media fragment random access box, if present. Following options are available: auto Auto-detect whether to set mfra timestamps as PTS or DTS (default) dts Set mfra timestamps as DTS pts Set mfra timestamps as PTS 0 Don't use mfra box to set timestamps use_tfdt For fragmented input, set fragment's starting timestamp to "baseMediaDecodeTime" from the "tfdt" box. Default is enabled, which will prefer to use the "tfdt" box to set DTS. Disable to use the "earliest_presentation_time" from the "sidx" box. In either case, the timestamp from the "mfra" box will be used if it's available and "use_mfra_for" is set to pts or dts. export_all Export unrecognized boxes within the udta box as metadata entries. The first four characters of the box type are set as the key. Default is false. export_xmp Export entire contents of XMP_ box and uuid box as a string with key "xmp". Note that if "export_all" is set and this option isn't, the contents of XMP_ box are still exported but with key "XMP_". Default is false. activation_bytes 4-byte key required to decrypt Audible AAX and AAX+ files. See Audible AAX subsection below. audible_fixed_key Fixed key used for handling Audible AAX/AAX+ files. It has been pre-set so should not be necessary to specify. decryption_key 16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7). max_stts_delta Very high sample deltas written in a trak's stts box may occasionally be intended but usually they are written in error or used to store a negative value for dts correction when treated as signed 32-bit integers. This option lets the user set an upper limit, beyond which the delta is clamped to 1. Values greater than the limit if negative when cast to int32 are used to adjust onward dts. Unit is the track time scale. Range is 0 to UINT_MAX. Default is "UINT_MAX - 48000*10" which allows upto a 10 second dts correction for 48 kHz audio streams while accommodating 99.9% of "uint32" range. interleaved_read Interleave packets from multiple tracks at demuxer level. For badly interleaved files, this prevents playback issues caused by large gaps between packets in different tracks, as MOV/MP4 do not have packet placement requirements. However, this can cause excessive seeking on very badly interleaved files, due to seeking between tracks, so disabling it may prevent I/O issues, at the expense of playback. Audible AAX Audible AAX files are encrypted M4B files, and they can be decrypted by specifying a 4 byte activation secret. ffmpeg -activation_bytes 1CEB00DA -i test.aax -vn -c:a copy output.mp4 mpegts MPEG-2 transport stream demuxer. This demuxer accepts the following options: resync_size Set size limit for looking up a new synchronization. Default value is 65536. skip_unknown_pmt Skip PMTs for programs not defined in the PAT. Default value is 0. fix_teletext_pts 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. ts_packetsize Output option carrying the raw packet size in bytes. Show the detected raw packet size, cannot be set by the user. scan_all_pmts 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. merge_pmt_versions Re-use existing streams when a PMT's version is updated and elementary streams move to different PIDs. Default value is 0. max_packet_size Set maximum size, in bytes, of packet emitted by the demuxer. Payloads above this size are split across multiple packets. Range is 1 to INT_MAX/2. Default is 204800 bytes. mpjpeg MJPEG encapsulated in multi-part MIME demuxer. This demuxer allows reading of MJPEG, where each frame is represented as a part of multipart/x-mixed-replace stream. strict_mime_boundary Default implementation applies a relaxed standard to multi-part MIME boundary detection, to prevent regression with numerous existing endpoints not generating a proper MIME MJPEG stream. Turning this option on by setting it to 1 will result in a stricter check of the boundary value. rawvideo 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: framerate Set input video frame rate. Default value is 25. pixel_format Set the input video pixel format. Default value is "yuv420p". video_size 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 sbg SBaGen script demuxer. This demuxer reads the script language used by 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. tedcaptions JSON captions used for . 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: start_time 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 vapoursynth Vapoursynth wrapper. Due to security concerns, Vapoursynth scripts will not be autodetected so the input format has to be forced. For ff* CLI tools, add "-f vapoursynth" before the input "-i yourscript.vpy". This demuxer accepts the following option: max_script_size The demuxer buffers the entire script into memory. Adjust this value to set the maximum buffer size, which in turn, acts as a ceiling for the size of scripts that can be read. Default is 1 MiB. METADATA 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: 1. A file consists of a header and a number of metadata tags divided into sections, each on its own line. 2. The header is a ;FFMETADATA string, followed by a version number (now 1). 3. Metadata tags are of the form key=value 4. Immediately after header follows global metadata 5. After global metadata there may be sections with per-stream/per-chapter metadata. 6. A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in brackets ([, ]) and ends with next section or end of file. 7. At the beginning of a chapter section there may be an optional timebase to be used for start/end values. It must be in form TIMEBASE=num/den, where num and den are integers. If the timebase is missing then start/end times are assumed to be in nanoseconds. Next a chapter section must contain chapter start and end times in form START=num, END=num, where num is a positive integer. 8. Empty lines and lines starting with ; or # are ignored. 9. Metadata keys or values containing special characters (=, ;, #, \ and a newline) must be escaped with a backslash \. 10. Note that whitespace in metadata (e.g. foo = bar) is considered to be a part of the tag (in the example above key is foo , value is bar). 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 PROTOCOL OPTIONS The libavformat library provides some generic global options, which can be set on all the protocols. In addition each protocol 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: protocol_whitelist list (input) Set a ","-separated list of allowed protocols. "ALL" matches all protocols. Protocols prefixed by "-" are disabled. All protocols are allowed by default but protocols used by an another protocol (nested protocols) are restricted to a per protocol subset. PROTOCOLS 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. All protocols accept the following options: rw_timeout Maximum time to wait for (network) read/write operations to complete, in microseconds. A description of the currently available protocols follows. amqp Advanced Message Queueing Protocol (AMQP) version 0-9-1 is a broker based publish-subscribe communication protocol. FFmpeg must be compiled with --enable-librabbitmq to support AMQP. A separate AMQP broker must also be run. An example open-source AMQP broker is RabbitMQ. After starting the broker, an FFmpeg client may stream data to the broker using the command: ffmpeg -re -i input -f mpegts amqp://[[user]:[password]@]hostname[:port][/vhost] Where hostname and port (default is 5672) is the address of the broker. The client may also set a user/password for authentication. The default for both fields is "guest". Name of virtual host on broker can be set with vhost. The default value is "/". Muliple subscribers may stream from the broker using the command: ffplay amqp://[[user]:[password]@]hostname[:port][/vhost] In RabbitMQ all data published to the broker flows through a specific exchange, and each subscribing client has an assigned queue/buffer. When a packet arrives at an exchange, it may be copied to a client's queue depending on the exchange and routing_key fields. The following options are supported: exchange Sets the exchange to use on the broker. RabbitMQ has several predefined exchanges: "amq.direct" is the default exchange, where the publisher and subscriber must have a matching routing_key; "amq.fanout" is the same as a broadcast operation (i.e. the data is forwarded to all queues on the fanout exchange independent of the routing_key); and "amq.topic" is similar to "amq.direct", but allows for more complex pattern matching (refer to the RabbitMQ documentation). routing_key Sets the routing key. The default value is "amqp". The routing key is used on the "amq.direct" and "amq.topic" exchanges to decide whether packets are written to the queue of a subscriber. pkt_size Maximum size of each packet sent/received to the broker. Default is 131072. Minimum is 4096 and max is any large value (representable by an int). When receiving packets, this sets an internal buffer size in FFmpeg. It should be equal to or greater than the size of the published packets to the broker. Otherwise the received message may be truncated causing decoding errors. connection_timeout The timeout in seconds during the initial connection to the broker. The default value is rw_timeout, or 5 seconds if rw_timeout is not set. delivery_mode mode Sets the delivery mode of each message sent to broker. The following values are accepted: persistent Delivery mode set to "persistent" (2). This is the default value. Messages may be written to the broker's disk depending on its setup. non-persistent Delivery mode set to "non-persistent" (1). Messages will stay in broker's memory unless the broker is under memory pressure. async Asynchronous data filling wrapper for input stream. Fill data in a background thread, to decouple I/O operation from demux thread. async: async:http://host/resource async:cache:http://host/resource bluray Read BluRay playlist. The accepted options are: angle BluRay angle chapter Start chapter (1...N) playlist 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 cache Caching wrapper for input stream. Cache the input stream to temporary file. It brings seeking capability to live streams. The accepted options are: read_ahead_limit Amount in bytes that may be read ahead when seeking isn't supported. Range is -1 to INT_MAX. -1 for unlimited. Default is 65536. URL Syntax is cache: concat 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:||...| 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. concatf Physical concatenation protocol using a line break delimited list of resources. Read and seek from many resources in sequence as if they were a unique resource. A URL accepted by this protocol has the syntax: concatf: where URL is the url containing a line break delimited list of resources to be concatenated, each one possibly specifying a distinct protocol. Special characters must be escaped with backslash or single quotes. See the "Quoting and escaping" section in the ffmpeg-utils(1) manual. For example to read a sequence of files split1.mpeg, split2.mpeg, split3.mpeg listed in separate lines within a file split.txt with ffplay use the command: ffplay concatf:split.txt Where split.txt contains the lines: split1.mpeg split2.mpeg split3.mpeg crypto AES-encrypted stream reading protocol. The accepted options are: key Set the AES decryption key binary block from given hexadecimal representation. iv Set the AES decryption initialization vector binary block from given hexadecimal representation. Accepted URL formats: crypto: crypto+ data Data in-line in the URI. See . For example, to convert a GIF file given inline with ffmpeg: ffmpeg -i "data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=" smiley.png fd File descriptor access protocol. The accepted syntax is: fd: -fd If fd is not specified, by default the stdout file descriptor will be used for writing, stdin for reading. Unlike the pipe protocol, fd protocol has seek support if it corresponding to a regular file. fd protocol doesn't support pass file descriptor via URL for security. This protocol accepts the following options: blocksize 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. fd Set file descriptor. file File access protocol. Read from or write to a file. A file URL can have the form: file: 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 Truncate existing files on write, if set to 1. A value of 0 prevents truncating. Default value is 1. blocksize 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. follow If set to 1, the protocol will retry reading at the end of the file, allowing reading files that still are being written. In order for this to terminate, you either need to use the rw_timeout option, or use the interrupt callback (for API users). seekable Controls if seekability is advertised on the file. 0 means non- seekable, -1 means auto (seekable for normal files, non-seekable for named pipes). Many demuxers handle seekable and non-seekable resources differently, overriding this might speed up opening certain files at the cost of losing some features (e.g. accurate seeking). ftp 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. timeout 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. ftp-user Set a user to be used for authenticating to the FTP server. This is overridden by the user in the FTP URL. ftp-password Set a password to be used for authenticating to the FTP server. This is overridden by the password in the FTP URL, or by ftp- anonymous-password if no user is set. ftp-anonymous-password Password used when login as anonymous user. Typically an e-mail address should be used. ftp-write-seekable 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 Gopher protocol. gophers Gophers protocol. The Gopher protocol with TLS encapsulation. hls 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 HTTP (Hyper Text Transfer Protocol). This protocol accepts the following options: seekable 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. chunked_post If set to 1 use chunked Transfer-Encoding for posts, default is 1. content_type Set a specific content type for the POST messages or for listen mode. http_proxy set HTTP proxy to tunnel through e.g. http://example.com:1234 headers Set custom HTTP headers, can override built in default headers. The value must be a string encoding the headers. multiple_requests Use persistent connections if set to 1, default is 0. post_data Set custom HTTP post data. referer Set the Referer header. Include 'Referer: URL' header in HTTP request. user_agent Override the User-Agent header. If not specified the protocol will use a string describing the libavformat build. ("Lavf/") reconnect_at_eof If set then eof is treated like an error and causes reconnection, this is useful for live / endless streams. reconnect_streamed If set then even streamed/non seekable streams will be reconnected on errors. reconnect_on_network_error Reconnect automatically in case of TCP/TLS errors during connect. reconnect_on_http_error A comma separated list of HTTP status codes to reconnect on. The list can include specific status codes (e.g. '503') or the strings '4xx' / '5xx'. reconnect_delay_max Sets the maximum delay in seconds after which to give up reconnecting mime_type Export the MIME type. http_version Exports the HTTP response version number. Usually "1.0" or "1.1". icy 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. icy_metadata_headers If the server supports ICY metadata, this contains the ICY-specific HTTP reply headers, separated by newline characters. icy_metadata_packet 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. cookies 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. offset Set initial byte offset. end_offset Try to limit the request to bytes preceding this offset. method 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. listen 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 multi-client HTTP server. This is not yet implemented in ffmpeg.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://: # Client side (receiving): ffmpeg -i http://: -c copy somefile.ogg # Client can also be done with wget: wget http://: -O somefile.ogg # Server side (receiving): ffmpeg -listen 1 -i http://: -c copy somefile.ogg # Client side (sending): ffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://: # Client can also be done with wget: wget --post-file=somefile.ogg http://: send_expect_100 Send an Expect: 100-continue header for POST. If set to 1 it will send, if set to 0 it won't, if set to -1 it will try to send if it is applicable. Default value is -1. auth_type Set HTTP authentication type. No option for Digest, since this method requires getting nonce parameters from the server first and can't be used straight away like Basic. none Choose the HTTP authentication type automatically. This is the default. basic Choose the HTTP basic authentication. Basic authentication sends a Base64-encoded string that contains a user name and password for the client. Base64 is not a form of encryption and should be considered the same as sending the user name and password in clear text (Base64 is a reversible encoding). If a resource needs to be protected, strongly consider using an authentication scheme other than basic authentication. HTTPS/TLS should be used with basic authentication. Without these additional security enhancements, basic authentication should not be used to protect sensitive or valuable information. HTTP Cookies 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 Icecast protocol (stream to Icecast servers) This protocol accepts the following options: ice_genre Set the stream genre. ice_name Set the stream name. ice_description Set the stream description. ice_url Set the stream website URL. ice_public Set if the stream should be public. The default is 0 (not public). user_agent Override the User-Agent header. If not specified a string of the form "Lavf/" will be used. password Set the Icecast mountpoint password. content_type Set the stream content type. This must be set if it is different from audio/mpeg. legacy_icecast This enables support for Icecast versions < 2.4.0, that do not support the HTTP PUT method but the SOURCE method. tls Establish a TLS (HTTPS) connection to Icecast. icecast://[[:]@]:/ ipfs InterPlanetary File System (IPFS) protocol support. One can access files stored on the IPFS network through so-called gateways. These are http(s) endpoints. This protocol wraps the IPFS native protocols (ipfs:// and ipns://) to be sent to such a gateway. Users can (and should) host their own node which means this protocol will use one's local gateway to access files on the IPFS network. This protocol accepts the following options: gateway Defines the gateway to use. When not set, the protocol will first try locating the local gateway by looking at $IPFS_GATEWAY, $IPFS_PATH and "$HOME/.ipfs/", in that order. One can use this protocol in 2 ways. Using IPFS: ffplay ipfs:// Or the IPNS protocol (IPNS is mutable IPFS): ffplay ipns:// mmst MMS (Microsoft Media Server) protocol over TCP. mmsh MMS (Microsoft Media Server) protocol over HTTP. The required syntax is: mmsh://[:][/][/] md5 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. pipe UNIX pipe access protocol. Read and write from UNIX pipes. The accepted syntax is: pipe:[] If fd isn't specified, 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: blocksize 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. fd Set file descriptor. Note that some formats (typically MOV), require the output protocol to be seekable, so they will fail with the pipe output protocol. prompeg Pro-MPEG Code of Practice #3 Release 2 FEC protocol. The Pro-MPEG CoP#3 FEC is a 2D parity-check forward error correction mechanism for MPEG-2 Transport Streams sent over RTP. This protocol must be used in conjunction with the "rtp_mpegts" muxer and the "rtp" protocol. The required syntax is: -f rtp_mpegts -fec prompeg=