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