You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

638 lines
18KB

  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 contained in the input multimedia
  148. stream.
  149. The information for each single frame is printed within a dedicated
  150. section with name "FRAME".
  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. A description of the currently available writers follows.
  255. @section default
  256. Default format.
  257. Print each section in the form:
  258. @example
  259. [SECTION]
  260. key1=val1
  261. ...
  262. keyN=valN
  263. [/SECTION]
  264. @end example
  265. Metadata tags are printed as a line in the corresponding FORMAT, STREAM or
  266. PROGRAM_STREAM section, and are prefixed by the string "TAG:".
  267. A description of the accepted options follows.
  268. @table @option
  269. @item nokey, nk
  270. If set to 1 specify not to print the key of each field. Default value
  271. is 0.
  272. @item noprint_wrappers, nw
  273. If set to 1 specify not to print the section header and footer.
  274. Default value is 0.
  275. @end table
  276. @section compact, csv
  277. Compact and CSV format.
  278. The @code{csv} writer is equivalent to @code{compact}, but supports
  279. different defaults.
  280. Each section is printed on a single line.
  281. If no option is specifid, the output has the form:
  282. @example
  283. section|key1=val1| ... |keyN=valN
  284. @end example
  285. Metadata tags are printed in the corresponding "format" or "stream"
  286. section. A metadata tag key, if printed, is prefixed by the string
  287. "tag:".
  288. The description of the accepted options follows.
  289. @table @option
  290. @item item_sep, s
  291. Specify the character to use for separating fields in the output line.
  292. It must be a single printable character, it is "|" by default ("," for
  293. the @code{csv} writer).
  294. @item nokey, nk
  295. If set to 1 specify not to print the key of each field. Its default
  296. value is 0 (1 for the @code{csv} writer).
  297. @item escape, e
  298. Set the escape mode to use, default to "c" ("csv" for the @code{csv}
  299. writer).
  300. It can assume one of the following values:
  301. @table @option
  302. @item c
  303. Perform C-like escaping. Strings containing a newline ('\n'), carriage
  304. return ('\r'), a tab ('\t'), a form feed ('\f'), the escaping
  305. character ('\') or the item separator character @var{SEP} are escaped using C-like fashioned
  306. escaping, so that a newline is converted to the sequence "\n", a
  307. carriage return to "\r", '\' to "\\" and the separator @var{SEP} is
  308. converted to "\@var{SEP}".
  309. @item csv
  310. Perform CSV-like escaping, as described in RFC4180. Strings
  311. containing a newline ('\n'), a carriage return ('\r'), a double quote
  312. ('"'), or @var{SEP} are enclosed in double-quotes.
  313. @item none
  314. Perform no escaping.
  315. @end table
  316. @item print_section, p
  317. Print the section name at the begin of each line if the value is
  318. @code{1}, disable it with value set to @code{0}. Default value is
  319. @code{1}.
  320. @end table
  321. @section flat
  322. Flat format.
  323. A free-form output where each line contains an explicit key=value, such as
  324. "streams.stream.3.tags.foo=bar". The output is shell escaped, so it can be
  325. directly embedded in sh scripts as long as the separator character is an
  326. alphanumeric character or an underscore (see @var{sep_char} option).
  327. The description of the accepted options follows.
  328. @table @option
  329. @item sep_char, s
  330. Separator character used to separate the chapter, the section name, IDs and
  331. potential tags in the printed field key.
  332. Default value is '.'.
  333. @item hierarchical, h
  334. Specify if the section name specification should be hierarchical. If
  335. set to 1, and if there is more than one section in the current
  336. chapter, the section name will be prefixed by the name of the
  337. chapter. A value of 0 will disable this behavior.
  338. Default value is 1.
  339. @end table
  340. @section ini
  341. INI format output.
  342. Print output in an INI based format.
  343. The following conventions are adopted:
  344. @itemize
  345. @item
  346. all key and values are UTF-8
  347. @item
  348. '.' is the subgroup separator
  349. @item
  350. newline, '\t', '\f', '\b' and the following characters are escaped
  351. @item
  352. '\' is the escape character
  353. @item
  354. '#' is the comment indicator
  355. @item
  356. '=' is the key/value separator
  357. @item
  358. ':' is not used but usually parsed as key/value separator
  359. @end itemize
  360. This writer accepts options as a list of @var{key}=@var{value} pairs,
  361. separated by ":".
  362. The description of the accepted options follows.
  363. @table @option
  364. @item hierarchical, h
  365. Specify if the section name specification should be hierarchical. If
  366. set to 1, and if there is more than one section in the current
  367. chapter, the section name will be prefixed by the name of the
  368. chapter. A value of 0 will disable this behavior.
  369. Default value is 1.
  370. @end table
  371. @section json
  372. JSON based format.
  373. Each section is printed using JSON notation.
  374. The description of the accepted options follows.
  375. @table @option
  376. @item compact, c
  377. If set to 1 enable compact output, that is each section will be
  378. printed on a single line. Default value is 0.
  379. @end table
  380. For more information about JSON, see @url{http://www.json.org/}.
  381. @section xml
  382. XML based format.
  383. The XML output is described in the XML schema description file
  384. @file{ffprobe.xsd} installed in the FFmpeg datadir.
  385. An updated version of the schema can be retrieved at the url
  386. @url{http://www.ffmpeg.org/schema/ffprobe.xsd}, which redirects to the
  387. latest schema committed into the FFmpeg development source code tree.
  388. Note that the output issued will be compliant to the
  389. @file{ffprobe.xsd} schema only when no special global output options
  390. (@option{unit}, @option{prefix}, @option{byte_binary_prefix},
  391. @option{sexagesimal} etc.) are specified.
  392. The description of the accepted options follows.
  393. @table @option
  394. @item fully_qualified, q
  395. If set to 1 specify if the output should be fully qualified. Default
  396. value is 0.
  397. This is required for generating an XML file which can be validated
  398. through an XSD file.
  399. @item xsd_compliant, x
  400. If set to 1 perform more checks for ensuring that the output is XSD
  401. compliant. Default value is 0.
  402. This option automatically sets @option{fully_qualified} to 1.
  403. @end table
  404. For more information about the XML format, see
  405. @url{http://www.w3.org/XML/}.
  406. @c man end WRITERS
  407. @chapter Timecode
  408. @c man begin TIMECODE
  409. @command{ffprobe} supports Timecode extraction:
  410. @itemize
  411. @item
  412. MPEG1/2 timecode is extracted from the GOP, and is available in the video
  413. stream details (@option{-show_streams}, see @var{timecode}).
  414. @item
  415. MOV timecode is extracted from tmcd track, so is available in the tmcd
  416. stream metadata (@option{-show_streams}, see @var{TAG:timecode}).
  417. @item
  418. DV, GXF and AVI timecodes are available in format metadata
  419. (@option{-show_format}, see @var{TAG:timecode}).
  420. @end itemize
  421. @c man end TIMECODE
  422. @include config.texi
  423. @ifset config-all
  424. @ifset config-avutil
  425. @include utils.texi
  426. @end ifset
  427. @ifset config-avcodec
  428. @include codecs.texi
  429. @include bitstream_filters.texi
  430. @end ifset
  431. @ifset config-avformat
  432. @include formats.texi
  433. @include protocols.texi
  434. @end ifset
  435. @ifset config-avdevice
  436. @include devices.texi
  437. @end ifset
  438. @ifset config-swresample
  439. @include resampler.texi
  440. @end ifset
  441. @ifset config-swscale
  442. @include scaler.texi
  443. @end ifset
  444. @ifset config-avfilter
  445. @include filters.texi
  446. @end ifset
  447. @end ifset
  448. @chapter See Also
  449. @ifhtml
  450. @ifset config-all
  451. @url{ffprobe.html,ffprobe},
  452. @end ifset
  453. @ifset config-not-all
  454. @url{ffprobe-all.html,ffprobe-all},
  455. @end ifset
  456. @url{ffmpeg.html,ffmpeg}, @url{ffplay.html,ffplay}, @url{ffserver.html,ffserver},
  457. @url{ffmpeg-utils.html,ffmpeg-utils},
  458. @url{ffmpeg-scaler.html,ffmpeg-scaler},
  459. @url{ffmpeg-resampler.html,ffmpeg-resampler},
  460. @url{ffmpeg-codecs.html,ffmpeg-codecs},
  461. @url{ffmpeg-bitstream-filters.html,ffmpeg-bitstream-filters},
  462. @url{ffmpeg-formats.html,ffmpeg-formats},
  463. @url{ffmpeg-devices.html,ffmpeg-devices},
  464. @url{ffmpeg-protocols.html,ffmpeg-protocols},
  465. @url{ffmpeg-filters.html,ffmpeg-filters}
  466. @end ifhtml
  467. @ifnothtml
  468. @ifset config-all
  469. ffprobe(1),
  470. @end ifset
  471. @ifset config-not-all
  472. ffprobe-all(1),
  473. @end ifset
  474. ffmpeg(1), ffplay(1), ffserver(1),
  475. ffmpeg-utils(1), ffmpeg-scaler(1), ffmpeg-resampler(1),
  476. ffmpeg-codecs(1), ffmpeg-bitstream-filters(1), ffmpeg-formats(1),
  477. ffmpeg-devices(1), ffmpeg-protocols(1), ffmpeg-filters(1)
  478. @end ifnothtml
  479. @include authors.texi
  480. @ignore
  481. @setfilename ffprobe
  482. @settitle ffprobe media prober
  483. @end ignore
  484. @bye