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