]> git.sesse.net Git - casparcg/blob - ffmpeg 0.8/doc/ffplay.html
2.0.0.2: Updated to ffmpeg 0.8.
[casparcg] / ffmpeg 0.8 / doc / ffplay.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
2 <html>
3 <!-- Created on July 23, 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>
8             and many others.
9 Maintained by: Many creative people.
10 Send bugs and suggestions to <texi2html-bug@nongnu.org>
11 -->
12 <head>
13 <title>ffplay Documentation</title>
14
15 <meta name="description" content="ffplay Documentation">
16 <meta name="keywords" content="ffplay 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">
22 <!--
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}
36 -->
37 </style>
38
39
40 </head>
41
42 <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
43
44 <a name="SEC_Top"></a>
45 <h1 class="settitle">ffplay Documentation</h1>
46
47 <a name="SEC_Contents"></a>
48 <h1>Table of Contents</h1>
49 <div class="contents">
50
51 <ul class="toc">
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-3" href="#Options-3">3. Options</a>
55   <ul class="toc">
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-Advanced-options" href="#Advanced-options">3.3 Advanced options</a></li>
59     <li><a name="toc-While-playing" href="#While-playing">3.4 While playing</a></li>
60   </ul></li>
61   <li><a name="toc-Expression-Evaluation" href="#Expression-Evaluation">4. Expression Evaluation</a></li>
62   <li><a name="toc-Decoders" href="#Decoders">5. Decoders</a></li>
63   <li><a name="toc-Video-Decoders" href="#Video-Decoders">6. Video Decoders</a>
64   <ul class="toc">
65     <li><a name="toc-rawvideo" href="#rawvideo">6.1 rawvideo</a>
66     <ul class="toc">
67       <li><a name="toc-Options-1" href="#Options-1">6.1.1 Options</a></li>
68     </ul>
69 </li>
70   </ul></li>
71   <li><a name="toc-Demuxers" href="#Demuxers">7. Demuxers</a>
72   <ul class="toc">
73     <li><a name="toc-image2-1" href="#image2-1">7.1 image2</a></li>
74     <li><a name="toc-applehttp" href="#applehttp">7.2 applehttp</a></li>
75   </ul></li>
76   <li><a name="toc-Muxers" href="#Muxers">8. Muxers</a>
77   <ul class="toc">
78     <li><a name="toc-crc-1" href="#crc-1">8.1 crc</a></li>
79     <li><a name="toc-framecrc-1" href="#framecrc-1">8.2 framecrc</a></li>
80     <li><a name="toc-image2" href="#image2">8.3 image2</a></li>
81     <li><a name="toc-mpegts" href="#mpegts">8.4 mpegts</a></li>
82     <li><a name="toc-null" href="#null">8.5 null</a></li>
83     <li><a name="toc-matroska" href="#matroska">8.6 matroska</a></li>
84   </ul></li>
85   <li><a name="toc-Input-Devices" href="#Input-Devices">9. Input Devices</a>
86   <ul class="toc">
87     <li><a name="toc-alsa-1" href="#alsa-1">9.1 alsa</a></li>
88     <li><a name="toc-bktr" href="#bktr">9.2 bktr</a></li>
89     <li><a name="toc-dv1394" href="#dv1394">9.3 dv1394</a></li>
90     <li><a name="toc-fbdev" href="#fbdev">9.4 fbdev</a></li>
91     <li><a name="toc-jack" href="#jack">9.5 jack</a></li>
92     <li><a name="toc-libdc1394" href="#libdc1394">9.6 libdc1394</a></li>
93     <li><a name="toc-openal" href="#openal">9.7 openal</a>
94     <ul class="toc">
95       <li><a name="toc-Options" href="#Options">9.7.1 Options</a></li>
96       <li><a name="toc-Examples" href="#Examples">9.7.2 Examples</a></li>
97     </ul></li>
98     <li><a name="toc-oss" href="#oss">9.8 oss</a></li>
99     <li><a name="toc-sndio-1" href="#sndio-1">9.9 sndio</a></li>
100     <li><a name="toc-video4linux-and-video4linux2" href="#video4linux-and-video4linux2">9.10 video4linux and video4linux2</a></li>
101     <li><a name="toc-vfwcap" href="#vfwcap">9.11 vfwcap</a></li>
102     <li><a name="toc-x11grab" href="#x11grab">9.12 x11grab</a></li>
103   </ul></li>
104   <li><a name="toc-Output-Devices" href="#Output-Devices">10. Output Devices</a>
105   <ul class="toc">
106     <li><a name="toc-alsa" href="#alsa">10.1 alsa</a></li>
107     <li><a name="toc-oss-1" href="#oss-1">10.2 oss</a></li>
108     <li><a name="toc-sdl" href="#sdl">10.3 sdl</a>
109     <ul class="toc">
110       <li><a name="toc-Options-2" href="#Options-2">10.3.1 Options</a></li>
111       <li><a name="toc-Examples-1" href="#Examples-1">10.3.2 Examples</a></li>
112     </ul></li>
113     <li><a name="toc-sndio" href="#sndio">10.4 sndio</a></li>
114   </ul></li>
115   <li><a name="toc-Protocols" href="#Protocols">11. Protocols</a>
116   <ul class="toc">
117     <li><a name="toc-applehttp-1" href="#applehttp-1">11.1 applehttp</a></li>
118     <li><a name="toc-concat" href="#concat">11.2 concat</a></li>
119     <li><a name="toc-file" href="#file">11.3 file</a></li>
120     <li><a name="toc-gopher" href="#gopher">11.4 gopher</a></li>
121     <li><a name="toc-http" href="#http">11.5 http</a></li>
122     <li><a name="toc-mmst" href="#mmst">11.6 mmst</a></li>
123     <li><a name="toc-mmsh" href="#mmsh">11.7 mmsh</a></li>
124     <li><a name="toc-md5" href="#md5">11.8 md5</a></li>
125     <li><a name="toc-pipe" href="#pipe">11.9 pipe</a></li>
126     <li><a name="toc-rtmp" href="#rtmp">11.10 rtmp</a></li>
127     <li><a name="toc-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte" href="#rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">11.11 rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></li>
128     <li><a name="toc-rtp" href="#rtp">11.12 rtp</a></li>
129     <li><a name="toc-rtsp" href="#rtsp">11.13 rtsp</a></li>
130     <li><a name="toc-sap" href="#sap">11.14 sap</a>
131     <ul class="toc">
132       <li><a name="toc-Muxer" href="#Muxer">11.14.1 Muxer</a></li>
133       <li><a name="toc-Demuxer" href="#Demuxer">11.14.2 Demuxer</a></li>
134     </ul></li>
135     <li><a name="toc-tcp" href="#tcp">11.15 tcp</a></li>
136     <li><a name="toc-udp" href="#udp">11.16 udp</a></li>
137   </ul></li>
138   <li><a name="toc-Filtergraph-description" href="#Filtergraph-description">12. Filtergraph description</a>
139   <ul class="toc">
140     <li><a name="toc-Filtergraph-syntax" href="#Filtergraph-syntax">12.1 Filtergraph syntax</a></li>
141   </ul></li>
142   <li><a name="toc-Audio-Filters" href="#Audio-Filters">13. Audio Filters</a>
143   <ul class="toc">
144     <li><a name="toc-anull" href="#anull">13.1 anull</a></li>
145   </ul></li>
146   <li><a name="toc-Audio-Sources" href="#Audio-Sources">14. Audio Sources</a>
147   <ul class="toc">
148     <li><a name="toc-anullsrc" href="#anullsrc">14.1 anullsrc</a></li>
149   </ul></li>
150   <li><a name="toc-Audio-Sinks" href="#Audio-Sinks">15. Audio Sinks</a>
151   <ul class="toc">
152     <li><a name="toc-anullsink" href="#anullsink">15.1 anullsink</a></li>
153   </ul></li>
154   <li><a name="toc-Video-Filters" href="#Video-Filters">16. Video Filters</a>
155   <ul class="toc">
156     <li><a name="toc-blackframe" href="#blackframe">16.1 blackframe</a></li>
157     <li><a name="toc-boxblur" href="#boxblur">16.2 boxblur</a></li>
158     <li><a name="toc-copy" href="#copy">16.3 copy</a></li>
159     <li><a name="toc-crop" href="#crop">16.4 crop</a></li>
160     <li><a name="toc-cropdetect" href="#cropdetect">16.5 cropdetect</a></li>
161     <li><a name="toc-drawbox" href="#drawbox">16.6 drawbox</a></li>
162     <li><a name="toc-drawtext" href="#drawtext">16.7 drawtext</a></li>
163     <li><a name="toc-fade" href="#fade">16.8 fade</a></li>
164     <li><a name="toc-fieldorder" href="#fieldorder">16.9 fieldorder</a></li>
165     <li><a name="toc-fifo" href="#fifo">16.10 fifo</a></li>
166     <li><a name="toc-format" href="#format">16.11 format</a></li>
167     <li><a name="toc-frei0r-1" href="#frei0r-1">16.12 frei0r</a></li>
168     <li><a name="toc-gradfun" href="#gradfun">16.13 gradfun</a></li>
169     <li><a name="toc-hflip" href="#hflip">16.14 hflip</a></li>
170     <li><a name="toc-hqdn3d" href="#hqdn3d">16.15 hqdn3d</a></li>
171     <li><a name="toc-lut_002c-lutrgb_002c-lutyuv" href="#lut_002c-lutrgb_002c-lutyuv">16.16 lut, lutrgb, lutyuv</a></li>
172     <li><a name="toc-mp" href="#mp">16.17 mp</a></li>
173     <li><a name="toc-negate" href="#negate">16.18 negate</a></li>
174     <li><a name="toc-noformat" href="#noformat">16.19 noformat</a></li>
175     <li><a name="toc-null-1" href="#null-1">16.20 null</a></li>
176     <li><a name="toc-ocv" href="#ocv">16.21 ocv</a>
177     <ul class="toc">
178       <li><a name="toc-dilate-1" href="#dilate-1">16.21.1 dilate</a></li>
179       <li><a name="toc-erode" href="#erode">16.21.2 erode</a></li>
180       <li><a name="toc-smooth" href="#smooth">16.21.3 smooth</a></li>
181     </ul></li>
182     <li><a name="toc-overlay" href="#overlay">16.22 overlay</a></li>
183     <li><a name="toc-pad" href="#pad">16.23 pad</a></li>
184     <li><a name="toc-pixdesctest" href="#pixdesctest">16.24 pixdesctest</a></li>
185     <li><a name="toc-scale" href="#scale">16.25 scale</a></li>
186     <li><a name="toc-select" href="#select">16.26 select</a></li>
187     <li><a name="toc-setdar-1" href="#setdar-1">16.27 setdar</a></li>
188     <li><a name="toc-setpts" href="#setpts">16.28 setpts</a></li>
189     <li><a name="toc-setsar-1" href="#setsar-1">16.29 setsar</a></li>
190     <li><a name="toc-settb" href="#settb">16.30 settb</a></li>
191     <li><a name="toc-showinfo" href="#showinfo">16.31 showinfo</a></li>
192     <li><a name="toc-slicify" href="#slicify">16.32 slicify</a></li>
193     <li><a name="toc-split" href="#split">16.33 split</a></li>
194     <li><a name="toc-transpose" href="#transpose">16.34 transpose</a></li>
195     <li><a name="toc-unsharp" href="#unsharp">16.35 unsharp</a></li>
196     <li><a name="toc-vflip" href="#vflip">16.36 vflip</a></li>
197     <li><a name="toc-yadif" href="#yadif">16.37 yadif</a></li>
198   </ul></li>
199   <li><a name="toc-Video-Sources" href="#Video-Sources">17. Video Sources</a>
200   <ul class="toc">
201     <li><a name="toc-buffer" href="#buffer">17.1 buffer</a></li>
202     <li><a name="toc-color" href="#color">17.2 color</a></li>
203     <li><a name="toc-movie" href="#movie">17.3 movie</a></li>
204     <li><a name="toc-nullsrc" href="#nullsrc">17.4 nullsrc</a></li>
205     <li><a name="toc-frei0r_005fsrc" href="#frei0r_005fsrc">17.5 frei0r_src</a></li>
206     <li><a name="toc-rgbtestsrc_002c-testsrc" href="#rgbtestsrc_002c-testsrc">17.6 rgbtestsrc, testsrc</a></li>
207   </ul></li>
208   <li><a name="toc-Video-Sinks" href="#Video-Sinks">18. Video Sinks</a>
209   <ul class="toc">
210     <li><a name="toc-buffersink" href="#buffersink">18.1 buffersink</a></li>
211     <li><a name="toc-nullsink" href="#nullsink">18.2 nullsink</a></li>
212   </ul>
213 </li>
214 </ul>
215 </div>
216
217 <hr size="1">
218 <a name="Synopsis"></a>
219 <h1 class="chapter"><a href="ffplay.html#toc-Synopsis">1. Synopsis</a></h1>
220
221 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay [options] [&lsquo;<tt>input_file</tt>&rsquo;]
222 </pre></td></tr></table>
223
224 <a name="Description"></a>
225 <h1 class="chapter"><a href="ffplay.html#toc-Description">2. Description</a></h1>
226
227 <p>FFplay is a very simple and portable media player using the FFmpeg
228 libraries and the SDL library. It is mostly used as a testbed for the
229 various FFmpeg APIs.
230 </p>
231 <a name="Options-3"></a>
232 <h1 class="chapter"><a href="ffplay.html#toc-Options-3">3. Options</a></h1>
233
234 <p>All the numerical options, if not specified otherwise, accept in input
235 a string representing a number, which may contain one of the
236 International System number postfixes, for example &rsquo;K&rsquo;, &rsquo;M&rsquo;, &rsquo;G&rsquo;.
237 If &rsquo;i&rsquo; is appended after the postfix, powers of 2 are used instead of
238 powers of 10. The &rsquo;B&rsquo; postfix multiplies the value for 8, and can be
239 appended after another postfix or used alone. This allows using for
240 example &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;, &rsquo;G&rsquo; and &rsquo;B&rsquo; as postfix.
241 </p>
242 <p>Options which do not take arguments are boolean options, and set the
243 corresponding value to true. They can be set to false by prefixing
244 with &quot;no&quot; the option name, for example using &quot;-nofoo&quot; in the
245 commandline will set to false the boolean option with name &quot;foo&quot;.
246 </p>
247 <a name="Generic-options"></a>
248 <h2 class="section"><a href="ffplay.html#toc-Generic-options">3.1 Generic options</a></h2>
249
250 <p>These options are shared amongst the ff* tools.
251 </p>
252 <dl compact="compact">
253 <dt> &lsquo;<samp>-L</samp>&rsquo;</dt>
254 <dd><p>Show license.
255 </p>
256 </dd>
257 <dt> &lsquo;<samp>-h, -?, -help, --help</samp>&rsquo;</dt>
258 <dd><p>Show help.
259 </p>
260 </dd>
261 <dt> &lsquo;<samp>-version</samp>&rsquo;</dt>
262 <dd><p>Show version.
263 </p>
264 </dd>
265 <dt> &lsquo;<samp>-formats</samp>&rsquo;</dt>
266 <dd><p>Show available formats.
267 </p>
268 <p>The fields preceding the format names have the following meanings:
269 </p><dl compact="compact">
270 <dt> &lsquo;<samp>D</samp>&rsquo;</dt>
271 <dd><p>Decoding available
272 </p></dd>
273 <dt> &lsquo;<samp>E</samp>&rsquo;</dt>
274 <dd><p>Encoding available
275 </p></dd>
276 </dl>
277
278 </dd>
279 <dt> &lsquo;<samp>-codecs</samp>&rsquo;</dt>
280 <dd><p>Show available codecs.
281 </p>
282 <p>The fields preceding the codec names have the following meanings:
283 </p><dl compact="compact">
284 <dt> &lsquo;<samp>D</samp>&rsquo;</dt>
285 <dd><p>Decoding available
286 </p></dd>
287 <dt> &lsquo;<samp>E</samp>&rsquo;</dt>
288 <dd><p>Encoding available
289 </p></dd>
290 <dt> &lsquo;<samp>V/A/S</samp>&rsquo;</dt>
291 <dd><p>Video/audio/subtitle codec
292 </p></dd>
293 <dt> &lsquo;<samp>S</samp>&rsquo;</dt>
294 <dd><p>Codec supports slices
295 </p></dd>
296 <dt> &lsquo;<samp>D</samp>&rsquo;</dt>
297 <dd><p>Codec supports direct rendering
298 </p></dd>
299 <dt> &lsquo;<samp>T</samp>&rsquo;</dt>
300 <dd><p>Codec can handle input truncated at random locations instead of only at frame boundaries
301 </p></dd>
302 </dl>
303
304 </dd>
305 <dt> &lsquo;<samp>-bsfs</samp>&rsquo;</dt>
306 <dd><p>Show available bitstream filters.
307 </p>
308 </dd>
309 <dt> &lsquo;<samp>-protocols</samp>&rsquo;</dt>
310 <dd><p>Show available protocols.
311 </p>
312 </dd>
313 <dt> &lsquo;<samp>-filters</samp>&rsquo;</dt>
314 <dd><p>Show available libavfilter filters.
315 </p>
316 </dd>
317 <dt> &lsquo;<samp>-pix_fmts</samp>&rsquo;</dt>
318 <dd><p>Show available pixel formats.
319 </p>
320 </dd>
321 <dt> &lsquo;<samp>-loglevel <var>loglevel</var></samp>&rsquo;</dt>
322 <dd><p>Set the logging level used by the library.
323 <var>loglevel</var> is a number or a string containing one of the following values:
324 </p><dl compact="compact">
325 <dt> &lsquo;<samp>quiet</samp>&rsquo;</dt>
326 <dt> &lsquo;<samp>panic</samp>&rsquo;</dt>
327 <dt> &lsquo;<samp>fatal</samp>&rsquo;</dt>
328 <dt> &lsquo;<samp>error</samp>&rsquo;</dt>
329 <dt> &lsquo;<samp>warning</samp>&rsquo;</dt>
330 <dt> &lsquo;<samp>info</samp>&rsquo;</dt>
331 <dt> &lsquo;<samp>verbose</samp>&rsquo;</dt>
332 <dt> &lsquo;<samp>debug</samp>&rsquo;</dt>
333 </dl>
334
335 <p>By default the program logs to stderr, if coloring is supported by the
336 terminal, colors are used to mark errors and warnings. Log coloring
337 can be disabled setting the environment variable
338 <code>FFMPEG_FORCE_NOCOLOR</code> or <code>NO_COLOR</code>, or can be forced setting
339 the environment variable <code>FFMPEG_FORCE_COLOR</code>.
340 The use of the environment variable <code>NO_COLOR</code> is deprecated and
341 will be dropped in a following FFmpeg version.
342 </p>
343 </dd>
344 </dl>
345
346 <a name="Main-options"></a>
347 <h2 class="section"><a href="ffplay.html#toc-Main-options">3.2 Main options</a></h2>
348
349 <dl compact="compact">
350 <dt> &lsquo;<samp>-x <var>width</var></samp>&rsquo;</dt>
351 <dd><p>Force displayed width.
352 </p></dd>
353 <dt> &lsquo;<samp>-y <var>height</var></samp>&rsquo;</dt>
354 <dd><p>Force displayed height.
355 </p></dd>
356 <dt> &lsquo;<samp>-s <var>size</var></samp>&rsquo;</dt>
357 <dd><p>This option has been removed. Use private format options for specifying the
358 input video size.
359 </p></dd>
360 <dt> &lsquo;<samp>-an</samp>&rsquo;</dt>
361 <dd><p>Disable audio.
362 </p></dd>
363 <dt> &lsquo;<samp>-vn</samp>&rsquo;</dt>
364 <dd><p>Disable video.
365 </p></dd>
366 <dt> &lsquo;<samp>-ss <var>pos</var></samp>&rsquo;</dt>
367 <dd><p>Seek to a given position in seconds.
368 </p></dd>
369 <dt> &lsquo;<samp>-t <var>duration</var></samp>&rsquo;</dt>
370 <dd><p>play &lt;duration&gt; seconds of audio/video
371 </p></dd>
372 <dt> &lsquo;<samp>-bytes</samp>&rsquo;</dt>
373 <dd><p>Seek by bytes.
374 </p></dd>
375 <dt> &lsquo;<samp>-nodisp</samp>&rsquo;</dt>
376 <dd><p>Disable graphical display.
377 </p></dd>
378 <dt> &lsquo;<samp>-f <var>fmt</var></samp>&rsquo;</dt>
379 <dd><p>Force format.
380 </p></dd>
381 <dt> &lsquo;<samp>-window_title <var>title</var></samp>&rsquo;</dt>
382 <dd><p>Set window title (default is the input filename).
383 </p></dd>
384 <dt> &lsquo;<samp>-loop <var>number</var></samp>&rsquo;</dt>
385 <dd><p>Loops movie playback &lt;number&gt; times. 0 means forever.
386 </p></dd>
387 <dt> &lsquo;<samp>-showmode <var>mode</var></samp>&rsquo;</dt>
388 <dd><p>Set the show mode to use.
389 Available values for <var>mode</var> are:
390 </p><dl compact="compact">
391 <dt> &lsquo;<samp>0, video</samp>&rsquo;</dt>
392 <dd><p>show video
393 </p></dd>
394 <dt> &lsquo;<samp>1, waves</samp>&rsquo;</dt>
395 <dd><p>show audio waves
396 </p></dd>
397 <dt> &lsquo;<samp>2, rdft</samp>&rsquo;</dt>
398 <dd><p>show audio frequency band using RDFT ((Inverse) Real Discrete Fourier Transform)
399 </p></dd>
400 </dl>
401
402 <p>Default value is &quot;video&quot;, if video is not present or cannot be played
403 &quot;rdft&quot; is automatically selected.
404 </p>
405 <p>You can interactively cycle through the available show modes by
406 pressing the key &lt;w&gt;.
407 </p>
408 </dd>
409 <dt> &lsquo;<samp>-vf <var>filter_graph</var></samp>&rsquo;</dt>
410 <dd><p><var>filter_graph</var> is a description of the filter graph to apply to
411 the input video.
412 Use the option &quot;-filters&quot; to show all the available filters (including
413 also sources and sinks).
414 </p>
415 </dd>
416 <dt> &lsquo;<samp>-i <var>input_file</var></samp>&rsquo;</dt>
417 <dd><p>Read <var>input_file</var>.
418 </p></dd>
419 </dl>
420
421 <a name="Advanced-options"></a>
422 <h2 class="section"><a href="ffplay.html#toc-Advanced-options">3.3 Advanced options</a></h2>
423 <dl compact="compact">
424 <dt> &lsquo;<samp>-pix_fmt <var>format</var></samp>&rsquo;</dt>
425 <dd><p>This option has been removed. Use private options for specifying the
426 input pixel format.
427 </p></dd>
428 <dt> &lsquo;<samp>-stats</samp>&rsquo;</dt>
429 <dd><p>Show the stream duration, the codec parameters, the current position in
430 the stream and the audio/video synchronisation drift.
431 </p></dd>
432 <dt> &lsquo;<samp>-bug</samp>&rsquo;</dt>
433 <dd><p>Work around bugs.
434 </p></dd>
435 <dt> &lsquo;<samp>-fast</samp>&rsquo;</dt>
436 <dd><p>Non-spec-compliant optimizations.
437 </p></dd>
438 <dt> &lsquo;<samp>-genpts</samp>&rsquo;</dt>
439 <dd><p>Generate pts.
440 </p></dd>
441 <dt> &lsquo;<samp>-rtp_tcp</samp>&rsquo;</dt>
442 <dd><p>Force RTP/TCP protocol usage instead of RTP/UDP. It is only meaningful
443 if you are streaming with the RTSP protocol.
444 </p></dd>
445 <dt> &lsquo;<samp>-sync <var>type</var></samp>&rsquo;</dt>
446 <dd><p>Set the master clock to audio (<code>type=audio</code>), video
447 (<code>type=video</code>) or external (<code>type=ext</code>). Default is audio. The
448 master clock is used to control audio-video synchronization. Most media
449 players use audio as master clock, but in some cases (streaming or high
450 quality broadcast) it is necessary to change that. This option is mainly
451 used for debugging purposes.
452 </p></dd>
453 <dt> &lsquo;<samp>-threads <var>count</var></samp>&rsquo;</dt>
454 <dd><p>Set the thread count.
455 </p></dd>
456 <dt> &lsquo;<samp>-ast <var>audio_stream_number</var></samp>&rsquo;</dt>
457 <dd><p>Select the desired audio stream number, counting from 0. The number
458 refers to the list of all the input audio streams. If it is greater
459 than the number of audio streams minus one, then the last one is
460 selected, if it is negative the audio playback is disabled.
461 </p></dd>
462 <dt> &lsquo;<samp>-vst <var>video_stream_number</var></samp>&rsquo;</dt>
463 <dd><p>Select the desired video stream number, counting from 0. The number
464 refers to the list of all the input video streams. If it is greater
465 than the number of video streams minus one, then the last one is
466 selected, if it is negative the video playback is disabled.
467 </p></dd>
468 <dt> &lsquo;<samp>-sst <var>subtitle_stream_number</var></samp>&rsquo;</dt>
469 <dd><p>Select the desired subtitle stream number, counting from 0. The number
470 refers to the list of all the input subtitle streams. If it is greater
471 than the number of subtitle streams minus one, then the last one is
472 selected, if it is negative the subtitle rendering is disabled.
473 </p></dd>
474 <dt> &lsquo;<samp>-autoexit</samp>&rsquo;</dt>
475 <dd><p>Exit when video is done playing.
476 </p></dd>
477 <dt> &lsquo;<samp>-exitonkeydown</samp>&rsquo;</dt>
478 <dd><p>Exit if any key is pressed.
479 </p></dd>
480 <dt> &lsquo;<samp>-exitonmousedown</samp>&rsquo;</dt>
481 <dd><p>Exit if any mouse button is pressed.
482 </p></dd>
483 </dl>
484
485 <a name="While-playing"></a>
486 <h2 class="section"><a href="ffplay.html#toc-While-playing">3.4 While playing</a></h2>
487
488 <dl compact="compact">
489 <dt> &lt;q, ESC&gt;</dt>
490 <dd><p>Quit.
491 </p>
492 </dd>
493 <dt> &lt;f&gt;</dt>
494 <dd><p>Toggle full screen.
495 </p>
496 </dd>
497 <dt> &lt;p, SPC&gt;</dt>
498 <dd><p>Pause.
499 </p>
500 </dd>
501 <dt> &lt;a&gt;</dt>
502 <dd><p>Cycle audio channel.
503 </p>
504 </dd>
505 <dt> &lt;v&gt;</dt>
506 <dd><p>Cycle video channel.
507 </p>
508 </dd>
509 <dt> &lt;t&gt;</dt>
510 <dd><p>Cycle subtitle channel.
511 </p>
512 </dd>
513 <dt> &lt;w&gt;</dt>
514 <dd><p>Show audio waves.
515 </p>
516 </dd>
517 <dt> &lt;left/right&gt;</dt>
518 <dd><p>Seek backward/forward 10 seconds.
519 </p>
520 </dd>
521 <dt> &lt;down/up&gt;</dt>
522 <dd><p>Seek backward/forward 1 minute.
523 </p>
524 </dd>
525 <dt> &lt;mouse click&gt;</dt>
526 <dd><p>Seek to percentage in file corresponding to fraction of width.
527 </p>
528 </dd>
529 </dl>
530
531
532 <a name="Expression-Evaluation"></a>
533 <h1 class="chapter"><a href="ffplay.html#toc-Expression-Evaluation">4. Expression Evaluation</a></h1>
534
535 <p>When evaluating an arithemetic expression, FFmpeg uses an internal
536 formula evaluator, implemented through the &lsquo;<tt>libavutil/eval.h</tt>&rsquo;
537 interface.
538 </p>
539 <p>An expression may contain unary, binary operators, constants, and
540 functions.
541 </p>
542 <p>Two expressions <var>expr1</var> and <var>expr2</var> can be combined to form
543 another expression &quot;<var>expr1</var>;<var>expr2</var>&quot;.
544 <var>expr1</var> and <var>expr2</var> are evaluated in turn, and the new
545 expression evaluates to the value of <var>expr2</var>.
546 </p>
547 <p>The following binary operators are available: <code>+</code>, <code>-</code>,
548 <code>*</code>, <code>/</code>, <code>^</code>.
549 </p>
550 <p>The following unary operators are available: <code>+</code>, <code>-</code>.
551 </p>
552 <p>The following functions are available:
553 </p><dl compact="compact">
554 <dt> &lsquo;<samp>sinh(x)</samp>&rsquo;</dt>
555 <dt> &lsquo;<samp>cosh(x)</samp>&rsquo;</dt>
556 <dt> &lsquo;<samp>tanh(x)</samp>&rsquo;</dt>
557 <dt> &lsquo;<samp>sin(x)</samp>&rsquo;</dt>
558 <dt> &lsquo;<samp>cos(x)</samp>&rsquo;</dt>
559 <dt> &lsquo;<samp>tan(x)</samp>&rsquo;</dt>
560 <dt> &lsquo;<samp>atan(x)</samp>&rsquo;</dt>
561 <dt> &lsquo;<samp>asin(x)</samp>&rsquo;</dt>
562 <dt> &lsquo;<samp>acos(x)</samp>&rsquo;</dt>
563 <dt> &lsquo;<samp>exp(x)</samp>&rsquo;</dt>
564 <dt> &lsquo;<samp>log(x)</samp>&rsquo;</dt>
565 <dt> &lsquo;<samp>abs(x)</samp>&rsquo;</dt>
566 <dt> &lsquo;<samp>squish(x)</samp>&rsquo;</dt>
567 <dt> &lsquo;<samp>gauss(x)</samp>&rsquo;</dt>
568 <dt> &lsquo;<samp>isnan(x)</samp>&rsquo;</dt>
569 <dd><p>Return 1.0 if <var>x</var> is NAN, 0.0 otherwise.
570 </p>
571 </dd>
572 <dt> &lsquo;<samp>mod(x, y)</samp>&rsquo;</dt>
573 <dt> &lsquo;<samp>max(x, y)</samp>&rsquo;</dt>
574 <dt> &lsquo;<samp>min(x, y)</samp>&rsquo;</dt>
575 <dt> &lsquo;<samp>eq(x, y)</samp>&rsquo;</dt>
576 <dt> &lsquo;<samp>gte(x, y)</samp>&rsquo;</dt>
577 <dt> &lsquo;<samp>gt(x, y)</samp>&rsquo;</dt>
578 <dt> &lsquo;<samp>lte(x, y)</samp>&rsquo;</dt>
579 <dt> &lsquo;<samp>lt(x, y)</samp>&rsquo;</dt>
580 <dt> &lsquo;<samp>st(var, expr)</samp>&rsquo;</dt>
581 <dd><p>Allow to store the value of the expression <var>expr</var> in an internal
582 variable. <var>var</var> specifies the number of the variable where to
583 store the value, and it is a value ranging from 0 to 9. The function
584 returns the value stored in the internal variable.
585 </p>
586 </dd>
587 <dt> &lsquo;<samp>ld(var)</samp>&rsquo;</dt>
588 <dd><p>Allow to load the value of the internal variable with number
589 <var>var</var>, which was previosly stored with st(<var>var</var>, <var>expr</var>).
590 The function returns the loaded value.
591 </p>
592 </dd>
593 <dt> &lsquo;<samp>while(cond, expr)</samp>&rsquo;</dt>
594 <dd><p>Evaluate expression <var>expr</var> while the expression <var>cond</var> is
595 non-zero, and returns the value of the last <var>expr</var> evaluation, or
596 NAN if <var>cond</var> was always false.
597 </p>
598 </dd>
599 <dt> &lsquo;<samp>ceil(expr)</samp>&rsquo;</dt>
600 <dd><p>Round the value of expression <var>expr</var> upwards to the nearest
601 integer. For example, &quot;ceil(1.5)&quot; is &quot;2.0&quot;.
602 </p>
603 </dd>
604 <dt> &lsquo;<samp>floor(expr)</samp>&rsquo;</dt>
605 <dd><p>Round the value of expression <var>expr</var> downwards to the nearest
606 integer. For example, &quot;floor(-1.5)&quot; is &quot;-2.0&quot;.
607 </p>
608 </dd>
609 <dt> &lsquo;<samp>trunc(expr)</samp>&rsquo;</dt>
610 <dd><p>Round the value of expression <var>expr</var> towards zero to the nearest
611 integer. For example, &quot;trunc(-1.5)&quot; is &quot;-1.0&quot;.
612 </p>
613 </dd>
614 <dt> &lsquo;<samp>sqrt(expr)</samp>&rsquo;</dt>
615 <dd><p>Compute the square root of <var>expr</var>. This is equivalent to
616 &quot;(<var>expr</var>)^.5&quot;.
617 </p>
618 </dd>
619 <dt> &lsquo;<samp>not(expr)</samp>&rsquo;</dt>
620 <dd><p>Return 1.0 if <var>expr</var> is zero, 0.0 otherwise.
621 </p>
622 </dd>
623 <dt> &lsquo;<samp>pow(x, y)</samp>&rsquo;</dt>
624 <dd><p>Compute the power of <var>x</var> elevated <var>y</var>, it is equivalent to
625 &quot;(<var>x</var>)^(<var>y</var>)&quot;.
626 </p></dd>
627 </dl>
628
629 <p>Note that:
630 </p>
631 <p><code>*</code> works like AND
632 </p>
633 <p><code>+</code> works like OR
634 </p>
635 <p>thus
636 </p><table><tr><td>&nbsp;</td><td><pre class="example">if A then B else C
637 </pre></td></tr></table>
638 <p>is equivalent to
639 </p><table><tr><td>&nbsp;</td><td><pre class="example">A*B + not(A)*C
640 </pre></td></tr></table>
641
642 <p>In your C code, you can extend the list of unary and binary functions,
643 and define recognized constants, so that they are available for your
644 expressions.
645 </p>
646 <p>The evaluator also recognizes the International System number
647 postfixes. If &rsquo;i&rsquo; is appended after the postfix, powers of 2 are used
648 instead of powers of 10. The &rsquo;B&rsquo; postfix multiplies the value for 8,
649 and can be appended after another postfix or used alone. This allows
650 using for example &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;, &rsquo;G&rsquo; and &rsquo;B&rsquo; as postfix.
651 </p>
652 <p>Follows the list of available International System postfixes, with
653 indication of the corresponding powers of 10 and of 2.
654 </p><dl compact="compact">
655 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
656 <dd><p>-24 / -80
657 </p></dd>
658 <dt> &lsquo;<samp>z</samp>&rsquo;</dt>
659 <dd><p>-21 / -70
660 </p></dd>
661 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
662 <dd><p>-18 / -60
663 </p></dd>
664 <dt> &lsquo;<samp>f</samp>&rsquo;</dt>
665 <dd><p>-15 / -50
666 </p></dd>
667 <dt> &lsquo;<samp>p</samp>&rsquo;</dt>
668 <dd><p>-12 / -40
669 </p></dd>
670 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
671 <dd><p>-9 / -30
672 </p></dd>
673 <dt> &lsquo;<samp>u</samp>&rsquo;</dt>
674 <dd><p>-6 / -20
675 </p></dd>
676 <dt> &lsquo;<samp>m</samp>&rsquo;</dt>
677 <dd><p>-3 / -10
678 </p></dd>
679 <dt> &lsquo;<samp>c</samp>&rsquo;</dt>
680 <dd><p>-2
681 </p></dd>
682 <dt> &lsquo;<samp>d</samp>&rsquo;</dt>
683 <dd><p>-1
684 </p></dd>
685 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
686 <dd><p>2
687 </p></dd>
688 <dt> &lsquo;<samp>k</samp>&rsquo;</dt>
689 <dd><p>3 / 10
690 </p></dd>
691 <dt> &lsquo;<samp>K</samp>&rsquo;</dt>
692 <dd><p>3 / 10
693 </p></dd>
694 <dt> &lsquo;<samp>M</samp>&rsquo;</dt>
695 <dd><p>6 / 20
696 </p></dd>
697 <dt> &lsquo;<samp>G</samp>&rsquo;</dt>
698 <dd><p>9 / 30
699 </p></dd>
700 <dt> &lsquo;<samp>T</samp>&rsquo;</dt>
701 <dd><p>12 / 40
702 </p></dd>
703 <dt> &lsquo;<samp>P</samp>&rsquo;</dt>
704 <dd><p>15 / 40
705 </p></dd>
706 <dt> &lsquo;<samp>E</samp>&rsquo;</dt>
707 <dd><p>18 / 50
708 </p></dd>
709 <dt> &lsquo;<samp>Z</samp>&rsquo;</dt>
710 <dd><p>21 / 60
711 </p></dd>
712 <dt> &lsquo;<samp>Y</samp>&rsquo;</dt>
713 <dd><p>24 / 70
714 </p></dd>
715 </dl>
716
717 <a name="Decoders"></a>
718 <h1 class="chapter"><a href="ffplay.html#toc-Decoders">5. Decoders</a></h1>
719
720 <p>Decoders are configured elements in FFmpeg which allow the decoding of
721 multimedia streams.
722 </p>
723 <p>When you configure your FFmpeg build, all the supported native decoders
724 are enabled by default. Decoders requiring an external library must be enabled
725 manually via the corresponding <code>--enable-lib</code> option. You can list all
726 available decoders using the configure option <code>--list-decoders</code>.
727 </p>
728 <p>You can disable all the decoders with the configure option
729 <code>--disable-decoders</code> and selectively enable / disable single decoders
730 with the options <code>--enable-decoder=<var>DECODER</var></code> /
731 <code>--disable-decoder=<var>DECODER</var></code>.
732 </p>
733 <p>The option <code>-codecs</code> of the ff* tools will display the list of
734 enabled decoders.
735 </p>
736
737 <a name="Video-Decoders"></a>
738 <h1 class="chapter"><a href="ffplay.html#toc-Video-Decoders">6. Video Decoders</a></h1>
739
740 <p>A description of some of the currently available video decoders
741 follows.
742 </p>
743 <a name="rawvideo"></a>
744 <h2 class="section"><a href="ffplay.html#toc-rawvideo">6.1 rawvideo</a></h2>
745
746 <p>Rawvideo decoder.
747 </p>
748 <p>This decoder decodes rawvideo streams.
749 </p>
750 <a name="Options-1"></a>
751 <h3 class="subsection"><a href="ffplay.html#toc-Options-1">6.1.1 Options</a></h3>
752
753 <dl compact="compact">
754 <dt> &lsquo;<samp>top <var>top_field_first</var></samp>&rsquo;</dt>
755 <dd><p>Specify the assumed field type of the input video.
756 </p><dl compact="compact">
757 <dt> &lsquo;<samp>-1</samp>&rsquo;</dt>
758 <dd><p>the video is assumed to be progressive (default)
759 </p></dd>
760 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
761 <dd><p>bottom-field-first is assumed
762 </p></dd>
763 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
764 <dd><p>top-field-first is assumed
765 </p></dd>
766 </dl>
767
768 </dd>
769 </dl>
770
771 <a name="Demuxers"></a>
772 <h1 class="chapter"><a href="ffplay.html#toc-Demuxers">7. Demuxers</a></h1>
773
774 <p>Demuxers are configured elements in FFmpeg which allow to read the
775 multimedia streams from a particular type of file.
776 </p>
777 <p>When you configure your FFmpeg build, all the supported demuxers
778 are enabled by default. You can list all available ones using the
779 configure option &quot;&ndash;list-demuxers&quot;.
780 </p>
781 <p>You can disable all the demuxers using the configure option
782 &quot;&ndash;disable-demuxers&quot;, and selectively enable a single demuxer with
783 the option &quot;&ndash;enable-demuxer=<var>DEMUXER</var>&quot;, or disable it
784 with the option &quot;&ndash;disable-demuxer=<var>DEMUXER</var>&quot;.
785 </p>
786 <p>The option &quot;-formats&quot; of the ff* tools will display the list of
787 enabled demuxers.
788 </p>
789 <p>The description of some of the currently available demuxers follows.
790 </p>
791 <a name="image2-1"></a>
792 <h2 class="section"><a href="ffplay.html#toc-image2-1">7.1 image2</a></h2>
793
794 <p>Image file demuxer.
795 </p>
796 <p>This demuxer reads from a list of image files specified by a pattern.
797 </p>
798 <p>The pattern may contain the string &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, which
799 specifies the position of the characters representing a sequential
800 number in each filename matched by the pattern. If the form
801 &quot;%d0<var>N</var>d&quot; is used, the string representing the number in each
802 filename is 0-padded and <var>N</var> is the total number of 0-padded
803 digits representing the number. The literal character &rsquo;%&rsquo; can be
804 specified in the pattern with the string &quot;%%&quot;.
805 </p>
806 <p>If the pattern contains &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, the first filename of
807 the file list specified by the pattern must contain a number
808 inclusively contained between 0 and 4, all the following numbers must
809 be sequential. This limitation may be hopefully fixed.
810 </p>
811 <p>The pattern may contain a suffix which is used to automatically
812 determine the format of the images contained in the files.
813 </p>
814 <p>For example the pattern &quot;img-%03d.bmp&quot; will match a sequence of
815 filenames of the form &lsquo;<tt>img-001.bmp</tt>&rsquo;, &lsquo;<tt>img-002.bmp</tt>&rsquo;, ...,
816 &lsquo;<tt>img-010.bmp</tt>&rsquo;, etc.; the pattern &quot;i%%m%%g-%d.jpg&quot; will match a
817 sequence of filenames of the form &lsquo;<tt>i%m%g-1.jpg</tt>&rsquo;,
818 &lsquo;<tt>i%m%g-2.jpg</tt>&rsquo;, ..., &lsquo;<tt>i%m%g-10.jpg</tt>&rsquo;, etc.
819 </p>
820 <p>The size, the pixel format, and the format of each image must be the
821 same for all the files in the sequence.
822 </p>
823 <p>The following example shows how to use &lsquo;<tt>ffmpeg</tt>&rsquo; for creating a
824 video from the images in the file sequence &lsquo;<tt>img-001.jpeg</tt>&rsquo;,
825 &lsquo;<tt>img-002.jpeg</tt>&rsquo;, ..., assuming an input framerate of 10 frames per
826 second:
827 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -r 10 -f image2 -i 'img-%03d.jpeg' out.avi
828 </pre></td></tr></table>
829
830 <p>Note that the pattern must not necessarily contain &quot;%d&quot; or
831 &quot;%0<var>N</var>d&quot;, for example to convert a single image file
832 &lsquo;<tt>img.jpeg</tt>&rsquo; you can employ the command:
833 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f image2 -i img.jpeg img.png
834 </pre></td></tr></table>
835
836 <a name="applehttp"></a>
837 <h2 class="section"><a href="ffplay.html#toc-applehttp">7.2 applehttp</a></h2>
838
839 <p>Apple HTTP Live Streaming demuxer.
840 </p>
841 <p>This demuxer presents all AVStreams from all variant streams.
842 The id field is set to the bitrate variant index number. By setting
843 the discard flags on AVStreams (by pressing &rsquo;a&rsquo; or &rsquo;v&rsquo; in ffplay),
844 the caller can decide which variant streams to actually receive.
845 The total bitrate of the variant that the stream belongs to is
846 available in a metadata key named &quot;variant_bitrate&quot;.
847 </p>
848 <a name="Muxers"></a>
849 <h1 class="chapter"><a href="ffplay.html#toc-Muxers">8. Muxers</a></h1>
850
851 <p>Muxers are configured elements in FFmpeg which allow writing
852 multimedia streams to a particular type of file.
853 </p>
854 <p>When you configure your FFmpeg build, all the supported muxers
855 are enabled by default. You can list all available muxers using the
856 configure option <code>--list-muxers</code>.
857 </p>
858 <p>You can disable all the muxers with the configure option
859 <code>--disable-muxers</code> and selectively enable / disable single muxers
860 with the options <code>--enable-muxer=<var>MUXER</var></code> /
861 <code>--disable-muxer=<var>MUXER</var></code>.
862 </p>
863 <p>The option <code>-formats</code> of the ff* tools will display the list of
864 enabled muxers.
865 </p>
866 <p>A description of some of the currently available muxers follows.
867 </p>
868 <p><a name="crc"></a>
869 </p><a name="crc-1"></a>
870 <h2 class="section"><a href="ffplay.html#toc-crc-1">8.1 crc</a></h2>
871
872 <p>CRC (Cyclic Redundancy Check) testing format.
873 </p>
874 <p>This muxer computes and prints the Adler-32 CRC of all the input audio
875 and video frames. By default audio frames are converted to signed
876 16-bit raw audio and video frames to raw video before computing the
877 CRC.
878 </p>
879 <p>The output of the muxer consists of a single line of the form:
880 CRC=0x<var>CRC</var>, where <var>CRC</var> is a hexadecimal number 0-padded to
881 8 digits containing the CRC for all the decoded input frames.
882 </p>
883 <p>For example to compute the CRC of the input, and store it in the file
884 &lsquo;<tt>out.crc</tt>&rsquo;:
885 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f crc out.crc
886 </pre></td></tr></table>
887
888 <p>You can print the CRC to stdout with the command:
889 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f crc -
890 </pre></td></tr></table>
891
892 <p>You can select the output format of each frame with &lsquo;<tt>ffmpeg</tt>&rsquo; by
893 specifying the audio and video codec and format. For example to
894 compute the CRC of the input audio converted to PCM unsigned 8-bit
895 and the input video converted to MPEG-2 video, use the command:
896 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -acodec pcm_u8 -vcodec mpeg2video -f crc -
897 </pre></td></tr></table>
898
899 <p>See also the <a href="#framecrc">framecrc</a> muxer.
900 </p>
901 <p><a name="framecrc"></a>
902 </p><a name="framecrc-1"></a>
903 <h2 class="section"><a href="ffplay.html#toc-framecrc-1">8.2 framecrc</a></h2>
904
905 <p>Per-frame CRC (Cyclic Redundancy Check) testing format.
906 </p>
907 <p>This muxer computes and prints the Adler-32 CRC for each decoded audio
908 and video frame. By default audio frames are converted to signed
909 16-bit raw audio and video frames to raw video before computing the
910 CRC.
911 </p>
912 <p>The output of the muxer consists of a line for each audio and video
913 frame of the form: <var>stream_index</var>, <var>frame_dts</var>,
914 <var>frame_size</var>, 0x<var>CRC</var>, where <var>CRC</var> is a hexadecimal
915 number 0-padded to 8 digits containing the CRC of the decoded frame.
916 </p>
917 <p>For example to compute the CRC of each decoded frame in the input, and
918 store it in the file &lsquo;<tt>out.crc</tt>&rsquo;:
919 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f framecrc out.crc
920 </pre></td></tr></table>
921
922 <p>You can print the CRC of each decoded frame to stdout with the command:
923 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f framecrc -
924 </pre></td></tr></table>
925
926 <p>You can select the output format of each frame with &lsquo;<tt>ffmpeg</tt>&rsquo; by
927 specifying the audio and video codec and format. For example, to
928 compute the CRC of each decoded input audio frame converted to PCM
929 unsigned 8-bit and of each decoded input video frame converted to
930 MPEG-2 video, use the command:
931 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -acodec pcm_u8 -vcodec mpeg2video -f framecrc -
932 </pre></td></tr></table>
933
934 <p>See also the <a href="#crc">crc</a> muxer.
935 </p>
936 <a name="image2"></a>
937 <h2 class="section"><a href="ffplay.html#toc-image2">8.3 image2</a></h2>
938
939 <p>Image file muxer.
940 </p>
941 <p>The image file muxer writes video frames to image files.
942 </p>
943 <p>The output filenames are specified by a pattern, which can be used to
944 produce sequentially numbered series of files.
945 The pattern may contain the string &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, this string
946 specifies the position of the characters representing a numbering in
947 the filenames. If the form &quot;%0<var>N</var>d&quot; is used, the string
948 representing the number in each filename is 0-padded to <var>N</var>
949 digits. The literal character &rsquo;%&rsquo; can be specified in the pattern with
950 the string &quot;%%&quot;.
951 </p>
952 <p>If the pattern contains &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, the first filename of
953 the file list specified will contain the number 1, all the following
954 numbers will be sequential.
955 </p>
956 <p>The pattern may contain a suffix which is used to automatically
957 determine the format of the image files to write.
958 </p>
959 <p>For example the pattern &quot;img-%03d.bmp&quot; will specify a sequence of
960 filenames of the form &lsquo;<tt>img-001.bmp</tt>&rsquo;, &lsquo;<tt>img-002.bmp</tt>&rsquo;, ...,
961 &lsquo;<tt>img-010.bmp</tt>&rsquo;, etc.
962 The pattern &quot;img%%-%d.jpg&quot; will specify a sequence of filenames of the
963 form &lsquo;<tt>img%-1.jpg</tt>&rsquo;, &lsquo;<tt>img%-2.jpg</tt>&rsquo;, ..., &lsquo;<tt>img%-10.jpg</tt>&rsquo;,
964 etc.
965 </p>
966 <p>The following example shows how to use &lsquo;<tt>ffmpeg</tt>&rsquo; for creating a
967 sequence of files &lsquo;<tt>img-001.jpeg</tt>&rsquo;, &lsquo;<tt>img-002.jpeg</tt>&rsquo;, ...,
968 taking one image every second from the input video:
969 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -r 1 -f image2 'img-%03d.jpeg'
970 </pre></td></tr></table>
971
972 <p>Note that with &lsquo;<tt>ffmpeg</tt>&rsquo;, if the format is not specified with the
973 <code>-f</code> option and the output filename specifies an image file
974 format, the image2 muxer is automatically selected, so the previous
975 command can be written as:
976 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -r 1 'img-%03d.jpeg'
977 </pre></td></tr></table>
978
979 <p>Note also that the pattern must not necessarily contain &quot;%d&quot; or
980 &quot;%0<var>N</var>d&quot;, for example to create a single image file
981 &lsquo;<tt>img.jpeg</tt>&rsquo; from the input video you can employ the command:
982 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -f image2 -vframes 1 img.jpeg
983 </pre></td></tr></table>
984
985 <p>The image muxer supports the .Y.U.V image file format. This format is
986 special in that that each image frame consists of three files, for
987 each of the YUV420P components. To read or write this image file format,
988 specify the name of the &rsquo;.Y&rsquo; file. The muxer will automatically open the
989 &rsquo;.U&rsquo; and &rsquo;.V&rsquo; files as required.
990 </p>
991 <a name="mpegts"></a>
992 <h2 class="section"><a href="ffplay.html#toc-mpegts">8.4 mpegts</a></h2>
993
994 <p>MPEG transport stream muxer.
995 </p>
996 <p>This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
997 </p>
998 <p>The muxer options are:
999 </p>
1000 <dl compact="compact">
1001 <dt> &lsquo;<samp>-mpegts_original_network_id <var>number</var></samp>&rsquo;</dt>
1002 <dd><p>Set the original_network_id (default 0x0001). This is unique identifier
1003 of a network in DVB. Its main use is in the unique identification of a
1004 service through the path Original_Network_ID, Transport_Stream_ID.
1005 </p></dd>
1006 <dt> &lsquo;<samp>-mpegts_transport_stream_id <var>number</var></samp>&rsquo;</dt>
1007 <dd><p>Set the transport_stream_id (default 0x0001). This identifies a
1008 transponder in DVB.
1009 </p></dd>
1010 <dt> &lsquo;<samp>-mpegts_service_id <var>number</var></samp>&rsquo;</dt>
1011 <dd><p>Set the service_id (default 0x0001) also known as program in DVB.
1012 </p></dd>
1013 <dt> &lsquo;<samp>-mpegts_pmt_start_pid <var>number</var></samp>&rsquo;</dt>
1014 <dd><p>Set the first PID for PMT (default 0x1000, max 0x1f00).
1015 </p></dd>
1016 <dt> &lsquo;<samp>-mpegts_start_pid <var>number</var></samp>&rsquo;</dt>
1017 <dd><p>Set the first PID for data packets (default 0x0100, max 0x0f00).
1018 </p></dd>
1019 </dl>
1020
1021 <p>The recognized metadata settings in mpegts muxer are <code>service_provider</code>
1022 and <code>service_name</code>. If they are not set the default for
1023 <code>service_provider</code> is &quot;FFmpeg&quot; and the default for
1024 <code>service_name</code> is &quot;Service01&quot;.
1025 </p>
1026 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i file.mpg -acodec copy -vcodec copy \
1027      -mpegts_original_network_id 0x1122 \
1028      -mpegts_transport_stream_id 0x3344 \
1029      -mpegts_service_id 0x5566 \
1030      -mpegts_pmt_start_pid 0x1500 \
1031      -mpegts_start_pid 0x150 \
1032      -metadata service_provider=&quot;Some provider&quot; \
1033      -metadata service_name=&quot;Some Channel&quot; \
1034      -y out.ts
1035 </pre></td></tr></table>
1036
1037 <a name="null"></a>
1038 <h2 class="section"><a href="ffplay.html#toc-null">8.5 null</a></h2>
1039
1040 <p>Null muxer.
1041 </p>
1042 <p>This muxer does not generate any output file, it is mainly useful for
1043 testing or benchmarking purposes.
1044 </p>
1045 <p>For example to benchmark decoding with &lsquo;<tt>ffmpeg</tt>&rsquo; you can use the
1046 command:
1047 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -benchmark -i INPUT -f null out.null
1048 </pre></td></tr></table>
1049
1050 <p>Note that the above command does not read or write the &lsquo;<tt>out.null</tt>&rsquo;
1051 file, but specifying the output file is required by the &lsquo;<tt>ffmpeg</tt>&rsquo;
1052 syntax.
1053 </p>
1054 <p>Alternatively you can write the command as:
1055 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -benchmark -i INPUT -f null -
1056 </pre></td></tr></table>
1057
1058 <a name="matroska"></a>
1059 <h2 class="section"><a href="ffplay.html#toc-matroska">8.6 matroska</a></h2>
1060
1061 <p>Matroska container muxer.
1062 </p>
1063 <p>This muxer implements the matroska and webm container specs.
1064 </p>
1065 <p>The recognized metadata settings in this muxer are:
1066 </p>
1067 <dl compact="compact">
1068 <dt> &lsquo;<samp>title=<var>title name</var></samp>&rsquo;</dt>
1069 <dd><p>Name provided to a single track
1070 </p></dd>
1071 </dl>
1072
1073 <dl compact="compact">
1074 <dt> &lsquo;<samp>language=<var>language name</var></samp>&rsquo;</dt>
1075 <dd><p>Specifies the language of the track in the Matroska languages form
1076 </p></dd>
1077 </dl>
1078
1079 <dl compact="compact">
1080 <dt> &lsquo;<samp>stereo_mode=<var>mode</var></samp>&rsquo;</dt>
1081 <dd><p>Stereo 3D video layout of two views in a single video track
1082 </p><dl compact="compact">
1083 <dt> &lsquo;<samp>mono</samp>&rsquo;</dt>
1084 <dd><p>video is not stereo
1085 </p></dd>
1086 <dt> &lsquo;<samp>left_right</samp>&rsquo;</dt>
1087 <dd><p>Both views are arranged side by side, Left-eye view is on the left
1088 </p></dd>
1089 <dt> &lsquo;<samp>bottom_top</samp>&rsquo;</dt>
1090 <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is at bottom
1091 </p></dd>
1092 <dt> &lsquo;<samp>top_bottom</samp>&rsquo;</dt>
1093 <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is on top
1094 </p></dd>
1095 <dt> &lsquo;<samp>checkerboard_rl</samp>&rsquo;</dt>
1096 <dd><p>Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
1097 </p></dd>
1098 <dt> &lsquo;<samp>checkerboard_lr</samp>&rsquo;</dt>
1099 <dd><p>Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
1100 </p></dd>
1101 <dt> &lsquo;<samp>row_interleaved_rl</samp>&rsquo;</dt>
1102 <dd><p>Each view is constituted by a row based interleaving, Right-eye view is first row
1103 </p></dd>
1104 <dt> &lsquo;<samp>row_interleaved_lr</samp>&rsquo;</dt>
1105 <dd><p>Each view is constituted by a row based interleaving, Left-eye view is first row
1106 </p></dd>
1107 <dt> &lsquo;<samp>col_interleaved_rl</samp>&rsquo;</dt>
1108 <dd><p>Both views are arranged in a column based interleaving manner, Right-eye view is first column
1109 </p></dd>
1110 <dt> &lsquo;<samp>col_interleaved_lr</samp>&rsquo;</dt>
1111 <dd><p>Both views are arranged in a column based interleaving manner, Left-eye view is first column
1112 </p></dd>
1113 <dt> &lsquo;<samp>anaglyph_cyan_red</samp>&rsquo;</dt>
1114 <dd><p>All frames are in anaglyph format viewable through red-cyan filters
1115 </p></dd>
1116 <dt> &lsquo;<samp>right_left</samp>&rsquo;</dt>
1117 <dd><p>Both views are arranged side by side, Right-eye view is on the left
1118 </p></dd>
1119 <dt> &lsquo;<samp>anaglyph_green_magenta</samp>&rsquo;</dt>
1120 <dd><p>All frames are in anaglyph format viewable through green-magenta filters
1121 </p></dd>
1122 <dt> &lsquo;<samp>block_lr</samp>&rsquo;</dt>
1123 <dd><p>Both eyes laced in one Block, Left-eye view is first
1124 </p></dd>
1125 <dt> &lsquo;<samp>block_rl</samp>&rsquo;</dt>
1126 <dd><p>Both eyes laced in one Block, Right-eye view is first
1127 </p></dd>
1128 </dl>
1129 </dd>
1130 </dl>
1131
1132 <p>For example a 3D WebM clip can be created using the following command line:
1133 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i sample_left_right_clip.mpg -an -vcodec libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
1134 </pre></td></tr></table>
1135
1136 <a name="Input-Devices"></a>
1137 <h1 class="chapter"><a href="ffplay.html#toc-Input-Devices">9. Input Devices</a></h1>
1138
1139 <p>Input devices are configured elements in FFmpeg which allow to access
1140 the data coming from a multimedia device attached to your system.
1141 </p>
1142 <p>When you configure your FFmpeg build, all the supported input devices
1143 are enabled by default. You can list all available ones using the
1144 configure option &quot;&ndash;list-indevs&quot;.
1145 </p>
1146 <p>You can disable all the input devices using the configure option
1147 &quot;&ndash;disable-indevs&quot;, and selectively enable an input device using the
1148 option &quot;&ndash;enable-indev=<var>INDEV</var>&quot;, or you can disable a particular
1149 input device using the option &quot;&ndash;disable-indev=<var>INDEV</var>&quot;.
1150 </p>
1151 <p>The option &quot;-formats&quot; of the ff* tools will display the list of
1152 supported input devices (amongst the demuxers).
1153 </p>
1154 <p>A description of the currently available input devices follows.
1155 </p>
1156 <a name="alsa-1"></a>
1157 <h2 class="section"><a href="ffplay.html#toc-alsa-1">9.1 alsa</a></h2>
1158
1159 <p>ALSA (Advanced Linux Sound Architecture) input device.
1160 </p>
1161 <p>To enable this input device during configuration you need libasound
1162 installed on your system.
1163 </p>
1164 <p>This device allows capturing from an ALSA device. The name of the
1165 device to capture has to be an ALSA card identifier.
1166 </p>
1167 <p>An ALSA identifier has the syntax:
1168 </p><table><tr><td>&nbsp;</td><td><pre class="example">hw:<var>CARD</var>[,<var>DEV</var>[,<var>SUBDEV</var>]]
1169 </pre></td></tr></table>
1170
1171 <p>where the <var>DEV</var> and <var>SUBDEV</var> components are optional.
1172 </p>
1173 <p>The three arguments (in order: <var>CARD</var>,<var>DEV</var>,<var>SUBDEV</var>)
1174 specify card number or identifier, device number and subdevice number
1175 (-1 means any).
1176 </p>
1177 <p>To see the list of cards currently recognized by your system check the
1178 files &lsquo;<tt>/proc/asound/cards</tt>&rsquo; and &lsquo;<tt>/proc/asound/devices</tt>&rsquo;.
1179 </p>
1180 <p>For example to capture with &lsquo;<tt>ffmpeg</tt>&rsquo; from an ALSA device with
1181 card id 0, you may run the command:
1182 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f alsa -i hw:0 alsaout.wav
1183 </pre></td></tr></table>
1184
1185 <p>For more information see:
1186 <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>
1187 </p>
1188 <a name="bktr"></a>
1189 <h2 class="section"><a href="ffplay.html#toc-bktr">9.2 bktr</a></h2>
1190
1191 <p>BSD video input device.
1192 </p>
1193 <a name="dv1394"></a>
1194 <h2 class="section"><a href="ffplay.html#toc-dv1394">9.3 dv1394</a></h2>
1195
1196 <p>Linux DV 1394 input device.
1197 </p>
1198 <a name="fbdev"></a>
1199 <h2 class="section"><a href="ffplay.html#toc-fbdev">9.4 fbdev</a></h2>
1200
1201 <p>Linux framebuffer input device.
1202 </p>
1203 <p>The Linux framebuffer is a graphic hardware-independent abstraction
1204 layer to show graphics on a computer monitor, typically on the
1205 console. It is accessed through a file device node, usually
1206 &lsquo;<tt>/dev/fb0</tt>&rsquo;.
1207 </p>
1208 <p>For more detailed information read the file
1209 Documentation/fb/framebuffer.txt included in the Linux source tree.
1210 </p>
1211 <p>To record from the framebuffer device &lsquo;<tt>/dev/fb0</tt>&rsquo; with
1212 &lsquo;<tt>ffmpeg</tt>&rsquo;:
1213 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
1214 </pre></td></tr></table>
1215
1216 <p>You can take a single screenshot image with the command:
1217 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f fbdev -vframes 1 -r 1 -i /dev/fb0 screenshot.jpeg
1218 </pre></td></tr></table>
1219
1220 <p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
1221 </p>
1222 <a name="jack"></a>
1223 <h2 class="section"><a href="ffplay.html#toc-jack">9.5 jack</a></h2>
1224
1225 <p>JACK input device.
1226 </p>
1227 <p>To enable this input device during configuration you need libjack
1228 installed on your system.
1229 </p>
1230 <p>A JACK input device creates one or more JACK writable clients, one for
1231 each audio channel, with name <var>client_name</var>:input_<var>N</var>, where
1232 <var>client_name</var> is the name provided by the application, and <var>N</var>
1233 is a number which identifies the channel.
1234 Each writable client will send the acquired data to the FFmpeg input
1235 device.
1236 </p>
1237 <p>Once you have created one or more JACK readable clients, you need to
1238 connect them to one or more JACK writable clients.
1239 </p>
1240 <p>To connect or disconnect JACK clients you can use the
1241 &lsquo;<tt>jack_connect</tt>&rsquo; and &lsquo;<tt>jack_disconnect</tt>&rsquo; programs, or do it
1242 through a graphical interface, for example with &lsquo;<tt>qjackctl</tt>&rsquo;.
1243 </p>
1244 <p>To list the JACK clients and their properties you can invoke the command
1245 &lsquo;<tt>jack_lsp</tt>&rsquo;.
1246 </p>
1247 <p>Follows an example which shows how to capture a JACK readable client
1248 with &lsquo;<tt>ffmpeg</tt>&rsquo;.
1249 </p><table><tr><td>&nbsp;</td><td><pre class="example"># Create a JACK writable client with name &quot;ffmpeg&quot;.
1250 $ ffmpeg -f jack -i ffmpeg -y out.wav
1251
1252 # Start the sample jack_metro readable client.
1253 $ jack_metro -b 120 -d 0.2 -f 4000
1254
1255 # List the current JACK clients.
1256 $ jack_lsp -c
1257 system:capture_1
1258 system:capture_2
1259 system:playback_1
1260 system:playback_2
1261 ffmpeg:input_1
1262 metro:120_bpm
1263
1264 # Connect metro to the ffmpeg writable client.
1265 $ jack_connect metro:120_bpm ffmpeg:input_1
1266 </pre></td></tr></table>
1267
1268 <p>For more information read:
1269 <a href="http://jackaudio.org/">http://jackaudio.org/</a>
1270 </p>
1271 <a name="libdc1394"></a>
1272 <h2 class="section"><a href="ffplay.html#toc-libdc1394">9.6 libdc1394</a></h2>
1273
1274 <p>IIDC1394 input device, based on libdc1394 and libraw1394.
1275 </p>
1276 <a name="openal"></a>
1277 <h2 class="section"><a href="ffplay.html#toc-openal">9.7 openal</a></h2>
1278
1279 <p>The OpenAL input device provides audio capture on all systems with a
1280 working OpenAL 1.1 implementation.
1281 </p>
1282 <p>To enable this input device during configuration, you need OpenAL
1283 headers and libraries installed on your system, and need to configure
1284 FFmpeg with <code>--enable-openal</code>.
1285 </p>
1286 <p>OpenAL headers and libraries should be provided as part of your OpenAL
1287 implementation, or as an additional download (an SDK). Depending on your
1288 installation you may need to specify additional flags via the
1289 <code>--extra-cflags</code> and <code>--extra-ldflags</code> for allowing the build
1290 system to locate the OpenAL headers and libraries.
1291 </p>
1292 <p>An incomplete list of OpenAL implementations follows:
1293 </p>
1294 <dl compact="compact">
1295 <dt> <strong>Creative</strong></dt>
1296 <dd><p>The official Windows implementation, providing hardware acceleration
1297 with supported devices and software fallback.
1298 See <a href="http://openal.org/">http://openal.org/</a>.
1299 </p></dd>
1300 <dt> <strong>OpenAL Soft</strong></dt>
1301 <dd><p>Portable, open source (LGPL) software implementation. Includes
1302 backends for the most common sound APIs on the Windows, Linux,
1303 Solaris, and BSD operating systems.
1304 See <a href="http://kcat.strangesoft.net/openal.html">http://kcat.strangesoft.net/openal.html</a>.
1305 </p></dd>
1306 <dt> <strong>Apple</strong></dt>
1307 <dd><p>OpenAL is part of Core Audio, the official Mac OS X Audio interface.
1308 See <a href="http://developer.apple.com/technologies/mac/audio-and-video.html">http://developer.apple.com/technologies/mac/audio-and-video.html</a>
1309 </p></dd>
1310 </dl>
1311
1312 <p>This device allows to capture from an audio input device handled
1313 through OpenAL.
1314 </p>
1315 <p>You need to specify the name of the device to capture in the provided
1316 filename. If the empty string is provided, the device will
1317 automatically select the default device. You can get the list of the
1318 supported devices by using the option <var>list_devices</var>.
1319 </p>
1320 <a name="Options"></a>
1321 <h3 class="subsection"><a href="ffplay.html#toc-Options">9.7.1 Options</a></h3>
1322
1323 <dl compact="compact">
1324 <dt> &lsquo;<samp>channels</samp>&rsquo;</dt>
1325 <dd><p>Set the number of channels in the captured audio. Only the values
1326 &lsquo;<samp>1</samp>&rsquo; (monaural) and &lsquo;<samp>2</samp>&rsquo; (stereo) are currently supported.
1327 Defaults to &lsquo;<samp>2</samp>&rsquo;.
1328 </p>
1329 </dd>
1330 <dt> &lsquo;<samp>sample_size</samp>&rsquo;</dt>
1331 <dd><p>Set the sample size (in bits) of the captured audio. Only the values
1332 &lsquo;<samp>8</samp>&rsquo; and &lsquo;<samp>16</samp>&rsquo; are currently supported. Defaults to
1333 &lsquo;<samp>16</samp>&rsquo;.
1334 </p>
1335 </dd>
1336 <dt> &lsquo;<samp>sample_rate</samp>&rsquo;</dt>
1337 <dd><p>Set the sample rate (in Hz) of the captured audio.
1338 Defaults to &lsquo;<samp>44.1k</samp>&rsquo;.
1339 </p>
1340 </dd>
1341 <dt> &lsquo;<samp>list_devices</samp>&rsquo;</dt>
1342 <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of devices and exit.
1343 Defaults to &lsquo;<samp>false</samp>&rsquo;.
1344 </p>
1345 </dd>
1346 </dl>
1347
1348 <a name="Examples"></a>
1349 <h3 class="subsection"><a href="ffplay.html#toc-Examples">9.7.2 Examples</a></h3>
1350
1351 <p>Print the list of OpenAL supported devices and exit:
1352 </p><table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -list_devices true -f openal -i dummy out.ogg
1353 </pre></td></tr></table>
1354
1355 <p>Capture from the OpenAL device &lsquo;<tt>DR-BT101 via PulseAudio</tt>&rsquo;:
1356 </p><table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
1357 </pre></td></tr></table>
1358
1359 <p>Capture from the default device (note the empty string &rdquo; as filename):
1360 </p><table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -f openal -i '' out.ogg
1361 </pre></td></tr></table>
1362
1363 <p>Capture from two devices simultaneously, writing to two different files,
1364 within the same &lsquo;<tt>ffmpeg</tt>&rsquo; command:
1365 </p><table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
1366 </pre></td></tr></table>
1367 <p>Note: not all OpenAL implementations support multiple simultaneous capture -
1368 try the latest OpenAL Soft if the above does not work.
1369 </p>
1370 <a name="oss"></a>
1371 <h2 class="section"><a href="ffplay.html#toc-oss">9.8 oss</a></h2>
1372
1373 <p>Open Sound System input device.
1374 </p>
1375 <p>The filename to provide to the input device is the device node
1376 representing the OSS input device, and is usually set to
1377 &lsquo;<tt>/dev/dsp</tt>&rsquo;.
1378 </p>
1379 <p>For example to grab from &lsquo;<tt>/dev/dsp</tt>&rsquo; using &lsquo;<tt>ffmpeg</tt>&rsquo; use the
1380 command:
1381 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
1382 </pre></td></tr></table>
1383
1384 <p>For more information about OSS see:
1385 <a href="http://manuals.opensound.com/usersguide/dsp.html">http://manuals.opensound.com/usersguide/dsp.html</a>
1386 </p>
1387 <a name="sndio-1"></a>
1388 <h2 class="section"><a href="ffplay.html#toc-sndio-1">9.9 sndio</a></h2>
1389
1390 <p>sndio input device.
1391 </p>
1392 <p>To enable this input device during configuration you need libsndio
1393 installed on your system.
1394 </p>
1395 <p>The filename to provide to the input device is the device node
1396 representing the sndio input device, and is usually set to
1397 &lsquo;<tt>/dev/audio0</tt>&rsquo;.
1398 </p>
1399 <p>For example to grab from &lsquo;<tt>/dev/audio0</tt>&rsquo; using &lsquo;<tt>ffmpeg</tt>&rsquo; use the
1400 command:
1401 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
1402 </pre></td></tr></table>
1403
1404 <a name="video4linux-and-video4linux2"></a>
1405 <h2 class="section"><a href="ffplay.html#toc-video4linux-and-video4linux2">9.10 video4linux and video4linux2</a></h2>
1406
1407 <p>Video4Linux and Video4Linux2 input video devices.
1408 </p>
1409 <p>The name of the device to grab is a file device node, usually Linux
1410 systems tend to automatically create such nodes when the device
1411 (e.g. an USB webcam) is plugged into the system, and has a name of the
1412 kind &lsquo;<tt>/dev/video<var>N</var></tt>&rsquo;, where <var>N</var> is a number associated to
1413 the device.
1414 </p>
1415 <p>Video4Linux and Video4Linux2 devices only support a limited set of
1416 <var>width</var>x<var>height</var> sizes and framerates. You can check which are
1417 supported for example with the command &lsquo;<tt>dov4l</tt>&rsquo; for Video4Linux
1418 devices and the command &lsquo;<tt>v4l-info</tt>&rsquo; for Video4Linux2 devices.
1419 </p>
1420 <p>If the size for the device is set to 0x0, the input device will
1421 try to autodetect the size to use.
1422 Only for the video4linux2 device, if the frame rate is set to 0/0 the
1423 input device will use the frame rate value already set in the driver.
1424 </p>
1425 <p>Video4Linux support is deprecated since Linux 2.6.30, and will be
1426 dropped in later versions.
1427 </p>
1428 <p>Follow some usage examples of the video4linux devices with the ff*
1429 tools.
1430 </p><table><tr><td>&nbsp;</td><td><pre class="example"># Grab and show the input of a video4linux device, frame rate is set
1431 # to the default of 25/1.
1432 ffplay -s 320x240 -f video4linux /dev/video0
1433
1434 # Grab and show the input of a video4linux2 device, autoadjust size.
1435 ffplay -f video4linux2 /dev/video0
1436
1437 # Grab and record the input of a video4linux2 device, autoadjust size,
1438 # frame rate value defaults to 0/0 so it is read from the video4linux2
1439 # driver.
1440 ffmpeg -f video4linux2 -i /dev/video0 out.mpeg
1441 </pre></td></tr></table>
1442
1443 <a name="vfwcap"></a>
1444 <h2 class="section"><a href="ffplay.html#toc-vfwcap">9.11 vfwcap</a></h2>
1445
1446 <p>VfW (Video for Windows) capture input device.
1447 </p>
1448 <p>The filename passed as input is the capture driver number, ranging from
1449 0 to 9. You may use &quot;list&quot; as filename to print a list of drivers. Any
1450 other filename will be interpreted as device number 0.
1451 </p>
1452 <a name="x11grab"></a>
1453 <h2 class="section"><a href="ffplay.html#toc-x11grab">9.12 x11grab</a></h2>
1454
1455 <p>X11 video input device.
1456 </p>
1457 <p>This device allows to capture a region of an X11 display.
1458 </p>
1459 <p>The filename passed as input has the syntax:
1460 </p><table><tr><td>&nbsp;</td><td><pre class="example">[<var>hostname</var>]:<var>display_number</var>.<var>screen_number</var>[+<var>x_offset</var>,<var>y_offset</var>]
1461 </pre></td></tr></table>
1462
1463 <p><var>hostname</var>:<var>display_number</var>.<var>screen_number</var> specifies the
1464 X11 display name of the screen to grab from. <var>hostname</var> can be
1465 ommitted, and defaults to &quot;localhost&quot;. The environment variable
1466 <code>DISPLAY</code> contains the default display name.
1467 </p>
1468 <p><var>x_offset</var> and <var>y_offset</var> specify the offsets of the grabbed
1469 area with respect to the top-left border of the X11 screen. They
1470 default to 0.
1471 </p>
1472 <p>Check the X11 documentation (e.g. man X) for more detailed information.
1473 </p>
1474 <p>Use the &lsquo;<tt>dpyinfo</tt>&rsquo; program for getting basic information about the
1475 properties of your X11 display (e.g. grep for &quot;name&quot; or &quot;dimensions&quot;).
1476 </p>
1477 <p>For example to grab from &lsquo;<tt>:0.0</tt>&rsquo; using &lsquo;<tt>ffmpeg</tt>&rsquo;:
1478 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpg
1479
1480 # Grab at position 10,20.
1481 ffmpeg -f x11grab -25 -s cif -i :0.0+10,20 out.mpg
1482 </pre></td></tr></table>
1483
1484 <a name="Output-Devices"></a>
1485 <h1 class="chapter"><a href="ffplay.html#toc-Output-Devices">10. Output Devices</a></h1>
1486
1487 <p>Output devices are configured elements in FFmpeg which allow to write
1488 multimedia data to an output device attached to your system.
1489 </p>
1490 <p>When you configure your FFmpeg build, all the supported output devices
1491 are enabled by default. You can list all available ones using the
1492 configure option &quot;&ndash;list-outdevs&quot;.
1493 </p>
1494 <p>You can disable all the output devices using the configure option
1495 &quot;&ndash;disable-outdevs&quot;, and selectively enable an output device using the
1496 option &quot;&ndash;enable-outdev=<var>OUTDEV</var>&quot;, or you can disable a particular
1497 input device using the option &quot;&ndash;disable-outdev=<var>OUTDEV</var>&quot;.
1498 </p>
1499 <p>The option &quot;-formats&quot; of the ff* tools will display the list of
1500 enabled output devices (amongst the muxers).
1501 </p>
1502 <p>A description of the currently available output devices follows.
1503 </p>
1504 <a name="alsa"></a>
1505 <h2 class="section"><a href="ffplay.html#toc-alsa">10.1 alsa</a></h2>
1506
1507 <p>ALSA (Advanced Linux Sound Architecture) output device.
1508 </p>
1509 <a name="oss-1"></a>
1510 <h2 class="section"><a href="ffplay.html#toc-oss-1">10.2 oss</a></h2>
1511
1512 <p>OSS (Open Sound System) output device.
1513 </p>
1514 <a name="sdl"></a>
1515 <h2 class="section"><a href="ffplay.html#toc-sdl">10.3 sdl</a></h2>
1516
1517 <p>SDL (Simple Directmedia Layer) output device.
1518 </p>
1519 <p>This output devices allows to show a video stream in an SDL
1520 window. Only one SDL window is allowed per application, so you can
1521 have only one instance of this output device in an application.
1522 </p>
1523 <p>To enable this output device you need libsdl installed on your system
1524 when configuring your build.
1525 </p>
1526 <p>For more information about SDL, check:
1527 <a href="http://www.libsdl.org/">http://www.libsdl.org/</a>
1528 </p>
1529 <a name="Options-2"></a>
1530 <h3 class="subsection"><a href="ffplay.html#toc-Options-2">10.3.1 Options</a></h3>
1531
1532 <dl compact="compact">
1533 <dt> &lsquo;<samp>window_title</samp>&rsquo;</dt>
1534 <dd><p>Set the SDL window title, if not specified default to the filename
1535 specified for the output device.
1536 </p>
1537 </dd>
1538 <dt> &lsquo;<samp>icon_title</samp>&rsquo;</dt>
1539 <dd><p>Set the name of the iconified SDL window, if not specified it is set
1540 to the same value of <var>window_title</var>.
1541 </p>
1542 </dd>
1543 <dt> &lsquo;<samp>window_size</samp>&rsquo;</dt>
1544 <dd><p>Set the SDL window size, can be a string of the form
1545 <var>width</var>x<var>height</var> or a video size abbreviation.
1546 If not specified it defaults to the size of the input video.
1547 </p></dd>
1548 </dl>
1549
1550 <a name="Examples-1"></a>
1551 <h3 class="subsection"><a href="ffplay.html#toc-Examples-1">10.3.2 Examples</a></h3>
1552
1553 <p>The following command shows the &lsquo;<tt>ffmpeg</tt>&rsquo; output is an
1554 SDL window, forcing its size to the qcif format:
1555 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -vcodec rawvideo -pix_fmt yuv420p -window_size qcif -f sdl &quot;SDL output&quot;
1556 </pre></td></tr></table>
1557
1558 <a name="sndio"></a>
1559 <h2 class="section"><a href="ffplay.html#toc-sndio">10.4 sndio</a></h2>
1560
1561 <p>sndio audio output device.
1562 </p>
1563 <a name="Protocols"></a>
1564 <h1 class="chapter"><a href="ffplay.html#toc-Protocols">11. Protocols</a></h1>
1565
1566 <p>Protocols are configured elements in FFmpeg which allow to access
1567 resources which require the use of a particular protocol.
1568 </p>
1569 <p>When you configure your FFmpeg build, all the supported protocols are
1570 enabled by default. You can list all available ones using the
1571 configure option &quot;&ndash;list-protocols&quot;.
1572 </p>
1573 <p>You can disable all the protocols using the configure option
1574 &quot;&ndash;disable-protocols&quot;, and selectively enable a protocol using the
1575 option &quot;&ndash;enable-protocol=<var>PROTOCOL</var>&quot;, or you can disable a
1576 particular protocol using the option
1577 &quot;&ndash;disable-protocol=<var>PROTOCOL</var>&quot;.
1578 </p>
1579 <p>The option &quot;-protocols&quot; of the ff* tools will display the list of
1580 supported protocols.
1581 </p>
1582 <p>A description of the currently available protocols follows.
1583 </p>
1584 <a name="applehttp-1"></a>
1585 <h2 class="section"><a href="ffplay.html#toc-applehttp-1">11.1 applehttp</a></h2>
1586
1587 <p>Read Apple HTTP Live Streaming compliant segmented stream as
1588 a uniform one. The M3U8 playlists describing the segments can be
1589 remote HTTP resources or local files, accessed using the standard
1590 file protocol.
1591 HTTP is default, specific protocol can be declared by specifying
1592 &quot;+<var>proto</var>&quot; after the applehttp URI scheme name, where <var>proto</var>
1593 is either &quot;file&quot; or &quot;http&quot;.
1594 </p>
1595 <table><tr><td>&nbsp;</td><td><pre class="example">applehttp://host/path/to/remote/resource.m3u8
1596 applehttp+http://host/path/to/remote/resource.m3u8
1597 applehttp+file://path/to/local/resource.m3u8
1598 </pre></td></tr></table>
1599
1600 <a name="concat"></a>
1601 <h2 class="section"><a href="ffplay.html#toc-concat">11.2 concat</a></h2>
1602
1603 <p>Physical concatenation protocol.
1604 </p>
1605 <p>Allow to read and seek from many resource in sequence as if they were
1606 a unique resource.
1607 </p>
1608 <p>A URL accepted by this protocol has the syntax:
1609 </p><table><tr><td>&nbsp;</td><td><pre class="example">concat:<var>URL1</var>|<var>URL2</var>|...|<var>URLN</var>
1610 </pre></td></tr></table>
1611
1612 <p>where <var>URL1</var>, <var>URL2</var>, ..., <var>URLN</var> are the urls of the
1613 resource to be concatenated, each one possibly specifying a distinct
1614 protocol.
1615 </p>
1616 <p>For example to read a sequence of files &lsquo;<tt>split1.mpeg</tt>&rsquo;,
1617 &lsquo;<tt>split2.mpeg</tt>&rsquo;, &lsquo;<tt>split3.mpeg</tt>&rsquo; with &lsquo;<tt>ffplay</tt>&rsquo; use the
1618 command:
1619 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
1620 </pre></td></tr></table>
1621
1622 <p>Note that you may need to escape the character &quot;|&quot; which is special for
1623 many shells.
1624 </p>
1625 <a name="file"></a>
1626 <h2 class="section"><a href="ffplay.html#toc-file">11.3 file</a></h2>
1627
1628 <p>File access protocol.
1629 </p>
1630 <p>Allow to read from or read to a file.
1631 </p>
1632 <p>For example to read from a file &lsquo;<tt>input.mpeg</tt>&rsquo; with &lsquo;<tt>ffmpeg</tt>&rsquo;
1633 use the command:
1634 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i file:input.mpeg output.mpeg
1635 </pre></td></tr></table>
1636
1637 <p>The ff* tools default to the file protocol, that is a resource
1638 specified with the name &quot;FILE.mpeg&quot; is interpreted as the URL
1639 &quot;file:FILE.mpeg&quot;.
1640 </p>
1641 <a name="gopher"></a>
1642 <h2 class="section"><a href="ffplay.html#toc-gopher">11.4 gopher</a></h2>
1643
1644 <p>Gopher protocol.
1645 </p>
1646 <a name="http"></a>
1647 <h2 class="section"><a href="ffplay.html#toc-http">11.5 http</a></h2>
1648
1649 <p>HTTP (Hyper Text Transfer Protocol).
1650 </p>
1651 <a name="mmst"></a>
1652 <h2 class="section"><a href="ffplay.html#toc-mmst">11.6 mmst</a></h2>
1653
1654 <p>MMS (Microsoft Media Server) protocol over TCP.
1655 </p>
1656 <a name="mmsh"></a>
1657 <h2 class="section"><a href="ffplay.html#toc-mmsh">11.7 mmsh</a></h2>
1658
1659 <p>MMS (Microsoft Media Server) protocol over HTTP.
1660 </p>
1661 <p>The required syntax is:
1662 </p><table><tr><td>&nbsp;</td><td><pre class="example">mmsh://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
1663 </pre></td></tr></table>
1664
1665 <a name="md5"></a>
1666 <h2 class="section"><a href="ffplay.html#toc-md5">11.8 md5</a></h2>
1667
1668 <p>MD5 output protocol.
1669 </p>
1670 <p>Computes the MD5 hash of the data to be written, and on close writes
1671 this to the designated output or stdout if none is specified. It can
1672 be used to test muxers without writing an actual file.
1673 </p>
1674 <p>Some examples follow.
1675 </p><table><tr><td>&nbsp;</td><td><pre class="example"># Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
1676 ffmpeg -i input.flv -f avi -y md5:output.avi.md5
1677
1678 # Write the MD5 hash of the encoded AVI file to stdout.
1679 ffmpeg -i input.flv -f avi -y md5:
1680 </pre></td></tr></table>
1681
1682 <p>Note that some formats (typically MOV) require the output protocol to
1683 be seekable, so they will fail with the MD5 output protocol.
1684 </p>
1685 <a name="pipe"></a>
1686 <h2 class="section"><a href="ffplay.html#toc-pipe">11.9 pipe</a></h2>
1687
1688 <p>UNIX pipe access protocol.
1689 </p>
1690 <p>Allow to read and write from UNIX pipes.
1691 </p>
1692 <p>The accepted syntax is:
1693 </p><table><tr><td>&nbsp;</td><td><pre class="example">pipe:[<var>number</var>]
1694 </pre></td></tr></table>
1695
1696 <p><var>number</var> is the number corresponding to the file descriptor of the
1697 pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr).  If <var>number</var>
1698 is not specified, by default the stdout file descriptor will be used
1699 for writing, stdin for reading.
1700 </p>
1701 <p>For example to read from stdin with &lsquo;<tt>ffmpeg</tt>&rsquo;:
1702 </p><table><tr><td>&nbsp;</td><td><pre class="example">cat test.wav | ffmpeg -i pipe:0
1703 # ...this is the same as...
1704 cat test.wav | ffmpeg -i pipe:
1705 </pre></td></tr></table>
1706
1707 <p>For writing to stdout with &lsquo;<tt>ffmpeg</tt>&rsquo;:
1708 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i test.wav -f avi pipe:1 | cat &gt; test.avi
1709 # ...this is the same as...
1710 ffmpeg -i test.wav -f avi pipe: | cat &gt; test.avi
1711 </pre></td></tr></table>
1712
1713 <p>Note that some formats (typically MOV), require the output protocol to
1714 be seekable, so they will fail with the pipe output protocol.
1715 </p>
1716 <a name="rtmp"></a>
1717 <h2 class="section"><a href="ffplay.html#toc-rtmp">11.10 rtmp</a></h2>
1718
1719 <p>Real-Time Messaging Protocol.
1720 </p>
1721 <p>The Real-Time Messaging Protocol (RTMP) is used for streaming multime‐
1722 dia content across a TCP/IP network.
1723 </p>
1724 <p>The required syntax is:
1725 </p><table><tr><td>&nbsp;</td><td><pre class="example">rtmp://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
1726 </pre></td></tr></table>
1727
1728 <p>The accepted parameters are:
1729 </p><dl compact="compact">
1730 <dt> &lsquo;<samp>server</samp>&rsquo;</dt>
1731 <dd><p>The address of the RTMP server.
1732 </p>
1733 </dd>
1734 <dt> &lsquo;<samp>port</samp>&rsquo;</dt>
1735 <dd><p>The number of the TCP port to use (by default is 1935).
1736 </p>
1737 </dd>
1738 <dt> &lsquo;<samp>app</samp>&rsquo;</dt>
1739 <dd><p>It is the name of the application to access. It usually corresponds to
1740 the path where the application is installed on the RTMP server
1741 (e.g. &lsquo;<tt>/ondemand/</tt>&rsquo;, &lsquo;<tt>/flash/live/</tt>&rsquo;, etc.).
1742 </p>
1743 </dd>
1744 <dt> &lsquo;<samp>playpath</samp>&rsquo;</dt>
1745 <dd><p>It is the path or name of the resource to play with reference to the
1746 application specified in <var>app</var>, may be prefixed by &quot;mp4:&quot;.
1747 </p>
1748 </dd>
1749 </dl>
1750
1751 <p>For example to read with &lsquo;<tt>ffplay</tt>&rsquo; a multimedia resource named
1752 &quot;sample&quot; from the application &quot;vod&quot; from an RTMP server &quot;myserver&quot;:
1753 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay rtmp://myserver/vod/sample
1754 </pre></td></tr></table>
1755
1756 <a name="rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte"></a>
1757 <h2 class="section"><a href="ffplay.html#toc-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">11.11 rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></h2>
1758
1759 <p>Real-Time Messaging Protocol and its variants supported through
1760 librtmp.
1761 </p>
1762 <p>Requires the presence of the librtmp headers and library during
1763 configuration. You need to explicitely configure the build with
1764 &quot;&ndash;enable-librtmp&quot;. If enabled this will replace the native RTMP
1765 protocol.
1766 </p>
1767 <p>This protocol provides most client functions and a few server
1768 functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
1769 encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
1770 variants of these encrypted types (RTMPTE, RTMPTS).
1771 </p>
1772 <p>The required syntax is:
1773 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>rtmp_proto</var>://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>] <var>options</var>
1774 </pre></td></tr></table>
1775
1776 <p>where <var>rtmp_proto</var> is one of the strings &quot;rtmp&quot;, &quot;rtmpt&quot;, &quot;rtmpe&quot;,
1777 &quot;rtmps&quot;, &quot;rtmpte&quot;, &quot;rtmpts&quot; corresponding to each RTMP variant, and
1778 <var>server</var>, <var>port</var>, <var>app</var> and <var>playpath</var> have the same
1779 meaning as specified for the RTMP native protocol.
1780 <var>options</var> contains a list of space-separated options of the form
1781 <var>key</var>=<var>val</var>.
1782 </p>
1783 <p>See the librtmp manual page (man 3 librtmp) for more information.
1784 </p>
1785 <p>For example, to stream a file in real-time to an RTMP server using
1786 &lsquo;<tt>ffmpeg</tt>&rsquo;:
1787 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
1788 </pre></td></tr></table>
1789
1790 <p>To play the same stream using &lsquo;<tt>ffplay</tt>&rsquo;:
1791 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay &quot;rtmp://myserver/live/mystream live=1&quot;
1792 </pre></td></tr></table>
1793
1794 <a name="rtp"></a>
1795 <h2 class="section"><a href="ffplay.html#toc-rtp">11.12 rtp</a></h2>
1796
1797 <p>Real-Time Protocol.
1798 </p>
1799 <a name="rtsp"></a>
1800 <h2 class="section"><a href="ffplay.html#toc-rtsp">11.13 rtsp</a></h2>
1801
1802 <p>RTSP is not technically a protocol handler in libavformat, it is a demuxer
1803 and muxer. The demuxer supports both normal RTSP (with data transferred
1804 over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
1805 data transferred over RDT).
1806 </p>
1807 <p>The muxer can be used to send a stream using RTSP ANNOUNCE to a server
1808 supporting it (currently Darwin Streaming Server and Mischa Spiegelmock&rsquo;s
1809 <a href="http://github.com/revmischa/rtsp-server">RTSP server</a>).
1810 </p>
1811 <p>The required syntax for a RTSP url is:
1812 </p><table><tr><td>&nbsp;</td><td><pre class="example">rtsp://<var>hostname</var>[:<var>port</var>]/<var>path</var>[?<var>options</var>]
1813 </pre></td></tr></table>
1814
1815 <p><var>options</var> is a <code>&amp;</code>-separated list. The following options
1816 are supported:
1817 </p>
1818 <dl compact="compact">
1819 <dt> &lsquo;<samp>udp</samp>&rsquo;</dt>
1820 <dd><p>Use UDP as lower transport protocol.
1821 </p>
1822 </dd>
1823 <dt> &lsquo;<samp>tcp</samp>&rsquo;</dt>
1824 <dd><p>Use TCP (interleaving within the RTSP control channel) as lower
1825 transport protocol.
1826 </p>
1827 </dd>
1828 <dt> &lsquo;<samp>multicast</samp>&rsquo;</dt>
1829 <dd><p>Use UDP multicast as lower transport protocol.
1830 </p>
1831 </dd>
1832 <dt> &lsquo;<samp>http</samp>&rsquo;</dt>
1833 <dd><p>Use HTTP tunneling as lower transport protocol, which is useful for
1834 passing proxies.
1835 </p>
1836 </dd>
1837 <dt> &lsquo;<samp>filter_src</samp>&rsquo;</dt>
1838 <dd><p>Accept packets only from negotiated peer address and port.
1839 </p></dd>
1840 </dl>
1841
1842 <p>Multiple lower transport protocols may be specified, in that case they are
1843 tried one at a time (if the setup of one fails, the next one is tried).
1844 For the muxer, only the <code>tcp</code> and <code>udp</code> options are supported.
1845 </p>
1846 <p>When receiving data over UDP, the demuxer tries to reorder received packets
1847 (since they may arrive out of order, or packets may get lost totally). In
1848 order for this to be enabled, a maximum delay must be specified in the
1849 <code>max_delay</code> field of AVFormatContext.
1850 </p>
1851 <p>When watching multi-bitrate Real-RTSP streams with &lsquo;<tt>ffplay</tt>&rsquo;, the
1852 streams to display can be chosen with <code>-vst</code> <var>n</var> and
1853 <code>-ast</code> <var>n</var> for video and audio respectively, and can be switched
1854 on the fly by pressing <code>v</code> and <code>a</code>.
1855 </p>
1856 <p>Example command lines:
1857 </p>
1858 <p>To watch a stream over UDP, with a max reordering delay of 0.5 seconds:
1859 </p>
1860 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -max_delay 500000 rtsp://server/video.mp4?udp
1861 </pre></td></tr></table>
1862
1863 <p>To watch a stream tunneled over HTTP:
1864 </p>
1865 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay rtsp://server/video.mp4?http
1866 </pre></td></tr></table>
1867
1868 <p>To send a stream in realtime to a RTSP server, for others to watch:
1869 </p>
1870 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
1871 </pre></td></tr></table>
1872
1873 <a name="sap"></a>
1874 <h2 class="section"><a href="ffplay.html#toc-sap">11.14 sap</a></h2>
1875
1876 <p>Session Announcement Protocol (RFC 2974). This is not technically a
1877 protocol handler in libavformat, it is a muxer and demuxer.
1878 It is used for signalling of RTP streams, by announcing the SDP for the
1879 streams regularly on a separate port.
1880 </p>
1881 <a name="Muxer"></a>
1882 <h3 class="subsection"><a href="ffplay.html#toc-Muxer">11.14.1 Muxer</a></h3>
1883
1884 <p>The syntax for a SAP url given to the muxer is:
1885 </p><table><tr><td>&nbsp;</td><td><pre class="example">sap://<var>destination</var>[:<var>port</var>][?<var>options</var>]
1886 </pre></td></tr></table>
1887
1888 <p>The RTP packets are sent to <var>destination</var> on port <var>port</var>,
1889 or to port 5004 if no port is specified.
1890 <var>options</var> is a <code>&amp;</code>-separated list. The following options
1891 are supported:
1892 </p>
1893 <dl compact="compact">
1894 <dt> &lsquo;<samp>announce_addr=<var>address</var></samp>&rsquo;</dt>
1895 <dd><p>Specify the destination IP address for sending the announcements to.
1896 If omitted, the announcements are sent to the commonly used SAP
1897 announcement multicast address 224.2.127.254 (sap.mcast.net), or
1898 ff0e::2:7ffe if <var>destination</var> is an IPv6 address.
1899 </p>
1900 </dd>
1901 <dt> &lsquo;<samp>announce_port=<var>port</var></samp>&rsquo;</dt>
1902 <dd><p>Specify the port to send the announcements on, defaults to
1903 9875 if not specified.
1904 </p>
1905 </dd>
1906 <dt> &lsquo;<samp>ttl=<var>ttl</var></samp>&rsquo;</dt>
1907 <dd><p>Specify the time to live value for the announcements and RTP packets,
1908 defaults to 255.
1909 </p>
1910 </dd>
1911 <dt> &lsquo;<samp>same_port=<var>0|1</var></samp>&rsquo;</dt>
1912 <dd><p>If set to 1, send all RTP streams on the same port pair. If zero (the
1913 default), all streams are sent on unique ports, with each stream on a
1914 port 2 numbers higher than the previous.
1915 VLC/Live555 requires this to be set to 1, to be able to receive the stream.
1916 The RTP stack in libavformat for receiving requires all streams to be sent
1917 on unique ports.
1918 </p></dd>
1919 </dl>
1920
1921 <p>Example command lines follow.
1922 </p>
1923 <p>To broadcast a stream on the local subnet, for watching in VLC:
1924 </p>
1925 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255?same_port=1
1926 </pre></td></tr></table>
1927
1928 <p>Similarly, for watching in ffplay:
1929 </p>
1930 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255
1931 </pre></td></tr></table>
1932
1933 <p>And for watching in ffplay, over IPv6:
1934 </p>
1935 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://[ff0e::1:2:3:4]
1936 </pre></td></tr></table>
1937
1938 <a name="Demuxer"></a>
1939 <h3 class="subsection"><a href="ffplay.html#toc-Demuxer">11.14.2 Demuxer</a></h3>
1940
1941 <p>The syntax for a SAP url given to the demuxer is:
1942 </p><table><tr><td>&nbsp;</td><td><pre class="example">sap://[<var>address</var>][:<var>port</var>]
1943 </pre></td></tr></table>
1944
1945 <p><var>address</var> is the multicast address to listen for announcements on,
1946 if omitted, the default 224.2.127.254 (sap.mcast.net) is used. <var>port</var>
1947 is the port that is listened on, 9875 if omitted.
1948 </p>
1949 <p>The demuxers listens for announcements on the given address and port.
1950 Once an announcement is received, it tries to receive that particular stream.
1951 </p>
1952 <p>Example command lines follow.
1953 </p>
1954 <p>To play back the first stream announced on the normal SAP multicast address:
1955 </p>
1956 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay sap://
1957 </pre></td></tr></table>
1958
1959 <p>To play back the first stream announced on one the default IPv6 SAP multicast address:
1960 </p>
1961 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay sap://[ff0e::2:7ffe]
1962 </pre></td></tr></table>
1963
1964 <a name="tcp"></a>
1965 <h2 class="section"><a href="ffplay.html#toc-tcp">11.15 tcp</a></h2>
1966
1967 <p>Trasmission Control Protocol.
1968 </p>
1969 <p>The required syntax for a TCP url is:
1970 </p><table><tr><td>&nbsp;</td><td><pre class="example">tcp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
1971 </pre></td></tr></table>
1972
1973 <dl compact="compact">
1974 <dt> &lsquo;<samp>listen</samp>&rsquo;</dt>
1975 <dd><p>Listen for an incoming connection
1976 </p>
1977 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> tcp://<var>hostname</var>:<var>port</var>?listen
1978 ffplay tcp://<var>hostname</var>:<var>port</var>
1979 </pre></td></tr></table>
1980
1981 </dd>
1982 </dl>
1983
1984 <a name="udp"></a>
1985 <h2 class="section"><a href="ffplay.html#toc-udp">11.16 udp</a></h2>
1986
1987 <p>User Datagram Protocol.
1988 </p>
1989 <p>The required syntax for a UDP url is:
1990 </p><table><tr><td>&nbsp;</td><td><pre class="example">udp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
1991 </pre></td></tr></table>
1992
1993 <p><var>options</var> contains a list of &amp;-seperated options of the form <var>key</var>=<var>val</var>.
1994 Follow the list of supported options.
1995 </p>
1996 <dl compact="compact">
1997 <dt> &lsquo;<samp>buffer_size=<var>size</var></samp>&rsquo;</dt>
1998 <dd><p>set the UDP buffer size in bytes
1999 </p>
2000 </dd>
2001 <dt> &lsquo;<samp>localport=<var>port</var></samp>&rsquo;</dt>
2002 <dd><p>override the local UDP port to bind with
2003 </p>
2004 </dd>
2005 <dt> &lsquo;<samp>pkt_size=<var>size</var></samp>&rsquo;</dt>
2006 <dd><p>set the size in bytes of UDP packets
2007 </p>
2008 </dd>
2009 <dt> &lsquo;<samp>reuse=<var>1|0</var></samp>&rsquo;</dt>
2010 <dd><p>explicitly allow or disallow reusing UDP sockets
2011 </p>
2012 </dd>
2013 <dt> &lsquo;<samp>ttl=<var>ttl</var></samp>&rsquo;</dt>
2014 <dd><p>set the time to live value (for multicast only)
2015 </p>
2016 </dd>
2017 <dt> &lsquo;<samp>connect=<var>1|0</var></samp>&rsquo;</dt>
2018 <dd><p>Initialize the UDP socket with <code>connect()</code>. In this case, the
2019 destination address can&rsquo;t be changed with ff_udp_set_remote_url later.
2020 If the destination address isn&rsquo;t known at the start, this option can
2021 be specified in ff_udp_set_remote_url, too.
2022 This allows finding out the source address for the packets with getsockname,
2023 and makes writes return with AVERROR(ECONNREFUSED) if &quot;destination
2024 unreachable&quot; is received.
2025 For receiving, this gives the benefit of only receiving packets from
2026 the specified peer address/port.
2027 </p></dd>
2028 </dl>
2029
2030 <p>Some usage examples of the udp protocol with &lsquo;<tt>ffmpeg</tt>&rsquo; follow.
2031 </p>
2032 <p>To stream over UDP to a remote endpoint:
2033 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> udp://<var>hostname</var>:<var>port</var>
2034 </pre></td></tr></table>
2035
2036 <p>To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer:
2037 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i <var>input</var> -f mpegts udp://<var>hostname</var>:<var>port</var>?pkt_size=188&amp;buffer_size=65535
2038 </pre></td></tr></table>
2039
2040 <p>To receive over UDP from a remote endpoint:
2041 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i udp://[<var>multicast-address</var>]:<var>port</var>
2042 </pre></td></tr></table>
2043
2044 <a name="Filtergraph-description"></a>
2045 <h1 class="chapter"><a href="ffplay.html#toc-Filtergraph-description">12. Filtergraph description</a></h1>
2046
2047 <p>A filtergraph is a directed graph of connected filters. It can contain
2048 cycles, and there can be multiple links between a pair of
2049 filters. Each link has one input pad on one side connecting it to one
2050 filter from which it takes its input, and one output pad on the other
2051 side connecting it to the one filter accepting its output.
2052 </p>
2053 <p>Each filter in a filtergraph is an instance of a filter class
2054 registered in the application, which defines the features and the
2055 number of input and output pads of the filter.
2056 </p>
2057 <p>A filter with no input pads is called a &quot;source&quot;, a filter with no
2058 output pads is called a &quot;sink&quot;.
2059 </p>
2060 <a name="Filtergraph-syntax"></a>
2061 <h2 class="section"><a href="ffplay.html#toc-Filtergraph-syntax">12.1 Filtergraph syntax</a></h2>
2062
2063 <p>A filtergraph can be represented using a textual representation, which
2064 is recognized by the <code>-vf</code> and <code>-af</code> options of the ff*
2065 tools, and by the <code>av_parse_graph()</code> function defined in
2066 &lsquo;<tt>libavfilter/avfiltergraph</tt>&rsquo;.
2067 </p>
2068 <p>A filterchain consists of a sequence of connected filters, each one
2069 connected to the previous one in the sequence. A filterchain is
2070 represented by a list of &quot;,&quot;-separated filter descriptions.
2071 </p>
2072 <p>A filtergraph consists of a sequence of filterchains. A sequence of
2073 filterchains is represented by a list of &quot;;&quot;-separated filterchain
2074 descriptions.
2075 </p>
2076 <p>A filter is represented by a string of the form:
2077 [<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>]
2078 </p>
2079 <p><var>filter_name</var> is the name of the filter class of which the
2080 described filter is an instance of, and has to be the name of one of
2081 the filter classes registered in the program.
2082 The name of the filter class is optionally followed by a string
2083 &quot;=<var>arguments</var>&quot;.
2084 </p>
2085 <p><var>arguments</var> is a string which contains the parameters used to
2086 initialize the filter instance, and are described in the filter
2087 descriptions below.
2088 </p>
2089 <p>The list of arguments can be quoted using the character &quot;&rsquo;&quot; as initial
2090 and ending mark, and the character &rsquo;\&rsquo; for escaping the characters
2091 within the quoted text; otherwise the argument string is considered
2092 terminated when the next special character (belonging to the set
2093 &quot;[]=;,&quot;) is encountered.
2094 </p>
2095 <p>The name and arguments of the filter are optionally preceded and
2096 followed by a list of link labels.
2097 A link label allows to name a link and associate it to a filter output
2098 or input pad. The preceding labels <var>in_link_1</var>
2099 ... <var>in_link_N</var>, are associated to the filter input pads,
2100 the following labels <var>out_link_1</var> ... <var>out_link_M</var>, are
2101 associated to the output pads.
2102 </p>
2103 <p>When two link labels with the same name are found in the
2104 filtergraph, a link between the corresponding input and output pad is
2105 created.
2106 </p>
2107 <p>If an output pad is not labelled, it is linked by default to the first
2108 unlabelled input pad of the next filter in the filterchain.
2109 For example in the filterchain:
2110 </p><table><tr><td>&nbsp;</td><td><pre class="example">nullsrc, split[L1], [L2]overlay, nullsink
2111 </pre></td></tr></table>
2112 <p>the split filter instance has two output pads, and the overlay filter
2113 instance two input pads. The first output pad of split is labelled
2114 &quot;L1&quot;, the first input pad of overlay is labelled &quot;L2&quot;, and the second
2115 output pad of split is linked to the second input pad of overlay,
2116 which are both unlabelled.
2117 </p>
2118 <p>In a complete filterchain all the unlabelled filter input and output
2119 pads must be connected. A filtergraph is considered valid if all the
2120 filter input and output pads of all the filterchains are connected.
2121 </p>
2122 <p>Follows a BNF description for the filtergraph syntax:
2123 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>NAME</var>             ::= sequence of alphanumeric characters and '_'
2124 <var>LINKLABEL</var>        ::= &quot;[&quot; <var>NAME</var> &quot;]&quot;
2125 <var>LINKLABELS</var>       ::= <var>LINKLABEL</var> [<var>LINKLABELS</var>]
2126 <var>FILTER_ARGUMENTS</var> ::= sequence of chars (eventually quoted)
2127 <var>FILTER</var>           ::= [<var>LINKNAMES</var>] <var>NAME</var> [&quot;=&quot; <var>ARGUMENTS</var>] [<var>LINKNAMES</var>]
2128 <var>FILTERCHAIN</var>      ::= <var>FILTER</var> [,<var>FILTERCHAIN</var>]
2129 <var>FILTERGRAPH</var>      ::= <var>FILTERCHAIN</var> [;<var>FILTERGRAPH</var>]
2130 </pre></td></tr></table>
2131
2132
2133 <a name="Audio-Filters"></a>
2134 <h1 class="chapter"><a href="ffplay.html#toc-Audio-Filters">13. Audio Filters</a></h1>
2135
2136 <p>When you configure your FFmpeg build, you can disable any of the
2137 existing filters using &ndash;disable-filters.
2138 The configure output will show the audio filters included in your
2139 build.
2140 </p>
2141 <p>Below is a description of the currently available audio filters.
2142 </p>
2143 <a name="anull"></a>
2144 <h2 class="section"><a href="ffplay.html#toc-anull">13.1 anull</a></h2>
2145
2146 <p>Pass the audio source unchanged to the output.
2147 </p>
2148
2149 <a name="Audio-Sources"></a>
2150 <h1 class="chapter"><a href="ffplay.html#toc-Audio-Sources">14. Audio Sources</a></h1>
2151
2152 <p>Below is a description of the currently available audio sources.
2153 </p>
2154 <a name="anullsrc"></a>
2155 <h2 class="section"><a href="ffplay.html#toc-anullsrc">14.1 anullsrc</a></h2>
2156
2157 <p>Null audio source, never return audio frames. It is mainly useful as a
2158 template and to be employed in analysis / debugging tools.
2159 </p>
2160 <p>It accepts as optional parameter a string of the form
2161 <var>sample_rate</var>:<var>channel_layout</var>.
2162 </p>
2163 <p><var>sample_rate</var> specify the sample rate, and defaults to 44100.
2164 </p>
2165 <p><var>channel_layout</var> specify the channel layout, and can be either an
2166 integer or a string representing a channel layout. The default value
2167 of <var>channel_layout</var> is 3, which corresponds to CH_LAYOUT_STEREO.
2168 </p>
2169 <p>Check the channel_layout_map definition in
2170 &lsquo;<tt>libavcodec/audioconvert.c</tt>&rsquo; for the mapping between strings and
2171 channel layout values.
2172 </p>
2173 <p>Follow some examples:
2174 </p><table><tr><td>&nbsp;</td><td><pre class="example">#  set the sample rate to 48000 Hz and the channel layout to CH_LAYOUT_MONO.
2175 anullsrc=48000:4
2176
2177 # same as
2178 anullsrc=48000:mono
2179 </pre></td></tr></table>
2180
2181
2182 <a name="Audio-Sinks"></a>
2183 <h1 class="chapter"><a href="ffplay.html#toc-Audio-Sinks">15. Audio Sinks</a></h1>
2184
2185 <p>Below is a description of the currently available audio sinks.
2186 </p>
2187 <a name="anullsink"></a>
2188 <h2 class="section"><a href="ffplay.html#toc-anullsink">15.1 anullsink</a></h2>
2189
2190 <p>Null audio sink, do absolutely nothing with the input audio. It is
2191 mainly useful as a template and to be employed in analysis / debugging
2192 tools.
2193 </p>
2194
2195 <a name="Video-Filters"></a>
2196 <h1 class="chapter"><a href="ffplay.html#toc-Video-Filters">16. Video Filters</a></h1>
2197
2198 <p>When you configure your FFmpeg build, you can disable any of the
2199 existing filters using &ndash;disable-filters.
2200 The configure output will show the video filters included in your
2201 build.
2202 </p>
2203 <p>Below is a description of the currently available video filters.
2204 </p>
2205 <a name="blackframe"></a>
2206 <h2 class="section"><a href="ffplay.html#toc-blackframe">16.1 blackframe</a></h2>
2207
2208 <p>Detect frames that are (almost) completely black. Can be useful to
2209 detect chapter transitions or commercials. Output lines consist of
2210 the frame number of the detected frame, the percentage of blackness,
2211 the position in the file if known or -1 and the timestamp in seconds.
2212 </p>
2213 <p>In order to display the output lines, you need to set the loglevel at
2214 least to the AV_LOG_INFO value.
2215 </p>
2216 <p>The filter accepts the syntax:
2217 </p><table><tr><td>&nbsp;</td><td><pre class="example">blackframe[=<var>amount</var>:[<var>threshold</var>]]
2218 </pre></td></tr></table>
2219
2220 <p><var>amount</var> is the percentage of the pixels that have to be below the
2221 threshold, and defaults to 98.
2222 </p>
2223 <p><var>threshold</var> is the threshold below which a pixel value is
2224 considered black, and defaults to 32.
2225 </p>
2226 <a name="boxblur"></a>
2227 <h2 class="section"><a href="ffplay.html#toc-boxblur">16.2 boxblur</a></h2>
2228
2229 <p>Apply boxblur algorithm to the input video.
2230 </p>
2231 <p>This filter accepts the parameters:
2232 <var>luma_power</var>:<var>luma_radius</var>:<var>chroma_radius</var>:<var>chroma_power</var>:<var>alpha_radius</var>:<var>alpha_power</var>
2233 </p>
2234 <p>Chroma and alpha parameters are optional, if not specified they default
2235 to the corresponding values set for <var>luma_radius</var> and
2236 <var>luma_power</var>.
2237 </p>
2238 <p><var>luma_radius</var>, <var>chroma_radius</var>, and <var>alpha_radius</var> represent
2239 the radius in pixels of the box used for blurring the corresponding
2240 input plane. They are expressions, and can contain the following
2241 constants:
2242 </p><dl compact="compact">
2243 <dt> &lsquo;<samp>w, h</samp>&rsquo;</dt>
2244 <dd><p>the input width and heigth in pixels
2245 </p>
2246 </dd>
2247 <dt> &lsquo;<samp>cw, ch</samp>&rsquo;</dt>
2248 <dd><p>the input chroma image width and height in pixels
2249 </p>
2250 </dd>
2251 <dt> &lsquo;<samp>hsub, vsub</samp>&rsquo;</dt>
2252 <dd><p>horizontal and vertical chroma subsample values. For example for the
2253 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
2254 </p></dd>
2255 </dl>
2256
2257 <p>The radius must be a non-negative number, and must be not greater than
2258 the value of the expression <code>min(w,h)/2</code> for the luma and alpha planes,
2259 and of <code>min(cw,ch)/2</code> for the chroma planes.
2260 </p>
2261 <p><var>luma_power</var>, <var>chroma_power</var>, and <var>alpha_power</var> represent
2262 how many times the boxblur filter is applied to the corresponding
2263 plane.
2264 </p>
2265 <p>Some examples follow:
2266 </p>
2267 <ul>
2268 <li>
2269 Apply a boxblur filter with luma, chroma, and alpha radius
2270 set to 2:
2271 <table><tr><td>&nbsp;</td><td><pre class="example">boxblur=2:1
2272 </pre></td></tr></table>
2273
2274 </li><li>
2275 Set luma radius to 2, alpha and chroma radius to 0
2276 <table><tr><td>&nbsp;</td><td><pre class="example">boxblur=2:1:0:0:0:0
2277 </pre></td></tr></table>
2278
2279 </li><li>
2280 Set luma and chroma radius to a fraction of the video dimension
2281 <table><tr><td>&nbsp;</td><td><pre class="example">boxblur=min(h\,w)/10:1:min(cw\,ch)/10:1
2282 </pre></td></tr></table>
2283
2284 </li></ul>
2285
2286 <a name="copy"></a>
2287 <h2 class="section"><a href="ffplay.html#toc-copy">16.3 copy</a></h2>
2288
2289 <p>Copy the input source unchanged to the output. Mainly useful for
2290 testing purposes.
2291 </p>
2292 <a name="crop"></a>
2293 <h2 class="section"><a href="ffplay.html#toc-crop">16.4 crop</a></h2>
2294
2295 <p>Crop the input video to <var>out_w</var>:<var>out_h</var>:<var>x</var>:<var>y</var>.
2296 </p>
2297 <p>The parameters are expressions containing the following constants:
2298 </p>
2299 <dl compact="compact">
2300 <dt> &lsquo;<samp>E, PI, PHI</samp>&rsquo;</dt>
2301 <dd><p>the corresponding mathematical approximated values for e
2302 (euler number), pi (greek PI), PHI (golden ratio)
2303 </p>
2304 </dd>
2305 <dt> &lsquo;<samp>x, y</samp>&rsquo;</dt>
2306 <dd><p>the computed values for <var>x</var> and <var>y</var>. They are evaluated for
2307 each new frame.
2308 </p>
2309 </dd>
2310 <dt> &lsquo;<samp>in_w, in_h</samp>&rsquo;</dt>
2311 <dd><p>the input width and heigth
2312 </p>
2313 </dd>
2314 <dt> &lsquo;<samp>iw, ih</samp>&rsquo;</dt>
2315 <dd><p>same as <var>in_w</var> and <var>in_h</var>
2316 </p>
2317 </dd>
2318 <dt> &lsquo;<samp>out_w, out_h</samp>&rsquo;</dt>
2319 <dd><p>the output (cropped) width and heigth
2320 </p>
2321 </dd>
2322 <dt> &lsquo;<samp>ow, oh</samp>&rsquo;</dt>
2323 <dd><p>same as <var>out_w</var> and <var>out_h</var>
2324 </p>
2325 </dd>
2326 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
2327 <dd><p>the number of input frame, starting from 0
2328 </p>
2329 </dd>
2330 <dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
2331 <dd><p>the position in the file of the input frame, NAN if unknown
2332 </p>
2333 </dd>
2334 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
2335 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
2336 </p>
2337 </dd>
2338 </dl>
2339
2340 <p>The <var>out_w</var> and <var>out_h</var> parameters specify the expressions for
2341 the width and height of the output (cropped) video. They are
2342 evaluated just at the configuration of the filter.
2343 </p>
2344 <p>The default value of <var>out_w</var> is &quot;in_w&quot;, and the default value of
2345 <var>out_h</var> is &quot;in_h&quot;.
2346 </p>
2347 <p>The expression for <var>out_w</var> may depend on the value of <var>out_h</var>,
2348 and the expression for <var>out_h</var> may depend on <var>out_w</var>, but they
2349 cannot depend on <var>x</var> and <var>y</var>, as <var>x</var> and <var>y</var> are
2350 evaluated after <var>out_w</var> and <var>out_h</var>.
2351 </p>
2352 <p>The <var>x</var> and <var>y</var> parameters specify the expressions for the
2353 position of the top-left corner of the output (non-cropped) area. They
2354 are evaluated for each frame. If the evaluated value is not valid, it
2355 is approximated to the nearest valid value.
2356 </p>
2357 <p>The default value of <var>x</var> is &quot;(in_w-out_w)/2&quot;, and the default
2358 value for <var>y</var> is &quot;(in_h-out_h)/2&quot;, which set the cropped area at
2359 the center of the input image.
2360 </p>
2361 <p>The expression for <var>x</var> may depend on <var>y</var>, and the expression
2362 for <var>y</var> may depend on <var>x</var>.
2363 </p>
2364 <p>Follow some examples:
2365 </p><table><tr><td>&nbsp;</td><td><pre class="example"># crop the central input area with size 100x100
2366 crop=100:100
2367
2368 # crop the central input area with size 2/3 of the input video
2369 &quot;crop=2/3*in_w:2/3*in_h&quot;
2370
2371 # crop the input video central square
2372 crop=in_h
2373
2374 # delimit the rectangle with the top-left corner placed at position
2375 # 100:100 and the right-bottom corner corresponding to the right-bottom
2376 # corner of the input image.
2377 crop=in_w-100:in_h-100:100:100
2378
2379 # crop 10 pixels from the left and right borders, and 20 pixels from
2380 # the top and bottom borders
2381 &quot;crop=in_w-2*10:in_h-2*20&quot;
2382
2383 # keep only the bottom right quarter of the input image
2384 &quot;crop=in_w/2:in_h/2:in_w/2:in_h/2&quot;
2385
2386 # crop height for getting Greek harmony
2387 &quot;crop=in_w:1/PHI*in_w&quot;
2388
2389 # trembling effect
2390 &quot;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)&quot;
2391
2392 # erratic camera effect depending on timestamp
2393 &quot;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)&quot;
2394
2395 # set x depending on the value of y
2396 &quot;crop=in_w/2:in_h/2:y:10+10*sin(n/10)&quot;
2397 </pre></td></tr></table>
2398
2399 <a name="cropdetect"></a>
2400 <h2 class="section"><a href="ffplay.html#toc-cropdetect">16.5 cropdetect</a></h2>
2401
2402 <p>Auto-detect crop size.
2403 </p>
2404 <p>Calculate necessary cropping parameters and prints the recommended
2405 parameters through the logging system. The detected dimensions
2406 correspond to the non-black area of the input video.
2407 </p>
2408 <p>It accepts the syntax:
2409 </p><table><tr><td>&nbsp;</td><td><pre class="example">cropdetect[=<var>limit</var>[:<var>round</var>[:<var>reset</var>]]]
2410 </pre></td></tr></table>
2411
2412 <dl compact="compact">
2413 <dt> &lsquo;<samp>limit</samp>&rsquo;</dt>
2414 <dd><p>Threshold, which can be optionally specified from nothing (0) to
2415 everything (255), defaults to 24.
2416 </p>
2417 </dd>
2418 <dt> &lsquo;<samp>round</samp>&rsquo;</dt>
2419 <dd><p>Value which the width/height should be divisible by, defaults to
2420 16. The offset is automatically adjusted to center the video. Use 2 to
2421 get only even dimensions (needed for 4:2:2 video). 16 is best when
2422 encoding to most video codecs.
2423 </p>
2424 </dd>
2425 <dt> &lsquo;<samp>reset</samp>&rsquo;</dt>
2426 <dd><p>Counter that determines after how many frames cropdetect will reset
2427 the previously detected largest video area and start over to detect
2428 the current optimal crop area. Defaults to 0.
2429 </p>
2430 <p>This can be useful when channel logos distort the video area. 0
2431 indicates never reset and return the largest area encountered during
2432 playback.
2433 </p></dd>
2434 </dl>
2435
2436 <a name="drawbox"></a>
2437 <h2 class="section"><a href="ffplay.html#toc-drawbox">16.6 drawbox</a></h2>
2438
2439 <p>Draw a colored box on the input image.
2440 </p>
2441 <p>It accepts the syntax:
2442 </p><table><tr><td>&nbsp;</td><td><pre class="example">drawbox=<var>x</var>:<var>y</var>:<var>width</var>:<var>height</var>:<var>color</var>
2443 </pre></td></tr></table>
2444
2445 <dl compact="compact">
2446 <dt> &lsquo;<samp>x, y</samp>&rsquo;</dt>
2447 <dd><p>Specify the top left corner coordinates of the box. Default to 0.
2448 </p>
2449 </dd>
2450 <dt> &lsquo;<samp>width, height</samp>&rsquo;</dt>
2451 <dd><p>Specify the width and height of the box, if 0 they are interpreted as
2452 the input width and height. Default to 0.
2453 </p>
2454 </dd>
2455 <dt> &lsquo;<samp>color</samp>&rsquo;</dt>
2456 <dd><p>Specify the color of the box to write, it can be the name of a color
2457 (case insensitive match) or a 0xRRGGBB[AA] sequence.
2458 </p></dd>
2459 </dl>
2460
2461 <p>Follow some examples:
2462 </p><table><tr><td>&nbsp;</td><td><pre class="example"># draw a black box around the edge of the input image
2463 drawbox
2464
2465 # draw a box with color red and an opacity of 50%
2466 drawbox=10:20:200:60:red@0.5&quot;
2467 </pre></td></tr></table>
2468
2469 <a name="drawtext"></a>
2470 <h2 class="section"><a href="ffplay.html#toc-drawtext">16.7 drawtext</a></h2>
2471
2472 <p>Draw text string or text from specified file on top of video using the
2473 libfreetype library.
2474 </p>
2475 <p>To enable compilation of this filter you need to configure FFmpeg with
2476 <code>--enable-libfreetype</code>.
2477 </p>
2478 <p>The filter also recognizes strftime() sequences in the provided text
2479 and expands them accordingly. Check the documentation of strftime().
2480 </p>
2481 <p>The filter accepts parameters as a list of <var>key</var>=<var>value</var> pairs,
2482 separated by &quot;:&quot;.
2483 </p>
2484 <p>The description of the accepted parameters follows.
2485 </p>
2486 <dl compact="compact">
2487 <dt> &lsquo;<samp>fontfile</samp>&rsquo;</dt>
2488 <dd><p>The font file to be used for drawing text. Path must be included.
2489 This parameter is mandatory.
2490 </p>
2491 </dd>
2492 <dt> &lsquo;<samp>text</samp>&rsquo;</dt>
2493 <dd><p>The text string to be drawn. The text must be a sequence of UTF-8
2494 encoded characters.
2495 This parameter is mandatory if no file is specified with the parameter
2496 <var>textfile</var>.
2497 </p>
2498 </dd>
2499 <dt> &lsquo;<samp>textfile</samp>&rsquo;</dt>
2500 <dd><p>A text file containing text to be drawn. The text must be a sequence
2501 of UTF-8 encoded characters.
2502 </p>
2503 <p>This parameter is mandatory if no text string is specified with the
2504 parameter <var>text</var>.
2505 </p>
2506 <p>If both text and textfile are specified, an error is thrown.
2507 </p>
2508 </dd>
2509 <dt> &lsquo;<samp>x, y</samp>&rsquo;</dt>
2510 <dd><p>The offsets where text will be drawn within the video frame.
2511 Relative to the top/left border of the output image.
2512 </p>
2513 <p>The default value of <var>x</var> and <var>y</var> is 0.
2514 </p>
2515 </dd>
2516 <dt> &lsquo;<samp>fontsize</samp>&rsquo;</dt>
2517 <dd><p>The font size to be used for drawing text.
2518 The default value of <var>fontsize</var> is 16.
2519 </p>
2520 </dd>
2521 <dt> &lsquo;<samp>fontcolor</samp>&rsquo;</dt>
2522 <dd><p>The color to be used for drawing fonts.
2523 Either a string (e.g. &quot;red&quot;) or in 0xRRGGBB[AA] format
2524 (e.g. &quot;0xff000033&quot;), possibly followed by an alpha specifier.
2525 The default value of <var>fontcolor</var> is &quot;black&quot;.
2526 </p>
2527 </dd>
2528 <dt> &lsquo;<samp>boxcolor</samp>&rsquo;</dt>
2529 <dd><p>The color to be used for drawing box around text.
2530 Either a string (e.g. &quot;yellow&quot;) or in 0xRRGGBB[AA] format
2531 (e.g. &quot;0xff00ff&quot;), possibly followed by an alpha specifier.
2532 The default value of <var>boxcolor</var> is &quot;white&quot;.
2533 </p>
2534 </dd>
2535 <dt> &lsquo;<samp>box</samp>&rsquo;</dt>
2536 <dd><p>Used to draw a box around text using background color.
2537 Value should be either 1 (enable) or 0 (disable).
2538 The default value of <var>box</var> is 0.
2539 </p>
2540 </dd>
2541 <dt> &lsquo;<samp>shadowx, shadowy</samp>&rsquo;</dt>
2542 <dd><p>The x and y offsets for the text shadow position with respect to the
2543 position of the text. They can be either positive or negative
2544 values. Default value for both is &quot;0&quot;.
2545 </p>
2546 </dd>
2547 <dt> &lsquo;<samp>shadowcolor</samp>&rsquo;</dt>
2548 <dd><p>The color to be used for drawing a shadow behind the drawn text.  It
2549 can be a color name (e.g. &quot;yellow&quot;) or a string in the 0xRRGGBB[AA]
2550 form (e.g. &quot;0xff00ff&quot;), possibly followed by an alpha specifier.
2551 The default value of <var>shadowcolor</var> is &quot;black&quot;.
2552 </p>
2553 </dd>
2554 <dt> &lsquo;<samp>ft_load_flags</samp>&rsquo;</dt>
2555 <dd><p>Flags to be used for loading the fonts.
2556 </p>
2557 <p>The flags map the corresponding flags supported by libfreetype, and are
2558 a combination of the following values:
2559 </p><dl compact="compact">
2560 <dt> <var>default</var></dt>
2561 <dt> <var>no_scale</var></dt>
2562 <dt> <var>no_hinting</var></dt>
2563 <dt> <var>render</var></dt>
2564 <dt> <var>no_bitmap</var></dt>
2565 <dt> <var>vertical_layout</var></dt>
2566 <dt> <var>force_autohint</var></dt>
2567 <dt> <var>crop_bitmap</var></dt>
2568 <dt> <var>pedantic</var></dt>
2569 <dt> <var>ignore_global_advance_width</var></dt>
2570 <dt> <var>no_recurse</var></dt>
2571 <dt> <var>ignore_transform</var></dt>
2572 <dt> <var>monochrome</var></dt>
2573 <dt> <var>linear_design</var></dt>
2574 <dt> <var>no_autohint</var></dt>
2575 <dt> <var>end table</var></dt>
2576 </dl>
2577
2578 <p>Default value is &quot;render&quot;.
2579 </p>
2580 <p>For more information consult the documentation for the FT_LOAD_*
2581 libfreetype flags.
2582 </p>
2583 </dd>
2584 <dt> &lsquo;<samp>tabsize</samp>&rsquo;</dt>
2585 <dd><p>The size in number of spaces to use for rendering the tab.
2586 Default value is 4.
2587 </p></dd>
2588 </dl>
2589
2590 <p>For example the command:
2591 </p><table><tr><td>&nbsp;</td><td><pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'&quot;
2592 </pre></td></tr></table>
2593
2594 <p>will draw &quot;Test Text&quot; with font FreeSerif, using the default values
2595 for the optional parameters.
2596 </p>
2597 <p>The command:
2598 </p><table><tr><td>&nbsp;</td><td><pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
2599           x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2&quot;
2600 </pre></td></tr></table>
2601
2602 <p>will draw &rsquo;Test Text&rsquo; with font FreeSerif of size 24 at position x=100
2603 and y=50 (counting from the top-left corner of the screen), text is
2604 yellow with a red box around it. Both the text and the box have an
2605 opacity of 20%.
2606 </p>
2607 <p>Note that the double quotes are not necessary if spaces are not used
2608 within the parameter list.
2609 </p>
2610 <p>For more information about libfreetype, check:
2611 <a href="http://www.freetype.org/">http://www.freetype.org/</a>.
2612 </p>
2613 <a name="fade"></a>
2614 <h2 class="section"><a href="ffplay.html#toc-fade">16.8 fade</a></h2>
2615
2616 <p>Apply fade-in/out effect to input video.
2617 </p>
2618 <p>It accepts the parameters:
2619 <var>type</var>:<var>start_frame</var>:<var>nb_frames</var>
2620 </p>
2621 <p><var>type</var> specifies if the effect type, can be either &quot;in&quot; for
2622 fade-in, or &quot;out&quot; for a fade-out effect.
2623 </p>
2624 <p><var>start_frame</var> specifies the number of the start frame for starting
2625 to apply the fade effect.
2626 </p>
2627 <p><var>nb_frames</var> specifies the number of frames for which the fade
2628 effect has to last. At the end of the fade-in effect the output video
2629 will have the same intensity as the input video, at the end of the
2630 fade-out transition the output video will be completely black.
2631 </p>
2632 <p>A few usage examples follow, usable too as test scenarios.
2633 </p><table><tr><td>&nbsp;</td><td><pre class="example"># fade in first 30 frames of video
2634 fade=in:0:30
2635
2636 # fade out last 45 frames of a 200-frame video
2637 fade=out:155:45
2638
2639 # fade in first 25 frames and fade out last 25 frames of a 1000-frame video
2640 fade=in:0:25, fade=out:975:25
2641
2642 # make first 5 frames black, then fade in from frame 5-24
2643 fade=in:5:20
2644 </pre></td></tr></table>
2645
2646 <a name="fieldorder"></a>
2647 <h2 class="section"><a href="ffplay.html#toc-fieldorder">16.9 fieldorder</a></h2>
2648
2649 <p>Transform the field order of the input video.
2650 </p>
2651 <p>It accepts one parameter which specifies the required field order that
2652 the input interlaced video will be transformed to. The parameter can
2653 assume one of the following values:
2654 </p>
2655 <dl compact="compact">
2656 <dt> &lsquo;<samp>0 or bff</samp>&rsquo;</dt>
2657 <dd><p>output bottom field first
2658 </p></dd>
2659 <dt> &lsquo;<samp>1 or tff</samp>&rsquo;</dt>
2660 <dd><p>output top field first
2661 </p></dd>
2662 </dl>
2663
2664 <p>Default value is &quot;tff&quot;.
2665 </p>
2666 <p>Transformation is achieved by shifting the picture content up or down
2667 by one line, and filling the remaining line with appropriate picture content.
2668 This method is consistent with most broadcast field order converters.
2669 </p>
2670 <p>If the input video is not flagged as being interlaced, or it is already
2671 flagged as being of the required output field order then this filter does
2672 not alter the incoming video.
2673 </p>
2674 <p>This filter is very useful when converting to or from PAL DV material,
2675 which is bottom field first.
2676 </p>
2677 <p>For example:
2678 </p><table><tr><td>&nbsp;</td><td><pre class="example">./ffmpeg -i in.vob -vf &quot;fieldorder=bff&quot; out.dv
2679 </pre></td></tr></table>
2680
2681 <a name="fifo"></a>
2682 <h2 class="section"><a href="ffplay.html#toc-fifo">16.10 fifo</a></h2>
2683
2684 <p>Buffer input images and send them when they are requested.
2685 </p>
2686 <p>This filter is mainly useful when auto-inserted by the libavfilter
2687 framework.
2688 </p>
2689 <p>The filter does not take parameters.
2690 </p>
2691 <a name="format"></a>
2692 <h2 class="section"><a href="ffplay.html#toc-format">16.11 format</a></h2>
2693
2694 <p>Convert the input video to one of the specified pixel formats.
2695 Libavfilter will try to pick one that is supported for the input to
2696 the next filter.
2697 </p>
2698 <p>The filter accepts a list of pixel format names, separated by &quot;:&quot;,
2699 for example &quot;yuv420p:monow:rgb24&quot;.
2700 </p>
2701 <p>Some examples follow:
2702 </p><table><tr><td>&nbsp;</td><td><pre class="example"># convert the input video to the format &quot;yuv420p&quot;
2703 format=yuv420p
2704
2705 # convert the input video to any of the formats in the list
2706 format=yuv420p:yuv444p:yuv410p
2707 </pre></td></tr></table>
2708
2709 <p><a name="frei0r"></a>
2710 </p><a name="frei0r-1"></a>
2711 <h2 class="section"><a href="ffplay.html#toc-frei0r-1">16.12 frei0r</a></h2>
2712
2713 <p>Apply a frei0r effect to the input video.
2714 </p>
2715 <p>To enable compilation of this filter you need to install the frei0r
2716 header and configure FFmpeg with &ndash;enable-frei0r.
2717 </p>
2718 <p>The filter supports the syntax:
2719 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>filter_name</var>[{:|=}<var>param1</var>:<var>param2</var>:...:<var>paramN</var>]
2720 </pre></td></tr></table>
2721
2722 <p><var>filter_name</var> is the name to the frei0r effect to load. If the
2723 environment variable <code>FREI0R_PATH</code> is defined, the frei0r effect
2724 is searched in each one of the directories specified by the colon
2725 separated list in <code>FREIOR_PATH</code>, otherwise in the standard frei0r
2726 paths, which are in this order: &lsquo;<tt>HOME/.frei0r-1/lib/</tt>&rsquo;,
2727 &lsquo;<tt>/usr/local/lib/frei0r-1/</tt>&rsquo;, &lsquo;<tt>/usr/lib/frei0r-1/</tt>&rsquo;.
2728 </p>
2729 <p><var>param1</var>, <var>param2</var>, ... , <var>paramN</var> specify the parameters
2730 for the frei0r effect.
2731 </p>
2732 <p>A frei0r effect parameter can be a boolean (whose values are specified
2733 with &quot;y&quot; and &quot;n&quot;), a double, a color (specified by the syntax
2734 <var>R</var>/<var>G</var>/<var>B</var>, <var>R</var>, <var>G</var>, and <var>B</var> being float
2735 numbers from 0.0 to 1.0) or by an <code>av_parse_color()</code> color
2736 description), a position (specified by the syntax <var>X</var>/<var>Y</var>,
2737 <var>X</var> and <var>Y</var> being float numbers) and a string.
2738 </p>
2739 <p>The number and kind of parameters depend on the loaded effect. If an
2740 effect parameter is not specified the default value is set.
2741 </p>
2742 <p>Some examples follow:
2743 </p><table><tr><td>&nbsp;</td><td><pre class="example"># apply the distort0r effect, set the first two double parameters
2744 frei0r=distort0r:0.5:0.01
2745
2746 # apply the colordistance effect, takes a color as first parameter
2747 frei0r=colordistance:0.2/0.3/0.4
2748 frei0r=colordistance:violet
2749 frei0r=colordistance:0x112233
2750
2751 # apply the perspective effect, specify the top left and top right
2752 # image positions
2753 frei0r=perspective:0.2/0.2:0.8/0.2
2754 </pre></td></tr></table>
2755
2756 <p>For more information see:
2757 <a href="http://piksel.org/frei0r">http://piksel.org/frei0r</a>
2758 </p>
2759 <a name="gradfun"></a>
2760 <h2 class="section"><a href="ffplay.html#toc-gradfun">16.13 gradfun</a></h2>
2761
2762 <p>Fix the banding artifacts that are sometimes introduced into nearly flat
2763 regions by truncation to 8bit colordepth.
2764 Interpolate the gradients that should go where the bands are, and
2765 dither them.
2766 </p>
2767 <p>This filter is designed for playback only.  Do not use it prior to
2768 lossy compression, because compression tends to lose the dither and
2769 bring back the bands.
2770 </p>
2771 <p>The filter takes two optional parameters, separated by &rsquo;:&rsquo;:
2772 <var>strength</var>:<var>radius</var>
2773 </p>
2774 <p><var>strength</var> is the maximum amount by which the filter will change
2775 any one pixel. Also the threshold for detecting nearly flat
2776 regions. Acceptable values range from .51 to 255, default value is
2777 1.2, out-of-range values will be clipped to the valid range.
2778 </p>
2779 <p><var>radius</var> is the neighborhood to fit the gradient to. A larger
2780 radius makes for smoother gradients, but also prevents the filter from
2781 modifying the pixels near detailed regions. Acceptable values are
2782 8-32, default value is 16, out-of-range values will be clipped to the
2783 valid range.
2784 </p>
2785 <table><tr><td>&nbsp;</td><td><pre class="example"># default parameters
2786 gradfun=1.2:16
2787
2788 # omitting radius
2789 gradfun=1.2
2790 </pre></td></tr></table>
2791
2792 <a name="hflip"></a>
2793 <h2 class="section"><a href="ffplay.html#toc-hflip">16.14 hflip</a></h2>
2794
2795 <p>Flip the input video horizontally.
2796 </p>
2797 <p>For example to horizontally flip the video in input with
2798 &lsquo;<tt>ffmpeg</tt>&rsquo;:
2799 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -vf &quot;hflip&quot; out.avi
2800 </pre></td></tr></table>
2801
2802 <a name="hqdn3d"></a>
2803 <h2 class="section"><a href="ffplay.html#toc-hqdn3d">16.15 hqdn3d</a></h2>
2804
2805 <p>High precision/quality 3d denoise filter. This filter aims to reduce
2806 image noise producing smooth images and making still images really
2807 still. It should enhance compressibility.
2808 </p>
2809 <p>It accepts the following optional parameters:
2810 <var>luma_spatial</var>:<var>chroma_spatial</var>:<var>luma_tmp</var>:<var>chroma_tmp</var>
2811 </p>
2812 <dl compact="compact">
2813 <dt> &lsquo;<samp>luma_spatial</samp>&rsquo;</dt>
2814 <dd><p>a non-negative float number which specifies spatial luma strength,
2815 defaults to 4.0
2816 </p>
2817 </dd>
2818 <dt> &lsquo;<samp>chroma_spatial</samp>&rsquo;</dt>
2819 <dd><p>a non-negative float number which specifies spatial chroma strength,
2820 defaults to 3.0*<var>luma_spatial</var>/4.0
2821 </p>
2822 </dd>
2823 <dt> &lsquo;<samp>luma_tmp</samp>&rsquo;</dt>
2824 <dd><p>a float number which specifies luma temporal strength, defaults to
2825 6.0*<var>luma_spatial</var>/4.0
2826 </p>
2827 </dd>
2828 <dt> &lsquo;<samp>chroma_tmp</samp>&rsquo;</dt>
2829 <dd><p>a float number which specifies chroma temporal strength, defaults to
2830 <var>luma_tmp</var>*<var>chroma_spatial</var>/<var>luma_spatial</var>
2831 </p></dd>
2832 </dl>
2833
2834 <a name="lut_002c-lutrgb_002c-lutyuv"></a>
2835 <h2 class="section"><a href="ffplay.html#toc-lut_002c-lutrgb_002c-lutyuv">16.16 lut, lutrgb, lutyuv</a></h2>
2836
2837 <p>Compute a look-up table for binding each pixel component input value
2838 to an output value, and apply it to input video.
2839 </p>
2840 <p><var>lutyuv</var> applies a lookup table to a YUV input video, <var>lutrgb</var>
2841 to an RGB input video.
2842 </p>
2843 <p>These filters accept in input a &quot;:&quot;-separated list of options, which
2844 specify the expressions used for computing the lookup table for the
2845 corresponding pixel component values.
2846 </p>
2847 <p>The <var>lut</var> filter requires either YUV or RGB pixel formats in
2848 input, and accepts the options:
2849 </p><dl compact="compact">
2850 <dd><p><var>c0</var> (first  pixel component)
2851 <var>c1</var> (second pixel component)
2852 <var>c2</var> (third  pixel component)
2853 <var>c3</var> (fourth pixel component, corresponds to the alpha component)
2854 </p></dd>
2855 </dl>
2856
2857 <p>The exact component associated to each option depends on the format in
2858 input.
2859 </p>
2860 <p>The <var>lutrgb</var> filter requires RGB pixel formats in input, and
2861 accepts the options:
2862 </p><dl compact="compact">
2863 <dd><p><var>r</var> (red component)
2864 <var>g</var> (green component)
2865 <var>b</var> (blue component)
2866 <var>a</var> (alpha component)
2867 </p></dd>
2868 </dl>
2869
2870 <p>The <var>lutyuv</var> filter requires YUV pixel formats in input, and
2871 accepts the options:
2872 </p><dl compact="compact">
2873 <dd><p><var>y</var> (Y/luminance component)
2874 <var>u</var> (U/Cb component)
2875 <var>v</var> (V/Cr component)
2876 <var>a</var> (alpha component)
2877 </p></dd>
2878 </dl>
2879
2880 <p>The expressions can contain the following constants and functions:
2881 </p>
2882 <dl compact="compact">
2883 <dt> &lsquo;<samp>E, PI, PHI</samp>&rsquo;</dt>
2884 <dd><p>the corresponding mathematical approximated values for e
2885 (euler number), pi (greek PI), PHI (golden ratio)
2886 </p>
2887 </dd>
2888 <dt> &lsquo;<samp>w, h</samp>&rsquo;</dt>
2889 <dd><p>the input width and heigth
2890 </p>
2891 </dd>
2892 <dt> &lsquo;<samp>val</samp>&rsquo;</dt>
2893 <dd><p>input value for the pixel component
2894 </p>
2895 </dd>
2896 <dt> &lsquo;<samp>clipval</samp>&rsquo;</dt>
2897 <dd><p>the input value clipped in the <var>minval</var>-<var>maxval</var> range
2898 </p>
2899 </dd>
2900 <dt> &lsquo;<samp>maxval</samp>&rsquo;</dt>
2901 <dd><p>maximum value for the pixel component
2902 </p>
2903 </dd>
2904 <dt> &lsquo;<samp>minval</samp>&rsquo;</dt>
2905 <dd><p>minimum value for the pixel component
2906 </p>
2907 </dd>
2908 <dt> &lsquo;<samp>negval</samp>&rsquo;</dt>
2909 <dd><p>the negated value for the pixel component value clipped in the
2910 <var>minval</var>-<var>maxval</var> range , it corresponds to the expression
2911 &quot;maxval-clipval+minval&quot;
2912 </p>
2913 </dd>
2914 <dt> &lsquo;<samp>clip(val)</samp>&rsquo;</dt>
2915 <dd><p>the computed value in <var>val</var> clipped in the
2916 <var>minval</var>-<var>maxval</var> range
2917 </p>
2918 </dd>
2919 <dt> &lsquo;<samp>gammaval(gamma)</samp>&rsquo;</dt>
2920 <dd><p>the computed gamma correction value of the pixel component value
2921 clipped in the <var>minval</var>-<var>maxval</var> range, corresponds to the
2922 expression
2923 &quot;pow((clipval-minval)/(maxval-minval)\,<var>gamma</var>)*(maxval-minval)+minval&quot;
2924 </p>
2925 </dd>
2926 </dl>
2927
2928 <p>All expressions default to &quot;val&quot;.
2929 </p>
2930 <p>Some examples follow:
2931 </p><table><tr><td>&nbsp;</td><td><pre class="example"># negate input video
2932 lutrgb=&quot;r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val&quot;
2933 lutyuv=&quot;y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val&quot;
2934
2935 # the above is the same as
2936 lutrgb=&quot;r=negval:g=negval:b=negval&quot;
2937 lutyuv=&quot;y=negval:u=negval:v=negval&quot;
2938
2939 # negate luminance
2940 lutyuv=negval
2941
2942 # remove chroma components, turns the video into a graytone image
2943 lutyuv=&quot;u=128:v=128&quot;
2944
2945 # apply a luma burning effect
2946 lutyuv=&quot;y=2*val&quot;
2947
2948 # remove green and blue components
2949 lutrgb=&quot;g=0:b=0&quot;
2950
2951 # set a constant alpha channel value on input
2952 format=rgba,lutrgb=a=&quot;maxval-minval/2&quot;
2953
2954 # correct luminance gamma by a 0.5 factor
2955 lutyuv=y=gammaval(0.5)
2956 </pre></td></tr></table>
2957
2958 <a name="mp"></a>
2959 <h2 class="section"><a href="ffplay.html#toc-mp">16.17 mp</a></h2>
2960
2961 <p>Apply an MPlayer filter to the input video.
2962 </p>
2963 <p>This filter provides a wrapper around most of the filters of
2964 MPlayer/MEncoder.
2965 </p>
2966 <p>This wrapper is considered experimental. Some of the wrapped filters
2967 may not work properly and we may drop support for them, as they will
2968 be implemented natively into FFmpeg. Thus you should avoid
2969 depending on them when writing portable scripts.
2970 </p>
2971 <p>The filters accepts the parameters:
2972 <var>filter_name</var>[:=]<var>filter_params</var>
2973 </p>
2974 <p><var>filter_name</var> is the name of a supported MPlayer filter,
2975 <var>filter_params</var> is a string containing the parameters accepted by
2976 the named filter.
2977 </p>
2978 <p>The list of the currently supported filters follows:
2979 </p><dl compact="compact">
2980 <dt> <var>2xsai</var></dt>
2981 <dt> <var>decimate</var></dt>
2982 <dt> <var>delogo</var></dt>
2983 <dt> <var>denoise3d</var></dt>
2984 <dt> <var>detc</var></dt>
2985 <dt> <var>dint</var></dt>
2986 <dt> <var>divtc</var></dt>
2987 <dt> <var>down3dright</var></dt>
2988 <dt> <var>dsize</var></dt>
2989 <dt> <var>eq2</var></dt>
2990 <dt> <var>eq</var></dt>
2991 <dt> <var>field</var></dt>
2992 <dt> <var>fil</var></dt>
2993 <dt> <var>fixpts</var></dt>
2994 <dt> <var>framestep</var></dt>
2995 <dt> <var>fspp</var></dt>
2996 <dt> <var>geq</var></dt>
2997 <dt> <var>gradfun</var></dt>
2998 <dt> <var>harddup</var></dt>
2999 <dt> <var>hqdn3d</var></dt>
3000 <dt> <var>hue</var></dt>
3001 <dt> <var>il</var></dt>
3002 <dt> <var>ilpack</var></dt>
3003 <dt> <var>ivtc</var></dt>
3004 <dt> <var>kerndeint</var></dt>
3005 <dt> <var>mcdeint</var></dt>
3006 <dt> <var>mirror</var></dt>
3007 <dt> <var>noise</var></dt>
3008 <dt> <var>ow</var></dt>
3009 <dt> <var>palette</var></dt>
3010 <dt> <var>perspective</var></dt>
3011 <dt> <var>phase</var></dt>
3012 <dt> <var>pp7</var></dt>
3013 <dt> <var>pullup</var></dt>
3014 <dt> <var>qp</var></dt>
3015 <dt> <var>rectangle</var></dt>
3016 <dt> <var>remove-logo</var></dt>
3017 <dt> <var>rotate</var></dt>
3018 <dt> <var>sab</var></dt>
3019 <dt> <var>screenshot</var></dt>
3020 <dt> <var>smartblur</var></dt>
3021 <dt> <var>softpulldown</var></dt>
3022 <dt> <var>softskip</var></dt>
3023 <dt> <var>spp</var></dt>
3024 <dt> <var>swapuv</var></dt>
3025 <dt> <var>telecine</var></dt>
3026 <dt> <var>test</var></dt>
3027 <dt> <var>tile</var></dt>
3028 <dt> <var>tinterlace</var></dt>
3029 <dt> <var>unsharp</var></dt>
3030 <dt> <var>uspp</var></dt>
3031 <dt> <var>yuvcsp</var></dt>
3032 <dt> <var>yvu9</var></dt>
3033 </dl>
3034
3035 <p>The parameter syntax and behavior for the listed filters are the same
3036 of the corresponding MPlayer filters. For detailed instructions check
3037 the &quot;VIDEO FILTERS&quot; section in the MPlayer manual.
3038 </p>
3039 <p>Some examples follow:
3040 </p><table><tr><td>&nbsp;</td><td><pre class="example"># remove a logo by interpolating the surrounding pixels
3041 mp=delogo=200:200:80:20:1
3042
3043 # adjust gamma, brightness, contrast
3044 mp=eq2=1.0:2:0.5
3045
3046 # tweak hue and saturation
3047 mp=hue=100:-10
3048 </pre></td></tr></table>
3049
3050 <p>See also mplayer(1), <a href="http://www.mplayerhq.hu/">http://www.mplayerhq.hu/</a>.
3051 </p>
3052 <a name="negate"></a>
3053 <h2 class="section"><a href="ffplay.html#toc-negate">16.18 negate</a></h2>
3054
3055 <p>Negate input video.
3056 </p>
3057 <p>This filter accepts an integer in input, if non-zero it negates the
3058 alpha component (if available). The default value in input is 0.
3059 </p>
3060 <a name="noformat"></a>
3061 <h2 class="section"><a href="ffplay.html#toc-noformat">16.19 noformat</a></h2>
3062
3063 <p>Force libavfilter not to use any of the specified pixel formats for the
3064 input to the next filter.
3065 </p>
3066 <p>The filter accepts a list of pixel format names, separated by &quot;:&quot;,
3067 for example &quot;yuv420p:monow:rgb24&quot;.
3068 </p>
3069 <p>Some examples follow:
3070 </p><table><tr><td>&nbsp;</td><td><pre class="example"># force libavfilter to use a format different from &quot;yuv420p&quot; for the
3071 # input to the vflip filter
3072 noformat=yuv420p,vflip
3073
3074 # convert the input video to any of the formats not contained in the list
3075 noformat=yuv420p:yuv444p:yuv410p
3076 </pre></td></tr></table>
3077
3078 <a name="null-1"></a>
3079 <h2 class="section"><a href="ffplay.html#toc-null-1">16.20 null</a></h2>
3080
3081 <p>Pass the video source unchanged to the output.
3082 </p>
3083 <a name="ocv"></a>
3084 <h2 class="section"><a href="ffplay.html#toc-ocv">16.21 ocv</a></h2>
3085
3086 <p>Apply video transform using libopencv.
3087 </p>
3088 <p>To enable this filter install libopencv library and headers and
3089 configure FFmpeg with &ndash;enable-libopencv.
3090 </p>
3091 <p>The filter takes the parameters: <var>filter_name</var>{:=}<var>filter_params</var>.
3092 </p>
3093 <p><var>filter_name</var> is the name of the libopencv filter to apply.
3094 </p>
3095 <p><var>filter_params</var> specifies the parameters to pass to the libopencv
3096 filter. If not specified the default values are assumed.
3097 </p>
3098 <p>Refer to the official libopencv documentation for more precise
3099 informations:
3100 <a href="http://opencv.willowgarage.com/documentation/c/image_filtering.html">http://opencv.willowgarage.com/documentation/c/image_filtering.html</a>
3101 </p>
3102 <p>Follows the list of supported libopencv filters.
3103 </p>
3104 <p><a name="dilate"></a>
3105 </p><a name="dilate-1"></a>
3106 <h3 class="subsection"><a href="ffplay.html#toc-dilate-1">16.21.1 dilate</a></h3>
3107
3108 <p>Dilate an image by using a specific structuring element.
3109 This filter corresponds to the libopencv function <code>cvDilate</code>.
3110 </p>
3111 <p>It accepts the parameters: <var>struct_el</var>:<var>nb_iterations</var>.
3112 </p>
3113 <p><var>struct_el</var> represents a structuring element, and has the syntax:
3114 <var>cols</var>x<var>rows</var>+<var>anchor_x</var>x<var>anchor_y</var>/<var>shape</var>
3115 </p>
3116 <p><var>cols</var> and <var>rows</var> represent the number of colums and rows of
3117 the structuring element, <var>anchor_x</var> and <var>anchor_y</var> the anchor
3118 point, and <var>shape</var> the shape for the structuring element, and
3119 can be one of the values &quot;rect&quot;, &quot;cross&quot;, &quot;ellipse&quot;, &quot;custom&quot;.
3120 </p>
3121 <p>If the value for <var>shape</var> is &quot;custom&quot;, it must be followed by a
3122 string of the form &quot;=<var>filename</var>&quot;. The file with name
3123 <var>filename</var> is assumed to represent a binary image, with each
3124 printable character corresponding to a bright pixel. When a custom
3125 <var>shape</var> is used, <var>cols</var> and <var>rows</var> are ignored, the number
3126 or columns and rows of the read file are assumed instead.
3127 </p>
3128 <p>The default value for <var>struct_el</var> is &quot;3x3+0x0/rect&quot;.
3129 </p>
3130 <p><var>nb_iterations</var> specifies the number of times the transform is
3131 applied to the image, and defaults to 1.
3132 </p>
3133 <p>Follow some example:
3134 </p><table><tr><td>&nbsp;</td><td><pre class="example"># use the default values
3135 ocv=dilate
3136
3137 # dilate using a structuring element with a 5x5 cross, iterate two times
3138 ocv=dilate=5x5+2x2/cross:2
3139
3140 # read the shape from the file diamond.shape, iterate two times
3141 # the file diamond.shape may contain a pattern of characters like this:
3142 #   *
3143 #  ***
3144 # *****
3145 #  ***
3146 #   *
3147 # the specified cols and rows are ignored (but not the anchor point coordinates)
3148 ocv=0x0+2x2/custom=diamond.shape:2
3149 </pre></td></tr></table>
3150
3151 <a name="erode"></a>
3152 <h3 class="subsection"><a href="ffplay.html#toc-erode">16.21.2 erode</a></h3>
3153
3154 <p>Erode an image by using a specific structuring element.
3155 This filter corresponds to the libopencv function <code>cvErode</code>.
3156 </p>
3157 <p>The filter accepts the parameters: <var>struct_el</var>:<var>nb_iterations</var>,
3158 with the same syntax and semantics as the <a href="#dilate">dilate</a> filter.
3159 </p>
3160 <a name="smooth"></a>
3161 <h3 class="subsection"><a href="ffplay.html#toc-smooth">16.21.3 smooth</a></h3>
3162
3163 <p>Smooth the input video.
3164 </p>
3165 <p>The filter takes the following parameters:
3166 <var>type</var>:<var>param1</var>:<var>param2</var>:<var>param3</var>:<var>param4</var>.
3167 </p>
3168 <p><var>type</var> is the type of smooth filter to apply, and can be one of
3169 the following values: &quot;blur&quot;, &quot;blur_no_scale&quot;, &quot;median&quot;, &quot;gaussian&quot;,
3170 &quot;bilateral&quot;. The default value is &quot;gaussian&quot;.
3171 </p>
3172 <p><var>param1</var>, <var>param2</var>, <var>param3</var>, and <var>param4</var> are
3173 parameters whose meanings depend on smooth type. <var>param1</var> and
3174 <var>param2</var> accept integer positive values or 0, <var>param3</var> and
3175 <var>param4</var> accept float values.
3176 </p>
3177 <p>The default value for <var>param1</var> is 3, the default value for the
3178 other parameters is 0.
3179 </p>
3180 <p>These parameters correspond to the parameters assigned to the
3181 libopencv function <code>cvSmooth</code>.
3182 </p>
3183 <a name="overlay"></a>
3184 <h2 class="section"><a href="ffplay.html#toc-overlay">16.22 overlay</a></h2>
3185
3186 <p>Overlay one video on top of another.
3187 </p>
3188 <p>It takes two inputs and one output, the first input is the &quot;main&quot;
3189 video on which the second input is overlayed.
3190 </p>
3191 <p>It accepts the parameters: <var>x</var>:<var>y</var>.
3192 </p>
3193 <p><var>x</var> is the x coordinate of the overlayed video on the main video,
3194 <var>y</var> is the y coordinate. The parameters are expressions containing
3195 the following parameters:
3196 </p>
3197 <dl compact="compact">
3198 <dt> &lsquo;<samp>main_w, main_h</samp>&rsquo;</dt>
3199 <dd><p>main input width and height
3200 </p>
3201 </dd>
3202 <dt> &lsquo;<samp>W, H</samp>&rsquo;</dt>
3203 <dd><p>same as <var>main_w</var> and <var>main_h</var>
3204 </p>
3205 </dd>
3206 <dt> &lsquo;<samp>overlay_w, overlay_h</samp>&rsquo;</dt>
3207 <dd><p>overlay input width and height
3208 </p>
3209 </dd>
3210 <dt> &lsquo;<samp>w, h</samp>&rsquo;</dt>
3211 <dd><p>same as <var>overlay_w</var> and <var>overlay_h</var>
3212 </p></dd>
3213 </dl>
3214
3215 <p>Be aware that frames are taken from each input video in timestamp
3216 order, hence, if their initial timestamps differ, it is a a good idea
3217 to pass the two inputs through a <var>setpts=PTS-STARTPTS</var> filter to
3218 have them begin in the same zero timestamp, as it does the example for
3219 the <var>movie</var> filter.
3220 </p>
3221 <p>Follow some examples:
3222 </p><table><tr><td>&nbsp;</td><td><pre class="example"># draw the overlay at 10 pixels from the bottom right
3223 # corner of the main video.
3224 overlay=main_w-overlay_w-10:main_h-overlay_h-10
3225
3226 # insert a transparent PNG logo in the bottom left corner of the input
3227 movie=logo.png [logo];
3228 [in][logo] overlay=10:main_h-overlay_h-10 [out]
3229
3230 # insert 2 different transparent PNG logos (second logo on bottom
3231 # right corner):
3232 movie=logo1.png [logo1];
3233 movie=logo2.png [logo2];
3234 [in][logo1]       overlay=10:H-h-10 [in+logo1];
3235 [in+logo1][logo2] overlay=W-w-10:H-h-10 [out]
3236
3237 # add a transparent color layer on top of the main video,
3238 # WxH specifies the size of the main input to the overlay filter
3239 color=red.3:WxH [over]; [in][over] overlay [out]
3240 </pre></td></tr></table>
3241
3242 <p>You can chain togheter more overlays but the efficiency of such
3243 approach is yet to be tested.
3244 </p>
3245 <a name="pad"></a>
3246 <h2 class="section"><a href="ffplay.html#toc-pad">16.23 pad</a></h2>
3247
3248 <p>Add paddings to the input image, and places the original input at the
3249 given coordinates <var>x</var>, <var>y</var>.
3250 </p>
3251 <p>It accepts the following parameters:
3252 <var>width</var>:<var>height</var>:<var>x</var>:<var>y</var>:<var>color</var>.
3253 </p>
3254 <p>The parameters <var>width</var>, <var>height</var>, <var>x</var>, and <var>y</var> are
3255 expressions containing the following constants:
3256 </p>
3257 <dl compact="compact">
3258 <dt> &lsquo;<samp>E, PI, PHI</samp>&rsquo;</dt>
3259 <dd><p>the corresponding mathematical approximated values for e
3260 (euler number), pi (greek PI), phi (golden ratio)
3261 </p>
3262 </dd>
3263 <dt> &lsquo;<samp>in_w, in_h</samp>&rsquo;</dt>
3264 <dd><p>the input video width and heigth
3265 </p>
3266 </dd>
3267 <dt> &lsquo;<samp>iw, ih</samp>&rsquo;</dt>
3268 <dd><p>same as <var>in_w</var> and <var>in_h</var>
3269 </p>
3270 </dd>
3271 <dt> &lsquo;<samp>out_w, out_h</samp>&rsquo;</dt>
3272 <dd><p>the output width and heigth, that is the size of the padded area as
3273 specified by the <var>width</var> and <var>height</var> expressions
3274 </p>
3275 </dd>
3276 <dt> &lsquo;<samp>ow, oh</samp>&rsquo;</dt>
3277 <dd><p>same as <var>out_w</var> and <var>out_h</var>
3278 </p>
3279 </dd>
3280 <dt> &lsquo;<samp>x, y</samp>&rsquo;</dt>
3281 <dd><p>x and y offsets as specified by the <var>x</var> and <var>y</var>
3282 expressions, or NAN if not yet specified
3283 </p>
3284 </dd>
3285 <dt> &lsquo;<samp>dar, a</samp>&rsquo;</dt>
3286 <dd><p>input display aspect ratio, same as <var>iw</var> / <var>ih</var>
3287 </p>
3288 </dd>
3289 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
3290 <dd><p>input sample aspect ratio
3291 </p>
3292 </dd>
3293 <dt> &lsquo;<samp>hsub, vsub</samp>&rsquo;</dt>
3294 <dd><p>horizontal and vertical chroma subsample values. For example for the
3295 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
3296 </p></dd>
3297 </dl>
3298
3299 <p>Follows the description of the accepted parameters.
3300 </p>
3301 <dl compact="compact">
3302 <dt> &lsquo;<samp>width, height</samp>&rsquo;</dt>
3303 <dd>
3304 <p>Specify the size of the output image with the paddings added. If the
3305 value for <var>width</var> or <var>height</var> is 0, the corresponding input size
3306 is used for the output.
3307 </p>
3308 <p>The <var>width</var> expression can reference the value set by the
3309 <var>height</var> expression, and viceversa.
3310 </p>
3311 <p>The default value of <var>width</var> and <var>height</var> is 0.
3312 </p>
3313 </dd>
3314 <dt> &lsquo;<samp>x, y</samp>&rsquo;</dt>
3315 <dd>
3316 <p>Specify the offsets where to place the input image in the padded area
3317 with respect to the top/left border of the output image.
3318 </p>
3319 <p>The <var>x</var> expression can reference the value set by the <var>y</var>
3320 expression, and viceversa.
3321 </p>
3322 <p>The default value of <var>x</var> and <var>y</var> is 0.
3323 </p>
3324 </dd>
3325 <dt> &lsquo;<samp>color</samp>&rsquo;</dt>
3326 <dd>
3327 <p>Specify the color of the padded area, it can be the name of a color
3328 (case insensitive match) or a 0xRRGGBB[AA] sequence.
3329 </p>
3330 <p>The default value of <var>color</var> is &quot;black&quot;.
3331 </p>
3332 </dd>
3333 </dl>
3334
3335 <p>Some examples follow:
3336 </p>
3337 <table><tr><td>&nbsp;</td><td><pre class="example"># Add paddings with color &quot;violet&quot; to the input video. Output video
3338 # size is 640x480, the top-left corner of the input video is placed at
3339 # column 0, row 40.
3340 pad=640:480:0:40:violet
3341
3342 # pad the input to get an output with dimensions increased bt 3/2,
3343 # and put the input video at the center of the padded area
3344 pad=&quot;3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2&quot;
3345
3346 # pad the input to get a squared output with size equal to the maximum
3347 # value between the input width and height, and put the input video at
3348 # the center of the padded area
3349 pad=&quot;max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2&quot;
3350
3351 # pad the input to get a final w/h ratio of 16:9
3352 pad=&quot;ih*16/9:ih:(ow-iw)/2:(oh-ih)/2&quot;
3353
3354 # double output size and put the input video in the bottom-right
3355 # corner of the output padded area
3356 pad=&quot;2*iw:2*ih:ow-iw:oh-ih&quot;
3357 </pre></td></tr></table>
3358
3359 <a name="pixdesctest"></a>
3360 <h2 class="section"><a href="ffplay.html#toc-pixdesctest">16.24 pixdesctest</a></h2>
3361
3362 <p>Pixel format descriptor test filter, mainly useful for internal
3363 testing. The output video should be equal to the input video.
3364 </p>
3365 <p>For example:
3366 </p><table><tr><td>&nbsp;</td><td><pre class="example">format=monow, pixdesctest
3367 </pre></td></tr></table>
3368
3369 <p>can be used to test the monowhite pixel format descriptor definition.
3370 </p>
3371 <a name="scale"></a>
3372 <h2 class="section"><a href="ffplay.html#toc-scale">16.25 scale</a></h2>
3373
3374 <p>Scale the input video to <var>width</var>:<var>height</var> and/or convert the image format.
3375 </p>
3376 <p>The parameters <var>width</var> and <var>height</var> are expressions containing
3377 the following constants:
3378 </p>
3379 <dl compact="compact">
3380 <dt> &lsquo;<samp>E, PI, PHI</samp>&rsquo;</dt>
3381 <dd><p>the corresponding mathematical approximated values for e
3382 (euler number), pi (greek PI), phi (golden ratio)
3383 </p>
3384 </dd>
3385 <dt> &lsquo;<samp>in_w, in_h</samp>&rsquo;</dt>
3386 <dd><p>the input width and heigth
3387 </p>
3388 </dd>
3389 <dt> &lsquo;<samp>iw, ih</samp>&rsquo;</dt>
3390 <dd><p>same as <var>in_w</var> and <var>in_h</var>
3391 </p>
3392 </dd>
3393 <dt> &lsquo;<samp>out_w, out_h</samp>&rsquo;</dt>
3394 <dd><p>the output (cropped) width and heigth
3395 </p>
3396 </dd>
3397 <dt> &lsquo;<samp>ow, oh</samp>&rsquo;</dt>
3398 <dd><p>same as <var>out_w</var> and <var>out_h</var>
3399 </p>
3400 </dd>
3401 <dt> &lsquo;<samp>dar, a</samp>&rsquo;</dt>
3402 <dd><p>input display aspect ratio, same as <var>iw</var> / <var>ih</var>
3403 </p>
3404 </dd>
3405 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
3406 <dd><p>input sample aspect ratio
3407 </p>
3408 </dd>
3409 <dt> &lsquo;<samp>hsub, vsub</samp>&rsquo;</dt>
3410 <dd><p>horizontal and vertical chroma subsample values. For example for the
3411 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
3412 </p></dd>
3413 </dl>
3414
3415 <p>If the input image format is different from the format requested by
3416 the next filter, the scale filter will convert the input to the
3417 requested format.
3418 </p>
3419 <p>If the value for <var>width</var> or <var>height</var> is 0, the respective input
3420 size is used for the output.
3421 </p>
3422 <p>If the value for <var>width</var> or <var>height</var> is -1, the scale filter will
3423 use, for the respective output size, a value that maintains the aspect
3424 ratio of the input image.
3425 </p>
3426 <p>The default value of <var>width</var> and <var>height</var> is 0.
3427 </p>
3428 <p>Some examples follow:
3429 </p><table><tr><td>&nbsp;</td><td><pre class="example"># scale the input video to a size of 200x100.
3430 scale=200:100
3431
3432 # scale the input to 2x
3433 scale=2*iw:2*ih
3434 # the above is the same as
3435 scale=2*in_w:2*in_h
3436
3437 # scale the input to half size
3438 scale=iw/2:ih/2
3439
3440 # increase the width, and set the height to the same size
3441 scale=3/2*iw:ow
3442
3443 # seek for Greek harmony
3444 scale=iw:1/PHI*iw
3445 scale=ih*PHI:ih
3446
3447 # increase the height, and set the width to 3/2 of the height
3448 scale=3/2*oh:3/5*ih
3449
3450 # increase the size, but make the size a multiple of the chroma
3451 scale=&quot;trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub&quot;
3452
3453 # increase the width to a maximum of 500 pixels, keep the same input aspect ratio
3454 scale='min(500\, iw*3/2):-1'
3455 </pre></td></tr></table>
3456
3457 <a name="select"></a>
3458 <h2 class="section"><a href="ffplay.html#toc-select">16.26 select</a></h2>
3459 <p>Select frames to pass in output.
3460 </p>
3461 <p>It accepts in input an expression, which is evaluated for each input
3462 frame. If the expression is evaluated to a non-zero value, the frame
3463 is selected and passed to the output, otherwise it is discarded.
3464 </p>
3465 <p>The expression can contain the following constants:
3466 </p>
3467 <dl compact="compact">
3468 <dt> &lsquo;<samp>PI</samp>&rsquo;</dt>
3469 <dd><p>Greek PI
3470 </p>
3471 </dd>
3472 <dt> &lsquo;<samp>PHI</samp>&rsquo;</dt>
3473 <dd><p>golden ratio
3474 </p>
3475 </dd>
3476 <dt> &lsquo;<samp>E</samp>&rsquo;</dt>
3477 <dd><p>Euler number
3478 </p>
3479 </dd>
3480 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
3481 <dd><p>the sequential number of the filtered frame, starting from 0
3482 </p>
3483 </dd>
3484 <dt> &lsquo;<samp>selected_n</samp>&rsquo;</dt>
3485 <dd><p>the sequential number of the selected frame, starting from 0
3486 </p>
3487 </dd>
3488 <dt> &lsquo;<samp>prev_selected_n</samp>&rsquo;</dt>
3489 <dd><p>the sequential number of the last selected frame, NAN if undefined
3490 </p>
3491 </dd>
3492 <dt> &lsquo;<samp>TB</samp>&rsquo;</dt>
3493 <dd><p>timebase of the input timestamps
3494 </p>
3495 </dd>
3496 <dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
3497 <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
3498 expressed in <var>TB</var> units, NAN if undefined
3499 </p>
3500 </dd>
3501 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
3502 <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
3503 expressed in seconds, NAN if undefined
3504 </p>
3505 </dd>
3506 <dt> &lsquo;<samp>prev_pts</samp>&rsquo;</dt>
3507 <dd><p>the PTS of the previously filtered video frame, NAN if undefined
3508 </p>
3509 </dd>
3510 <dt> &lsquo;<samp>prev_selected_pts</samp>&rsquo;</dt>
3511 <dd><p>the PTS of the last previously filtered video frame, NAN if undefined
3512 </p>
3513 </dd>
3514 <dt> &lsquo;<samp>prev_selected_t</samp>&rsquo;</dt>
3515 <dd><p>the PTS of the last previously selected video frame, NAN if undefined
3516 </p>
3517 </dd>
3518 <dt> &lsquo;<samp>start_pts</samp>&rsquo;</dt>
3519 <dd><p>the PTS of the first video frame in the video, NAN if undefined
3520 </p>
3521 </dd>
3522 <dt> &lsquo;<samp>start_t</samp>&rsquo;</dt>
3523 <dd><p>the time of the first video frame in the video, NAN if undefined
3524 </p>
3525 </dd>
3526 <dt> &lsquo;<samp>pict_type</samp>&rsquo;</dt>
3527 <dd><p>the picture type of the filtered frame, can assume one of the following
3528 values:
3529 </p><dl compact="compact">
3530 <dt> &lsquo;<samp>PICT_TYPE_I</samp>&rsquo;</dt>
3531 <dt> &lsquo;<samp>PICT_TYPE_P</samp>&rsquo;</dt>
3532 <dt> &lsquo;<samp>PICT_TYPE_B</samp>&rsquo;</dt>
3533 <dt> &lsquo;<samp>PICT_TYPE_S</samp>&rsquo;</dt>
3534 <dt> &lsquo;<samp>PICT_TYPE_SI</samp>&rsquo;</dt>
3535 <dt> &lsquo;<samp>PICT_TYPE_SP</samp>&rsquo;</dt>
3536 <dt> &lsquo;<samp>PICT_TYPE_BI</samp>&rsquo;</dt>
3537 </dl>
3538
3539 </dd>
3540 <dt> &lsquo;<samp>interlace_type</samp>&rsquo;</dt>
3541 <dd><p>the frame interlace type, can assume one of the following values:
3542 </p><dl compact="compact">
3543 <dt> &lsquo;<samp>INTERLACE_TYPE_P</samp>&rsquo;</dt>
3544 <dd><p>the frame is progressive (not interlaced)
3545 </p></dd>
3546 <dt> &lsquo;<samp>INTERLACE_TYPE_T</samp>&rsquo;</dt>
3547 <dd><p>the frame is top-field-first
3548 </p></dd>
3549 <dt> &lsquo;<samp>INTERLACE_TYPE_B</samp>&rsquo;</dt>
3550 <dd><p>the frame is bottom-field-first
3551 </p></dd>
3552 </dl>
3553
3554 </dd>
3555 <dt> &lsquo;<samp>key</samp>&rsquo;</dt>
3556 <dd><p>1 if the filtered frame is a key-frame, 0 otherwise
3557 </p>
3558 </dd>
3559 <dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
3560 <dd><p>the position in the file of the filtered frame, -1 if the information
3561 is not available (e.g. for synthetic video)
3562 </p></dd>
3563 </dl>
3564
3565 <p>The default value of the select expression is &quot;1&quot;.
3566 </p>
3567 <p>Some examples follow:
3568 </p>
3569 <table><tr><td>&nbsp;</td><td><pre class="example"># select all frames in input
3570 select
3571
3572 # the above is the same as:
3573 select=1
3574
3575 # skip all frames:
3576 select=0
3577
3578 # select only I-frames
3579 select='eq(pict_type\,PICT_TYPE_I)'
3580
3581 # select one frame every 100
3582 select='not(mod(n\,100))'
3583
3584 # select only frames contained in the 10-20 time interval
3585 select='gte(t\,10)*lte(t\,20)'
3586
3587 # select only I frames contained in the 10-20 time interval
3588 select='gte(t\,10)*lte(t\,20)*eq(pict_type\,PICT_TYPE_I)'
3589
3590 # select frames with a minimum distance of 10 seconds
3591 select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
3592 </pre></td></tr></table>
3593
3594 <p><a name="setdar"></a>
3595 </p><a name="setdar-1"></a>
3596 <h2 class="section"><a href="ffplay.html#toc-setdar-1">16.27 setdar</a></h2>
3597
3598 <p>Set the Display Aspect Ratio for the filter output video.
3599 </p>
3600 <p>This is done by changing the specified Sample (aka Pixel) Aspect
3601 Ratio, according to the following equation:
3602 <em>DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR</em>
3603 </p>
3604 <p>Keep in mind that this filter does not modify the pixel dimensions of
3605 the video frame. Also the display aspect ratio set by this filter may
3606 be changed by later filters in the filterchain, e.g. in case of
3607 scaling or if another &quot;setdar&quot; or a &quot;setsar&quot; filter is applied.
3608 </p>
3609 <p>The filter accepts a parameter string which represents the wanted
3610 display aspect ratio.
3611 The parameter can be a floating point number string, or an expression
3612 of the form <var>num</var>:<var>den</var>, where <var>num</var> and <var>den</var> are the
3613 numerator and denominator of the aspect ratio.
3614 If the parameter is not specified, it is assumed the value &quot;0:1&quot;.
3615 </p>
3616 <p>For example to change the display aspect ratio to 16:9, specify:
3617 </p><table><tr><td>&nbsp;</td><td><pre class="example">setdar=16:9
3618 # the above is equivalent to
3619 setdar=1.77777
3620 </pre></td></tr></table>
3621
3622 <p>See also the <a href="#setsar">setsar</a> filter documentation.
3623 </p>
3624 <a name="setpts"></a>
3625 <h2 class="section"><a href="ffplay.html#toc-setpts">16.28 setpts</a></h2>
3626
3627 <p>Change the PTS (presentation timestamp) of the input video frames.
3628 </p>
3629 <p>Accept in input an expression evaluated through the eval API, which
3630 can contain the following constants:
3631 </p>
3632 <dl compact="compact">
3633 <dt> &lsquo;<samp>PTS</samp>&rsquo;</dt>
3634 <dd><p>the presentation timestamp in input
3635 </p>
3636 </dd>
3637 <dt> &lsquo;<samp>PI</samp>&rsquo;</dt>
3638 <dd><p>Greek PI
3639 </p>
3640 </dd>
3641 <dt> &lsquo;<samp>PHI</samp>&rsquo;</dt>
3642 <dd><p>golden ratio
3643 </p>
3644 </dd>
3645 <dt> &lsquo;<samp>E</samp>&rsquo;</dt>
3646 <dd><p>Euler number
3647 </p>
3648 </dd>
3649 <dt> &lsquo;<samp>N</samp>&rsquo;</dt>
3650 <dd><p>the count of the input frame, starting from 0.
3651 </p>
3652 </dd>
3653 <dt> &lsquo;<samp>STARTPTS</samp>&rsquo;</dt>
3654 <dd><p>the PTS of the first video frame
3655 </p>
3656 </dd>
3657 <dt> &lsquo;<samp>INTERLACED</samp>&rsquo;</dt>
3658 <dd><p>tell if the current frame is interlaced
3659 </p>
3660 </dd>
3661 <dt> &lsquo;<samp>POS</samp>&rsquo;</dt>
3662 <dd><p>original position in the file of the frame, or undefined if undefined
3663 for the current frame
3664 </p>
3665 </dd>
3666 <dt> &lsquo;<samp>PREV_INPTS</samp>&rsquo;</dt>
3667 <dd><p>previous input PTS
3668 </p>
3669 </dd>
3670 <dt> &lsquo;<samp>PREV_OUTPTS</samp>&rsquo;</dt>
3671 <dd><p>previous output PTS
3672 </p>
3673 </dd>
3674 </dl>
3675
3676 <p>Some examples follow:
3677 </p>
3678 <table><tr><td>&nbsp;</td><td><pre class="example"># start counting PTS from zero
3679 setpts=PTS-STARTPTS
3680
3681 # fast motion
3682 setpts=0.5*PTS
3683
3684 # slow motion
3685 setpts=2.0*PTS
3686
3687 # fixed rate 25 fps
3688 setpts=N/(25*TB)
3689
3690 # fixed rate 25 fps with some jitter
3691 setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
3692 </pre></td></tr></table>
3693
3694 <p><a name="setsar"></a>
3695 </p><a name="setsar-1"></a>
3696 <h2 class="section"><a href="ffplay.html#toc-setsar-1">16.29 setsar</a></h2>
3697
3698 <p>Set the Sample (aka Pixel) Aspect Ratio for the filter output video.
3699 </p>
3700 <p>Note that as a consequence of the application of this filter, the
3701 output display aspect ratio will change according to the following
3702 equation:
3703 <em>DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR</em>
3704 </p>
3705 <p>Keep in mind that the sample aspect ratio set by this filter may be
3706 changed by later filters in the filterchain, e.g. if another &quot;setsar&quot;
3707 or a &quot;setdar&quot; filter is applied.
3708 </p>
3709 <p>The filter accepts a parameter string which represents the wanted
3710 sample aspect ratio.
3711 The parameter can be a floating point number string, or an expression
3712 of the form <var>num</var>:<var>den</var>, where <var>num</var> and <var>den</var> are the
3713 numerator and denominator of the aspect ratio.
3714 If the parameter is not specified, it is assumed the value &quot;0:1&quot;.
3715 </p>
3716 <p>For example to change the sample aspect ratio to 10:11, specify:
3717 </p><table><tr><td>&nbsp;</td><td><pre class="example">setsar=10:11
3718 </pre></td></tr></table>
3719
3720 <a name="settb"></a>
3721 <h2 class="section"><a href="ffplay.html#toc-settb">16.30 settb</a></h2>
3722
3723 <p>Set the timebase to use for the output frames timestamps.
3724 It is mainly useful for testing timebase configuration.
3725 </p>
3726 <p>It accepts in input an arithmetic expression representing a rational.
3727 The expression can contain the constants &quot;PI&quot;, &quot;E&quot;, &quot;PHI&quot;, &quot;AVTB&quot; (the
3728 default timebase), and &quot;intb&quot; (the input timebase).
3729 </p>
3730 <p>The default value for the input is &quot;intb&quot;.
3731 </p>
3732 <p>Follow some examples.
3733 </p>
3734 <table><tr><td>&nbsp;</td><td><pre class="example"># set the timebase to 1/25
3735 settb=1/25
3736
3737 # set the timebase to 1/10
3738 settb=0.1
3739
3740 #set the timebase to 1001/1000
3741 settb=1+0.001
3742
3743 #set the timebase to 2*intb
3744 settb=2*intb
3745
3746 #set the default timebase value
3747 settb=AVTB
3748 </pre></td></tr></table>
3749
3750 <a name="showinfo"></a>
3751 <h2 class="section"><a href="ffplay.html#toc-showinfo">16.31 showinfo</a></h2>
3752
3753 <p>Show a line containing various information for each input video frame.
3754 The input video is not modified.
3755 </p>
3756 <p>The shown line contains a sequence of key/value pairs of the form
3757 <var>key</var>:<var>value</var>.
3758 </p>
3759 <p>A description of each shown parameter follows:
3760 </p>
3761 <dl compact="compact">
3762 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
3763 <dd><p>sequential number of the input frame, starting from 0
3764 </p>
3765 </dd>
3766 <dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
3767 <dd><p>Presentation TimeStamp of the input frame, expressed as a number of
3768 time base units. The time base unit depends on the filter input pad.
3769 </p>
3770 </dd>
3771 <dt> &lsquo;<samp>pts_time</samp>&rsquo;</dt>
3772 <dd><p>Presentation TimeStamp of the input frame, expressed as a number of
3773 seconds
3774 </p>
3775 </dd>
3776 <dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
3777 <dd><p>position of the frame in the input stream, -1 if this information in
3778 unavailable and/or meanigless (for example in case of synthetic video)
3779 </p>
3780 </dd>
3781 <dt> &lsquo;<samp>fmt</samp>&rsquo;</dt>
3782 <dd><p>pixel format name
3783 </p>
3784 </dd>
3785 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
3786 <dd><p>sample aspect ratio of the input frame, expressed in the form
3787 <var>num</var>/<var>den</var>
3788 </p>
3789 </dd>
3790 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
3791 <dd><p>size of the input frame, expressed in the form
3792 <var>width</var>x<var>height</var>
3793 </p>
3794 </dd>
3795 <dt> &lsquo;<samp>i</samp>&rsquo;</dt>
3796 <dd><p>interlaced mode (&quot;P&quot; for &quot;progressive&quot;, &quot;T&quot; for top field first, &quot;B&quot;
3797 for bottom field first)
3798 </p>
3799 </dd>
3800 <dt> &lsquo;<samp>iskey</samp>&rsquo;</dt>
3801 <dd><p>1 if the frame is a key frame, 0 otherwise
3802 </p>
3803 </dd>
3804 <dt> &lsquo;<samp>type</samp>&rsquo;</dt>
3805 <dd><p>picture type of the input frame (&quot;I&quot; for an I-frame, &quot;P&quot; for a
3806 P-frame, &quot;B&quot; for a B-frame, &quot;?&quot; for unknown type).
3807 Check also the documentation of the <code>AVPictureType</code> enum and of
3808 the <code>av_get_picture_type_char</code> function defined in
3809 &lsquo;<tt>libavutil/avutil.h</tt>&rsquo;.
3810 </p>
3811 </dd>
3812 <dt> &lsquo;<samp>checksum</samp>&rsquo;</dt>
3813 <dd><p>Adler-32 checksum of all the planes of the input frame
3814 </p>
3815 </dd>
3816 <dt> &lsquo;<samp>plane_checksum</samp>&rsquo;</dt>
3817 <dd><p>Adler-32 checksum of each plane of the input frame, expressed in the form
3818 &quot;[<var>c0</var> <var>c1</var> <var>c2</var> <var>c3</var>]&quot;
3819 </p></dd>
3820 </dl>
3821
3822 <a name="slicify"></a>
3823 <h2 class="section"><a href="ffplay.html#toc-slicify">16.32 slicify</a></h2>
3824
3825 <p>Pass the images of input video on to next video filter as multiple
3826 slices.
3827 </p>
3828 <table><tr><td>&nbsp;</td><td><pre class="example">./ffmpeg -i in.avi -vf &quot;slicify=32&quot; out.avi
3829 </pre></td></tr></table>
3830
3831 <p>The filter accepts the slice height as parameter. If the parameter is
3832 not specified it will use the default value of 16.
3833 </p>
3834 <p>Adding this in the beginning of filter chains should make filtering
3835 faster due to better use of the memory cache.
3836 </p>
3837 <a name="split"></a>
3838 <h2 class="section"><a href="ffplay.html#toc-split">16.33 split</a></h2>
3839
3840 <p>Pass on the input video to two outputs. Both outputs are identical to
3841 the input video.
3842 </p>
3843 <p>For example:
3844 </p><table><tr><td>&nbsp;</td><td><pre class="example">[in] split [splitout1][splitout2];
3845 [splitout1] crop=100:100:0:0    [cropout];
3846 [splitout2] pad=200:200:100:100 [padout];
3847 </pre></td></tr></table>
3848
3849 <p>will create two separate outputs from the same input, one cropped and
3850 one padded.
3851 </p>
3852 <a name="transpose"></a>
3853 <h2 class="section"><a href="ffplay.html#toc-transpose">16.34 transpose</a></h2>
3854
3855 <p>Transpose rows with columns in the input video and optionally flip it.
3856 </p>
3857 <p>It accepts a parameter representing an integer, which can assume the
3858 values:
3859 </p>
3860 <dl compact="compact">
3861 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
3862 <dd><p>Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
3863 </p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     L.l
3864 . . -&gt;  . .
3865 l.r     R.r
3866 </pre></td></tr></table>
3867
3868 </dd>
3869 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
3870 <dd><p>Rotate by 90 degrees clockwise, that is:
3871 </p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     l.L
3872 . . -&gt;  . .
3873 l.r     r.R
3874 </pre></td></tr></table>
3875
3876 </dd>
3877 <dt> &lsquo;<samp>2</samp>&rsquo;</dt>
3878 <dd><p>Rotate by 90 degrees counterclockwise, that is:
3879 </p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     R.r
3880 . . -&gt;  . .
3881 l.r     L.l
3882 </pre></td></tr></table>
3883
3884 </dd>
3885 <dt> &lsquo;<samp>3</samp>&rsquo;</dt>
3886 <dd><p>Rotate by 90 degrees clockwise and vertically flip, that is:
3887 </p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     r.R
3888 . . -&gt;  . .
3889 l.r     l.L
3890 </pre></td></tr></table>
3891 </dd>
3892 </dl>
3893
3894 <a name="unsharp"></a>
3895 <h2 class="section"><a href="ffplay.html#toc-unsharp">16.35 unsharp</a></h2>
3896
3897 <p>Sharpen or blur the input video.
3898 </p>
3899 <p>It accepts the following parameters:
3900 <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>
3901 </p>
3902 <p>Negative values for the amount will blur the input video, while positive
3903 values will sharpen. All parameters are optional and default to the
3904 equivalent of the string &rsquo;5:5:1.0:0:0:0.0&rsquo;.
3905 </p>
3906 <dl compact="compact">
3907 <dt> &lsquo;<samp>luma_msize_x</samp>&rsquo;</dt>
3908 <dd><p>Set the luma matrix horizontal size. It can be an integer between 3
3909 and 13, default value is 5.
3910 </p>
3911 </dd>
3912 <dt> &lsquo;<samp>luma_msize_y</samp>&rsquo;</dt>
3913 <dd><p>Set the luma matrix vertical size. It can be an integer between 3
3914 and 13, default value is 5.
3915 </p>
3916 </dd>
3917 <dt> &lsquo;<samp>luma_amount</samp>&rsquo;</dt>
3918 <dd><p>Set the luma effect strength. It can be a float number between -2.0
3919 and 5.0, default value is 1.0.
3920 </p>
3921 </dd>
3922 <dt> &lsquo;<samp>chroma_msize_x</samp>&rsquo;</dt>
3923 <dd><p>Set the chroma matrix horizontal size. It can be an integer between 3
3924 and 13, default value is 0.
3925 </p>
3926 </dd>
3927 <dt> &lsquo;<samp>chroma_msize_y</samp>&rsquo;</dt>
3928 <dd><p>Set the chroma matrix vertical size. It can be an integer between 3
3929 and 13, default value is 0.
3930 </p>
3931 </dd>
3932 <dt> &lsquo;<samp>luma_amount</samp>&rsquo;</dt>
3933 <dd><p>Set the chroma effect strength. It can be a float number between -2.0
3934 and 5.0, default value is 0.0.
3935 </p>
3936 </dd>
3937 </dl>
3938
3939 <table><tr><td>&nbsp;</td><td><pre class="example"># Strong luma sharpen effect parameters
3940 unsharp=7:7:2.5
3941
3942 # Strong blur of both luma and chroma parameters
3943 unsharp=7:7:-2:7:7:-2
3944
3945 # Use the default values with <code>ffmpeg</code>
3946 ./ffmpeg -i in.avi -vf &quot;unsharp&quot; out.mp4
3947 </pre></td></tr></table>
3948
3949 <a name="vflip"></a>
3950 <h2 class="section"><a href="ffplay.html#toc-vflip">16.36 vflip</a></h2>
3951
3952 <p>Flip the input video vertically.
3953 </p>
3954 <table><tr><td>&nbsp;</td><td><pre class="example">./ffmpeg -i in.avi -vf &quot;vflip&quot; out.avi
3955 </pre></td></tr></table>
3956
3957 <a name="yadif"></a>
3958 <h2 class="section"><a href="ffplay.html#toc-yadif">16.37 yadif</a></h2>
3959
3960 <p>Deinterlace the input video (&quot;yadif&quot; means &quot;yet another deinterlacing
3961 filter&quot;).
3962 </p>
3963 <p>It accepts the optional parameters: <var>mode</var>:<var>parity</var>:<var>auto</var>.
3964 </p>
3965 <p><var>mode</var> specifies the interlacing mode to adopt, accepts one of the
3966 following values:
3967 </p>
3968 <dl compact="compact">
3969 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
3970 <dd><p>output 1 frame for each frame
3971 </p></dd>
3972 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
3973 <dd><p>output 1 frame for each field
3974 </p></dd>
3975 <dt> &lsquo;<samp>2</samp>&rsquo;</dt>
3976 <dd><p>like 0 but skips spatial interlacing check
3977 </p></dd>
3978 <dt> &lsquo;<samp>3</samp>&rsquo;</dt>
3979 <dd><p>like 1 but skips spatial interlacing check
3980 </p></dd>
3981 </dl>
3982
3983 <p>Default value is 0.
3984 </p>
3985 <p><var>parity</var> specifies the picture field parity assumed for the input
3986 interlaced video, accepts one of the following values:
3987 </p>
3988 <dl compact="compact">
3989 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
3990 <dd><p>assume bottom field first
3991 </p></dd>
3992 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
3993 <dd><p>assume top field first
3994 </p></dd>
3995 <dt> &lsquo;<samp>-1</samp>&rsquo;</dt>
3996 <dd><p>enable automatic detection
3997 </p></dd>
3998 </dl>
3999
4000 <p>Default value is -1.
4001 If interlacing is unknown or decoder does not export this information,
4002 top field first will be assumed.
4003 </p>
4004 <p><var>auto</var> specifies if deinterlacer should trust the interlaced flag
4005 and only deinterlace frames marked as interlaced
4006 </p>
4007 <dl compact="compact">
4008 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
4009 <dd><p>deinterlace all frames
4010 </p></dd>
4011 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
4012 <dd><p>only deinterlace frames marked as interlaced
4013 </p></dd>
4014 </dl>
4015
4016 <p>Default value is 0.
4017 </p>
4018
4019 <a name="Video-Sources"></a>
4020 <h1 class="chapter"><a href="ffplay.html#toc-Video-Sources">17. Video Sources</a></h1>
4021
4022 <p>Below is a description of the currently available video sources.
4023 </p>
4024 <a name="buffer"></a>
4025 <h2 class="section"><a href="ffplay.html#toc-buffer">17.1 buffer</a></h2>
4026
4027 <p>Buffer video frames, and make them available to the filter chain.
4028 </p>
4029 <p>This source is mainly intended for a programmatic use, in particular
4030 through the interface defined in &lsquo;<tt>libavfilter/vsrc_buffer.h</tt>&rsquo;.
4031 </p>
4032 <p>It accepts the following parameters:
4033 <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>
4034 </p>
4035 <p>All the parameters but <var>scale_params</var> need to be explicitely
4036 defined.
4037 </p>
4038 <p>Follows the list of the accepted parameters.
4039 </p>
4040 <dl compact="compact">
4041 <dt> &lsquo;<samp>width, height</samp>&rsquo;</dt>
4042 <dd><p>Specify the width and height of the buffered video frames.
4043 </p>
4044 </dd>
4045 <dt> &lsquo;<samp>pix_fmt_string</samp>&rsquo;</dt>
4046 <dd><p>A string representing the pixel format of the buffered video frames.
4047 It may be a number corresponding to a pixel format, or a pixel format
4048 name.
4049 </p>
4050 </dd>
4051 <dt> &lsquo;<samp>timebase_num, timebase_den</samp>&rsquo;</dt>
4052 <dd><p>Specify numerator and denomitor of the timebase assumed by the
4053 timestamps of the buffered frames.
4054 </p>
4055 </dd>
4056 <dt> &lsquo;<samp>sample_aspect_ratio.num, sample_aspect_ratio.den</samp>&rsquo;</dt>
4057 <dd><p>Specify numerator and denominator of the sample aspect ratio assumed
4058 by the video frames.
4059 </p>
4060 </dd>
4061 <dt> &lsquo;<samp>scale_params</samp>&rsquo;</dt>
4062 <dd><p>Specify the optional parameters to be used for the scale filter which
4063 is automatically inserted when an input change is detected in the
4064 input size or format.
4065 </p></dd>
4066 </dl>
4067
4068 <p>For example:
4069 </p><table><tr><td>&nbsp;</td><td><pre class="example">buffer=320:240:yuv410p:1:24:1:1
4070 </pre></td></tr></table>
4071
4072 <p>will instruct the source to accept video frames with size 320x240 and
4073 with format &quot;yuv410p&quot;, assuming 1/24 as the timestamps timebase and
4074 square pixels (1:1 sample aspect ratio).
4075 Since the pixel format with name &quot;yuv410p&quot; corresponds to the number 6
4076 (check the enum PixelFormat definition in &lsquo;<tt>libavutil/pixfmt.h</tt>&rsquo;),
4077 this example corresponds to:
4078 </p><table><tr><td>&nbsp;</td><td><pre class="example">buffer=320:240:6:1:24:1:1
4079 </pre></td></tr></table>
4080
4081 <a name="color"></a>
4082 <h2 class="section"><a href="ffplay.html#toc-color">17.2 color</a></h2>
4083
4084 <p>Provide an uniformly colored input.
4085 </p>
4086 <p>It accepts the following parameters:
4087 <var>color</var>:<var>frame_size</var>:<var>frame_rate</var>
4088 </p>
4089 <p>Follows the description of the accepted parameters.
4090 </p>
4091 <dl compact="compact">
4092 <dt> &lsquo;<samp>color</samp>&rsquo;</dt>
4093 <dd><p>Specify the color of the source. It can be the name of a color (case
4094 insensitive match) or a 0xRRGGBB[AA] sequence, possibly followed by an
4095 alpha specifier. The default value is &quot;black&quot;.
4096 </p>
4097 </dd>
4098 <dt> &lsquo;<samp>frame_size</samp>&rsquo;</dt>
4099 <dd><p>Specify the size of the sourced video, it may be a string of the form
4100 <var>width</var>x<var>heigth</var>, or the name of a size abbreviation. The
4101 default value is &quot;320x240&quot;.
4102 </p>
4103 </dd>
4104 <dt> &lsquo;<samp>frame_rate</samp>&rsquo;</dt>
4105 <dd><p>Specify the frame rate of the sourced video, as the number of frames
4106 generated per second. It has to be a string in the format
4107 <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a float
4108 number or a valid video frame rate abbreviation. The default value is
4109 &quot;25&quot;.
4110 </p>
4111 </dd>
4112 </dl>
4113
4114 <p>For example the following graph description will generate a red source
4115 with an opacity of 0.2, with size &quot;qcif&quot; and a frame rate of 10
4116 frames per second, which will be overlayed over the source connected
4117 to the pad with identifier &quot;in&quot;.
4118 </p>
4119 <table><tr><td>&nbsp;</td><td><pre class="example">&quot;color=red@0.2:qcif:10 [color]; [in][color] overlay [out]&quot;
4120 </pre></td></tr></table>
4121
4122 <a name="movie"></a>
4123 <h2 class="section"><a href="ffplay.html#toc-movie">17.3 movie</a></h2>
4124
4125 <p>Read a video stream from a movie container.
4126 </p>
4127 <p>It accepts the syntax: <var>movie_name</var>[:<var>options</var>] where
4128 <var>movie_name</var> is the name of the resource to read (not necessarily
4129 a file but also a device or a stream accessed through some protocol),
4130 and <var>options</var> is an optional sequence of <var>key</var>=<var>value</var>
4131 pairs, separated by &quot;:&quot;.
4132 </p>
4133 <p>The description of the accepted options follows.
4134 </p>
4135 <dl compact="compact">
4136 <dt> &lsquo;<samp>format_name, f</samp>&rsquo;</dt>
4137 <dd><p>Specifies the format assumed for the movie to read, and can be either
4138 the name of a container or an input device. If not specified the
4139 format is guessed from <var>movie_name</var> or by probing.
4140 </p>
4141 </dd>
4142 <dt> &lsquo;<samp>seek_point, sp</samp>&rsquo;</dt>
4143 <dd><p>Specifies the seek point in seconds, the frames will be output
4144 starting from this seek point, the parameter is evaluated with
4145 <code>av_strtod</code> so the numerical value may be suffixed by an IS
4146 postfix. Default value is &quot;0&quot;.
4147 </p>
4148 </dd>
4149 <dt> &lsquo;<samp>stream_index, si</samp>&rsquo;</dt>
4150 <dd><p>Specifies the index of the video stream to read. If the value is -1,
4151 the best suited video stream will be automatically selected. Default
4152 value is &quot;-1&quot;.
4153 </p>
4154 </dd>
4155 </dl>
4156
4157 <p>This filter allows to overlay a second video on top of main input of
4158 a filtergraph as shown in this graph:
4159 </p><table><tr><td>&nbsp;</td><td><pre class="example">input -----------&gt; deltapts0 --&gt; overlay --&gt; output
4160                                     ^
4161                                     |
4162 movie --&gt; scale--&gt; deltapts1 -------+
4163 </pre></td></tr></table>
4164
4165 <p>Some examples follow:
4166 </p><table><tr><td>&nbsp;</td><td><pre class="example"># skip 3.2 seconds from the start of the avi file in.avi, and overlay it
4167 # on top of the input labelled as &quot;in&quot;.
4168 movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [movie];
4169 [in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
4170
4171 # read from a video4linux2 device, and overlay it on top of the input
4172 # labelled as &quot;in&quot;
4173 movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [movie];
4174 [in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
4175
4176 </pre></td></tr></table>
4177
4178 <a name="nullsrc"></a>
4179 <h2 class="section"><a href="ffplay.html#toc-nullsrc">17.4 nullsrc</a></h2>
4180
4181 <p>Null video source, never return images. It is mainly useful as a
4182 template and to be employed in analysis / debugging tools.
4183 </p>
4184 <p>It accepts as optional parameter a string of the form
4185 <var>width</var>:<var>height</var>:<var>timebase</var>.
4186 </p>
4187 <p><var>width</var> and <var>height</var> specify the size of the configured
4188 source. The default values of <var>width</var> and <var>height</var> are
4189 respectively 352 and 288 (corresponding to the CIF size format).
4190 </p>
4191 <p><var>timebase</var> specifies an arithmetic expression representing a
4192 timebase. The expression can contain the constants &quot;PI&quot;, &quot;E&quot;, &quot;PHI&quot;,
4193 &quot;AVTB&quot; (the default timebase), and defaults to the value &quot;AVTB&quot;.
4194 </p>
4195 <a name="frei0r_005fsrc"></a>
4196 <h2 class="section"><a href="ffplay.html#toc-frei0r_005fsrc">17.5 frei0r_src</a></h2>
4197
4198 <p>Provide a frei0r source.
4199 </p>
4200 <p>To enable compilation of this filter you need to install the frei0r
4201 header and configure FFmpeg with &ndash;enable-frei0r.
4202 </p>
4203 <p>The source supports the syntax:
4204 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>size</var>:<var>rate</var>:<var>src_name</var>[{=|:}<var>param1</var>:<var>param2</var>:...:<var>paramN</var>]
4205 </pre></td></tr></table>
4206
4207 <p><var>size</var> is the size of the video to generate, may be a string of the
4208 form <var>width</var>x<var>height</var> or a frame size abbreviation.
4209 <var>rate</var> is the rate of the video to generate, may be a string of
4210 the form <var>num</var>/<var>den</var> or a frame rate abbreviation.
4211 <var>src_name</var> is the name to the frei0r source to load. For more
4212 information regarding frei0r and how to set the parameters read the
4213 section <a href="#frei0r">frei0r</a> in the description of the video filters.
4214 </p>
4215 <p>Some examples follow:
4216 </p><table><tr><td>&nbsp;</td><td><pre class="example"># generate a frei0r partik0l source with size 200x200 and framerate 10
4217 # which is overlayed on the overlay filter main input
4218 frei0r_src=200x200:10:partik0l=1234 [overlay]; [in][overlay] overlay
4219 </pre></td></tr></table>
4220
4221 <a name="rgbtestsrc_002c-testsrc"></a>
4222 <h2 class="section"><a href="ffplay.html#toc-rgbtestsrc_002c-testsrc">17.6 rgbtestsrc, testsrc</a></h2>
4223
4224 <p>The <code>rgbtestsrc</code> source generates an RGB test pattern useful for
4225 detecting RGB vs BGR issues. You should see a red, green and blue
4226 stripe from top to bottom.
4227 </p>
4228 <p>The <code>testsrc</code> source generates a test video pattern, showing a
4229 color pattern, a scrolling gradient and a timestamp. This is mainly
4230 intended for testing purposes.
4231 </p>
4232 <p>Both sources accept an optional sequence of <var>key</var>=<var>value</var> pairs,
4233 separated by &quot;:&quot;. The description of the accepted options follows.
4234 </p>
4235 <dl compact="compact">
4236 <dt> &lsquo;<samp>size, s</samp>&rsquo;</dt>
4237 <dd><p>Specify the size of the sourced video, it may be a string of the form
4238 <var>width</var>x<var>heigth</var>, or the name of a size abbreviation. The
4239 default value is &quot;320x240&quot;.
4240 </p>
4241 </dd>
4242 <dt> &lsquo;<samp>rate, r</samp>&rsquo;</dt>
4243 <dd><p>Specify the frame rate of the sourced video, as the number of frames
4244 generated per second. It has to be a string in the format
4245 <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a float
4246 number or a valid video frame rate abbreviation. The default value is
4247 &quot;25&quot;.
4248 </p>
4249 </dd>
4250 <dt> &lsquo;<samp>duration</samp>&rsquo;</dt>
4251 <dd><p>Set the video duration of the sourced video. The accepted syntax is:
4252 </p><table><tr><td>&nbsp;</td><td><pre class="example">[-]HH[:MM[:SS[.m...]]]
4253 [-]S+[.m...]
4254 </pre></td></tr></table>
4255 <p>See also the function <code>av_parse_time()</code>.
4256 </p>
4257 <p>If not specified, or the expressed duration is negative, the video is
4258 supposed to be generated forever.
4259 </p></dd>
4260 </dl>
4261
4262 <p>For example the following:
4263 </p><table><tr><td>&nbsp;</td><td><pre class="example">testsrc=duration=5.3:size=qcif:rate=10
4264 </pre></td></tr></table>
4265
4266 <p>will generate a video with a duration of 5.3 seconds, with size
4267 176x144 and a framerate of 10 frames per second.
4268 </p>
4269
4270 <a name="Video-Sinks"></a>
4271 <h1 class="chapter"><a href="ffplay.html#toc-Video-Sinks">18. Video Sinks</a></h1>
4272
4273 <p>Below is a description of the currently available video sinks.
4274 </p>
4275 <a name="buffersink"></a>
4276 <h2 class="section"><a href="ffplay.html#toc-buffersink">18.1 buffersink</a></h2>
4277
4278 <p>Buffer video frames, and make them available to the end of the filter
4279 graph.
4280 </p>
4281 <p>This sink is mainly intended for a programmatic use, in particular
4282 through the interface defined in &lsquo;<tt>libavfilter/vsink_buffer.h</tt>&rsquo;.
4283 </p>
4284 <p>It does not require a string parameter in input, but you need to
4285 specify a pointer to a list of supported pixel formats terminated by
4286 -1 in the opaque parameter provided to <code>avfilter_init_filter</code>
4287 when initializing this sink.
4288 </p>
4289 <a name="nullsink"></a>
4290 <h2 class="section"><a href="ffplay.html#toc-nullsink">18.2 nullsink</a></h2>
4291
4292 <p>Null video sink, do absolutely nothing with the input video. It is
4293 mainly useful as a template and to be employed in analysis / debugging
4294 tools.
4295 </p>
4296
4297
4298
4299 <hr size="1">
4300 <p>
4301  <font size="-1">
4302   This document was generated by <em>Kyle Schwarz</em> on <em>July 23, 2011</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.
4303  </font>
4304  <br>
4305
4306 </p>
4307 </body>
4308 </html>