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