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.

518 lines
14KB

  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. The generic syntax is:
  10. @example
  11. @c man begin SYNOPSIS
  12. ffprobe [options] [@file{input_file}]
  13. @c man end
  14. @end example
  15. @chapter Description
  16. @c man begin DESCRIPTION
  17. ffprobe gathers information from multimedia streams and prints it in
  18. human- and machine-readable fashion.
  19. For example it can be used to check the format of the container used
  20. by a multimedia stream and the format and type of each media stream
  21. contained in it.
  22. If a filename is specified in input, ffprobe will try to open and
  23. probe the file content. If the file cannot be opened or recognized as
  24. a multimedia file, a positive exit code is returned.
  25. ffprobe may be employed both as a standalone application or in
  26. combination with a textual filter, which may perform more
  27. sophisticated processing, e.g. statistical processing or plotting.
  28. Options are used to list some of the formats supported by ffprobe or
  29. for specifying which information to display, and for setting how
  30. ffprobe will show it.
  31. ffprobe output is designed to be easily parsable by a textual filter,
  32. and consists of one or more sections of a form defined by the selected
  33. writer, which is specified by the @option{print_format} option.
  34. Sections may contain other nested sections, and are identified by a
  35. name (which may be shared by other sections), and an unique
  36. name. See the output of @option{sections}.
  37. Metadata tags stored in the container or in the streams are recognized
  38. and printed in the corresponding "FORMAT" or "STREAM" section.
  39. @c man end
  40. @chapter Options
  41. @c man begin OPTIONS
  42. @include avtools-common-opts.texi
  43. @section Main options
  44. @table @option
  45. @item -f @var{format}
  46. Force format to use.
  47. @item -unit
  48. Show the unit of the displayed values.
  49. @item -prefix
  50. Use SI prefixes for the displayed values.
  51. Unless the "-byte_binary_prefix" option is used all the prefixes
  52. are decimal.
  53. @item -byte_binary_prefix
  54. Force the use of binary prefixes for byte values.
  55. @item -sexagesimal
  56. Use sexagesimal format HH:MM:SS.MICROSECONDS for time values.
  57. @item -pretty
  58. Prettify the format of the displayed values, it corresponds to the
  59. options "-unit -prefix -byte_binary_prefix -sexagesimal".
  60. @item -of, -print_format @var{writer_name}[=@var{writer_options}]
  61. Set the output printing format.
  62. @var{writer_name} specifies the name of the writer, and
  63. @var{writer_options} specifies the options to be passed to the writer.
  64. For example for printing the output in JSON format, specify:
  65. @example
  66. -print_format json
  67. @end example
  68. For more details on the available output printing formats, see the
  69. Writers section below.
  70. @item -sections
  71. Print sections structure and section information, and exit. The output
  72. is not meant to be parsed by a machine.
  73. @item -select_streams @var{stream_specifier}
  74. Select only the streams specified by @var{stream_specifier}. This
  75. option affects only the options related to streams
  76. (e.g. @code{show_streams}, @code{show_packets}, etc.).
  77. For example to show only audio streams, you can use the command:
  78. @example
  79. ffprobe -show_streams -select_streams a INPUT
  80. @end example
  81. To show only video packets belonging to the video stream with index 1:
  82. @example
  83. ffprobe -show_packets -select_streams v:1 INPUT
  84. @end example
  85. @item -show_data
  86. Show payload data, as an hexadecimal and ASCII dump. Coupled with
  87. @option{-show_packets}, it will dump the packets' data. Coupled with
  88. @option{-show_streams}, it will dump the codec extradata.
  89. The dump is printed as the "data" field. It may contain newlines.
  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. format_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 contained in the input multimedia
  152. stream.
  153. The information for each single frame is printed within a dedicated
  154. section with name "FRAME".
  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 -count_frames
  161. Count the number of frames per stream and report it in the
  162. corresponding stream section.
  163. @item -count_packets
  164. Count the number of packets per stream and report it in the
  165. corresponding stream section.
  166. @item -show_private_data, -private
  167. Show private data, that is data depending on the format of the
  168. particular shown element.
  169. This option is enabled by default, but you may need to disable it
  170. for specific uses, for example when creating XSD-compliant XML output.
  171. @item -show_program_version
  172. Show information related to program version.
  173. Version information is printed within a section with name
  174. "PROGRAM_VERSION".
  175. @item -show_library_versions
  176. Show information related to library versions.
  177. Version information for each library is printed within a section with
  178. name "LIBRARY_VERSION".
  179. @item -show_versions
  180. Show information related to program and library versions. This is the
  181. equivalent of setting both @option{-show_program_version} and
  182. @option{-show_library_versions} options.
  183. @item -bitexact
  184. Force bitexact output, useful to produce output which is not dependent
  185. on the specific build.
  186. @item -i @var{input_file}
  187. Read @var{input_file}.
  188. @end table
  189. @c man end
  190. @chapter Writers
  191. @c man begin WRITERS
  192. A writer defines the output format adopted by @command{ffprobe}, and will be
  193. used for printing all the parts of the output.
  194. A writer may accept one or more arguments, which specify the options
  195. to adopt. The options are specified as a list of @var{key}=@var{value}
  196. pairs, separated by ":".
  197. A description of the currently available writers follows.
  198. @section default
  199. Default format.
  200. Print each section in the form:
  201. @example
  202. [SECTION]
  203. key1=val1
  204. ...
  205. keyN=valN
  206. [/SECTION]
  207. @end example
  208. Metadata tags are printed as a line in the corresponding FORMAT or
  209. STREAM section, and are prefixed by the string "TAG:".
  210. A description of the accepted options follows.
  211. @table @option
  212. @item nokey, nk
  213. If set to 1 specify not to print the key of each field. Default value
  214. is 0.
  215. @item noprint_wrappers, nw
  216. If set to 1 specify not to print the section header and footer.
  217. Default value is 0.
  218. @end table
  219. @section compact, csv
  220. Compact and CSV format.
  221. The @code{csv} writer is equivalent to @code{compact}, but supports
  222. different defaults.
  223. Each section is printed on a single line.
  224. If no option is specifid, the output has the form:
  225. @example
  226. section|key1=val1| ... |keyN=valN
  227. @end example
  228. Metadata tags are printed in the corresponding "format" or "stream"
  229. section. A metadata tag key, if printed, is prefixed by the string
  230. "tag:".
  231. The description of the accepted options follows.
  232. @table @option
  233. @item item_sep, s
  234. Specify the character to use for separating fields in the output line.
  235. It must be a single printable character, it is "|" by default ("," for
  236. the @code{csv} writer).
  237. @item nokey, nk
  238. If set to 1 specify not to print the key of each field. Its default
  239. value is 0 (1 for the @code{csv} writer).
  240. @item escape, e
  241. Set the escape mode to use, default to "c" ("csv" for the @code{csv}
  242. writer).
  243. It can assume one of the following values:
  244. @table @option
  245. @item c
  246. Perform C-like escaping. Strings containing a newline ('\n'), carriage
  247. return ('\r'), a tab ('\t'), a form feed ('\f'), the escaping
  248. character ('\') or the item separator character @var{SEP} are escaped using C-like fashioned
  249. escaping, so that a newline is converted to the sequence "\n", a
  250. carriage return to "\r", '\' to "\\" and the separator @var{SEP} is
  251. converted to "\@var{SEP}".
  252. @item csv
  253. Perform CSV-like escaping, as described in RFC4180. Strings
  254. containing a newline ('\n'), a carriage return ('\r'), a double quote
  255. ('"'), or @var{SEP} are enclosed in double-quotes.
  256. @item none
  257. Perform no escaping.
  258. @end table
  259. @item print_section, p
  260. Print the section name at the begin of each line if the value is
  261. @code{1}, disable it with value set to @code{0}. Default value is
  262. @code{1}.
  263. @end table
  264. @section flat
  265. Flat format.
  266. A free-form output where each line contains an explicit key=value, such as
  267. "streams.stream.3.tags.foo=bar". The output is shell escaped, so it can be
  268. directly embedded in sh scripts as long as the separator character is an
  269. alphanumeric character or an underscore (see @var{sep_char} option).
  270. The description of the accepted options follows.
  271. @table @option
  272. @item sep_char, s
  273. Separator character used to separate the chapter, the section name, IDs and
  274. potential tags in the printed field key.
  275. Default value is '.'.
  276. @item hierarchical, h
  277. Specify if the section name specification should be hierarchical. If
  278. set to 1, and if there is more than one section in the current
  279. chapter, the section name will be prefixed by the name of the
  280. chapter. A value of 0 will disable this behavior.
  281. Default value is 1.
  282. @end table
  283. @section ini
  284. INI format output.
  285. Print output in an INI based format.
  286. The following conventions are adopted:
  287. @itemize
  288. @item
  289. all key and values are UTF-8
  290. @item
  291. '.' is the subgroup separator
  292. @item
  293. newline, '\t', '\f', '\b' and the following characters are escaped
  294. @item
  295. '\' is the escape character
  296. @item
  297. '#' is the comment indicator
  298. @item
  299. '=' is the key/value separator
  300. @item
  301. ':' is not used but usually parsed as key/value separator
  302. @end itemize
  303. This writer accepts options as a list of @var{key}=@var{value} pairs,
  304. separated by ":".
  305. The description of the accepted options follows.
  306. @table @option
  307. @item hierarchical, h
  308. Specify if the section name specification should be hierarchical. If
  309. set to 1, and if there is more than one section in the current
  310. chapter, the section name will be prefixed by the name of the
  311. chapter. A value of 0 will disable this behavior.
  312. Default value is 1.
  313. @end table
  314. @section json
  315. JSON based format.
  316. Each section is printed using JSON notation.
  317. The description of the accepted options follows.
  318. @table @option
  319. @item compact, c
  320. If set to 1 enable compact output, that is each section will be
  321. printed on a single line. Default value is 0.
  322. @end table
  323. For more information about JSON, see @url{http://www.json.org/}.
  324. @section xml
  325. XML based format.
  326. The XML output is described in the XML schema description file
  327. @file{ffprobe.xsd} installed in the FFmpeg datadir.
  328. An updated version of the schema can be retrieved at the url
  329. @url{http://www.ffmpeg.org/schema/ffprobe.xsd}, which redirects to the
  330. latest schema committed into the FFmpeg development source code tree.
  331. Note that the output issued will be compliant to the
  332. @file{ffprobe.xsd} schema only when no special global output options
  333. (@option{unit}, @option{prefix}, @option{byte_binary_prefix},
  334. @option{sexagesimal} etc.) are specified.
  335. The description of the accepted options follows.
  336. @table @option
  337. @item fully_qualified, q
  338. If set to 1 specify if the output should be fully qualified. Default
  339. value is 0.
  340. This is required for generating an XML file which can be validated
  341. through an XSD file.
  342. @item xsd_compliant, x
  343. If set to 1 perform more checks for ensuring that the output is XSD
  344. compliant. Default value is 0.
  345. This option automatically sets @option{fully_qualified} to 1.
  346. @end table
  347. For more information about the XML format, see
  348. @url{http://www.w3.org/XML/}.
  349. @c man end WRITERS
  350. @chapter Timecode
  351. @c man begin TIMECODE
  352. @command{ffprobe} supports Timecode extraction:
  353. @itemize
  354. @item
  355. MPEG1/2 timecode is extracted from the GOP, and is available in the video
  356. stream details (@option{-show_streams}, see @var{timecode}).
  357. @item
  358. MOV timecode is extracted from tmcd track, so is available in the tmcd
  359. stream metadata (@option{-show_streams}, see @var{TAG:timecode}).
  360. @item
  361. DV, GXF and AVI timecodes are available in format metadata
  362. (@option{-show_format}, see @var{TAG:timecode}).
  363. @end itemize
  364. @c man end TIMECODE
  365. @include syntax.texi
  366. @include decoders.texi
  367. @include demuxers.texi
  368. @include protocols.texi
  369. @include indevs.texi
  370. @ignore
  371. @setfilename ffprobe
  372. @settitle ffprobe media prober
  373. @c man begin SEEALSO
  374. ffmpeg(1), ffplay(1), ffserver(1) and the FFmpeg HTML documentation
  375. @c man end
  376. @c man begin AUTHORS
  377. The FFmpeg developers
  378. @c man end
  379. @end ignore
  380. @bye