ffprobe.texi 19 KB

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