ffprobe文档 1-3

FFprobe文档

这些文档在实际使用中非常有用,ffmpeg相关内容较多,但ffprobe中文内容似乎不多,因此自己在阅读过程中同时做一下翻译以加深印象,若有错误,请各位不吝赐教,敬请斧正。 —— 2020-2-3, GarfieldGCat

1 Synopsis 概要

ffprobe [options] [input_url]

2 Description 描述

ffprobe 从 媒体流(multimedia streams) 中读取信息,并以人或机器可读的方式输出。

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.

ffprobe会尝试打开[input_url]指定的文件并探测其中的内容,但若指定文件无法打开或识别为媒体文件,则程序会返回一个正整数作为exit code(PS:一般而言程序最终返回值不是0的话意味着出现了错误)。

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既可以作为单独的应用程序使用,也可以与其他 文本过滤器(textual filter) (任何可以读取文本流的程序)一并使用。

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]用来列出哪些格式是ffprobe所支持的,或用于指定显示信息的类型和样式。

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的输出设计上非常易于被其他程序所解析,并根据print_format选项可以有多种不同的输出格式,输出会包含一个或多个 分段(section)

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) 存储于容器中,也可从媒体流中识别,它有三个分段的内容:FORMAT, STREAM, PROGRAM_STREAM

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

3 Options 选项

所有含有数字的选项,如果没有特别说明,均接受以字符表示的数字作为输入,并可包含通用国际单位,如:K, M, G等。

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’.

如果输入有单位作为后缀,则数字会按照单位来解析,但要注意,在这里进制采用的是计算机中常用的1024,而非1000。另外,如果在单位后加上B,则会再乘以8(即表示字节),如:KB, MiB

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.

若选项不接受任何参数则表示该选项是 布尔值(boolean) ,也可以理解为开关,即该参数设置了之后即代表设置为 真(true) (开启状态),而要关闭或设置为假的方法是在参数前加**no**作为前缀。如:-nofoo表示将foo选项设置为 假(false) (关闭状态)。

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

3.1 Stream specifiers 流选择器

有些选项默认是作用于所有流的,如 码率(bitrate)编码(codec)流选择器(Stream specifier) 即用于精确的指定选项作用于哪个流的。

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.

流选择器是以半角冒号:紧跟选项后面来描述的,如:-codec:a:1 ac3 就包含a:1作为流选择器,意思是选择 第二条音频流 (a=audio,流从0开始数起)并应用ac3编码。

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.

流选择器可以选中多个流,如:-b:a 128k会匹配 所有的 音频流。

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.

如果流选择器是空的,则指定的是 所有的流 ,如:-codec copy-codec: copy含义是复制所有的流。

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 流索引

    索引(index) 的形式选择流。如:-threads:1 4含义是将第二条流的线程数设置为4。如果流索引用于 附加选择器 [:additional_stream_specifier](见下方),则其指定的是特定流的索引(非所有流)。流编号取决于libavformat检测出的顺序,除非 节目编号(Program ID) 也被指定了,在这种情况下取决于的是节目中流的顺序。

    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] 流类型

    流类型有如下几种:v/V视频(Video)a音频(Audio)s字幕(Subtitle)d数据(Data)t附带内容(Attachments)。特别地,大写的V只选取没有附加图片、缩略图或封面的视频流,而小写的v则会选取所有的视频流。如果提供了附加选择器,则会选取同时符合类型和附加选择器的流,否则选取所有该类型的流。

    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 流编号

    选择指定编号的流,如MPEG-TS容器中的PID值。

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

  • m:key[:value] 元数据键值

    选择含有指定元数据 标签(tag key) 及对应 值(value) 的流,如果不给出值,则选择所有含有该标签的流。

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

  • u 可用配置

    //暂不确定用法,以后补充

    Matches streams with usable configuration, the codec must be defined and the essential information such as video dimension or audio sample rate must be present.Note that in ffmpeg, matching by metadata will only work properly for input files.

3.2 Generic options 通用选项

这些选项在所有 ff 系的工具中含义一致。

These options are shared amongst the ff* tools.

  • -L

    打印许可信息。

    Show license.

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

    打印帮助信息。附加的参数可以指定特定信息的帮助文档,如果没有附加参数,则只会输出基础信息(建议重定向到文件,基础信息就有100多KB的内容)。可用的参数有:

    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

      打印高级可用选项(在ffprobe中与基础信息一致)

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

    • full

      打印所有可用选项(在ffprobe中与基础信息一致),包括一些私有的编解码器、封解流器、滤镜等。

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

    • decoder=decoder_name

      打印与指定 解码器(decoder) 相关的详细信息。使用-decoders可以打印所有可用的解码器。

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

    • encoder=encoder_name

      打印与指定 编码器(encoder) 相关的详细信息。使用-encoders可以打印所有可用的编码器。

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

    • demuxer=demuxer_name

      打印与指定 解流器(demuxer) 相关的详细信息。使用-formats可以打印所有可用的封解流器。(该名词不确定是否有通用译名,其作用为拆分多个流或将其整合,如mp4格式)

      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

      打印与指定 封流器(muxer) 相关的详细信息。

      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

      打印指定 滤镜(filter) 相关的详细信息。使用-filters可以打印所有可用的滤镜。(也有人将其称为过滤器,因为滤镜听起来不能应用于音频)

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

    • bsf=bitstream_filter_name

      打印指定 比特流滤镜(bsf, bitstream filter) 相关的详细信息。使用-bsfs可以打印所有可用的比特流滤镜。

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

    原文档中下方有-formats, -decoders 等说明,由于本节中已有一样的内容,因此删除下方这些部分内容

  • -version

    打印版本号

    Show version.

  • -devices

    打印可用设备(一般指摄像头等)

    Show available devices.

  • -codecs

    打印所有libavcodec支持的编码。注意:术语codec贯穿文档全文,但它只是缩写,其全称是 媒体比特流格式(media bitstream format)

    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.

  • -protocols

    打印所有可用的协议。(如rtmp, ftp等)

    Show available protocols.

  • -pix_fmts

    打印所有可用的像素格式。(如yuv420p, cuda, rgb565等)

    Show available pixel formats.

  • -sample_fmts

    打印所有可用的采样格式。(如u8, s16, s32等)

    Show available sample formats.

  • -layouts

    打印所有标准声道布局与名称。(如stereo, 2.1, 5.1, 7.1等)

    Show channel names and standard channel layouts.

  • -colors

    打印所有可识别的颜色名称与十六进制值。(如Gold #ffd700等)

    Show recognized color names.

  • -sources device[,opt1=val1[,opt2=val2]…]

    打印所有自动检测到的输入设备的源。部分设备可能由于提供的是与系统相关的名称导致无法检测。 不能 假定该选项打印的列表一定是完整的。用法如ffmpeg -sources pulse,server=192.168.0.4

    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]…]

    打印所有自动检测到的源接收设备。部分设备可能由于提供的是与系统相关的名称导致无法检测。 不能 假定该选项打印的列表一定是完整的。用法如ffmpeg -sinks pulse,server=192.168.0.4

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

  • -loglevel [flags+]loglevel | -v [flags+]loglevel

    设置日志记录级别与特殊标记位。

    Set logging level and flags used by the library.

    可用的 标志位(flags) 前缀有如下值:

    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’

      指示日志每行输出应在最前添加 级别标签[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) 是一串特定的字符或特定数字,见下:

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

    • ‘quiet, -8’

      不显示任何日志。

      Show nothing at all; be silent.

    • ‘panic, 0’

      只显示会导致程序崩溃的 致命(fatal) 错误,如 断言(assertion) 错误。不过现在该参数没有作用。

      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’

      只显示会使程序 一定 无法继续执行的 致命(fatal) 错误。

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

    • ‘error, 16’

      显示包括一些无法从中恢复的所有 错误(error)

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

    • ‘warning, 24’

      显示所有 警告(warning)错误(error) 。这包括所有可能出错或非预期的情况。

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

    • ‘info, 32’

      显示程序执行过程中的所有 信息(informative message) 。该级别是 默认级别 ,其也包括警告与错误。

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

    • ‘verbose, 40’

      info级别类似,但会显示更多细节。

      Same as info, except more verbose.

    • ‘debug, 48’

      显示所有信息,包括 **调试信息(debugging information) **。

      Show everything, including debugging information.

    • ‘trace, 56’

      (该级别无说明)

    如设置不压缩重复信息,并添加信息级别标签,同时设置日志级别为verbose,方法如下:

    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

    默认情况下,日志输出至 标准错误流(stderr) 。如果当前 终端(terminal) 不支持显示颜色,则可以在环境变量中加入AV_LOG_FORCE_NOCOLORNO_COLOR来关闭颜色显示。另若要强制打开日志颜色显示则在环境变量中加入AV_LOG_FORCE_COLOR即可。注意,NO_COLOR在未来的FFmpeg版本中已被遗弃。

    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.

  • -report

    将完整的命令行参数以及日志信息输出成以program-YYYYMMDD-HHMMSS.log格式命名的文件到当前目录。对调试非常有帮助,该命令会同时隐式的将日志级别设置为debug

    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.

    设置环境变量FFREPORT为任何值也有同样的效果,但FFREPORT的值可作为选项影响输出,参数为':'分割的键值序列。要注意的是,如果选项中包含特殊字符一定要对齐进行转义(如':'就是特殊字符,详细查阅相关文档 该链接为官方文档,尚未翻译

    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

      设置该选项所用的文件名;%p代表程序的名字,%t代表时间戳,%%%的转义字符。

      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

      以数字形式设置日志级别(查看上方-loglevel段)。

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

    如要将输出文件命名为ffreport.log,并设置32(info)的日志级别,如下:

    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

    不输出声明信息。默认情况下,所有的FFmpeg工具都会显示版权信息、编译信息以及依赖库版本。

    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)

    设置或清除 CPU标志位(cpu flags) 。该选项用于测试,除非你知道其行为,否则不要使用该选项。

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

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

    可能的标志如下:

    Possible flags for this option are:

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

3.3 AVOptions AV选项

这些选项由libavformat, libavdevice, libavcoder库直接提供。要查看所有可用的AV选项可使用-help选项。它们大致分为两大类:

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.

如要写入ID3v2.3头而非默认的ID3v2.4头到MP3文件中,可以在MP3封流器中使用id3v2_version私有选项:

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

所有编码的AV选项都是针对单独的流的,因此应该使用流选择器选择一条流来使用。

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

上方示例中,一个多声道的音频流被映射了两次。第一次将其编码为ac3640k码率。第二次则是将其降采样为双声道并以aac编码及128k码率

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.

注意:-nooption设置为假(关闭)的语法不能同样用于AV选项,而要使用-option 0/option 1表示假(关闭)/真(打开)

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

注意:一些旧的文档中指定流的方法在现在已经别遗弃,且很快就会移除。(目前文档版本为20200201 )

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

3.4 Main options 主选项

  • -f format

    强制使用特定格式解码。

    Force format to use.

  • -unit

    打印数值的单位。

    Show the unit of the displayed values.

  • -prefix

    使用国际通用前缀显示数值。除了-byte_binary_perfix选项启用,否则所有前缀都是十进制的。

    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

    使用HH:MM:SS.MICROSECONDS(时:分:秒.微秒)的格式显示时间。

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

  • -pretty

    美化显示数值的格式,行为等同于同时使用下列选项:-unit -prefix -byte_binary_prefix -sexagesimal

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

  • -of, -print_format writer_name[=writer_options]

    设置信息输出格式。

    Set the output printing format.

    writer_name用于指出要使用的 输出器(Writer) ,如有附加参数会一并被传递给该输出器。(这是ffprobe的一个概念,输出格式被Writer所定义,暂定该译名,后有该详细章节)

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

    如要将输出格式设置为JSON,则:

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

    -print_format json

    更多关于输出格式的细节查阅有关输出器的章节。

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

  • -sections

    仅打印有关于ffprobe所输出的 分段(section) 的结构和信息,主要是供人查看的。

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

  • -select_streams stream_specifier

    通过流选择器选择流,使与流相关的选项只作用于被选择的流,如:show_streams, show_packets

    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

    或只显示第二条(索引为1)的 视频数据包(video packet) 信息,如下:

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

    ffprobe -show_packets -select_streams v:1 INPUT

  • -show_data

    以十六进制打印 负载数据块(payload data) 信息。与-show_packets联合使用则会打印该包里的数据分段;与-show_streams联合使用则会打印编码有关的附加数据。

    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

    打印负载数据块的 哈希码(hash) ,而非打印完整的数据块。

    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.

    错误信息会输出在ERROR 分段(section)

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

  • -show_format

    打印多媒体流的容器格式。

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

    所有关于容器的信息会输出在FORMAT分段。

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

  • -show_format_entry name

    类似于-show_format,但只打印指定的 条目(entry) 而非所有信息*(如bit_rate就是一个常用的条目)*。这个选项可以使用多次,所有被指定的条目都会打印。

    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.

    该选项已有更完善的show_entries作为替代,不推荐使用。

    This option is deprecated, use show_entries instead.

  • -show_entries section_entries

    设置要打印的条目。

    Set list of entries to show.

    条目通过以下语法来指定。section_entries是一个 分段(section) 列表,以':'分割。每个分段包含了分段名称或分段唯一名称,分段后可选跟随指定的条目,以','分割。

    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]
    

    例如,仅打印 流索引号(stream index)编码类型(codec_type) ,并打印每条流中媒体包信息的 索引号(index) 与类型、PTS(presentation time stamp, 显示时间戳) 时间、持续时间可参照下列参数:

    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

    打印与format分段有关的所有条目,但只输出stream分段中的编码类型信息参照下列参数:

    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

    打印stream分段与format分段中所有的标签信息:

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

    stream_tags:format_tags

    打印stream分段中title条目(如果有):

    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.

    所有的媒体包都会以单独的PACKET分段打印。

    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.

    所有的帧或字幕信息都以单独的FRAMESUBTITLE分段打印。

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

  • -show_log loglevel

    打印解码器解码帧时的日志信息,loglevel定义见上方-loglevel段。该选项需与-show_frames联合使用。

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

    所有的日志信息都以单独的LOG分段打印。

    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.

    所有的媒体流都以单独的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.

    所有的节目信息都以单独的PROGRAM_STREAM分段打印。

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

  • -show_chapters

    打印 章节(chapters) 信息。(播放时进度条上有可选的点与描述就是包含了章节信息)

    Show information about chapters stored in the format.

    所有的章节都会以单独的CHAPTER分段打印。

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

  • -count_frames

    在对应的STREAM分段里打印总的帧数。

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

  • -count_packets

    在对应的STREAM分段里打印总的媒体包数。

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

  • -read_intervals read_intervals

    指定读取 区间(interval)read_intervals是一系列以','分割的区间。ffprobe会移动到区间的开始位置读取。

    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.

    每个区间由两个可选的部分组成,以'%'分割。第一部分指定该区间的 起始位置(start position) ,其描述一个 绝对位置(absolute position) ,但若该部分开头以'+'起始,则描述的是相对位置,描述以当前位置为源点的 相对偏移量(relative offset) 。如果第一部分为空,则从头开始读取。

    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.

    第二部分指定该区间的 结束位置(end position) 。默认下与起始位置一样描述的也是绝对位置,也支持以'+'描述相对位置。但还有一个'#'起始的方式,描述的是从起始位置读取媒体包的数量(不包括缓冲包)。如果第二部分为空,则会一直读取到结尾。

    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(1分30秒)开始,读取直到01:45

      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

    • 从起始位置读取42个媒体包信息

      Read only 42 packets after seeking to position 01:23:

      01:23%+#42

    • 从开头读取20秒

      Read only the first 20 seconds from the start:

      %+20

    • 02:30开始读取直到结束

      Read from the start until position02:30:

      %02:30

  • -show_private_data, -private

    打印 私有数据(private data) ,这些数据取决于特定的格式。这个选项是 默认打开 的。

    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.

    版本信息会在单独的PROGRAM_VERSION分段打印。

    Version information is printed within a section with name “PROGRAM_VERSION”.

  • -show_library_versions

    打印依赖库的版本。

    Show information related to library versions.

    库的版本信息会在单独的LIBRARY_VERSIOn分段打印。

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

  • -show_versions

    打印所有相关的版本信息,其行为等同于同时使用-show_program_version-show_library_version选项。

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

  • -show_pixel_formats

    打印所有FFmpeg支持的 像素格式(pixel format)

    Show information about all pixel formats supported by FFmpeg.

    所有像素格式信息会在单独的PIXEL_FORMAT分段打印。

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

  • -bitexact

    强制使用精确位模式打印,这种用法可以使得输出不依赖特定版本。

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

  • -i input_url

    input_url中读取

    Read input_url.
    IBRARY_VERSIOn`分段打印。

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

  • -show_versions

    打印所有相关的版本信息,其行为等同于同时使用-show_program_version-show_library_version选项。

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

  • -show_pixel_formats

    打印所有FFmpeg支持的 像素格式(pixel format)

    Show information about all pixel formats supported by FFmpeg.

    所有像素格式信息会在单独的PIXEL_FORMAT分段打印。

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

  • -bitexact

    强制使用精确位模式打印,这种用法可以使得输出不依赖特定版本。

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

  • -i input_url

    input_url中读取

    Read input_url.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值