FFprobe User Guide

Source: Internet
Author: User
Tags print format

1. What is ffprobe?

To put it simply, ffprobe is a multimedia stream analysis tool. It collects information from Multimedia Streams and prints it in human and machine readable forms.

It can be used to detect the container type of a multimedia stream and the format and type of each multimedia stream. It can be used as an independent application, or it can be used with text filters to perform more complex processing.

2. How to Use ffprobe

Command Line: ffprobe [Option] ['input file']

3. Available ffprobe Option 3.1 stream indicator

The stream indicator is used to precisely specify the stream to which a given option belongs.

A stream indicator is usually a string appended to an option name and separated. For example,-codec: a: 1 ac3 contains the stream indicator a: 1, which matches the second audio stream. Therefore, it specifies ac3 codec for the second audio stream.

A single stream indicator can match multiple streams, so that the given options will be applied to all matching streams. For example, the stream indicator in-B: a 128 k will match all audio streams.

An empty stream indicator will match all streams. For example,-codec copy or-codec: copy Copies all streams without re-encoding them.

Possible form of stream indicator:

'Stream _ Index' matches the stream with this index value. For example,-threads: 1 4 sets the number of threads for the second stream to 4. 'Stream _ type [: stream_index] 'stream_type is one of the following: 'V' video, 'A' audio, 's' subtitle, and 'D' data, 't'attachment. If stream_index is given, it will match the stream whose index number is stream_index. Otherwise, it will match all the streams of this type. 'P: program_id [: stream_index] 'If stream_index is specified, it matches the stream with the quotation mark stream_index under the program with the id of program_id. Otherwise, it will match all streams under the program. '# Stream_id or I: stream_id' match with stream id (for example, PID in the MPEG-TS container)
3.2 General options

Ff * Common options of the tool are shared. (FFplay)

'-L' display license'-h ,-?, -Help, -- help [arg] ': print the help information. You can specify an arg parameter. If no parameter is specified, only the optional arg options of basic options are printed: 'long, the advanced options 'full' will also be printed to print a complete list of options, including encoders, decoders, demuxers, muxers, filters and other sharing and private options 'decoder = decoder_name 'print the decoder details with the name of "decoder_name" 'encoder = encoder_name' print the detailed information of the encoder_name' demuxer = demuxer_name 'print the details of the demuxer whose name is "demuxer_name" 'muxer = muxer_name 'print the details of the muxer whose name is "muxer_name" 'filter = filter_name' print the name as" filter_name "filter details '-version' display version information'-formats' display valid format '-codecs' display libavcodec known all codecs' display valid decoder '-encoders' display valid encoder'-bsfs 'display valid bit stream filter'-Protocols' display valid protocol '-filters' display libavfilter valid filter '-pix_fmts' display valid pixel format '-sample_fmts' display valid sampling format '-layouts' display channel name and standard channel layout '-colors' display recognized color name '-hide_banner' disable Printing welcome speech; that is, the copyright information, compilation options, and library version information displayed by default are prohibited.
3.3 main options
'-F format' mandatory format'-unit 'indicates the unit of the value'-prefix'. The value displayed uses the standard international unit system header '-byte_binary_prefix' to force the binary prefix for the byte value. the '-sexagesimal' time value uses the 60-digit format HH: MM: SS. MICROSECONDS '-pretty' beautify the format of the displayed value. It is equivalent to "-unit-prefix-byte_binary_prefix-sexagesimal" '-of,-print_format writer_name [= writer_options]' to set the output print format. Writer_name specifies the name of the writer, and writer_options specifies the options passed to writer. For example, print the output to the JSON format:-print_format json '-select_streams stream_specifier' and select only the stream specified by stream_specifier. This option only affects streaming-related options (such as show_streams and show_packets ). For example, to display only audio streams, run the command ffprobe-show_streams-select_streams a INPUT '-show_data' to display the payload data, in hexadecimal format and ASCII dump. It is used in combination with '-show_packets'. It dumps package data and '-show_streams'. It appends dump codec data. '-Show_error' displays the error message '-show_format' when detecting the input file. '-show_packets' indicates the container format information of the input multimedia stream. '-show_frames 'display the information of each frame and subtitle in the input multimedia stream'-show_streams 'displays the information of each stream in the input multimedia stream'-show_programs' displays the programs and their streams in the input multimedia stream. '-show_chapters': the unit information stored in the format '-count_frames' is used to calculate the number of frames in each stream, in the corresponding section, '-count_packets' is displayed to calculate the number of packages in each stream, in the corresponding section, '-show_program_version' is used to display the program version and configuration related information '-show_library_versions' is used to display information about the library version '-show_versions. It is equivalent to setting '-show_program_version' and '-show_library_versions'-I input_file 'to specify the input file
4. Print the program (Writers)

A writer defines the output format used by ffprobe.

It can accept one or more parameters, which are specified in the form of key = value and separated. All writers support the following options:

'String _ validation, sv 'sets the string Verification Mode and it can accept the following values: (replace by default) 'fail' fails immediately when an invalid string (UTF-8) sequence or code point is found. This is very useful for verifying input metadata. 'Ignore' any verification error will be ignored. 'Replace 'writer uses the string specified by 'string _ validation_replacement' to replace an invalid UTF-8 sequence or code point. 'String _ validation_replacement and svr 'are used to set the replacement string. this parameter is used when 'string _ validation' is set to 'replace.

The following are available writers:

4.1 default format. Print each section as follows: [SECTION] key1 = val1... keyN = valN [/SECTION] 4.2 compact, csv compact and CSV format. Each section is printed on a separate row. If no other options are specified, the input format is as follows: section | key1 = val1 |... | keyN = valN4.3 Flat is a free-format output. Each row contains a clear key = value pair. 4.4 ini output. 4.5 json output. Each section is printed with a JSON symbol. 4.6 output in xml format. For more information about acceptable writer options, see ffprobe.
5. ffprobe example
1) The simplest way to use ffprobe test.mp4 2) do not display the welcome information ffprobe-hide_banner test.mp4 3) display the information of each stream in JSON format ffprobe-print_format json-show_streams test.mp4 4) show container format related information ffprobe-show_format test.mp4

For more ffprobe options, you can use ffprobe-h to obtain

Original works can be reprinted. During reprinting, you must mark the original source, author information, and this statement in hyperlink form.

-- End --

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.