logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

ffprobe.1 (34397B)


  1. .Dd August 2, 2024
  2. .Dt FFPROBE 7
  3. .Os
  4. .Sh NAME
  5. .Nm ffprobe
  6. .Nd ffprobe Documentation
  7. .Sh
  8. .Sh Synopsis
  9. ffprobe [
  10. .Va options
  11. ]
  12. .Pa input_url
  13. .Pp
  14. .Sh Description
  15. ffprobe gathers information from multimedia streams and prints it in human-
  16. and machine-readable fashion.
  17. .Pp
  18. For example it can be used to check the format of the container used by a
  19. multimedia stream and the format and type of each media stream contained in
  20. it.
  21. .Pp
  22. If a url is specified in input, ffprobe will try to open and probe the url
  23. content. If the url cannot be opened or recognized as a multimedia file, a
  24. positive exit code is returned.
  25. .Pp
  26. If no output is specified as output with
  27. .Op o
  28. ffprobe will write to stdout.
  29. .Pp
  30. ffprobe may be employed both as a standalone application or in combination
  31. with a textual filter, which may perform more sophisticated processing, e.g.
  32. statistical processing or plotting.
  33. .Pp
  34. Options are used to list some of the formats supported by ffprobe or for specifying
  35. which information to display, and for setting how ffprobe will show it.
  36. .Pp
  37. ffprobe output is designed to be easily parsable by a textual filter, and
  38. consists of one or more sections of a form defined by the selected writer,
  39. which is specified by the
  40. .Op output_format
  41. option.
  42. .Pp
  43. Sections may contain other nested sections, and are identified by a name (which
  44. may be shared by other sections), and an unique name. See the output of
  45. .Op sections .
  46. .Pp
  47. Metadata tags stored in the container or in the streams are recognized and
  48. printed in the corresponding "FORMAT", "STREAM", "STREAM_GROUP_STREAM" or
  49. "PROGRAM_STREAM" section.
  50. .Pp
  51. .Sh Options
  52. All the numerical options, if not specified otherwise, accept a string representing
  53. a number as input, which may be followed by one of the SI unit prefixes, for
  54. example: 'K', 'M', or 'G'.
  55. .Pp
  56. If 'i' is appended to the SI unit prefix, the complete prefix will be interpreted
  57. as a unit prefix for binary multiples, which are based on powers of 1024 instead
  58. of powers of 1000. Appending 'B' to the SI unit prefix multiplies the value
  59. by 8. This allows using, for example: 'KB', 'MiB', 'G' and 'B' as number suffixes.
  60. .Pp
  61. Options which do not take arguments are boolean options, and set the corresponding
  62. value to true. They can be set to false by prefixing the option name with
  63. "no". For example using "-nofoo" will set the boolean option with name "foo"
  64. to false.
  65. .Pp
  66. Options that take arguments support a special syntax where the argument given
  67. on the command line is interpreted as a path to the file from which the actual
  68. argument value is loaded. To use this feature, add a forward slash '/' immediately
  69. before the option name (after the leading dash). E.g.
  70. .Bd -literal -offset indent
  71. ffmpeg -i INPUT -/filter:v filter.script OUTPUT
  72. .Ed
  73. will load a filtergraph description from the file named
  74. .Pa filter.script .
  75. .Pp
  76. .Ss Stream specifiers
  77. Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
  78. are used to precisely specify which stream(s) a given option belongs to.
  79. .Pp
  80. A stream specifier is a string generally appended to the option name and separated
  81. from it by a colon. E.g.
  82. .Li -codec:a:1 ac3
  83. contains the
  84. .Li a:1
  85. stream specifier, which matches the second audio stream. Therefore, it would
  86. select the ac3 codec for the second audio stream.
  87. .Pp
  88. A stream specifier can match several streams, so that the option is applied
  89. to all of them. E.g. the stream specifier in
  90. .Li -b:a 128k
  91. matches all audio streams.
  92. .Pp
  93. An empty stream specifier matches all streams. For example,
  94. .Li -codec copy
  95. or
  96. .Li -codec: copy
  97. would copy all the streams without reencoding.
  98. .Pp
  99. Possible forms of stream specifiers are:
  100. .Bl -tag -width Ds
  101. .It Va stream_index
  102. Matches the stream with this index. E.g.
  103. .Li -threads:1 4
  104. would set the thread count for the second stream to 4. If
  105. .Va stream_index
  106. is used as an additional stream specifier (see below), then it selects stream
  107. number
  108. .Va stream_index
  109. from the matching streams. Stream numbering is based on the order of the streams
  110. as detected by libavformat except when a stream group specifier or program
  111. ID is also specified. In this case it is based on the ordering of the streams
  112. in the group or program.
  113. .It Va stream_type[: Va additional_stream_specifier]
  114. .Va stream_type
  115. is one of following: 'v' or 'V' for video, 'a' for audio, 's' for subtitle,
  116. \&'d' for data, and 't' for attachments. 'v' matches all video streams, 'V'
  117. only matches video streams which are not attached pictures, video thumbnails
  118. or cover arts. If
  119. .Va additional_stream_specifier
  120. is used, then it matches streams which both have this type and match the
  121. .Va additional_stream_specifier .
  122. Otherwise, it matches all streams of the specified type.
  123. .It g: Va group_specifier[: Va additional_stream_specifier]
  124. Matches streams which are in the group with the specifier
  125. .Va group_specifier .
  126. if
  127. .Va additional_stream_specifier
  128. is used, then it matches streams which both are part of the group and match
  129. the
  130. .Va additional_stream_specifier .
  131. .Va group_specifier
  132. may be one of the following:
  133. .Bl -tag -width Ds
  134. .It Va group_index
  135. Match the stream with this group index.
  136. .It # Va group_id or i: Va group_id
  137. Match the stream with this group id.
  138. .El
  139. .It p: Va program_id[: Va additional_stream_specifier]
  140. Matches streams which are in the program with the id
  141. .Va program_id .
  142. If
  143. .Va additional_stream_specifier
  144. is used, then it matches streams which both are part of the program and match
  145. the
  146. .Va additional_stream_specifier .
  147. .Pp
  148. .It # Va stream_id or i: Va stream_id
  149. Match the stream by stream id (e.g. PID in MPEG-TS container).
  150. .It m: Va key[: Va value]
  151. Matches streams with the metadata tag
  152. .Va key
  153. having the specified value. If
  154. .Va value
  155. is not given, matches streams that contain the given tag with any value.
  156. .It u
  157. Matches streams with usable configuration, the codec must be defined and the
  158. essential information such as video dimension or audio sample rate must be
  159. present.
  160. .Pp
  161. Note that in
  162. .Xr ffmpeg ,
  163. matching by metadata will only work properly for input files.
  164. .El
  165. .Pp
  166. .Ss Generic options
  167. These options are shared amongst the ff* tools.
  168. .Pp
  169. .Bl -tag -width Ds
  170. .It -L
  171. Show license.
  172. .Pp
  173. .It -h, -?, -help, --help [ Va arg]
  174. Show help. An optional parameter may be specified to print help about a specific
  175. item. If no argument is specified, only basic (non advanced) tool options
  176. are shown.
  177. .Pp
  178. Possible values of
  179. .Va arg
  180. are:
  181. .Bl -tag -width Ds
  182. .It long
  183. Print advanced tool options in addition to the basic tool options.
  184. .Pp
  185. .It full
  186. Print complete list of options, including shared and private options for encoders,
  187. decoders, demuxers, muxers, filters, etc.
  188. .Pp
  189. .It decoder= Va decoder_name
  190. Print detailed information about the decoder named
  191. .Va decoder_name .
  192. Use the
  193. .Op -decoders
  194. option to get a list of all decoders.
  195. .Pp
  196. .It encoder= Va encoder_name
  197. Print detailed information about the encoder named
  198. .Va encoder_name .
  199. Use the
  200. .Op -encoders
  201. option to get a list of all encoders.
  202. .Pp
  203. .It demuxer= Va demuxer_name
  204. Print detailed information about the demuxer named
  205. .Va demuxer_name .
  206. Use the
  207. .Op -formats
  208. option to get a list of all demuxers and muxers.
  209. .Pp
  210. .It muxer= Va muxer_name
  211. Print detailed information about the muxer named
  212. .Va muxer_name .
  213. Use the
  214. .Op -formats
  215. option to get a list of all muxers and demuxers.
  216. .Pp
  217. .It filter= Va filter_name
  218. Print detailed information about the filter named
  219. .Va filter_name .
  220. Use the
  221. .Op -filters
  222. option to get a list of all filters.
  223. .Pp
  224. .It bsf= Va bitstream_filter_name
  225. Print detailed information about the bitstream filter named
  226. .Va bitstream_filter_name .
  227. Use the
  228. .Op -bsfs
  229. option to get a list of all bitstream filters.
  230. .Pp
  231. .It protocol= Va protocol_name
  232. Print detailed information about the protocol named
  233. .Va protocol_name .
  234. Use the
  235. .Op -protocols
  236. option to get a list of all protocols.
  237. .El
  238. .Pp
  239. .It -version
  240. Show version.
  241. .Pp
  242. .It -buildconf
  243. Show the build configuration, one option per line.
  244. .Pp
  245. .It -formats
  246. Show available formats (including devices).
  247. .Pp
  248. .It -demuxers
  249. Show available demuxers.
  250. .Pp
  251. .It -muxers
  252. Show available muxers.
  253. .Pp
  254. .It -devices
  255. Show available devices.
  256. .Pp
  257. .It -codecs
  258. Show all codecs known to libavcodec.
  259. .Pp
  260. Note that the term 'codec' is used throughout this documentation as a shortcut
  261. for what is more correctly called a media bitstream format.
  262. .Pp
  263. .It -decoders
  264. Show available decoders.
  265. .Pp
  266. .It -encoders
  267. Show all available encoders.
  268. .Pp
  269. .It -bsfs
  270. Show available bitstream filters.
  271. .Pp
  272. .It -protocols
  273. Show available protocols.
  274. .Pp
  275. .It -filters
  276. Show available libavfilter filters.
  277. .Pp
  278. .It -pix_fmts
  279. Show available pixel formats.
  280. .Pp
  281. .It -sample_fmts
  282. Show available sample formats.
  283. .Pp
  284. .It -layouts
  285. Show channel names and standard channel layouts.
  286. .Pp
  287. .It -dispositions
  288. Show stream dispositions.
  289. .Pp
  290. .It -colors
  291. Show recognized color names.
  292. .Pp
  293. .It -sources Va device[, Va opt1= Va val1[, Va opt2= Va val2]...]
  294. Show autodetected sources of the input device. Some devices may provide system-dependent
  295. source names that cannot be autodetected. The returned list cannot be assumed
  296. to be always complete.
  297. .Bd -literal -offset indent
  298. ffmpeg -sources pulse,server=192.168.0.4
  299. .Ed
  300. .Pp
  301. .It -sinks Va device[, Va opt1= Va val1[, Va opt2= Va val2]...]
  302. Show autodetected sinks of the output device. Some devices may provide system-dependent
  303. sink names that cannot be autodetected. The returned list cannot be assumed
  304. to be always complete.
  305. .Bd -literal -offset indent
  306. ffmpeg -sinks pulse,server=192.168.0.4
  307. .Ed
  308. .Pp
  309. .It -loglevel [ Va flags+] Va loglevel | -v [ Va flags+] Va loglevel
  310. Set logging level and flags used by the library.
  311. .Pp
  312. The optional
  313. .Va flags
  314. prefix can consist of the following values:
  315. .Bl -tag -width Ds
  316. .It repeat
  317. Indicates that repeated log output should not be compressed to the first line
  318. and the "Last message repeated n times" line will be omitted.
  319. .It level
  320. Indicates that log output should add a
  321. .Li [level]
  322. prefix to each message line. This can be used as an alternative to log coloring,
  323. e.g. when dumping the log to file.
  324. .El
  325. Flags can also be used alone by adding a '+'/'-' prefix to set/reset a single
  326. flag without affecting other
  327. .Va flags
  328. or changing
  329. .Va loglevel .
  330. When setting both
  331. .Va flags
  332. and
  333. .Va loglevel ,
  334. a '+' separator is expected between the last
  335. .Va flags
  336. value and before
  337. .Va loglevel .
  338. .Pp
  339. .Va loglevel
  340. is a string or a number containing one of the following values:
  341. .Bl -tag -width Ds
  342. .It quiet, -8
  343. Show nothing at all; be silent.
  344. .It panic, 0
  345. Only show fatal errors which could lead the process to crash, such as an assertion
  346. failure. This is not currently used for anything.
  347. .It fatal, 8
  348. Only show fatal errors. These are errors after which the process absolutely
  349. cannot continue.
  350. .It error, 16
  351. Show all errors, including ones which can be recovered from.
  352. .It warning, 24
  353. Show all warnings and errors. Any message related to possibly incorrect or
  354. unexpected events will be shown.
  355. .It info, 32
  356. Show informative messages during processing. This is in addition to warnings
  357. and errors. This is the default value.
  358. .It verbose, 40
  359. Same as
  360. .Li info ,
  361. except more verbose.
  362. .It debug, 48
  363. Show everything, including debugging information.
  364. .It trace, 56
  365. .El
  366. .Pp
  367. For example to enable repeated log output, add the
  368. .Li level
  369. prefix, and set
  370. .Va loglevel
  371. to
  372. .Li verbose :
  373. .Bd -literal -offset indent
  374. ffmpeg -loglevel repeat+level+verbose -i input output
  375. .Ed
  376. Another example that enables repeated log output without affecting current
  377. state of
  378. .Li level
  379. prefix flag or
  380. .Va loglevel :
  381. .Bd -literal -offset indent
  382. ffmpeg [...] -loglevel +repeat
  383. .Ed
  384. .Pp
  385. By default the program logs to stderr. If coloring is supported by the terminal,
  386. colors are used to mark errors and warnings. Log coloring can be disabled
  387. setting the environment variable
  388. .Ev AV_LOG_FORCE_NOCOLOR ,
  389. or can be forced setting the environment variable
  390. .Ev AV_LOG_FORCE_COLOR .
  391. .Pp
  392. .It -report
  393. Dump full command line and log output to a file named
  394. .Li Va program- Va YYYYMMDD- Va HHMMSS.log
  395. in the current directory. This file can be useful for bug reports. It also
  396. implies
  397. .Li -loglevel debug .
  398. .Pp
  399. Setting the environment variable
  400. .Ev FFREPORT
  401. to any value has the same effect. If the value is a ':'-separated key=value
  402. sequence, these options will affect the report; option values must be escaped
  403. if they contain special characters or the options delimiter ':' (see the \(lqQuoting
  404. and escaping\(rq section in the ffmpeg-utils manual).
  405. .Pp
  406. The following options are recognized:
  407. .Bl -tag -width Ds
  408. .It file
  409. set the file name to use for the report;
  410. .Li %p
  411. is expanded to the name of the program,
  412. .Li %t
  413. is expanded to a timestamp,
  414. .Li %%
  415. is expanded to a plain
  416. .Li %
  417. .It level
  418. set the log verbosity level using a numerical value (see
  419. .Li -loglevel ) .
  420. .El
  421. .Pp
  422. For example, to output a report to a file named
  423. .Pa ffreport.log
  424. using a log level of
  425. .Li 32
  426. (alias for log level
  427. .Li info ) :
  428. .Pp
  429. .Bd -literal -offset indent
  430. FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
  431. .Ed
  432. .Pp
  433. Errors in parsing the environment variable are not fatal, and will not appear
  434. in the report.
  435. .Pp
  436. .It -hide_banner
  437. Suppress printing banner.
  438. .Pp
  439. All FFmpeg tools will normally show a copyright notice, build options and
  440. library versions. This option can be used to suppress printing this information.
  441. .Pp
  442. .It -cpuflags flags ( Em global)
  443. Allows setting and clearing cpu flags. This option is intended for testing.
  444. Do not use it unless you know what you're doing.
  445. .Bd -literal -offset indent
  446. ffmpeg -cpuflags -sse+mmx ...
  447. ffmpeg -cpuflags mmx ...
  448. ffmpeg -cpuflags 0 ...
  449. .Ed
  450. Possible flags for this option are:
  451. .Bl -tag -width Ds
  452. .It x86
  453. .Bl -tag -width Ds
  454. .It mmx
  455. .It mmxext
  456. .It sse
  457. .It sse2
  458. .It sse2slow
  459. .It sse3
  460. .It sse3slow
  461. .It ssse3
  462. .It atom
  463. .It sse4.1
  464. .It sse4.2
  465. .It avx
  466. .It avx2
  467. .It xop
  468. .It fma3
  469. .It fma4
  470. .It 3dnow
  471. .It 3dnowext
  472. .It bmi1
  473. .It bmi2
  474. .It cmov
  475. .El
  476. .It ARM
  477. .Bl -tag -width Ds
  478. .It armv5te
  479. .It armv6
  480. .It armv6t2
  481. .It vfp
  482. .It vfpv3
  483. .It neon
  484. .It setend
  485. .El
  486. .It AArch64
  487. .Bl -tag -width Ds
  488. .It armv8
  489. .It vfp
  490. .It neon
  491. .El
  492. .It PowerPC
  493. .Bl -tag -width Ds
  494. .It altivec
  495. .El
  496. .It Specific Processors
  497. .Bl -tag -width Ds
  498. .It pentium2
  499. .It pentium3
  500. .It pentium4
  501. .It k6
  502. .It k62
  503. .It athlon
  504. .It athlonxp
  505. .It k8
  506. .El
  507. .El
  508. .Pp
  509. .It -cpucount Va count ( Em global)
  510. Override detection of CPU count. This option is intended for testing. Do not
  511. use it unless you know what you're doing.
  512. .Bd -literal -offset indent
  513. ffmpeg -cpucount 2
  514. .Ed
  515. .Pp
  516. .It -max_alloc Va bytes
  517. Set the maximum size limit for allocating a block on the heap by ffmpeg's
  518. family of malloc functions. Exercise
  519. .Sy extreme caution
  520. when using this option. Don't use if you do not understand the full consequence
  521. of doing so. Default is INT_MAX.
  522. .El
  523. .Pp
  524. .Ss AVOptions
  525. These options are provided directly by the libavformat, libavdevice and libavcodec
  526. libraries. To see the list of available AVOptions, use the
  527. .Op -help
  528. option. They are separated into two categories:
  529. .Bl -tag -width Ds
  530. .It generic
  531. These options can be set for any container, codec or device. Generic options
  532. are listed under AVFormatContext options for containers/devices and under
  533. AVCodecContext options for codecs.
  534. .It private
  535. These options are specific to the given container, device or codec. Private
  536. options are listed under their corresponding containers/devices/codecs.
  537. .El
  538. .Pp
  539. For example to write an ID3v2.3 header instead of a default ID3v2.4 to an
  540. MP3 file, use the
  541. .Op id3v2_version
  542. private option of the MP3 muxer:
  543. .Bd -literal -offset indent
  544. ffmpeg -i input.flac -id3v2_version 3 out.mp3
  545. .Ed
  546. .Pp
  547. All codec AVOptions are per-stream, and thus a stream specifier should be
  548. attached to them:
  549. .Bd -literal -offset indent
  550. ffmpeg -i multichannel.mxf -map 0:v:0 -map 0:a:0 -map 0:a:0 -c:a:0 ac3 -b:a:0 640k -ac:a:1 2 -c:a:1 aac -b:2 128k out.mp4
  551. .Ed
  552. .Pp
  553. In the above example, a multichannel audio stream is mapped twice for output.
  554. The first instance is encoded with codec ac3 and bitrate 640k. The second
  555. instance is downmixed to 2 channels and encoded with codec aac. A bitrate
  556. of 128k is specified for it using absolute index of the output stream.
  557. .Pp
  558. Note: the
  559. .Op -nooption
  560. syntax cannot be used for boolean AVOptions, use
  561. .Op -option 0
  562. /
  563. .Op -option 1 .
  564. .Pp
  565. Note: the old undocumented way of specifying per-stream AVOptions by prepending
  566. v/a/s to the options name is now obsolete and will be removed soon.
  567. .Pp
  568. .Ss Main options
  569. .Bl -tag -width Ds
  570. .It -f Va format
  571. Force format to use.
  572. .Pp
  573. .It -unit
  574. Show the unit of the displayed values.
  575. .Pp
  576. .It -prefix
  577. Use SI prefixes for the displayed values. Unless the "-byte_binary_prefix"
  578. option is used all the prefixes are decimal.
  579. .Pp
  580. .It -byte_binary_prefix
  581. Force the use of binary prefixes for byte values.
  582. .Pp
  583. .It -sexagesimal
  584. Use sexagesimal format HH:MM:SS.MICROSECONDS for time values.
  585. .Pp
  586. .It -pretty
  587. Prettify the format of the displayed values, it corresponds to the options
  588. "-unit -prefix -byte_binary_prefix -sexagesimal".
  589. .Pp
  590. .It -output_format, -of, -print_format Va writer_name[= Va writer_options]
  591. Set the output printing format.
  592. .Pp
  593. .Va writer_name
  594. specifies the name of the writer, and
  595. .Va writer_options
  596. specifies the options to be passed to the writer.
  597. .Pp
  598. For example for printing the output in JSON format, specify:
  599. .Bd -literal -offset indent
  600. -output_format json
  601. .Ed
  602. .Pp
  603. For more details on the available output printing formats, see the Writers
  604. section below.
  605. .Pp
  606. .It -sections
  607. Print sections structure and section information, and exit. The output is
  608. not meant to be parsed by a machine.
  609. .Pp
  610. .It -select_streams Va stream_specifier
  611. Select only the streams specified by
  612. .Va stream_specifier .
  613. This option affects only the options related to streams (e.g.
  614. .Li show_streams ,
  615. .Li show_packets ,
  616. etc.).
  617. .Pp
  618. For example to show only audio streams, you can use the command:
  619. .Bd -literal -offset indent
  620. ffprobe -show_streams -select_streams a INPUT
  621. .Ed
  622. .Pp
  623. To show only video packets belonging to the video stream with index 1:
  624. .Bd -literal -offset indent
  625. ffprobe -show_packets -select_streams v:1 INPUT
  626. .Ed
  627. .Pp
  628. .It -show_data
  629. Show payload data, as a hexadecimal and ASCII dump. Coupled with
  630. .Op -show_packets ,
  631. it will dump the packets' data. Coupled with
  632. .Op -show_streams ,
  633. it will dump the codec extradata.
  634. .Pp
  635. The dump is printed as the "data" field. It may contain newlines.
  636. .Pp
  637. .It -show_data_hash Va algorithm
  638. Show a hash of payload data, for packets with
  639. .Op -show_packets
  640. and for codec extradata with
  641. .Op -show_streams .
  642. .Pp
  643. .It -show_error
  644. Show information about the error found when trying to probe the input.
  645. .Pp
  646. The error information is printed within a section with name "ERROR".
  647. .Pp
  648. .It -show_format
  649. Show information about the container format of the input multimedia stream.
  650. .Pp
  651. All the container format information is printed within a section with name
  652. "FORMAT".
  653. .Pp
  654. .It -show_format_entry Va name
  655. Like
  656. .Op -show_format ,
  657. but only prints the specified entry of the container format information, rather
  658. than all. This option may be given more than once, then all specified entries
  659. will be shown.
  660. .Pp
  661. This option is deprecated, use
  662. .Li show_entries
  663. instead.
  664. .Pp
  665. .It -show_entries Va section_entries
  666. Set list of entries to show.
  667. .Pp
  668. Entries are specified according to the following syntax.
  669. .Va section_entries
  670. contains a list of section entries separated by
  671. .Li : .
  672. Each section entry is composed by a section name (or unique name), optionally
  673. followed by a list of entries local to that section, separated by
  674. .Li , .
  675. .Pp
  676. If section name is specified but is followed by no
  677. .Li = ,
  678. all entries are printed to output, together with all the contained sections.
  679. Otherwise only the entries specified in the local section entries list are
  680. printed. In particular, if
  681. .Li =
  682. is specified but the list of local entries is empty, then no entries will
  683. be shown for that section.
  684. .Pp
  685. Note that the order of specification of the local section entries is not honored
  686. in the output, and the usual display order will be retained.
  687. .Pp
  688. The formal syntax is given by:
  689. .Bd -literal -offset indent
  690. LOCAL_SECTION_ENTRIES ::= SECTION_ENTRY_NAME[,LOCAL_SECTION_ENTRIES]
  691. SECTION_ENTRY ::= SECTION_NAME[=[LOCAL_SECTION_ENTRIES]]
  692. SECTION_ENTRIES ::= SECTION_ENTRY[:SECTION_ENTRIES]
  693. .Ed
  694. .Pp
  695. For example, to show only the index and type of each stream, and the PTS time,
  696. duration time, and stream index of the packets, you can specify the argument:
  697. .Bd -literal -offset indent
  698. packet=pts_time,duration_time,stream_index : stream=index,codec_type
  699. .Ed
  700. .Pp
  701. To show all the entries in the section "format", but only the codec type in
  702. the section "stream", specify the argument:
  703. .Bd -literal -offset indent
  704. format : stream=codec_type
  705. .Ed
  706. .Pp
  707. To show all the tags in the stream and format sections:
  708. .Bd -literal -offset indent
  709. stream_tags : format_tags
  710. .Ed
  711. .Pp
  712. To show only the
  713. .Li title
  714. tag (if available) in the stream sections:
  715. .Bd -literal -offset indent
  716. stream_tags=title
  717. .Ed
  718. .Pp
  719. .It -show_packets
  720. Show information about each packet contained in the input multimedia stream.
  721. .Pp
  722. The information for each single packet is printed within a dedicated section
  723. with name "PACKET".
  724. .Pp
  725. .It -show_frames
  726. Show information about each frame and subtitle contained in the input multimedia
  727. stream.
  728. .Pp
  729. The information for each single frame is printed within a dedicated section
  730. with name "FRAME" or "SUBTITLE".
  731. .Pp
  732. .It -show_log Va loglevel
  733. Show logging information from the decoder about each frame according to the
  734. value set in
  735. .Va loglevel ,
  736. (see
  737. .Li -loglevel ) .
  738. This option requires
  739. .Li -show_frames .
  740. .Pp
  741. The information for each log message is printed within a dedicated section
  742. with name "LOG".
  743. .Pp
  744. .It -show_streams
  745. Show information about each media stream contained in the input multimedia
  746. stream.
  747. .Pp
  748. Each media stream information is printed within a dedicated section with name
  749. "STREAM".
  750. .Pp
  751. .It -show_programs
  752. Show information about programs and their streams contained in the input multimedia
  753. stream.
  754. .Pp
  755. Each media stream information is printed within a dedicated section with name
  756. "PROGRAM_STREAM".
  757. .Pp
  758. .It -show_stream_groups
  759. Show information about stream groups and their streams contained in the input
  760. multimedia stream.
  761. .Pp
  762. Each media stream information is printed within a dedicated section with name
  763. "STREAM_GROUP_STREAM".
  764. .Pp
  765. .It -show_chapters
  766. Show information about chapters stored in the format.
  767. .Pp
  768. Each chapter is printed within a dedicated section with name "CHAPTER".
  769. .Pp
  770. .It -count_frames
  771. Count the number of frames per stream and report it in the corresponding stream
  772. section.
  773. .Pp
  774. .It -count_packets
  775. Count the number of packets per stream and report it in the corresponding
  776. stream section.
  777. .Pp
  778. .It -read_intervals Va read_intervals
  779. .Pp
  780. Read only the specified intervals.
  781. .Va read_intervals
  782. must be a sequence of interval specifications separated by ",".
  783. .Xr ffprobe
  784. will seek to the interval starting point, and will continue reading from that.
  785. .Pp
  786. Each interval is specified by two optional parts, separated by "%".
  787. .Pp
  788. The first part specifies the interval start position. It is interpreted as
  789. an absolute position, or as a relative offset from the current position if
  790. it is preceded by the "+" character. If this first part is not specified,
  791. no seeking will be performed when reading this interval.
  792. .Pp
  793. The second part specifies the interval end position. It is interpreted as
  794. an absolute position, or as a relative offset from the current position if
  795. it is preceded by the "+" character. If the offset specification starts with
  796. "#", it is interpreted as the number of packets to read (not including the
  797. flushing packets) from the interval start. If no second part is specified,
  798. the program will read until the end of the input.
  799. .Pp
  800. Note that seeking is not accurate, thus the actual interval start point may
  801. be different from the specified position. Also, when an interval duration
  802. is specified, the absolute end time will be computed by adding the duration
  803. to the interval start point found by seeking the file, rather than to the
  804. specified start value.
  805. .Pp
  806. The formal syntax is given by:
  807. .Bd -literal -offset indent
  808. INTERVAL ::= [START|+START_OFFSET][%[END|+END_OFFSET]]
  809. INTERVALS ::= INTERVAL[,INTERVALS]
  810. .Ed
  811. .Pp
  812. A few examples follow.
  813. .Bl -bullet
  814. .It
  815. Seek to time 10, read packets until 20 seconds after the found seek point,
  816. then seek to position
  817. .Li 01:30
  818. (1 minute and thirty seconds) and read packets until position
  819. .Li 01:45 .
  820. .Bd -literal -offset indent
  821. 10%+20,01:30%01:45
  822. .Ed
  823. .Pp
  824. .It
  825. Read only 42 packets after seeking to position
  826. .Li 01:23 :
  827. .Bd -literal -offset indent
  828. 01:23%+#42
  829. .Ed
  830. .Pp
  831. .It
  832. Read only the first 20 seconds from the start:
  833. .Bd -literal -offset indent
  834. %+20
  835. .Ed
  836. .Pp
  837. .It
  838. Read from the start until position
  839. .Li 02:30 :
  840. .Bd -literal -offset indent
  841. %02:30
  842. .Ed
  843. .El
  844. .Pp
  845. .It -show_private_data, -private
  846. Show private data, that is data depending on the format of the particular
  847. shown element. This option is enabled by default, but you may need to disable
  848. it for specific uses, for example when creating XSD-compliant XML output.
  849. .Pp
  850. .It -show_program_version
  851. Show information related to program version.
  852. .Pp
  853. Version information is printed within a section with name "PROGRAM_VERSION".
  854. .Pp
  855. .It -show_library_versions
  856. Show information related to library versions.
  857. .Pp
  858. Version information for each library is printed within a section with name
  859. "LIBRARY_VERSION".
  860. .Pp
  861. .It -show_versions
  862. Show information related to program and library versions. This is the equivalent
  863. of setting both
  864. .Op -show_program_version
  865. and
  866. .Op -show_library_versions
  867. options.
  868. .Pp
  869. .It -show_pixel_formats
  870. Show information about all pixel formats supported by FFmpeg.
  871. .Pp
  872. Pixel format information for each format is printed within a section with
  873. name "PIXEL_FORMAT".
  874. .Pp
  875. .It -show_optional_fields Va value
  876. Some writers viz. JSON and XML, omit the printing of fields with invalid or
  877. non-applicable values, while other writers always print them. This option
  878. enables one to control this behaviour. Valid values are
  879. .Li always
  880. /
  881. .Li 1 ,
  882. .Li never
  883. /
  884. .Li 0
  885. and
  886. .Li auto
  887. /
  888. .Li -1 .
  889. Default is
  890. .Va auto .
  891. .Pp
  892. .It -bitexact
  893. Force bitexact output, useful to produce output which is not dependent on
  894. the specific build.
  895. .Pp
  896. .It -i Va input_url
  897. Read
  898. .Va input_url .
  899. .Pp
  900. .It -o Va output_url
  901. Write output to
  902. .Va output_url .
  903. If not specified, the output is sent to stdout.
  904. .Pp
  905. .El
  906. .Sh Writers
  907. A writer defines the output format adopted by
  908. .Xr ffprobe ,
  909. and will be used for printing all the parts of the output.
  910. .Pp
  911. A writer may accept one or more arguments, which specify the options to adopt.
  912. The options are specified as a list of
  913. .Va key
  914. =
  915. .Va value
  916. pairs, separated by ":".
  917. .Pp
  918. All writers support the following options:
  919. .Pp
  920. .Bl -tag -width Ds
  921. .It string_validation, sv
  922. Set string validation mode.
  923. .Pp
  924. The following values are accepted.
  925. .Bl -tag -width Ds
  926. .It fail
  927. The writer will fail immediately in case an invalid string (UTF-8) sequence
  928. or code point is found in the input. This is especially useful to validate
  929. input metadata.
  930. .Pp
  931. .It ignore
  932. Any validation error will be ignored. This will result in possibly broken
  933. output, especially with the json or xml writer.
  934. .Pp
  935. .It replace
  936. The writer will substitute invalid UTF-8 sequences or code points with the
  937. string specified with the
  938. .Op string_validation_replacement .
  939. .El
  940. .Pp
  941. Default value is
  942. .Li replace .
  943. .Pp
  944. .It string_validation_replacement, svr
  945. Set replacement string to use in case
  946. .Op string_validation
  947. is set to
  948. .Li replace .
  949. .Pp
  950. In case the option is not specified, the writer will assume the empty string,
  951. that is it will remove the invalid sequences from the input strings.
  952. .El
  953. .Pp
  954. A description of the currently available writers follows.
  955. .Pp
  956. .Ss default
  957. Default format.
  958. .Pp
  959. Print each section in the form:
  960. .Bd -literal -offset indent
  961. [SECTION]
  962. key1=val1
  963. \&...
  964. keyN=valN
  965. [/SECTION]
  966. .Ed
  967. .Pp
  968. Metadata tags are printed as a line in the corresponding FORMAT, STREAM, STREAM_GROUP_STREAM
  969. or PROGRAM_STREAM section, and are prefixed by the string "TAG:".
  970. .Pp
  971. A description of the accepted options follows.
  972. .Pp
  973. .Bl -tag -width Ds
  974. .It nokey, nk
  975. If set to 1 specify not to print the key of each field. Default value is 0.
  976. .Pp
  977. .It noprint_wrappers, nw
  978. If set to 1 specify not to print the section header and footer. Default value
  979. is 0.
  980. .El
  981. .Pp
  982. .Ss compact, csv
  983. Compact and CSV format.
  984. .Pp
  985. The
  986. .Li csv
  987. writer is equivalent to
  988. .Li compact ,
  989. but supports different defaults.
  990. .Pp
  991. Each section is printed on a single line. If no option is specified, the output
  992. has the form:
  993. .Bd -literal -offset indent
  994. section|key1=val1| ... |keyN=valN
  995. .Ed
  996. .Pp
  997. Metadata tags are printed in the corresponding "format" or "stream" section.
  998. A metadata tag key, if printed, is prefixed by the string "tag:".
  999. .Pp
  1000. The description of the accepted options follows.
  1001. .Pp
  1002. .Bl -tag -width Ds
  1003. .It item_sep, s
  1004. Specify the character to use for separating fields in the output line. It
  1005. must be a single printable character, it is "|" by default ("," for the
  1006. .Li csv
  1007. writer).
  1008. .Pp
  1009. .It nokey, nk
  1010. If set to 1 specify not to print the key of each field. Its default value
  1011. is 0 (1 for the
  1012. .Li csv
  1013. writer).
  1014. .Pp
  1015. .It escape, e
  1016. Set the escape mode to use, default to "c" ("csv" for the
  1017. .Li csv
  1018. writer).
  1019. .Pp
  1020. It can assume one of the following values:
  1021. .Bl -tag -width Ds
  1022. .It c
  1023. Perform C-like escaping. Strings containing a newline (
  1024. .Li \en ) ,
  1025. carriage return (
  1026. .Li \er ) ,
  1027. a tab (
  1028. .Li \et ) ,
  1029. a form feed (
  1030. .Li \ef ) ,
  1031. the escaping character (
  1032. .Li \e )
  1033. or the item separator character
  1034. .Va SEP
  1035. are escaped using C-like fashioned escaping, so that a newline is converted
  1036. to the sequence
  1037. .Li \en ,
  1038. a carriage return to
  1039. .Li \er ,
  1040. .Li \e
  1041. to
  1042. .Li \e\e
  1043. and the separator
  1044. .Va SEP
  1045. is converted to
  1046. .Li \e Va SEP .
  1047. .Pp
  1048. .It csv
  1049. Perform CSV-like escaping, as described in RFC4180. Strings containing a newline
  1050. (
  1051. .Li \en ) ,
  1052. a carriage return (
  1053. .Li \er ) ,
  1054. a double quote (
  1055. .Li " ) ,
  1056. or
  1057. .Va SEP
  1058. are enclosed in double-quotes.
  1059. .Pp
  1060. .It none
  1061. Perform no escaping.
  1062. .El
  1063. .Pp
  1064. .It print_section, p
  1065. Print the section name at the beginning of each line if the value is
  1066. .Li 1 ,
  1067. disable it with value set to
  1068. .Li 0 .
  1069. Default value is
  1070. .Li 1 .
  1071. .Pp
  1072. .El
  1073. .Ss flat
  1074. Flat format.
  1075. .Pp
  1076. A free-form output where each line contains an explicit key=value, such as
  1077. "streams.stream.3.tags.foo=bar". The output is shell escaped, so it can be
  1078. directly embedded in sh scripts as long as the separator character is an alphanumeric
  1079. character or an underscore (see
  1080. .Va sep_char
  1081. option).
  1082. .Pp
  1083. The description of the accepted options follows.
  1084. .Pp
  1085. .Bl -tag -width Ds
  1086. .It sep_char, s
  1087. Separator character used to separate the chapter, the section name, IDs and
  1088. potential tags in the printed field key.
  1089. .Pp
  1090. Default value is
  1091. .Li . .
  1092. .Pp
  1093. .It hierarchical, h
  1094. Specify if the section name specification should be hierarchical. If set to
  1095. 1, and if there is more than one section in the current chapter, the section
  1096. name will be prefixed by the name of the chapter. A value of 0 will disable
  1097. this behavior.
  1098. .Pp
  1099. Default value is 1.
  1100. .El
  1101. .Pp
  1102. .Ss ini
  1103. INI format output.
  1104. .Pp
  1105. Print output in an INI based format.
  1106. .Pp
  1107. The following conventions are adopted:
  1108. .Pp
  1109. .Bl -bullet
  1110. .It
  1111. all key and values are UTF-8
  1112. .It
  1113. .Li .
  1114. is the subgroup separator
  1115. .It
  1116. newline,
  1117. .Li \et ,
  1118. .Li \ef ,
  1119. .Li \eb
  1120. and the following characters are escaped
  1121. .It
  1122. .Li \e
  1123. is the escape character
  1124. .It
  1125. .Li #
  1126. is the comment indicator
  1127. .It
  1128. .Li =
  1129. is the key/value separator
  1130. .It
  1131. .Li :
  1132. is not used but usually parsed as key/value separator
  1133. .El
  1134. .Pp
  1135. This writer accepts options as a list of
  1136. .Va key
  1137. =
  1138. .Va value
  1139. pairs, separated by
  1140. .Li : .
  1141. .Pp
  1142. The description of the accepted options follows.
  1143. .Pp
  1144. .Bl -tag -width Ds
  1145. .It hierarchical, h
  1146. Specify if the section name specification should be hierarchical. If set to
  1147. 1, and if there is more than one section in the current chapter, the section
  1148. name will be prefixed by the name of the chapter. A value of 0 will disable
  1149. this behavior.
  1150. .Pp
  1151. Default value is 1.
  1152. .El
  1153. .Pp
  1154. .Ss json
  1155. JSON based format.
  1156. .Pp
  1157. Each section is printed using JSON notation.
  1158. .Pp
  1159. The description of the accepted options follows.
  1160. .Pp
  1161. .Bl -tag -width Ds
  1162. .It compact, c
  1163. If set to 1 enable compact output, that is each section will be printed on
  1164. a single line. Default value is 0.
  1165. .El
  1166. .Pp
  1167. For more information about JSON, see
  1168. .Lk http://www.json.org/ .
  1169. .Pp
  1170. .Ss xml
  1171. XML based format.
  1172. .Pp
  1173. The XML output is described in the XML schema description file
  1174. .Pa ffprobe.xsd
  1175. installed in the FFmpeg datadir.
  1176. .Pp
  1177. An updated version of the schema can be retrieved at the url
  1178. .Lk http://www.ffmpeg.org/schema/ffprobe.xsd ,
  1179. which redirects to the latest schema committed into the FFmpeg development
  1180. source code tree.
  1181. .Pp
  1182. Note that the output issued will be compliant to the
  1183. .Pa ffprobe.xsd
  1184. schema only when no special global output options (
  1185. .Op unit ,
  1186. .Op prefix ,
  1187. .Op byte_binary_prefix ,
  1188. .Op sexagesimal
  1189. etc.) are specified.
  1190. .Pp
  1191. The description of the accepted options follows.
  1192. .Pp
  1193. .Bl -tag -width Ds
  1194. .It fully_qualified, q
  1195. If set to 1 specify if the output should be fully qualified. Default value
  1196. is 0. This is required for generating an XML file which can be validated through
  1197. an XSD file.
  1198. .Pp
  1199. .It xsd_strict, x
  1200. If set to 1 perform more checks for ensuring that the output is XSD compliant.
  1201. Default value is 0. This option automatically sets
  1202. .Op fully_qualified
  1203. to 1.
  1204. .El
  1205. .Pp
  1206. For more information about the XML format, see
  1207. .Lk https://www.w3.org/XML/ .
  1208. .Pp
  1209. .Sh Timecode
  1210. .Xr ffprobe
  1211. supports Timecode extraction:
  1212. .Pp
  1213. .Bl -bullet
  1214. .It
  1215. MPEG1/2 timecode is extracted from the GOP, and is available in the video
  1216. stream details (
  1217. .Op -show_streams ,
  1218. see
  1219. .Va timecode ) .
  1220. .Pp
  1221. .It
  1222. MOV timecode is extracted from tmcd track, so is available in the tmcd stream
  1223. metadata (
  1224. .Op -show_streams ,
  1225. see
  1226. .Va TAG:timecode ) .
  1227. .Pp
  1228. .It
  1229. DV, GXF and AVI timecodes are available in format metadata (
  1230. .Op -show_format ,
  1231. see
  1232. .Va TAG:timecode ) .
  1233. .Pp
  1234. .El
  1235. .Sh See Also
  1236. ffmpeg(1), ffplay(1), ffmpeg-utils(1), ffmpeg-scaler(1), ffmpeg-resampler(1),
  1237. ffmpeg-codecs(1), ffmpeg-bitstream-filters(1), ffmpeg-formats(1), ffmpeg-devices(1),
  1238. ffmpeg-protocols(1), ffmpeg-filters(1)
  1239. .Pp
  1240. .Sh Authors
  1241. The FFmpeg developers.
  1242. .Pp
  1243. For details about the authorship, see the Git history of the project (https://git.ffmpeg.org/ffmpeg),
  1244. e.g. by typing the command
  1245. .Xr git log
  1246. in the FFmpeg source directory, or browsing the online repository at
  1247. .Lk https://git.ffmpeg.org/ffmpeg .
  1248. .Pp
  1249. Maintainers for the specific components are listed in the file
  1250. .Pa MAINTAINERS
  1251. in the source code tree.
  1252. .Pp