ffprobe.texi 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712
  1. \input texinfo @c -*- texinfo -*-
  2. @documentencoding UTF-8
  3. @settitle ffprobe Documentation
  4. @titlepage
  5. @center @titlefont{ffprobe Documentation}
  6. @end titlepage
  7. @top
  8. @contents
  9. @chapter Synopsis
  10. ffprobe [@var{options}] @file{input_url}
  11. @chapter Description
  12. @c man begin DESCRIPTION
  13. ffprobe gathers information from multimedia streams and prints it in
  14. human- and machine-readable fashion.
  15. For example it can be used to check the format of the container used
  16. by a multimedia stream and the format and type of each media stream
  17. contained in it.
  18. If a url is specified in input, ffprobe will try to open and
  19. probe the url content. If the url cannot be opened or recognized as
  20. a multimedia file, a positive exit code is returned.
  21. If no output is specified as output with @option{o} ffprobe will write
  22. to stdout.
  23. ffprobe may be employed both as a standalone application or in
  24. combination with a textual filter, which may perform more
  25. sophisticated processing, e.g. statistical processing or plotting.
  26. Options are used to list some of the formats supported by ffprobe or
  27. for specifying which information to display, and for setting how
  28. ffprobe will show it.
  29. ffprobe output is designed to be easily parsable by a textual filter,
  30. and consists of one or more sections of a form defined by the selected
  31. writer, which is specified by the @option{output_format} option.
  32. Sections may contain other nested sections, and are identified by a
  33. name (which may be shared by other sections), and an unique
  34. name. See the output of @option{sections}.
  35. Metadata tags stored in the container or in the streams are recognized
  36. and printed in the corresponding "FORMAT", "STREAM", "STREAM_GROUP_STREAM"
  37. or "PROGRAM_STREAM" section.
  38. @c man end
  39. @chapter Options
  40. @c man begin OPTIONS
  41. @include fftools-common-opts.texi
  42. @section Main options
  43. @table @option
  44. @item -f @var{format}
  45. Force format to use.
  46. @item -unit
  47. Show the unit of the displayed values.
  48. @item -prefix
  49. Use SI prefixes for the displayed values.
  50. Unless the "-byte_binary_prefix" option is used all the prefixes
  51. are decimal.
  52. @item -byte_binary_prefix
  53. Force the use of binary prefixes for byte values.
  54. @item -sexagesimal
  55. Use sexagesimal format HH:MM:SS.MICROSECONDS for time values.
  56. @item -pretty
  57. Prettify the format of the displayed values, it corresponds to the
  58. options "-unit -prefix -byte_binary_prefix -sexagesimal".
  59. @item -output_format, -of, -print_format @var{writer_name}[=@var{writer_options}]
  60. Set the output printing format.
  61. @var{writer_name} specifies the name of the writer, and
  62. @var{writer_options} specifies the options to be passed to the writer.
  63. For example for printing the output in JSON format, specify:
  64. @example
  65. -output_format json
  66. @end example
  67. For more details on the available output printing formats, see the
  68. Writers section below.
  69. @item -sections
  70. Print sections structure and section information, and exit. The output
  71. is not meant to be parsed by a machine.
  72. @item -select_streams @var{stream_specifier}
  73. Select only the streams specified by @var{stream_specifier}. This
  74. option affects only the options related to streams
  75. (e.g. @code{show_streams}, @code{show_packets}, etc.).
  76. For example to show only audio streams, you can use the command:
  77. @example
  78. ffprobe -show_streams -select_streams a INPUT
  79. @end example
  80. To show only video packets belonging to the video stream with index 1:
  81. @example
  82. ffprobe -show_packets -select_streams v:1 INPUT
  83. @end example
  84. @item -show_data
  85. Show payload data, as a hexadecimal and ASCII dump. Coupled with
  86. @option{-show_packets}, it will dump the packets' data. Coupled with
  87. @option{-show_streams}, it will dump the codec extradata.
  88. The dump is printed as the "data" field. It may contain newlines.
  89. @item -show_data_hash @var{algorithm}
  90. Show a hash of payload data, for packets with @option{-show_packets} and for
  91. codec extradata with @option{-show_streams}.
  92. @item -show_error
  93. Show information about the error found when trying to probe the input.
  94. The error information is printed within a section with name "ERROR".
  95. @item -show_format
  96. Show information about the container format of the input multimedia
  97. stream.
  98. All the container format information is printed within a section with
  99. name "FORMAT".
  100. @item -show_format_entry @var{name}
  101. Like @option{-show_format}, but only prints the specified entry of the
  102. container format information, rather than all. This option may be given more
  103. than once, then all specified entries will be shown.
  104. This option is deprecated, use @code{show_entries} instead.
  105. @item -show_entries @var{section_entries}
  106. Set list of entries to show.
  107. Entries are specified according to the following
  108. syntax. @var{section_entries} contains a list of section entries
  109. separated by @code{:}. Each section entry is composed by a section
  110. name (or unique name), optionally followed by a list of entries local
  111. to that section, separated by @code{,}.
  112. If section name is specified but is followed by no @code{=}, all
  113. entries are printed to output, together with all the contained
  114. sections. Otherwise only the entries specified in the local section
  115. entries list are printed. In particular, if @code{=} is specified but
  116. the list of local entries is empty, then no entries will be shown for
  117. that section.
  118. Note that the order of specification of the local section entries is
  119. not honored in the output, and the usual display order will be
  120. retained.
  121. The formal syntax is given by:
  122. @example
  123. @var{LOCAL_SECTION_ENTRIES} ::= @var{SECTION_ENTRY_NAME}[,@var{LOCAL_SECTION_ENTRIES}]
  124. @var{SECTION_ENTRY} ::= @var{SECTION_NAME}[=[@var{LOCAL_SECTION_ENTRIES}]]
  125. @var{SECTION_ENTRIES} ::= @var{SECTION_ENTRY}[:@var{SECTION_ENTRIES}]
  126. @end example
  127. For example, to show only the index and type of each stream, and the PTS
  128. time, duration time, and stream index of the packets, you can specify
  129. the argument:
  130. @example
  131. packet=pts_time,duration_time,stream_index : stream=index,codec_type
  132. @end example
  133. To show all the entries in the section "format", but only the codec
  134. type in the section "stream", specify the argument:
  135. @example
  136. format : stream=codec_type
  137. @end example
  138. To show all the tags in the stream and format sections:
  139. @example
  140. stream_tags : format_tags
  141. @end example
  142. To show only the @code{title} tag (if available) in the stream
  143. sections:
  144. @example
  145. stream_tags=title
  146. @end example
  147. @item -show_packets
  148. Show information about each packet contained in the input multimedia
  149. stream.
  150. The information for each single packet is printed within a dedicated
  151. section with name "PACKET".
  152. @item -show_frames
  153. Show information about each frame and subtitle contained in the input
  154. multimedia stream.
  155. The information for each single frame is printed within a dedicated
  156. section with name "FRAME" or "SUBTITLE".
  157. @item -show_log @var{loglevel}
  158. Show logging information from the decoder about each frame according to
  159. the value set in @var{loglevel}, (see @code{-loglevel}). This option requires @code{-show_frames}.
  160. The information for each log message is printed within a dedicated
  161. section with name "LOG".
  162. @item -show_streams
  163. Show information about each media stream contained in the input
  164. multimedia stream.
  165. Each media stream information is printed within a dedicated section
  166. with name "STREAM".
  167. @item -show_programs
  168. Show information about programs and their streams contained in the input
  169. multimedia stream.
  170. Each media stream information is printed within a dedicated section
  171. with name "PROGRAM_STREAM".
  172. @item -show_stream_groups
  173. Show information about stream groups and their streams contained in the
  174. input multimedia stream.
  175. Each media stream information is printed within a dedicated section
  176. with name "STREAM_GROUP_STREAM".
  177. @item -show_chapters
  178. Show information about chapters stored in the format.
  179. Each chapter is printed within a dedicated section with name "CHAPTER".
  180. @item -count_frames
  181. Count the number of frames per stream and report it in the
  182. corresponding stream section.
  183. @item -count_packets
  184. Count the number of packets per stream and report it in the
  185. corresponding stream section.
  186. @item -read_intervals @var{read_intervals}
  187. Read only the specified intervals. @var{read_intervals} must be a
  188. sequence of interval specifications separated by ",".
  189. @command{ffprobe} will seek to the interval starting point, and will
  190. continue reading from that.
  191. Each interval is specified by two optional parts, separated by "%".
  192. The first part specifies the interval start position. It is
  193. interpreted as an absolute position, or as a relative offset from the
  194. current position if it is preceded by the "+" character. If this first
  195. part is not specified, no seeking will be performed when reading this
  196. interval.
  197. The second part specifies the interval end position. It is interpreted
  198. as an absolute position, or as a relative offset from the current
  199. position if it is preceded by the "+" character. If the offset
  200. specification starts with "#", it is interpreted as the number of
  201. packets to read (not including the flushing packets) from the interval
  202. start. If no second part is specified, the program will read until the
  203. end of the input.
  204. Note that seeking is not accurate, thus the actual interval start
  205. point may be different from the specified position. Also, when an
  206. interval duration is specified, the absolute end time will be computed
  207. by adding the duration to the interval start point found by seeking
  208. the file, rather than to the specified start value.
  209. The formal syntax is given by:
  210. @example
  211. @var{INTERVAL} ::= [@var{START}|+@var{START_OFFSET}][%[@var{END}|+@var{END_OFFSET}]]
  212. @var{INTERVALS} ::= @var{INTERVAL}[,@var{INTERVALS}]
  213. @end example
  214. A few examples follow.
  215. @itemize
  216. @item
  217. Seek to time 10, read packets until 20 seconds after the found seek
  218. point, then seek to position @code{01:30} (1 minute and thirty
  219. seconds) and read packets until position @code{01:45}.
  220. @example
  221. 10%+20,01:30%01:45
  222. @end example
  223. @item
  224. Read only 42 packets after seeking to position @code{01:23}:
  225. @example
  226. 01:23%+#42
  227. @end example
  228. @item
  229. Read only the first 20 seconds from the start:
  230. @example
  231. %+20
  232. @end example
  233. @item
  234. Read from the start until position @code{02:30}:
  235. @example
  236. %02:30
  237. @end example
  238. @end itemize
  239. @item -show_private_data, -private
  240. Show private data, that is data depending on the format of the
  241. particular shown element.
  242. This option is enabled by default, but you may need to disable it
  243. for specific uses, for example when creating XSD-compliant XML output.
  244. @item -show_program_version
  245. Show information related to program version.
  246. Version information is printed within a section with name
  247. "PROGRAM_VERSION".
  248. @item -show_library_versions
  249. Show information related to library versions.
  250. Version information for each library is printed within a section with
  251. name "LIBRARY_VERSION".
  252. @item -show_versions
  253. Show information related to program and library versions. This is the
  254. equivalent of setting both @option{-show_program_version} and
  255. @option{-show_library_versions} options.
  256. @item -show_pixel_formats
  257. Show information about all pixel formats supported by FFmpeg.
  258. Pixel format information for each format is printed within a section
  259. with name "PIXEL_FORMAT".
  260. @item -show_optional_fields @var{value}
  261. Some writers viz. JSON and XML, omit the printing of fields with invalid or non-applicable values,
  262. while other writers always print them. This option enables one to control this behaviour.
  263. Valid values are @code{always}/@code{1}, @code{never}/@code{0} and @code{auto}/@code{-1}.
  264. Default is @var{auto}.
  265. @item -bitexact
  266. Force bitexact output, useful to produce output which is not dependent
  267. on the specific build.
  268. @item -i @var{input_url}
  269. Read @var{input_url}.
  270. @item -o @var{output_url}
  271. Write output to @var{output_url}. If not specified, the output is sent
  272. to stdout.
  273. @end table
  274. @c man end
  275. @chapter Writers
  276. @c man begin WRITERS
  277. A writer defines the output format adopted by @command{ffprobe}, and will be
  278. used for printing all the parts of the output.
  279. A writer may accept one or more arguments, which specify the options
  280. to adopt. The options are specified as a list of @var{key}=@var{value}
  281. pairs, separated by ":".
  282. All writers support the following options:
  283. @table @option
  284. @item string_validation, sv
  285. Set string validation mode.
  286. The following values are accepted.
  287. @table @samp
  288. @item fail
  289. The writer will fail immediately in case an invalid string (UTF-8)
  290. sequence or code point is found in the input. This is especially
  291. useful to validate input metadata.
  292. @item ignore
  293. Any validation error will be ignored. This will result in possibly
  294. broken output, especially with the json or xml writer.
  295. @item replace
  296. The writer will substitute invalid UTF-8 sequences or code points with
  297. the string specified with the @option{string_validation_replacement}.
  298. @end table
  299. Default value is @samp{replace}.
  300. @item string_validation_replacement, svr
  301. Set replacement string to use in case @option{string_validation} is
  302. set to @samp{replace}.
  303. In case the option is not specified, the writer will assume the empty
  304. string, that is it will remove the invalid sequences from the input
  305. strings.
  306. @end table
  307. A description of the currently available writers follows.
  308. @section default
  309. Default format.
  310. Print each section in the form:
  311. @example
  312. [SECTION]
  313. key1=val1
  314. ...
  315. keyN=valN
  316. [/SECTION]
  317. @end example
  318. Metadata tags are printed as a line in the corresponding FORMAT, STREAM,
  319. STREAM_GROUP_STREAM or PROGRAM_STREAM section, and are prefixed by the
  320. string "TAG:".
  321. A description of the accepted options follows.
  322. @table @option
  323. @item nokey, nk
  324. If set to 1 specify not to print the key of each field. Default value
  325. is 0.
  326. @item noprint_wrappers, nw
  327. If set to 1 specify not to print the section header and footer.
  328. Default value is 0.
  329. @end table
  330. @section compact, csv
  331. Compact and CSV format.
  332. The @code{csv} writer is equivalent to @code{compact}, but supports
  333. different defaults.
  334. Each section is printed on a single line.
  335. If no option is specified, the output has the form:
  336. @example
  337. section|key1=val1| ... |keyN=valN
  338. @end example
  339. Metadata tags are printed in the corresponding "format" or "stream"
  340. section. A metadata tag key, if printed, is prefixed by the string
  341. "tag:".
  342. The description of the accepted options follows.
  343. @table @option
  344. @item item_sep, s
  345. Specify the character to use for separating fields in the output line.
  346. It must be a single printable character, it is "|" by default ("," for
  347. the @code{csv} writer).
  348. @item nokey, nk
  349. If set to 1 specify not to print the key of each field. Its default
  350. value is 0 (1 for the @code{csv} writer).
  351. @item escape, e
  352. Set the escape mode to use, default to "c" ("csv" for the @code{csv}
  353. writer).
  354. It can assume one of the following values:
  355. @table @option
  356. @item c
  357. Perform C-like escaping. Strings containing a newline (@samp{\n}), carriage
  358. return (@samp{\r}), a tab (@samp{\t}), a form feed (@samp{\f}), the escaping
  359. character (@samp{\}) or the item separator character @var{SEP} are escaped
  360. using C-like fashioned escaping, so that a newline is converted to the
  361. sequence @samp{\n}, a carriage return to @samp{\r}, @samp{\} to @samp{\\} and
  362. the separator @var{SEP} is converted to @samp{\@var{SEP}}.
  363. @item csv
  364. Perform CSV-like escaping, as described in RFC4180. Strings
  365. containing a newline (@samp{\n}), a carriage return (@samp{\r}), a double quote
  366. (@samp{"}), or @var{SEP} are enclosed in double-quotes.
  367. @item none
  368. Perform no escaping.
  369. @end table
  370. @item print_section, p
  371. Print the section name at the beginning of each line if the value is
  372. @code{1}, disable it with value set to @code{0}. Default value is
  373. @code{1}.
  374. @end table
  375. @section flat
  376. Flat format.
  377. A free-form output where each line contains an explicit key=value, such as
  378. "streams.stream.3.tags.foo=bar". The output is shell escaped, so it can be
  379. directly embedded in sh scripts as long as the separator character is an
  380. alphanumeric character or an underscore (see @var{sep_char} option).
  381. The description of the accepted options follows.
  382. @table @option
  383. @item sep_char, s
  384. Separator character used to separate the chapter, the section name, IDs and
  385. potential tags in the printed field key.
  386. Default value is @samp{.}.
  387. @item hierarchical, h
  388. Specify if the section name specification should be hierarchical. If
  389. set to 1, and if there is more than one section in the current
  390. chapter, the section name will be prefixed by the name of the
  391. chapter. A value of 0 will disable this behavior.
  392. Default value is 1.
  393. @end table
  394. @section ini
  395. INI format output.
  396. Print output in an INI based format.
  397. The following conventions are adopted:
  398. @itemize
  399. @item
  400. all key and values are UTF-8
  401. @item
  402. @samp{.} is the subgroup separator
  403. @item
  404. newline, @samp{\t}, @samp{\f}, @samp{\b} and the following characters are
  405. escaped
  406. @item
  407. @samp{\} is the escape character
  408. @item
  409. @samp{#} is the comment indicator
  410. @item
  411. @samp{=} is the key/value separator
  412. @item
  413. @samp{:} is not used but usually parsed as key/value separator
  414. @end itemize
  415. This writer accepts options as a list of @var{key}=@var{value} pairs,
  416. separated by @samp{:}.
  417. The description of the accepted options follows.
  418. @table @option
  419. @item hierarchical, h
  420. Specify if the section name specification should be hierarchical. If
  421. set to 1, and if there is more than one section in the current
  422. chapter, the section name will be prefixed by the name of the
  423. chapter. A value of 0 will disable this behavior.
  424. Default value is 1.
  425. @end table
  426. @section json
  427. JSON based format.
  428. Each section is printed using JSON notation.
  429. The description of the accepted options follows.
  430. @table @option
  431. @item compact, c
  432. If set to 1 enable compact output, that is each section will be
  433. printed on a single line. Default value is 0.
  434. @end table
  435. For more information about JSON, see @url{http://www.json.org/}.
  436. @section xml
  437. XML based format.
  438. The XML output is described in the XML schema description file
  439. @file{ffprobe.xsd} installed in the FFmpeg datadir.
  440. An updated version of the schema can be retrieved at the url
  441. @url{http://www.ffmpeg.org/schema/ffprobe.xsd}, which redirects to the
  442. latest schema committed into the FFmpeg development source code tree.
  443. Note that the output issued will be compliant to the
  444. @file{ffprobe.xsd} schema only when no special global output options
  445. (@option{unit}, @option{prefix}, @option{byte_binary_prefix},
  446. @option{sexagesimal} etc.) are specified.
  447. The description of the accepted options follows.
  448. @table @option
  449. @item fully_qualified, q
  450. If set to 1 specify if the output should be fully qualified. Default
  451. value is 0.
  452. This is required for generating an XML file which can be validated
  453. through an XSD file.
  454. @item xsd_strict, x
  455. If set to 1 perform more checks for ensuring that the output is XSD
  456. compliant. Default value is 0.
  457. This option automatically sets @option{fully_qualified} to 1.
  458. @end table
  459. For more information about the XML format, see
  460. @url{https://www.w3.org/XML/}.
  461. @c man end WRITERS
  462. @chapter Timecode
  463. @c man begin TIMECODE
  464. @command{ffprobe} supports Timecode extraction:
  465. @itemize
  466. @item
  467. MPEG1/2 timecode is extracted from the GOP, and is available in the video
  468. stream details (@option{-show_streams}, see @var{timecode}).
  469. @item
  470. MOV timecode is extracted from tmcd track, so is available in the tmcd
  471. stream metadata (@option{-show_streams}, see @var{TAG:timecode}).
  472. @item
  473. DV, GXF and AVI timecodes are available in format metadata
  474. (@option{-show_format}, see @var{TAG:timecode}).
  475. @end itemize
  476. @c man end TIMECODE
  477. @include config.texi
  478. @ifset config-all
  479. @set config-readonly
  480. @ifset config-avutil
  481. @include utils.texi
  482. @end ifset
  483. @ifset config-avcodec
  484. @include codecs.texi
  485. @include bitstream_filters.texi
  486. @end ifset
  487. @ifset config-avformat
  488. @include formats.texi
  489. @include protocols.texi
  490. @end ifset
  491. @ifset config-avdevice
  492. @include devices.texi
  493. @end ifset
  494. @ifset config-swresample
  495. @include resampler.texi
  496. @end ifset
  497. @ifset config-swscale
  498. @include scaler.texi
  499. @end ifset
  500. @ifset config-avfilter
  501. @include filters.texi
  502. @end ifset
  503. @include general_contents.texi
  504. @end ifset
  505. @chapter See Also
  506. @ifhtml
  507. @ifset config-all
  508. @url{ffprobe.html,ffprobe},
  509. @end ifset
  510. @ifset config-not-all
  511. @url{ffprobe-all.html,ffprobe-all},
  512. @end ifset
  513. @url{ffmpeg.html,ffmpeg}, @url{ffplay.html,ffplay},
  514. @url{ffmpeg-utils.html,ffmpeg-utils},
  515. @url{ffmpeg-scaler.html,ffmpeg-scaler},
  516. @url{ffmpeg-resampler.html,ffmpeg-resampler},
  517. @url{ffmpeg-codecs.html,ffmpeg-codecs},
  518. @url{ffmpeg-bitstream-filters.html,ffmpeg-bitstream-filters},
  519. @url{ffmpeg-formats.html,ffmpeg-formats},
  520. @url{ffmpeg-devices.html,ffmpeg-devices},
  521. @url{ffmpeg-protocols.html,ffmpeg-protocols},
  522. @url{ffmpeg-filters.html,ffmpeg-filters}
  523. @end ifhtml
  524. @ifnothtml
  525. @ifset config-all
  526. ffprobe(1),
  527. @end ifset
  528. @ifset config-not-all
  529. ffprobe-all(1),
  530. @end ifset
  531. ffmpeg(1), ffplay(1),
  532. ffmpeg-utils(1), ffmpeg-scaler(1), ffmpeg-resampler(1),
  533. ffmpeg-codecs(1), ffmpeg-bitstream-filters(1), ffmpeg-formats(1),
  534. ffmpeg-devices(1), ffmpeg-protocols(1), ffmpeg-filters(1)
  535. @end ifnothtml
  536. @include authors.texi
  537. @ignore
  538. @setfilename ffprobe
  539. @settitle ffprobe media prober
  540. @end ignore
  541. @bye