ffprobe.texi 19 KB

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