yading@10
|
1 .\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14)
|
yading@10
|
2 .\"
|
yading@10
|
3 .\" Standard preamble:
|
yading@10
|
4 .\" ========================================================================
|
yading@10
|
5 .de Sp \" Vertical space (when we can't use .PP)
|
yading@10
|
6 .if t .sp .5v
|
yading@10
|
7 .if n .sp
|
yading@10
|
8 ..
|
yading@10
|
9 .de Vb \" Begin verbatim text
|
yading@10
|
10 .ft CW
|
yading@10
|
11 .nf
|
yading@10
|
12 .ne \\$1
|
yading@10
|
13 ..
|
yading@10
|
14 .de Ve \" End verbatim text
|
yading@10
|
15 .ft R
|
yading@10
|
16 .fi
|
yading@10
|
17 ..
|
yading@10
|
18 .\" Set up some character translations and predefined strings. \*(-- will
|
yading@10
|
19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
yading@10
|
20 .\" double quote, and \*(R" will give a right double quote. \*(C+ will
|
yading@10
|
21 .\" give a nicer C++. Capital omega is used to do unbreakable dashes and
|
yading@10
|
22 .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
|
yading@10
|
23 .\" nothing in troff, for use with C<>.
|
yading@10
|
24 .tr \(*W-
|
yading@10
|
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
yading@10
|
26 .ie n \{\
|
yading@10
|
27 . ds -- \(*W-
|
yading@10
|
28 . ds PI pi
|
yading@10
|
29 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
yading@10
|
30 . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
yading@10
|
31 . ds L" ""
|
yading@10
|
32 . ds R" ""
|
yading@10
|
33 . ds C` ""
|
yading@10
|
34 . ds C' ""
|
yading@10
|
35 'br\}
|
yading@10
|
36 .el\{\
|
yading@10
|
37 . ds -- \|\(em\|
|
yading@10
|
38 . ds PI \(*p
|
yading@10
|
39 . ds L" ``
|
yading@10
|
40 . ds R" ''
|
yading@10
|
41 'br\}
|
yading@10
|
42 .\"
|
yading@10
|
43 .\" Escape single quotes in literal strings from groff's Unicode transform.
|
yading@10
|
44 .ie \n(.g .ds Aq \(aq
|
yading@10
|
45 .el .ds Aq '
|
yading@10
|
46 .\"
|
yading@10
|
47 .\" If the F register is turned on, we'll generate index entries on stderr for
|
yading@10
|
48 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
|
yading@10
|
49 .\" entries marked with X<> in POD. Of course, you'll have to process the
|
yading@10
|
50 .\" output yourself in some meaningful fashion.
|
yading@10
|
51 .ie \nF \{\
|
yading@10
|
52 . de IX
|
yading@10
|
53 . tm Index:\\$1\t\\n%\t"\\$2"
|
yading@10
|
54 ..
|
yading@10
|
55 . nr % 0
|
yading@10
|
56 . rr F
|
yading@10
|
57 .\}
|
yading@10
|
58 .el \{\
|
yading@10
|
59 . de IX
|
yading@10
|
60 ..
|
yading@10
|
61 .\}
|
yading@10
|
62 .\"
|
yading@10
|
63 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
yading@10
|
64 .\" Fear. Run. Save yourself. No user-serviceable parts.
|
yading@10
|
65 . \" fudge factors for nroff and troff
|
yading@10
|
66 .if n \{\
|
yading@10
|
67 . ds #H 0
|
yading@10
|
68 . ds #V .8m
|
yading@10
|
69 . ds #F .3m
|
yading@10
|
70 . ds #[ \f1
|
yading@10
|
71 . ds #] \fP
|
yading@10
|
72 .\}
|
yading@10
|
73 .if t \{\
|
yading@10
|
74 . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
yading@10
|
75 . ds #V .6m
|
yading@10
|
76 . ds #F 0
|
yading@10
|
77 . ds #[ \&
|
yading@10
|
78 . ds #] \&
|
yading@10
|
79 .\}
|
yading@10
|
80 . \" simple accents for nroff and troff
|
yading@10
|
81 .if n \{\
|
yading@10
|
82 . ds ' \&
|
yading@10
|
83 . ds ` \&
|
yading@10
|
84 . ds ^ \&
|
yading@10
|
85 . ds , \&
|
yading@10
|
86 . ds ~ ~
|
yading@10
|
87 . ds /
|
yading@10
|
88 .\}
|
yading@10
|
89 .if t \{\
|
yading@10
|
90 . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
yading@10
|
91 . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
yading@10
|
92 . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
yading@10
|
93 . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
yading@10
|
94 . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
yading@10
|
95 . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
yading@10
|
96 .\}
|
yading@10
|
97 . \" troff and (daisy-wheel) nroff accents
|
yading@10
|
98 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
yading@10
|
99 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
yading@10
|
100 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
yading@10
|
101 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
yading@10
|
102 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
yading@10
|
103 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
yading@10
|
104 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
yading@10
|
105 .ds ae a\h'-(\w'a'u*4/10)'e
|
yading@10
|
106 .ds Ae A\h'-(\w'A'u*4/10)'E
|
yading@10
|
107 . \" corrections for vroff
|
yading@10
|
108 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
yading@10
|
109 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
yading@10
|
110 . \" for low resolution devices (crt and lpr)
|
yading@10
|
111 .if \n(.H>23 .if \n(.V>19 \
|
yading@10
|
112 \{\
|
yading@10
|
113 . ds : e
|
yading@10
|
114 . ds 8 ss
|
yading@10
|
115 . ds o a
|
yading@10
|
116 . ds d- d\h'-1'\(ga
|
yading@10
|
117 . ds D- D\h'-1'\(hy
|
yading@10
|
118 . ds th \o'bp'
|
yading@10
|
119 . ds Th \o'LP'
|
yading@10
|
120 . ds ae ae
|
yading@10
|
121 . ds Ae AE
|
yading@10
|
122 .\}
|
yading@10
|
123 .rm #[ #] #H #V #F C
|
yading@10
|
124 .\" ========================================================================
|
yading@10
|
125 .\"
|
yading@10
|
126 .IX Title "FFMPEG-FORMATS 1"
|
yading@10
|
127 .TH FFMPEG-FORMATS 1 "2013-04-21" " " " "
|
yading@10
|
128 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
yading@10
|
129 .\" way too many mistakes in technical documents.
|
yading@10
|
130 .if n .ad l
|
yading@10
|
131 .nh
|
yading@10
|
132 .SH "NAME"
|
yading@10
|
133 ffmpeg\-formats \- FFmpeg formats
|
yading@10
|
134 .SH "DESCRIPTION"
|
yading@10
|
135 .IX Header "DESCRIPTION"
|
yading@10
|
136 This document describes the supported formats (muxers and demuxers)
|
yading@10
|
137 provided by the libavformat library.
|
yading@10
|
138 .SH "FORMAT OPTIONS"
|
yading@10
|
139 .IX Header "FORMAT OPTIONS"
|
yading@10
|
140 The libavformat library provides some generic global options, which
|
yading@10
|
141 can be set on all the muxers and demuxers. In addition each muxer or
|
yading@10
|
142 demuxer may support so-called private options, which are specific for
|
yading@10
|
143 that component.
|
yading@10
|
144 .PP
|
yading@10
|
145 Options may be set by specifying \-\fIoption\fR \fIvalue\fR in the
|
yading@10
|
146 FFmpeg tools, or by setting the value explicitly in the
|
yading@10
|
147 \&\f(CW\*(C`AVFormatContext\*(C'\fR options or using the \fIlibavutil/opt.h\fR \s-1API\s0
|
yading@10
|
148 for programmatic use.
|
yading@10
|
149 .PP
|
yading@10
|
150 The list of supported options follows:
|
yading@10
|
151 .IP "\fBavioflags\fR \fIflags\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4
|
yading@10
|
152 .IX Item "avioflags flags (input/output)"
|
yading@10
|
153 Possible values:
|
yading@10
|
154 .RS 4
|
yading@10
|
155 .IP "\fBdirect\fR" 4
|
yading@10
|
156 .IX Item "direct"
|
yading@10
|
157 Reduce buffering.
|
yading@10
|
158 .RE
|
yading@10
|
159 .RS 4
|
yading@10
|
160 .RE
|
yading@10
|
161 .IP "\fBprobesize\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
|
yading@10
|
162 .IX Item "probesize integer (input)"
|
yading@10
|
163 Set probing size in bytes, i.e. the size of the data to analyze to get
|
yading@10
|
164 stream information. A higher value will allow to detect more
|
yading@10
|
165 information in case it is dispersed into the stream, but will increase
|
yading@10
|
166 latency. Must be an integer not lesser than 32. It is 5000000 by default.
|
yading@10
|
167 .IP "\fBpacketsize\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
|
yading@10
|
168 .IX Item "packetsize integer (output)"
|
yading@10
|
169 Set packet size.
|
yading@10
|
170 .IP "\fBfflags\fR \fIflags\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4
|
yading@10
|
171 .IX Item "fflags flags (input/output)"
|
yading@10
|
172 Set format flags.
|
yading@10
|
173 .Sp
|
yading@10
|
174 Possible values:
|
yading@10
|
175 .RS 4
|
yading@10
|
176 .IP "\fBignidx\fR" 4
|
yading@10
|
177 .IX Item "ignidx"
|
yading@10
|
178 Ignore index.
|
yading@10
|
179 .IP "\fBgenpts\fR" 4
|
yading@10
|
180 .IX Item "genpts"
|
yading@10
|
181 Generate \s-1PTS\s0.
|
yading@10
|
182 .IP "\fBnofillin\fR" 4
|
yading@10
|
183 .IX Item "nofillin"
|
yading@10
|
184 Do not fill in missing values that can be exactly calculated.
|
yading@10
|
185 .IP "\fBnoparse\fR" 4
|
yading@10
|
186 .IX Item "noparse"
|
yading@10
|
187 Disable AVParsers, this needs \f(CW\*(C`+nofillin\*(C'\fR too.
|
yading@10
|
188 .IP "\fBigndts\fR" 4
|
yading@10
|
189 .IX Item "igndts"
|
yading@10
|
190 Ignore \s-1DTS\s0.
|
yading@10
|
191 .IP "\fBdiscardcorrupt\fR" 4
|
yading@10
|
192 .IX Item "discardcorrupt"
|
yading@10
|
193 Discard corrupted frames.
|
yading@10
|
194 .IP "\fBsortdts\fR" 4
|
yading@10
|
195 .IX Item "sortdts"
|
yading@10
|
196 Try to interleave output packets by \s-1DTS\s0.
|
yading@10
|
197 .IP "\fBkeepside\fR" 4
|
yading@10
|
198 .IX Item "keepside"
|
yading@10
|
199 Do not merge side data.
|
yading@10
|
200 .IP "\fBlatm\fR" 4
|
yading@10
|
201 .IX Item "latm"
|
yading@10
|
202 Enable \s-1RTP\s0 \s-1MP4A\-LATM\s0 payload.
|
yading@10
|
203 .IP "\fBnobuffer\fR" 4
|
yading@10
|
204 .IX Item "nobuffer"
|
yading@10
|
205 Reduce the latency introduced by optional buffering
|
yading@10
|
206 .RE
|
yading@10
|
207 .RS 4
|
yading@10
|
208 .RE
|
yading@10
|
209 .IP "\fBanalyzeduration\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
|
yading@10
|
210 .IX Item "analyzeduration integer (input)"
|
yading@10
|
211 Specify how many microseconds are analyzed to probe the input. A
|
yading@10
|
212 higher value will allow to detect more accurate information, but will
|
yading@10
|
213 increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
|
yading@10
|
214 .IP "\fBcryptokey\fR \fIhexadecimal string\fR \fB(\fR\fIinput\fR\fB)\fR" 4
|
yading@10
|
215 .IX Item "cryptokey hexadecimal string (input)"
|
yading@10
|
216 Set decryption key.
|
yading@10
|
217 .IP "\fBindexmem\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
|
yading@10
|
218 .IX Item "indexmem integer (input)"
|
yading@10
|
219 Set max memory used for timestamp index (per stream).
|
yading@10
|
220 .IP "\fBrtbufsize\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
|
yading@10
|
221 .IX Item "rtbufsize integer (input)"
|
yading@10
|
222 Set max memory used for buffering real-time frames.
|
yading@10
|
223 .IP "\fBfdebug\fR \fIflags\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4
|
yading@10
|
224 .IX Item "fdebug flags (input/output)"
|
yading@10
|
225 Print specific debug info.
|
yading@10
|
226 .Sp
|
yading@10
|
227 Possible values:
|
yading@10
|
228 .RS 4
|
yading@10
|
229 .IP "\fBts\fR" 4
|
yading@10
|
230 .IX Item "ts"
|
yading@10
|
231 .RE
|
yading@10
|
232 .RS 4
|
yading@10
|
233 .RE
|
yading@10
|
234 .PD 0
|
yading@10
|
235 .IP "\fBmax_delay\fR \fIinteger\fR \fB(\fR\fIinput/output\fR\fB)\fR" 4
|
yading@10
|
236 .IX Item "max_delay integer (input/output)"
|
yading@10
|
237 .PD
|
yading@10
|
238 Set maximum muxing or demuxing delay in microseconds.
|
yading@10
|
239 .IP "\fBfpsprobesize\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
|
yading@10
|
240 .IX Item "fpsprobesize integer (input)"
|
yading@10
|
241 Set number of frames used to probe fps.
|
yading@10
|
242 .IP "\fBaudio_preload\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
|
yading@10
|
243 .IX Item "audio_preload integer (output)"
|
yading@10
|
244 Set microseconds by which audio packets should be interleaved earlier.
|
yading@10
|
245 .IP "\fBchunk_duration\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
|
yading@10
|
246 .IX Item "chunk_duration integer (output)"
|
yading@10
|
247 Set microseconds for each chunk.
|
yading@10
|
248 .IP "\fBchunk_size\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
|
yading@10
|
249 .IX Item "chunk_size integer (output)"
|
yading@10
|
250 Set size in bytes for each chunk.
|
yading@10
|
251 .IP "\fBerr_detect, f_err_detect\fR \fIflags\fR \fB(\fR\fIinput\fR\fB)\fR" 4
|
yading@10
|
252 .IX Item "err_detect, f_err_detect flags (input)"
|
yading@10
|
253 Set error detection flags. \f(CW\*(C`f_err_detect\*(C'\fR is deprecated and
|
yading@10
|
254 should be used only via the \fBffmpeg\fR tool.
|
yading@10
|
255 .Sp
|
yading@10
|
256 Possible values:
|
yading@10
|
257 .RS 4
|
yading@10
|
258 .IP "\fBcrccheck\fR" 4
|
yading@10
|
259 .IX Item "crccheck"
|
yading@10
|
260 Verify embedded CRCs.
|
yading@10
|
261 .IP "\fBbitstream\fR" 4
|
yading@10
|
262 .IX Item "bitstream"
|
yading@10
|
263 Detect bitstream specification deviations.
|
yading@10
|
264 .IP "\fBbuffer\fR" 4
|
yading@10
|
265 .IX Item "buffer"
|
yading@10
|
266 Detect improper bitstream length.
|
yading@10
|
267 .IP "\fBexplode\fR" 4
|
yading@10
|
268 .IX Item "explode"
|
yading@10
|
269 Abort decoding on minor error detection.
|
yading@10
|
270 .IP "\fBcareful\fR" 4
|
yading@10
|
271 .IX Item "careful"
|
yading@10
|
272 Consider things that violate the spec and have not been seen in the
|
yading@10
|
273 wild as errors.
|
yading@10
|
274 .IP "\fBcompliant\fR" 4
|
yading@10
|
275 .IX Item "compliant"
|
yading@10
|
276 Consider all spec non compliancies as errors.
|
yading@10
|
277 .IP "\fBaggressive\fR" 4
|
yading@10
|
278 .IX Item "aggressive"
|
yading@10
|
279 Consider things that a sane encoder should not do as an error.
|
yading@10
|
280 .RE
|
yading@10
|
281 .RS 4
|
yading@10
|
282 .RE
|
yading@10
|
283 .IP "\fBuse_wallclock_as_timestamps\fR \fIinteger\fR \fB(\fR\fIinput\fR\fB)\fR" 4
|
yading@10
|
284 .IX Item "use_wallclock_as_timestamps integer (input)"
|
yading@10
|
285 Use wallclock as timestamps.
|
yading@10
|
286 .IP "\fBavoid_negative_ts\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
|
yading@10
|
287 .IX Item "avoid_negative_ts integer (output)"
|
yading@10
|
288 Shift timestamps to make them positive. A value of 1 enables shifting,
|
yading@10
|
289 a value of 0 disables it, the default value of \-1 enables shifting
|
yading@10
|
290 when required by the target format.
|
yading@10
|
291 .Sp
|
yading@10
|
292 When shifting is enabled, all output timestamps are shifted by the
|
yading@10
|
293 same amount. Audio, video, and subtitles desynching and relative
|
yading@10
|
294 timestamp differences are preserved compared to how they would have
|
yading@10
|
295 been without shifting.
|
yading@10
|
296 .Sp
|
yading@10
|
297 Also note that this affects only leading negative timestamps, and not
|
yading@10
|
298 non-monotonic negative timestamps.
|
yading@10
|
299 .IP "\fBflush_packets\fR \fIinteger\fR \fB(\fR\fIoutput\fR\fB)\fR" 4
|
yading@10
|
300 .IX Item "flush_packets integer (output)"
|
yading@10
|
301 Flush the underlying I/O stream after each packet. Default 1 enables it, and
|
yading@10
|
302 has the effect of reducing the latency; 0 disables it and may slightly
|
yading@10
|
303 increase performance in some cases.
|
yading@10
|
304 .SH "DEMUXERS"
|
yading@10
|
305 .IX Header "DEMUXERS"
|
yading@10
|
306 Demuxers are configured elements in FFmpeg which allow to read the
|
yading@10
|
307 multimedia streams from a particular type of file.
|
yading@10
|
308 .PP
|
yading@10
|
309 When you configure your FFmpeg build, all the supported demuxers
|
yading@10
|
310 are enabled by default. You can list all available ones using the
|
yading@10
|
311 configure option \f(CW\*(C`\-\-list\-demuxers\*(C'\fR.
|
yading@10
|
312 .PP
|
yading@10
|
313 You can disable all the demuxers using the configure option
|
yading@10
|
314 \&\f(CW\*(C`\-\-disable\-demuxers\*(C'\fR, and selectively enable a single demuxer with
|
yading@10
|
315 the option \f(CW\*(C`\-\-enable\-demuxer=\f(CIDEMUXER\f(CW\*(C'\fR, or disable it
|
yading@10
|
316 with the option \f(CW\*(C`\-\-disable\-demuxer=\f(CIDEMUXER\f(CW\*(C'\fR.
|
yading@10
|
317 .PP
|
yading@10
|
318 The option \f(CW\*(C`\-formats\*(C'\fR of the ff* tools will display the list of
|
yading@10
|
319 enabled demuxers.
|
yading@10
|
320 .PP
|
yading@10
|
321 The description of some of the currently available demuxers follows.
|
yading@10
|
322 .SS "applehttp"
|
yading@10
|
323 .IX Subsection "applehttp"
|
yading@10
|
324 Apple \s-1HTTP\s0 Live Streaming demuxer.
|
yading@10
|
325 .PP
|
yading@10
|
326 This demuxer presents all AVStreams from all variant streams.
|
yading@10
|
327 The id field is set to the bitrate variant index number. By setting
|
yading@10
|
328 the discard flags on AVStreams (by pressing 'a' or 'v' in ffplay),
|
yading@10
|
329 the caller can decide which variant streams to actually receive.
|
yading@10
|
330 The total bitrate of the variant that the stream belongs to is
|
yading@10
|
331 available in a metadata key named \*(L"variant_bitrate\*(R".
|
yading@10
|
332 .SS "concat"
|
yading@10
|
333 .IX Subsection "concat"
|
yading@10
|
334 Virtual concatenation script demuxer.
|
yading@10
|
335 .PP
|
yading@10
|
336 This demuxer reads a list of files and other directives from a text file and
|
yading@10
|
337 demuxes them one after the other, as if all their packet had been muxed
|
yading@10
|
338 together.
|
yading@10
|
339 .PP
|
yading@10
|
340 The timestamps in the files are adjusted so that the first file starts at 0
|
yading@10
|
341 and each next file starts where the previous one finishes. Note that it is
|
yading@10
|
342 done globally and may cause gaps if all streams do not have exactly the same
|
yading@10
|
343 length.
|
yading@10
|
344 .PP
|
yading@10
|
345 All files must have the same streams (same codecs, same time base, etc.).
|
yading@10
|
346 .PP
|
yading@10
|
347 The duration of each file is used to adjust the timestamps of the next file:
|
yading@10
|
348 if the duration is incorrect (because it was computed using the bit-rate or
|
yading@10
|
349 because the file is truncated, for example), it can cause artifacts. The
|
yading@10
|
350 \&\f(CW\*(C`duration\*(C'\fR directive can be used to override the duration stored in
|
yading@10
|
351 each file.
|
yading@10
|
352 .PP
|
yading@10
|
353 \fISyntax\fR
|
yading@10
|
354 .IX Subsection "Syntax"
|
yading@10
|
355 .PP
|
yading@10
|
356 The script is a text file in extended-ASCII, with one directive per line.
|
yading@10
|
357 Empty lines, leading spaces and lines starting with '#' are ignored. The
|
yading@10
|
358 following directive is recognized:
|
yading@10
|
359 .ie n .IP "\fB\fB""file \f(BIpath\f(CB""\fB\fR" 4
|
yading@10
|
360 .el .IP "\fB\f(CBfile \f(CBpath\f(CB\fB\fR" 4
|
yading@10
|
361 .IX Item "file path"
|
yading@10
|
362 Path to a file to read; special characters and spaces must be escaped with
|
yading@10
|
363 backslash or single quotes.
|
yading@10
|
364 .Sp
|
yading@10
|
365 All subsequent directives apply to that file.
|
yading@10
|
366 .ie n .IP "\fB\fB""ffconcat version 1.0""\fB\fR" 4
|
yading@10
|
367 .el .IP "\fB\f(CBffconcat version 1.0\fB\fR" 4
|
yading@10
|
368 .IX Item "ffconcat version 1.0"
|
yading@10
|
369 Identify the script type and version. It also sets the \fBsafe\fR option
|
yading@10
|
370 to 1 if it was to its default \-1.
|
yading@10
|
371 .Sp
|
yading@10
|
372 To make FFmpeg recognize the format automatically, this directive must
|
yading@10
|
373 appears exactly as is (no extra space or byte-order-mark) on the very first
|
yading@10
|
374 line of the script.
|
yading@10
|
375 .ie n .IP "\fB\fB""duration \f(BIdur\f(CB""\fB\fR" 4
|
yading@10
|
376 .el .IP "\fB\f(CBduration \f(CBdur\f(CB\fB\fR" 4
|
yading@10
|
377 .IX Item "duration dur"
|
yading@10
|
378 Duration of the file. This information can be specified from the file;
|
yading@10
|
379 specifying it here may be more efficient or help if the information from the
|
yading@10
|
380 file is not available or accurate.
|
yading@10
|
381 .Sp
|
yading@10
|
382 If the duration is set for all files, then it is possible to seek in the
|
yading@10
|
383 whole concatenated video.
|
yading@10
|
384 .PP
|
yading@10
|
385 \fIOptions\fR
|
yading@10
|
386 .IX Subsection "Options"
|
yading@10
|
387 .PP
|
yading@10
|
388 This demuxer accepts the following option:
|
yading@10
|
389 .IP "\fBsafe\fR" 4
|
yading@10
|
390 .IX Item "safe"
|
yading@10
|
391 If set to 1, reject unsafe file paths. A file path is considered safe if it
|
yading@10
|
392 does not contain a protocol specification and is relative and all components
|
yading@10
|
393 only contain characters from the portable character set (letters, digits,
|
yading@10
|
394 period, underscore and hyphen) and have no period at the beginning of a
|
yading@10
|
395 component.
|
yading@10
|
396 .Sp
|
yading@10
|
397 If set to 0, any file name is accepted.
|
yading@10
|
398 .Sp
|
yading@10
|
399 The default is \-1, it is equivalent to 1 if the format was automatically
|
yading@10
|
400 probed and 0 otherwise.
|
yading@10
|
401 .SS "libquvi"
|
yading@10
|
402 .IX Subsection "libquvi"
|
yading@10
|
403 Play media from Internet services using the quvi project.
|
yading@10
|
404 .PP
|
yading@10
|
405 The demuxer accepts a \fBformat\fR option to request a specific quality. It
|
yading@10
|
406 is by default set to \fIbest\fR.
|
yading@10
|
407 .PP
|
yading@10
|
408 See <\fBhttp://quvi.sourceforge.net/\fR> for more information.
|
yading@10
|
409 .PP
|
yading@10
|
410 FFmpeg needs to be built with \f(CW\*(C`\-\-enable\-libquvi\*(C'\fR for this demuxer to be
|
yading@10
|
411 enabled.
|
yading@10
|
412 .SS "image2"
|
yading@10
|
413 .IX Subsection "image2"
|
yading@10
|
414 Image file demuxer.
|
yading@10
|
415 .PP
|
yading@10
|
416 This demuxer reads from a list of image files specified by a pattern.
|
yading@10
|
417 The syntax and meaning of the pattern is specified by the
|
yading@10
|
418 option \fIpattern_type\fR.
|
yading@10
|
419 .PP
|
yading@10
|
420 The pattern may contain a suffix which is used to automatically
|
yading@10
|
421 determine the format of the images contained in the files.
|
yading@10
|
422 .PP
|
yading@10
|
423 The size, the pixel format, and the format of each image must be the
|
yading@10
|
424 same for all the files in the sequence.
|
yading@10
|
425 .PP
|
yading@10
|
426 This demuxer accepts the following options:
|
yading@10
|
427 .IP "\fBframerate\fR" 4
|
yading@10
|
428 .IX Item "framerate"
|
yading@10
|
429 Set the frame rate for the video stream. It defaults to 25.
|
yading@10
|
430 .IP "\fBloop\fR" 4
|
yading@10
|
431 .IX Item "loop"
|
yading@10
|
432 If set to 1, loop over the input. Default value is 0.
|
yading@10
|
433 .IP "\fBpattern_type\fR" 4
|
yading@10
|
434 .IX Item "pattern_type"
|
yading@10
|
435 Select the pattern type used to interpret the provided filename.
|
yading@10
|
436 .Sp
|
yading@10
|
437 \&\fIpattern_type\fR accepts one of the following values.
|
yading@10
|
438 .RS 4
|
yading@10
|
439 .IP "\fBsequence\fR" 4
|
yading@10
|
440 .IX Item "sequence"
|
yading@10
|
441 Select a sequence pattern type, used to specify a sequence of files
|
yading@10
|
442 indexed by sequential numbers.
|
yading@10
|
443 .Sp
|
yading@10
|
444 A sequence pattern may contain the string \*(L"%d\*(R" or "%0\fIN\fRd\*(L", which
|
yading@10
|
445 specifies the position of the characters representing a sequential
|
yading@10
|
446 number in each filename matched by the pattern. If the form
|
yading@10
|
447 \&\*(R"%d0\fIN\fRd" is used, the string representing the number in each
|
yading@10
|
448 filename is 0\-padded and \fIN\fR is the total number of 0\-padded
|
yading@10
|
449 digits representing the number. The literal character '%' can be
|
yading@10
|
450 specified in the pattern with the string \*(L"%%\*(R".
|
yading@10
|
451 .Sp
|
yading@10
|
452 If the sequence pattern contains \*(L"%d\*(R" or "%0\fIN\fRd", the first filename of
|
yading@10
|
453 the file list specified by the pattern must contain a number
|
yading@10
|
454 inclusively contained between \fIstart_number\fR and
|
yading@10
|
455 \&\fIstart_number\fR+\fIstart_number_range\fR\-1, and all the following
|
yading@10
|
456 numbers must be sequential.
|
yading@10
|
457 .Sp
|
yading@10
|
458 For example the pattern \*(L"img\-%03d.bmp\*(R" will match a sequence of
|
yading@10
|
459 filenames of the form \fIimg\-001.bmp\fR, \fIimg\-002.bmp\fR, ...,
|
yading@10
|
460 \&\fIimg\-010.bmp\fR, etc.; the pattern \*(L"i%%m%%g\-%d.jpg\*(R" will match a
|
yading@10
|
461 sequence of filenames of the form \fIi%m%g\-1.jpg\fR,
|
yading@10
|
462 \&\fIi%m%g\-2.jpg\fR, ..., \fIi%m%g\-10.jpg\fR, etc.
|
yading@10
|
463 .Sp
|
yading@10
|
464 Note that the pattern must not necessarily contain \*(L"%d\*(R" or
|
yading@10
|
465 "%0\fIN\fRd", for example to convert a single image file
|
yading@10
|
466 \&\fIimg.jpeg\fR you can employ the command:
|
yading@10
|
467 .Sp
|
yading@10
|
468 .Vb 1
|
yading@10
|
469 \& ffmpeg \-i img.jpeg img.png
|
yading@10
|
470 .Ve
|
yading@10
|
471 .IP "\fBglob\fR" 4
|
yading@10
|
472 .IX Item "glob"
|
yading@10
|
473 Select a glob wildcard pattern type.
|
yading@10
|
474 .Sp
|
yading@10
|
475 The pattern is interpreted like a \f(CW\*(C`glob()\*(C'\fR pattern. This is only
|
yading@10
|
476 selectable if libavformat was compiled with globbing support.
|
yading@10
|
477 .IP "\fBglob_sequence\fR \fI(deprecated, will be removed)\fR" 4
|
yading@10
|
478 .IX Item "glob_sequence (deprecated, will be removed)"
|
yading@10
|
479 Select a mixed glob wildcard/sequence pattern.
|
yading@10
|
480 .Sp
|
yading@10
|
481 If your version of libavformat was compiled with globbing support, and
|
yading@10
|
482 the provided pattern contains at least one glob meta character among
|
yading@10
|
483 \&\f(CW\*(C`%*?[]{}\*(C'\fR that is preceded by an unescaped \*(L"%\*(R", the pattern is
|
yading@10
|
484 interpreted like a \f(CW\*(C`glob()\*(C'\fR pattern, otherwise it is interpreted
|
yading@10
|
485 like a sequence pattern.
|
yading@10
|
486 .Sp
|
yading@10
|
487 All glob special characters \f(CW\*(C`%*?[]{}\*(C'\fR must be prefixed
|
yading@10
|
488 with \*(L"%\*(R". To escape a literal \*(L"%\*(R" you shall use \*(L"%%\*(R".
|
yading@10
|
489 .Sp
|
yading@10
|
490 For example the pattern \f(CW\*(C`foo\-%*.jpeg\*(C'\fR will match all the
|
yading@10
|
491 filenames prefixed by \*(L"foo\-\*(R" and terminating with \*(L".jpeg\*(R", and
|
yading@10
|
492 \&\f(CW\*(C`foo\-%?%?%?.jpeg\*(C'\fR will match all the filenames prefixed with
|
yading@10
|
493 \&\*(L"foo\-\*(R", followed by a sequence of three characters, and terminating
|
yading@10
|
494 with \*(L".jpeg\*(R".
|
yading@10
|
495 .Sp
|
yading@10
|
496 This pattern type is deprecated in favor of \fIglob\fR and
|
yading@10
|
497 \&\fIsequence\fR.
|
yading@10
|
498 .RE
|
yading@10
|
499 .RS 4
|
yading@10
|
500 .Sp
|
yading@10
|
501 Default value is \fIglob_sequence\fR.
|
yading@10
|
502 .RE
|
yading@10
|
503 .IP "\fBpixel_format\fR" 4
|
yading@10
|
504 .IX Item "pixel_format"
|
yading@10
|
505 Set the pixel format of the images to read. If not specified the pixel
|
yading@10
|
506 format is guessed from the first image file in the sequence.
|
yading@10
|
507 .IP "\fBstart_number\fR" 4
|
yading@10
|
508 .IX Item "start_number"
|
yading@10
|
509 Set the index of the file matched by the image file pattern to start
|
yading@10
|
510 to read from. Default value is 0.
|
yading@10
|
511 .IP "\fBstart_number_range\fR" 4
|
yading@10
|
512 .IX Item "start_number_range"
|
yading@10
|
513 Set the index interval range to check when looking for the first image
|
yading@10
|
514 file in the sequence, starting from \fIstart_number\fR. Default value
|
yading@10
|
515 is 5.
|
yading@10
|
516 .IP "\fBvideo_size\fR" 4
|
yading@10
|
517 .IX Item "video_size"
|
yading@10
|
518 Set the video size of the images to read. If not specified the video
|
yading@10
|
519 size is guessed from the first image file in the sequence.
|
yading@10
|
520 .PP
|
yading@10
|
521 \fIExamples\fR
|
yading@10
|
522 .IX Subsection "Examples"
|
yading@10
|
523 .IP "\(bu" 4
|
yading@10
|
524 Use \fBffmpeg\fR for creating a video from the images in the file
|
yading@10
|
525 sequence \fIimg\-001.jpeg\fR, \fIimg\-002.jpeg\fR, ..., assuming an
|
yading@10
|
526 input frame rate of 10 frames per second:
|
yading@10
|
527 .Sp
|
yading@10
|
528 .Vb 1
|
yading@10
|
529 \& ffmpeg \-i \*(Aqimg\-%03d.jpeg\*(Aq \-r 10 out.mkv
|
yading@10
|
530 .Ve
|
yading@10
|
531 .IP "\(bu" 4
|
yading@10
|
532 As above, but start by reading from a file with index 100 in the sequence:
|
yading@10
|
533 .Sp
|
yading@10
|
534 .Vb 1
|
yading@10
|
535 \& ffmpeg \-start_number 100 \-i \*(Aqimg\-%03d.jpeg\*(Aq \-r 10 out.mkv
|
yading@10
|
536 .Ve
|
yading@10
|
537 .IP "\(bu" 4
|
yading@10
|
538 Read images matching the \*(L"*.png\*(R" glob pattern , that is all the files
|
yading@10
|
539 terminating with the \*(L".png\*(R" suffix:
|
yading@10
|
540 .Sp
|
yading@10
|
541 .Vb 1
|
yading@10
|
542 \& ffmpeg \-pattern_type glob \-i "*.png" \-r 10 out.mkv
|
yading@10
|
543 .Ve
|
yading@10
|
544 .SS "rawvideo"
|
yading@10
|
545 .IX Subsection "rawvideo"
|
yading@10
|
546 Raw video demuxer.
|
yading@10
|
547 .PP
|
yading@10
|
548 This demuxer allows to read raw video data. Since there is no header
|
yading@10
|
549 specifying the assumed video parameters, the user must specify them
|
yading@10
|
550 in order to be able to decode the data correctly.
|
yading@10
|
551 .PP
|
yading@10
|
552 This demuxer accepts the following options:
|
yading@10
|
553 .IP "\fBframerate\fR" 4
|
yading@10
|
554 .IX Item "framerate"
|
yading@10
|
555 Set input video frame rate. Default value is 25.
|
yading@10
|
556 .IP "\fBpixel_format\fR" 4
|
yading@10
|
557 .IX Item "pixel_format"
|
yading@10
|
558 Set the input video pixel format. Default value is \f(CW\*(C`yuv420p\*(C'\fR.
|
yading@10
|
559 .IP "\fBvideo_size\fR" 4
|
yading@10
|
560 .IX Item "video_size"
|
yading@10
|
561 Set the input video size. This value must be specified explicitly.
|
yading@10
|
562 .PP
|
yading@10
|
563 For example to read a rawvideo file \fIinput.raw\fR with
|
yading@10
|
564 \&\fBffplay\fR, assuming a pixel format of \f(CW\*(C`rgb24\*(C'\fR, a video
|
yading@10
|
565 size of \f(CW\*(C`320x240\*(C'\fR, and a frame rate of 10 images per second, use
|
yading@10
|
566 the command:
|
yading@10
|
567 .PP
|
yading@10
|
568 .Vb 1
|
yading@10
|
569 \& ffplay \-f rawvideo \-pixel_format rgb24 \-video_size 320x240 \-framerate 10 input.raw
|
yading@10
|
570 .Ve
|
yading@10
|
571 .SS "sbg"
|
yading@10
|
572 .IX Subsection "sbg"
|
yading@10
|
573 SBaGen script demuxer.
|
yading@10
|
574 .PP
|
yading@10
|
575 This demuxer reads the script language used by SBaGen
|
yading@10
|
576 <\fBhttp://uazu.net/sbagen/\fR> to generate binaural beats sessions. A \s-1SBG\s0
|
yading@10
|
577 script looks like that:
|
yading@10
|
578 .PP
|
yading@10
|
579 .Vb 9
|
yading@10
|
580 \& \-SE
|
yading@10
|
581 \& a: 300\-2.5/3 440+4.5/0
|
yading@10
|
582 \& b: 300\-2.5/0 440+4.5/3
|
yading@10
|
583 \& off: \-
|
yading@10
|
584 \& NOW == a
|
yading@10
|
585 \& +0:07:00 == b
|
yading@10
|
586 \& +0:14:00 == a
|
yading@10
|
587 \& +0:21:00 == b
|
yading@10
|
588 \& +0:30:00 off
|
yading@10
|
589 .Ve
|
yading@10
|
590 .PP
|
yading@10
|
591 A \s-1SBG\s0 script can mix absolute and relative timestamps. If the script uses
|
yading@10
|
592 either only absolute timestamps (including the script start time) or only
|
yading@10
|
593 relative ones, then its layout is fixed, and the conversion is
|
yading@10
|
594 straightforward. On the other hand, if the script mixes both kind of
|
yading@10
|
595 timestamps, then the \fI\s-1NOW\s0\fR reference for relative timestamps will be
|
yading@10
|
596 taken from the current time of day at the time the script is read, and the
|
yading@10
|
597 script layout will be frozen according to that reference. That means that if
|
yading@10
|
598 the script is directly played, the actual times will match the absolute
|
yading@10
|
599 timestamps up to the sound controller's clock accuracy, but if the user
|
yading@10
|
600 somehow pauses the playback or seeks, all times will be shifted accordingly.
|
yading@10
|
601 .SS "tedcaptions"
|
yading@10
|
602 .IX Subsection "tedcaptions"
|
yading@10
|
603 \&\s-1JSON\s0 captions used for <\fBhttp://www.ted.com/\fR>.
|
yading@10
|
604 .PP
|
yading@10
|
605 \&\s-1TED\s0 does not provide links to the captions, but they can be guessed from the
|
yading@10
|
606 page. The file \fItools/bookmarklets.html\fR from the FFmpeg source tree
|
yading@10
|
607 contains a bookmarklet to expose them.
|
yading@10
|
608 .PP
|
yading@10
|
609 This demuxer accepts the following option:
|
yading@10
|
610 .IP "\fBstart_time\fR" 4
|
yading@10
|
611 .IX Item "start_time"
|
yading@10
|
612 Set the start time of the \s-1TED\s0 talk, in milliseconds. The default is 15000
|
yading@10
|
613 (15s). It is used to sync the captions with the downloadable videos, because
|
yading@10
|
614 they include a 15s intro.
|
yading@10
|
615 .PP
|
yading@10
|
616 Example: convert the captions to a format most players understand:
|
yading@10
|
617 .PP
|
yading@10
|
618 .Vb 1
|
yading@10
|
619 \& ffmpeg \-i http://www.ted.com/talks/subtitles/id/1/lang/en talk1\-en.srt
|
yading@10
|
620 .Ve
|
yading@10
|
621 .SH "MUXERS"
|
yading@10
|
622 .IX Header "MUXERS"
|
yading@10
|
623 Muxers are configured elements in FFmpeg which allow writing
|
yading@10
|
624 multimedia streams to a particular type of file.
|
yading@10
|
625 .PP
|
yading@10
|
626 When you configure your FFmpeg build, all the supported muxers
|
yading@10
|
627 are enabled by default. You can list all available muxers using the
|
yading@10
|
628 configure option \f(CW\*(C`\-\-list\-muxers\*(C'\fR.
|
yading@10
|
629 .PP
|
yading@10
|
630 You can disable all the muxers with the configure option
|
yading@10
|
631 \&\f(CW\*(C`\-\-disable\-muxers\*(C'\fR and selectively enable / disable single muxers
|
yading@10
|
632 with the options \f(CW\*(C`\-\-enable\-muxer=\f(CIMUXER\f(CW\*(C'\fR /
|
yading@10
|
633 \&\f(CW\*(C`\-\-disable\-muxer=\f(CIMUXER\f(CW\*(C'\fR.
|
yading@10
|
634 .PP
|
yading@10
|
635 The option \f(CW\*(C`\-formats\*(C'\fR of the ff* tools will display the list of
|
yading@10
|
636 enabled muxers.
|
yading@10
|
637 .PP
|
yading@10
|
638 A description of some of the currently available muxers follows.
|
yading@10
|
639 .SS "crc"
|
yading@10
|
640 .IX Subsection "crc"
|
yading@10
|
641 \&\s-1CRC\s0 (Cyclic Redundancy Check) testing format.
|
yading@10
|
642 .PP
|
yading@10
|
643 This muxer computes and prints the Adler\-32 \s-1CRC\s0 of all the input audio
|
yading@10
|
644 and video frames. By default audio frames are converted to signed
|
yading@10
|
645 16\-bit raw audio and video frames to raw video before computing the
|
yading@10
|
646 \&\s-1CRC\s0.
|
yading@10
|
647 .PP
|
yading@10
|
648 The output of the muxer consists of a single line of the form:
|
yading@10
|
649 CRC=0x\fI\s-1CRC\s0\fR, where \fI\s-1CRC\s0\fR is a hexadecimal number 0\-padded to
|
yading@10
|
650 8 digits containing the \s-1CRC\s0 for all the decoded input frames.
|
yading@10
|
651 .PP
|
yading@10
|
652 For example to compute the \s-1CRC\s0 of the input, and store it in the file
|
yading@10
|
653 \&\fIout.crc\fR:
|
yading@10
|
654 .PP
|
yading@10
|
655 .Vb 1
|
yading@10
|
656 \& ffmpeg \-i INPUT \-f crc out.crc
|
yading@10
|
657 .Ve
|
yading@10
|
658 .PP
|
yading@10
|
659 You can print the \s-1CRC\s0 to stdout with the command:
|
yading@10
|
660 .PP
|
yading@10
|
661 .Vb 1
|
yading@10
|
662 \& ffmpeg \-i INPUT \-f crc \-
|
yading@10
|
663 .Ve
|
yading@10
|
664 .PP
|
yading@10
|
665 You can select the output format of each frame with \fBffmpeg\fR by
|
yading@10
|
666 specifying the audio and video codec and format. For example to
|
yading@10
|
667 compute the \s-1CRC\s0 of the input audio converted to \s-1PCM\s0 unsigned 8\-bit
|
yading@10
|
668 and the input video converted to \s-1MPEG\-2\s0 video, use the command:
|
yading@10
|
669 .PP
|
yading@10
|
670 .Vb 1
|
yading@10
|
671 \& ffmpeg \-i INPUT \-c:a pcm_u8 \-c:v mpeg2video \-f crc \-
|
yading@10
|
672 .Ve
|
yading@10
|
673 .PP
|
yading@10
|
674 See also the framecrc muxer.
|
yading@10
|
675 .SS "framecrc"
|
yading@10
|
676 .IX Subsection "framecrc"
|
yading@10
|
677 Per-packet \s-1CRC\s0 (Cyclic Redundancy Check) testing format.
|
yading@10
|
678 .PP
|
yading@10
|
679 This muxer computes and prints the Adler\-32 \s-1CRC\s0 for each audio
|
yading@10
|
680 and video packet. By default audio frames are converted to signed
|
yading@10
|
681 16\-bit raw audio and video frames to raw video before computing the
|
yading@10
|
682 \&\s-1CRC\s0.
|
yading@10
|
683 .PP
|
yading@10
|
684 The output of the muxer consists of a line for each audio and video
|
yading@10
|
685 packet of the form:
|
yading@10
|
686 .PP
|
yading@10
|
687 .Vb 1
|
yading@10
|
688 \& <stream_index>, <packet_dts>, <packet_pts>, <packet_duration>, <packet_size>, 0x<CRC>
|
yading@10
|
689 .Ve
|
yading@10
|
690 .PP
|
yading@10
|
691 \&\fI\s-1CRC\s0\fR is a hexadecimal number 0\-padded to 8 digits containing the
|
yading@10
|
692 \&\s-1CRC\s0 of the packet.
|
yading@10
|
693 .PP
|
yading@10
|
694 For example to compute the \s-1CRC\s0 of the audio and video frames in
|
yading@10
|
695 \&\fI\s-1INPUT\s0\fR, converted to raw audio and video packets, and store it
|
yading@10
|
696 in the file \fIout.crc\fR:
|
yading@10
|
697 .PP
|
yading@10
|
698 .Vb 1
|
yading@10
|
699 \& ffmpeg \-i INPUT \-f framecrc out.crc
|
yading@10
|
700 .Ve
|
yading@10
|
701 .PP
|
yading@10
|
702 To print the information to stdout, use the command:
|
yading@10
|
703 .PP
|
yading@10
|
704 .Vb 1
|
yading@10
|
705 \& ffmpeg \-i INPUT \-f framecrc \-
|
yading@10
|
706 .Ve
|
yading@10
|
707 .PP
|
yading@10
|
708 With \fBffmpeg\fR, you can select the output format to which the
|
yading@10
|
709 audio and video frames are encoded before computing the \s-1CRC\s0 for each
|
yading@10
|
710 packet by specifying the audio and video codec. For example, to
|
yading@10
|
711 compute the \s-1CRC\s0 of each decoded input audio frame converted to \s-1PCM\s0
|
yading@10
|
712 unsigned 8\-bit and of each decoded input video frame converted to
|
yading@10
|
713 \&\s-1MPEG\-2\s0 video, use the command:
|
yading@10
|
714 .PP
|
yading@10
|
715 .Vb 1
|
yading@10
|
716 \& ffmpeg \-i INPUT \-c:a pcm_u8 \-c:v mpeg2video \-f framecrc \-
|
yading@10
|
717 .Ve
|
yading@10
|
718 .PP
|
yading@10
|
719 See also the crc muxer.
|
yading@10
|
720 .SS "framemd5"
|
yading@10
|
721 .IX Subsection "framemd5"
|
yading@10
|
722 Per-packet \s-1MD5\s0 testing format.
|
yading@10
|
723 .PP
|
yading@10
|
724 This muxer computes and prints the \s-1MD5\s0 hash for each audio
|
yading@10
|
725 and video packet. By default audio frames are converted to signed
|
yading@10
|
726 16\-bit raw audio and video frames to raw video before computing the
|
yading@10
|
727 hash.
|
yading@10
|
728 .PP
|
yading@10
|
729 The output of the muxer consists of a line for each audio and video
|
yading@10
|
730 packet of the form:
|
yading@10
|
731 .PP
|
yading@10
|
732 .Vb 1
|
yading@10
|
733 \& <stream_index>, <packet_dts>, <packet_pts>, <packet_duration>, <packet_size>, <MD5>
|
yading@10
|
734 .Ve
|
yading@10
|
735 .PP
|
yading@10
|
736 \&\fI\s-1MD5\s0\fR is a hexadecimal number representing the computed \s-1MD5\s0 hash
|
yading@10
|
737 for the packet.
|
yading@10
|
738 .PP
|
yading@10
|
739 For example to compute the \s-1MD5\s0 of the audio and video frames in
|
yading@10
|
740 \&\fI\s-1INPUT\s0\fR, converted to raw audio and video packets, and store it
|
yading@10
|
741 in the file \fIout.md5\fR:
|
yading@10
|
742 .PP
|
yading@10
|
743 .Vb 1
|
yading@10
|
744 \& ffmpeg \-i INPUT \-f framemd5 out.md5
|
yading@10
|
745 .Ve
|
yading@10
|
746 .PP
|
yading@10
|
747 To print the information to stdout, use the command:
|
yading@10
|
748 .PP
|
yading@10
|
749 .Vb 1
|
yading@10
|
750 \& ffmpeg \-i INPUT \-f framemd5 \-
|
yading@10
|
751 .Ve
|
yading@10
|
752 .PP
|
yading@10
|
753 See also the md5 muxer.
|
yading@10
|
754 .SS "hls"
|
yading@10
|
755 .IX Subsection "hls"
|
yading@10
|
756 Apple \s-1HTTP\s0 Live Streaming muxer that segments MPEG-TS according to
|
yading@10
|
757 the \s-1HTTP\s0 Live Streaming specification.
|
yading@10
|
758 .PP
|
yading@10
|
759 It creates a playlist file and numbered segment files. The output
|
yading@10
|
760 filename specifies the playlist filename; the segment filenames
|
yading@10
|
761 receive the same basename as the playlist, a sequential number and
|
yading@10
|
762 a .ts extension.
|
yading@10
|
763 .PP
|
yading@10
|
764 .Vb 1
|
yading@10
|
765 \& ffmpeg \-i in.nut out.m3u8
|
yading@10
|
766 .Ve
|
yading@10
|
767 .IP "\fB\-hls_time\fR \fIseconds\fR" 4
|
yading@10
|
768 .IX Item "-hls_time seconds"
|
yading@10
|
769 Set the segment length in seconds.
|
yading@10
|
770 .IP "\fB\-hls_list_size\fR \fIsize\fR" 4
|
yading@10
|
771 .IX Item "-hls_list_size size"
|
yading@10
|
772 Set the maximum number of playlist entries.
|
yading@10
|
773 .IP "\fB\-hls_wrap\fR \fIwrap\fR" 4
|
yading@10
|
774 .IX Item "-hls_wrap wrap"
|
yading@10
|
775 Set the number after which index wraps.
|
yading@10
|
776 .IP "\fB\-start_number\fR \fInumber\fR" 4
|
yading@10
|
777 .IX Item "-start_number number"
|
yading@10
|
778 Start the sequence from \fInumber\fR.
|
yading@10
|
779 .SS "ico"
|
yading@10
|
780 .IX Subsection "ico"
|
yading@10
|
781 \&\s-1ICO\s0 file muxer.
|
yading@10
|
782 .PP
|
yading@10
|
783 Microsoft's icon file format (\s-1ICO\s0) has some strict limitations that should be noted:
|
yading@10
|
784 .IP "\(bu" 4
|
yading@10
|
785 Size cannot exceed 256 pixels in any dimension
|
yading@10
|
786 .IP "\(bu" 4
|
yading@10
|
787 Only \s-1BMP\s0 and \s-1PNG\s0 images can be stored
|
yading@10
|
788 .IP "\(bu" 4
|
yading@10
|
789 If a \s-1BMP\s0 image is used, it must be one of the following pixel formats:
|
yading@10
|
790 .Sp
|
yading@10
|
791 .Vb 7
|
yading@10
|
792 \& BMP Bit Depth FFmpeg Pixel Format
|
yading@10
|
793 \& 1bit pal8
|
yading@10
|
794 \& 4bit pal8
|
yading@10
|
795 \& 8bit pal8
|
yading@10
|
796 \& 16bit rgb555le
|
yading@10
|
797 \& 24bit bgr24
|
yading@10
|
798 \& 32bit bgra
|
yading@10
|
799 .Ve
|
yading@10
|
800 .IP "\(bu" 4
|
yading@10
|
801 If a \s-1BMP\s0 image is used, it must use the \s-1BITMAPINFOHEADER\s0 \s-1DIB\s0 header
|
yading@10
|
802 .IP "\(bu" 4
|
yading@10
|
803 If a \s-1PNG\s0 image is used, it must use the rgba pixel format
|
yading@10
|
804 .SS "image2"
|
yading@10
|
805 .IX Subsection "image2"
|
yading@10
|
806 Image file muxer.
|
yading@10
|
807 .PP
|
yading@10
|
808 The image file muxer writes video frames to image files.
|
yading@10
|
809 .PP
|
yading@10
|
810 The output filenames are specified by a pattern, which can be used to
|
yading@10
|
811 produce sequentially numbered series of files.
|
yading@10
|
812 The pattern may contain the string \*(L"%d\*(R" or "%0\fIN\fRd\*(L", this string
|
yading@10
|
813 specifies the position of the characters representing a numbering in
|
yading@10
|
814 the filenames. If the form \*(R"%0\fIN\fRd" is used, the string
|
yading@10
|
815 representing the number in each filename is 0\-padded to \fIN\fR
|
yading@10
|
816 digits. The literal character '%' can be specified in the pattern with
|
yading@10
|
817 the string \*(L"%%\*(R".
|
yading@10
|
818 .PP
|
yading@10
|
819 If the pattern contains \*(L"%d\*(R" or "%0\fIN\fRd", the first filename of
|
yading@10
|
820 the file list specified will contain the number 1, all the following
|
yading@10
|
821 numbers will be sequential.
|
yading@10
|
822 .PP
|
yading@10
|
823 The pattern may contain a suffix which is used to automatically
|
yading@10
|
824 determine the format of the image files to write.
|
yading@10
|
825 .PP
|
yading@10
|
826 For example the pattern \*(L"img\-%03d.bmp\*(R" will specify a sequence of
|
yading@10
|
827 filenames of the form \fIimg\-001.bmp\fR, \fIimg\-002.bmp\fR, ...,
|
yading@10
|
828 \&\fIimg\-010.bmp\fR, etc.
|
yading@10
|
829 The pattern \*(L"img%%\-%d.jpg\*(R" will specify a sequence of filenames of the
|
yading@10
|
830 form \fIimg%\-1.jpg\fR, \fIimg%\-2.jpg\fR, ..., \fIimg%\-10.jpg\fR,
|
yading@10
|
831 etc.
|
yading@10
|
832 .PP
|
yading@10
|
833 The following example shows how to use \fBffmpeg\fR for creating a
|
yading@10
|
834 sequence of files \fIimg\-001.jpeg\fR, \fIimg\-002.jpeg\fR, ...,
|
yading@10
|
835 taking one image every second from the input video:
|
yading@10
|
836 .PP
|
yading@10
|
837 .Vb 1
|
yading@10
|
838 \& ffmpeg \-i in.avi \-vsync 1 \-r 1 \-f image2 \*(Aqimg\-%03d.jpeg\*(Aq
|
yading@10
|
839 .Ve
|
yading@10
|
840 .PP
|
yading@10
|
841 Note that with \fBffmpeg\fR, if the format is not specified with the
|
yading@10
|
842 \&\f(CW\*(C`\-f\*(C'\fR option and the output filename specifies an image file
|
yading@10
|
843 format, the image2 muxer is automatically selected, so the previous
|
yading@10
|
844 command can be written as:
|
yading@10
|
845 .PP
|
yading@10
|
846 .Vb 1
|
yading@10
|
847 \& ffmpeg \-i in.avi \-vsync 1 \-r 1 \*(Aqimg\-%03d.jpeg\*(Aq
|
yading@10
|
848 .Ve
|
yading@10
|
849 .PP
|
yading@10
|
850 Note also that the pattern must not necessarily contain \*(L"%d\*(R" or
|
yading@10
|
851 "%0\fIN\fRd", for example to create a single image file
|
yading@10
|
852 \&\fIimg.jpeg\fR from the input video you can employ the command:
|
yading@10
|
853 .PP
|
yading@10
|
854 .Vb 1
|
yading@10
|
855 \& ffmpeg \-i in.avi \-f image2 \-frames:v 1 img.jpeg
|
yading@10
|
856 .Ve
|
yading@10
|
857 .IP "\fBstart_number\fR \fInumber\fR" 4
|
yading@10
|
858 .IX Item "start_number number"
|
yading@10
|
859 Start the sequence from \fInumber\fR. Default value is 1. Must be a
|
yading@10
|
860 positive number.
|
yading@10
|
861 .IP "\fB\-update\fR \fInumber\fR" 4
|
yading@10
|
862 .IX Item "-update number"
|
yading@10
|
863 If \fInumber\fR is nonzero, the filename will always be interpreted as just a
|
yading@10
|
864 filename, not a pattern, and this file will be continuously overwritten with new
|
yading@10
|
865 images.
|
yading@10
|
866 .PP
|
yading@10
|
867 The image muxer supports the .Y.U.V image file format. This format is
|
yading@10
|
868 special in that that each image frame consists of three files, for
|
yading@10
|
869 each of the \s-1YUV420P\s0 components. To read or write this image file format,
|
yading@10
|
870 specify the name of the '.Y' file. The muxer will automatically open the
|
yading@10
|
871 \&'.U' and '.V' files as required.
|
yading@10
|
872 .SS "md5"
|
yading@10
|
873 .IX Subsection "md5"
|
yading@10
|
874 \&\s-1MD5\s0 testing format.
|
yading@10
|
875 .PP
|
yading@10
|
876 This muxer computes and prints the \s-1MD5\s0 hash of all the input audio
|
yading@10
|
877 and video frames. By default audio frames are converted to signed
|
yading@10
|
878 16\-bit raw audio and video frames to raw video before computing the
|
yading@10
|
879 hash.
|
yading@10
|
880 .PP
|
yading@10
|
881 The output of the muxer consists of a single line of the form:
|
yading@10
|
882 MD5=\fI\s-1MD5\s0\fR, where \fI\s-1MD5\s0\fR is a hexadecimal number representing
|
yading@10
|
883 the computed \s-1MD5\s0 hash.
|
yading@10
|
884 .PP
|
yading@10
|
885 For example to compute the \s-1MD5\s0 hash of the input converted to raw
|
yading@10
|
886 audio and video, and store it in the file \fIout.md5\fR:
|
yading@10
|
887 .PP
|
yading@10
|
888 .Vb 1
|
yading@10
|
889 \& ffmpeg \-i INPUT \-f md5 out.md5
|
yading@10
|
890 .Ve
|
yading@10
|
891 .PP
|
yading@10
|
892 You can print the \s-1MD5\s0 to stdout with the command:
|
yading@10
|
893 .PP
|
yading@10
|
894 .Vb 1
|
yading@10
|
895 \& ffmpeg \-i INPUT \-f md5 \-
|
yading@10
|
896 .Ve
|
yading@10
|
897 .PP
|
yading@10
|
898 See also the framemd5 muxer.
|
yading@10
|
899 .SS "\s-1MOV/MP4/ISMV\s0"
|
yading@10
|
900 .IX Subsection "MOV/MP4/ISMV"
|
yading@10
|
901 The mov/mp4/ismv muxer supports fragmentation. Normally, a \s-1MOV/MP4\s0
|
yading@10
|
902 file has all the metadata about all packets stored in one location
|
yading@10
|
903 (written at the end of the file, it can be moved to the start for
|
yading@10
|
904 better playback by adding \fIfaststart\fR to the \fImovflags\fR, or
|
yading@10
|
905 using the \fBqt-faststart\fR tool). A fragmented
|
yading@10
|
906 file consists of a number of fragments, where packets and metadata
|
yading@10
|
907 about these packets are stored together. Writing a fragmented
|
yading@10
|
908 file has the advantage that the file is decodable even if the
|
yading@10
|
909 writing is interrupted (while a normal \s-1MOV/MP4\s0 is undecodable if
|
yading@10
|
910 it is not properly finished), and it requires less memory when writing
|
yading@10
|
911 very long files (since writing normal \s-1MOV/MP4\s0 files stores info about
|
yading@10
|
912 every single packet in memory until the file is closed). The downside
|
yading@10
|
913 is that it is less compatible with other applications.
|
yading@10
|
914 .PP
|
yading@10
|
915 Fragmentation is enabled by setting one of the AVOptions that define
|
yading@10
|
916 how to cut the file into fragments:
|
yading@10
|
917 .IP "\fB\-moov_size\fR \fIbytes\fR" 4
|
yading@10
|
918 .IX Item "-moov_size bytes"
|
yading@10
|
919 Reserves space for the moov atom at the beginning of the file instead of placing the
|
yading@10
|
920 moov atom at the end. If the space reserved is insufficient, muxing will fail.
|
yading@10
|
921 .IP "\fB\-movflags frag_keyframe\fR" 4
|
yading@10
|
922 .IX Item "-movflags frag_keyframe"
|
yading@10
|
923 Start a new fragment at each video keyframe.
|
yading@10
|
924 .IP "\fB\-frag_duration\fR \fIduration\fR" 4
|
yading@10
|
925 .IX Item "-frag_duration duration"
|
yading@10
|
926 Create fragments that are \fIduration\fR microseconds long.
|
yading@10
|
927 .IP "\fB\-frag_size\fR \fIsize\fR" 4
|
yading@10
|
928 .IX Item "-frag_size size"
|
yading@10
|
929 Create fragments that contain up to \fIsize\fR bytes of payload data.
|
yading@10
|
930 .IP "\fB\-movflags frag_custom\fR" 4
|
yading@10
|
931 .IX Item "-movflags frag_custom"
|
yading@10
|
932 Allow the caller to manually choose when to cut fragments, by
|
yading@10
|
933 calling \f(CW\*(C`av_write_frame(ctx, NULL)\*(C'\fR to write a fragment with
|
yading@10
|
934 the packets written so far. (This is only useful with other
|
yading@10
|
935 applications integrating libavformat, not from \fBffmpeg\fR.)
|
yading@10
|
936 .IP "\fB\-min_frag_duration\fR \fIduration\fR" 4
|
yading@10
|
937 .IX Item "-min_frag_duration duration"
|
yading@10
|
938 Don't create fragments that are shorter than \fIduration\fR microseconds long.
|
yading@10
|
939 .PP
|
yading@10
|
940 If more than one condition is specified, fragments are cut when
|
yading@10
|
941 one of the specified conditions is fulfilled. The exception to this is
|
yading@10
|
942 \&\f(CW\*(C`\-min_frag_duration\*(C'\fR, which has to be fulfilled for any of the other
|
yading@10
|
943 conditions to apply.
|
yading@10
|
944 .PP
|
yading@10
|
945 Additionally, the way the output file is written can be adjusted
|
yading@10
|
946 through a few other options:
|
yading@10
|
947 .IP "\fB\-movflags empty_moov\fR" 4
|
yading@10
|
948 .IX Item "-movflags empty_moov"
|
yading@10
|
949 Write an initial moov atom directly at the start of the file, without
|
yading@10
|
950 describing any samples in it. Generally, an mdat/moov pair is written
|
yading@10
|
951 at the start of the file, as a normal \s-1MOV/MP4\s0 file, containing only
|
yading@10
|
952 a short portion of the file. With this option set, there is no initial
|
yading@10
|
953 mdat atom, and the moov atom only describes the tracks but has
|
yading@10
|
954 a zero duration.
|
yading@10
|
955 .Sp
|
yading@10
|
956 Files written with this option set do not work in QuickTime.
|
yading@10
|
957 This option is implicitly set when writing ismv (Smooth Streaming) files.
|
yading@10
|
958 .IP "\fB\-movflags separate_moof\fR" 4
|
yading@10
|
959 .IX Item "-movflags separate_moof"
|
yading@10
|
960 Write a separate moof (movie fragment) atom for each track. Normally,
|
yading@10
|
961 packets for all tracks are written in a moof atom (which is slightly
|
yading@10
|
962 more efficient), but with this option set, the muxer writes one moof/mdat
|
yading@10
|
963 pair for each track, making it easier to separate tracks.
|
yading@10
|
964 .Sp
|
yading@10
|
965 This option is implicitly set when writing ismv (Smooth Streaming) files.
|
yading@10
|
966 .IP "\fB\-movflags faststart\fR" 4
|
yading@10
|
967 .IX Item "-movflags faststart"
|
yading@10
|
968 Run a second pass moving the moov atom on top of the file. This
|
yading@10
|
969 operation can take a while, and will not work in various situations such
|
yading@10
|
970 as fragmented output, thus it is not enabled by default.
|
yading@10
|
971 .IP "\fB\-movflags rtphint\fR" 4
|
yading@10
|
972 .IX Item "-movflags rtphint"
|
yading@10
|
973 Add \s-1RTP\s0 hinting tracks to the output file.
|
yading@10
|
974 .PP
|
yading@10
|
975 Smooth Streaming content can be pushed in real time to a publishing
|
yading@10
|
976 point on \s-1IIS\s0 with this muxer. Example:
|
yading@10
|
977 .PP
|
yading@10
|
978 .Vb 1
|
yading@10
|
979 \& ffmpeg \-re <<normal input/transcoding options>> \-movflags isml+frag_keyframe \-f ismv http://server/publishingpoint.isml/Streams(Encoder1)
|
yading@10
|
980 .Ve
|
yading@10
|
981 .SS "mpegts"
|
yading@10
|
982 .IX Subsection "mpegts"
|
yading@10
|
983 \&\s-1MPEG\s0 transport stream muxer.
|
yading@10
|
984 .PP
|
yading@10
|
985 This muxer implements \s-1ISO\s0 13818\-1 and part of \s-1ETSI\s0 \s-1EN\s0 300 468.
|
yading@10
|
986 .PP
|
yading@10
|
987 The muxer options are:
|
yading@10
|
988 .IP "\fB\-mpegts_original_network_id\fR \fInumber\fR" 4
|
yading@10
|
989 .IX Item "-mpegts_original_network_id number"
|
yading@10
|
990 Set the original_network_id (default 0x0001). This is unique identifier
|
yading@10
|
991 of a network in \s-1DVB\s0. Its main use is in the unique identification of a
|
yading@10
|
992 service through the path Original_Network_ID, Transport_Stream_ID.
|
yading@10
|
993 .IP "\fB\-mpegts_transport_stream_id\fR \fInumber\fR" 4
|
yading@10
|
994 .IX Item "-mpegts_transport_stream_id number"
|
yading@10
|
995 Set the transport_stream_id (default 0x0001). This identifies a
|
yading@10
|
996 transponder in \s-1DVB\s0.
|
yading@10
|
997 .IP "\fB\-mpegts_service_id\fR \fInumber\fR" 4
|
yading@10
|
998 .IX Item "-mpegts_service_id number"
|
yading@10
|
999 Set the service_id (default 0x0001) also known as program in \s-1DVB\s0.
|
yading@10
|
1000 .IP "\fB\-mpegts_pmt_start_pid\fR \fInumber\fR" 4
|
yading@10
|
1001 .IX Item "-mpegts_pmt_start_pid number"
|
yading@10
|
1002 Set the first \s-1PID\s0 for \s-1PMT\s0 (default 0x1000, max 0x1f00).
|
yading@10
|
1003 .IP "\fB\-mpegts_start_pid\fR \fInumber\fR" 4
|
yading@10
|
1004 .IX Item "-mpegts_start_pid number"
|
yading@10
|
1005 Set the first \s-1PID\s0 for data packets (default 0x0100, max 0x0f00).
|
yading@10
|
1006 .PP
|
yading@10
|
1007 The recognized metadata settings in mpegts muxer are \f(CW\*(C`service_provider\*(C'\fR
|
yading@10
|
1008 and \f(CW\*(C`service_name\*(C'\fR. If they are not set the default for
|
yading@10
|
1009 \&\f(CW\*(C`service_provider\*(C'\fR is \*(L"FFmpeg\*(R" and the default for
|
yading@10
|
1010 \&\f(CW\*(C`service_name\*(C'\fR is \*(L"Service01\*(R".
|
yading@10
|
1011 .PP
|
yading@10
|
1012 .Vb 9
|
yading@10
|
1013 \& ffmpeg \-i file.mpg \-c copy \e
|
yading@10
|
1014 \& \-mpegts_original_network_id 0x1122 \e
|
yading@10
|
1015 \& \-mpegts_transport_stream_id 0x3344 \e
|
yading@10
|
1016 \& \-mpegts_service_id 0x5566 \e
|
yading@10
|
1017 \& \-mpegts_pmt_start_pid 0x1500 \e
|
yading@10
|
1018 \& \-mpegts_start_pid 0x150 \e
|
yading@10
|
1019 \& \-metadata service_provider="Some provider" \e
|
yading@10
|
1020 \& \-metadata service_name="Some Channel" \e
|
yading@10
|
1021 \& \-y out.ts
|
yading@10
|
1022 .Ve
|
yading@10
|
1023 .SS "null"
|
yading@10
|
1024 .IX Subsection "null"
|
yading@10
|
1025 Null muxer.
|
yading@10
|
1026 .PP
|
yading@10
|
1027 This muxer does not generate any output file, it is mainly useful for
|
yading@10
|
1028 testing or benchmarking purposes.
|
yading@10
|
1029 .PP
|
yading@10
|
1030 For example to benchmark decoding with \fBffmpeg\fR you can use the
|
yading@10
|
1031 command:
|
yading@10
|
1032 .PP
|
yading@10
|
1033 .Vb 1
|
yading@10
|
1034 \& ffmpeg \-benchmark \-i INPUT \-f null out.null
|
yading@10
|
1035 .Ve
|
yading@10
|
1036 .PP
|
yading@10
|
1037 Note that the above command does not read or write the \fIout.null\fR
|
yading@10
|
1038 file, but specifying the output file is required by the \fBffmpeg\fR
|
yading@10
|
1039 syntax.
|
yading@10
|
1040 .PP
|
yading@10
|
1041 Alternatively you can write the command as:
|
yading@10
|
1042 .PP
|
yading@10
|
1043 .Vb 1
|
yading@10
|
1044 \& ffmpeg \-benchmark \-i INPUT \-f null \-
|
yading@10
|
1045 .Ve
|
yading@10
|
1046 .SS "matroska"
|
yading@10
|
1047 .IX Subsection "matroska"
|
yading@10
|
1048 Matroska container muxer.
|
yading@10
|
1049 .PP
|
yading@10
|
1050 This muxer implements the matroska and webm container specs.
|
yading@10
|
1051 .PP
|
yading@10
|
1052 The recognized metadata settings in this muxer are:
|
yading@10
|
1053 .IP "\fBtitle=\fR\fItitle name\fR" 4
|
yading@10
|
1054 .IX Item "title=title name"
|
yading@10
|
1055 Name provided to a single track
|
yading@10
|
1056 .IP "\fBlanguage=\fR\fIlanguage name\fR" 4
|
yading@10
|
1057 .IX Item "language=language name"
|
yading@10
|
1058 Specifies the language of the track in the Matroska languages form
|
yading@10
|
1059 .IP "\fBstereo_mode=\fR\fImode\fR" 4
|
yading@10
|
1060 .IX Item "stereo_mode=mode"
|
yading@10
|
1061 Stereo 3D video layout of two views in a single video track
|
yading@10
|
1062 .RS 4
|
yading@10
|
1063 .IP "\fBmono\fR" 4
|
yading@10
|
1064 .IX Item "mono"
|
yading@10
|
1065 video is not stereo
|
yading@10
|
1066 .IP "\fBleft_right\fR" 4
|
yading@10
|
1067 .IX Item "left_right"
|
yading@10
|
1068 Both views are arranged side by side, Left-eye view is on the left
|
yading@10
|
1069 .IP "\fBbottom_top\fR" 4
|
yading@10
|
1070 .IX Item "bottom_top"
|
yading@10
|
1071 Both views are arranged in top-bottom orientation, Left-eye view is at bottom
|
yading@10
|
1072 .IP "\fBtop_bottom\fR" 4
|
yading@10
|
1073 .IX Item "top_bottom"
|
yading@10
|
1074 Both views are arranged in top-bottom orientation, Left-eye view is on top
|
yading@10
|
1075 .IP "\fBcheckerboard_rl\fR" 4
|
yading@10
|
1076 .IX Item "checkerboard_rl"
|
yading@10
|
1077 Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
|
yading@10
|
1078 .IP "\fBcheckerboard_lr\fR" 4
|
yading@10
|
1079 .IX Item "checkerboard_lr"
|
yading@10
|
1080 Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
|
yading@10
|
1081 .IP "\fBrow_interleaved_rl\fR" 4
|
yading@10
|
1082 .IX Item "row_interleaved_rl"
|
yading@10
|
1083 Each view is constituted by a row based interleaving, Right-eye view is first row
|
yading@10
|
1084 .IP "\fBrow_interleaved_lr\fR" 4
|
yading@10
|
1085 .IX Item "row_interleaved_lr"
|
yading@10
|
1086 Each view is constituted by a row based interleaving, Left-eye view is first row
|
yading@10
|
1087 .IP "\fBcol_interleaved_rl\fR" 4
|
yading@10
|
1088 .IX Item "col_interleaved_rl"
|
yading@10
|
1089 Both views are arranged in a column based interleaving manner, Right-eye view is first column
|
yading@10
|
1090 .IP "\fBcol_interleaved_lr\fR" 4
|
yading@10
|
1091 .IX Item "col_interleaved_lr"
|
yading@10
|
1092 Both views are arranged in a column based interleaving manner, Left-eye view is first column
|
yading@10
|
1093 .IP "\fBanaglyph_cyan_red\fR" 4
|
yading@10
|
1094 .IX Item "anaglyph_cyan_red"
|
yading@10
|
1095 All frames are in anaglyph format viewable through red-cyan filters
|
yading@10
|
1096 .IP "\fBright_left\fR" 4
|
yading@10
|
1097 .IX Item "right_left"
|
yading@10
|
1098 Both views are arranged side by side, Right-eye view is on the left
|
yading@10
|
1099 .IP "\fBanaglyph_green_magenta\fR" 4
|
yading@10
|
1100 .IX Item "anaglyph_green_magenta"
|
yading@10
|
1101 All frames are in anaglyph format viewable through green-magenta filters
|
yading@10
|
1102 .IP "\fBblock_lr\fR" 4
|
yading@10
|
1103 .IX Item "block_lr"
|
yading@10
|
1104 Both eyes laced in one Block, Left-eye view is first
|
yading@10
|
1105 .IP "\fBblock_rl\fR" 4
|
yading@10
|
1106 .IX Item "block_rl"
|
yading@10
|
1107 Both eyes laced in one Block, Right-eye view is first
|
yading@10
|
1108 .RE
|
yading@10
|
1109 .RS 4
|
yading@10
|
1110 .RE
|
yading@10
|
1111 .PP
|
yading@10
|
1112 For example a 3D WebM clip can be created using the following command line:
|
yading@10
|
1113 .PP
|
yading@10
|
1114 .Vb 1
|
yading@10
|
1115 \& ffmpeg \-i sample_left_right_clip.mpg \-an \-c:v libvpx \-metadata stereo_mode=left_right \-y stereo_clip.webm
|
yading@10
|
1116 .Ve
|
yading@10
|
1117 .SS "segment, stream_segment, ssegment"
|
yading@10
|
1118 .IX Subsection "segment, stream_segment, ssegment"
|
yading@10
|
1119 Basic stream segmenter.
|
yading@10
|
1120 .PP
|
yading@10
|
1121 The segmenter muxer outputs streams to a number of separate files of nearly
|
yading@10
|
1122 fixed duration. Output filename pattern can be set in a fashion similar to
|
yading@10
|
1123 image2.
|
yading@10
|
1124 .PP
|
yading@10
|
1125 \&\f(CW\*(C`stream_segment\*(C'\fR is a variant of the muxer used to write to
|
yading@10
|
1126 streaming output formats, i.e. which do not require global headers,
|
yading@10
|
1127 and is recommended for outputting e.g. to \s-1MPEG\s0 transport stream segments.
|
yading@10
|
1128 \&\f(CW\*(C`ssegment\*(C'\fR is a shorter alias for \f(CW\*(C`stream_segment\*(C'\fR.
|
yading@10
|
1129 .PP
|
yading@10
|
1130 Every segment starts with a keyframe of the selected reference stream,
|
yading@10
|
1131 which is set through the \fBreference_stream\fR option.
|
yading@10
|
1132 .PP
|
yading@10
|
1133 Note that if you want accurate splitting for a video file, you need to
|
yading@10
|
1134 make the input key frames correspond to the exact splitting times
|
yading@10
|
1135 expected by the segmenter, or the segment muxer will start the new
|
yading@10
|
1136 segment with the key frame found next after the specified start
|
yading@10
|
1137 time.
|
yading@10
|
1138 .PP
|
yading@10
|
1139 The segment muxer works best with a single constant frame rate video.
|
yading@10
|
1140 .PP
|
yading@10
|
1141 Optionally it can generate a list of the created segments, by setting
|
yading@10
|
1142 the option \fIsegment_list\fR. The list type is specified by the
|
yading@10
|
1143 \&\fIsegment_list_type\fR option.
|
yading@10
|
1144 .PP
|
yading@10
|
1145 The segment muxer supports the following options:
|
yading@10
|
1146 .IP "\fBreference_stream\fR \fIspecifier\fR" 4
|
yading@10
|
1147 .IX Item "reference_stream specifier"
|
yading@10
|
1148 Set the reference stream, as specified by the string \fIspecifier\fR.
|
yading@10
|
1149 If \fIspecifier\fR is set to \f(CW\*(C`auto\*(C'\fR, the reference is choosen
|
yading@10
|
1150 automatically. Otherwise it must be a stream specifier (see the ``Stream
|
yading@10
|
1151 specifiers'' chapter in the ffmpeg manual) which specifies the
|
yading@10
|
1152 reference stream. The default value is ``auto''.
|
yading@10
|
1153 .IP "\fBsegment_format\fR \fIformat\fR" 4
|
yading@10
|
1154 .IX Item "segment_format format"
|
yading@10
|
1155 Override the inner container format, by default it is guessed by the filename
|
yading@10
|
1156 extension.
|
yading@10
|
1157 .IP "\fBsegment_list\fR \fIname\fR" 4
|
yading@10
|
1158 .IX Item "segment_list name"
|
yading@10
|
1159 Generate also a listfile named \fIname\fR. If not specified no
|
yading@10
|
1160 listfile is generated.
|
yading@10
|
1161 .IP "\fBsegment_list_flags\fR \fIflags\fR" 4
|
yading@10
|
1162 .IX Item "segment_list_flags flags"
|
yading@10
|
1163 Set flags affecting the segment list generation.
|
yading@10
|
1164 .Sp
|
yading@10
|
1165 It currently supports the following flags:
|
yading@10
|
1166 .RS 4
|
yading@10
|
1167 .IP "\fIcache\fR" 4
|
yading@10
|
1168 .IX Item "cache"
|
yading@10
|
1169 Allow caching (only affects M3U8 list files).
|
yading@10
|
1170 .IP "\fIlive\fR" 4
|
yading@10
|
1171 .IX Item "live"
|
yading@10
|
1172 Allow live-friendly file generation.
|
yading@10
|
1173 .RE
|
yading@10
|
1174 .RS 4
|
yading@10
|
1175 .Sp
|
yading@10
|
1176 Default value is \f(CW\*(C`cache\*(C'\fR.
|
yading@10
|
1177 .RE
|
yading@10
|
1178 .IP "\fBsegment_list_size\fR \fIsize\fR" 4
|
yading@10
|
1179 .IX Item "segment_list_size size"
|
yading@10
|
1180 Update the list file so that it contains at most the last \fIsize\fR
|
yading@10
|
1181 segments. If 0 the list file will contain all the segments. Default
|
yading@10
|
1182 value is 0.
|
yading@10
|
1183 .IP "\fBsegment_list type\fR \fItype\fR" 4
|
yading@10
|
1184 .IX Item "segment_list type type"
|
yading@10
|
1185 Specify the format for the segment list file.
|
yading@10
|
1186 .Sp
|
yading@10
|
1187 The following values are recognized:
|
yading@10
|
1188 .RS 4
|
yading@10
|
1189 .IP "\fBflat\fR" 4
|
yading@10
|
1190 .IX Item "flat"
|
yading@10
|
1191 Generate a flat list for the created segments, one segment per line.
|
yading@10
|
1192 .IP "\fBcsv, ext\fR" 4
|
yading@10
|
1193 .IX Item "csv, ext"
|
yading@10
|
1194 Generate a list for the created segments, one segment per line,
|
yading@10
|
1195 each line matching the format (comma-separated values):
|
yading@10
|
1196 .Sp
|
yading@10
|
1197 .Vb 1
|
yading@10
|
1198 \& <segment_filename>,<segment_start_time>,<segment_end_time>
|
yading@10
|
1199 .Ve
|
yading@10
|
1200 .Sp
|
yading@10
|
1201 \&\fIsegment_filename\fR is the name of the output file generated by the
|
yading@10
|
1202 muxer according to the provided pattern. \s-1CSV\s0 escaping (according to
|
yading@10
|
1203 \&\s-1RFC4180\s0) is applied if required.
|
yading@10
|
1204 .Sp
|
yading@10
|
1205 \&\fIsegment_start_time\fR and \fIsegment_end_time\fR specify
|
yading@10
|
1206 the segment start and end time expressed in seconds.
|
yading@10
|
1207 .Sp
|
yading@10
|
1208 A list file with the suffix \f(CW".csv"\fR or \f(CW".ext"\fR will
|
yading@10
|
1209 auto-select this format.
|
yading@10
|
1210 .Sp
|
yading@10
|
1211 \&\f(CW\*(C`ext\*(C'\fR is deprecated in favor or \f(CW\*(C`csv\*(C'\fR.
|
yading@10
|
1212 .IP "\fBffconcat\fR" 4
|
yading@10
|
1213 .IX Item "ffconcat"
|
yading@10
|
1214 Generate an ffconcat file for the created segments. The resulting file
|
yading@10
|
1215 can be read using the FFmpeg concat demuxer.
|
yading@10
|
1216 .Sp
|
yading@10
|
1217 A list file with the suffix \f(CW".ffcat"\fR or \f(CW".ffconcat"\fR will
|
yading@10
|
1218 auto-select this format.
|
yading@10
|
1219 .IP "\fBm3u8\fR" 4
|
yading@10
|
1220 .IX Item "m3u8"
|
yading@10
|
1221 Generate an extended M3U8 file, version 3, compliant with
|
yading@10
|
1222 <\fBhttp://tools.ietf.org/id/draft\-pantos\-http\-live\-streaming\fR>.
|
yading@10
|
1223 .Sp
|
yading@10
|
1224 A list file with the suffix \f(CW".m3u8"\fR will auto-select this format.
|
yading@10
|
1225 .RE
|
yading@10
|
1226 .RS 4
|
yading@10
|
1227 .Sp
|
yading@10
|
1228 If not specified the type is guessed from the list file name suffix.
|
yading@10
|
1229 .RE
|
yading@10
|
1230 .IP "\fBsegment_time\fR \fItime\fR" 4
|
yading@10
|
1231 .IX Item "segment_time time"
|
yading@10
|
1232 Set segment duration to \fItime\fR, the value must be a duration
|
yading@10
|
1233 specification. Default value is \*(L"2\*(R". See also the
|
yading@10
|
1234 \&\fBsegment_times\fR option.
|
yading@10
|
1235 .Sp
|
yading@10
|
1236 Note that splitting may not be accurate, unless you force the
|
yading@10
|
1237 reference stream key-frames at the given time. See the introductory
|
yading@10
|
1238 notice and the examples below.
|
yading@10
|
1239 .IP "\fBsegment_time_delta\fR \fIdelta\fR" 4
|
yading@10
|
1240 .IX Item "segment_time_delta delta"
|
yading@10
|
1241 Specify the accuracy time when selecting the start time for a
|
yading@10
|
1242 segment, expressed as a duration specification. Default value is \*(L"0\*(R".
|
yading@10
|
1243 .Sp
|
yading@10
|
1244 When delta is specified a key-frame will start a new segment if its
|
yading@10
|
1245 \&\s-1PTS\s0 satisfies the relation:
|
yading@10
|
1246 .Sp
|
yading@10
|
1247 .Vb 1
|
yading@10
|
1248 \& PTS >= start_time \- time_delta
|
yading@10
|
1249 .Ve
|
yading@10
|
1250 .Sp
|
yading@10
|
1251 This option is useful when splitting video content, which is always
|
yading@10
|
1252 split at \s-1GOP\s0 boundaries, in case a key frame is found just before the
|
yading@10
|
1253 specified split time.
|
yading@10
|
1254 .Sp
|
yading@10
|
1255 In particular may be used in combination with the \fIffmpeg\fR option
|
yading@10
|
1256 \&\fIforce_key_frames\fR. The key frame times specified by
|
yading@10
|
1257 \&\fIforce_key_frames\fR may not be set accurately because of rounding
|
yading@10
|
1258 issues, with the consequence that a key frame time may result set just
|
yading@10
|
1259 before the specified time. For constant frame rate videos a value of
|
yading@10
|
1260 1/2*\fIframe_rate\fR should address the worst case mismatch between
|
yading@10
|
1261 the specified time and the time set by \fIforce_key_frames\fR.
|
yading@10
|
1262 .IP "\fBsegment_times\fR \fItimes\fR" 4
|
yading@10
|
1263 .IX Item "segment_times times"
|
yading@10
|
1264 Specify a list of split points. \fItimes\fR contains a list of comma
|
yading@10
|
1265 separated duration specifications, in increasing order. See also
|
yading@10
|
1266 the \fBsegment_time\fR option.
|
yading@10
|
1267 .IP "\fBsegment_frames\fR \fIframes\fR" 4
|
yading@10
|
1268 .IX Item "segment_frames frames"
|
yading@10
|
1269 Specify a list of split video frame numbers. \fIframes\fR contains a
|
yading@10
|
1270 list of comma separated integer numbers, in increasing order.
|
yading@10
|
1271 .Sp
|
yading@10
|
1272 This option specifies to start a new segment whenever a reference
|
yading@10
|
1273 stream key frame is found and the sequential number (starting from 0)
|
yading@10
|
1274 of the frame is greater or equal to the next value in the list.
|
yading@10
|
1275 .IP "\fBsegment_wrap\fR \fIlimit\fR" 4
|
yading@10
|
1276 .IX Item "segment_wrap limit"
|
yading@10
|
1277 Wrap around segment index once it reaches \fIlimit\fR.
|
yading@10
|
1278 .IP "\fBsegment_start_number\fR \fInumber\fR" 4
|
yading@10
|
1279 .IX Item "segment_start_number number"
|
yading@10
|
1280 Set the sequence number of the first segment. Defaults to \f(CW0\fR.
|
yading@10
|
1281 .IP "\fBreset_timestamps\fR \fI1|0\fR" 4
|
yading@10
|
1282 .IX Item "reset_timestamps 1|0"
|
yading@10
|
1283 Reset timestamps at the begin of each segment, so that each segment
|
yading@10
|
1284 will start with near-zero timestamps. It is meant to ease the playback
|
yading@10
|
1285 of the generated segments. May not work with some combinations of
|
yading@10
|
1286 muxers/codecs. It is set to \f(CW0\fR by default.
|
yading@10
|
1287 .PP
|
yading@10
|
1288 \fIExamples\fR
|
yading@10
|
1289 .IX Subsection "Examples"
|
yading@10
|
1290 .IP "\(bu" 4
|
yading@10
|
1291 To remux the content of file \fIin.mkv\fR to a list of segments
|
yading@10
|
1292 \&\fIout\-000.nut\fR, \fIout\-001.nut\fR, etc., and write the list of
|
yading@10
|
1293 generated segments to \fIout.list\fR:
|
yading@10
|
1294 .Sp
|
yading@10
|
1295 .Vb 1
|
yading@10
|
1296 \& ffmpeg \-i in.mkv \-codec copy \-map 0 \-f segment \-segment_list out.list out%03d.nut
|
yading@10
|
1297 .Ve
|
yading@10
|
1298 .IP "\(bu" 4
|
yading@10
|
1299 As the example above, but segment the input file according to the split
|
yading@10
|
1300 points specified by the \fIsegment_times\fR option:
|
yading@10
|
1301 .Sp
|
yading@10
|
1302 .Vb 1
|
yading@10
|
1303 \& ffmpeg \-i in.mkv \-codec copy \-map 0 \-f segment \-segment_list out.csv \-segment_times 1,2,3,5,8,13,21 out%03d.nut
|
yading@10
|
1304 .Ve
|
yading@10
|
1305 .IP "\(bu" 4
|
yading@10
|
1306 As the example above, but use the \f(CW\*(C`ffmpeg\*(C'\fR \fIforce_key_frames\fR
|
yading@10
|
1307 option to force key frames in the input at the specified location, together
|
yading@10
|
1308 with the segment option \fIsegment_time_delta\fR to account for
|
yading@10
|
1309 possible roundings operated when setting key frame times.
|
yading@10
|
1310 .Sp
|
yading@10
|
1311 .Vb 2
|
yading@10
|
1312 \& ffmpeg \-i in.mkv \-force_key_frames 1,2,3,5,8,13,21 \-codec:v mpeg4 \-codec:a pcm_s16le \-map 0 \e
|
yading@10
|
1313 \& \-f segment \-segment_list out.csv \-segment_times 1,2,3,5,8,13,21 \-segment_time_delta 0.05 out%03d.nut
|
yading@10
|
1314 .Ve
|
yading@10
|
1315 .Sp
|
yading@10
|
1316 In order to force key frames on the input file, transcoding is
|
yading@10
|
1317 required.
|
yading@10
|
1318 .IP "\(bu" 4
|
yading@10
|
1319 Segment the input file by splitting the input file according to the
|
yading@10
|
1320 frame numbers sequence specified with the \fIsegment_frames\fR option:
|
yading@10
|
1321 .Sp
|
yading@10
|
1322 .Vb 1
|
yading@10
|
1323 \& ffmpeg \-i in.mkv \-codec copy \-map 0 \-f segment \-segment_list out.csv \-segment_frames 100,200,300,500,800 out%03d.nut
|
yading@10
|
1324 .Ve
|
yading@10
|
1325 .IP "\(bu" 4
|
yading@10
|
1326 To convert the \fIin.mkv\fR to \s-1TS\s0 segments using the \f(CW\*(C`libx264\*(C'\fR
|
yading@10
|
1327 and \f(CW\*(C`libfaac\*(C'\fR encoders:
|
yading@10
|
1328 .Sp
|
yading@10
|
1329 .Vb 1
|
yading@10
|
1330 \& ffmpeg \-i in.mkv \-map 0 \-codec:v libx264 \-codec:a libfaac \-f ssegment \-segment_list out.list out%03d.ts
|
yading@10
|
1331 .Ve
|
yading@10
|
1332 .IP "\(bu" 4
|
yading@10
|
1333 Segment the input file, and create an M3U8 live playlist (can be used
|
yading@10
|
1334 as live \s-1HLS\s0 source):
|
yading@10
|
1335 .Sp
|
yading@10
|
1336 .Vb 2
|
yading@10
|
1337 \& ffmpeg \-re \-i in.mkv \-codec copy \-map 0 \-f segment \-segment_list playlist.m3u8 \e
|
yading@10
|
1338 \& \-segment_list_flags +live \-segment_time 10 out%03d.mkv
|
yading@10
|
1339 .Ve
|
yading@10
|
1340 .SS "mp3"
|
yading@10
|
1341 .IX Subsection "mp3"
|
yading@10
|
1342 The \s-1MP3\s0 muxer writes a raw \s-1MP3\s0 stream with an ID3v2 header at the beginning and
|
yading@10
|
1343 optionally an ID3v1 tag at the end. ID3v2.3 and ID3v2.4 are supported, the
|
yading@10
|
1344 \&\f(CW\*(C`id3v2_version\*(C'\fR option controls which one is used. The legacy ID3v1 tag is
|
yading@10
|
1345 not written by default, but may be enabled with the \f(CW\*(C`write_id3v1\*(C'\fR option.
|
yading@10
|
1346 .PP
|
yading@10
|
1347 For seekable output the muxer also writes a Xing frame at the beginning, which
|
yading@10
|
1348 contains the number of frames in the file. It is useful for computing duration
|
yading@10
|
1349 of \s-1VBR\s0 files.
|
yading@10
|
1350 .PP
|
yading@10
|
1351 The muxer supports writing ID3v2 attached pictures (\s-1APIC\s0 frames). The pictures
|
yading@10
|
1352 are supplied to the muxer in form of a video stream with a single packet. There
|
yading@10
|
1353 can be any number of those streams, each will correspond to a single \s-1APIC\s0 frame.
|
yading@10
|
1354 The stream metadata tags \fItitle\fR and \fIcomment\fR map to \s-1APIC\s0
|
yading@10
|
1355 \&\fIdescription\fR and \fIpicture type\fR respectively. See
|
yading@10
|
1356 <\fBhttp://id3.org/id3v2.4.0\-frames\fR> for allowed picture types.
|
yading@10
|
1357 .PP
|
yading@10
|
1358 Note that the \s-1APIC\s0 frames must be written at the beginning, so the muxer will
|
yading@10
|
1359 buffer the audio frames until it gets all the pictures. It is therefore advised
|
yading@10
|
1360 to provide the pictures as soon as possible to avoid excessive buffering.
|
yading@10
|
1361 .PP
|
yading@10
|
1362 Examples:
|
yading@10
|
1363 .PP
|
yading@10
|
1364 Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
|
yading@10
|
1365 .PP
|
yading@10
|
1366 .Vb 1
|
yading@10
|
1367 \& ffmpeg \-i INPUT \-id3v2_version 3 \-write_id3v1 1 out.mp3
|
yading@10
|
1368 .Ve
|
yading@10
|
1369 .PP
|
yading@10
|
1370 To attach a picture to an mp3 file select both the audio and the picture stream
|
yading@10
|
1371 with \f(CW\*(C`map\*(C'\fR:
|
yading@10
|
1372 .PP
|
yading@10
|
1373 .Vb 2
|
yading@10
|
1374 \& ffmpeg \-i input.mp3 \-i cover.png \-c copy \-map 0 \-map 1
|
yading@10
|
1375 \& \-metadata:s:v title="Album cover" \-metadata:s:v comment="Cover (Front)" out.mp3
|
yading@10
|
1376 .Ve
|
yading@10
|
1377 .SS "ogg"
|
yading@10
|
1378 .IX Subsection "ogg"
|
yading@10
|
1379 Ogg container muxer.
|
yading@10
|
1380 .IP "\fB\-page_duration\fR \fIduration\fR" 4
|
yading@10
|
1381 .IX Item "-page_duration duration"
|
yading@10
|
1382 Preferred page duration, in microseconds. The muxer will attempt to create
|
yading@10
|
1383 pages that are approximately \fIduration\fR microseconds long. This allows the
|
yading@10
|
1384 user to compromise between seek granularity and container overhead. The default
|
yading@10
|
1385 is 1 second. A value of 0 will fill all segments, making pages as large as
|
yading@10
|
1386 possible. A value of 1 will effectively use 1 packet-per-page in most
|
yading@10
|
1387 situations, giving a small seek granularity at the cost of additional container
|
yading@10
|
1388 overhead.
|
yading@10
|
1389 .SS "tee"
|
yading@10
|
1390 .IX Subsection "tee"
|
yading@10
|
1391 The tee muxer can be used to write the same data to several files or any
|
yading@10
|
1392 other kind of muxer. It can be used, for example, to both stream a video to
|
yading@10
|
1393 the network and save it to disk at the same time.
|
yading@10
|
1394 .PP
|
yading@10
|
1395 It is different from specifying several outputs to the \fBffmpeg\fR
|
yading@10
|
1396 command-line tool because the audio and video data will be encoded only once
|
yading@10
|
1397 with the tee muxer; encoding can be a very expensive process. It is not
|
yading@10
|
1398 useful when using the libavformat \s-1API\s0 directly because it is then possible
|
yading@10
|
1399 to feed the same packets to several muxers directly.
|
yading@10
|
1400 .PP
|
yading@10
|
1401 The slave outputs are specified in the file name given to the muxer,
|
yading@10
|
1402 separated by '|'. If any of the slave name contains the '|' separator,
|
yading@10
|
1403 leading or trailing spaces or any special character, it must be
|
yading@10
|
1404 escaped (see the ``Quoting and escaping'' section in the ffmpeg-utils
|
yading@10
|
1405 manual).
|
yading@10
|
1406 .PP
|
yading@10
|
1407 Options can be specified for each slave by prepending them as a list of
|
yading@10
|
1408 \&\fIkey\fR=\fIvalue\fR pairs separated by ':', between square brackets. If
|
yading@10
|
1409 the options values contain a special character or the ':' separator, they
|
yading@10
|
1410 must be escaped; note that this is a second level escaping.
|
yading@10
|
1411 .PP
|
yading@10
|
1412 Example: encode something and both archive it in a WebM file and stream it
|
yading@10
|
1413 as MPEG-TS over \s-1UDP\s0 (the streams need to be explicitly mapped):
|
yading@10
|
1414 .PP
|
yading@10
|
1415 .Vb 2
|
yading@10
|
1416 \& ffmpeg \-i ... \-c:v libx264 \-c:a mp2 \-f tee \-map 0:v \-map 0:a
|
yading@10
|
1417 \& "archive\-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/"
|
yading@10
|
1418 .Ve
|
yading@10
|
1419 .PP
|
yading@10
|
1420 Note: some codecs may need different options depending on the output format;
|
yading@10
|
1421 the auto-detection of this can not work with the tee muxer. The main example
|
yading@10
|
1422 is the \fBglobal_header\fR flag.
|
yading@10
|
1423 .SH "METADATA"
|
yading@10
|
1424 .IX Header "METADATA"
|
yading@10
|
1425 FFmpeg is able to dump metadata from media files into a simple UTF\-8\-encoded
|
yading@10
|
1426 INI-like text file and then load it back using the metadata muxer/demuxer.
|
yading@10
|
1427 .PP
|
yading@10
|
1428 The file format is as follows:
|
yading@10
|
1429 .IP "1." 4
|
yading@10
|
1430 A file consists of a header and a number of metadata tags divided into sections,
|
yading@10
|
1431 each on its own line.
|
yading@10
|
1432 .IP "2." 4
|
yading@10
|
1433 The header is a ';FFMETADATA' string, followed by a version number (now 1).
|
yading@10
|
1434 .IP "3." 4
|
yading@10
|
1435 Metadata tags are of the form 'key=value'
|
yading@10
|
1436 .IP "4." 4
|
yading@10
|
1437 Immediately after header follows global metadata
|
yading@10
|
1438 .IP "5." 4
|
yading@10
|
1439 After global metadata there may be sections with per\-stream/per\-chapter
|
yading@10
|
1440 metadata.
|
yading@10
|
1441 .IP "6." 4
|
yading@10
|
1442 A section starts with the section name in uppercase (i.e. \s-1STREAM\s0 or \s-1CHAPTER\s0) in
|
yading@10
|
1443 brackets ('[', ']') and ends with next section or end of file.
|
yading@10
|
1444 .IP "7." 4
|
yading@10
|
1445 At the beginning of a chapter section there may be an optional timebase to be
|
yading@10
|
1446 used for start/end values. It must be in form 'TIMEBASE=num/den', where num and
|
yading@10
|
1447 den are integers. If the timebase is missing then start/end times are assumed to
|
yading@10
|
1448 be in milliseconds.
|
yading@10
|
1449 Next a chapter section must contain chapter start and end times in form
|
yading@10
|
1450 \&'START=num', 'END=num', where num is a positive integer.
|
yading@10
|
1451 .IP "8." 4
|
yading@10
|
1452 Empty lines and lines starting with ';' or '#' are ignored.
|
yading@10
|
1453 .IP "9." 4
|
yading@10
|
1454 Metadata keys or values containing special characters ('=', ';', '#', '\e' and a
|
yading@10
|
1455 newline) must be escaped with a backslash '\e'.
|
yading@10
|
1456 .IP "10." 4
|
yading@10
|
1457 Note that whitespace in metadata (e.g. foo = bar) is considered to be a part of
|
yading@10
|
1458 the tag (in the example above key is 'foo ', value is ' bar').
|
yading@10
|
1459 .PP
|
yading@10
|
1460 A ffmetadata file might look like this:
|
yading@10
|
1461 .PP
|
yading@10
|
1462 .Vb 4
|
yading@10
|
1463 \& ;FFMETADATA1
|
yading@10
|
1464 \& title=bike\e\eshed
|
yading@10
|
1465 \& ;this is a comment
|
yading@10
|
1466 \& artist=FFmpeg troll team
|
yading@10
|
1467 \&
|
yading@10
|
1468 \& [CHAPTER]
|
yading@10
|
1469 \& TIMEBASE=1/1000
|
yading@10
|
1470 \& START=0
|
yading@10
|
1471 \& #chapter ends at 0:01:00
|
yading@10
|
1472 \& END=60000
|
yading@10
|
1473 \& title=chapter \e#1
|
yading@10
|
1474 \& [STREAM]
|
yading@10
|
1475 \& title=multi\e
|
yading@10
|
1476 \& line
|
yading@10
|
1477 .Ve
|
yading@10
|
1478 .SH "SEE ALSO"
|
yading@10
|
1479 .IX Header "SEE ALSO"
|
yading@10
|
1480 \&\fIffmpeg\fR\|(1), \fIffplay\fR\|(1), \fIffprobe\fR\|(1), \fIffserver\fR\|(1), \fIlibavformat\fR\|(3)
|
yading@10
|
1481 .SH "AUTHORS"
|
yading@10
|
1482 .IX Header "AUTHORS"
|
yading@10
|
1483 The FFmpeg developers.
|
yading@10
|
1484 .PP
|
yading@10
|
1485 For details about the authorship, see the Git history of the project
|
yading@10
|
1486 (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
|
yading@10
|
1487 \&\fBgit log\fR in the FFmpeg source directory, or browsing the
|
yading@10
|
1488 online repository at <\fBhttp://source.ffmpeg.org\fR>.
|
yading@10
|
1489 .PP
|
yading@10
|
1490 Maintainers for the specific components are listed in the file
|
yading@10
|
1491 \&\fI\s-1MAINTAINERS\s0\fR in the source code tree.
|