FFPROBE(1) | FFPROBE(1) |
ffprobe - ffprobe media prober
ffprobe [options] [input_url]
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.
ffprobe may be employed both as a standalone application or in combination with a textual filter, which may perform more sophisticated processing, e.g. statistical processing or plotting.
Options are used to list some of the formats supported by ffprobe or for specifying which information to display, and for setting how ffprobe will show it.
ffprobe output is designed to be easily parsable by a textual filter, and consists of one or more sections of a form defined by the selected writer, which is specified by the print_format option.
Sections may contain other nested sections, and are identified by a name (which may be shared by other sections), and an unique name. See the output of sections.
Metadata tags stored in the container or in the streams are recognized and printed in the corresponding "FORMAT", "STREAM" or "PROGRAM_STREAM" section.
All the numerical options, if not specified otherwise, accept a string representing a number as input, which may be followed by one of the SI unit prefixes, for example: 'K', 'M', or 'G'.
If 'i' is appended to the SI unit prefix, the complete prefix will be interpreted as a unit prefix for binary multiples, which are based on powers of 1024 instead of powers of 1000. Appending 'B' to the SI unit prefix multiplies the value by 8. This allows using, for example: 'KB', 'MiB', 'G' and 'B' as number suffixes.
Options which do not take arguments are boolean options, and set the corresponding value to true. They can be set to false by prefixing the option name with "no". For example using "-nofoo" will set the boolean option with name "foo" to false.
Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers are used to precisely specify which stream(s) a given option belongs to.
A stream specifier is a string generally appended to the option name and separated from it by a colon. E.g. "-codec:a:1 ac3" contains the "a:1" stream specifier, which matches the second audio stream. Therefore, it would select the ac3 codec for the second audio stream.
A stream specifier can match several streams, so that the option is applied to all of them. E.g. the stream specifier in "-b:a 128k" matches all audio streams.
An empty stream specifier matches all streams. For example, "-codec copy" or "-codec: copy" would copy all the streams without reencoding.
Possible forms of stream specifiers are:
Note that in ffmpeg, matching by metadata will only work properly for input files.
These options are shared amongst the ff* tools.
Possible values of arg are:
Note that the term 'codec' is used throughout this documentation as a shortcut for what is more correctly called a media bitstream format.
ffmpeg -sources pulse,server=192.168.0.4
ffmpeg -sinks pulse,server=192.168.0.4
The optional flags prefix can consist of the following values:
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:
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 NO_COLOR, or can be forced setting the environment variable AV_LOG_FORCE_COLOR. The use of the environment variable NO_COLOR is deprecated and will be dropped in a future FFmpeg version.
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:
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.
All FFmpeg tools will normally show a copyright notice, build options and library versions. This option can be used to suppress printing this information.
ffmpeg -cpuflags -sse+mmx ... ffmpeg -cpuflags mmx ... ffmpeg -cpuflags 0 ...
Possible flags for this option are:
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:
For example to write an ID3v2.3 header instead of a default ID3v2.4 to an MP3 file, use the id3v2_version private option of the MP3 muxer:
ffmpeg -i input.flac -id3v2_version 3 out.mp3
All codec AVOptions are per-stream, and thus a stream specifier should be attached to them.
Note: the -nooption syntax cannot be used for boolean AVOptions, use -option 0/-option 1.
Note: the old undocumented way of specifying per-stream AVOptions by prepending v/a/s to the options name is now obsolete and will be removed soon.
writer_name specifies the name of the writer, and writer_options specifies the options to be passed to the writer.
For example for printing the output in JSON format, specify:
-print_format json
For more details on the available output printing formats, see the Writers section below.
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
The dump is printed as the "data" field. It may contain newlines.
The error information is printed within a section with name "ERROR".
All the container format information is printed within a section with name "FORMAT".
This option is deprecated, use "show_entries" instead.
Entries are specified according to the following syntax. section_entries contains a list of section entries separated by ":". Each section entry is composed by a section name (or unique name), optionally followed by a list of entries local to that section, separated by ",".
If section name is specified but is followed by no "=", all entries are printed to output, together with all the contained sections. Otherwise only the entries specified in the local section entries list are printed. In particular, if "=" is specified but the list of local entries is empty, then no entries will be shown for that section.
Note that the order of specification of the local section entries is not honored in the output, and the usual display order will be retained.
The formal syntax is given by:
<LOCAL_SECTION_ENTRIES> ::= <SECTION_ENTRY_NAME>[,<LOCAL_SECTION_ENTRIES>] <SECTION_ENTRY> ::= <SECTION_NAME>[=[<LOCAL_SECTION_ENTRIES>]] <SECTION_ENTRIES> ::= <SECTION_ENTRY>[:<SECTION_ENTRIES>]
For example, to show only the index and type of each stream, and the PTS time, duration time, and stream index of the packets, you can specify the argument:
packet=pts_time,duration_time,stream_index : stream=index,codec_type
To show all the entries in the section "format", but only the codec type in the section "stream", specify the argument:
format : stream=codec_type
To show all the tags in the stream and format sections:
stream_tags : format_tags
To show only the "title" tag (if available) in the stream sections:
stream_tags=title
The information for each single packet is printed within a dedicated section with name "PACKET".
The information for each single frame is printed within a dedicated section with name "FRAME" or "SUBTITLE".
The information for each log message is printed within a dedicated section with name "LOG".
Each media stream information is printed within a dedicated section with name "STREAM".
Each media stream information is printed within a dedicated section with name "PROGRAM_STREAM".
Each chapter is printed within a dedicated section with name "CHAPTER".
Each interval is specified by two optional parts, separated by "%".
The first part specifies the interval start position. It is interpreted as an absolute position, or as a relative offset from the current position if it is preceded by the "+" character. If this first part is not specified, no seeking will be performed when reading this interval.
The second part specifies the interval end position. It is interpreted as an absolute position, or as a relative offset from the current position if it is preceded by the "+" character. If the offset specification starts with "#", it is interpreted as the number of packets to read (not including the flushing packets) from the interval start. If no second part is specified, the program will read until the end of the input.
Note that seeking is not accurate, thus the actual interval start point may be different from the specified position. Also, when an interval duration is specified, the absolute end time will be computed by adding the duration to the interval start point found by seeking the file, rather than to the specified start value.
The formal syntax is given by:
<INTERVAL> ::= [<START>|+<START_OFFSET>][%[<END>|+<END_OFFSET>]] <INTERVALS> ::= <INTERVAL>[,<INTERVALS>]
A few examples follow.
10%+20,01:30%01:45
01:23%+#42
%+20
%02:30
Version information is printed within a section with name "PROGRAM_VERSION".
Version information for each library is printed within a section with name "LIBRARY_VERSION".
Pixel format information for each format is printed within a section with name "PIXEL_FORMAT".
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:
The following values are accepted.
Default value is replace.
In case the option is not specified, the writer will assume the empty string, that is it will remove the invalid sequences from the input strings.
A description of the currently available writers follows.
Default format.
Print each section in the form:
[SECTION] key1=val1 ... keyN=valN [/SECTION]
Metadata tags are printed as a line in the corresponding FORMAT, STREAM or PROGRAM_STREAM section, and are prefixed by the string "TAG:".
A description of the accepted options follows.
Compact and CSV format.
The "csv" writer is equivalent to "compact", but supports different defaults.
Each section is printed on a single line. If no option is specifid, the output has the form:
section|key1=val1| ... |keyN=valN
Metadata tags are printed in the corresponding "format" or "stream" section. A metadata tag key, if printed, is prefixed by the string "tag:".
The description of the accepted options follows.
It can assume one of the following values:
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.
Default value is ..
Default value is 1.
INI format output.
Print output in an INI based format.
The following conventions are adopted:
This writer accepts options as a list of key=value pairs, separated by :.
The description of the accepted options follows.
Default value is 1.
JSON based format.
Each section is printed using JSON notation.
The description of the accepted options follows.
For more information about JSON, see <http://www.json.org/>.
XML based format.
The XML output is described in the XML schema description file ffprobe.xsd installed in the FFmpeg datadir.
An updated version of the schema can be retrieved at the url <http://www.ffmpeg.org/schema/ffprobe.xsd>, which redirects to the latest schema committed into the FFmpeg development source code tree.
Note that the output issued will be compliant to the ffprobe.xsd schema only when no special global output options (unit, prefix, byte_binary_prefix, sexagesimal etc.) are specified.
The description of the accepted options follows.
For more information about the XML format, see <http://www.w3.org/XML/>.
ffprobe supports Timecode extraction:
ffprobe-all(1), ffmpeg(1), ffplay(1), ffmpeg-utils(1), ffmpeg-scaler(1), ffmpeg-resampler(1), ffmpeg-codecs(1), ffmpeg-bitstream-filters(1), ffmpeg-formats(1), ffmpeg-devices(1), ffmpeg-protocols(1), ffmpeg-filters(1)
The FFmpeg developers.
For details about the authorship, see the Git history of the project (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command git log in the FFmpeg source directory, or browsing the online repository at <http://source.ffmpeg.org>.
Maintainers for the specific components are listed in the file MAINTAINERS in the source code tree.