1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
3 <!-- Created on June 10, 2011 by texi2html 1.82
4 texi2html was written by:
5 Lionel Cons <Lionel.Cons@cern.ch> (original author)
6 Karl Berry <karl@freefriends.org>
7 Olaf Bachmann <obachman@mathematik.uni-kl.de>
9 Maintained by: Many creative people.
10 Send bugs and suggestions to <texi2html-bug@nongnu.org>
13 <title>ffmpeg Documentation</title>
15 <meta name="description" content="ffmpeg Documentation">
16 <meta name="keywords" content="ffmpeg Documentation">
17 <meta name="resource-type" content="document">
18 <meta name="distribution" content="global">
19 <meta name="Generator" content="texi2html 1.82">
20 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
21 <style type="text/css">
23 a.summary-letter {text-decoration: none}
24 blockquote.smallquotation {font-size: smaller}
25 pre.display {font-family: serif}
26 pre.format {font-family: serif}
27 pre.menu-comment {font-family: serif}
28 pre.menu-preformatted {font-family: serif}
29 pre.smalldisplay {font-family: serif; font-size: smaller}
30 pre.smallexample {font-size: smaller}
31 pre.smallformat {font-family: serif; font-size: smaller}
32 pre.smalllisp {font-size: smaller}
33 span.roman {font-family:serif; font-weight:normal;}
34 span.sansserif {font-family:sans-serif; font-weight:normal;}
35 ul.toc {list-style: none}
42 <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
44 <a name="SEC_Top"></a>
45 <h1 class="settitle">ffmpeg Documentation</h1>
47 <a name="SEC_Contents"></a>
48 <h1>Table of Contents</h1>
49 <div class="contents">
52 <li><a name="toc-Synopsis" href="#Synopsis">1. Synopsis</a></li>
53 <li><a name="toc-Description" href="#Description">2. Description</a></li>
54 <li><a name="toc-Options-4" href="#Options-4">3. Options</a>
56 <li><a name="toc-Generic-options" href="#Generic-options">3.1 Generic options</a></li>
57 <li><a name="toc-Main-options" href="#Main-options">3.2 Main options</a></li>
58 <li><a name="toc-Video-Options" href="#Video-Options">3.3 Video Options</a></li>
59 <li><a name="toc-Advanced-Video-Options" href="#Advanced-Video-Options">3.4 Advanced Video Options</a></li>
60 <li><a name="toc-Audio-Options" href="#Audio-Options">3.5 Audio Options</a></li>
61 <li><a name="toc-Advanced-Audio-options_003a" href="#Advanced-Audio-options_003a">3.6 Advanced Audio options:</a></li>
62 <li><a name="toc-Subtitle-options_003a" href="#Subtitle-options_003a">3.7 Subtitle options:</a></li>
63 <li><a name="toc-Audio_002fVideo-grab-options" href="#Audio_002fVideo-grab-options">3.8 Audio/Video grab options</a></li>
64 <li><a name="toc-Advanced-options" href="#Advanced-options">3.9 Advanced options</a></li>
65 <li><a name="toc-Preset-files" href="#Preset-files">3.10 Preset files</a></li>
67 <li><a name="toc-Tips" href="#Tips">4. Tips</a></li>
68 <li><a name="toc-Examples" href="#Examples">5. Examples</a>
70 <li><a name="toc-Video-and-Audio-grabbing" href="#Video-and-Audio-grabbing">5.1 Video and Audio grabbing</a></li>
71 <li><a name="toc-X11-grabbing" href="#X11-grabbing">5.2 X11 grabbing</a></li>
72 <li><a name="toc-Video-and-Audio-file-format-conversion" href="#Video-and-Audio-file-format-conversion">5.3 Video and Audio file format conversion</a></li>
74 <li><a name="toc-Expression-Evaluation" href="#Expression-Evaluation">6. Expression Evaluation</a></li>
75 <li><a name="toc-Decoders" href="#Decoders">7. Decoders</a></li>
76 <li><a name="toc-Video-Decoders" href="#Video-Decoders">8. Video Decoders</a>
78 <li><a name="toc-rawvideo" href="#rawvideo">8.1 rawvideo</a>
80 <li><a name="toc-Options" href="#Options">8.1.1 Options</a></li>
84 <li><a name="toc-Encoders" href="#Encoders">9. Encoders</a></li>
85 <li><a name="toc-Audio-Encoders" href="#Audio-Encoders">10. Audio Encoders</a>
87 <li><a name="toc-ac3-and-ac3_005ffixed" href="#ac3-and-ac3_005ffixed">10.1 ac3 and ac3_fixed</a>
89 <li><a name="toc-AC_002d3-Metadata" href="#AC_002d3-Metadata">10.1.1 AC-3 Metadata</a>
91 <li><a name="toc-Metadata-Control-Options" href="#Metadata-Control-Options">10.1.1.1 Metadata Control Options</a></li>
92 <li><a name="toc-Downmix-Levels" href="#Downmix-Levels">10.1.1.2 Downmix Levels</a></li>
93 <li><a name="toc-Audio-Production-Information" href="#Audio-Production-Information">10.1.1.3 Audio Production Information</a></li>
94 <li><a name="toc-Other-Metadata-Options" href="#Other-Metadata-Options">10.1.1.4 Other Metadata Options</a></li>
96 <li><a name="toc-Extended-Bitstream-Information" href="#Extended-Bitstream-Information">10.1.2 Extended Bitstream Information</a>
98 <li><a name="toc-Extended-Bitstream-Information-_002d-Part-1" href="#Extended-Bitstream-Information-_002d-Part-1">10.1.2.1 Extended Bitstream Information - Part 1</a></li>
99 <li><a name="toc-Extended-Bitstream-Information-_002d-Part-2" href="#Extended-Bitstream-Information-_002d-Part-2">10.1.2.2 Extended Bitstream Information - Part 2</a></li>
101 <li><a name="toc-Other-AC_002d3-Encoding-Options" href="#Other-AC_002d3-Encoding-Options">10.1.3 Other AC-3 Encoding Options</a></li>
102 <li><a name="toc-Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options" href="#Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options">10.1.4 Floating-Point-Only AC-3 Encoding Options</a></li>
106 <li><a name="toc-Video-Encoders" href="#Video-Encoders">11. Video Encoders</a>
108 <li><a name="toc-libvpx" href="#libvpx">11.1 libvpx</a>
110 <li><a name="toc-Options-1" href="#Options-1">11.1.1 Options</a></li>
112 <li><a name="toc-libx264" href="#libx264">11.2 libx264</a>
114 <li><a name="toc-Options-2" href="#Options-2">11.2.1 Options</a></li>
118 <li><a name="toc-Demuxers" href="#Demuxers">12. Demuxers</a>
120 <li><a name="toc-image2" href="#image2">12.1 image2</a></li>
121 <li><a name="toc-applehttp" href="#applehttp">12.2 applehttp</a></li>
123 <li><a name="toc-Muxers" href="#Muxers">13. Muxers</a>
125 <li><a name="toc-crc-1" href="#crc-1">13.1 crc</a></li>
126 <li><a name="toc-framecrc-1" href="#framecrc-1">13.2 framecrc</a></li>
127 <li><a name="toc-image2-1" href="#image2-1">13.3 image2</a></li>
128 <li><a name="toc-mpegts" href="#mpegts">13.4 mpegts</a></li>
129 <li><a name="toc-null" href="#null">13.5 null</a></li>
130 <li><a name="toc-matroska" href="#matroska">13.6 matroska</a></li>
132 <li><a name="toc-Input-Devices" href="#Input-Devices">14. Input Devices</a>
134 <li><a name="toc-alsa-1" href="#alsa-1">14.1 alsa</a></li>
135 <li><a name="toc-bktr" href="#bktr">14.2 bktr</a></li>
136 <li><a name="toc-dv1394" href="#dv1394">14.3 dv1394</a></li>
137 <li><a name="toc-fbdev" href="#fbdev">14.4 fbdev</a></li>
138 <li><a name="toc-jack" href="#jack">14.5 jack</a></li>
139 <li><a name="toc-libdc1394" href="#libdc1394">14.6 libdc1394</a></li>
140 <li><a name="toc-oss-1" href="#oss-1">14.7 oss</a></li>
141 <li><a name="toc-sndio" href="#sndio">14.8 sndio</a></li>
142 <li><a name="toc-video4linux-and-video4linux2" href="#video4linux-and-video4linux2">14.9 video4linux and video4linux2</a></li>
143 <li><a name="toc-vfwcap" href="#vfwcap">14.10 vfwcap</a></li>
144 <li><a name="toc-x11grab" href="#x11grab">14.11 x11grab</a></li>
146 <li><a name="toc-Output-Devices" href="#Output-Devices">15. Output Devices</a>
148 <li><a name="toc-alsa" href="#alsa">15.1 alsa</a></li>
149 <li><a name="toc-oss" href="#oss">15.2 oss</a></li>
150 <li><a name="toc-sdl" href="#sdl">15.3 sdl</a>
152 <li><a name="toc-Options-3" href="#Options-3">15.3.1 Options</a></li>
153 <li><a name="toc-Examples-1" href="#Examples-1">15.3.2 Examples</a></li>
155 <li><a name="toc-sndio-1" href="#sndio-1">15.4 sndio</a></li>
157 <li><a name="toc-Protocols" href="#Protocols">16. Protocols</a>
159 <li><a name="toc-applehttp-1" href="#applehttp-1">16.1 applehttp</a></li>
160 <li><a name="toc-concat" href="#concat">16.2 concat</a></li>
161 <li><a name="toc-file" href="#file">16.3 file</a></li>
162 <li><a name="toc-gopher" href="#gopher">16.4 gopher</a></li>
163 <li><a name="toc-http" href="#http">16.5 http</a></li>
164 <li><a name="toc-mmst" href="#mmst">16.6 mmst</a></li>
165 <li><a name="toc-mmsh" href="#mmsh">16.7 mmsh</a></li>
166 <li><a name="toc-md5" href="#md5">16.8 md5</a></li>
167 <li><a name="toc-pipe" href="#pipe">16.9 pipe</a></li>
168 <li><a name="toc-rtmp" href="#rtmp">16.10 rtmp</a></li>
169 <li><a name="toc-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte" href="#rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">16.11 rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></li>
170 <li><a name="toc-rtp" href="#rtp">16.12 rtp</a></li>
171 <li><a name="toc-rtsp" href="#rtsp">16.13 rtsp</a></li>
172 <li><a name="toc-sap" href="#sap">16.14 sap</a>
174 <li><a name="toc-Muxer" href="#Muxer">16.14.1 Muxer</a></li>
175 <li><a name="toc-Demuxer" href="#Demuxer">16.14.2 Demuxer</a></li>
177 <li><a name="toc-tcp" href="#tcp">16.15 tcp</a></li>
178 <li><a name="toc-udp" href="#udp">16.16 udp</a></li>
180 <li><a name="toc-Bitstream-Filters" href="#Bitstream-Filters">17. Bitstream Filters</a>
182 <li><a name="toc-aac_005fadtstoasc" href="#aac_005fadtstoasc">17.1 aac_adtstoasc</a></li>
183 <li><a name="toc-chomp" href="#chomp">17.2 chomp</a></li>
184 <li><a name="toc-dump_005fextradata" href="#dump_005fextradata">17.3 dump_extradata</a></li>
185 <li><a name="toc-h264_005fmp4toannexb" href="#h264_005fmp4toannexb">17.4 h264_mp4toannexb</a></li>
186 <li><a name="toc-imx_005fdump_005fheader" href="#imx_005fdump_005fheader">17.5 imx_dump_header</a></li>
187 <li><a name="toc-mjpeg2jpeg" href="#mjpeg2jpeg">17.6 mjpeg2jpeg</a></li>
188 <li><a name="toc-mjpega_005fdump_005fheader" href="#mjpega_005fdump_005fheader">17.7 mjpega_dump_header</a></li>
189 <li><a name="toc-movsub" href="#movsub">17.8 movsub</a></li>
190 <li><a name="toc-mp3_005fheader_005fcompress" href="#mp3_005fheader_005fcompress">17.9 mp3_header_compress</a></li>
191 <li><a name="toc-mp3_005fheader_005fdecompress" href="#mp3_005fheader_005fdecompress">17.10 mp3_header_decompress</a></li>
192 <li><a name="toc-noise" href="#noise">17.11 noise</a></li>
193 <li><a name="toc-remove_005fextradata" href="#remove_005fextradata">17.12 remove_extradata</a></li>
195 <li><a name="toc-Filtergraph-description" href="#Filtergraph-description">18. Filtergraph description</a>
197 <li><a name="toc-Filtergraph-syntax" href="#Filtergraph-syntax">18.1 Filtergraph syntax</a></li>
199 <li><a name="toc-Audio-Filters" href="#Audio-Filters">19. Audio Filters</a>
201 <li><a name="toc-anull" href="#anull">19.1 anull</a></li>
203 <li><a name="toc-Audio-Sources" href="#Audio-Sources">20. Audio Sources</a>
205 <li><a name="toc-anullsrc" href="#anullsrc">20.1 anullsrc</a></li>
207 <li><a name="toc-Audio-Sinks" href="#Audio-Sinks">21. Audio Sinks</a>
209 <li><a name="toc-anullsink" href="#anullsink">21.1 anullsink</a></li>
211 <li><a name="toc-Video-Filters" href="#Video-Filters">22. Video Filters</a>
213 <li><a name="toc-blackframe" href="#blackframe">22.1 blackframe</a></li>
214 <li><a name="toc-copy" href="#copy">22.2 copy</a></li>
215 <li><a name="toc-crop" href="#crop">22.3 crop</a></li>
216 <li><a name="toc-cropdetect" href="#cropdetect">22.4 cropdetect</a></li>
217 <li><a name="toc-drawbox" href="#drawbox">22.5 drawbox</a></li>
218 <li><a name="toc-drawtext" href="#drawtext">22.6 drawtext</a></li>
219 <li><a name="toc-fade" href="#fade">22.7 fade</a></li>
220 <li><a name="toc-fieldorder" href="#fieldorder">22.8 fieldorder</a></li>
221 <li><a name="toc-fifo" href="#fifo">22.9 fifo</a></li>
222 <li><a name="toc-format" href="#format">22.10 format</a></li>
223 <li><a name="toc-frei0r-1" href="#frei0r-1">22.11 frei0r</a></li>
224 <li><a name="toc-gradfun" href="#gradfun">22.12 gradfun</a></li>
225 <li><a name="toc-hflip" href="#hflip">22.13 hflip</a></li>
226 <li><a name="toc-hqdn3d" href="#hqdn3d">22.14 hqdn3d</a></li>
227 <li><a name="toc-mp" href="#mp">22.15 mp</a></li>
228 <li><a name="toc-noformat" href="#noformat">22.16 noformat</a></li>
229 <li><a name="toc-null-1" href="#null-1">22.17 null</a></li>
230 <li><a name="toc-ocv" href="#ocv">22.18 ocv</a>
232 <li><a name="toc-dilate-1" href="#dilate-1">22.18.1 dilate</a></li>
233 <li><a name="toc-erode" href="#erode">22.18.2 erode</a></li>
234 <li><a name="toc-smooth" href="#smooth">22.18.3 smooth</a></li>
236 <li><a name="toc-overlay" href="#overlay">22.19 overlay</a></li>
237 <li><a name="toc-pad" href="#pad">22.20 pad</a></li>
238 <li><a name="toc-pixdesctest" href="#pixdesctest">22.21 pixdesctest</a></li>
239 <li><a name="toc-scale" href="#scale">22.22 scale</a></li>
240 <li><a name="toc-select" href="#select">22.23 select</a></li>
241 <li><a name="toc-setdar-1" href="#setdar-1">22.24 setdar</a></li>
242 <li><a name="toc-setpts" href="#setpts">22.25 setpts</a></li>
243 <li><a name="toc-setsar-1" href="#setsar-1">22.26 setsar</a></li>
244 <li><a name="toc-settb" href="#settb">22.27 settb</a></li>
245 <li><a name="toc-showinfo" href="#showinfo">22.28 showinfo</a></li>
246 <li><a name="toc-slicify" href="#slicify">22.29 slicify</a></li>
247 <li><a name="toc-split" href="#split">22.30 split</a></li>
248 <li><a name="toc-transpose" href="#transpose">22.31 transpose</a></li>
249 <li><a name="toc-unsharp" href="#unsharp">22.32 unsharp</a></li>
250 <li><a name="toc-vflip" href="#vflip">22.33 vflip</a></li>
251 <li><a name="toc-yadif" href="#yadif">22.34 yadif</a></li>
253 <li><a name="toc-Video-Sources" href="#Video-Sources">23. Video Sources</a>
255 <li><a name="toc-buffer" href="#buffer">23.1 buffer</a></li>
256 <li><a name="toc-color" href="#color">23.2 color</a></li>
257 <li><a name="toc-movie" href="#movie">23.3 movie</a></li>
258 <li><a name="toc-nullsrc" href="#nullsrc">23.4 nullsrc</a></li>
259 <li><a name="toc-frei0r_005fsrc" href="#frei0r_005fsrc">23.5 frei0r_src</a></li>
261 <li><a name="toc-Video-Sinks" href="#Video-Sinks">24. Video Sinks</a>
263 <li><a name="toc-nullsink" href="#nullsink">24.1 nullsink</a></li>
265 <li><a name="toc-Metadata" href="#Metadata">25. Metadata</a></li>
270 <a name="Synopsis"></a>
271 <h1 class="chapter"><a href="ffmpeg.html#toc-Synopsis">1. Synopsis</a></h1>
273 <p>The generic syntax is:
275 <table><tr><td> </td><td><pre class="example">ffmpeg [[infile options][‘<samp>-i</samp>’ <var>infile</var>]]... {[outfile options] <var>outfile</var>}...
276 </pre></td></tr></table>
278 <a name="Description"></a>
279 <h1 class="chapter"><a href="ffmpeg.html#toc-Description">2. Description</a></h1>
281 <p>ffmpeg is a very fast video and audio converter that can also grab from
282 a live audio/video source. It can also convert between arbitrary sample
283 rates and resize video on the fly with a high quality polyphase filter.
285 <p>The command line interface is designed to be intuitive, in the sense
286 that ffmpeg tries to figure out all parameters that can possibly be
287 derived automatically. You usually only have to specify the target
290 <p>As a general rule, options are applied to the next specified
291 file. Therefore, order is important, and you can have the same
292 option on the command line multiple times. Each occurrence is
293 then applied to the next input or output file.
297 To set the video bitrate of the output file to 64kbit/s:
298 <table><tr><td> </td><td><pre class="example">ffmpeg -i input.avi -b 64k output.avi
299 </pre></td></tr></table>
302 To force the frame rate of the output file to 24 fps:
303 <table><tr><td> </td><td><pre class="example">ffmpeg -i input.avi -r 24 output.avi
304 </pre></td></tr></table>
307 To force the frame rate of the input file (valid for raw formats only)
308 to 1 fps and the frame rate of the output file to 24 fps:
309 <table><tr><td> </td><td><pre class="example">ffmpeg -r 1 -i input.m2v -r 24 output.avi
310 </pre></td></tr></table>
313 <p>The format option may be needed for raw input files.
315 <p>By default ffmpeg tries to convert as losslessly as possible: It
316 uses the same audio and video parameters for the outputs as the one
317 specified for the inputs.
320 <a name="Options-4"></a>
321 <h1 class="chapter"><a href="ffmpeg.html#toc-Options-4">3. Options</a></h1>
323 <p>All the numerical options, if not specified otherwise, accept in input
324 a string representing a number, which may contain one of the
325 International System number postfixes, for example ’K’, ’M’, ’G’.
326 If ’i’ is appended after the postfix, powers of 2 are used instead of
327 powers of 10. The ’B’ postfix multiplies the value for 8, and can be
328 appended after another postfix or used alone. This allows using for
329 example ’KB’, ’MiB’, ’G’ and ’B’ as postfix.
331 <p>Options which do not take arguments are boolean options, and set the
332 corresponding value to true. They can be set to false by prefixing
333 with "no" the option name, for example using "-nofoo" in the
334 commandline will set to false the boolean option with name "foo".
336 <a name="Generic-options"></a>
337 <h2 class="section"><a href="ffmpeg.html#toc-Generic-options">3.1 Generic options</a></h2>
339 <p>These options are shared amongst the ff* tools.
341 <dl compact="compact">
342 <dt> ‘<samp>-L</samp>’</dt>
346 <dt> ‘<samp>-h, -?, -help, --help</samp>’</dt>
350 <dt> ‘<samp>-version</samp>’</dt>
354 <dt> ‘<samp>-formats</samp>’</dt>
355 <dd><p>Show available formats.
357 <p>The fields preceding the format names have the following meanings:
358 </p><dl compact="compact">
359 <dt> ‘<samp>D</samp>’</dt>
360 <dd><p>Decoding available
362 <dt> ‘<samp>E</samp>’</dt>
363 <dd><p>Encoding available
368 <dt> ‘<samp>-codecs</samp>’</dt>
369 <dd><p>Show available codecs.
371 <p>The fields preceding the codec names have the following meanings:
372 </p><dl compact="compact">
373 <dt> ‘<samp>D</samp>’</dt>
374 <dd><p>Decoding available
376 <dt> ‘<samp>E</samp>’</dt>
377 <dd><p>Encoding available
379 <dt> ‘<samp>V/A/S</samp>’</dt>
380 <dd><p>Video/audio/subtitle codec
382 <dt> ‘<samp>S</samp>’</dt>
383 <dd><p>Codec supports slices
385 <dt> ‘<samp>D</samp>’</dt>
386 <dd><p>Codec supports direct rendering
388 <dt> ‘<samp>T</samp>’</dt>
389 <dd><p>Codec can handle input truncated at random locations instead of only at frame boundaries
394 <dt> ‘<samp>-bsfs</samp>’</dt>
395 <dd><p>Show available bitstream filters.
398 <dt> ‘<samp>-protocols</samp>’</dt>
399 <dd><p>Show available protocols.
402 <dt> ‘<samp>-filters</samp>’</dt>
403 <dd><p>Show available libavfilter filters.
406 <dt> ‘<samp>-pix_fmts</samp>’</dt>
407 <dd><p>Show available pixel formats.
410 <dt> ‘<samp>-loglevel <var>loglevel</var></samp>’</dt>
411 <dd><p>Set the logging level used by the library.
412 <var>loglevel</var> is a number or a string containing one of the following values:
413 </p><dl compact="compact">
414 <dt> ‘<samp>quiet</samp>’</dt>
415 <dt> ‘<samp>panic</samp>’</dt>
416 <dt> ‘<samp>fatal</samp>’</dt>
417 <dt> ‘<samp>error</samp>’</dt>
418 <dt> ‘<samp>warning</samp>’</dt>
419 <dt> ‘<samp>info</samp>’</dt>
420 <dt> ‘<samp>verbose</samp>’</dt>
421 <dt> ‘<samp>debug</samp>’</dt>
424 <p>By default the program logs to stderr, if coloring is supported by the
425 terminal, colors are used to mark errors and warnings. Log coloring
426 can be disabled setting the environment variable
427 <code>FFMPEG_FORCE_NOCOLOR</code> or <code>NO_COLOR</code>, or can be forced setting
428 the environment variable <code>FFMPEG_FORCE_COLOR</code>.
429 The use of the environment variable <code>NO_COLOR</code> is deprecated and
430 will be dropped in a following FFmpeg version.
435 <a name="Main-options"></a>
436 <h2 class="section"><a href="ffmpeg.html#toc-Main-options">3.2 Main options</a></h2>
438 <dl compact="compact">
439 <dt> ‘<samp>-f <var>fmt</var></samp>’</dt>
443 <dt> ‘<samp>-i <var>filename</var></samp>’</dt>
444 <dd><p>input file name
447 <dt> ‘<samp>-y</samp>’</dt>
448 <dd><p>Overwrite output files.
451 <dt> ‘<samp>-t <var>duration</var></samp>’</dt>
452 <dd><p>Restrict the transcoded/captured video sequence
453 to the duration specified in seconds.
454 <code>hh:mm:ss[.xxx]</code> syntax is also supported.
457 <dt> ‘<samp>-fs <var>limit_size</var></samp>’</dt>
458 <dd><p>Set the file size limit.
461 <dt> ‘<samp>-ss <var>position</var></samp>’</dt>
462 <dd><p>Seek to given time position in seconds.
463 <code>hh:mm:ss[.xxx]</code> syntax is also supported.
466 <dt> ‘<samp>-itsoffset <var>offset</var></samp>’</dt>
467 <dd><p>Set the input time offset in seconds.
468 <code>[-]hh:mm:ss[.xxx]</code> syntax is also supported.
469 This option affects all the input files that follow it.
470 The offset is added to the timestamps of the input files.
471 Specifying a positive offset means that the corresponding
472 streams are delayed by ’offset’ seconds.
475 <dt> ‘<samp>-timestamp <var>time</var></samp>’</dt>
476 <dd><p>Set the recording timestamp in the container.
477 The syntax for <var>time</var> is:
478 </p><table><tr><td> </td><td><pre class="example">now|([(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH[:MM[:SS[.m...]]])|(HH[MM[SS[.m...]]]))[Z|z])
479 </pre></td></tr></table>
480 <p>If the value is "now" it takes the current time.
481 Time is local time unless ’Z’ or ’z’ is appended, in which case it is
483 If the year-month-day part is not specified it takes the current
487 <dt> ‘<samp>-metadata <var>key</var>=<var>value</var></samp>’</dt>
488 <dd><p>Set a metadata key/value pair.
490 <p>For example, for setting the title in the output file:
491 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i in.avi -metadata title="my title" out.flv
492 </pre></td></tr></table>
495 <dt> ‘<samp>-v <var>number</var></samp>’</dt>
496 <dd><p>Set the logging verbosity level.
499 <dt> ‘<samp>-target <var>type</var></samp>’</dt>
500 <dd><p>Specify target file type ("vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd",
501 "ntsc-svcd", ... ). All the format options (bitrate, codecs,
502 buffer sizes) are then set automatically. You can just type:
504 <table><tr><td> </td><td><pre class="example">ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
505 </pre></td></tr></table>
507 <p>Nevertheless you can specify additional options as long as you know
508 they do not conflict with the standard, as in:
510 <table><tr><td> </td><td><pre class="example">ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
511 </pre></td></tr></table>
514 <dt> ‘<samp>-dframes <var>number</var></samp>’</dt>
515 <dd><p>Set the number of data frames to record.
518 <dt> ‘<samp>-scodec <var>codec</var></samp>’</dt>
519 <dd><p>Force subtitle codec (’copy’ to copy stream).
522 <dt> ‘<samp>-newsubtitle</samp>’</dt>
523 <dd><p>Add a new subtitle stream to the current output stream.
526 <dt> ‘<samp>-slang <var>code</var></samp>’</dt>
527 <dd><p>Set the ISO 639 language code (3 letters) of the current subtitle stream.
532 <a name="Video-Options"></a>
533 <h2 class="section"><a href="ffmpeg.html#toc-Video-Options">3.3 Video Options</a></h2>
535 <dl compact="compact">
536 <dt> ‘<samp>-b <var>bitrate</var></samp>’</dt>
537 <dd><p>Set the video bitrate in bit/s (default = 200 kb/s).
539 <dt> ‘<samp>-vframes <var>number</var></samp>’</dt>
540 <dd><p>Set the number of video frames to record.
542 <dt> ‘<samp>-r <var>fps</var></samp>’</dt>
543 <dd><p>Set frame rate (Hz value, fraction or abbreviation), (default = 25).
545 <dt> ‘<samp>-s <var>size</var></samp>’</dt>
546 <dd><p>Set frame size. The format is ‘<samp>wxh</samp>’ (ffserver default = 160x128).
547 There is no default for input streams,
548 for output streams it is set by default to the size of the source stream.
549 If the input file has video streams with different resolutions, the behaviour is undefined.
550 The following abbreviations are recognized:
551 </p><dl compact="compact">
552 <dt> ‘<samp>sqcif</samp>’</dt>
555 <dt> ‘<samp>qcif</samp>’</dt>
558 <dt> ‘<samp>cif</samp>’</dt>
561 <dt> ‘<samp>4cif</samp>’</dt>
564 <dt> ‘<samp>16cif</samp>’</dt>
567 <dt> ‘<samp>qqvga</samp>’</dt>
570 <dt> ‘<samp>qvga</samp>’</dt>
573 <dt> ‘<samp>vga</samp>’</dt>
576 <dt> ‘<samp>svga</samp>’</dt>
579 <dt> ‘<samp>xga</samp>’</dt>
582 <dt> ‘<samp>uxga</samp>’</dt>
585 <dt> ‘<samp>qxga</samp>’</dt>
588 <dt> ‘<samp>sxga</samp>’</dt>
591 <dt> ‘<samp>qsxga</samp>’</dt>
594 <dt> ‘<samp>hsxga</samp>’</dt>
597 <dt> ‘<samp>wvga</samp>’</dt>
600 <dt> ‘<samp>wxga</samp>’</dt>
603 <dt> ‘<samp>wsxga</samp>’</dt>
606 <dt> ‘<samp>wuxga</samp>’</dt>
609 <dt> ‘<samp>woxga</samp>’</dt>
612 <dt> ‘<samp>wqsxga</samp>’</dt>
615 <dt> ‘<samp>wquxga</samp>’</dt>
618 <dt> ‘<samp>whsxga</samp>’</dt>
621 <dt> ‘<samp>whuxga</samp>’</dt>
624 <dt> ‘<samp>cga</samp>’</dt>
627 <dt> ‘<samp>ega</samp>’</dt>
630 <dt> ‘<samp>hd480</samp>’</dt>
633 <dt> ‘<samp>hd720</samp>’</dt>
636 <dt> ‘<samp>hd1080</samp>’</dt>
642 <dt> ‘<samp>-aspect <var>aspect</var></samp>’</dt>
643 <dd><p>Set the video display aspect ratio specified by <var>aspect</var>.
645 <p><var>aspect</var> can be a floating point number string, or a string of the
646 form <var>num</var>:<var>den</var>, where <var>num</var> and <var>den</var> are the
647 numerator and denominator of the aspect ratio. For example "4:3",
648 "16:9", "1.3333", and "1.7777" are valid argument values.
651 <dt> ‘<samp>-croptop <var>size</var></samp>’</dt>
652 <dt> ‘<samp>-cropbottom <var>size</var></samp>’</dt>
653 <dt> ‘<samp>-cropleft <var>size</var></samp>’</dt>
654 <dt> ‘<samp>-cropright <var>size</var></samp>’</dt>
655 <dd><p>All the crop options have been removed. Use -vf
656 crop=width:height:x:y instead.
659 <dt> ‘<samp>-padtop <var>size</var></samp>’</dt>
660 <dt> ‘<samp>-padbottom <var>size</var></samp>’</dt>
661 <dt> ‘<samp>-padleft <var>size</var></samp>’</dt>
662 <dt> ‘<samp>-padright <var>size</var></samp>’</dt>
663 <dt> ‘<samp>-padcolor <var>hex_color</var></samp>’</dt>
664 <dd><p>All the pad options have been removed. Use -vf
665 pad=width:height:x:y:color instead.
667 <dt> ‘<samp>-vn</samp>’</dt>
668 <dd><p>Disable video recording.
670 <dt> ‘<samp>-bt <var>tolerance</var></samp>’</dt>
671 <dd><p>Set video bitrate tolerance (in bits, default 4000k).
672 Has a minimum value of: (target_bitrate/target_framerate).
673 In 1-pass mode, bitrate tolerance specifies how far ratecontrol is
674 willing to deviate from the target average bitrate value. This is
675 not related to min/max bitrate. Lowering tolerance too much has
676 an adverse effect on quality.
678 <dt> ‘<samp>-maxrate <var>bitrate</var></samp>’</dt>
679 <dd><p>Set max video bitrate (in bit/s).
680 Requires -bufsize to be set.
682 <dt> ‘<samp>-minrate <var>bitrate</var></samp>’</dt>
683 <dd><p>Set min video bitrate (in bit/s).
684 Most useful in setting up a CBR encode:
685 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
686 </pre></td></tr></table>
687 <p>It is of little use elsewise.
689 <dt> ‘<samp>-bufsize <var>size</var></samp>’</dt>
690 <dd><p>Set video buffer verifier buffer size (in bits).
692 <dt> ‘<samp>-vcodec <var>codec</var></samp>’</dt>
693 <dd><p>Force video codec to <var>codec</var>. Use the <code>copy</code> special value to
694 tell that the raw codec data must be copied as is.
696 <dt> ‘<samp>-sameq</samp>’</dt>
697 <dd><p>Use same quantizer as source (implies VBR).
700 <dt> ‘<samp>-pass <var>n</var></samp>’</dt>
701 <dd><p>Select the pass number (1 or 2). It is used to do two-pass
702 video encoding. The statistics of the video are recorded in the first
703 pass into a log file (see also the option -passlogfile),
704 and in the second pass that log file is used to generate the video
705 at the exact requested bitrate.
706 On pass 1, you may just deactivate audio and set output to null,
707 examples for Windows and Unix:
708 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i foo.mov -vcodec libxvid -pass 1 -an -f rawvideo -y NUL
709 ffmpeg -i foo.mov -vcodec libxvid -pass 1 -an -f rawvideo -y /dev/null
710 </pre></td></tr></table>
713 <dt> ‘<samp>-passlogfile <var>prefix</var></samp>’</dt>
714 <dd><p>Set two-pass log file name prefix to <var>prefix</var>, the default file name
715 prefix is “ffmpeg2pass”. The complete file name will be
716 ‘<tt>PREFIX-N.log</tt>’, where N is a number specific to the output
720 <dt> ‘<samp>-newvideo</samp>’</dt>
721 <dd><p>Add a new video stream to the current output stream.
724 <dt> ‘<samp>-vlang <var>code</var></samp>’</dt>
725 <dd><p>Set the ISO 639 language code (3 letters) of the current video stream.
728 <dt> ‘<samp>-vf <var>filter_graph</var></samp>’</dt>
729 <dd><p><var>filter_graph</var> is a description of the filter graph to apply to
731 Use the option "-filters" to show all the available filters (including
732 also sources and sinks).
737 <a name="Advanced-Video-Options"></a>
738 <h2 class="section"><a href="ffmpeg.html#toc-Advanced-Video-Options">3.4 Advanced Video Options</a></h2>
740 <dl compact="compact">
741 <dt> ‘<samp>-pix_fmt <var>format</var></samp>’</dt>
742 <dd><p>Set pixel format. Use ’list’ as parameter to show all the supported
745 <dt> ‘<samp>-sws_flags <var>flags</var></samp>’</dt>
746 <dd><p>Set SwScaler flags.
748 <dt> ‘<samp>-g <var>gop_size</var></samp>’</dt>
749 <dd><p>Set the group of pictures size.
751 <dt> ‘<samp>-intra</samp>’</dt>
752 <dd><p>Use only intra frames.
754 <dt> ‘<samp>-vdt <var>n</var></samp>’</dt>
755 <dd><p>Discard threshold.
757 <dt> ‘<samp>-qscale <var>q</var></samp>’</dt>
758 <dd><p>Use fixed video quantizer scale (VBR).
760 <dt> ‘<samp>-qmin <var>q</var></samp>’</dt>
761 <dd><p>minimum video quantizer scale (VBR)
763 <dt> ‘<samp>-qmax <var>q</var></samp>’</dt>
764 <dd><p>maximum video quantizer scale (VBR)
766 <dt> ‘<samp>-qdiff <var>q</var></samp>’</dt>
767 <dd><p>maximum difference between the quantizer scales (VBR)
769 <dt> ‘<samp>-qblur <var>blur</var></samp>’</dt>
770 <dd><p>video quantizer scale blur (VBR) (range 0.0 - 1.0)
772 <dt> ‘<samp>-qcomp <var>compression</var></samp>’</dt>
773 <dd><p>video quantizer scale compression (VBR) (default 0.5).
774 Constant of ratecontrol equation. Recommended range for default rc_eq: 0.0-1.0
777 <dt> ‘<samp>-lmin <var>lambda</var></samp>’</dt>
778 <dd><p>minimum video lagrange factor (VBR)
780 <dt> ‘<samp>-lmax <var>lambda</var></samp>’</dt>
781 <dd><p>max video lagrange factor (VBR)
783 <dt> ‘<samp>-mblmin <var>lambda</var></samp>’</dt>
784 <dd><p>minimum macroblock quantizer scale (VBR)
786 <dt> ‘<samp>-mblmax <var>lambda</var></samp>’</dt>
787 <dd><p>maximum macroblock quantizer scale (VBR)
789 <p>These four options (lmin, lmax, mblmin, mblmax) use ’lambda’ units,
790 but you may use the QP2LAMBDA constant to easily convert from ’q’ units:
791 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
792 </pre></td></tr></table>
795 <dt> ‘<samp>-rc_init_cplx <var>complexity</var></samp>’</dt>
796 <dd><p>initial complexity for single pass encoding
798 <dt> ‘<samp>-b_qfactor <var>factor</var></samp>’</dt>
799 <dd><p>qp factor between P- and B-frames
801 <dt> ‘<samp>-i_qfactor <var>factor</var></samp>’</dt>
802 <dd><p>qp factor between P- and I-frames
804 <dt> ‘<samp>-b_qoffset <var>offset</var></samp>’</dt>
805 <dd><p>qp offset between P- and B-frames
807 <dt> ‘<samp>-i_qoffset <var>offset</var></samp>’</dt>
808 <dd><p>qp offset between P- and I-frames
810 <dt> ‘<samp>-rc_eq <var>equation</var></samp>’</dt>
811 <dd><p>Set rate control equation (see section "Expression Evaluation")
812 (default = <code>tex^qComp</code>).
814 <p>When computing the rate control equation expression, besides the
815 standard functions defined in the section "Expression Evaluation", the
816 following functions are available:
817 </p><dl compact="compact">
818 <dt> <var>bits2qp(bits)</var></dt>
819 <dt> <var>qp2bits(qp)</var></dt>
822 <p>and the following constants are available:
823 </p><dl compact="compact">
824 <dt> <var>iTex</var></dt>
825 <dt> <var>pTex</var></dt>
826 <dt> <var>tex</var></dt>
827 <dt> <var>mv</var></dt>
828 <dt> <var>fCode</var></dt>
829 <dt> <var>iCount</var></dt>
830 <dt> <var>mcVar</var></dt>
831 <dt> <var>var</var></dt>
832 <dt> <var>isI</var></dt>
833 <dt> <var>isP</var></dt>
834 <dt> <var>isB</var></dt>
835 <dt> <var>avgQP</var></dt>
836 <dt> <var>qComp</var></dt>
837 <dt> <var>avgIITex</var></dt>
838 <dt> <var>avgPITex</var></dt>
839 <dt> <var>avgPPTex</var></dt>
840 <dt> <var>avgBPTex</var></dt>
841 <dt> <var>avgTex</var></dt>
845 <dt> ‘<samp>-rc_override <var>override</var></samp>’</dt>
846 <dd><p>Rate control override for specific intervals, formated as "int,int,int"
847 list separated with slashes. Two first values are the beginning and
848 end frame numbers, last one is quantizer to use if positive, or quality
851 <dt> ‘<samp>-me_method <var>method</var></samp>’</dt>
852 <dd><p>Set motion estimation method to <var>method</var>.
853 Available methods are (from lowest to best quality):
854 </p><dl compact="compact">
855 <dt> ‘<samp>zero</samp>’</dt>
856 <dd><p>Try just the (0, 0) vector.
858 <dt> ‘<samp>phods</samp>’</dt>
859 <dt> ‘<samp>log</samp>’</dt>
860 <dt> ‘<samp>x1</samp>’</dt>
861 <dt> ‘<samp>hex</samp>’</dt>
862 <dt> ‘<samp>umh</samp>’</dt>
863 <dt> ‘<samp>epzs</samp>’</dt>
864 <dd><p>(default method)
866 <dt> ‘<samp>full</samp>’</dt>
867 <dd><p>exhaustive search (slow and marginally better than epzs)
872 <dt> ‘<samp>-dct_algo <var>algo</var></samp>’</dt>
873 <dd><p>Set DCT algorithm to <var>algo</var>. Available values are:
874 </p><dl compact="compact">
875 <dt> ‘<samp>0</samp>’</dt>
876 <dd><p>FF_DCT_AUTO (default)
878 <dt> ‘<samp>1</samp>’</dt>
879 <dd><p>FF_DCT_FASTINT
881 <dt> ‘<samp>2</samp>’</dt>
884 <dt> ‘<samp>3</samp>’</dt>
887 <dt> ‘<samp>4</samp>’</dt>
890 <dt> ‘<samp>5</samp>’</dt>
891 <dd><p>FF_DCT_ALTIVEC
896 <dt> ‘<samp>-idct_algo <var>algo</var></samp>’</dt>
897 <dd><p>Set IDCT algorithm to <var>algo</var>. Available values are:
898 </p><dl compact="compact">
899 <dt> ‘<samp>0</samp>’</dt>
900 <dd><p>FF_IDCT_AUTO (default)
902 <dt> ‘<samp>1</samp>’</dt>
905 <dt> ‘<samp>2</samp>’</dt>
906 <dd><p>FF_IDCT_SIMPLE
908 <dt> ‘<samp>3</samp>’</dt>
909 <dd><p>FF_IDCT_SIMPLEMMX
911 <dt> ‘<samp>4</samp>’</dt>
912 <dd><p>FF_IDCT_LIBMPEG2MMX
914 <dt> ‘<samp>5</samp>’</dt>
917 <dt> ‘<samp>6</samp>’</dt>
920 <dt> ‘<samp>7</samp>’</dt>
923 <dt> ‘<samp>8</samp>’</dt>
924 <dd><p>FF_IDCT_ALTIVEC
926 <dt> ‘<samp>9</samp>’</dt>
929 <dt> ‘<samp>10</samp>’</dt>
930 <dd><p>FF_IDCT_SIMPLEARM
935 <dt> ‘<samp>-er <var>n</var></samp>’</dt>
936 <dd><p>Set error resilience to <var>n</var>.
937 </p><dl compact="compact">
938 <dt> ‘<samp>1</samp>’</dt>
939 <dd><p>FF_ER_CAREFUL (default)
941 <dt> ‘<samp>2</samp>’</dt>
942 <dd><p>FF_ER_COMPLIANT
944 <dt> ‘<samp>3</samp>’</dt>
945 <dd><p>FF_ER_AGGRESSIVE
947 <dt> ‘<samp>4</samp>’</dt>
948 <dd><p>FF_ER_VERY_AGGRESSIVE
953 <dt> ‘<samp>-ec <var>bit_mask</var></samp>’</dt>
954 <dd><p>Set error concealment to <var>bit_mask</var>. <var>bit_mask</var> is a bit mask of
955 the following values:
956 </p><dl compact="compact">
957 <dt> ‘<samp>1</samp>’</dt>
958 <dd><p>FF_EC_GUESS_MVS (default = enabled)
960 <dt> ‘<samp>2</samp>’</dt>
961 <dd><p>FF_EC_DEBLOCK (default = enabled)
966 <dt> ‘<samp>-bf <var>frames</var></samp>’</dt>
967 <dd><p>Use ’frames’ B-frames (supported for MPEG-1, MPEG-2 and MPEG-4).
969 <dt> ‘<samp>-mbd <var>mode</var></samp>’</dt>
970 <dd><p>macroblock decision
971 </p><dl compact="compact">
972 <dt> ‘<samp>0</samp>’</dt>
973 <dd><p>FF_MB_DECISION_SIMPLE: Use mb_cmp (cannot change it yet in ffmpeg).
975 <dt> ‘<samp>1</samp>’</dt>
976 <dd><p>FF_MB_DECISION_BITS: Choose the one which needs the fewest bits.
978 <dt> ‘<samp>2</samp>’</dt>
979 <dd><p>FF_MB_DECISION_RD: rate distortion
984 <dt> ‘<samp>-4mv</samp>’</dt>
985 <dd><p>Use four motion vector by macroblock (MPEG-4 only).
987 <dt> ‘<samp>-part</samp>’</dt>
988 <dd><p>Use data partitioning (MPEG-4 only).
990 <dt> ‘<samp>-bug <var>param</var></samp>’</dt>
991 <dd><p>Work around encoder bugs that are not auto-detected.
993 <dt> ‘<samp>-strict <var>strictness</var></samp>’</dt>
994 <dd><p>How strictly to follow the standards.
996 <dt> ‘<samp>-aic</samp>’</dt>
997 <dd><p>Enable Advanced intra coding (h263+).
999 <dt> ‘<samp>-umv</samp>’</dt>
1000 <dd><p>Enable Unlimited Motion Vector (h263+)
1003 <dt> ‘<samp>-deinterlace</samp>’</dt>
1004 <dd><p>Deinterlace pictures.
1006 <dt> ‘<samp>-ilme</samp>’</dt>
1007 <dd><p>Force interlacing support in encoder (MPEG-2 and MPEG-4 only).
1008 Use this option if your input file is interlaced and you want
1009 to keep the interlaced format for minimum losses.
1010 The alternative is to deinterlace the input stream with
1011 ‘<samp>-deinterlace</samp>’, but deinterlacing introduces losses.
1013 <dt> ‘<samp>-psnr</samp>’</dt>
1014 <dd><p>Calculate PSNR of compressed frames.
1016 <dt> ‘<samp>-vstats</samp>’</dt>
1017 <dd><p>Dump video coding statistics to ‘<tt>vstats_HHMMSS.log</tt>’.
1019 <dt> ‘<samp>-vstats_file <var>file</var></samp>’</dt>
1020 <dd><p>Dump video coding statistics to <var>file</var>.
1022 <dt> ‘<samp>-top <var>n</var></samp>’</dt>
1023 <dd><p>top=1/bottom=0/auto=-1 field first
1025 <dt> ‘<samp>-dc <var>precision</var></samp>’</dt>
1026 <dd><p>Intra_dc_precision.
1028 <dt> ‘<samp>-vtag <var>fourcc/tag</var></samp>’</dt>
1029 <dd><p>Force video tag/fourcc.
1031 <dt> ‘<samp>-qphist</samp>’</dt>
1032 <dd><p>Show QP histogram.
1034 <dt> ‘<samp>-vbsf <var>bitstream_filter</var></samp>’</dt>
1035 <dd><p>Bitstream filters available are "dump_extra", "remove_extra", "noise", "h264_mp4toannexb", "imxdump", "mjpegadump", "mjpeg2jpeg".
1036 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i h264.mp4 -vcodec copy -vbsf h264_mp4toannexb -an out.h264
1037 </pre></td></tr></table>
1039 <dt> ‘<samp>-force_key_frames <var>time</var>[,<var>time</var>...]</samp>’</dt>
1040 <dd><p>Force key frames at the specified timestamps, more precisely at the first
1041 frames after each specified time.
1042 This option can be useful to ensure that a seek point is present at a
1043 chapter mark or any other designated place in the output file.
1044 The timestamps must be specified in ascending order.
1048 <a name="Audio-Options"></a>
1049 <h2 class="section"><a href="ffmpeg.html#toc-Audio-Options">3.5 Audio Options</a></h2>
1051 <dl compact="compact">
1052 <dt> ‘<samp>-aframes <var>number</var></samp>’</dt>
1053 <dd><p>Set the number of audio frames to record.
1055 <dt> ‘<samp>-ar <var>freq</var></samp>’</dt>
1056 <dd><p>Set the audio sampling frequency. For input streams it is set by
1057 default to 44100 Hz, for output streams it is set by default to the
1058 frequency of the input stream. If the input file has audio streams
1059 with different frequencies, the behaviour is undefined.
1061 <dt> ‘<samp>-ab <var>bitrate</var></samp>’</dt>
1062 <dd><p>Set the audio bitrate in bit/s (default = 64k).
1064 <dt> ‘<samp>-aq <var>q</var></samp>’</dt>
1065 <dd><p>Set the audio quality (codec-specific, VBR).
1067 <dt> ‘<samp>-ac <var>channels</var></samp>’</dt>
1068 <dd><p>Set the number of audio channels. For input streams it is set by
1069 default to 1, for output streams it is set by default to the same
1070 number of audio channels in input. If the input file has audio streams
1071 with different channel count, the behaviour is undefined.
1073 <dt> ‘<samp>-an</samp>’</dt>
1074 <dd><p>Disable audio recording.
1076 <dt> ‘<samp>-acodec <var>codec</var></samp>’</dt>
1077 <dd><p>Force audio codec to <var>codec</var>. Use the <code>copy</code> special value to
1078 specify that the raw codec data must be copied as is.
1080 <dt> ‘<samp>-newaudio</samp>’</dt>
1081 <dd><p>Add a new audio track to the output file. If you want to specify parameters,
1082 do so before <code>-newaudio</code> (<code>-acodec</code>, <code>-ab</code>, etc..).
1084 <p>Mapping will be done automatically, if the number of output streams is equal to
1085 the number of input streams, else it will pick the first one that matches. You
1086 can override the mapping using <code>-map</code> as usual.
1089 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i file.mpg -vcodec copy -acodec ac3 -ab 384k test.mpg -acodec mp2 -ab 192k -newaudio
1090 </pre></td></tr></table>
1092 <dt> ‘<samp>-alang <var>code</var></samp>’</dt>
1093 <dd><p>Set the ISO 639 language code (3 letters) of the current audio stream.
1097 <a name="Advanced-Audio-options_003a"></a>
1098 <h2 class="section"><a href="ffmpeg.html#toc-Advanced-Audio-options_003a">3.6 Advanced Audio options:</a></h2>
1100 <dl compact="compact">
1101 <dt> ‘<samp>-atag <var>fourcc/tag</var></samp>’</dt>
1102 <dd><p>Force audio tag/fourcc.
1104 <dt> ‘<samp>-audio_service_type <var>type</var></samp>’</dt>
1105 <dd><p>Set the type of service that the audio stream contains.
1106 </p><dl compact="compact">
1107 <dt> ‘<samp>ma</samp>’</dt>
1108 <dd><p>Main Audio Service (default)
1110 <dt> ‘<samp>ef</samp>’</dt>
1113 <dt> ‘<samp>vi</samp>’</dt>
1114 <dd><p>Visually Impaired
1116 <dt> ‘<samp>hi</samp>’</dt>
1117 <dd><p>Hearing Impaired
1119 <dt> ‘<samp>di</samp>’</dt>
1122 <dt> ‘<samp>co</samp>’</dt>
1125 <dt> ‘<samp>em</samp>’</dt>
1128 <dt> ‘<samp>vo</samp>’</dt>
1131 <dt> ‘<samp>ka</samp>’</dt>
1136 <dt> ‘<samp>-absf <var>bitstream_filter</var></samp>’</dt>
1137 <dd><p>Bitstream filters available are "dump_extra", "remove_extra", "noise", "mp3comp", "mp3decomp".
1141 <a name="Subtitle-options_003a"></a>
1142 <h2 class="section"><a href="ffmpeg.html#toc-Subtitle-options_003a">3.7 Subtitle options:</a></h2>
1144 <dl compact="compact">
1145 <dt> ‘<samp>-scodec <var>codec</var></samp>’</dt>
1146 <dd><p>Force subtitle codec (’copy’ to copy stream).
1148 <dt> ‘<samp>-newsubtitle</samp>’</dt>
1149 <dd><p>Add a new subtitle stream to the current output stream.
1151 <dt> ‘<samp>-slang <var>code</var></samp>’</dt>
1152 <dd><p>Set the ISO 639 language code (3 letters) of the current subtitle stream.
1154 <dt> ‘<samp>-sn</samp>’</dt>
1155 <dd><p>Disable subtitle recording.
1157 <dt> ‘<samp>-sbsf <var>bitstream_filter</var></samp>’</dt>
1158 <dd><p>Bitstream filters available are "mov2textsub", "text2movsub".
1159 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i file.mov -an -vn -sbsf mov2textsub -scodec copy -f rawvideo sub.txt
1160 </pre></td></tr></table>
1164 <a name="Audio_002fVideo-grab-options"></a>
1165 <h2 class="section"><a href="ffmpeg.html#toc-Audio_002fVideo-grab-options">3.8 Audio/Video grab options</a></h2>
1167 <dl compact="compact">
1168 <dt> ‘<samp>-vc <var>channel</var></samp>’</dt>
1169 <dd><p>Set video grab channel (DV1394 only).
1171 <dt> ‘<samp>-tvstd <var>standard</var></samp>’</dt>
1172 <dd><p>Set television standard (NTSC, PAL (SECAM)).
1174 <dt> ‘<samp>-isync</samp>’</dt>
1175 <dd><p>Synchronize read on input.
1179 <a name="Advanced-options"></a>
1180 <h2 class="section"><a href="ffmpeg.html#toc-Advanced-options">3.9 Advanced options</a></h2>
1182 <dl compact="compact">
1183 <dt> ‘<samp>-map <var>input_file_id</var>.<var>input_stream_id</var>[:<var>sync_file_id</var>.<var>sync_stream_id</var>]</samp>’</dt>
1185 <p>Designate an input stream as a source for the output file. Each input
1186 stream is identified by the input file index <var>input_file_id</var> and
1187 the input stream index <var>input_stream_id</var> within the input
1188 file. Both indexes start at 0. If specified,
1189 <var>sync_file_id</var>.<var>sync_stream_id</var> sets which input stream
1190 is used as a presentation sync reference.
1192 <p>The <code>-map</code> options must be specified just after the output file.
1193 If any <code>-map</code> options are used, the number of <code>-map</code> options
1194 on the command line must match the number of streams in the output
1195 file. The first <code>-map</code> option on the command line specifies the
1196 source for output stream 0, the second <code>-map</code> option specifies
1197 the source for output stream 1, etc.
1199 <p>For example, if you have two audio streams in the first input file,
1200 these streams are identified by "0.0" and "0.1". You can use
1201 <code>-map</code> to select which stream to place in an output file. For
1203 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT out.wav -map 0.1
1204 </pre></td></tr></table>
1205 <p>will map the input stream in ‘<tt>INPUT</tt>’ identified by "0.1" to
1206 the (single) output stream in ‘<tt>out.wav</tt>’.
1208 <p>For example, to select the stream with index 2 from input file
1209 ‘<tt>a.mov</tt>’ (specified by the identifier "0.2"), and stream with
1210 index 6 from input ‘<tt>b.mov</tt>’ (specified by the identifier "1.6"),
1211 and copy them to the output file ‘<tt>out.mov</tt>’:
1212 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i a.mov -i b.mov -vcodec copy -acodec copy out.mov -map 0.2 -map 1.6
1213 </pre></td></tr></table>
1215 <p>To add more streams to the output file, you can use the
1216 <code>-newaudio</code>, <code>-newvideo</code>, <code>-newsubtitle</code> options.
1219 <dt> ‘<samp>-map_meta_data <var>outfile</var>[,<var>metadata</var>]:<var>infile</var>[,<var>metadata</var>]</samp>’</dt>
1220 <dd><p>Deprecated, use <var>-map_metadata</var> instead.
1223 <dt> ‘<samp>-map_metadata <var>outfile</var>[,<var>metadata</var>]:<var>infile</var>[,<var>metadata</var>]</samp>’</dt>
1224 <dd><p>Set metadata information of <var>outfile</var> from <var>infile</var>. Note that those
1225 are file indices (zero-based), not filenames.
1226 Optional <var>metadata</var> parameters specify, which metadata to copy - (g)lobal
1227 (i.e. metadata that applies to the whole file), per-(s)tream, per-(c)hapter or
1228 per-(p)rogram. All metadata specifiers other than global must be followed by the
1229 stream/chapter/program number. If metadata specifier is omitted, it defaults to
1232 <p>By default, global metadata is copied from the first input file to all output files,
1233 per-stream and per-chapter metadata is copied along with streams/chapters. These
1234 default mappings are disabled by creating any mapping of the relevant type. A negative
1235 file index can be used to create a dummy mapping that just disables automatic copying.
1237 <p>For example to copy metadata from the first stream of the input file to global metadata
1239 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i in.ogg -map_metadata 0:0,s0 out.mp3
1240 </pre></td></tr></table>
1242 <dt> ‘<samp>-map_chapters <var>outfile</var>:<var>infile</var></samp>’</dt>
1243 <dd><p>Copy chapters from <var>infile</var> to <var>outfile</var>. If no chapter mapping is specified,
1244 then chapters are copied from the first input file with at least one chapter to all
1245 output files. Use a negative file index to disable any chapter copying.
1247 <dt> ‘<samp>-debug</samp>’</dt>
1248 <dd><p>Print specific debug info.
1250 <dt> ‘<samp>-benchmark</samp>’</dt>
1251 <dd><p>Show benchmarking information at the end of an encode.
1252 Shows CPU time used and maximum memory consumption.
1253 Maximum memory consumption is not supported on all systems,
1254 it will usually display as 0 if not supported.
1256 <dt> ‘<samp>-dump</samp>’</dt>
1257 <dd><p>Dump each input packet.
1259 <dt> ‘<samp>-hex</samp>’</dt>
1260 <dd><p>When dumping packets, also dump the payload.
1262 <dt> ‘<samp>-bitexact</samp>’</dt>
1263 <dd><p>Only use bit exact algorithms (for codec testing).
1265 <dt> ‘<samp>-ps <var>size</var></samp>’</dt>
1266 <dd><p>Set RTP payload size in bytes.
1268 <dt> ‘<samp>-re</samp>’</dt>
1269 <dd><p>Read input at native frame rate. Mainly used to simulate a grab device.
1271 <dt> ‘<samp>-loop_input</samp>’</dt>
1272 <dd><p>Loop over the input stream. Currently it works only for image
1273 streams. This option is used for automatic FFserver testing.
1275 <dt> ‘<samp>-loop_output <var>number_of_times</var></samp>’</dt>
1276 <dd><p>Repeatedly loop output for formats that support looping such as animated GIF
1277 (0 will loop the output infinitely).
1279 <dt> ‘<samp>-threads <var>count</var></samp>’</dt>
1280 <dd><p>Thread count.
1282 <dt> ‘<samp>-vsync <var>parameter</var></samp>’</dt>
1283 <dd><p>Video sync method.
1285 <dl compact="compact">
1286 <dt> ‘<samp>0</samp>’</dt>
1287 <dd><p>Each frame is passed with its timestamp from the demuxer to the muxer.
1289 <dt> ‘<samp>1</samp>’</dt>
1290 <dd><p>Frames will be duplicated and dropped to achieve exactly the requested
1293 <dt> ‘<samp>2</samp>’</dt>
1294 <dd><p>Frames are passed through with their timestamp or dropped so as to
1295 prevent 2 frames from having the same timestamp.
1297 <dt> ‘<samp>-1</samp>’</dt>
1298 <dd><p>Chooses between 1 and 2 depending on muxer capabilities. This is the
1303 <p>With -map you can select from which stream the timestamps should be
1304 taken. You can leave either video or audio unchanged and sync the
1305 remaining stream(s) to the unchanged one.
1308 <dt> ‘<samp>-async <var>samples_per_second</var></samp>’</dt>
1309 <dd><p>Audio sync method. "Stretches/squeezes" the audio stream to match the timestamps,
1310 the parameter is the maximum samples per second by which the audio is changed.
1311 -async 1 is a special case where only the start of the audio stream is corrected
1312 without any later correction.
1314 <dt> ‘<samp>-copyts</samp>’</dt>
1315 <dd><p>Copy timestamps from input to output.
1317 <dt> ‘<samp>-copytb</samp>’</dt>
1318 <dd><p>Copy input stream time base from input to output when stream copying.
1320 <dt> ‘<samp>-shortest</samp>’</dt>
1321 <dd><p>Finish encoding when the shortest input stream ends.
1323 <dt> ‘<samp>-dts_delta_threshold</samp>’</dt>
1324 <dd><p>Timestamp discontinuity delta threshold.
1326 <dt> ‘<samp>-muxdelay <var>seconds</var></samp>’</dt>
1327 <dd><p>Set the maximum demux-decode delay.
1329 <dt> ‘<samp>-muxpreload <var>seconds</var></samp>’</dt>
1330 <dd><p>Set the initial demux-decode delay.
1332 <dt> ‘<samp>-streamid <var>output-stream-index</var>:<var>new-value</var></samp>’</dt>
1333 <dd><p>Assign a new stream-id value to an output stream. This option should be
1334 specified prior to the output filename to which it applies.
1335 For the situation where multiple output files exist, a streamid
1336 may be reassigned to a different value.
1338 <p>For example, to set the stream 0 PID to 33 and the stream 1 PID to 36 for
1339 an output mpegts file:
1340 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i infile -streamid 0:33 -streamid 1:36 out.ts
1341 </pre></td></tr></table>
1345 <a name="Preset-files"></a>
1346 <h2 class="section"><a href="ffmpeg.html#toc-Preset-files">3.10 Preset files</a></h2>
1348 <p>A preset file contains a sequence of <var>option</var>=<var>value</var> pairs,
1349 one for each line, specifying a sequence of options which would be
1350 awkward to specify on the command line. Lines starting with the hash
1351 (’#’) character are ignored and are used to provide comments. Check
1352 the ‘<tt>ffpresets</tt>’ directory in the FFmpeg source tree for examples.
1354 <p>Preset files are specified with the <code>vpre</code>, <code>apre</code>,
1355 <code>spre</code>, and <code>fpre</code> options. The <code>fpre</code> option takes the
1356 filename of the preset instead of a preset name as input and can be
1357 used for any kind of codec. For the <code>vpre</code>, <code>apre</code>, and
1358 <code>spre</code> options, the options specified in a preset file are
1359 applied to the currently selected codec of the same type as the preset
1362 <p>The argument passed to the <code>vpre</code>, <code>apre</code>, and <code>spre</code>
1363 preset options identifies the preset file to use according to the
1366 <p>First ffmpeg searches for a file named <var>arg</var>.ffpreset in the
1367 directories ‘<tt>$FFMPEG_DATADIR</tt>’ (if set), and ‘<tt>$HOME/.ffmpeg</tt>’, and in
1368 the datadir defined at configuration time (usually ‘<tt>PREFIX/share/ffmpeg</tt>’)
1369 or in a ‘<tt>ffpresets</tt>’ folder along the executable on win32,
1370 in that order. For example, if the argument is <code>libx264-max</code>, it will
1371 search for the file ‘<tt>libx264-max.ffpreset</tt>’.
1373 <p>If no such file is found, then ffmpeg will search for a file named
1374 <var>codec_name</var>-<var>arg</var>.ffpreset in the above-mentioned
1375 directories, where <var>codec_name</var> is the name of the codec to which
1376 the preset file options will be applied. For example, if you select
1377 the video codec with <code>-vcodec libx264</code> and use <code>-vpre max</code>,
1378 then it will search for the file ‘<tt>libx264-max.ffpreset</tt>’.
1381 <h1 class="chapter"><a href="ffmpeg.html#toc-Tips">4. Tips</a></h1>
1385 For streaming at very low bitrate application, use a low frame rate
1386 and a small GOP size. This is especially true for RealVideo where
1387 the Linux player does not seem to be very fast, so it can miss
1388 frames. An example is:
1390 <table><tr><td> </td><td><pre class="example">ffmpeg -g 3 -r 3 -t 10 -b 50k -s qcif -f rv10 /tmp/b.rm
1391 </pre></td></tr></table>
1394 The parameter ’q’ which is displayed while encoding is the current
1395 quantizer. The value 1 indicates that a very good quality could
1396 be achieved. The value 31 indicates the worst quality. If q=31 appears
1397 too often, it means that the encoder cannot compress enough to meet
1398 your bitrate. You must either increase the bitrate, decrease the
1399 frame rate or decrease the frame size.
1402 If your computer is not fast enough, you can speed up the
1403 compression at the expense of the compression ratio. You can use
1404 ’-me zero’ to speed up motion estimation, and ’-intra’ to disable
1405 motion estimation completely (you have only I-frames, which means it
1406 is about as good as JPEG compression).
1409 To have very low audio bitrates, reduce the sampling frequency
1410 (down to 22050 Hz for MPEG audio, 22050 or 11025 for AC-3).
1413 To have a constant quality (but a variable bitrate), use the option
1414 ’-qscale n’ when ’n’ is between 1 (excellent quality) and 31 (worst
1418 When converting video files, you can use the ’-sameq’ option which
1419 uses the same quality factor in the encoder as in the decoder.
1420 It allows almost lossless encoding.
1424 <a name="Examples"></a>
1425 <h1 class="chapter"><a href="ffmpeg.html#toc-Examples">5. Examples</a></h1>
1427 <a name="Video-and-Audio-grabbing"></a>
1428 <h2 class="section"><a href="ffmpeg.html#toc-Video-and-Audio-grabbing">5.1 Video and Audio grabbing</a></h2>
1430 <p>If you specify the input format and device then ffmpeg can grab video
1433 <table><tr><td> </td><td><pre class="example">ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
1434 </pre></td></tr></table>
1436 <p>Note that you must activate the right video source and channel before
1437 launching ffmpeg with any TV viewer such as xawtv
1438 (<a href="http://linux.bytesex.org/xawtv/">http://linux.bytesex.org/xawtv/</a>) by Gerd Knorr. You also
1439 have to set the audio recording levels correctly with a
1442 <a name="X11-grabbing"></a>
1443 <h2 class="section"><a href="ffmpeg.html#toc-X11-grabbing">5.2 X11 grabbing</a></h2>
1445 <p>Grab the X11 display with ffmpeg via
1447 <table><tr><td> </td><td><pre class="example">ffmpeg -f x11grab -s cif -r 25 -i :0.0 /tmp/out.mpg
1448 </pre></td></tr></table>
1450 <p>0.0 is display.screen number of your X11 server, same as
1451 the DISPLAY environment variable.
1453 <table><tr><td> </td><td><pre class="example">ffmpeg -f x11grab -s cif -r 25 -i :0.0+10,20 /tmp/out.mpg
1454 </pre></td></tr></table>
1456 <p>0.0 is display.screen number of your X11 server, same as the DISPLAY environment
1457 variable. 10 is the x-offset and 20 the y-offset for the grabbing.
1459 <a name="Video-and-Audio-file-format-conversion"></a>
1460 <h2 class="section"><a href="ffmpeg.html#toc-Video-and-Audio-file-format-conversion">5.3 Video and Audio file format conversion</a></h2>
1462 <p>Any supported file format and protocol can serve as input to ffmpeg:
1467 You can use YUV files as input:
1469 <table><tr><td> </td><td><pre class="example">ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
1470 </pre></td></tr></table>
1472 <p>It will use the files:
1473 </p><table><tr><td> </td><td><pre class="example">/tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
1474 /tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
1475 </pre></td></tr></table>
1477 <p>The Y files use twice the resolution of the U and V files. They are
1478 raw files, without header. They can be generated by all decent video
1479 decoders. You must specify the size of the image with the ‘<samp>-s</samp>’ option
1480 if ffmpeg cannot guess it.
1483 You can input from a raw YUV420P file:
1485 <table><tr><td> </td><td><pre class="example">ffmpeg -i /tmp/test.yuv /tmp/out.avi
1486 </pre></td></tr></table>
1488 <p>test.yuv is a file containing raw YUV planar data. Each frame is composed
1489 of the Y plane followed by the U and V planes at half vertical and
1490 horizontal resolution.
1493 You can output to a raw YUV420P file:
1495 <table><tr><td> </td><td><pre class="example">ffmpeg -i mydivx.avi hugefile.yuv
1496 </pre></td></tr></table>
1499 You can set several input files and output files:
1501 <table><tr><td> </td><td><pre class="example">ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
1502 </pre></td></tr></table>
1504 <p>Converts the audio file a.wav and the raw YUV video file a.yuv
1508 You can also do audio and video conversions at the same time:
1510 <table><tr><td> </td><td><pre class="example">ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
1511 </pre></td></tr></table>
1513 <p>Converts a.wav to MPEG audio at 22050 Hz sample rate.
1516 You can encode to several formats at the same time and define a
1517 mapping from input stream to output streams:
1519 <table><tr><td> </td><td><pre class="example">ffmpeg -i /tmp/a.wav -ab 64k /tmp/a.mp2 -ab 128k /tmp/b.mp2 -map 0:0 -map 0:0
1520 </pre></td></tr></table>
1522 <p>Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. ’-map
1523 file:index’ specifies which input stream is used for each output
1524 stream, in the order of the definition of output streams.
1527 You can transcode decrypted VOBs:
1529 <table><tr><td> </td><td><pre class="example">ffmpeg -i snatch_1.vob -f avi -vcodec mpeg4 -b 800k -g 300 -bf 2 -acodec libmp3lame -ab 128k snatch.avi
1530 </pre></td></tr></table>
1532 <p>This is a typical DVD ripping example; the input is a VOB file, the
1533 output an AVI file with MPEG-4 video and MP3 audio. Note that in this
1534 command we use B-frames so the MPEG-4 stream is DivX5 compatible, and
1535 GOP size is 300 which means one intra frame every 10 seconds for 29.97fps
1536 input video. Furthermore, the audio stream is MP3-encoded so you need
1537 to enable LAME support by passing <code>--enable-libmp3lame</code> to configure.
1538 The mapping is particularly useful for DVD transcoding
1539 to get the desired audio language.
1541 <p>NOTE: To see the supported input formats, use <code>ffmpeg -formats</code>.
1544 You can extract images from a video, or create a video from many images:
1546 <p>For extracting images from a video:
1547 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg
1548 </pre></td></tr></table>
1550 <p>This will extract one video frame per second from the video and will
1551 output them in files named ‘<tt>foo-001.jpeg</tt>’, ‘<tt>foo-002.jpeg</tt>’,
1552 etc. Images will be rescaled to fit the new WxH values.
1554 <p>If you want to extract just a limited number of frames, you can use the
1555 above command in combination with the -vframes or -t option, or in
1556 combination with -ss to start extracting from a certain point in time.
1558 <p>For creating a video from many images:
1559 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f image2 -i foo-%03d.jpeg -r 12 -s WxH foo.avi
1560 </pre></td></tr></table>
1562 <p>The syntax <code>foo-%03d.jpeg</code> specifies to use a decimal number
1563 composed of three digits padded with zeroes to express the sequence
1564 number. It is the same syntax supported by the C printf function, but
1565 only formats accepting a normal integer are suitable.
1568 You can put many streams of the same type in the output:
1570 <table><tr><td> </td><td><pre class="example">ffmpeg -i test1.avi -i test2.avi -vcodec copy -acodec copy -vcodec copy -acodec copy test12.avi -newvideo -newaudio
1571 </pre></td></tr></table>
1573 <p>In addition to the first video and audio streams, the resulting
1574 output file ‘<tt>test12.avi</tt>’ will contain the second video
1575 and the second audio stream found in the input streams list.
1577 <p>The <code>-newvideo</code>, <code>-newaudio</code> and <code>-newsubtitle</code>
1578 options have to be specified immediately after the name of the output
1579 file to which you want to add them.
1583 <a name="Expression-Evaluation"></a>
1584 <h1 class="chapter"><a href="ffmpeg.html#toc-Expression-Evaluation">6. Expression Evaluation</a></h1>
1586 <p>When evaluating an arithemetic expression, FFmpeg uses an internal
1587 formula evaluator, implemented through the ‘<tt>libavutil/eval.h</tt>’
1590 <p>An expression may contain unary, binary operators, constants, and
1593 <p>Two expressions <var>expr1</var> and <var>expr2</var> can be combined to form
1594 another expression "<var>expr1</var>;<var>expr2</var>".
1595 <var>expr1</var> and <var>expr2</var> are evaluated in turn, and the new
1596 expression evaluates to the value of <var>expr2</var>.
1598 <p>The following binary operators are available: <code>+</code>, <code>-</code>,
1599 <code>*</code>, <code>/</code>, <code>^</code>.
1601 <p>The following unary operators are available: <code>+</code>, <code>-</code>.
1603 <p>The following functions are available:
1604 </p><dl compact="compact">
1605 <dt> ‘<samp>sinh(x)</samp>’</dt>
1606 <dt> ‘<samp>cosh(x)</samp>’</dt>
1607 <dt> ‘<samp>tanh(x)</samp>’</dt>
1608 <dt> ‘<samp>sin(x)</samp>’</dt>
1609 <dt> ‘<samp>cos(x)</samp>’</dt>
1610 <dt> ‘<samp>tan(x)</samp>’</dt>
1611 <dt> ‘<samp>atan(x)</samp>’</dt>
1612 <dt> ‘<samp>asin(x)</samp>’</dt>
1613 <dt> ‘<samp>acos(x)</samp>’</dt>
1614 <dt> ‘<samp>exp(x)</samp>’</dt>
1615 <dt> ‘<samp>log(x)</samp>’</dt>
1616 <dt> ‘<samp>abs(x)</samp>’</dt>
1617 <dt> ‘<samp>squish(x)</samp>’</dt>
1618 <dt> ‘<samp>gauss(x)</samp>’</dt>
1619 <dt> ‘<samp>isnan(x)</samp>’</dt>
1620 <dd><p>Return 1.0 if <var>x</var> is NAN, 0.0 otherwise.
1623 <dt> ‘<samp>mod(x, y)</samp>’</dt>
1624 <dt> ‘<samp>max(x, y)</samp>’</dt>
1625 <dt> ‘<samp>min(x, y)</samp>’</dt>
1626 <dt> ‘<samp>eq(x, y)</samp>’</dt>
1627 <dt> ‘<samp>gte(x, y)</samp>’</dt>
1628 <dt> ‘<samp>gt(x, y)</samp>’</dt>
1629 <dt> ‘<samp>lte(x, y)</samp>’</dt>
1630 <dt> ‘<samp>lt(x, y)</samp>’</dt>
1631 <dt> ‘<samp>st(var, expr)</samp>’</dt>
1632 <dd><p>Allow to store the value of the expression <var>expr</var> in an internal
1633 variable. <var>var</var> specifies the number of the variable where to
1634 store the value, and it is a value ranging from 0 to 9. The function
1635 returns the value stored in the internal variable.
1638 <dt> ‘<samp>ld(var)</samp>’</dt>
1639 <dd><p>Allow to load the value of the internal variable with number
1640 <var>var</var>, which was previosly stored with st(<var>var</var>, <var>expr</var>).
1641 The function returns the loaded value.
1644 <dt> ‘<samp>while(cond, expr)</samp>’</dt>
1645 <dd><p>Evaluate expression <var>expr</var> while the expression <var>cond</var> is
1646 non-zero, and returns the value of the last <var>expr</var> evaluation, or
1647 NAN if <var>cond</var> was always false.
1650 <dt> ‘<samp>ceil(expr)</samp>’</dt>
1651 <dd><p>Round the value of expression <var>expr</var> upwards to the nearest
1652 integer. For example, "ceil(1.5)" is "2.0".
1655 <dt> ‘<samp>floor(expr)</samp>’</dt>
1656 <dd><p>Round the value of expression <var>expr</var> downwards to the nearest
1657 integer. For example, "floor(-1.5)" is "-2.0".
1660 <dt> ‘<samp>trunc(expr)</samp>’</dt>
1661 <dd><p>Round the value of expression <var>expr</var> towards zero to the nearest
1662 integer. For example, "trunc(-1.5)" is "-1.0".
1665 <dt> ‘<samp>sqrt(expr)</samp>’</dt>
1666 <dd><p>Compute the square root of <var>expr</var>. This is equivalent to
1667 "(<var>expr</var>)^.5".
1670 <dt> ‘<samp>not(expr)</samp>’</dt>
1671 <dd><p>Return 1.0 if <var>expr</var> is zero, 0.0 otherwise.
1674 <dt> ‘<samp>pow(x, y)</samp>’</dt>
1675 <dd><p>Compute the power of <var>x</var> elevated <var>y</var>, it is equivalent to
1676 "(<var>x</var>)^(<var>y</var>)".
1682 <p><code>*</code> works like AND
1684 <p><code>+</code> works like OR
1687 </p><table><tr><td> </td><td><pre class="example">if A then B else C
1688 </pre></td></tr></table>
1690 </p><table><tr><td> </td><td><pre class="example">A*B + not(A)*C
1691 </pre></td></tr></table>
1693 <p>In your C code, you can extend the list of unary and binary functions,
1694 and define recognized constants, so that they are available for your
1697 <p>The evaluator also recognizes the International System number
1698 postfixes. If ’i’ is appended after the postfix, powers of 2 are used
1699 instead of powers of 10. The ’B’ postfix multiplies the value for 8,
1700 and can be appended after another postfix or used alone. This allows
1701 using for example ’KB’, ’MiB’, ’G’ and ’B’ as postfix.
1703 <p>Follows the list of available International System postfixes, with
1704 indication of the corresponding powers of 10 and of 2.
1705 </p><dl compact="compact">
1706 <dt> ‘<samp>y</samp>’</dt>
1709 <dt> ‘<samp>z</samp>’</dt>
1712 <dt> ‘<samp>a</samp>’</dt>
1715 <dt> ‘<samp>f</samp>’</dt>
1718 <dt> ‘<samp>p</samp>’</dt>
1721 <dt> ‘<samp>n</samp>’</dt>
1724 <dt> ‘<samp>u</samp>’</dt>
1727 <dt> ‘<samp>m</samp>’</dt>
1730 <dt> ‘<samp>c</samp>’</dt>
1733 <dt> ‘<samp>d</samp>’</dt>
1736 <dt> ‘<samp>h</samp>’</dt>
1739 <dt> ‘<samp>k</samp>’</dt>
1742 <dt> ‘<samp>K</samp>’</dt>
1745 <dt> ‘<samp>M</samp>’</dt>
1748 <dt> ‘<samp>G</samp>’</dt>
1751 <dt> ‘<samp>T</samp>’</dt>
1754 <dt> ‘<samp>P</samp>’</dt>
1757 <dt> ‘<samp>E</samp>’</dt>
1760 <dt> ‘<samp>Z</samp>’</dt>
1763 <dt> ‘<samp>Y</samp>’</dt>
1768 <a name="Decoders"></a>
1769 <h1 class="chapter"><a href="ffmpeg.html#toc-Decoders">7. Decoders</a></h1>
1771 <p>Decoders are configured elements in FFmpeg which allow the decoding of
1774 <p>When you configure your FFmpeg build, all the supported native decoders
1775 are enabled by default. Decoders requiring an external library must be enabled
1776 manually via the corresponding <code>--enable-lib</code> option. You can list all
1777 available decoders using the configure option <code>--list-decoders</code>.
1779 <p>You can disable all the decoders with the configure option
1780 <code>--disable-decoders</code> and selectively enable / disable single decoders
1781 with the options <code>--enable-decoder=<var>DECODER</var></code> /
1782 <code>--disable-decoder=<var>DECODER</var></code>.
1784 <p>The option <code>-codecs</code> of the ff* tools will display the list of
1788 <a name="Video-Decoders"></a>
1789 <h1 class="chapter"><a href="ffmpeg.html#toc-Video-Decoders">8. Video Decoders</a></h1>
1791 <p>A description of some of the currently available video decoders
1794 <a name="rawvideo"></a>
1795 <h2 class="section"><a href="ffmpeg.html#toc-rawvideo">8.1 rawvideo</a></h2>
1797 <p>Rawvideo decoder.
1799 <p>This decoder decodes rawvideo streams.
1801 <a name="Options"></a>
1802 <h3 class="subsection"><a href="ffmpeg.html#toc-Options">8.1.1 Options</a></h3>
1804 <dl compact="compact">
1805 <dt> ‘<samp>top <var>top_field_first</var></samp>’</dt>
1806 <dd><p>Specify the assumed field type of the input video.
1807 </p><dl compact="compact">
1808 <dt> ‘<samp>-1</samp>’</dt>
1809 <dd><p>the video is assumed to be progressive (default)
1811 <dt> ‘<samp>0</samp>’</dt>
1812 <dd><p>bottom-field-first is assumed
1814 <dt> ‘<samp>1</samp>’</dt>
1815 <dd><p>top-field-first is assumed
1822 <a name="Encoders"></a>
1823 <h1 class="chapter"><a href="ffmpeg.html#toc-Encoders">9. Encoders</a></h1>
1825 <p>Encoders are configured elements in FFmpeg which allow the encoding of
1828 <p>When you configure your FFmpeg build, all the supported native encoders
1829 are enabled by default. Encoders requiring an external library must be enabled
1830 manually via the corresponding <code>--enable-lib</code> option. You can list all
1831 available encoders using the configure option <code>--list-encoders</code>.
1833 <p>You can disable all the encoders with the configure option
1834 <code>--disable-encoders</code> and selectively enable / disable single encoders
1835 with the options <code>--enable-encoder=<var>ENCODER</var></code> /
1836 <code>--disable-encoder=<var>ENCODER</var></code>.
1838 <p>The option <code>-codecs</code> of the ff* tools will display the list of
1842 <a name="Audio-Encoders"></a>
1843 <h1 class="chapter"><a href="ffmpeg.html#toc-Audio-Encoders">10. Audio Encoders</a></h1>
1845 <p>A description of some of the currently available audio encoders
1848 <a name="ac3-and-ac3_005ffixed"></a>
1849 <h2 class="section"><a href="ffmpeg.html#toc-ac3-and-ac3_005ffixed">10.1 ac3 and ac3_fixed</a></h2>
1851 <p>AC-3 audio encoders.
1853 <p>These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
1854 the undocumented RealAudio 3 (a.k.a. dnet).
1856 <p>The <var>ac3</var> encoder uses floating-point math, while the <var>ac3_fixed</var>
1857 encoder only uses fixed-point integer math. This does not mean that one is
1858 always faster, just that one or the other may be better suited to a
1859 particular system. The floating-point encoder will generally produce better
1860 quality audio for a given bitrate. The <var>ac3_fixed</var> encoder is not the
1861 default codec for any of the output formats, so it must be specified explicitly
1862 using the option <code>-acodec ac3_fixed</code> in order to use it.
1864 <a name="AC_002d3-Metadata"></a>
1865 <h3 class="subsection"><a href="ffmpeg.html#toc-AC_002d3-Metadata">10.1.1 AC-3 Metadata</a></h3>
1867 <p>The AC-3 metadata options are used to set parameters that describe the audio,
1868 but in most cases do not affect the audio encoding itself. Some of the options
1869 do directly affect or influence the decoding and playback of the resulting
1870 bitstream, while others are just for informational purposes. A few of the
1871 options will add bits to the output stream that could otherwise be used for
1872 audio data, and will thus affect the quality of the output. Those will be
1873 indicated accordingly with a note in the option list below.
1875 <p>These parameters are described in detail in several publicly-available
1878 <li> <a href="http://www.atsc.org/cms/standards/a_52-2010.pdf">A/52:2010 - Digital Audio Compression (AC-3) (E-AC-3) Standard</a>
1879 </li><li> <a href="http://www.atsc.org/cms/standards/a_54a_with_corr_1.pdf">A/54 - Guide to the Use of the ATSC Digital Television Standard</a>
1880 </li><li> <a href="http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf">Dolby Metadata Guide</a>
1881 </li><li> <a href="http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf">Dolby Digital Professional Encoding Guidelines</a>
1884 <a name="Metadata-Control-Options"></a>
1885 <h4 class="subsubsection"><a href="ffmpeg.html#toc-Metadata-Control-Options">10.1.1.1 Metadata Control Options</a></h4>
1887 <dl compact="compact">
1888 <dt> ‘<samp>-per_frame_metadata <var>boolean</var></samp>’</dt>
1889 <dd><p>Allow Per-Frame Metadata. Specifies if the encoder should check for changing
1890 metadata for each frame.
1891 </p><dl compact="compact">
1892 <dt> ‘<samp>0</samp>’</dt>
1893 <dd><p>The metadata values set at initialization will be used for every frame in the
1896 <dt> ‘<samp>1</samp>’</dt>
1897 <dd><p>Metadata values can be changed before encoding each frame.
1904 <a name="Downmix-Levels"></a>
1905 <h4 class="subsubsection"><a href="ffmpeg.html#toc-Downmix-Levels">10.1.1.2 Downmix Levels</a></h4>
1907 <dl compact="compact">
1908 <dt> ‘<samp>-center_mixlev <var>level</var></samp>’</dt>
1909 <dd><p>Center Mix Level. The amount of gain the decoder should apply to the center
1910 channel when downmixing to stereo. This field will only be written to the
1911 bitstream if a center channel is present. The value is specified as a scale
1912 factor. There are 3 valid values:
1913 </p><dl compact="compact">
1914 <dt> ‘<samp>0.707</samp>’</dt>
1915 <dd><p>Apply -3dB gain
1917 <dt> ‘<samp>0.595</samp>’</dt>
1918 <dd><p>Apply -4.5dB gain (default)
1920 <dt> ‘<samp>0.500</samp>’</dt>
1921 <dd><p>Apply -6dB gain
1926 <dt> ‘<samp>-surround_mixlev <var>level</var></samp>’</dt>
1927 <dd><p>Surround Mix Level. The amount of gain the decoder should apply to the surround
1928 channel(s) when downmixing to stereo. This field will only be written to the
1929 bitstream if one or more surround channels are present. The value is specified
1930 as a scale factor. There are 3 valid values:
1931 </p><dl compact="compact">
1932 <dt> ‘<samp>0.707</samp>’</dt>
1933 <dd><p>Apply -3dB gain
1935 <dt> ‘<samp>0.500</samp>’</dt>
1936 <dd><p>Apply -6dB gain (default)
1938 <dt> ‘<samp>0.000</samp>’</dt>
1939 <dd><p>Silence Surround Channel(s)
1946 <a name="Audio-Production-Information"></a>
1947 <h4 class="subsubsection"><a href="ffmpeg.html#toc-Audio-Production-Information">10.1.1.3 Audio Production Information</a></h4>
1948 <p>Audio Production Information is optional information describing the mixing
1949 environment. Either none or both of the fields are written to the bitstream.
1951 <dl compact="compact">
1952 <dt> ‘<samp>-mixing_level <var>number</var></samp>’</dt>
1953 <dd><p>Mixing Level. Specifies peak sound pressure level (SPL) in the production
1954 environment when the mix was mastered. Valid values are 80 to 111, or -1 for
1955 unknown or not indicated. The default value is -1, but that value cannot be
1956 used if the Audio Production Information is written to the bitstream. Therefore,
1957 if the <code>room_type</code> option is not the default value, the <code>mixing_level</code>
1958 option must not be -1.
1961 <dt> ‘<samp>-room_type <var>type</var></samp>’</dt>
1962 <dd><p>Room Type. Describes the equalization used during the final mixing session at
1963 the studio or on the dubbing stage. A large room is a dubbing stage with the
1964 industry standard X-curve equalization; a small room has flat equalization.
1965 This field will not be written to the bitstream if both the <code>mixing_level</code>
1966 option and the <code>room_type</code> option have the default values.
1967 </p><dl compact="compact">
1968 <dt> ‘<samp>0</samp>’</dt>
1969 <dt> ‘<samp>notindicated</samp>’</dt>
1970 <dd><p>Not Indicated (default)
1972 <dt> ‘<samp>1</samp>’</dt>
1973 <dt> ‘<samp>large</samp>’</dt>
1976 <dt> ‘<samp>2</samp>’</dt>
1977 <dt> ‘<samp>small</samp>’</dt>
1985 <a name="Other-Metadata-Options"></a>
1986 <h4 class="subsubsection"><a href="ffmpeg.html#toc-Other-Metadata-Options">10.1.1.4 Other Metadata Options</a></h4>
1988 <dl compact="compact">
1989 <dt> ‘<samp>-copyright <var>boolean</var></samp>’</dt>
1990 <dd><p>Copyright Indicator. Specifies whether a copyright exists for this audio.
1991 </p><dl compact="compact">
1992 <dt> ‘<samp>0</samp>’</dt>
1993 <dt> ‘<samp>off</samp>’</dt>
1994 <dd><p>No Copyright Exists (default)
1996 <dt> ‘<samp>1</samp>’</dt>
1997 <dt> ‘<samp>on</samp>’</dt>
1998 <dd><p>Copyright Exists
2003 <dt> ‘<samp>-dialnorm <var>value</var></samp>’</dt>
2004 <dd><p>Dialogue Normalization. Indicates how far the average dialogue level of the
2005 program is below digital 100% full scale (0 dBFS). This parameter determines a
2006 level shift during audio reproduction that sets the average volume of the
2007 dialogue to a preset level. The goal is to match volume level between program
2008 sources. A value of -31dB will result in no volume level change, relative to
2009 the source volume, during audio reproduction. Valid values are whole numbers in
2010 the range -31 to -1, with -31 being the default.
2013 <dt> ‘<samp>-dsur_mode <var>mode</var></samp>’</dt>
2014 <dd><p>Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
2015 (Pro Logic). This field will only be written to the bitstream if the audio
2016 stream is stereo. Using this option does <b>NOT</b> mean the encoder will actually
2017 apply Dolby Surround processing.
2018 </p><dl compact="compact">
2019 <dt> ‘<samp>0</samp>’</dt>
2020 <dt> ‘<samp>notindicated</samp>’</dt>
2021 <dd><p>Not Indicated (default)
2023 <dt> ‘<samp>1</samp>’</dt>
2024 <dt> ‘<samp>off</samp>’</dt>
2025 <dd><p>Not Dolby Surround Encoded
2027 <dt> ‘<samp>2</samp>’</dt>
2028 <dt> ‘<samp>on</samp>’</dt>
2029 <dd><p>Dolby Surround Encoded
2034 <dt> ‘<samp>-original <var>boolean</var></samp>’</dt>
2035 <dd><p>Original Bit Stream Indicator. Specifies whether this audio is from the
2036 original source and not a copy.
2037 </p><dl compact="compact">
2038 <dt> ‘<samp>0</samp>’</dt>
2039 <dt> ‘<samp>off</samp>’</dt>
2040 <dd><p>Not Original Source
2042 <dt> ‘<samp>1</samp>’</dt>
2043 <dt> ‘<samp>on</samp>’</dt>
2044 <dd><p>Original Source (default)
2051 <a name="Extended-Bitstream-Information"></a>
2052 <h3 class="subsection"><a href="ffmpeg.html#toc-Extended-Bitstream-Information">10.1.2 Extended Bitstream Information</a></h3>
2053 <p>The extended bitstream options are part of the Alternate Bit Stream Syntax as
2054 specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
2055 If any one parameter in a group is specified, all values in that group will be
2056 written to the bitstream. Default values are used for those that are written
2057 but have not been specified. If the mixing levels are written, the decoder
2058 will use these values instead of the ones specified in the <code>center_mixlev</code>
2059 and <code>surround_mixlev</code> options if it supports the Alternate Bit Stream
2062 <a name="Extended-Bitstream-Information-_002d-Part-1"></a>
2063 <h4 class="subsubsection"><a href="ffmpeg.html#toc-Extended-Bitstream-Information-_002d-Part-1">10.1.2.1 Extended Bitstream Information - Part 1</a></h4>
2065 <dl compact="compact">
2066 <dt> ‘<samp>-dmix_mode <var>mode</var></samp>’</dt>
2067 <dd><p>Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
2068 (Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
2069 </p><dl compact="compact">
2070 <dt> ‘<samp>0</samp>’</dt>
2071 <dt> ‘<samp>notindicated</samp>’</dt>
2072 <dd><p>Not Indicated (default)
2074 <dt> ‘<samp>1</samp>’</dt>
2075 <dt> ‘<samp>ltrt</samp>’</dt>
2076 <dd><p>Lt/Rt Downmix Preferred
2078 <dt> ‘<samp>2</samp>’</dt>
2079 <dt> ‘<samp>loro</samp>’</dt>
2080 <dd><p>Lo/Ro Downmix Preferred
2085 <dt> ‘<samp>-ltrt_cmixlev <var>level</var></samp>’</dt>
2086 <dd><p>Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
2087 center channel when downmixing to stereo in Lt/Rt mode.
2088 </p><dl compact="compact">
2089 <dt> ‘<samp>1.414</samp>’</dt>
2090 <dd><p>Apply +3dB gain
2092 <dt> ‘<samp>1.189</samp>’</dt>
2093 <dd><p>Apply +1.5dB gain
2095 <dt> ‘<samp>1.000</samp>’</dt>
2096 <dd><p>Apply 0dB gain
2098 <dt> ‘<samp>0.841</samp>’</dt>
2099 <dd><p>Apply -1.5dB gain
2101 <dt> ‘<samp>0.707</samp>’</dt>
2102 <dd><p>Apply -3.0dB gain
2104 <dt> ‘<samp>0.595</samp>’</dt>
2105 <dd><p>Apply -4.5dB gain (default)
2107 <dt> ‘<samp>0.500</samp>’</dt>
2108 <dd><p>Apply -6.0dB gain
2110 <dt> ‘<samp>0.000</samp>’</dt>
2111 <dd><p>Silence Center Channel
2116 <dt> ‘<samp>-ltrt_surmixlev <var>level</var></samp>’</dt>
2117 <dd><p>Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
2118 surround channel(s) when downmixing to stereo in Lt/Rt mode.
2119 </p><dl compact="compact">
2120 <dt> ‘<samp>0.841</samp>’</dt>
2121 <dd><p>Apply -1.5dB gain
2123 <dt> ‘<samp>0.707</samp>’</dt>
2124 <dd><p>Apply -3.0dB gain
2126 <dt> ‘<samp>0.595</samp>’</dt>
2127 <dd><p>Apply -4.5dB gain
2129 <dt> ‘<samp>0.500</samp>’</dt>
2130 <dd><p>Apply -6.0dB gain (default)
2132 <dt> ‘<samp>0.000</samp>’</dt>
2133 <dd><p>Silence Surround Channel(s)
2138 <dt> ‘<samp>-loro_cmixlev <var>level</var></samp>’</dt>
2139 <dd><p>Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
2140 center channel when downmixing to stereo in Lo/Ro mode.
2141 </p><dl compact="compact">
2142 <dt> ‘<samp>1.414</samp>’</dt>
2143 <dd><p>Apply +3dB gain
2145 <dt> ‘<samp>1.189</samp>’</dt>
2146 <dd><p>Apply +1.5dB gain
2148 <dt> ‘<samp>1.000</samp>’</dt>
2149 <dd><p>Apply 0dB gain
2151 <dt> ‘<samp>0.841</samp>’</dt>
2152 <dd><p>Apply -1.5dB gain
2154 <dt> ‘<samp>0.707</samp>’</dt>
2155 <dd><p>Apply -3.0dB gain
2157 <dt> ‘<samp>0.595</samp>’</dt>
2158 <dd><p>Apply -4.5dB gain (default)
2160 <dt> ‘<samp>0.500</samp>’</dt>
2161 <dd><p>Apply -6.0dB gain
2163 <dt> ‘<samp>0.000</samp>’</dt>
2164 <dd><p>Silence Center Channel
2169 <dt> ‘<samp>-loro_surmixlev <var>level</var></samp>’</dt>
2170 <dd><p>Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
2171 surround channel(s) when downmixing to stereo in Lo/Ro mode.
2172 </p><dl compact="compact">
2173 <dt> ‘<samp>0.841</samp>’</dt>
2174 <dd><p>Apply -1.5dB gain
2176 <dt> ‘<samp>0.707</samp>’</dt>
2177 <dd><p>Apply -3.0dB gain
2179 <dt> ‘<samp>0.595</samp>’</dt>
2180 <dd><p>Apply -4.5dB gain
2182 <dt> ‘<samp>0.500</samp>’</dt>
2183 <dd><p>Apply -6.0dB gain (default)
2185 <dt> ‘<samp>0.000</samp>’</dt>
2186 <dd><p>Silence Surround Channel(s)
2193 <a name="Extended-Bitstream-Information-_002d-Part-2"></a>
2194 <h4 class="subsubsection"><a href="ffmpeg.html#toc-Extended-Bitstream-Information-_002d-Part-2">10.1.2.2 Extended Bitstream Information - Part 2</a></h4>
2196 <dl compact="compact">
2197 <dt> ‘<samp>-dsurex_mode <var>mode</var></samp>’</dt>
2198 <dd><p>Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
2199 (7.1 matrixed to 5.1). Using this option does <b>NOT</b> mean the encoder will actually
2200 apply Dolby Surround EX processing.
2201 </p><dl compact="compact">
2202 <dt> ‘<samp>0</samp>’</dt>
2203 <dt> ‘<samp>notindicated</samp>’</dt>
2204 <dd><p>Not Indicated (default)
2206 <dt> ‘<samp>1</samp>’</dt>
2207 <dt> ‘<samp>on</samp>’</dt>
2208 <dd><p>Dolby Surround EX On
2210 <dt> ‘<samp>2</samp>’</dt>
2211 <dt> ‘<samp>off</samp>’</dt>
2212 <dd><p>Dolby Surround EX Off
2217 <dt> ‘<samp>-dheadphone_mode <var>mode</var></samp>’</dt>
2218 <dd><p>Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
2219 encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
2220 option does <b>NOT</b> mean the encoder will actually apply Dolby Headphone
2222 </p><dl compact="compact">
2223 <dt> ‘<samp>0</samp>’</dt>
2224 <dt> ‘<samp>notindicated</samp>’</dt>
2225 <dd><p>Not Indicated (default)
2227 <dt> ‘<samp>1</samp>’</dt>
2228 <dt> ‘<samp>on</samp>’</dt>
2229 <dd><p>Dolby Headphone On
2231 <dt> ‘<samp>2</samp>’</dt>
2232 <dt> ‘<samp>off</samp>’</dt>
2233 <dd><p>Dolby Headphone Off
2238 <dt> ‘<samp>-ad_conv_type <var>type</var></samp>’</dt>
2239 <dd><p>A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
2241 </p><dl compact="compact">
2242 <dt> ‘<samp>0</samp>’</dt>
2243 <dt> ‘<samp>standard</samp>’</dt>
2244 <dd><p>Standard A/D Converter (default)
2246 <dt> ‘<samp>1</samp>’</dt>
2247 <dt> ‘<samp>hdcd</samp>’</dt>
2248 <dd><p>HDCD A/D Converter
2255 <a name="Other-AC_002d3-Encoding-Options"></a>
2256 <h3 class="subsection"><a href="ffmpeg.html#toc-Other-AC_002d3-Encoding-Options">10.1.3 Other AC-3 Encoding Options</a></h3>
2258 <dl compact="compact">
2259 <dt> ‘<samp>-stereo_rematrixing <var>boolean</var></samp>’</dt>
2260 <dd><p>Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
2261 is an optional AC-3 feature that increases quality by selectively encoding
2262 the left/right channels as mid/side. This option is enabled by default, and it
2263 is highly recommended that it be left as enabled except for testing purposes.
2268 <a name="Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options"></a>
2269 <h3 class="subsection"><a href="ffmpeg.html#toc-Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options">10.1.4 Floating-Point-Only AC-3 Encoding Options</a></h3>
2271 <p>These options are only valid for the floating-point encoder and do not exist
2272 for the fixed-point encoder due to the corresponding features not being
2273 implemented in fixed-point.
2275 <dl compact="compact">
2276 <dt> ‘<samp>-channel_coupling <var>boolean</var></samp>’</dt>
2277 <dd><p>Enables/Disables use of channel coupling, which is an optional AC-3 feature
2278 that increases quality by combining high frequency information from multiple
2279 channels into a single channel. The per-channel high frequency information is
2280 sent with less accuracy in both the frequency and time domains. This allows
2281 more bits to be used for lower frequencies while preserving enough information
2282 to reconstruct the high frequencies. This option is enabled by default for the
2283 floating-point encoder and should generally be left as enabled except for
2284 testing purposes or to increase encoding speed.
2285 </p><dl compact="compact">
2286 <dt> ‘<samp>-1</samp>’</dt>
2287 <dt> ‘<samp>auto</samp>’</dt>
2288 <dd><p>Selected by Encoder (default)
2290 <dt> ‘<samp>0</samp>’</dt>
2291 <dt> ‘<samp>off</samp>’</dt>
2292 <dd><p>Disable Channel Coupling
2294 <dt> ‘<samp>1</samp>’</dt>
2295 <dt> ‘<samp>on</samp>’</dt>
2296 <dd><p>Enable Channel Coupling
2301 <dt> ‘<samp>-cpl_start_band <var>number</var></samp>’</dt>
2302 <dd><p>Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
2303 value higher than the bandwidth is used, it will be reduced to 1 less than the
2304 coupling end band. If <var>auto</var> is used, the start band will be determined by
2305 the encoder based on the bit rate, sample rate, and channel layout. This option
2306 has no effect if channel coupling is disabled.
2307 </p><dl compact="compact">
2308 <dt> ‘<samp>-1</samp>’</dt>
2309 <dt> ‘<samp>auto</samp>’</dt>
2310 <dd><p>Selected by Encoder (default)
2318 <a name="Video-Encoders"></a>
2319 <h1 class="chapter"><a href="ffmpeg.html#toc-Video-Encoders">11. Video Encoders</a></h1>
2321 <p>A description of some of the currently available video encoders
2324 <a name="libvpx"></a>
2325 <h2 class="section"><a href="ffmpeg.html#toc-libvpx">11.1 libvpx</a></h2>
2327 <p>VP8 format supported through libvpx.
2329 <p>Requires the presence of the libvpx headers and library during configuration.
2330 You need to explicitly configure the build with <code>--enable-libvpx</code>.
2332 <a name="Options-1"></a>
2333 <h3 class="subsection"><a href="ffmpeg.html#toc-Options-1">11.1.1 Options</a></h3>
2335 <p>Mapping from FFmpeg to libvpx options with conversion notes in parentheses.
2337 <dl compact="compact">
2338 <dt> ‘<samp>threads</samp>’</dt>
2342 <dt> ‘<samp>profile</samp>’</dt>
2346 <dt> ‘<samp>vb</samp>’</dt>
2347 <dd><p>rc_target_bitrate
2350 <dt> ‘<samp>g</samp>’</dt>
2354 <dt> ‘<samp>keyint_min</samp>’</dt>
2358 <dt> ‘<samp>qmin</samp>’</dt>
2359 <dd><p>rc_min_quantizer
2362 <dt> ‘<samp>qmax</samp>’</dt>
2363 <dd><p>rc_max_quantizer
2366 <dt> ‘<samp>bufsize, vb</samp>’</dt>
2368 <code>(bufsize * 1000 / vb)</code>
2370 <p>rc_buf_optimal_sz
2371 <code>(bufsize * 1000 / vb * 5 / 6)</code>
2374 <dt> ‘<samp>rc_init_occupancy, vb</samp>’</dt>
2375 <dd><p>rc_buf_initial_sz
2376 <code>(rc_init_occupancy * 1000 / vb)</code>
2379 <dt> ‘<samp>rc_buffer_aggressivity</samp>’</dt>
2380 <dd><p>rc_undershoot_pct
2383 <dt> ‘<samp>skip_threshold</samp>’</dt>
2384 <dd><p>rc_dropframe_thresh
2387 <dt> ‘<samp>qcomp</samp>’</dt>
2388 <dd><p>rc_2pass_vbr_bias_pct
2391 <dt> ‘<samp>maxrate, vb</samp>’</dt>
2392 <dd><p>rc_2pass_vbr_maxsection_pct
2393 <code>(maxrate * 100 / vb)</code>
2396 <dt> ‘<samp>minrate, vb</samp>’</dt>
2397 <dd><p>rc_2pass_vbr_minsection_pct
2398 <code>(minrate * 100 / vb)</code>
2401 <dt> ‘<samp>minrate, maxrate, vb</samp>’</dt>
2402 <dd><p><code>VPX_CBR</code>
2403 <code>(minrate == maxrate == vb)</code>
2406 <dt> ‘<samp>crf</samp>’</dt>
2407 <dd><p><code>VPX_CQ</code>, <code>VP8E_SET_CQ_LEVEL</code>
2410 <dt> ‘<samp>quality</samp>’</dt>
2411 <dd><dl compact="compact">
2412 <dt> ‘<samp><var>best</var></samp>’</dt>
2413 <dd><p><code>VPX_DL_BEST_QUALITY</code>
2415 <dt> ‘<samp><var>good</var></samp>’</dt>
2416 <dd><p><code>VPX_DL_GOOD_QUALITY</code>
2418 <dt> ‘<samp><var>realtime</var></samp>’</dt>
2419 <dd><p><code>VPX_DL_REALTIME</code>
2424 <dt> ‘<samp>speed</samp>’</dt>
2425 <dd><p><code>VP8E_SET_CPUUSED</code>
2428 <dt> ‘<samp>nr</samp>’</dt>
2429 <dd><p><code>VP8E_SET_NOISE_SENSITIVITY</code>
2432 <dt> ‘<samp>mb_threshold</samp>’</dt>
2433 <dd><p><code>VP8E_SET_STATIC_THRESHOLD</code>
2436 <dt> ‘<samp>slices</samp>’</dt>
2437 <dd><p><code>VP8E_SET_TOKEN_PARTITIONS</code>
2440 <dt> ‘<samp>Alternate reference frame related</samp>’</dt>
2441 <dd><dl compact="compact">
2442 <dt> ‘<samp>vp8flags altref</samp>’</dt>
2443 <dd><p><code>VP8E_SET_ENABLEAUTOALTREF</code>
2445 <dt> ‘<samp><var>arnr_max_frames</var></samp>’</dt>
2446 <dd><p><code>VP8E_SET_ARNR_MAXFRAMES</code>
2448 <dt> ‘<samp><var>arnr_type</var></samp>’</dt>
2449 <dd><p><code>VP8E_SET_ARNR_TYPE</code>
2451 <dt> ‘<samp><var>arnr_strength</var></samp>’</dt>
2452 <dd><p><code>VP8E_SET_ARNR_STRENGTH</code>
2454 <dt> ‘<samp><var>rc_lookahead</var></samp>’</dt>
2455 <dd><p>g_lag_in_frames
2460 <dt> ‘<samp>vp8flags error_resilient</samp>’</dt>
2461 <dd><p>g_error_resilient
2466 <p>For more information about libvpx see:
2467 <a href="http://www.webmproject.org/">http://www.webmproject.org/</a>
2469 <a name="libx264"></a>
2470 <h2 class="section"><a href="ffmpeg.html#toc-libx264">11.2 libx264</a></h2>
2472 <p>H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 format supported through
2475 <p>Requires the presence of the libx264 headers and library during
2476 configuration. You need to explicitly configure the build with
2477 <code>--enable-libx264</code>.
2479 <a name="Options-2"></a>
2480 <h3 class="subsection"><a href="ffmpeg.html#toc-Options-2">11.2.1 Options</a></h3>
2482 <dl compact="compact">
2483 <dt> ‘<samp>preset <var>preset_name</var></samp>’</dt>
2484 <dd><p>Set the encoding preset.
2487 <dt> ‘<samp>tune <var>tune_name</var></samp>’</dt>
2488 <dd><p>Tune the encoding params.
2489 Deprecated in favor of <var>x264_opts</var>
2492 <dt> ‘<samp>fastfirstpass <var>bool</var></samp>’</dt>
2493 <dd><p>Use fast settings when encoding first pass, default value is 1.
2494 Deprecated in favor of <var>x264_opts</var>.
2497 <dt> ‘<samp>profile <var>profile_name</var></samp>’</dt>
2498 <dd><p>Set profile restrictions.
2499 Deprecated in favor of <var>x264_opts</var>.
2502 <dt> ‘<samp>level <var>level</var></samp>’</dt>
2503 <dd><p>Specify level (as defined by Annex A).
2504 Deprecated in favor of <var>x264_opts</var>.
2507 <dt> ‘<samp>passlogfile <var>filename</var></samp>’</dt>
2508 <dd><p>Specify filename for 2 pass stats.
2509 Deprecated in favor of <var>x264_opts</var>.
2512 <dt> ‘<samp>wpredp <var>wpred_type</var></samp>’</dt>
2513 <dd><p>Specify Weighted prediction for P-frames.
2514 Deprecated in favor of <var>x264_opts</var>.
2517 <dt> ‘<samp>x264opts <var>options</var></samp>’</dt>
2518 <dd><p>Allow to set any x264 option, see x264 manual for a list.
2520 <p><var>options</var> is a list of <var>key</var>=<var>value</var> couples separated by
2525 <p>For example to specify libx264 encoding options with ‘<tt>ffmpeg</tt>’:
2526 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
2527 </pre></td></tr></table>
2529 <p>For more information about libx264 and the supported options see:
2530 <a href="http://www.videolan.org/developers/x264.html">http://www.videolan.org/developers/x264.html</a>
2532 <a name="Demuxers"></a>
2533 <h1 class="chapter"><a href="ffmpeg.html#toc-Demuxers">12. Demuxers</a></h1>
2535 <p>Demuxers are configured elements in FFmpeg which allow to read the
2536 multimedia streams from a particular type of file.
2538 <p>When you configure your FFmpeg build, all the supported demuxers
2539 are enabled by default. You can list all available ones using the
2540 configure option "–list-demuxers".
2542 <p>You can disable all the demuxers using the configure option
2543 "–disable-demuxers", and selectively enable a single demuxer with
2544 the option "–enable-demuxer=<var>DEMUXER</var>", or disable it
2545 with the option "–disable-demuxer=<var>DEMUXER</var>".
2547 <p>The option "-formats" of the ff* tools will display the list of
2550 <p>The description of some of the currently available demuxers follows.
2552 <a name="image2"></a>
2553 <h2 class="section"><a href="ffmpeg.html#toc-image2">12.1 image2</a></h2>
2555 <p>Image file demuxer.
2557 <p>This demuxer reads from a list of image files specified by a pattern.
2559 <p>The pattern may contain the string "%d" or "%0<var>N</var>d", which
2560 specifies the position of the characters representing a sequential
2561 number in each filename matched by the pattern. If the form
2562 "%d0<var>N</var>d" is used, the string representing the number in each
2563 filename is 0-padded and <var>N</var> is the total number of 0-padded
2564 digits representing the number. The literal character ’%’ can be
2565 specified in the pattern with the string "%%".
2567 <p>If the pattern contains "%d" or "%0<var>N</var>d", the first filename of
2568 the file list specified by the pattern must contain a number
2569 inclusively contained between 0 and 4, all the following numbers must
2570 be sequential. This limitation may be hopefully fixed.
2572 <p>The pattern may contain a suffix which is used to automatically
2573 determine the format of the images contained in the files.
2575 <p>For example the pattern "img-%03d.bmp" will match a sequence of
2576 filenames of the form ‘<tt>img-001.bmp</tt>’, ‘<tt>img-002.bmp</tt>’, ...,
2577 ‘<tt>img-010.bmp</tt>’, etc.; the pattern "i%%m%%g-%d.jpg" will match a
2578 sequence of filenames of the form ‘<tt>i%m%g-1.jpg</tt>’,
2579 ‘<tt>i%m%g-2.jpg</tt>’, ..., ‘<tt>i%m%g-10.jpg</tt>’, etc.
2581 <p>The size, the pixel format, and the format of each image must be the
2582 same for all the files in the sequence.
2584 <p>The following example shows how to use ‘<tt>ffmpeg</tt>’ for creating a
2585 video from the images in the file sequence ‘<tt>img-001.jpeg</tt>’,
2586 ‘<tt>img-002.jpeg</tt>’, ..., assuming an input framerate of 10 frames per
2588 </p><table><tr><td> </td><td><pre class="example">ffmpeg -r 10 -f image2 -i 'img-%03d.jpeg' out.avi
2589 </pre></td></tr></table>
2591 <p>Note that the pattern must not necessarily contain "%d" or
2592 "%0<var>N</var>d", for example to convert a single image file
2593 ‘<tt>img.jpeg</tt>’ you can employ the command:
2594 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f image2 -i img.jpeg img.png
2595 </pre></td></tr></table>
2597 <a name="applehttp"></a>
2598 <h2 class="section"><a href="ffmpeg.html#toc-applehttp">12.2 applehttp</a></h2>
2600 <p>Apple HTTP Live Streaming demuxer.
2602 <p>This demuxer presents all AVStreams from all variant streams.
2603 The id field is set to the bitrate variant index number. By setting
2604 the discard flags on AVStreams (by pressing ’a’ or ’v’ in ffplay),
2605 the caller can decide which variant streams to actually receive.
2606 The total bitrate of the variant that the stream belongs to is
2607 available in a metadata key named "variant_bitrate".
2609 <a name="Muxers"></a>
2610 <h1 class="chapter"><a href="ffmpeg.html#toc-Muxers">13. Muxers</a></h1>
2612 <p>Muxers are configured elements in FFmpeg which allow writing
2613 multimedia streams to a particular type of file.
2615 <p>When you configure your FFmpeg build, all the supported muxers
2616 are enabled by default. You can list all available muxers using the
2617 configure option <code>--list-muxers</code>.
2619 <p>You can disable all the muxers with the configure option
2620 <code>--disable-muxers</code> and selectively enable / disable single muxers
2621 with the options <code>--enable-muxer=<var>MUXER</var></code> /
2622 <code>--disable-muxer=<var>MUXER</var></code>.
2624 <p>The option <code>-formats</code> of the ff* tools will display the list of
2627 <p>A description of some of the currently available muxers follows.
2629 <p><a name="crc"></a>
2630 </p><a name="crc-1"></a>
2631 <h2 class="section"><a href="ffmpeg.html#toc-crc-1">13.1 crc</a></h2>
2633 <p>CRC (Cyclic Redundancy Check) testing format.
2635 <p>This muxer computes and prints the Adler-32 CRC of all the input audio
2636 and video frames. By default audio frames are converted to signed
2637 16-bit raw audio and video frames to raw video before computing the
2640 <p>The output of the muxer consists of a single line of the form:
2641 CRC=0x<var>CRC</var>, where <var>CRC</var> is a hexadecimal number 0-padded to
2642 8 digits containing the CRC for all the decoded input frames.
2644 <p>For example to compute the CRC of the input, and store it in the file
2645 ‘<tt>out.crc</tt>’:
2646 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -f crc out.crc
2647 </pre></td></tr></table>
2649 <p>You can print the CRC to stdout with the command:
2650 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -f crc -
2651 </pre></td></tr></table>
2653 <p>You can select the output format of each frame with ‘<tt>ffmpeg</tt>’ by
2654 specifying the audio and video codec and format. For example to
2655 compute the CRC of the input audio converted to PCM unsigned 8-bit
2656 and the input video converted to MPEG-2 video, use the command:
2657 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -acodec pcm_u8 -vcodec mpeg2video -f crc -
2658 </pre></td></tr></table>
2660 <p>See also the <code>framecrc</code> muxer (see <a href="#framecrc">framecrc</a>).
2662 <p><a name="framecrc"></a>
2663 </p><a name="framecrc-1"></a>
2664 <h2 class="section"><a href="ffmpeg.html#toc-framecrc-1">13.2 framecrc</a></h2>
2666 <p>Per-frame CRC (Cyclic Redundancy Check) testing format.
2668 <p>This muxer computes and prints the Adler-32 CRC for each decoded audio
2669 and video frame. By default audio frames are converted to signed
2670 16-bit raw audio and video frames to raw video before computing the
2673 <p>The output of the muxer consists of a line for each audio and video
2674 frame of the form: <var>stream_index</var>, <var>frame_dts</var>,
2675 <var>frame_size</var>, 0x<var>CRC</var>, where <var>CRC</var> is a hexadecimal
2676 number 0-padded to 8 digits containing the CRC of the decoded frame.
2678 <p>For example to compute the CRC of each decoded frame in the input, and
2679 store it in the file ‘<tt>out.crc</tt>’:
2680 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -f framecrc out.crc
2681 </pre></td></tr></table>
2683 <p>You can print the CRC of each decoded frame to stdout with the command:
2684 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -f framecrc -
2685 </pre></td></tr></table>
2687 <p>You can select the output format of each frame with ‘<tt>ffmpeg</tt>’ by
2688 specifying the audio and video codec and format. For example, to
2689 compute the CRC of each decoded input audio frame converted to PCM
2690 unsigned 8-bit and of each decoded input video frame converted to
2691 MPEG-2 video, use the command:
2692 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -acodec pcm_u8 -vcodec mpeg2video -f framecrc -
2693 </pre></td></tr></table>
2695 <p>See also the <code>crc</code> muxer (see <a href="#crc">crc</a>).
2697 <a name="image2-1"></a>
2698 <h2 class="section"><a href="ffmpeg.html#toc-image2-1">13.3 image2</a></h2>
2700 <p>Image file muxer.
2702 <p>The image file muxer writes video frames to image files.
2704 <p>The output filenames are specified by a pattern, which can be used to
2705 produce sequentially numbered series of files.
2706 The pattern may contain the string "%d" or "%0<var>N</var>d", this string
2707 specifies the position of the characters representing a numbering in
2708 the filenames. If the form "%0<var>N</var>d" is used, the string
2709 representing the number in each filename is 0-padded to <var>N</var>
2710 digits. The literal character ’%’ can be specified in the pattern with
2711 the string "%%".
2713 <p>If the pattern contains "%d" or "%0<var>N</var>d", the first filename of
2714 the file list specified will contain the number 1, all the following
2715 numbers will be sequential.
2717 <p>The pattern may contain a suffix which is used to automatically
2718 determine the format of the image files to write.
2720 <p>For example the pattern "img-%03d.bmp" will specify a sequence of
2721 filenames of the form ‘<tt>img-001.bmp</tt>’, ‘<tt>img-002.bmp</tt>’, ...,
2722 ‘<tt>img-010.bmp</tt>’, etc.
2723 The pattern "img%%-%d.jpg" will specify a sequence of filenames of the
2724 form ‘<tt>img%-1.jpg</tt>’, ‘<tt>img%-2.jpg</tt>’, ..., ‘<tt>img%-10.jpg</tt>’,
2727 <p>The following example shows how to use ‘<tt>ffmpeg</tt>’ for creating a
2728 sequence of files ‘<tt>img-001.jpeg</tt>’, ‘<tt>img-002.jpeg</tt>’, ...,
2729 taking one image every second from the input video:
2730 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i in.avi -r 1 -f image2 'img-%03d.jpeg'
2731 </pre></td></tr></table>
2733 <p>Note that with ‘<tt>ffmpeg</tt>’, if the format is not specified with the
2734 <code>-f</code> option and the output filename specifies an image file
2735 format, the image2 muxer is automatically selected, so the previous
2736 command can be written as:
2737 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i in.avi -r 1 'img-%03d.jpeg'
2738 </pre></td></tr></table>
2740 <p>Note also that the pattern must not necessarily contain "%d" or
2741 "%0<var>N</var>d", for example to create a single image file
2742 ‘<tt>img.jpeg</tt>’ from the input video you can employ the command:
2743 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i in.avi -f image2 -vframes 1 img.jpeg
2744 </pre></td></tr></table>
2746 <p>The image muxer supports the .Y.U.V image file format. This format is
2747 special in that that each image frame consists of three files, for
2748 each of the YUV420P components. To read or write this image file format,
2749 specify the name of the ’.Y’ file. The muxer will automatically open the
2750 ’.U’ and ’.V’ files as required.
2752 <a name="mpegts"></a>
2753 <h2 class="section"><a href="ffmpeg.html#toc-mpegts">13.4 mpegts</a></h2>
2755 <p>MPEG transport stream muxer.
2757 <p>This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
2759 <p>The muxer options are:
2761 <dl compact="compact">
2762 <dt> ‘<samp>-mpegts_original_network_id <var>number</var></samp>’</dt>
2763 <dd><p>Set the original_network_id (default 0x0001). This is unique identifier
2764 of a network in DVB. Its main use is in the unique identification of a
2765 service through the path Original_Network_ID, Transport_Stream_ID.
2767 <dt> ‘<samp>-mpegts_transport_stream_id <var>number</var></samp>’</dt>
2768 <dd><p>Set the transport_stream_id (default 0x0001). This identifies a
2771 <dt> ‘<samp>-mpegts_service_id <var>number</var></samp>’</dt>
2772 <dd><p>Set the service_id (default 0x0001) also known as program in DVB.
2774 <dt> ‘<samp>-mpegts_pmt_start_pid <var>number</var></samp>’</dt>
2775 <dd><p>Set the first PID for PMT (default 0x1000, max 0x1f00).
2777 <dt> ‘<samp>-mpegts_start_pid <var>number</var></samp>’</dt>
2778 <dd><p>Set the first PID for data packets (default 0x0100, max 0x0f00).
2782 <p>The recognized metadata settings in mpegts muxer are <code>service_provider</code>
2783 and <code>service_name</code>. If they are not set the default for
2784 <code>service_provider</code> is "FFmpeg" and the default for
2785 <code>service_name</code> is "Service01".
2787 <table><tr><td> </td><td><pre class="example">ffmpeg -i file.mpg -acodec copy -vcodec copy \
2788 -mpegts_original_network_id 0x1122 \
2789 -mpegts_transport_stream_id 0x3344 \
2790 -mpegts_service_id 0x5566 \
2791 -mpegts_pmt_start_pid 0x1500 \
2792 -mpegts_start_pid 0x150 \
2793 -metadata service_provider="Some provider" \
2794 -metadata service_name="Some Channel" \
2796 </pre></td></tr></table>
2799 <h2 class="section"><a href="ffmpeg.html#toc-null">13.5 null</a></h2>
2803 <p>This muxer does not generate any output file, it is mainly useful for
2804 testing or benchmarking purposes.
2806 <p>For example to benchmark decoding with ‘<tt>ffmpeg</tt>’ you can use the
2808 </p><table><tr><td> </td><td><pre class="example">ffmpeg -benchmark -i INPUT -f null out.null
2809 </pre></td></tr></table>
2811 <p>Note that the above command does not read or write the ‘<tt>out.null</tt>’
2812 file, but specifying the output file is required by the ‘<tt>ffmpeg</tt>’
2815 <p>Alternatively you can write the command as:
2816 </p><table><tr><td> </td><td><pre class="example">ffmpeg -benchmark -i INPUT -f null -
2817 </pre></td></tr></table>
2819 <a name="matroska"></a>
2820 <h2 class="section"><a href="ffmpeg.html#toc-matroska">13.6 matroska</a></h2>
2822 <p>Matroska container muxer.
2824 <p>This muxer implements the matroska and webm container specs.
2826 <p>The recognized metadata settings in this muxer are:
2828 <dl compact="compact">
2829 <dt> ‘<samp>title=<var>title name</var></samp>’</dt>
2830 <dd><p>Name provided to a single track
2834 <dl compact="compact">
2835 <dt> ‘<samp>language=<var>language name</var></samp>’</dt>
2836 <dd><p>Specifies the language of the track in the Matroska languages form
2840 <dl compact="compact">
2841 <dt> ‘<samp>stereo_mode=<var>mode</var></samp>’</dt>
2842 <dd><p>Stereo 3D video layout of two views in a single video track
2843 </p><dl compact="compact">
2844 <dt> ‘<samp>mono</samp>’</dt>
2845 <dd><p>video is not stereo
2847 <dt> ‘<samp>left_right</samp>’</dt>
2848 <dd><p>Both views are arranged side by side, Left-eye view is on the left
2850 <dt> ‘<samp>bottom_top</samp>’</dt>
2851 <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is at bottom
2853 <dt> ‘<samp>top_bottom</samp>’</dt>
2854 <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is on top
2856 <dt> ‘<samp>checkerboard_rl</samp>’</dt>
2857 <dd><p>Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
2859 <dt> ‘<samp>checkerboard_lr</samp>’</dt>
2860 <dd><p>Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
2862 <dt> ‘<samp>row_interleaved_rl</samp>’</dt>
2863 <dd><p>Each view is constituted by a row based interleaving, Right-eye view is first row
2865 <dt> ‘<samp>row_interleaved_lr</samp>’</dt>
2866 <dd><p>Each view is constituted by a row based interleaving, Left-eye view is first row
2868 <dt> ‘<samp>col_interleaved_rl</samp>’</dt>
2869 <dd><p>Both views are arranged in a column based interleaving manner, Right-eye view is first column
2871 <dt> ‘<samp>col_interleaved_lr</samp>’</dt>
2872 <dd><p>Both views are arranged in a column based interleaving manner, Left-eye view is first column
2874 <dt> ‘<samp>anaglyph_cyan_red</samp>’</dt>
2875 <dd><p>All frames are in anaglyph format viewable through red-cyan filters
2877 <dt> ‘<samp>right_left</samp>’</dt>
2878 <dd><p>Both views are arranged side by side, Right-eye view is on the left
2880 <dt> ‘<samp>anaglyph_green_magenta</samp>’</dt>
2881 <dd><p>All frames are in anaglyph format viewable through green-magenta filters
2883 <dt> ‘<samp>block_lr</samp>’</dt>
2884 <dd><p>Both eyes laced in one Block, Left-eye view is first
2886 <dt> ‘<samp>block_rl</samp>’</dt>
2887 <dd><p>Both eyes laced in one Block, Right-eye view is first
2893 <p>For example a 3D WebM clip can be created using the following command line:
2894 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i sample_left_right_clip.mpg -an -vcodec libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
2895 </pre></td></tr></table>
2897 <a name="Input-Devices"></a>
2898 <h1 class="chapter"><a href="ffmpeg.html#toc-Input-Devices">14. Input Devices</a></h1>
2900 <p>Input devices are configured elements in FFmpeg which allow to access
2901 the data coming from a multimedia device attached to your system.
2903 <p>When you configure your FFmpeg build, all the supported input devices
2904 are enabled by default. You can list all available ones using the
2905 configure option "–list-indevs".
2907 <p>You can disable all the input devices using the configure option
2908 "–disable-indevs", and selectively enable an input device using the
2909 option "–enable-indev=<var>INDEV</var>", or you can disable a particular
2910 input device using the option "–disable-indev=<var>INDEV</var>".
2912 <p>The option "-formats" of the ff* tools will display the list of
2913 supported input devices (amongst the demuxers).
2915 <p>A description of the currently available input devices follows.
2917 <a name="alsa-1"></a>
2918 <h2 class="section"><a href="ffmpeg.html#toc-alsa-1">14.1 alsa</a></h2>
2920 <p>ALSA (Advanced Linux Sound Architecture) input device.
2922 <p>To enable this input device during configuration you need libasound
2923 installed on your system.
2925 <p>This device allows capturing from an ALSA device. The name of the
2926 device to capture has to be an ALSA card identifier.
2928 <p>An ALSA identifier has the syntax:
2929 </p><table><tr><td> </td><td><pre class="example">hw:<var>CARD</var>[,<var>DEV</var>[,<var>SUBDEV</var>]]
2930 </pre></td></tr></table>
2932 <p>where the <var>DEV</var> and <var>SUBDEV</var> components are optional.
2934 <p>The three arguments (in order: <var>CARD</var>,<var>DEV</var>,<var>SUBDEV</var>)
2935 specify card number or identifier, device number and subdevice number
2938 <p>To see the list of cards currently recognized by your system check the
2939 files ‘<tt>/proc/asound/cards</tt>’ and ‘<tt>/proc/asound/devices</tt>’.
2941 <p>For example to capture with ‘<tt>ffmpeg</tt>’ from an ALSA device with
2942 card id 0, you may run the command:
2943 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f alsa -i hw:0 alsaout.wav
2944 </pre></td></tr></table>
2946 <p>For more information see:
2947 <a href="http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html">http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html</a>
2950 <h2 class="section"><a href="ffmpeg.html#toc-bktr">14.2 bktr</a></h2>
2952 <p>BSD video input device.
2954 <a name="dv1394"></a>
2955 <h2 class="section"><a href="ffmpeg.html#toc-dv1394">14.3 dv1394</a></h2>
2957 <p>Linux DV 1394 input device.
2959 <a name="fbdev"></a>
2960 <h2 class="section"><a href="ffmpeg.html#toc-fbdev">14.4 fbdev</a></h2>
2962 <p>Linux framebuffer input device.
2964 <p>The Linux framebuffer is a graphic hardware-independent abstraction
2965 layer to show graphics on a computer monitor, typically on the
2966 console. It is accessed through a file device node, usually
2967 ‘<tt>/dev/fb0</tt>’.
2969 <p>For more detailed information read the file
2970 Documentation/fb/framebuffer.txt included in the Linux source tree.
2972 <p>To record from the framebuffer device ‘<tt>/dev/fb0</tt>’ with
2973 ‘<tt>ffmpeg</tt>’:
2974 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
2975 </pre></td></tr></table>
2977 <p>You can take a single screenshot image with the command:
2978 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f fbdev -vframes 1 -r 1 -i /dev/fb0 screenshot.jpeg
2979 </pre></td></tr></table>
2981 <p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
2984 <h2 class="section"><a href="ffmpeg.html#toc-jack">14.5 jack</a></h2>
2986 <p>JACK input device.
2988 <p>To enable this input device during configuration you need libjack
2989 installed on your system.
2991 <p>A JACK input device creates one or more JACK writable clients, one for
2992 each audio channel, with name <var>client_name</var>:input_<var>N</var>, where
2993 <var>client_name</var> is the name provided by the application, and <var>N</var>
2994 is a number which identifies the channel.
2995 Each writable client will send the acquired data to the FFmpeg input
2998 <p>Once you have created one or more JACK readable clients, you need to
2999 connect them to one or more JACK writable clients.
3001 <p>To connect or disconnect JACK clients you can use the
3002 ‘<tt>jack_connect</tt>’ and ‘<tt>jack_disconnect</tt>’ programs, or do it
3003 through a graphical interface, for example with ‘<tt>qjackctl</tt>’.
3005 <p>To list the JACK clients and their properties you can invoke the command
3006 ‘<tt>jack_lsp</tt>’.
3008 <p>Follows an example which shows how to capture a JACK readable client
3009 with ‘<tt>ffmpeg</tt>’.
3010 </p><table><tr><td> </td><td><pre class="example"># Create a JACK writable client with name "ffmpeg".
3011 $ ffmpeg -f jack -i ffmpeg -y out.wav
3013 # Start the sample jack_metro readable client.
3014 $ jack_metro -b 120 -d 0.2 -f 4000
3016 # List the current JACK clients.
3025 # Connect metro to the ffmpeg writable client.
3026 $ jack_connect metro:120_bpm ffmpeg:input_1
3027 </pre></td></tr></table>
3029 <p>For more information read:
3030 <a href="http://jackaudio.org/">http://jackaudio.org/</a>
3032 <a name="libdc1394"></a>
3033 <h2 class="section"><a href="ffmpeg.html#toc-libdc1394">14.6 libdc1394</a></h2>
3035 <p>IIDC1394 input device, based on libdc1394 and libraw1394.
3037 <a name="oss-1"></a>
3038 <h2 class="section"><a href="ffmpeg.html#toc-oss-1">14.7 oss</a></h2>
3040 <p>Open Sound System input device.
3042 <p>The filename to provide to the input device is the device node
3043 representing the OSS input device, and is usually set to
3044 ‘<tt>/dev/dsp</tt>’.
3046 <p>For example to grab from ‘<tt>/dev/dsp</tt>’ using ‘<tt>ffmpeg</tt>’ use the
3048 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
3049 </pre></td></tr></table>
3051 <p>For more information about OSS see:
3052 <a href="http://manuals.opensound.com/usersguide/dsp.html">http://manuals.opensound.com/usersguide/dsp.html</a>
3054 <a name="sndio"></a>
3055 <h2 class="section"><a href="ffmpeg.html#toc-sndio">14.8 sndio</a></h2>
3057 <p>sndio input device.
3059 <p>To enable this input device during configuration you need libsndio
3060 installed on your system.
3062 <p>The filename to provide to the input device is the device node
3063 representing the sndio input device, and is usually set to
3064 ‘<tt>/dev/audio0</tt>’.
3066 <p>For example to grab from ‘<tt>/dev/audio0</tt>’ using ‘<tt>ffmpeg</tt>’ use the
3068 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
3069 </pre></td></tr></table>
3071 <a name="video4linux-and-video4linux2"></a>
3072 <h2 class="section"><a href="ffmpeg.html#toc-video4linux-and-video4linux2">14.9 video4linux and video4linux2</a></h2>
3074 <p>Video4Linux and Video4Linux2 input video devices.
3076 <p>The name of the device to grab is a file device node, usually Linux
3077 systems tend to automatically create such nodes when the device
3078 (e.g. an USB webcam) is plugged into the system, and has a name of the
3079 kind ‘<tt>/dev/video<var>N</var></tt>’, where <var>N</var> is a number associated to
3082 <p>Video4Linux and Video4Linux2 devices only support a limited set of
3083 <var>width</var>x<var>height</var> sizes and framerates. You can check which are
3084 supported for example with the command ‘<tt>dov4l</tt>’ for Video4Linux
3085 devices and the command ‘<tt>v4l-info</tt>’ for Video4Linux2 devices.
3087 <p>If the size for the device is set to 0x0, the input device will
3088 try to autodetect the size to use.
3089 Only for the video4linux2 device, if the frame rate is set to 0/0 the
3090 input device will use the frame rate value already set in the driver.
3092 <p>Video4Linux support is deprecated since Linux 2.6.30, and will be
3093 dropped in later versions.
3095 <p>Follow some usage examples of the video4linux devices with the ff*
3097 </p><table><tr><td> </td><td><pre class="example"># Grab and show the input of a video4linux device, frame rate is set
3098 # to the default of 25/1.
3099 ffplay -s 320x240 -f video4linux /dev/video0
3101 # Grab and show the input of a video4linux2 device, autoadjust size.
3102 ffplay -f video4linux2 /dev/video0
3104 # Grab and record the input of a video4linux2 device, autoadjust size,
3105 # frame rate value defaults to 0/0 so it is read from the video4linux2
3107 ffmpeg -f video4linux2 -i /dev/video0 out.mpeg
3108 </pre></td></tr></table>
3110 <a name="vfwcap"></a>
3111 <h2 class="section"><a href="ffmpeg.html#toc-vfwcap">14.10 vfwcap</a></h2>
3113 <p>VfW (Video for Windows) capture input device.
3115 <p>The filename passed as input is the capture driver number, ranging from
3116 0 to 9. You may use "list" as filename to print a list of drivers. Any
3117 other filename will be interpreted as device number 0.
3119 <a name="x11grab"></a>
3120 <h2 class="section"><a href="ffmpeg.html#toc-x11grab">14.11 x11grab</a></h2>
3122 <p>X11 video input device.
3124 <p>This device allows to capture a region of an X11 display.
3126 <p>The filename passed as input has the syntax:
3127 </p><table><tr><td> </td><td><pre class="example">[<var>hostname</var>]:<var>display_number</var>.<var>screen_number</var>[+<var>x_offset</var>,<var>y_offset</var>]
3128 </pre></td></tr></table>
3130 <p><var>hostname</var>:<var>display_number</var>.<var>screen_number</var> specifies the
3131 X11 display name of the screen to grab from. <var>hostname</var> can be
3132 ommitted, and defaults to "localhost". The environment variable
3133 <code>DISPLAY</code> contains the default display name.
3135 <p><var>x_offset</var> and <var>y_offset</var> specify the offsets of the grabbed
3136 area with respect to the top-left border of the X11 screen. They
3139 <p>Check the X11 documentation (e.g. man X) for more detailed information.
3141 <p>Use the ‘<tt>dpyinfo</tt>’ program for getting basic information about the
3142 properties of your X11 display (e.g. grep for "name" or "dimensions").
3144 <p>For example to grab from ‘<tt>:0.0</tt>’ using ‘<tt>ffmpeg</tt>’:
3145 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpg
3147 # Grab at position 10,20.
3148 ffmpeg -f x11grab -25 -s cif -i :0.0+10,20 out.mpg
3149 </pre></td></tr></table>
3151 <a name="Output-Devices"></a>
3152 <h1 class="chapter"><a href="ffmpeg.html#toc-Output-Devices">15. Output Devices</a></h1>
3154 <p>Output devices are configured elements in FFmpeg which allow to write
3155 multimedia data to an output device attached to your system.
3157 <p>When you configure your FFmpeg build, all the supported output devices
3158 are enabled by default. You can list all available ones using the
3159 configure option "–list-outdevs".
3161 <p>You can disable all the output devices using the configure option
3162 "–disable-outdevs", and selectively enable an output device using the
3163 option "–enable-outdev=<var>OUTDEV</var>", or you can disable a particular
3164 input device using the option "–disable-outdev=<var>OUTDEV</var>".
3166 <p>The option "-formats" of the ff* tools will display the list of
3167 enabled output devices (amongst the muxers).
3169 <p>A description of the currently available output devices follows.
3172 <h2 class="section"><a href="ffmpeg.html#toc-alsa">15.1 alsa</a></h2>
3174 <p>ALSA (Advanced Linux Sound Architecture) output device.
3177 <h2 class="section"><a href="ffmpeg.html#toc-oss">15.2 oss</a></h2>
3179 <p>OSS (Open Sound System) output device.
3182 <h2 class="section"><a href="ffmpeg.html#toc-sdl">15.3 sdl</a></h2>
3184 <p>SDL (Simple Directmedia Layer) output device.
3186 <p>This output devices allows to show a video stream in an SDL
3187 window. Only one SDL window is allowed per application, so you can
3188 have only one instance of this output device in an application.
3190 <p>To enable this output device you need libsdl installed on your system
3191 when configuring your build.
3193 <p>For more information about SDL, check:
3194 <a href="http://www.libsdl.org/">http://www.libsdl.org/</a>
3196 <a name="Options-3"></a>
3197 <h3 class="subsection"><a href="ffmpeg.html#toc-Options-3">15.3.1 Options</a></h3>
3199 <dl compact="compact">
3200 <dt> ‘<samp>window_title</samp>’</dt>
3201 <dd><p>Set the SDL window title, if not specified default to the filename
3202 specified for the output device.
3205 <dt> ‘<samp>icon_title</samp>’</dt>
3206 <dd><p>Set the name of the iconified SDL window, if not specified it is set
3207 to the same value of <var>window_title</var>.
3210 <dt> ‘<samp>window_size</samp>’</dt>
3211 <dd><p>Set the SDL window size, can be a string of the form
3212 <var>width</var>x<var>height</var> or a video size abbreviation.
3213 If not specified it defaults to the size of the input video.
3217 <a name="Examples-1"></a>
3218 <h3 class="subsection"><a href="ffmpeg.html#toc-Examples-1">15.3.2 Examples</a></h3>
3220 <p>The following command shows the ‘<tt>ffmpeg</tt>’ output is an
3221 SDL window, forcing its size to the qcif format:
3222 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -vcodec rawvideo -pix_fmt yuv420p -window_size qcif -f sdl "SDL output"
3223 </pre></td></tr></table>
3225 <a name="sndio-1"></a>
3226 <h2 class="section"><a href="ffmpeg.html#toc-sndio-1">15.4 sndio</a></h2>
3228 <p>sndio audio output device.
3230 <a name="Protocols"></a>
3231 <h1 class="chapter"><a href="ffmpeg.html#toc-Protocols">16. Protocols</a></h1>
3233 <p>Protocols are configured elements in FFmpeg which allow to access
3234 resources which require the use of a particular protocol.
3236 <p>When you configure your FFmpeg build, all the supported protocols are
3237 enabled by default. You can list all available ones using the
3238 configure option "–list-protocols".
3240 <p>You can disable all the protocols using the configure option
3241 "–disable-protocols", and selectively enable a protocol using the
3242 option "–enable-protocol=<var>PROTOCOL</var>", or you can disable a
3243 particular protocol using the option
3244 "–disable-protocol=<var>PROTOCOL</var>".
3246 <p>The option "-protocols" of the ff* tools will display the list of
3247 supported protocols.
3249 <p>A description of the currently available protocols follows.
3251 <a name="applehttp-1"></a>
3252 <h2 class="section"><a href="ffmpeg.html#toc-applehttp-1">16.1 applehttp</a></h2>
3254 <p>Read Apple HTTP Live Streaming compliant segmented stream as
3255 a uniform one. The M3U8 playlists describing the segments can be
3256 remote HTTP resources or local files, accessed using the standard
3258 HTTP is default, specific protocol can be declared by specifying
3259 "+<var>proto</var>" after the applehttp URI scheme name, where <var>proto</var>
3260 is either "file" or "http".
3262 <table><tr><td> </td><td><pre class="example">applehttp://host/path/to/remote/resource.m3u8
3263 applehttp+http://host/path/to/remote/resource.m3u8
3264 applehttp+file://path/to/local/resource.m3u8
3265 </pre></td></tr></table>
3267 <a name="concat"></a>
3268 <h2 class="section"><a href="ffmpeg.html#toc-concat">16.2 concat</a></h2>
3270 <p>Physical concatenation protocol.
3272 <p>Allow to read and seek from many resource in sequence as if they were
3275 <p>A URL accepted by this protocol has the syntax:
3276 </p><table><tr><td> </td><td><pre class="example">concat:<var>URL1</var>|<var>URL2</var>|...|<var>URLN</var>
3277 </pre></td></tr></table>
3279 <p>where <var>URL1</var>, <var>URL2</var>, ..., <var>URLN</var> are the urls of the
3280 resource to be concatenated, each one possibly specifying a distinct
3283 <p>For example to read a sequence of files ‘<tt>split1.mpeg</tt>’,
3284 ‘<tt>split2.mpeg</tt>’, ‘<tt>split3.mpeg</tt>’ with ‘<tt>ffplay</tt>’ use the
3286 </p><table><tr><td> </td><td><pre class="example">ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
3287 </pre></td></tr></table>
3289 <p>Note that you may need to escape the character "|" which is special for
3293 <h2 class="section"><a href="ffmpeg.html#toc-file">16.3 file</a></h2>
3295 <p>File access protocol.
3297 <p>Allow to read from or read to a file.
3299 <p>For example to read from a file ‘<tt>input.mpeg</tt>’ with ‘<tt>ffmpeg</tt>’
3301 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i file:input.mpeg output.mpeg
3302 </pre></td></tr></table>
3304 <p>The ff* tools default to the file protocol, that is a resource
3305 specified with the name "FILE.mpeg" is interpreted as the URL
3306 "file:FILE.mpeg".
3308 <a name="gopher"></a>
3309 <h2 class="section"><a href="ffmpeg.html#toc-gopher">16.4 gopher</a></h2>
3314 <h2 class="section"><a href="ffmpeg.html#toc-http">16.5 http</a></h2>
3316 <p>HTTP (Hyper Text Transfer Protocol).
3319 <h2 class="section"><a href="ffmpeg.html#toc-mmst">16.6 mmst</a></h2>
3321 <p>MMS (Microsoft Media Server) protocol over TCP.
3324 <h2 class="section"><a href="ffmpeg.html#toc-mmsh">16.7 mmsh</a></h2>
3326 <p>MMS (Microsoft Media Server) protocol over HTTP.
3328 <p>The required syntax is:
3329 </p><table><tr><td> </td><td><pre class="example">mmsh://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
3330 </pre></td></tr></table>
3333 <h2 class="section"><a href="ffmpeg.html#toc-md5">16.8 md5</a></h2>
3335 <p>MD5 output protocol.
3337 <p>Computes the MD5 hash of the data to be written, and on close writes
3338 this to the designated output or stdout if none is specified. It can
3339 be used to test muxers without writing an actual file.
3341 <p>Some examples follow.
3342 </p><table><tr><td> </td><td><pre class="example"># Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
3343 ffmpeg -i input.flv -f avi -y md5:output.avi.md5
3345 # Write the MD5 hash of the encoded AVI file to stdout.
3346 ffmpeg -i input.flv -f avi -y md5:
3347 </pre></td></tr></table>
3349 <p>Note that some formats (typically MOV) require the output protocol to
3350 be seekable, so they will fail with the MD5 output protocol.
3353 <h2 class="section"><a href="ffmpeg.html#toc-pipe">16.9 pipe</a></h2>
3355 <p>UNIX pipe access protocol.
3357 <p>Allow to read and write from UNIX pipes.
3359 <p>The accepted syntax is:
3360 </p><table><tr><td> </td><td><pre class="example">pipe:[<var>number</var>]
3361 </pre></td></tr></table>
3363 <p><var>number</var> is the number corresponding to the file descriptor of the
3364 pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If <var>number</var>
3365 is not specified, by default the stdout file descriptor will be used
3366 for writing, stdin for reading.
3368 <p>For example to read from stdin with ‘<tt>ffmpeg</tt>’:
3369 </p><table><tr><td> </td><td><pre class="example">cat test.wav | ffmpeg -i pipe:0
3370 # ...this is the same as...
3371 cat test.wav | ffmpeg -i pipe:
3372 </pre></td></tr></table>
3374 <p>For writing to stdout with ‘<tt>ffmpeg</tt>’:
3375 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi
3376 # ...this is the same as...
3377 ffmpeg -i test.wav -f avi pipe: | cat > test.avi
3378 </pre></td></tr></table>
3380 <p>Note that some formats (typically MOV), require the output protocol to
3381 be seekable, so they will fail with the pipe output protocol.
3384 <h2 class="section"><a href="ffmpeg.html#toc-rtmp">16.10 rtmp</a></h2>
3386 <p>Real-Time Messaging Protocol.
3388 <p>The Real-Time Messaging Protocol (RTMP) is used for streaming multime‐
3389 dia content across a TCP/IP network.
3391 <p>The required syntax is:
3392 </p><table><tr><td> </td><td><pre class="example">rtmp://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
3393 </pre></td></tr></table>
3395 <p>The accepted parameters are:
3396 </p><dl compact="compact">
3397 <dt> ‘<samp>server</samp>’</dt>
3398 <dd><p>The address of the RTMP server.
3401 <dt> ‘<samp>port</samp>’</dt>
3402 <dd><p>The number of the TCP port to use (by default is 1935).
3405 <dt> ‘<samp>app</samp>’</dt>
3406 <dd><p>It is the name of the application to access. It usually corresponds to
3407 the path where the application is installed on the RTMP server
3408 (e.g. ‘<tt>/ondemand/</tt>’, ‘<tt>/flash/live/</tt>’, etc.).
3411 <dt> ‘<samp>playpath</samp>’</dt>
3412 <dd><p>It is the path or name of the resource to play with reference to the
3413 application specified in <var>app</var>, may be prefixed by "mp4:".
3418 <p>For example to read with ‘<tt>ffplay</tt>’ a multimedia resource named
3419 "sample" from the application "vod" from an RTMP server "myserver":
3420 </p><table><tr><td> </td><td><pre class="example">ffplay rtmp://myserver/vod/sample
3421 </pre></td></tr></table>
3423 <a name="rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte"></a>
3424 <h2 class="section"><a href="ffmpeg.html#toc-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">16.11 rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></h2>
3426 <p>Real-Time Messaging Protocol and its variants supported through
3429 <p>Requires the presence of the librtmp headers and library during
3430 configuration. You need to explicitely configure the build with
3431 "–enable-librtmp". If enabled this will replace the native RTMP
3434 <p>This protocol provides most client functions and a few server
3435 functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
3436 encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
3437 variants of these encrypted types (RTMPTE, RTMPTS).
3439 <p>The required syntax is:
3440 </p><table><tr><td> </td><td><pre class="example"><var>rtmp_proto</var>://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>] <var>options</var>
3441 </pre></td></tr></table>
3443 <p>where <var>rtmp_proto</var> is one of the strings "rtmp", "rtmpt", "rtmpe",
3444 "rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and
3445 <var>server</var>, <var>port</var>, <var>app</var> and <var>playpath</var> have the same
3446 meaning as specified for the RTMP native protocol.
3447 <var>options</var> contains a list of space-separated options of the form
3448 <var>key</var>=<var>val</var>.
3450 <p>See the librtmp manual page (man 3 librtmp) for more information.
3452 <p>For example, to stream a file in real-time to an RTMP server using
3453 ‘<tt>ffmpeg</tt>’:
3454 </p><table><tr><td> </td><td><pre class="example">ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
3455 </pre></td></tr></table>
3457 <p>To play the same stream using ‘<tt>ffplay</tt>’:
3458 </p><table><tr><td> </td><td><pre class="example">ffplay "rtmp://myserver/live/mystream live=1"
3459 </pre></td></tr></table>
3462 <h2 class="section"><a href="ffmpeg.html#toc-rtp">16.12 rtp</a></h2>
3464 <p>Real-Time Protocol.
3467 <h2 class="section"><a href="ffmpeg.html#toc-rtsp">16.13 rtsp</a></h2>
3469 <p>RTSP is not technically a protocol handler in libavformat, it is a demuxer
3470 and muxer. The demuxer supports both normal RTSP (with data transferred
3471 over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
3472 data transferred over RDT).
3474 <p>The muxer can be used to send a stream using RTSP ANNOUNCE to a server
3475 supporting it (currently Darwin Streaming Server and Mischa Spiegelmock’s
3476 RTSP server, <a href="http://github.com/revmischa/rtsp-server">http://github.com/revmischa/rtsp-server</a>).
3478 <p>The required syntax for a RTSP url is:
3479 </p><table><tr><td> </td><td><pre class="example">rtsp://<var>hostname</var>[:<var>port</var>]/<var>path</var>[?<var>options</var>]
3480 </pre></td></tr></table>
3482 <p><var>options</var> is a <code>&</code>-separated list. The following options
3485 <dl compact="compact">
3486 <dt> ‘<samp>udp</samp>’</dt>
3487 <dd><p>Use UDP as lower transport protocol.
3490 <dt> ‘<samp>tcp</samp>’</dt>
3491 <dd><p>Use TCP (interleaving within the RTSP control channel) as lower
3495 <dt> ‘<samp>multicast</samp>’</dt>
3496 <dd><p>Use UDP multicast as lower transport protocol.
3499 <dt> ‘<samp>http</samp>’</dt>
3500 <dd><p>Use HTTP tunneling as lower transport protocol, which is useful for
3504 <dt> ‘<samp>filter_src</samp>’</dt>
3505 <dd><p>Accept packets only from negotiated peer address and port.
3509 <p>Multiple lower transport protocols may be specified, in that case they are
3510 tried one at a time (if the setup of one fails, the next one is tried).
3511 For the muxer, only the <code>tcp</code> and <code>udp</code> options are supported.
3513 <p>When receiving data over UDP, the demuxer tries to reorder received packets
3514 (since they may arrive out of order, or packets may get lost totally). In
3515 order for this to be enabled, a maximum delay must be specified in the
3516 <code>max_delay</code> field of AVFormatContext.
3518 <p>When watching multi-bitrate Real-RTSP streams with ‘<tt>ffplay</tt>’, the
3519 streams to display can be chosen with <code>-vst</code> <var>n</var> and
3520 <code>-ast</code> <var>n</var> for video and audio respectively, and can be switched
3521 on the fly by pressing <code>v</code> and <code>a</code>.
3523 <p>Example command lines:
3525 <p>To watch a stream over UDP, with a max reordering delay of 0.5 seconds:
3527 <table><tr><td> </td><td><pre class="example">ffplay -max_delay 500000 rtsp://server/video.mp4?udp
3528 </pre></td></tr></table>
3530 <p>To watch a stream tunneled over HTTP:
3532 <table><tr><td> </td><td><pre class="example">ffplay rtsp://server/video.mp4?http
3533 </pre></td></tr></table>
3535 <p>To send a stream in realtime to a RTSP server, for others to watch:
3537 <table><tr><td> </td><td><pre class="example">ffmpeg -re -i <var>input</var> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
3538 </pre></td></tr></table>
3541 <h2 class="section"><a href="ffmpeg.html#toc-sap">16.14 sap</a></h2>
3543 <p>Session Announcement Protocol (RFC 2974). This is not technically a
3544 protocol handler in libavformat, it is a muxer and demuxer.
3545 It is used for signalling of RTP streams, by announcing the SDP for the
3546 streams regularly on a separate port.
3548 <a name="Muxer"></a>
3549 <h3 class="subsection"><a href="ffmpeg.html#toc-Muxer">16.14.1 Muxer</a></h3>
3551 <p>The syntax for a SAP url given to the muxer is:
3552 </p><table><tr><td> </td><td><pre class="example">sap://<var>destination</var>[:<var>port</var>][?<var>options</var>]
3553 </pre></td></tr></table>
3555 <p>The RTP packets are sent to <var>destination</var> on port <var>port</var>,
3556 or to port 5004 if no port is specified.
3557 <var>options</var> is a <code>&</code>-separated list. The following options
3560 <dl compact="compact">
3561 <dt> ‘<samp>announce_addr=<var>address</var></samp>’</dt>
3562 <dd><p>Specify the destination IP address for sending the announcements to.
3563 If omitted, the announcements are sent to the commonly used SAP
3564 announcement multicast address 224.2.127.254 (sap.mcast.net), or
3565 ff0e::2:7ffe if <var>destination</var> is an IPv6 address.
3568 <dt> ‘<samp>announce_port=<var>port</var></samp>’</dt>
3569 <dd><p>Specify the port to send the announcements on, defaults to
3570 9875 if not specified.
3573 <dt> ‘<samp>ttl=<var>ttl</var></samp>’</dt>
3574 <dd><p>Specify the time to live value for the announcements and RTP packets,
3578 <dt> ‘<samp>same_port=<var>0|1</var></samp>’</dt>
3579 <dd><p>If set to 1, send all RTP streams on the same port pair. If zero (the
3580 default), all streams are sent on unique ports, with each stream on a
3581 port 2 numbers higher than the previous.
3582 VLC/Live555 requires this to be set to 1, to be able to receive the stream.
3583 The RTP stack in libavformat for receiving requires all streams to be sent
3588 <p>Example command lines follow.
3590 <p>To broadcast a stream on the local subnet, for watching in VLC:
3592 <table><tr><td> </td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255?same_port=1
3593 </pre></td></tr></table>
3595 <p>Similarly, for watching in ffplay:
3597 <table><tr><td> </td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255
3598 </pre></td></tr></table>
3600 <p>And for watching in ffplay, over IPv6:
3602 <table><tr><td> </td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://[ff0e::1:2:3:4]
3603 </pre></td></tr></table>
3605 <a name="Demuxer"></a>
3606 <h3 class="subsection"><a href="ffmpeg.html#toc-Demuxer">16.14.2 Demuxer</a></h3>
3608 <p>The syntax for a SAP url given to the demuxer is:
3609 </p><table><tr><td> </td><td><pre class="example">sap://[<var>address</var>][:<var>port</var>]
3610 </pre></td></tr></table>
3612 <p><var>address</var> is the multicast address to listen for announcements on,
3613 if omitted, the default 224.2.127.254 (sap.mcast.net) is used. <var>port</var>
3614 is the port that is listened on, 9875 if omitted.
3616 <p>The demuxers listens for announcements on the given address and port.
3617 Once an announcement is received, it tries to receive that particular stream.
3619 <p>Example command lines follow.
3621 <p>To play back the first stream announced on the normal SAP multicast address:
3623 <table><tr><td> </td><td><pre class="example">ffplay sap://
3624 </pre></td></tr></table>
3626 <p>To play back the first stream announced on one the default IPv6 SAP multicast address:
3628 <table><tr><td> </td><td><pre class="example">ffplay sap://[ff0e::2:7ffe]
3629 </pre></td></tr></table>
3632 <h2 class="section"><a href="ffmpeg.html#toc-tcp">16.15 tcp</a></h2>
3634 <p>Trasmission Control Protocol.
3636 <p>The required syntax for a TCP url is:
3637 </p><table><tr><td> </td><td><pre class="example">tcp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
3638 </pre></td></tr></table>
3640 <dl compact="compact">
3641 <dt> ‘<samp>listen</samp>’</dt>
3642 <dd><p>Listen for an incoming connection
3644 <table><tr><td> </td><td><pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> tcp://<var>hostname</var>:<var>port</var>?listen
3645 ffplay tcp://<var>hostname</var>:<var>port</var>
3646 </pre></td></tr></table>
3652 <h2 class="section"><a href="ffmpeg.html#toc-udp">16.16 udp</a></h2>
3654 <p>User Datagram Protocol.
3656 <p>The required syntax for a UDP url is:
3657 </p><table><tr><td> </td><td><pre class="example">udp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
3658 </pre></td></tr></table>
3660 <p><var>options</var> contains a list of &-seperated options of the form <var>key</var>=<var>val</var>.
3661 Follow the list of supported options.
3663 <dl compact="compact">
3664 <dt> ‘<samp>buffer_size=<var>size</var></samp>’</dt>
3665 <dd><p>set the UDP buffer size in bytes
3668 <dt> ‘<samp>localport=<var>port</var></samp>’</dt>
3669 <dd><p>override the local UDP port to bind with
3672 <dt> ‘<samp>pkt_size=<var>size</var></samp>’</dt>
3673 <dd><p>set the size in bytes of UDP packets
3676 <dt> ‘<samp>reuse=<var>1|0</var></samp>’</dt>
3677 <dd><p>explicitly allow or disallow reusing UDP sockets
3680 <dt> ‘<samp>ttl=<var>ttl</var></samp>’</dt>
3681 <dd><p>set the time to live value (for multicast only)
3684 <dt> ‘<samp>connect=<var>1|0</var></samp>’</dt>
3685 <dd><p>Initialize the UDP socket with <code>connect()</code>. In this case, the
3686 destination address can’t be changed with ff_udp_set_remote_url later.
3687 If the destination address isn’t known at the start, this option can
3688 be specified in ff_udp_set_remote_url, too.
3689 This allows finding out the source address for the packets with getsockname,
3690 and makes writes return with AVERROR(ECONNREFUSED) if "destination
3691 unreachable" is received.
3692 For receiving, this gives the benefit of only receiving packets from
3693 the specified peer address/port.
3697 <p>Some usage examples of the udp protocol with ‘<tt>ffmpeg</tt>’ follow.
3699 <p>To stream over UDP to a remote endpoint:
3700 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> udp://<var>hostname</var>:<var>port</var>
3701 </pre></td></tr></table>
3703 <p>To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer:
3704 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i <var>input</var> -f mpegts udp://<var>hostname</var>:<var>port</var>?pkt_size=188&buffer_size=65535
3705 </pre></td></tr></table>
3707 <p>To receive over UDP from a remote endpoint:
3708 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i udp://[<var>multicast-address</var>]:<var>port</var>
3709 </pre></td></tr></table>
3711 <a name="Bitstream-Filters"></a>
3712 <h1 class="chapter"><a href="ffmpeg.html#toc-Bitstream-Filters">17. Bitstream Filters</a></h1>
3714 <p>When you configure your FFmpeg build, all the supported bitstream
3715 filters are enabled by default. You can list all available ones using
3716 the configure option <code>--list-bsfs</code>.
3718 <p>You can disable all the bitstream filters using the configure option
3719 <code>--disable-bsfs</code>, and selectively enable any bitstream filter using
3720 the option <code>--enable-bsf=BSF</code>, or you can disable a particular
3721 bitstream filter using the option <code>--disable-bsf=BSF</code>.
3723 <p>The option <code>-bsfs</code> of the ff* tools will display the list of
3724 all the supported bitstream filters included in your build.
3726 <p>Below is a description of the currently available bitstream filters.
3728 <a name="aac_005fadtstoasc"></a>
3729 <h2 class="section"><a href="ffmpeg.html#toc-aac_005fadtstoasc">17.1 aac_adtstoasc</a></h2>
3731 <a name="chomp"></a>
3732 <h2 class="section"><a href="ffmpeg.html#toc-chomp">17.2 chomp</a></h2>
3734 <a name="dump_005fextradata"></a>
3735 <h2 class="section"><a href="ffmpeg.html#toc-dump_005fextradata">17.3 dump_extradata</a></h2>
3737 <a name="h264_005fmp4toannexb"></a>
3738 <h2 class="section"><a href="ffmpeg.html#toc-h264_005fmp4toannexb">17.4 h264_mp4toannexb</a></h2>
3740 <a name="imx_005fdump_005fheader"></a>
3741 <h2 class="section"><a href="ffmpeg.html#toc-imx_005fdump_005fheader">17.5 imx_dump_header</a></h2>
3743 <a name="mjpeg2jpeg"></a>
3744 <h2 class="section"><a href="ffmpeg.html#toc-mjpeg2jpeg">17.6 mjpeg2jpeg</a></h2>
3746 <p>Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
3748 <p>MJPEG is a video codec wherein each video frame is essentially a
3749 JPEG image. The individual frames can be extracted without loss,
3752 <table><tr><td> </td><td><pre class="example">ffmpeg -i ../some_mjpeg.avi -vcodec copy frames_%d.jpg
3753 </pre></td></tr></table>
3755 <p>Unfortunately, these chunks are incomplete JPEG images, because
3756 they lack the DHT segment required for decoding. Quoting from
3757 <a href="http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml">http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml</a>:
3759 <p>Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
3760 commented that "MJPEG, or at least the MJPEG in AVIs having the
3761 MJPG fourcc, is restricted JPEG with a fixed – and *omitted* –
3762 Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2,
3763 and it must use basic Huffman encoding, not arithmetic or
3764 progressive. . . . You can indeed extract the MJPEG frames and
3765 decode them with a regular JPEG decoder, but you have to prepend
3766 the DHT segment to them, or else the decoder won’t have any idea
3767 how to decompress the data. The exact table necessary is given in
3768 the OpenDML spec."
3770 <p>This bitstream filter patches the header of frames extracted from an MJPEG
3771 stream (carrying the AVI1 header ID and lacking a DHT segment) to
3772 produce fully qualified JPEG images.
3774 <table><tr><td> </td><td><pre class="example">ffmpeg -i mjpeg-movie.avi -vcodec copy -vbsf mjpeg2jpeg frame_%d.jpg
3775 exiftran -i -9 frame*.jpg
3776 ffmpeg -i frame_%d.jpg -vcodec copy rotated.avi
3777 </pre></td></tr></table>
3779 <a name="mjpega_005fdump_005fheader"></a>
3780 <h2 class="section"><a href="ffmpeg.html#toc-mjpega_005fdump_005fheader">17.7 mjpega_dump_header</a></h2>
3782 <a name="movsub"></a>
3783 <h2 class="section"><a href="ffmpeg.html#toc-movsub">17.8 movsub</a></h2>
3785 <a name="mp3_005fheader_005fcompress"></a>
3786 <h2 class="section"><a href="ffmpeg.html#toc-mp3_005fheader_005fcompress">17.9 mp3_header_compress</a></h2>
3788 <a name="mp3_005fheader_005fdecompress"></a>
3789 <h2 class="section"><a href="ffmpeg.html#toc-mp3_005fheader_005fdecompress">17.10 mp3_header_decompress</a></h2>
3791 <a name="noise"></a>
3792 <h2 class="section"><a href="ffmpeg.html#toc-noise">17.11 noise</a></h2>
3794 <a name="remove_005fextradata"></a>
3795 <h2 class="section"><a href="ffmpeg.html#toc-remove_005fextradata">17.12 remove_extradata</a></h2>
3797 <a name="Filtergraph-description"></a>
3798 <h1 class="chapter"><a href="ffmpeg.html#toc-Filtergraph-description">18. Filtergraph description</a></h1>
3800 <p>A filtergraph is a directed graph of connected filters. It can contain
3801 cycles, and there can be multiple links between a pair of
3802 filters. Each link has one input pad on one side connecting it to one
3803 filter from which it takes its input, and one output pad on the other
3804 side connecting it to the one filter accepting its output.
3806 <p>Each filter in a filtergraph is an instance of a filter class
3807 registered in the application, which defines the features and the
3808 number of input and output pads of the filter.
3810 <p>A filter with no input pads is called a "source", a filter with no
3811 output pads is called a "sink".
3813 <a name="Filtergraph-syntax"></a>
3814 <h2 class="section"><a href="ffmpeg.html#toc-Filtergraph-syntax">18.1 Filtergraph syntax</a></h2>
3816 <p>A filtergraph can be represented using a textual representation, which
3817 is recognized by the <code>-vf</code> and <code>-af</code> options of the ff*
3818 tools, and by the <code>av_parse_graph()</code> function defined in
3819 ‘<tt>libavfilter/avfiltergraph</tt>’.
3821 <p>A filterchain consists of a sequence of connected filters, each one
3822 connected to the previous one in the sequence. A filterchain is
3823 represented by a list of ","-separated filter descriptions.
3825 <p>A filtergraph consists of a sequence of filterchains. A sequence of
3826 filterchains is represented by a list of ";"-separated filterchain
3829 <p>A filter is represented by a string of the form:
3830 [<var>in_link_1</var>]...[<var>in_link_N</var>]<var>filter_name</var>=<var>arguments</var>[<var>out_link_1</var>]...[<var>out_link_M</var>]
3832 <p><var>filter_name</var> is the name of the filter class of which the
3833 described filter is an instance of, and has to be the name of one of
3834 the filter classes registered in the program.
3835 The name of the filter class is optionally followed by a string
3836 "=<var>arguments</var>".
3838 <p><var>arguments</var> is a string which contains the parameters used to
3839 initialize the filter instance, and are described in the filter
3842 <p>The list of arguments can be quoted using the character "’" as initial
3843 and ending mark, and the character ’\’ for escaping the characters
3844 within the quoted text; otherwise the argument string is considered
3845 terminated when the next special character (belonging to the set
3846 "[]=;,") is encountered.
3848 <p>The name and arguments of the filter are optionally preceded and
3849 followed by a list of link labels.
3850 A link label allows to name a link and associate it to a filter output
3851 or input pad. The preceding labels <var>in_link_1</var>
3852 ... <var>in_link_N</var>, are associated to the filter input pads,
3853 the following labels <var>out_link_1</var> ... <var>out_link_M</var>, are
3854 associated to the output pads.
3856 <p>When two link labels with the same name are found in the
3857 filtergraph, a link between the corresponding input and output pad is
3860 <p>If an output pad is not labelled, it is linked by default to the first
3861 unlabelled input pad of the next filter in the filterchain.
3862 For example in the filterchain:
3863 </p><table><tr><td> </td><td><pre class="example">nullsrc, split[L1], [L2]overlay, nullsink
3864 </pre></td></tr></table>
3865 <p>the split filter instance has two output pads, and the overlay filter
3866 instance two input pads. The first output pad of split is labelled
3867 "L1", the first input pad of overlay is labelled "L2", and the second
3868 output pad of split is linked to the second input pad of overlay,
3869 which are both unlabelled.
3871 <p>In a complete filterchain all the unlabelled filter input and output
3872 pads must be connected. A filtergraph is considered valid if all the
3873 filter input and output pads of all the filterchains are connected.
3875 <p>Follows a BNF description for the filtergraph syntax:
3876 </p><table><tr><td> </td><td><pre class="example"><var>NAME</var> ::= sequence of alphanumeric characters and '_'
3877 <var>LINKLABEL</var> ::= "[" <var>NAME</var> "]"
3878 <var>LINKLABELS</var> ::= <var>LINKLABEL</var> [<var>LINKLABELS</var>]
3879 <var>FILTER_ARGUMENTS</var> ::= sequence of chars (eventually quoted)
3880 <var>FILTER</var> ::= [<var>LINKNAMES</var>] <var>NAME</var> ["=" <var>ARGUMENTS</var>] [<var>LINKNAMES</var>]
3881 <var>FILTERCHAIN</var> ::= <var>FILTER</var> [,<var>FILTERCHAIN</var>]
3882 <var>FILTERGRAPH</var> ::= <var>FILTERCHAIN</var> [;<var>FILTERGRAPH</var>]
3883 </pre></td></tr></table>
3886 <a name="Audio-Filters"></a>
3887 <h1 class="chapter"><a href="ffmpeg.html#toc-Audio-Filters">19. Audio Filters</a></h1>
3889 <p>When you configure your FFmpeg build, you can disable any of the
3890 existing filters using –disable-filters.
3891 The configure output will show the audio filters included in your
3894 <p>Below is a description of the currently available audio filters.
3896 <a name="anull"></a>
3897 <h2 class="section"><a href="ffmpeg.html#toc-anull">19.1 anull</a></h2>
3899 <p>Pass the audio source unchanged to the output.
3902 <a name="Audio-Sources"></a>
3903 <h1 class="chapter"><a href="ffmpeg.html#toc-Audio-Sources">20. Audio Sources</a></h1>
3905 <p>Below is a description of the currently available audio sources.
3907 <a name="anullsrc"></a>
3908 <h2 class="section"><a href="ffmpeg.html#toc-anullsrc">20.1 anullsrc</a></h2>
3910 <p>Null audio source, never return audio frames. It is mainly useful as a
3911 template and to be employed in analysis / debugging tools.
3913 <p>It accepts as optional parameter a string of the form
3914 <var>sample_rate</var>:<var>channel_layout</var>.
3916 <p><var>sample_rate</var> specify the sample rate, and defaults to 44100.
3918 <p><var>channel_layout</var> specify the channel layout, and can be either an
3919 integer or a string representing a channel layout. The default value
3920 of <var>channel_layout</var> is 3, which corresponds to CH_LAYOUT_STEREO.
3922 <p>Check the channel_layout_map definition in
3923 ‘<tt>libavcodec/audioconvert.c</tt>’ for the mapping between strings and
3924 channel layout values.
3926 <p>Follow some examples:
3927 </p><table><tr><td> </td><td><pre class="example"># set the sample rate to 48000 Hz and the channel layout to CH_LAYOUT_MONO.
3932 </pre></td></tr></table>
3935 <a name="Audio-Sinks"></a>
3936 <h1 class="chapter"><a href="ffmpeg.html#toc-Audio-Sinks">21. Audio Sinks</a></h1>
3938 <p>Below is a description of the currently available audio sinks.
3940 <a name="anullsink"></a>
3941 <h2 class="section"><a href="ffmpeg.html#toc-anullsink">21.1 anullsink</a></h2>
3943 <p>Null audio sink, do absolutely nothing with the input audio. It is
3944 mainly useful as a template and to be employed in analysis / debugging
3948 <a name="Video-Filters"></a>
3949 <h1 class="chapter"><a href="ffmpeg.html#toc-Video-Filters">22. Video Filters</a></h1>
3951 <p>When you configure your FFmpeg build, you can disable any of the
3952 existing filters using –disable-filters.
3953 The configure output will show the video filters included in your
3956 <p>Below is a description of the currently available video filters.
3958 <a name="blackframe"></a>
3959 <h2 class="section"><a href="ffmpeg.html#toc-blackframe">22.1 blackframe</a></h2>
3961 <p>Detect frames that are (almost) completely black. Can be useful to
3962 detect chapter transitions or commercials. Output lines consist of
3963 the frame number of the detected frame, the percentage of blackness,
3964 the position in the file if known or -1 and the timestamp in seconds.
3966 <p>In order to display the output lines, you need to set the loglevel at
3967 least to the AV_LOG_INFO value.
3969 <p>The filter accepts the syntax:
3970 </p><table><tr><td> </td><td><pre class="example">blackframe[=<var>amount</var>:[<var>threshold</var>]]
3971 </pre></td></tr></table>
3973 <p><var>amount</var> is the percentage of the pixels that have to be below the
3974 threshold, and defaults to 98.
3976 <p><var>threshold</var> is the threshold below which a pixel value is
3977 considered black, and defaults to 32.
3980 <h2 class="section"><a href="ffmpeg.html#toc-copy">22.2 copy</a></h2>
3982 <p>Copy the input source unchanged to the output. Mainly useful for
3986 <h2 class="section"><a href="ffmpeg.html#toc-crop">22.3 crop</a></h2>
3988 <p>Crop the input video to <var>out_w</var>:<var>out_h</var>:<var>x</var>:<var>y</var>.
3990 <p>The parameters are expressions containing the following constants:
3992 <dl compact="compact">
3993 <dt> ‘<samp>E, PI, PHI</samp>’</dt>
3994 <dd><p>the corresponding mathematical approximated values for e
3995 (euler number), pi (greek PI), PHI (golden ratio)
3998 <dt> ‘<samp>x, y</samp>’</dt>
3999 <dd><p>the computed values for <var>x</var> and <var>y</var>. They are evaluated for
4003 <dt> ‘<samp>in_w, in_h</samp>’</dt>
4004 <dd><p>the input width and heigth
4007 <dt> ‘<samp>iw, ih</samp>’</dt>
4008 <dd><p>same as <var>in_w</var> and <var>in_h</var>
4011 <dt> ‘<samp>out_w, out_h</samp>’</dt>
4012 <dd><p>the output (cropped) width and heigth
4015 <dt> ‘<samp>ow, oh</samp>’</dt>
4016 <dd><p>same as <var>out_w</var> and <var>out_h</var>
4019 <dt> ‘<samp>n</samp>’</dt>
4020 <dd><p>the number of input frame, starting from 0
4023 <dt> ‘<samp>pos</samp>’</dt>
4024 <dd><p>the position in the file of the input frame, NAN if unknown
4027 <dt> ‘<samp>t</samp>’</dt>
4028 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
4033 <p>The <var>out_w</var> and <var>out_h</var> parameters specify the expressions for
4034 the width and height of the output (cropped) video. They are
4035 evaluated just at the configuration of the filter.
4037 <p>The default value of <var>out_w</var> is "in_w", and the default value of
4038 <var>out_h</var> is "in_h".
4040 <p>The expression for <var>out_w</var> may depend on the value of <var>out_h</var>,
4041 and the expression for <var>out_h</var> may depend on <var>out_w</var>, but they
4042 cannot depend on <var>x</var> and <var>y</var>, as <var>x</var> and <var>y</var> are
4043 evaluated after <var>out_w</var> and <var>out_h</var>.
4045 <p>The <var>x</var> and <var>y</var> parameters specify the expressions for the
4046 position of the top-left corner of the output (non-cropped) area. They
4047 are evaluated for each frame. If the evaluated value is not valid, it
4048 is approximated to the nearest valid value.
4050 <p>The default value of <var>x</var> is "(in_w-out_w)/2", and the default
4051 value for <var>y</var> is "(in_h-out_h)/2", which set the cropped area at
4052 the center of the input image.
4054 <p>The expression for <var>x</var> may depend on <var>y</var>, and the expression
4055 for <var>y</var> may depend on <var>x</var>.
4057 <p>Follow some examples:
4058 </p><table><tr><td> </td><td><pre class="example"># crop the central input area with size 100x100
4061 # crop the central input area with size 2/3 of the input video
4062 "crop=2/3*in_w:2/3*in_h"
4064 # crop the input video central square
4067 # delimit the rectangle with the top-left corner placed at position
4068 # 100:100 and the right-bottom corner corresponding to the right-bottom
4069 # corner of the input image.
4070 crop=in_w-100:in_h-100:100:100
4072 # crop 10 pixels from the left and right borders, and 20 pixels from
4073 # the top and bottom borders
4074 "crop=in_w-2*10:in_h-2*20"
4076 # keep only the bottom right quarter of the input image
4077 "crop=in_w/2:in_h/2:in_w/2:in_h/2"
4079 # crop height for getting Greek harmony
4080 "crop=in_w:1/PHI*in_w"
4083 "crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(n/7)"
4085 # erratic camera effect depending on timestamp
4086 "crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(t*10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t*13)"
4088 # set x depending on the value of y
4089 "crop=in_w/2:in_h/2:y:10+10*sin(n/10)"
4090 </pre></td></tr></table>
4092 <a name="cropdetect"></a>
4093 <h2 class="section"><a href="ffmpeg.html#toc-cropdetect">22.4 cropdetect</a></h2>
4095 <p>Auto-detect crop size.
4097 <p>Calculate necessary cropping parameters and prints the recommended
4098 parameters through the logging system. The detected dimensions
4099 correspond to the non-black area of the input video.
4101 <p>It accepts the syntax:
4102 </p><table><tr><td> </td><td><pre class="example">cropdetect[=<var>limit</var>[:<var>round</var>[:<var>reset</var>]]]
4103 </pre></td></tr></table>
4105 <dl compact="compact">
4106 <dt> ‘<samp>limit</samp>’</dt>
4107 <dd><p>Threshold, which can be optionally specified from nothing (0) to
4108 everything (255), defaults to 24.
4111 <dt> ‘<samp>round</samp>’</dt>
4112 <dd><p>Value which the width/height should be divisible by, defaults to
4113 16. The offset is automatically adjusted to center the video. Use 2 to
4114 get only even dimensions (needed for 4:2:2 video). 16 is best when
4115 encoding to most video codecs.
4118 <dt> ‘<samp>reset</samp>’</dt>
4119 <dd><p>Counter that determines after how many frames cropdetect will reset
4120 the previously detected largest video area and start over to detect
4121 the current optimal crop area. Defaults to 0.
4123 <p>This can be useful when channel logos distort the video area. 0
4124 indicates never reset and return the largest area encountered during
4129 <a name="drawbox"></a>
4130 <h2 class="section"><a href="ffmpeg.html#toc-drawbox">22.5 drawbox</a></h2>
4132 <p>Draw a colored box on the input image.
4134 <p>It accepts the syntax:
4135 </p><table><tr><td> </td><td><pre class="example">drawbox=<var>x</var>:<var>y</var>:<var>width</var>:<var>height</var>:<var>color</var>
4136 </pre></td></tr></table>
4138 <dl compact="compact">
4139 <dt> ‘<samp>x, y</samp>’</dt>
4140 <dd><p>Specify the top left corner coordinates of the box. Default to 0.
4143 <dt> ‘<samp>width, height</samp>’</dt>
4144 <dd><p>Specify the width and height of the box, if 0 they are interpreted as
4145 the input width and height. Default to 0.
4148 <dt> ‘<samp>color</samp>’</dt>
4149 <dd><p>Specify the color of the box to write, it can be the name of a color
4150 (case insensitive match) or a 0xRRGGBB[AA] sequence.
4154 <p>Follow some examples:
4155 </p><table><tr><td> </td><td><pre class="example"># draw a black box around the edge of the input image
4158 # draw a box with color red and an opacity of 50%
4159 drawbox=10:20:200:60:red@0.5"
4160 </pre></td></tr></table>
4162 <a name="drawtext"></a>
4163 <h2 class="section"><a href="ffmpeg.html#toc-drawtext">22.6 drawtext</a></h2>
4165 <p>Draw text string or text from specified file on top of video using the
4166 libfreetype library.
4168 <p>To enable compilation of this filter you need to configure FFmpeg with
4169 <code>--enable-libfreetype</code>.
4171 <p>The filter also recognizes strftime() sequences in the provided text
4172 and expands them accordingly. Check the documentation of strftime().
4174 <p>The filter accepts parameters as a list of <var>key</var>=<var>value</var> pairs,
4175 separated by ":".
4177 <p>The description of the accepted parameters follows.
4179 <dl compact="compact">
4180 <dt> ‘<samp>fontfile</samp>’</dt>
4181 <dd><p>The font file to be used for drawing text. Path must be included.
4182 This parameter is mandatory.
4185 <dt> ‘<samp>text</samp>’</dt>
4186 <dd><p>The text string to be drawn. The text must be a sequence of UTF-8
4188 This parameter is mandatory if no file is specified with the parameter
4189 <var>textfile</var>.
4192 <dt> ‘<samp>textfile</samp>’</dt>
4193 <dd><p>A text file containing text to be drawn. The text must be a sequence
4194 of UTF-8 encoded characters.
4196 <p>This parameter is mandatory if no text string is specified with the
4197 parameter <var>text</var>.
4199 <p>If both text and textfile are specified, an error is thrown.
4202 <dt> ‘<samp>x, y</samp>’</dt>
4203 <dd><p>The offsets where text will be drawn within the video frame.
4204 Relative to the top/left border of the output image.
4206 <p>The default value of <var>x</var> and <var>y</var> is 0.
4209 <dt> ‘<samp>fontsize</samp>’</dt>
4210 <dd><p>The font size to be used for drawing text.
4211 The default value of <var>fontsize</var> is 16.
4214 <dt> ‘<samp>fontcolor</samp>’</dt>
4215 <dd><p>The color to be used for drawing fonts.
4216 Either a string (e.g. "red") or in 0xRRGGBB[AA] format
4217 (e.g. "0xff000033"), possibly followed by an alpha specifier.
4218 The default value of <var>fontcolor</var> is "black".
4221 <dt> ‘<samp>boxcolor</samp>’</dt>
4222 <dd><p>The color to be used for drawing box around text.
4223 Either a string (e.g. "yellow") or in 0xRRGGBB[AA] format
4224 (e.g. "0xff00ff"), possibly followed by an alpha specifier.
4225 The default value of <var>boxcolor</var> is "white".
4228 <dt> ‘<samp>box</samp>’</dt>
4229 <dd><p>Used to draw a box around text using background color.
4230 Value should be either 1 (enable) or 0 (disable).
4231 The default value of <var>box</var> is 0.
4234 <dt> ‘<samp>shadowx, shadowy</samp>’</dt>
4235 <dd><p>The x and y offsets for the text shadow position with respect to the
4236 position of the text. They can be either positive or negative
4237 values. Default value for both is "0".
4240 <dt> ‘<samp>shadowcolor</samp>’</dt>
4241 <dd><p>The color to be used for drawing a shadow behind the drawn text. It
4242 can be a color name (e.g. "yellow") or a string in the 0xRRGGBB[AA]
4243 form (e.g. "0xff00ff"), possibly followed by an alpha specifier.
4244 The default value of <var>shadowcolor</var> is "black".
4247 <dt> ‘<samp>ft_load_flags</samp>’</dt>
4248 <dd><p>Flags to be used for loading the fonts.
4250 <p>The flags map the corresponding flags supported by libfreetype, and are
4251 a combination of the following values:
4252 </p><dl compact="compact">
4253 <dt> <var>default</var></dt>
4254 <dt> <var>no_scale</var></dt>
4255 <dt> <var>no_hinting</var></dt>
4256 <dt> <var>render</var></dt>
4257 <dt> <var>no_bitmap</var></dt>
4258 <dt> <var>vertical_layout</var></dt>
4259 <dt> <var>force_autohint</var></dt>
4260 <dt> <var>crop_bitmap</var></dt>
4261 <dt> <var>pedantic</var></dt>
4262 <dt> <var>ignore_global_advance_width</var></dt>
4263 <dt> <var>no_recurse</var></dt>
4264 <dt> <var>ignore_transform</var></dt>
4265 <dt> <var>monochrome</var></dt>
4266 <dt> <var>linear_design</var></dt>
4267 <dt> <var>no_autohint</var></dt>
4268 <dt> <var>end table</var></dt>
4271 <p>Default value is "render".
4273 <p>For more information consult the documentation for the FT_LOAD_*
4277 <dt> ‘<samp>tabsize</samp>’</dt>
4278 <dd><p>The size in number of spaces to use for rendering the tab.
4283 <p>For example the command:
4284 </p><table><tr><td> </td><td><pre class="example">drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'"
4285 </pre></td></tr></table>
4287 <p>will draw "Test Text" with font FreeSerif, using the default values
4288 for the optional parameters.
4291 </p><table><tr><td> </td><td><pre class="example">drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
4292 x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2"
4293 </pre></td></tr></table>
4295 <p>will draw ’Test Text’ with font FreeSerif of size 24 at position x=100
4296 and y=50 (counting from the top-left corner of the screen), text is
4297 yellow with a red box around it. Both the text and the box have an
4300 <p>Note that the double quotes are not necessary if spaces are not used
4301 within the parameter list.
4303 <p>For more information about libfreetype, check:
4304 <a href="http://www.freetype.org/">http://www.freetype.org/</a>.
4307 <h2 class="section"><a href="ffmpeg.html#toc-fade">22.7 fade</a></h2>
4309 <p>Apply fade-in/out effect to input video.
4311 <p>It accepts the parameters:
4312 <var>type</var>:<var>start_frame</var>:<var>nb_frames</var>
4314 <p><var>type</var> specifies if the effect type, can be either "in" for
4315 fade-in, or "out" for a fade-out effect.
4317 <p><var>start_frame</var> specifies the number of the start frame for starting
4318 to apply the fade effect.
4320 <p><var>nb_frames</var> specifies the number of frames for which the fade
4321 effect has to last. At the end of the fade-in effect the output video
4322 will have the same intensity as the input video, at the end of the
4323 fade-out transition the output video will be completely black.
4325 <p>A few usage examples follow, usable too as test scenarios.
4326 </p><table><tr><td> </td><td><pre class="example"># fade in first 30 frames of video
4329 # fade out last 45 frames of a 200-frame video
4332 # fade in first 25 frames and fade out last 25 frames of a 1000-frame video
4333 fade=in:0:25, fade=out:975:25
4335 # make first 5 frames black, then fade in from frame 5-24
4337 </pre></td></tr></table>
4339 <a name="fieldorder"></a>
4340 <h2 class="section"><a href="ffmpeg.html#toc-fieldorder">22.8 fieldorder</a></h2>
4342 <p>Transform the field order of the input video.
4344 <p>It accepts one parameter which specifies the required field order that
4345 the input interlaced video will be transformed to. The parameter can
4346 assume one of the following values:
4348 <dl compact="compact">
4349 <dt> ‘<samp>0 or bff</samp>’</dt>
4350 <dd><p>output bottom field first
4352 <dt> ‘<samp>1 or tff</samp>’</dt>
4353 <dd><p>output top field first
4357 <p>Default value is "tff".
4359 <p>Transformation is achieved by shifting the picture content up or down
4360 by one line, and filling the remaining line with appropriate picture content.
4361 This method is consistent with most broadcast field order converters.
4363 <p>If the input video is not flagged as being interlaced, or it is already
4364 flagged as being of the required output field order then this filter does
4365 not alter the incoming video.
4367 <p>This filter is very useful when converting to or from PAL DV material,
4368 which is bottom field first.
4371 </p><table><tr><td> </td><td><pre class="example">./ffmpeg -i in.vob -vf "fieldorder=bff" out.dv
4372 </pre></td></tr></table>
4375 <h2 class="section"><a href="ffmpeg.html#toc-fifo">22.9 fifo</a></h2>
4377 <p>Buffer input images and send them when they are requested.
4379 <p>This filter is mainly useful when auto-inserted by the libavfilter
4382 <p>The filter does not take parameters.
4384 <a name="format"></a>
4385 <h2 class="section"><a href="ffmpeg.html#toc-format">22.10 format</a></h2>
4387 <p>Convert the input video to one of the specified pixel formats.
4388 Libavfilter will try to pick one that is supported for the input to
4391 <p>The filter accepts a list of pixel format names, separated by ":",
4392 for example "yuv420p:monow:rgb24".
4394 <p>Some examples follow:
4395 </p><table><tr><td> </td><td><pre class="example"># convert the input video to the format "yuv420p"
4398 # convert the input video to any of the formats in the list
4399 format=yuv420p:yuv444p:yuv410p
4400 </pre></td></tr></table>
4402 <p><a name="frei0r"></a>
4403 </p><a name="frei0r-1"></a>
4404 <h2 class="section"><a href="ffmpeg.html#toc-frei0r-1">22.11 frei0r</a></h2>
4406 <p>Apply a frei0r effect to the input video.
4408 <p>To enable compilation of this filter you need to install the frei0r
4409 header and configure FFmpeg with –enable-frei0r.
4411 <p>The filter supports the syntax:
4412 </p><table><tr><td> </td><td><pre class="example"><var>filter_name</var>[{:|=}<var>param1</var>:<var>param2</var>:...:<var>paramN</var>]
4413 </pre></td></tr></table>
4415 <p><var>filter_name</var> is the name to the frei0r effect to load. If the
4416 environment variable <code>FREI0R_PATH</code> is defined, the frei0r effect
4417 is searched in each one of the directories specified by the colon
4418 separated list in <code>FREIOR_PATH</code>, otherwise in the standard frei0r
4419 paths, which are in this order: ‘<tt>HOME/.frei0r-1/lib/</tt>’,
4420 ‘<tt>/usr/local/lib/frei0r-1/</tt>’, ‘<tt>/usr/lib/frei0r-1/</tt>’.
4422 <p><var>param1</var>, <var>param2</var>, ... , <var>paramN</var> specify the parameters
4423 for the frei0r effect.
4425 <p>A frei0r effect parameter can be a boolean (whose values are specified
4426 with "y" and "n"), a double, a color (specified by the syntax
4427 <var>R</var>/<var>G</var>/<var>B</var>, <var>R</var>, <var>G</var>, and <var>B</var> being float
4428 numbers from 0.0 to 1.0) or by an <code>av_parse_color()</code> color
4429 description), a position (specified by the syntax <var>X</var>/<var>Y</var>,
4430 <var>X</var> and <var>Y</var> being float numbers) and a string.
4432 <p>The number and kind of parameters depend on the loaded effect. If an
4433 effect parameter is not specified the default value is set.
4435 <p>Some examples follow:
4436 </p><table><tr><td> </td><td><pre class="example"># apply the distort0r effect, set the first two double parameters
4437 frei0r=distort0r:0.5:0.01
4439 # apply the colordistance effect, takes a color as first parameter
4440 frei0r=colordistance:0.2/0.3/0.4
4441 frei0r=colordistance:violet
4442 frei0r=colordistance:0x112233
4444 # apply the perspective effect, specify the top left and top right
4446 frei0r=perspective:0.2/0.2:0.8/0.2
4447 </pre></td></tr></table>
4449 <p>For more information see:
4450 <a href="http://piksel.org/frei0r">http://piksel.org/frei0r</a>
4452 <a name="gradfun"></a>
4453 <h2 class="section"><a href="ffmpeg.html#toc-gradfun">22.12 gradfun</a></h2>
4455 <p>Fix the banding artifacts that are sometimes introduced into nearly flat
4456 regions by truncation to 8bit colordepth.
4457 Interpolate the gradients that should go where the bands are, and
4460 <p>This filter is designed for playback only. Do not use it prior to
4461 lossy compression, because compression tends to lose the dither and
4462 bring back the bands.
4464 <p>The filter takes two optional parameters, separated by ’:’:
4465 <var>strength</var>:<var>radius</var>
4467 <p><var>strength</var> is the maximum amount by which the filter will change
4468 any one pixel. Also the threshold for detecting nearly flat
4469 regions. Acceptable values range from .51 to 255, default value is
4470 1.2, out-of-range values will be clipped to the valid range.
4472 <p><var>radius</var> is the neighborhood to fit the gradient to. A larger
4473 radius makes for smoother gradients, but also prevents the filter from
4474 modifying the pixels near detailed regions. Acceptable values are
4475 8-32, default value is 16, out-of-range values will be clipped to the
4478 <table><tr><td> </td><td><pre class="example"># default parameters
4483 </pre></td></tr></table>
4485 <a name="hflip"></a>
4486 <h2 class="section"><a href="ffmpeg.html#toc-hflip">22.13 hflip</a></h2>
4488 <p>Flip the input video horizontally.
4490 <p>For example to horizontally flip the video in input with
4491 ‘<tt>ffmpeg</tt>’:
4492 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i in.avi -vf "hflip" out.avi
4493 </pre></td></tr></table>
4495 <a name="hqdn3d"></a>
4496 <h2 class="section"><a href="ffmpeg.html#toc-hqdn3d">22.14 hqdn3d</a></h2>
4498 <p>High precision/quality 3d denoise filter. This filter aims to reduce
4499 image noise producing smooth images and making still images really
4500 still. It should enhance compressibility.
4502 <p>It accepts the following optional parameters:
4503 <var>luma_spatial</var>:<var>chroma_spatial</var>:<var>luma_tmp</var>:<var>chroma_tmp</var>
4505 <dl compact="compact">
4506 <dt> ‘<samp>luma_spatial</samp>’</dt>
4507 <dd><p>a non-negative float number which specifies spatial luma strength,
4511 <dt> ‘<samp>chroma_spatial</samp>’</dt>
4512 <dd><p>a non-negative float number which specifies spatial chroma strength,
4513 defaults to 3.0*<var>luma_spatial</var>/4.0
4516 <dt> ‘<samp>luma_tmp</samp>’</dt>
4517 <dd><p>a float number which specifies luma temporal strength, defaults to
4518 6.0*<var>luma_spatial</var>/4.0
4521 <dt> ‘<samp>chroma_tmp</samp>’</dt>
4522 <dd><p>a float number which specifies chroma temporal strength, defaults to
4523 <var>luma_tmp</var>*<var>chroma_spatial</var>/<var>luma_spatial</var>
4528 <h2 class="section"><a href="ffmpeg.html#toc-mp">22.15 mp</a></h2>
4530 <p>Apply an MPlayer filter to the input video.
4532 <p>This filter provides a wrapper around most of the filters of
4535 <p>This wrapper is considered experimental. Some of the wrapped filters
4536 may not work properly and we may drop support for them, as they will
4537 be implemented natively into FFmpeg. Thus you should avoid
4538 depending on them when writing portable scripts.
4540 <p>The filters accepts the parameters:
4541 <var>filter_name</var>[:=]<var>filter_params</var>
4543 <p><var>filter_name</var> is the name of a supported MPlayer filter,
4544 <var>filter_params</var> is a string containing the parameters accepted by
4547 <p>The list of the currently supported filters follows:
4548 </p><dl compact="compact">
4549 <dt> <var>2xsai</var></dt>
4550 <dt> <var>blackframe</var></dt>
4551 <dt> <var>boxblur</var></dt>
4552 <dt> <var>cropdetect</var></dt>
4553 <dt> <var>decimate</var></dt>
4554 <dt> <var>delogo</var></dt>
4555 <dt> <var>denoise3d</var></dt>
4556 <dt> <var>detc</var></dt>
4557 <dt> <var>dint</var></dt>
4558 <dt> <var>divtc</var></dt>
4559 <dt> <var>down3dright</var></dt>
4560 <dt> <var>dsize</var></dt>
4561 <dt> <var>eq2</var></dt>
4562 <dt> <var>eq</var></dt>
4563 <dt> <var>field</var></dt>
4564 <dt> <var>fil</var></dt>
4565 <dt> <var>fixpts</var></dt>
4566 <dt> <var>framestep</var></dt>
4567 <dt> <var>fspp</var></dt>
4568 <dt> <var>geq</var></dt>
4569 <dt> <var>gradfun</var></dt>
4570 <dt> <var>harddup</var></dt>
4571 <dt> <var>hqdn3d</var></dt>
4572 <dt> <var>hue</var></dt>
4573 <dt> <var>il</var></dt>
4574 <dt> <var>ilpack</var></dt>
4575 <dt> <var>ivtc</var></dt>
4576 <dt> <var>kerndeint</var></dt>
4577 <dt> <var>mcdeint</var></dt>
4578 <dt> <var>mirror</var></dt>
4579 <dt> <var>noise</var></dt>
4580 <dt> <var>ow</var></dt>
4581 <dt> <var>palette</var></dt>
4582 <dt> <var>perspective</var></dt>
4583 <dt> <var>phase</var></dt>
4584 <dt> <var>pp7</var></dt>
4585 <dt> <var>pullup</var></dt>
4586 <dt> <var>qp</var></dt>
4587 <dt> <var>rectangle</var></dt>
4588 <dt> <var>remove-logo</var></dt>
4589 <dt> <var>rgbtest</var></dt>
4590 <dt> <var>rotate</var></dt>
4591 <dt> <var>sab</var></dt>
4592 <dt> <var>screenshot</var></dt>
4593 <dt> <var>smartblur</var></dt>
4594 <dt> <var>softpulldown</var></dt>
4595 <dt> <var>softskip</var></dt>
4596 <dt> <var>spp</var></dt>
4597 <dt> <var>swapuv</var></dt>
4598 <dt> <var>telecine</var></dt>
4599 <dt> <var>test</var></dt>
4600 <dt> <var>tile</var></dt>
4601 <dt> <var>tinterlace</var></dt>
4602 <dt> <var>unsharp</var></dt>
4603 <dt> <var>uspp</var></dt>
4604 <dt> <var>yuvcsp</var></dt>
4605 <dt> <var>yvu9</var></dt>
4608 <p>The parameter syntax and behavior for the listed filters are the same
4609 of the corresponding MPlayer filters. For detailed instructions check
4610 the "VIDEO FILTERS" section in the MPlayer manual.
4612 <p>Some examples follow:
4613 </p><table><tr><td> </td><td><pre class="example"># remove a logo by interpolating the surrounding pixels
4614 mp=delogo=200:200:80:20:1
4616 # adjust gamma, brightness, contrast
4619 # tweak hue and saturation
4621 </pre></td></tr></table>
4623 <p>See also mplayer(1), <a href="http://www.mplayerhq.hu/">http://www.mplayerhq.hu/</a>.
4625 <a name="noformat"></a>
4626 <h2 class="section"><a href="ffmpeg.html#toc-noformat">22.16 noformat</a></h2>
4628 <p>Force libavfilter not to use any of the specified pixel formats for the
4629 input to the next filter.
4631 <p>The filter accepts a list of pixel format names, separated by ":",
4632 for example "yuv420p:monow:rgb24".
4634 <p>Some examples follow:
4635 </p><table><tr><td> </td><td><pre class="example"># force libavfilter to use a format different from "yuv420p" for the
4636 # input to the vflip filter
4637 noformat=yuv420p,vflip
4639 # convert the input video to any of the formats not contained in the list
4640 noformat=yuv420p:yuv444p:yuv410p
4641 </pre></td></tr></table>
4643 <a name="null-1"></a>
4644 <h2 class="section"><a href="ffmpeg.html#toc-null-1">22.17 null</a></h2>
4646 <p>Pass the video source unchanged to the output.
4649 <h2 class="section"><a href="ffmpeg.html#toc-ocv">22.18 ocv</a></h2>
4651 <p>Apply video transform using libopencv.
4653 <p>To enable this filter install libopencv library and headers and
4654 configure FFmpeg with –enable-libopencv.
4656 <p>The filter takes the parameters: <var>filter_name</var>{:=}<var>filter_params</var>.
4658 <p><var>filter_name</var> is the name of the libopencv filter to apply.
4660 <p><var>filter_params</var> specifies the parameters to pass to the libopencv
4661 filter. If not specified the default values are assumed.
4663 <p>Refer to the official libopencv documentation for more precise
4665 <a href="http://opencv.willowgarage.com/documentation/c/image_filtering.html">http://opencv.willowgarage.com/documentation/c/image_filtering.html</a>
4667 <p>Follows the list of supported libopencv filters.
4669 <p><a name="dilate"></a>
4670 </p><a name="dilate-1"></a>
4671 <h3 class="subsection"><a href="ffmpeg.html#toc-dilate-1">22.18.1 dilate</a></h3>
4673 <p>Dilate an image by using a specific structuring element.
4674 This filter corresponds to the libopencv function <code>cvDilate</code>.
4676 <p>It accepts the parameters: <var>struct_el</var>:<var>nb_iterations</var>.
4678 <p><var>struct_el</var> represents a structuring element, and has the syntax:
4679 <var>cols</var>x<var>rows</var>+<var>anchor_x</var>x<var>anchor_y</var>/<var>shape</var>
4681 <p><var>cols</var> and <var>rows</var> represent the number of colums and rows of
4682 the structuring element, <var>anchor_x</var> and <var>anchor_y</var> the anchor
4683 point, and <var>shape</var> the shape for the structuring element, and
4684 can be one of the values "rect", "cross", "ellipse", "custom".
4686 <p>If the value for <var>shape</var> is "custom", it must be followed by a
4687 string of the form "=<var>filename</var>". The file with name
4688 <var>filename</var> is assumed to represent a binary image, with each
4689 printable character corresponding to a bright pixel. When a custom
4690 <var>shape</var> is used, <var>cols</var> and <var>rows</var> are ignored, the number
4691 or columns and rows of the read file are assumed instead.
4693 <p>The default value for <var>struct_el</var> is "3x3+0x0/rect".
4695 <p><var>nb_iterations</var> specifies the number of times the transform is
4696 applied to the image, and defaults to 1.
4698 <p>Follow some example:
4699 </p><table><tr><td> </td><td><pre class="example"># use the default values
4702 # dilate using a structuring element with a 5x5 cross, iterate two times
4703 ocv=dilate=5x5+2x2/cross:2
4705 # read the shape from the file diamond.shape, iterate two times
4706 # the file diamond.shape may contain a pattern of characters like this:
4712 # the specified cols and rows are ignored (but not the anchor point coordinates)
4713 ocv=0x0+2x2/custom=diamond.shape:2
4714 </pre></td></tr></table>
4716 <a name="erode"></a>
4717 <h3 class="subsection"><a href="ffmpeg.html#toc-erode">22.18.2 erode</a></h3>
4719 <p>Erode an image by using a specific structuring element.
4720 This filter corresponds to the libopencv function <code>cvErode</code>.
4722 <p>The filter accepts the parameters: <var>struct_el</var>:<var>nb_iterations</var>,
4723 with the same meaning and use of those of the dilate filter
4724 (see <a href="#dilate">dilate</a>).
4726 <a name="smooth"></a>
4727 <h3 class="subsection"><a href="ffmpeg.html#toc-smooth">22.18.3 smooth</a></h3>
4729 <p>Smooth the input video.
4731 <p>The filter takes the following parameters:
4732 <var>type</var>:<var>param1</var>:<var>param2</var>:<var>param3</var>:<var>param4</var>.
4734 <p><var>type</var> is the type of smooth filter to apply, and can be one of
4735 the following values: "blur", "blur_no_scale", "median", "gaussian",
4736 "bilateral". The default value is "gaussian".
4738 <p><var>param1</var>, <var>param2</var>, <var>param3</var>, and <var>param4</var> are
4739 parameters whose meanings depend on smooth type. <var>param1</var> and
4740 <var>param2</var> accept integer positive values or 0, <var>param3</var> and
4741 <var>param4</var> accept float values.
4743 <p>The default value for <var>param1</var> is 3, the default value for the
4744 other parameters is 0.
4746 <p>These parameters correspond to the parameters assigned to the
4747 libopencv function <code>cvSmooth</code>.
4749 <a name="overlay"></a>
4750 <h2 class="section"><a href="ffmpeg.html#toc-overlay">22.19 overlay</a></h2>
4752 <p>Overlay one video on top of another.
4754 <p>It takes two inputs and one output, the first input is the "main"
4755 video on which the second input is overlayed.
4757 <p>It accepts the parameters: <var>x</var>:<var>y</var>.
4759 <p><var>x</var> is the x coordinate of the overlayed video on the main video,
4760 <var>y</var> is the y coordinate. The parameters are expressions containing
4761 the following parameters:
4763 <dl compact="compact">
4764 <dt> ‘<samp>main_w, main_h</samp>’</dt>
4765 <dd><p>main input width and height
4768 <dt> ‘<samp>W, H</samp>’</dt>
4769 <dd><p>same as <var>main_w</var> and <var>main_h</var>
4772 <dt> ‘<samp>overlay_w, overlay_h</samp>’</dt>
4773 <dd><p>overlay input width and height
4776 <dt> ‘<samp>w, h</samp>’</dt>
4777 <dd><p>same as <var>overlay_w</var> and <var>overlay_h</var>
4781 <p>Be aware that frames are taken from each input video in timestamp
4782 order, hence, if their initial timestamps differ, it is a a good idea
4783 to pass the two inputs through a <var>setpts=PTS-STARTPTS</var> filter to
4784 have them begin in the same zero timestamp, as it does the example for
4785 the <var>movie</var> filter.
4787 <p>Follow some examples:
4788 </p><table><tr><td> </td><td><pre class="example"># draw the overlay at 10 pixels from the bottom right
4789 # corner of the main video.
4790 overlay=main_w-overlay_w-10:main_h-overlay_h-10
4792 # insert a transparent PNG logo in the bottom left corner of the input
4793 movie=logo.png [logo];
4794 [in][logo] overlay=10:main_h-overlay_h-10 [out]
4796 # insert 2 different transparent PNG logos (second logo on bottom
4798 movie=logo1.png [logo1];
4799 movie=logo2.png [logo2];
4800 [in][logo1] overlay=10:H-h-10 [in+logo1];
4801 [in+logo1][logo2] overlay=W-w-10:H-h-10 [out]
4803 # add a transparent color layer on top of the main video,
4804 # WxH specifies the size of the main input to the overlay filter
4805 color=red.3:WxH [over]; [in][over] overlay [out]
4806 </pre></td></tr></table>
4808 <p>You can chain togheter more overlays but the efficiency of such
4809 approach is yet to be tested.
4812 <h2 class="section"><a href="ffmpeg.html#toc-pad">22.20 pad</a></h2>
4814 <p>Add paddings to the input image, and places the original input at the
4815 given coordinates <var>x</var>, <var>y</var>.
4817 <p>It accepts the following parameters:
4818 <var>width</var>:<var>height</var>:<var>x</var>:<var>y</var>:<var>color</var>.
4820 <p>The parameters <var>width</var>, <var>height</var>, <var>x</var>, and <var>y</var> are
4821 expressions containing the following constants:
4823 <dl compact="compact">
4824 <dt> ‘<samp>E, PI, PHI</samp>’</dt>
4825 <dd><p>the corresponding mathematical approximated values for e
4826 (euler number), pi (greek PI), phi (golden ratio)
4829 <dt> ‘<samp>in_w, in_h</samp>’</dt>
4830 <dd><p>the input video width and heigth
4833 <dt> ‘<samp>iw, ih</samp>’</dt>
4834 <dd><p>same as <var>in_w</var> and <var>in_h</var>
4837 <dt> ‘<samp>out_w, out_h</samp>’</dt>
4838 <dd><p>the output width and heigth, that is the size of the padded area as
4839 specified by the <var>width</var> and <var>height</var> expressions
4842 <dt> ‘<samp>ow, oh</samp>’</dt>
4843 <dd><p>same as <var>out_w</var> and <var>out_h</var>
4846 <dt> ‘<samp>x, y</samp>’</dt>
4847 <dd><p>x and y offsets as specified by the <var>x</var> and <var>y</var>
4848 expressions, or NAN if not yet specified
4851 <dt> ‘<samp>a</samp>’</dt>
4852 <dd><p>input display aspect ratio, same as <var>iw</var> / <var>ih</var>
4855 <dt> ‘<samp>hsub, vsub</samp>’</dt>
4856 <dd><p>horizontal and vertical chroma subsample values. For example for the
4857 pixel format "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
4861 <p>Follows the description of the accepted parameters.
4863 <dl compact="compact">
4864 <dt> ‘<samp>width, height</samp>’</dt>
4866 <p>Specify the size of the output image with the paddings added. If the
4867 value for <var>width</var> or <var>height</var> is 0, the corresponding input size
4868 is used for the output.
4870 <p>The <var>width</var> expression can reference the value set by the
4871 <var>height</var> expression, and viceversa.
4873 <p>The default value of <var>width</var> and <var>height</var> is 0.
4876 <dt> ‘<samp>x, y</samp>’</dt>
4878 <p>Specify the offsets where to place the input image in the padded area
4879 with respect to the top/left border of the output image.
4881 <p>The <var>x</var> expression can reference the value set by the <var>y</var>
4882 expression, and viceversa.
4884 <p>The default value of <var>x</var> and <var>y</var> is 0.
4887 <dt> ‘<samp>color</samp>’</dt>
4889 <p>Specify the color of the padded area, it can be the name of a color
4890 (case insensitive match) or a 0xRRGGBB[AA] sequence.
4892 <p>The default value of <var>color</var> is "black".
4897 <p>Some examples follow:
4899 <table><tr><td> </td><td><pre class="example"># Add paddings with color "violet" to the input video. Output video
4900 # size is 640x480, the top-left corner of the input video is placed at
4902 pad=640:480:0:40:violet
4904 # pad the input to get an output with dimensions increased bt 3/2,
4905 # and put the input video at the center of the padded area
4906 pad="3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2"
4908 # pad the input to get a squared output with size equal to the maximum
4909 # value between the input width and height, and put the input video at
4910 # the center of the padded area
4911 pad="max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2"
4913 # pad the input to get a final w/h ratio of 16:9
4914 pad="ih*16/9:ih:(ow-iw)/2:(oh-ih)/2"
4916 # double output size and put the input video in the bottom-right
4917 # corner of the output padded area
4918 pad="2*iw:2*ih:ow-iw:oh-ih"
4919 </pre></td></tr></table>
4921 <a name="pixdesctest"></a>
4922 <h2 class="section"><a href="ffmpeg.html#toc-pixdesctest">22.21 pixdesctest</a></h2>
4924 <p>Pixel format descriptor test filter, mainly useful for internal
4925 testing. The output video should be equal to the input video.
4928 </p><table><tr><td> </td><td><pre class="example">format=monow, pixdesctest
4929 </pre></td></tr></table>
4931 <p>can be used to test the monowhite pixel format descriptor definition.
4933 <a name="scale"></a>
4934 <h2 class="section"><a href="ffmpeg.html#toc-scale">22.22 scale</a></h2>
4936 <p>Scale the input video to <var>width</var>:<var>height</var> and/or convert the image format.
4938 <p>The parameters <var>width</var> and <var>height</var> are expressions containing
4939 the following constants:
4941 <dl compact="compact">
4942 <dt> ‘<samp>E, PI, PHI</samp>’</dt>
4943 <dd><p>the corresponding mathematical approximated values for e
4944 (euler number), pi (greek PI), phi (golden ratio)
4947 <dt> ‘<samp>in_w, in_h</samp>’</dt>
4948 <dd><p>the input width and heigth
4951 <dt> ‘<samp>iw, ih</samp>’</dt>
4952 <dd><p>same as <var>in_w</var> and <var>in_h</var>
4955 <dt> ‘<samp>out_w, out_h</samp>’</dt>
4956 <dd><p>the output (cropped) width and heigth
4959 <dt> ‘<samp>ow, oh</samp>’</dt>
4960 <dd><p>same as <var>out_w</var> and <var>out_h</var>
4963 <dt> ‘<samp>a</samp>’</dt>
4964 <dd><p>input display aspect ratio, same as <var>iw</var> / <var>ih</var>
4967 <dt> ‘<samp>hsub, vsub</samp>’</dt>
4968 <dd><p>horizontal and vertical chroma subsample values. For example for the
4969 pixel format "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
4973 <p>If the input image format is different from the format requested by
4974 the next filter, the scale filter will convert the input to the
4977 <p>If the value for <var>width</var> or <var>height</var> is 0, the respective input
4978 size is used for the output.
4980 <p>If the value for <var>width</var> or <var>height</var> is -1, the scale filter will
4981 use, for the respective output size, a value that maintains the aspect
4982 ratio of the input image.
4984 <p>The default value of <var>width</var> and <var>height</var> is 0.
4986 <p>Some examples follow:
4987 </p><table><tr><td> </td><td><pre class="example"># scale the input video to a size of 200x100.
4990 # scale the input to 2x
4992 # the above is the same as
4995 # scale the input to half size
4998 # increase the width, and set the height to the same size
5001 # seek for Greek harmony
5005 # increase the height, and set the width to 3/2 of the height
5008 # increase the size, but make the size a multiple of the chroma
5009 scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
5011 # increase the width to a maximum of 500 pixels, keep the same input aspect ratio
5012 scale='min(500\, iw*3/2):-1'
5013 </pre></td></tr></table>
5015 <a name="select"></a>
5016 <h2 class="section"><a href="ffmpeg.html#toc-select">22.23 select</a></h2>
5017 <p>Select frames to pass in output.
5019 <p>It accepts in input an expression, which is evaluated for each input
5020 frame. If the expression is evaluated to a non-zero value, the frame
5021 is selected and passed to the output, otherwise it is discarded.
5023 <p>The expression can contain the following constants:
5025 <dl compact="compact">
5026 <dt> ‘<samp>PI</samp>’</dt>
5030 <dt> ‘<samp>PHI</samp>’</dt>
5034 <dt> ‘<samp>E</samp>’</dt>
5038 <dt> ‘<samp>n</samp>’</dt>
5039 <dd><p>the sequential number of the filtered frame, starting from 0
5042 <dt> ‘<samp>selected_n</samp>’</dt>
5043 <dd><p>the sequential number of the selected frame, starting from 0
5046 <dt> ‘<samp>prev_selected_n</samp>’</dt>
5047 <dd><p>the sequential number of the last selected frame, NAN if undefined
5050 <dt> ‘<samp>TB</samp>’</dt>
5051 <dd><p>timebase of the input timestamps
5054 <dt> ‘<samp>pts</samp>’</dt>
5055 <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
5056 expressed in <var>TB</var> units, NAN if undefined
5059 <dt> ‘<samp>t</samp>’</dt>
5060 <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
5061 expressed in seconds, NAN if undefined
5064 <dt> ‘<samp>prev_pts</samp>’</dt>
5065 <dd><p>the PTS of the previously filtered video frame, NAN if undefined
5068 <dt> ‘<samp>prev_selected_pts</samp>’</dt>
5069 <dd><p>the PTS of the last previously filtered video frame, NAN if undefined
5072 <dt> ‘<samp>prev_selected_t</samp>’</dt>
5073 <dd><p>the PTS of the last previously selected video frame, NAN if undefined
5076 <dt> ‘<samp>start_pts</samp>’</dt>
5077 <dd><p>the PTS of the first video frame in the video, NAN if undefined
5080 <dt> ‘<samp>start_t</samp>’</dt>
5081 <dd><p>the time of the first video frame in the video, NAN if undefined
5084 <dt> ‘<samp>pict_type</samp>’</dt>
5085 <dd><p>the picture type of the filtered frame, can assume one of the following
5087 </p><dl compact="compact">
5088 <dt> ‘<samp>PICT_TYPE_I</samp>’</dt>
5089 <dt> ‘<samp>PICT_TYPE_P</samp>’</dt>
5090 <dt> ‘<samp>PICT_TYPE_B</samp>’</dt>
5091 <dt> ‘<samp>PICT_TYPE_S</samp>’</dt>
5092 <dt> ‘<samp>PICT_TYPE_SI</samp>’</dt>
5093 <dt> ‘<samp>PICT_TYPE_SP</samp>’</dt>
5094 <dt> ‘<samp>PICT_TYPE_BI</samp>’</dt>
5098 <dt> ‘<samp>interlace_type</samp>’</dt>
5099 <dd><p>the frame interlace type, can assume one of the following values:
5100 </p><dl compact="compact">
5101 <dt> ‘<samp>INTERLACE_TYPE_P</samp>’</dt>
5102 <dd><p>the frame is progressive (not interlaced)
5104 <dt> ‘<samp>INTERLACE_TYPE_T</samp>’</dt>
5105 <dd><p>the frame is top-field-first
5107 <dt> ‘<samp>INTERLACE_TYPE_B</samp>’</dt>
5108 <dd><p>the frame is bottom-field-first
5113 <dt> ‘<samp>key</samp>’</dt>
5114 <dd><p>1 if the filtered frame is a key-frame, 0 otherwise
5117 <dt> ‘<samp>pos</samp>’</dt>
5118 <dd><p>the position in the file of the filtered frame, -1 if the information
5119 is not available (e.g. for synthetic video)
5123 <p>The default value of the select expression is "1".
5125 <p>Some examples follow:
5127 <table><tr><td> </td><td><pre class="example"># select all frames in input
5130 # the above is the same as:
5136 # select only I-frames
5137 select='eq(pict_type\,PICT_TYPE_I)'
5139 # select one frame every 100
5140 select='not(mod(n\,100))'
5142 # select only frames contained in the 10-20 time interval
5143 select='gte(t\,10)*lte(t\,20)'
5145 # select only I frames contained in the 10-20 time interval
5146 select='gte(t\,10)*lte(t\,20)*eq(pict_type\,PICT_TYPE_I)'
5148 # select frames with a minimum distance of 10 seconds
5149 select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
5150 </pre></td></tr></table>
5152 <p><a name="setdar"></a>
5153 </p><a name="setdar-1"></a>
5154 <h2 class="section"><a href="ffmpeg.html#toc-setdar-1">22.24 setdar</a></h2>
5156 <p>Set the Display Aspect Ratio for the filter output video.
5158 <p>This is done by changing the specified Sample (aka Pixel) Aspect
5159 Ratio, according to the following equation:
5160 <em>DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR</em>
5162 <p>Keep in mind that this filter does not modify the pixel dimensions of
5163 the video frame. Also the display aspect ratio set by this filter may
5164 be changed by later filters in the filterchain, e.g. in case of
5165 scaling or if another "setdar" or a "setsar" filter is applied.
5167 <p>The filter accepts a parameter string which represents the wanted
5168 display aspect ratio.
5169 The parameter can be a floating point number string, or an expression
5170 of the form <var>num</var>:<var>den</var>, where <var>num</var> and <var>den</var> are the
5171 numerator and denominator of the aspect ratio.
5172 If the parameter is not specified, it is assumed the value "0:1".
5174 <p>For example to change the display aspect ratio to 16:9, specify:
5175 </p><table><tr><td> </td><td><pre class="example">setdar=16:9
5176 # the above is equivalent to
5178 </pre></td></tr></table>
5180 <p>See also the "setsar" filter documentation (see <a href="#setsar">setsar</a>).
5182 <a name="setpts"></a>
5183 <h2 class="section"><a href="ffmpeg.html#toc-setpts">22.25 setpts</a></h2>
5185 <p>Change the PTS (presentation timestamp) of the input video frames.
5187 <p>Accept in input an expression evaluated through the eval API, which
5188 can contain the following constants:
5190 <dl compact="compact">
5191 <dt> ‘<samp>PTS</samp>’</dt>
5192 <dd><p>the presentation timestamp in input
5195 <dt> ‘<samp>PI</samp>’</dt>
5199 <dt> ‘<samp>PHI</samp>’</dt>
5203 <dt> ‘<samp>E</samp>’</dt>
5207 <dt> ‘<samp>N</samp>’</dt>
5208 <dd><p>the count of the input frame, starting from 0.
5211 <dt> ‘<samp>STARTPTS</samp>’</dt>
5212 <dd><p>the PTS of the first video frame
5215 <dt> ‘<samp>INTERLACED</samp>’</dt>
5216 <dd><p>tell if the current frame is interlaced
5219 <dt> ‘<samp>POS</samp>’</dt>
5220 <dd><p>original position in the file of the frame, or undefined if undefined
5221 for the current frame
5224 <dt> ‘<samp>PREV_INPTS</samp>’</dt>
5225 <dd><p>previous input PTS
5228 <dt> ‘<samp>PREV_OUTPTS</samp>’</dt>
5229 <dd><p>previous output PTS
5234 <p>Some examples follow:
5236 <table><tr><td> </td><td><pre class="example"># start counting PTS from zero
5248 # fixed rate 25 fps with some jitter
5249 setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
5250 </pre></td></tr></table>
5252 <p><a name="setsar"></a>
5253 </p><a name="setsar-1"></a>
5254 <h2 class="section"><a href="ffmpeg.html#toc-setsar-1">22.26 setsar</a></h2>
5256 <p>Set the Sample (aka Pixel) Aspect Ratio for the filter output video.
5258 <p>Note that as a consequence of the application of this filter, the
5259 output display aspect ratio will change according to the following
5261 <em>DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR</em>
5263 <p>Keep in mind that the sample aspect ratio set by this filter may be
5264 changed by later filters in the filterchain, e.g. if another "setsar"
5265 or a "setdar" filter is applied.
5267 <p>The filter accepts a parameter string which represents the wanted
5268 sample aspect ratio.
5269 The parameter can be a floating point number string, or an expression
5270 of the form <var>num</var>:<var>den</var>, where <var>num</var> and <var>den</var> are the
5271 numerator and denominator of the aspect ratio.
5272 If the parameter is not specified, it is assumed the value "0:1".
5274 <p>For example to change the sample aspect ratio to 10:11, specify:
5275 </p><table><tr><td> </td><td><pre class="example">setsar=10:11
5276 </pre></td></tr></table>
5278 <a name="settb"></a>
5279 <h2 class="section"><a href="ffmpeg.html#toc-settb">22.27 settb</a></h2>
5281 <p>Set the timebase to use for the output frames timestamps.
5282 It is mainly useful for testing timebase configuration.
5284 <p>It accepts in input an arithmetic expression representing a rational.
5285 The expression can contain the constants "PI", "E", "PHI", "AVTB" (the
5286 default timebase), and "intb" (the input timebase).
5288 <p>The default value for the input is "intb".
5290 <p>Follow some examples.
5292 <table><tr><td> </td><td><pre class="example"># set the timebase to 1/25
5295 # set the timebase to 1/10
5298 #set the timebase to 1001/1000
5301 #set the timebase to 2*intb
5304 #set the default timebase value
5306 </pre></td></tr></table>
5308 <a name="showinfo"></a>
5309 <h2 class="section"><a href="ffmpeg.html#toc-showinfo">22.28 showinfo</a></h2>
5311 <p>Show a line containing various information for each input video frame.
5312 The input video is not modified.
5314 <p>The shown line contains a sequence of key/value pairs of the form
5315 <var>key</var>:<var>value</var>.
5317 <p>A description of each shown parameter follows:
5319 <dl compact="compact">
5320 <dt> ‘<samp>n</samp>’</dt>
5321 <dd><p>sequential number of the input frame, starting from 0
5324 <dt> ‘<samp>pts</samp>’</dt>
5325 <dd><p>Presentation TimeStamp of the input frame, expressed as a number of
5326 time base units. The time base unit depends on the filter input pad.
5329 <dt> ‘<samp>pts_time</samp>’</dt>
5330 <dd><p>Presentation TimeStamp of the input frame, expressed as a number of
5334 <dt> ‘<samp>pos</samp>’</dt>
5335 <dd><p>position of the frame in the input stream, -1 if this information in
5336 unavailable and/or meanigless (for example in case of synthetic video)
5339 <dt> ‘<samp>fmt</samp>’</dt>
5340 <dd><p>pixel format name
5343 <dt> ‘<samp>sar</samp>’</dt>
5344 <dd><p>sample aspect ratio of the input frame, expressed in the form
5345 <var>num</var>/<var>den</var>
5348 <dt> ‘<samp>s</samp>’</dt>
5349 <dd><p>size of the input frame, expressed in the form
5350 <var>width</var>x<var>height</var>
5353 <dt> ‘<samp>i</samp>’</dt>
5354 <dd><p>interlaced mode ("P" for "progressive", "T" for top field first, "B"
5355 for bottom field first)
5358 <dt> ‘<samp>iskey</samp>’</dt>
5359 <dd><p>1 if the frame is a key frame, 0 otherwise
5362 <dt> ‘<samp>type</samp>’</dt>
5363 <dd><p>picture type of the input frame ("I" for an I-frame, "P" for a
5364 P-frame, "B" for a B-frame, "?" for unknown type).
5365 Check also the documentation of the <code>AVPictureType</code> enum and of
5366 the <code>av_get_picture_type_char</code> function defined in
5367 ‘<tt>libavutil/avutil.h</tt>’.
5370 <dt> ‘<samp>checksum</samp>’</dt>
5371 <dd><p>Adler-32 checksum of all the planes of the input frame
5374 <dt> ‘<samp>plane_checksum</samp>’</dt>
5375 <dd><p>Adler-32 checksum of each plane of the input frame, expressed in the form
5376 "[<var>c0</var> <var>c1</var> <var>c2</var> <var>c3</var>]"
5380 <a name="slicify"></a>
5381 <h2 class="section"><a href="ffmpeg.html#toc-slicify">22.29 slicify</a></h2>
5383 <p>Pass the images of input video on to next video filter as multiple
5386 <table><tr><td> </td><td><pre class="example">./ffmpeg -i in.avi -vf "slicify=32" out.avi
5387 </pre></td></tr></table>
5389 <p>The filter accepts the slice height as parameter. If the parameter is
5390 not specified it will use the default value of 16.
5392 <p>Adding this in the beginning of filter chains should make filtering
5393 faster due to better use of the memory cache.
5395 <a name="split"></a>
5396 <h2 class="section"><a href="ffmpeg.html#toc-split">22.30 split</a></h2>
5398 <p>Pass on the input video to two outputs. Both outputs are identical to
5402 </p><table><tr><td> </td><td><pre class="example">[in] split [splitout1][splitout2];
5403 [splitout1] crop=100:100:0:0 [cropout];
5404 [splitout2] pad=200:200:100:100 [padout];
5405 </pre></td></tr></table>
5407 <p>will create two separate outputs from the same input, one cropped and
5410 <a name="transpose"></a>
5411 <h2 class="section"><a href="ffmpeg.html#toc-transpose">22.31 transpose</a></h2>
5413 <p>Transpose rows with columns in the input video and optionally flip it.
5415 <p>It accepts a parameter representing an integer, which can assume the
5418 <dl compact="compact">
5419 <dt> ‘<samp>0</samp>’</dt>
5420 <dd><p>Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
5421 </p><table><tr><td> </td><td><pre class="example">L.R L.l
5424 </pre></td></tr></table>
5427 <dt> ‘<samp>1</samp>’</dt>
5428 <dd><p>Rotate by 90 degrees clockwise, that is:
5429 </p><table><tr><td> </td><td><pre class="example">L.R l.L
5432 </pre></td></tr></table>
5435 <dt> ‘<samp>2</samp>’</dt>
5436 <dd><p>Rotate by 90 degrees counterclockwise, that is:
5437 </p><table><tr><td> </td><td><pre class="example">L.R R.r
5440 </pre></td></tr></table>
5443 <dt> ‘<samp>3</samp>’</dt>
5444 <dd><p>Rotate by 90 degrees clockwise and vertically flip, that is:
5445 </p><table><tr><td> </td><td><pre class="example">L.R r.R
5448 </pre></td></tr></table>
5452 <a name="unsharp"></a>
5453 <h2 class="section"><a href="ffmpeg.html#toc-unsharp">22.32 unsharp</a></h2>
5455 <p>Sharpen or blur the input video.
5457 <p>It accepts the following parameters:
5458 <var>luma_msize_x</var>:<var>luma_msize_y</var>:<var>luma_amount</var>:<var>chroma_msize_x</var>:<var>chroma_msize_y</var>:<var>chroma_amount</var>
5460 <p>Negative values for the amount will blur the input video, while positive
5461 values will sharpen. All parameters are optional and default to the
5462 equivalent of the string ’5:5:1.0:0:0:0.0’.
5464 <dl compact="compact">
5465 <dt> ‘<samp>luma_msize_x</samp>’</dt>
5466 <dd><p>Set the luma matrix horizontal size. It can be an integer between 3
5467 and 13, default value is 5.
5470 <dt> ‘<samp>luma_msize_y</samp>’</dt>
5471 <dd><p>Set the luma matrix vertical size. It can be an integer between 3
5472 and 13, default value is 5.
5475 <dt> ‘<samp>luma_amount</samp>’</dt>
5476 <dd><p>Set the luma effect strength. It can be a float number between -2.0
5477 and 5.0, default value is 1.0.
5480 <dt> ‘<samp>chroma_msize_x</samp>’</dt>
5481 <dd><p>Set the chroma matrix horizontal size. It can be an integer between 3
5482 and 13, default value is 0.
5485 <dt> ‘<samp>chroma_msize_y</samp>’</dt>
5486 <dd><p>Set the chroma matrix vertical size. It can be an integer between 3
5487 and 13, default value is 0.
5490 <dt> ‘<samp>luma_amount</samp>’</dt>
5491 <dd><p>Set the chroma effect strength. It can be a float number between -2.0
5492 and 5.0, default value is 0.0.
5497 <table><tr><td> </td><td><pre class="example"># Strong luma sharpen effect parameters
5500 # Strong blur of both luma and chroma parameters
5501 unsharp=7:7:-2:7:7:-2
5503 # Use the default values with <code>ffmpeg</code>
5504 ./ffmpeg -i in.avi -vf "unsharp" out.mp4
5505 </pre></td></tr></table>
5507 <a name="vflip"></a>
5508 <h2 class="section"><a href="ffmpeg.html#toc-vflip">22.33 vflip</a></h2>
5510 <p>Flip the input video vertically.
5512 <table><tr><td> </td><td><pre class="example">./ffmpeg -i in.avi -vf "vflip" out.avi
5513 </pre></td></tr></table>
5515 <a name="yadif"></a>
5516 <h2 class="section"><a href="ffmpeg.html#toc-yadif">22.34 yadif</a></h2>
5518 <p>Deinterlace the input video ("yadif" means "yet another deinterlacing
5521 <p>It accepts the optional parameters: <var>mode</var>:<var>parity</var>.
5523 <p><var>mode</var> specifies the interlacing mode to adopt, accepts one of the
5526 <dl compact="compact">
5527 <dt> ‘<samp>0</samp>’</dt>
5528 <dd><p>output 1 frame for each frame
5530 <dt> ‘<samp>1</samp>’</dt>
5531 <dd><p>output 1 frame for each field
5533 <dt> ‘<samp>2</samp>’</dt>
5534 <dd><p>like 0 but skips spatial interlacing check
5536 <dt> ‘<samp>3</samp>’</dt>
5537 <dd><p>like 1 but skips spatial interlacing check
5541 <p>Default value is 0.
5543 <p><var>parity</var> specifies the picture field parity assumed for the input
5544 interlaced video, accepts one of the following values:
5546 <dl compact="compact">
5547 <dt> ‘<samp>0</samp>’</dt>
5548 <dd><p>assume bottom field first
5550 <dt> ‘<samp>1</samp>’</dt>
5551 <dd><p>assume top field first
5553 <dt> ‘<samp>-1</samp>’</dt>
5554 <dd><p>enable automatic detection
5558 <p>Default value is -1.
5559 If interlacing is unknown or decoder does not export this information,
5560 top field first will be assumed.
5563 <a name="Video-Sources"></a>
5564 <h1 class="chapter"><a href="ffmpeg.html#toc-Video-Sources">23. Video Sources</a></h1>
5566 <p>Below is a description of the currently available video sources.
5568 <a name="buffer"></a>
5569 <h2 class="section"><a href="ffmpeg.html#toc-buffer">23.1 buffer</a></h2>
5571 <p>Buffer video frames, and make them available to the filter chain.
5573 <p>This source is mainly intended for a programmatic use, in particular
5574 through the interface defined in ‘<tt>libavfilter/vsrc_buffer.h</tt>’.
5576 <p>It accepts the following parameters:
5577 <var>width</var>:<var>height</var>:<var>pix_fmt_string</var>:<var>timebase_num</var>:<var>timebase_den</var>:<var>sample_aspect_ratio_num</var>:<var>sample_aspect_ratio.den</var>:<var>scale_params</var>
5579 <p>All the parameters but <var>scale_params</var> need to be explicitely
5582 <p>Follows the list of the accepted parameters.
5584 <dl compact="compact">
5585 <dt> ‘<samp>width, height</samp>’</dt>
5586 <dd><p>Specify the width and height of the buffered video frames.
5589 <dt> ‘<samp>pix_fmt_string</samp>’</dt>
5590 <dd><p>A string representing the pixel format of the buffered video frames.
5591 It may be a number corresponding to a pixel format, or a pixel format
5595 <dt> ‘<samp>timebase_num, timebase_den</samp>’</dt>
5596 <dd><p>Specify numerator and denomitor of the timebase assumed by the
5597 timestamps of the buffered frames.
5600 <dt> ‘<samp>sample_aspect_ratio.num, sample_aspect_ratio.den</samp>’</dt>
5601 <dd><p>Specify numerator and denominator of the sample aspect ratio assumed
5602 by the video frames.
5605 <dt> ‘<samp>scale_params</samp>’</dt>
5606 <dd><p>Specify the optional parameters to be used for the scale filter which
5607 is automatically inserted when an input change is detected in the
5608 input size or format.
5613 </p><table><tr><td> </td><td><pre class="example">buffer=320:240:yuv410p:1:24:1:1
5614 </pre></td></tr></table>
5616 <p>will instruct the source to accept video frames with size 320x240 and
5617 with format "yuv410p", assuming 1/24 as the timestamps timebase and
5618 square pixels (1:1 sample aspect ratio).
5619 Since the pixel format with name "yuv410p" corresponds to the number 6
5620 (check the enum PixelFormat definition in ‘<tt>libavutil/pixfmt.h</tt>’),
5621 this example corresponds to:
5622 </p><table><tr><td> </td><td><pre class="example">buffer=320:240:6:1:24:1:1
5623 </pre></td></tr></table>
5625 <a name="color"></a>
5626 <h2 class="section"><a href="ffmpeg.html#toc-color">23.2 color</a></h2>
5628 <p>Provide an uniformly colored input.
5630 <p>It accepts the following parameters:
5631 <var>color</var>:<var>frame_size</var>:<var>frame_rate</var>
5633 <p>Follows the description of the accepted parameters.
5635 <dl compact="compact">
5636 <dt> ‘<samp>color</samp>’</dt>
5637 <dd><p>Specify the color of the source. It can be the name of a color (case
5638 insensitive match) or a 0xRRGGBB[AA] sequence, possibly followed by an
5639 alpha specifier. The default value is "black".
5642 <dt> ‘<samp>frame_size</samp>’</dt>
5643 <dd><p>Specify the size of the sourced video, it may be a string of the form
5644 <var>width</var>x<var>heigth</var>, or the name of a size abbreviation. The
5645 default value is "320x240".
5648 <dt> ‘<samp>frame_rate</samp>’</dt>
5649 <dd><p>Specify the frame rate of the sourced video, as the number of frames
5650 generated per second. It has to be a string in the format
5651 <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a float
5652 number or a valid video frame rate abbreviation. The default value is
5658 <p>For example the following graph description will generate a red source
5659 with an opacity of 0.2, with size "qcif" and a frame rate of 10
5660 frames per second, which will be overlayed over the source connected
5661 to the pad with identifier "in".
5663 <table><tr><td> </td><td><pre class="example">"color=red@0.2:qcif:10 [color]; [in][color] overlay [out]"
5664 </pre></td></tr></table>
5666 <a name="movie"></a>
5667 <h2 class="section"><a href="ffmpeg.html#toc-movie">23.3 movie</a></h2>
5669 <p>Read a video stream from a movie container.
5671 <p>It accepts the syntax: <var>movie_name</var>[:<var>options</var>] where
5672 <var>movie_name</var> is the name of the resource to read (not necessarily
5673 a file but also a device or a stream accessed through some protocol),
5674 and <var>options</var> is an optional sequence of <var>key</var>=<var>value</var>
5675 pairs, separated by ":".
5677 <p>The description of the accepted options follows.
5679 <dl compact="compact">
5680 <dt> ‘<samp>format_name, f</samp>’</dt>
5681 <dd><p>Specifies the format assumed for the movie to read, and can be either
5682 the name of a container or an input device. If not specified the
5683 format is guessed from <var>movie_name</var> or by probing.
5686 <dt> ‘<samp>seek_point, sp</samp>’</dt>
5687 <dd><p>Specifies the seek point in seconds, the frames will be output
5688 starting from this seek point, the parameter is evaluated with
5689 <code>av_strtod</code> so the numerical value may be suffixed by an IS
5690 postfix. Default value is "0".
5693 <dt> ‘<samp>stream_index, si</samp>’</dt>
5694 <dd><p>Specifies the index of the video stream to read. If the value is -1,
5695 the best suited video stream will be automatically selected. Default
5696 value is "-1".
5701 <p>This filter allows to overlay a second video on top of main input of
5702 a filtergraph as shown in this graph:
5703 </p><table><tr><td> </td><td><pre class="example">input -----------> deltapts0 --> overlay --> output
5706 movie --> scale--> deltapts1 -------+
5707 </pre></td></tr></table>
5709 <p>Some examples follow:
5710 </p><table><tr><td> </td><td><pre class="example"># skip 3.2 seconds from the start of the avi file in.avi, and overlay it
5711 # on top of the input labelled as "in".
5712 movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [movie];
5713 [in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
5715 # read from a video4linux2 device, and overlay it on top of the input
5716 # labelled as "in"
5717 movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [movie];
5718 [in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
5720 </pre></td></tr></table>
5722 <a name="nullsrc"></a>
5723 <h2 class="section"><a href="ffmpeg.html#toc-nullsrc">23.4 nullsrc</a></h2>
5725 <p>Null video source, never return images. It is mainly useful as a
5726 template and to be employed in analysis / debugging tools.
5728 <p>It accepts as optional parameter a string of the form
5729 <var>width</var>:<var>height</var>:<var>timebase</var>.
5731 <p><var>width</var> and <var>height</var> specify the size of the configured
5732 source. The default values of <var>width</var> and <var>height</var> are
5733 respectively 352 and 288 (corresponding to the CIF size format).
5735 <p><var>timebase</var> specifies an arithmetic expression representing a
5736 timebase. The expression can contain the constants "PI", "E", "PHI",
5737 "AVTB" (the default timebase), and defaults to the value "AVTB".
5739 <a name="frei0r_005fsrc"></a>
5740 <h2 class="section"><a href="ffmpeg.html#toc-frei0r_005fsrc">23.5 frei0r_src</a></h2>
5742 <p>Provide a frei0r source.
5744 <p>To enable compilation of this filter you need to install the frei0r
5745 header and configure FFmpeg with –enable-frei0r.
5747 <p>The source supports the syntax:
5748 </p><table><tr><td> </td><td><pre class="example"><var>size</var>:<var>rate</var>:<var>src_name</var>[{=|:}<var>param1</var>:<var>param2</var>:...:<var>paramN</var>]
5749 </pre></td></tr></table>
5751 <p><var>size</var> is the size of the video to generate, may be a string of the
5752 form <var>width</var>x<var>height</var> or a frame size abbreviation.
5753 <var>rate</var> is the rate of the video to generate, may be a string of
5754 the form <var>num</var>/<var>den</var> or a frame rate abbreviation.
5755 <var>src_name</var> is the name to the frei0r source to load. For more
5756 information regarding frei0r and how to set the parameters read the
5757 section "frei0r" (see <a href="#frei0r">frei0r</a>) in the description of the video
5760 <p>Some examples follow:
5761 </p><table><tr><td> </td><td><pre class="example"># generate a frei0r partik0l source with size 200x200 and framerate 10
5762 # which is overlayed on the overlay filter main input
5763 frei0r_src=200x200:10:partik0l=1234 [overlay]; [in][overlay] overlay
5764 </pre></td></tr></table>
5767 <a name="Video-Sinks"></a>
5768 <h1 class="chapter"><a href="ffmpeg.html#toc-Video-Sinks">24. Video Sinks</a></h1>
5770 <p>Below is a description of the currently available video sinks.
5772 <a name="nullsink"></a>
5773 <h2 class="section"><a href="ffmpeg.html#toc-nullsink">24.1 nullsink</a></h2>
5775 <p>Null video sink, do absolutely nothing with the input video. It is
5776 mainly useful as a template and to be employed in analysis / debugging
5780 <a name="Metadata"></a>
5781 <h1 class="chapter"><a href="ffmpeg.html#toc-Metadata">25. Metadata</a></h1>
5783 <p>FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded
5784 INI-like text file and then load it back using the metadata muxer/demuxer.
5786 <p>The file format is as follows:
5789 A file consists of a header and a number of metadata tags divided into sections,
5790 each on its own line.
5793 The header is a ’;FFMETADATA’ string, followed by a version number (now 1).
5796 Metadata tags are of the form ’key=value’
5799 Immediately after header follows global metadata
5802 After global metadata there may be sections with per-stream/per-chapter
5806 A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
5807 brackets (’[’, ’]’) and ends with next section or end of file.
5810 At the beginning of a chapter section there may be an optional timebase to be
5811 used for start/end values. It must be in form ’TIMEBASE=num/den’, where num and
5812 den are integers. If the timebase is missing then start/end times are assumed to
5814 Next a chapter section must contain chapter start and end times in form
5815 ’START=num’, ’END=num’, where num is a positive integer.
5818 Empty lines and lines starting with ’;’ or ’#’ are ignored.
5821 Metadata keys or values containing special characters (’=’, ’;’, ’#’, ’\’ and a
5822 newline) must be escaped with a backslash ’\’.
5825 Note that whitespace in metadata (e.g. foo = bar) is considered to be a part of
5826 the tag (in the example above key is ’foo ’, value is ’ bar’).
5829 <p>A ffmetadata file might look like this:
5830 </p><table><tr><td> </td><td><pre class="example">;FFMETADATA1
5833 artist=FFmpeg troll team
5838 #chapter ends at 0:01:00
5844 </pre></td></tr></table>
5850 This document was generated by <em>Kyle Schwarz</em> on <em>June 10, 2011</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.