ffprobe.texi 19 KB

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