]> git.sesse.net Git - ffmpeg/blob - doc/formats.texi
fc80ce1d2b4856ba78042494e7d7e2fdb4105207
[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 max_probe_packets @var{integer} (@emph{input})
31 Set the maximum number of buffered packets when probing a codec.
32 Default is 2500 packets.
33
34 @item packetsize @var{integer} (@emph{output})
35 Set packet size.
36
37 @item fflags @var{flags}
38 Set format flags. Some are implemented for a limited number of formats.
39
40 Possible values for input files:
41 @table @samp
42 @item discardcorrupt
43 Discard corrupted packets.
44 @item fastseek
45 Enable fast, but inaccurate seeks for some formats.
46 @item genpts
47 Generate missing PTS if DTS is present.
48 @item igndts
49 Ignore DTS if PTS is set. Inert when nofillin is set.
50 @item ignidx
51 Ignore index.
52 @item keepside (@emph{deprecated},@emph{inert})
53 @item nobuffer
54 Reduce the latency introduced by buffering during initial input streams analysis.
55 @item nofillin
56 Do not fill in missing values in packet fields that can be exactly calculated.
57 @item noparse
58 Disable AVParsers, this needs @code{+nofillin} too.
59 @item sortdts
60 Try to interleave output packets by DTS. At present, available only for AVIs with an index.
61 @end table
62
63 Possible values for output files:
64 @table @samp
65 @item autobsf
66 Automatically apply bitstream filters as required by the output format. Enabled by default.
67 @item bitexact
68 Only write platform-, build- and time-independent data.
69 This ensures that file and data checksums are reproducible and match between
70 platforms. Its primary use is for regression testing.
71 @item flush_packets
72 Write out packets immediately.
73 @item latm (@emph{deprecated},@emph{inert})
74 @item shortest
75 Stop muxing at the end of the shortest stream.
76 It may be needed to increase max_interleave_delta to avoid flushing the longer
77 streams before EOF.
78 @end table
79
80 @item seek2any @var{integer} (@emph{input})
81 Allow seeking to non-keyframes on demuxer level when supported if set to 1.
82 Default is 0.
83
84 @item analyzeduration @var{integer} (@emph{input})
85 Specify how many microseconds are analyzed to probe the input. A
86 higher value will enable detecting more accurate information, but will
87 increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
88
89 @item cryptokey @var{hexadecimal string} (@emph{input})
90 Set decryption key.
91
92 @item indexmem @var{integer} (@emph{input})
93 Set max memory used for timestamp index (per stream).
94
95 @item rtbufsize @var{integer} (@emph{input})
96 Set max memory used for buffering real-time frames.
97
98 @item fdebug @var{flags} (@emph{input/output})
99 Print specific debug info.
100
101 Possible values:
102 @table @samp
103 @item ts
104 @end table
105
106 @item max_delay @var{integer} (@emph{input/output})
107 Set maximum muxing or demuxing delay in microseconds.
108
109 @item fpsprobesize @var{integer} (@emph{input})
110 Set number of frames used to probe fps.
111
112 @item audio_preload @var{integer} (@emph{output})
113 Set microseconds by which audio packets should be interleaved earlier.
114
115 @item chunk_duration @var{integer} (@emph{output})
116 Set microseconds for each chunk.
117
118 @item chunk_size @var{integer} (@emph{output})
119 Set size in bytes for each chunk.
120
121 @item err_detect, f_err_detect @var{flags} (@emph{input})
122 Set error detection flags. @code{f_err_detect} is deprecated and
123 should be used only via the @command{ffmpeg} tool.
124
125 Possible values:
126 @table @samp
127 @item crccheck
128 Verify embedded CRCs.
129 @item bitstream
130 Detect bitstream specification deviations.
131 @item buffer
132 Detect improper bitstream length.
133 @item explode
134 Abort decoding on minor error detection.
135 @item careful
136 Consider things that violate the spec and have not been seen in the
137 wild as errors.
138 @item compliant
139 Consider all spec non compliancies as errors.
140 @item aggressive
141 Consider things that a sane encoder should not do as an error.
142 @end table
143
144 @item max_interleave_delta @var{integer} (@emph{output})
145 Set maximum buffering duration for interleaving. The duration is
146 expressed in microseconds, and defaults to 10000000 (10 seconds).
147
148 To ensure all the streams are interleaved correctly, libavformat will
149 wait until it has at least one packet for each stream before actually
150 writing any packets to the output file. When some streams are
151 "sparse" (i.e. there are large gaps between successive packets), this
152 can result in excessive buffering.
153
154 This field specifies the maximum difference between the timestamps of the
155 first and the last packet in the muxing queue, above which libavformat
156 will output a packet regardless of whether it has queued a packet for all
157 the streams.
158
159 If set to 0, libavformat will continue buffering packets until it has
160 a packet for each stream, regardless of the maximum timestamp
161 difference between the buffered packets.
162
163 @item use_wallclock_as_timestamps @var{integer} (@emph{input})
164 Use wallclock as timestamps if set to 1. Default is 0.
165
166 @item avoid_negative_ts @var{integer} (@emph{output})
167
168 Possible values:
169 @table @samp
170 @item make_non_negative
171 Shift timestamps to make them non-negative.
172 Also note that this affects only leading negative timestamps, and not
173 non-monotonic negative timestamps.
174 @item make_zero
175 Shift timestamps so that the first timestamp is 0.
176 @item auto (default)
177 Enables shifting when required by the target format.
178 @item disabled
179 Disables shifting of timestamp.
180 @end table
181
182 When shifting is enabled, all output timestamps are shifted by the
183 same amount. Audio, video, and subtitles desynching and relative
184 timestamp differences are preserved compared to how they would have
185 been without shifting.
186
187 @item skip_initial_bytes @var{integer} (@emph{input})
188 Set number of bytes to skip before reading header and frames if set to 1.
189 Default is 0.
190
191 @item correct_ts_overflow @var{integer} (@emph{input})
192 Correct single timestamp overflows if set to 1. Default is 1.
193
194 @item flush_packets @var{integer} (@emph{output})
195 Flush the underlying I/O stream after each packet. Default is -1 (auto), which
196 means that the underlying protocol will decide, 1 enables it, and has the
197 effect of reducing the latency, 0 disables it and may increase IO throughput in
198 some cases.
199
200 @item output_ts_offset @var{offset} (@emph{output})
201 Set the output time offset.
202
203 @var{offset} must be a time duration specification,
204 see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
205
206 The offset is added by the muxer to the output timestamps.
207
208 Specifying a positive offset means that the corresponding streams are
209 delayed bt the time duration specified in @var{offset}. Default value
210 is @code{0} (meaning that no offset is applied).
211
212 @item format_whitelist @var{list} (@emph{input})
213 "," separated list of allowed demuxers. By default all are allowed.
214
215 @item dump_separator @var{string} (@emph{input})
216 Separator used to separate the fields printed on the command line about the
217 Stream parameters.
218 For example, to separate the fields with newlines and indentation:
219 @example
220 ffprobe -dump_separator "
221                           "  -i ~/videos/matrixbench_mpeg2.mpg
222 @end example
223
224 @item max_streams @var{integer} (@emph{input})
225 Specifies the maximum number of streams. This can be used to reject files that
226 would require too many resources due to a large number of streams.
227
228 @item skip_estimate_duration_from_pts @var{bool} (@emph{input})
229 Skip estimation of input duration when calculated using PTS.
230 At present, applicable for MPEG-PS and MPEG-TS.
231
232 @item strict, f_strict @var{integer} (@emph{input/output})
233 Specify how strictly to follow the standards. @code{f_strict} is deprecated and
234 should be used only via the @command{ffmpeg} tool.
235
236 Possible values:
237 @table @samp
238 @item very
239 strictly conform to an older more strict version of the spec or reference software
240 @item strict
241 strictly conform to all the things in the spec no matter what consequences
242 @item normal
243
244 @item unofficial
245 allow unofficial extensions
246 @item experimental
247 allow non standardized experimental things, experimental
248 (unfinished/work in progress/not well tested) decoders and encoders.
249 Note: experimental decoders can pose a security risk, do not use this for
250 decoding untrusted input.
251 @end table
252
253 @end table
254
255 @c man end FORMAT OPTIONS
256
257 @anchor{Format stream specifiers}
258 @section Format stream specifiers
259
260 Format stream specifiers allow selection of one or more streams that
261 match specific properties.
262
263 The exact semantics of stream specifiers is defined by the
264 @code{avformat_match_stream_specifier()} function declared in the
265 @file{libavformat/avformat.h} header and documented in the
266 @ref{Stream specifiers,,Stream specifiers section in the ffmpeg(1) manual,ffmpeg}.
267
268 @ifclear config-writeonly
269 @include demuxers.texi
270 @end ifclear
271 @ifclear config-readonly
272 @include muxers.texi
273 @end ifclear
274 @include metadata.texi