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