Imported Debian version 2.4.3~trusty1
[deb_ffmpeg.git] / 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 allow to detect 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 genpts
41 Generate PTS.
42 @item nofillin
43 Do not fill in missing values that can be exactly calculated.
44 @item noparse
45 Disable AVParsers, this needs @code{+nofillin} too.
46 @item igndts
47 Ignore DTS.
48 @item discardcorrupt
49 Discard corrupted frames.
50 @item sortdts
51 Try to interleave output packets by DTS.
52 @item keepside
53 Do not merge side data.
54 @item latm
55 Enable RTP MP4A-LATM payload.
56 @item nobuffer
57 Reduce the latency introduced by optional buffering
58 @end table
59
60 @item seek2any @var{integer} (@emph{input})
61 Allow seeking to non-keyframes on demuxer level when supported if set to 1.
62 Default is 0.
63
64 @item analyzeduration @var{integer} (@emph{input})
65 Specify how many microseconds are analyzed to probe the input. A
66 higher value will allow to detect more accurate information, but will
67 increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
68
69 @item cryptokey @var{hexadecimal string} (@emph{input})
70 Set decryption key.
71
72 @item indexmem @var{integer} (@emph{input})
73 Set max memory used for timestamp index (per stream).
74
75 @item rtbufsize @var{integer} (@emph{input})
76 Set max memory used for buffering real-time frames.
77
78 @item fdebug @var{flags} (@emph{input/output})
79 Print specific debug info.
80
81 Possible values:
82 @table @samp
83 @item ts
84 @end table
85
86 @item max_delay @var{integer} (@emph{input/output})
87 Set maximum muxing or demuxing delay in microseconds.
88
89 @item fpsprobesize @var{integer} (@emph{input})
90 Set number of frames used to probe fps.
91
92 @item audio_preload @var{integer} (@emph{output})
93 Set microseconds by which audio packets should be interleaved earlier.
94
95 @item chunk_duration @var{integer} (@emph{output})
96 Set microseconds for each chunk.
97
98 @item chunk_size @var{integer} (@emph{output})
99 Set size in bytes for each chunk.
100
101 @item err_detect, f_err_detect @var{flags} (@emph{input})
102 Set error detection flags. @code{f_err_detect} is deprecated and
103 should be used only via the @command{ffmpeg} tool.
104
105 Possible values:
106 @table @samp
107 @item crccheck
108 Verify embedded CRCs.
109 @item bitstream
110 Detect bitstream specification deviations.
111 @item buffer
112 Detect improper bitstream length.
113 @item explode
114 Abort decoding on minor error detection.
115 @item careful
116 Consider things that violate the spec and have not been seen in the
117 wild as errors.
118 @item compliant
119 Consider all spec non compliancies as errors.
120 @item aggressive
121 Consider things that a sane encoder should not do as an error.
122 @end table
123
124 @item use_wallclock_as_timestamps @var{integer} (@emph{input})
125 Use wallclock as timestamps.
126
127 @item avoid_negative_ts @var{integer} (@emph{output})
128
129 Possible values:
130 @table @samp
131 @item make_non_negative
132 Shift timestamps to make them non-negative.
133 Also note that this affects only leading negative timestamps, and not
134 non-monotonic negative timestamps.
135 @item make_zero
136 Shift timestamps so that the first timestamp is 0.
137 @item auto (default)
138 Enables shifting when required by the target format.
139 @item disabled
140 Disables shifting of timestamp.
141 @end table
142
143 When shifting is enabled, all output timestamps are shifted by the
144 same amount. Audio, video, and subtitles desynching and relative
145 timestamp differences are preserved compared to how they would have
146 been without shifting.
147
148 @item skip_initial_bytes @var{integer} (@emph{input})
149 Set number of bytes to skip before reading header and frames if set to 1.
150 Default is 0.
151
152 @item correct_ts_overflow @var{integer} (@emph{input})
153 Correct single timestamp overflows if set to 1. Default is 1.
154
155 @item flush_packets @var{integer} (@emph{output})
156 Flush the underlying I/O stream after each packet. Default 1 enables it, and
157 has the effect of reducing the latency; 0 disables it and may slightly
158 increase performance in some cases.
159
160 @item output_ts_offset @var{offset} (@emph{output})
161 Set the output time offset.
162
163 @var{offset} must be a time duration specification,
164 see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
165
166 The offset is added by the muxer to the output timestamps.
167
168 Specifying a positive offset means that the corresponding streams are
169 delayed bt the time duration specified in @var{offset}. Default value
170 is @code{0} (meaning that no offset is applied).
171 @end table
172
173 @c man end FORMAT OPTIONS
174
175 @anchor{Format stream specifiers}
176 @section Format stream specifiers
177
178 Format stream specifiers allow selection of one or more streams that
179 match specific properties.
180
181 Possible forms of stream specifiers are:
182 @table @option
183 @item @var{stream_index}
184 Matches the stream with this index.
185
186 @item @var{stream_type}[:@var{stream_index}]
187 @var{stream_type} is one of following: 'v' for video, 'a' for audio,
188 's' for subtitle, 'd' for data, and 't' for attachments. If
189 @var{stream_index} is given, then it matches the stream number
190 @var{stream_index} of this type. Otherwise, it matches all streams of
191 this type.
192
193 @item p:@var{program_id}[:@var{stream_index}]
194 If @var{stream_index} is given, then it matches the stream with number
195 @var{stream_index} in the program with the id
196 @var{program_id}. Otherwise, it matches all streams in the program.
197
198 @item #@var{stream_id}
199 Matches the stream by a format-specific ID.
200 @end table
201
202 The exact semantics of stream specifiers is defined by the
203 @code{avformat_match_stream_specifier()} function declared in the
204 @file{libavformat/avformat.h} header.
205
206 @ifclear config-writeonly
207 @include demuxers.texi
208 @end ifclear
209 @ifclear config-readonly
210 @include muxers.texi
211 @end ifclear
212 @include metadata.texi