]> git.sesse.net Git - ffmpeg/blob - doc/formats.texi
Merge commit 'b34257eefd98cb768ea2f53a390b8684d51e689a'
[ffmpeg] / doc / formats.texi
1 @chapter Format Options
2 @c man begin FORMAT OPTIONS
3
4 The libavformat library provides some generic global options, which
5 can be set on all the muxers and demuxers. In addition each muxer or
6 demuxer may support so-called private options, which are specific for
7 that component.
8
9 Options may be set by specifying -@var{option} @var{value} in the
10 FFmpeg tools, or by setting the value explicitly in the
11 @code{AVFormatContext} options or using the @file{libavutil/opt.h} API
12 for programmatic use.
13
14 The list of supported options follows:
15
16 @table @option
17 @item avioflags @var{flags} (@emph{input/output})
18 Possible values:
19 @table @samp
20 @item direct
21 Reduce buffering.
22 @end table
23
24 @item probesize @var{integer} (@emph{input})
25 Set probing size in bytes, i.e. the size of the data to analyze to get
26 stream information. A higher value will enable detecting more
27 information in case it is dispersed into the stream, but will increase
28 latency. Must be an integer not lesser than 32. It is 5000000 by default.
29
30 @item packetsize @var{integer} (@emph{output})
31 Set packet size.
32
33 @item fflags @var{flags} (@emph{input/output})
34 Set format flags.
35
36 Possible values:
37 @table @samp
38 @item ignidx
39 Ignore index.
40 @item fastseek
41 Enable fast, but inaccurate seeks for some formats.
42 @item genpts
43 Generate PTS.
44 @item nofillin
45 Do not fill in missing values that can be exactly calculated.
46 @item noparse
47 Disable AVParsers, this needs @code{+nofillin} too.
48 @item igndts
49 Ignore DTS.
50 @item discardcorrupt
51 Discard corrupted frames.
52 @item sortdts
53 Try to interleave output packets by DTS.
54 @item keepside
55 Do not merge side data.
56 @item latm
57 Enable RTP MP4A-LATM payload.
58 @item nobuffer
59 Reduce the latency introduced by optional buffering
60 @item bitexact
61 Only write platform-, build- and time-independent data.
62 This ensures that file and data checksums are reproducible and match between
63 platforms. Its primary use is for regression testing.
64 @end table
65
66 @item seek2any @var{integer} (@emph{input})
67 Allow seeking to non-keyframes on demuxer level when supported if set to 1.
68 Default is 0.
69
70 @item analyzeduration @var{integer} (@emph{input})
71 Specify how many microseconds are analyzed to probe the input. A
72 higher value will enable detecting more accurate information, but will
73 increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
74
75 @item cryptokey @var{hexadecimal string} (@emph{input})
76 Set decryption key.
77
78 @item indexmem @var{integer} (@emph{input})
79 Set max memory used for timestamp index (per stream).
80
81 @item rtbufsize @var{integer} (@emph{input})
82 Set max memory used for buffering real-time frames.
83
84 @item fdebug @var{flags} (@emph{input/output})
85 Print specific debug info.
86
87 Possible values:
88 @table @samp
89 @item ts
90 @end table
91
92 @item max_delay @var{integer} (@emph{input/output})
93 Set maximum muxing or demuxing delay in microseconds.
94
95 @item fpsprobesize @var{integer} (@emph{input})
96 Set number of frames used to probe fps.
97
98 @item audio_preload @var{integer} (@emph{output})
99 Set microseconds by which audio packets should be interleaved earlier.
100
101 @item chunk_duration @var{integer} (@emph{output})
102 Set microseconds for each chunk.
103
104 @item chunk_size @var{integer} (@emph{output})
105 Set size in bytes for each chunk.
106
107 @item err_detect, f_err_detect @var{flags} (@emph{input})
108 Set error detection flags. @code{f_err_detect} is deprecated and
109 should be used only via the @command{ffmpeg} tool.
110
111 Possible values:
112 @table @samp
113 @item crccheck
114 Verify embedded CRCs.
115 @item bitstream
116 Detect bitstream specification deviations.
117 @item buffer
118 Detect improper bitstream length.
119 @item explode
120 Abort decoding on minor error detection.
121 @item careful
122 Consider things that violate the spec and have not been seen in the
123 wild as errors.
124 @item compliant
125 Consider all spec non compliancies as errors.
126 @item aggressive
127 Consider things that a sane encoder should not do as an error.
128 @end table
129
130 @item use_wallclock_as_timestamps @var{integer} (@emph{input})
131 Use wallclock as timestamps.
132
133 @item avoid_negative_ts @var{integer} (@emph{output})
134
135 Possible values:
136 @table @samp
137 @item make_non_negative
138 Shift timestamps to make them non-negative.
139 Also note that this affects only leading negative timestamps, and not
140 non-monotonic negative timestamps.
141 @item make_zero
142 Shift timestamps so that the first timestamp is 0.
143 @item auto (default)
144 Enables shifting when required by the target format.
145 @item disabled
146 Disables shifting of timestamp.
147 @end table
148
149 When shifting is enabled, all output timestamps are shifted by the
150 same amount. Audio, video, and subtitles desynching and relative
151 timestamp differences are preserved compared to how they would have
152 been without shifting.
153
154 @item skip_initial_bytes @var{integer} (@emph{input})
155 Set number of bytes to skip before reading header and frames if set to 1.
156 Default is 0.
157
158 @item correct_ts_overflow @var{integer} (@emph{input})
159 Correct single timestamp overflows if set to 1. Default is 1.
160
161 @item flush_packets @var{integer} (@emph{output})
162 Flush the underlying I/O stream after each packet. Default 1 enables it, and
163 has the effect of reducing the latency; 0 disables it and may slightly
164 increase performance in some cases.
165
166 @item output_ts_offset @var{offset} (@emph{output})
167 Set the output time offset.
168
169 @var{offset} must be a time duration specification,
170 see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
171
172 The offset is added by the muxer to the output timestamps.
173
174 Specifying a positive offset means that the corresponding streams are
175 delayed bt the time duration specified in @var{offset}. Default value
176 is @code{0} (meaning that no offset is applied).
177
178 @item format_whitelist @var{list} (@emph{input})
179 "," separated List of allowed demuxers. By default all are allowed.
180
181 @item dump_separator @var{string} (@emph{input})
182 Separator used to separate the fields printed on the command line about the
183 Stream parameters.
184 For example to separate the fields with newlines and indention:
185 @example
186 ffprobe -dump_separator "
187                           "  -i ~/videos/matrixbench_mpeg2.mpg
188 @end example
189 @end table
190
191 @c man end FORMAT OPTIONS
192
193 @anchor{Format stream specifiers}
194 @section Format stream specifiers
195
196 Format stream specifiers allow selection of one or more streams that
197 match specific properties.
198
199 Possible forms of stream specifiers are:
200 @table @option
201 @item @var{stream_index}
202 Matches the stream with this index.
203
204 @item @var{stream_type}[:@var{stream_index}]
205 @var{stream_type} is one of following: 'v' for video, 'a' for audio,
206 's' for subtitle, 'd' for data, and 't' for attachments. If
207 @var{stream_index} is given, then it matches the stream number
208 @var{stream_index} of this type. Otherwise, it matches all streams of
209 this type.
210
211 @item p:@var{program_id}[:@var{stream_index}]
212 If @var{stream_index} is given, then it matches the stream with number
213 @var{stream_index} in the program with the id
214 @var{program_id}. Otherwise, it matches all streams in the program.
215
216 @item #@var{stream_id}
217 Matches the stream by a format-specific ID.
218 @end table
219
220 The exact semantics of stream specifiers is defined by the
221 @code{avformat_match_stream_specifier()} function declared in the
222 @file{libavformat/avformat.h} header.
223
224 @ifclear config-writeonly
225 @include demuxers.texi
226 @end ifclear
227 @ifclear config-readonly
228 @include muxers.texi
229 @end ifclear
230 @include metadata.texi