ffprobe.texi 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725
  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 -analyze_frames
  266. Analyze frames and/or their side data up to the provided read interval,
  267. providing additional information that may be useful at a stream level.
  268. Must be paired with the @option{-show_streams} option or it will have no effect.
  269. Currently, the additional fields provided by this option when enabled are the
  270. @code{closed_captions} and @code{film_grain} fields.
  271. For example, to analyze the first 20 seconds and populate these fields:
  272. @example
  273. ffprobe -show_streams -analyze_frames -read_intervals "%+20" INPUT
  274. @end example
  275. @item -bitexact
  276. Force bitexact output, useful to produce output which is not dependent
  277. on the specific build.
  278. @item -i @var{input_url}
  279. Read @var{input_url}.
  280. @item -o @var{output_url}
  281. Write output to @var{output_url}. If not specified, the output is sent
  282. to stdout.
  283. @end table
  284. @c man end
  285. @chapter Writers
  286. @c man begin WRITERS
  287. A writer defines the output format adopted by @command{ffprobe}, and will be
  288. used for printing all the parts of the output.
  289. A writer may accept one or more arguments, which specify the options
  290. to adopt. The options are specified as a list of @var{key}=@var{value}
  291. pairs, separated by ":".
  292. All writers support the following options:
  293. @table @option
  294. @item string_validation, sv
  295. Set string validation mode.
  296. The following values are accepted.
  297. @table @samp
  298. @item fail
  299. The writer will fail immediately in case an invalid string (UTF-8)
  300. sequence or code point is found in the input. This is especially
  301. useful to validate input metadata.
  302. @item ignore
  303. Any validation error will be ignored. This will result in possibly
  304. broken output, especially with the json or xml writer.
  305. @item replace
  306. The writer will substitute invalid UTF-8 sequences or code points with
  307. the string specified with the @option{string_validation_replacement}.
  308. @end table
  309. Default value is @samp{replace}.
  310. @item string_validation_replacement, svr
  311. Set replacement string to use in case @option{string_validation} is
  312. set to @samp{replace}.
  313. In case the option is not specified, the writer will assume the empty
  314. string, that is it will remove the invalid sequences from the input
  315. strings.
  316. @end table
  317. A description of the currently available writers follows.
  318. @section default
  319. Default format.
  320. Print each section in the form:
  321. @example
  322. [SECTION]
  323. key1=val1
  324. ...
  325. keyN=valN
  326. [/SECTION]
  327. @end example
  328. Metadata tags are printed as a line in the corresponding FORMAT, STREAM,
  329. STREAM_GROUP_STREAM or PROGRAM_STREAM section, and are prefixed by the
  330. string "TAG:".
  331. A description of the accepted options follows.
  332. @table @option
  333. @item nokey, nk
  334. If set to 1 specify not to print the key of each field. Default value
  335. is 0.
  336. @item noprint_wrappers, nw
  337. If set to 1 specify not to print the section header and footer.
  338. Default value is 0.
  339. @end table
  340. @section compact, csv
  341. Compact and CSV format.
  342. The @code{csv} writer is equivalent to @code{compact}, but supports
  343. different defaults.
  344. Each section is printed on a single line.
  345. If no option is specified, the output has the form:
  346. @example
  347. section|key1=val1| ... |keyN=valN
  348. @end example
  349. Metadata tags are printed in the corresponding "format" or "stream"
  350. section. A metadata tag key, if printed, is prefixed by the string
  351. "tag:".
  352. The description of the accepted options follows.
  353. @table @option
  354. @item item_sep, s
  355. Specify the character to use for separating fields in the output line.
  356. It must be a single printable character, it is "|" by default ("," for
  357. the @code{csv} writer).
  358. @item nokey, nk
  359. If set to 1 specify not to print the key of each field. Its default
  360. value is 0 (1 for the @code{csv} writer).
  361. @item escape, e
  362. Set the escape mode to use, default to "c" ("csv" for the @code{csv}
  363. writer).
  364. It can assume one of the following values:
  365. @table @option
  366. @item c
  367. Perform C-like escaping. Strings containing a newline (@samp{\n}), carriage
  368. return (@samp{\r}), a tab (@samp{\t}), a form feed (@samp{\f}), the escaping
  369. character (@samp{\}) or the item separator character @var{SEP} are escaped
  370. using C-like fashioned escaping, so that a newline is converted to the
  371. sequence @samp{\n}, a carriage return to @samp{\r}, @samp{\} to @samp{\\} and
  372. the separator @var{SEP} is converted to @samp{\@var{SEP}}.
  373. @item csv
  374. Perform CSV-like escaping, as described in RFC4180. Strings
  375. containing a newline (@samp{\n}), a carriage return (@samp{\r}), a double quote
  376. (@samp{"}), or @var{SEP} are enclosed in double-quotes.
  377. @item none
  378. Perform no escaping.
  379. @end table
  380. @item print_section, p
  381. Print the section name at the beginning of each line if the value is
  382. @code{1}, disable it with value set to @code{0}. Default value is
  383. @code{1}.
  384. @end table
  385. @section flat
  386. Flat format.
  387. A free-form output where each line contains an explicit key=value, such as
  388. "streams.stream.3.tags.foo=bar". The output is shell escaped, so it can be
  389. directly embedded in sh scripts as long as the separator character is an
  390. alphanumeric character or an underscore (see @var{sep_char} option).
  391. The description of the accepted options follows.
  392. @table @option
  393. @item sep_char, s
  394. Separator character used to separate the chapter, the section name, IDs and
  395. potential tags in the printed field key.
  396. Default value is @samp{.}.
  397. @item hierarchical, h
  398. Specify if the section name specification should be hierarchical. If
  399. set to 1, and if there is more than one section in the current
  400. chapter, the section name will be prefixed by the name of the
  401. chapter. A value of 0 will disable this behavior.
  402. Default value is 1.
  403. @end table
  404. @section ini
  405. INI format output.
  406. Print output in an INI based format.
  407. The following conventions are adopted:
  408. @itemize
  409. @item
  410. all key and values are UTF-8
  411. @item
  412. @samp{.} is the subgroup separator
  413. @item
  414. newline, @samp{\t}, @samp{\f}, @samp{\b} and the following characters are
  415. escaped
  416. @item
  417. @samp{\} is the escape character
  418. @item
  419. @samp{#} is the comment indicator
  420. @item
  421. @samp{=} is the key/value separator
  422. @item
  423. @samp{:} is not used but usually parsed as key/value separator
  424. @end itemize
  425. This writer accepts options as a list of @var{key}=@var{value} pairs,
  426. separated by @samp{:}.
  427. The description of the accepted options follows.
  428. @table @option
  429. @item hierarchical, h
  430. Specify if the section name specification should be hierarchical. If
  431. set to 1, and if there is more than one section in the current
  432. chapter, the section name will be prefixed by the name of the
  433. chapter. A value of 0 will disable this behavior.
  434. Default value is 1.
  435. @end table
  436. @section json
  437. JSON based format.
  438. Each section is printed using JSON notation.
  439. The description of the accepted options follows.
  440. @table @option
  441. @item compact, c
  442. If set to 1 enable compact output, that is each section will be
  443. printed on a single line. Default value is 0.
  444. @end table
  445. For more information about JSON, see @url{http://www.json.org/}.
  446. @section xml
  447. XML based format.
  448. The XML output is described in the XML schema description file
  449. @file{ffprobe.xsd} installed in the FFmpeg datadir.
  450. An updated version of the schema can be retrieved at the url
  451. @url{http://www.ffmpeg.org/schema/ffprobe.xsd}, which redirects to the
  452. latest schema committed into the FFmpeg development source code tree.
  453. Note that the output issued will be compliant to the
  454. @file{ffprobe.xsd} schema only when no special global output options
  455. (@option{unit}, @option{prefix}, @option{byte_binary_prefix},
  456. @option{sexagesimal} etc.) are specified.
  457. The description of the accepted options follows.
  458. @table @option
  459. @item fully_qualified, q
  460. If set to 1 specify if the output should be fully qualified. Default
  461. value is 0.
  462. This is required for generating an XML file which can be validated
  463. through an XSD file.
  464. @item xsd_strict, x
  465. If set to 1 perform more checks for ensuring that the output is XSD
  466. compliant. Default value is 0.
  467. This option automatically sets @option{fully_qualified} to 1.
  468. @end table
  469. For more information about the XML format, see
  470. @url{https://www.w3.org/XML/}.
  471. @c man end WRITERS
  472. @chapter Timecode
  473. @c man begin TIMECODE
  474. @command{ffprobe} supports Timecode extraction:
  475. @itemize
  476. @item
  477. MPEG1/2 timecode is extracted from the GOP, and is available in the video
  478. stream details (@option{-show_streams}, see @var{timecode}).
  479. @item
  480. MOV timecode is extracted from tmcd track, so is available in the tmcd
  481. stream metadata (@option{-show_streams}, see @var{TAG:timecode}).
  482. @item
  483. DV, GXF and AVI timecodes are available in format metadata
  484. (@option{-show_format}, see @var{TAG:timecode}).
  485. @end itemize
  486. @c man end TIMECODE
  487. @include config.texi
  488. @ifset config-all
  489. @set config-readonly
  490. @ifset config-avutil
  491. @include utils.texi
  492. @end ifset
  493. @ifset config-avcodec
  494. @include codecs.texi
  495. @include bitstream_filters.texi
  496. @end ifset
  497. @ifset config-avformat
  498. @include formats.texi
  499. @include protocols.texi
  500. @end ifset
  501. @ifset config-avdevice
  502. @include devices.texi
  503. @end ifset
  504. @ifset config-swresample
  505. @include resampler.texi
  506. @end ifset
  507. @ifset config-swscale
  508. @include scaler.texi
  509. @end ifset
  510. @ifset config-avfilter
  511. @include filters.texi
  512. @end ifset
  513. @include general_contents.texi
  514. @end ifset
  515. @chapter See Also
  516. @ifhtml
  517. @ifset config-all
  518. @url{ffprobe.html,ffprobe},
  519. @end ifset
  520. @ifset config-not-all
  521. @url{ffprobe-all.html,ffprobe-all},
  522. @end ifset
  523. @url{ffmpeg.html,ffmpeg}, @url{ffplay.html,ffplay},
  524. @url{ffmpeg-utils.html,ffmpeg-utils},
  525. @url{ffmpeg-scaler.html,ffmpeg-scaler},
  526. @url{ffmpeg-resampler.html,ffmpeg-resampler},
  527. @url{ffmpeg-codecs.html,ffmpeg-codecs},
  528. @url{ffmpeg-bitstream-filters.html,ffmpeg-bitstream-filters},
  529. @url{ffmpeg-formats.html,ffmpeg-formats},
  530. @url{ffmpeg-devices.html,ffmpeg-devices},
  531. @url{ffmpeg-protocols.html,ffmpeg-protocols},
  532. @url{ffmpeg-filters.html,ffmpeg-filters}
  533. @end ifhtml
  534. @ifnothtml
  535. @ifset config-all
  536. ffprobe(1),
  537. @end ifset
  538. @ifset config-not-all
  539. ffprobe-all(1),
  540. @end ifset
  541. ffmpeg(1), ffplay(1),
  542. ffmpeg-utils(1), ffmpeg-scaler(1), ffmpeg-resampler(1),
  543. ffmpeg-codecs(1), ffmpeg-bitstream-filters(1), ffmpeg-formats(1),
  544. ffmpeg-devices(1), ffmpeg-protocols(1), ffmpeg-filters(1)
  545. @end ifnothtml
  546. @include authors.texi
  547. @ignore
  548. @setfilename ffprobe
  549. @settitle ffprobe media prober
  550. @end ignore
  551. @bye