1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
3 <!-- Created on July 23, 2011 by texi2html 1.82
4 texi2html was written by:
5 Lionel Cons <Lionel.Cons@cern.ch> (original author)
6 Karl Berry <karl@freefriends.org>
7 Olaf Bachmann <obachman@mathematik.uni-kl.de>
9 Maintained by: Many creative people.
10 Send bugs and suggestions to <texi2html-bug@nongnu.org>
13 <title>ffplay Documentation</title>
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">
23 a.summary-letter {text-decoration: none}
24 blockquote.smallquotation {font-size: smaller}
25 pre.display {font-family: serif}
26 pre.format {font-family: serif}
27 pre.menu-comment {font-family: serif}
28 pre.menu-preformatted {font-family: serif}
29 pre.smalldisplay {font-family: serif; font-size: smaller}
30 pre.smallexample {font-size: smaller}
31 pre.smallformat {font-family: serif; font-size: smaller}
32 pre.smalllisp {font-size: smaller}
33 span.roman {font-family:serif; font-weight:normal;}
34 span.sansserif {font-family:sans-serif; font-weight:normal;}
35 ul.toc {list-style: none}
42 <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
44 <a name="SEC_Top"></a>
45 <h1 class="settitle">ffplay Documentation</h1>
47 <a name="SEC_Contents"></a>
48 <h1>Table of Contents</h1>
49 <div class="contents">
52 <li><a name="toc-Synopsis" href="#Synopsis">1. Synopsis</a></li>
53 <li><a name="toc-Description" href="#Description">2. Description</a></li>
54 <li><a name="toc-Options-3" href="#Options-3">3. Options</a>
56 <li><a name="toc-Generic-options" href="#Generic-options">3.1 Generic options</a></li>
57 <li><a name="toc-Main-options" href="#Main-options">3.2 Main options</a></li>
58 <li><a name="toc-Advanced-options" href="#Advanced-options">3.3 Advanced options</a></li>
59 <li><a name="toc-While-playing" href="#While-playing">3.4 While playing</a></li>
61 <li><a name="toc-Expression-Evaluation" href="#Expression-Evaluation">4. Expression Evaluation</a></li>
62 <li><a name="toc-Decoders" href="#Decoders">5. Decoders</a></li>
63 <li><a name="toc-Video-Decoders" href="#Video-Decoders">6. Video Decoders</a>
65 <li><a name="toc-rawvideo" href="#rawvideo">6.1 rawvideo</a>
67 <li><a name="toc-Options-1" href="#Options-1">6.1.1 Options</a></li>
71 <li><a name="toc-Demuxers" href="#Demuxers">7. Demuxers</a>
73 <li><a name="toc-image2-1" href="#image2-1">7.1 image2</a></li>
74 <li><a name="toc-applehttp" href="#applehttp">7.2 applehttp</a></li>
76 <li><a name="toc-Muxers" href="#Muxers">8. Muxers</a>
78 <li><a name="toc-crc-1" href="#crc-1">8.1 crc</a></li>
79 <li><a name="toc-framecrc-1" href="#framecrc-1">8.2 framecrc</a></li>
80 <li><a name="toc-image2" href="#image2">8.3 image2</a></li>
81 <li><a name="toc-mpegts" href="#mpegts">8.4 mpegts</a></li>
82 <li><a name="toc-null" href="#null">8.5 null</a></li>
83 <li><a name="toc-matroska" href="#matroska">8.6 matroska</a></li>
85 <li><a name="toc-Input-Devices" href="#Input-Devices">9. Input Devices</a>
87 <li><a name="toc-alsa-1" href="#alsa-1">9.1 alsa</a></li>
88 <li><a name="toc-bktr" href="#bktr">9.2 bktr</a></li>
89 <li><a name="toc-dv1394" href="#dv1394">9.3 dv1394</a></li>
90 <li><a name="toc-fbdev" href="#fbdev">9.4 fbdev</a></li>
91 <li><a name="toc-jack" href="#jack">9.5 jack</a></li>
92 <li><a name="toc-libdc1394" href="#libdc1394">9.6 libdc1394</a></li>
93 <li><a name="toc-openal" href="#openal">9.7 openal</a>
95 <li><a name="toc-Options" href="#Options">9.7.1 Options</a></li>
96 <li><a name="toc-Examples" href="#Examples">9.7.2 Examples</a></li>
98 <li><a name="toc-oss" href="#oss">9.8 oss</a></li>
99 <li><a name="toc-sndio-1" href="#sndio-1">9.9 sndio</a></li>
100 <li><a name="toc-video4linux-and-video4linux2" href="#video4linux-and-video4linux2">9.10 video4linux and video4linux2</a></li>
101 <li><a name="toc-vfwcap" href="#vfwcap">9.11 vfwcap</a></li>
102 <li><a name="toc-x11grab" href="#x11grab">9.12 x11grab</a></li>
104 <li><a name="toc-Output-Devices" href="#Output-Devices">10. Output Devices</a>
106 <li><a name="toc-alsa" href="#alsa">10.1 alsa</a></li>
107 <li><a name="toc-oss-1" href="#oss-1">10.2 oss</a></li>
108 <li><a name="toc-sdl" href="#sdl">10.3 sdl</a>
110 <li><a name="toc-Options-2" href="#Options-2">10.3.1 Options</a></li>
111 <li><a name="toc-Examples-1" href="#Examples-1">10.3.2 Examples</a></li>
113 <li><a name="toc-sndio" href="#sndio">10.4 sndio</a></li>
115 <li><a name="toc-Protocols" href="#Protocols">11. Protocols</a>
117 <li><a name="toc-applehttp-1" href="#applehttp-1">11.1 applehttp</a></li>
118 <li><a name="toc-concat" href="#concat">11.2 concat</a></li>
119 <li><a name="toc-file" href="#file">11.3 file</a></li>
120 <li><a name="toc-gopher" href="#gopher">11.4 gopher</a></li>
121 <li><a name="toc-http" href="#http">11.5 http</a></li>
122 <li><a name="toc-mmst" href="#mmst">11.6 mmst</a></li>
123 <li><a name="toc-mmsh" href="#mmsh">11.7 mmsh</a></li>
124 <li><a name="toc-md5" href="#md5">11.8 md5</a></li>
125 <li><a name="toc-pipe" href="#pipe">11.9 pipe</a></li>
126 <li><a name="toc-rtmp" href="#rtmp">11.10 rtmp</a></li>
127 <li><a name="toc-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte" href="#rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">11.11 rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></li>
128 <li><a name="toc-rtp" href="#rtp">11.12 rtp</a></li>
129 <li><a name="toc-rtsp" href="#rtsp">11.13 rtsp</a></li>
130 <li><a name="toc-sap" href="#sap">11.14 sap</a>
132 <li><a name="toc-Muxer" href="#Muxer">11.14.1 Muxer</a></li>
133 <li><a name="toc-Demuxer" href="#Demuxer">11.14.2 Demuxer</a></li>
135 <li><a name="toc-tcp" href="#tcp">11.15 tcp</a></li>
136 <li><a name="toc-udp" href="#udp">11.16 udp</a></li>
138 <li><a name="toc-Filtergraph-description" href="#Filtergraph-description">12. Filtergraph description</a>
140 <li><a name="toc-Filtergraph-syntax" href="#Filtergraph-syntax">12.1 Filtergraph syntax</a></li>
142 <li><a name="toc-Audio-Filters" href="#Audio-Filters">13. Audio Filters</a>
144 <li><a name="toc-anull" href="#anull">13.1 anull</a></li>
146 <li><a name="toc-Audio-Sources" href="#Audio-Sources">14. Audio Sources</a>
148 <li><a name="toc-anullsrc" href="#anullsrc">14.1 anullsrc</a></li>
150 <li><a name="toc-Audio-Sinks" href="#Audio-Sinks">15. Audio Sinks</a>
152 <li><a name="toc-anullsink" href="#anullsink">15.1 anullsink</a></li>
154 <li><a name="toc-Video-Filters" href="#Video-Filters">16. Video Filters</a>
156 <li><a name="toc-blackframe" href="#blackframe">16.1 blackframe</a></li>
157 <li><a name="toc-boxblur" href="#boxblur">16.2 boxblur</a></li>
158 <li><a name="toc-copy" href="#copy">16.3 copy</a></li>
159 <li><a name="toc-crop" href="#crop">16.4 crop</a></li>
160 <li><a name="toc-cropdetect" href="#cropdetect">16.5 cropdetect</a></li>
161 <li><a name="toc-drawbox" href="#drawbox">16.6 drawbox</a></li>
162 <li><a name="toc-drawtext" href="#drawtext">16.7 drawtext</a></li>
163 <li><a name="toc-fade" href="#fade">16.8 fade</a></li>
164 <li><a name="toc-fieldorder" href="#fieldorder">16.9 fieldorder</a></li>
165 <li><a name="toc-fifo" href="#fifo">16.10 fifo</a></li>
166 <li><a name="toc-format" href="#format">16.11 format</a></li>
167 <li><a name="toc-frei0r-1" href="#frei0r-1">16.12 frei0r</a></li>
168 <li><a name="toc-gradfun" href="#gradfun">16.13 gradfun</a></li>
169 <li><a name="toc-hflip" href="#hflip">16.14 hflip</a></li>
170 <li><a name="toc-hqdn3d" href="#hqdn3d">16.15 hqdn3d</a></li>
171 <li><a name="toc-lut_002c-lutrgb_002c-lutyuv" href="#lut_002c-lutrgb_002c-lutyuv">16.16 lut, lutrgb, lutyuv</a></li>
172 <li><a name="toc-mp" href="#mp">16.17 mp</a></li>
173 <li><a name="toc-negate" href="#negate">16.18 negate</a></li>
174 <li><a name="toc-noformat" href="#noformat">16.19 noformat</a></li>
175 <li><a name="toc-null-1" href="#null-1">16.20 null</a></li>
176 <li><a name="toc-ocv" href="#ocv">16.21 ocv</a>
178 <li><a name="toc-dilate-1" href="#dilate-1">16.21.1 dilate</a></li>
179 <li><a name="toc-erode" href="#erode">16.21.2 erode</a></li>
180 <li><a name="toc-smooth" href="#smooth">16.21.3 smooth</a></li>
182 <li><a name="toc-overlay" href="#overlay">16.22 overlay</a></li>
183 <li><a name="toc-pad" href="#pad">16.23 pad</a></li>
184 <li><a name="toc-pixdesctest" href="#pixdesctest">16.24 pixdesctest</a></li>
185 <li><a name="toc-scale" href="#scale">16.25 scale</a></li>
186 <li><a name="toc-select" href="#select">16.26 select</a></li>
187 <li><a name="toc-setdar-1" href="#setdar-1">16.27 setdar</a></li>
188 <li><a name="toc-setpts" href="#setpts">16.28 setpts</a></li>
189 <li><a name="toc-setsar-1" href="#setsar-1">16.29 setsar</a></li>
190 <li><a name="toc-settb" href="#settb">16.30 settb</a></li>
191 <li><a name="toc-showinfo" href="#showinfo">16.31 showinfo</a></li>
192 <li><a name="toc-slicify" href="#slicify">16.32 slicify</a></li>
193 <li><a name="toc-split" href="#split">16.33 split</a></li>
194 <li><a name="toc-transpose" href="#transpose">16.34 transpose</a></li>
195 <li><a name="toc-unsharp" href="#unsharp">16.35 unsharp</a></li>
196 <li><a name="toc-vflip" href="#vflip">16.36 vflip</a></li>
197 <li><a name="toc-yadif" href="#yadif">16.37 yadif</a></li>
199 <li><a name="toc-Video-Sources" href="#Video-Sources">17. Video Sources</a>
201 <li><a name="toc-buffer" href="#buffer">17.1 buffer</a></li>
202 <li><a name="toc-color" href="#color">17.2 color</a></li>
203 <li><a name="toc-movie" href="#movie">17.3 movie</a></li>
204 <li><a name="toc-nullsrc" href="#nullsrc">17.4 nullsrc</a></li>
205 <li><a name="toc-frei0r_005fsrc" href="#frei0r_005fsrc">17.5 frei0r_src</a></li>
206 <li><a name="toc-rgbtestsrc_002c-testsrc" href="#rgbtestsrc_002c-testsrc">17.6 rgbtestsrc, testsrc</a></li>
208 <li><a name="toc-Video-Sinks" href="#Video-Sinks">18. Video Sinks</a>
210 <li><a name="toc-buffersink" href="#buffersink">18.1 buffersink</a></li>
211 <li><a name="toc-nullsink" href="#nullsink">18.2 nullsink</a></li>
218 <a name="Synopsis"></a>
219 <h1 class="chapter"><a href="ffplay.html#toc-Synopsis">1. Synopsis</a></h1>
221 <table><tr><td> </td><td><pre class="example">ffplay [options] [‘<tt>input_file</tt>’]
222 </pre></td></tr></table>
224 <a name="Description"></a>
225 <h1 class="chapter"><a href="ffplay.html#toc-Description">2. Description</a></h1>
227 <p>FFplay is a very simple and portable media player using the FFmpeg
228 libraries and the SDL library. It is mostly used as a testbed for the
231 <a name="Options-3"></a>
232 <h1 class="chapter"><a href="ffplay.html#toc-Options-3">3. Options</a></h1>
234 <p>All the numerical options, if not specified otherwise, accept in input
235 a string representing a number, which may contain one of the
236 International System number postfixes, for example ’K’, ’M’, ’G’.
237 If ’i’ is appended after the postfix, powers of 2 are used instead of
238 powers of 10. The ’B’ postfix multiplies the value for 8, and can be
239 appended after another postfix or used alone. This allows using for
240 example ’KB’, ’MiB’, ’G’ and ’B’ as postfix.
242 <p>Options which do not take arguments are boolean options, and set the
243 corresponding value to true. They can be set to false by prefixing
244 with "no" the option name, for example using "-nofoo" in the
245 commandline will set to false the boolean option with name "foo".
247 <a name="Generic-options"></a>
248 <h2 class="section"><a href="ffplay.html#toc-Generic-options">3.1 Generic options</a></h2>
250 <p>These options are shared amongst the ff* tools.
252 <dl compact="compact">
253 <dt> ‘<samp>-L</samp>’</dt>
257 <dt> ‘<samp>-h, -?, -help, --help</samp>’</dt>
261 <dt> ‘<samp>-version</samp>’</dt>
265 <dt> ‘<samp>-formats</samp>’</dt>
266 <dd><p>Show available formats.
268 <p>The fields preceding the format names have the following meanings:
269 </p><dl compact="compact">
270 <dt> ‘<samp>D</samp>’</dt>
271 <dd><p>Decoding available
273 <dt> ‘<samp>E</samp>’</dt>
274 <dd><p>Encoding available
279 <dt> ‘<samp>-codecs</samp>’</dt>
280 <dd><p>Show available codecs.
282 <p>The fields preceding the codec names have the following meanings:
283 </p><dl compact="compact">
284 <dt> ‘<samp>D</samp>’</dt>
285 <dd><p>Decoding available
287 <dt> ‘<samp>E</samp>’</dt>
288 <dd><p>Encoding available
290 <dt> ‘<samp>V/A/S</samp>’</dt>
291 <dd><p>Video/audio/subtitle codec
293 <dt> ‘<samp>S</samp>’</dt>
294 <dd><p>Codec supports slices
296 <dt> ‘<samp>D</samp>’</dt>
297 <dd><p>Codec supports direct rendering
299 <dt> ‘<samp>T</samp>’</dt>
300 <dd><p>Codec can handle input truncated at random locations instead of only at frame boundaries
305 <dt> ‘<samp>-bsfs</samp>’</dt>
306 <dd><p>Show available bitstream filters.
309 <dt> ‘<samp>-protocols</samp>’</dt>
310 <dd><p>Show available protocols.
313 <dt> ‘<samp>-filters</samp>’</dt>
314 <dd><p>Show available libavfilter filters.
317 <dt> ‘<samp>-pix_fmts</samp>’</dt>
318 <dd><p>Show available pixel formats.
321 <dt> ‘<samp>-loglevel <var>loglevel</var></samp>’</dt>
322 <dd><p>Set the logging level used by the library.
323 <var>loglevel</var> is a number or a string containing one of the following values:
324 </p><dl compact="compact">
325 <dt> ‘<samp>quiet</samp>’</dt>
326 <dt> ‘<samp>panic</samp>’</dt>
327 <dt> ‘<samp>fatal</samp>’</dt>
328 <dt> ‘<samp>error</samp>’</dt>
329 <dt> ‘<samp>warning</samp>’</dt>
330 <dt> ‘<samp>info</samp>’</dt>
331 <dt> ‘<samp>verbose</samp>’</dt>
332 <dt> ‘<samp>debug</samp>’</dt>
335 <p>By default the program logs to stderr, if coloring is supported by the
336 terminal, colors are used to mark errors and warnings. Log coloring
337 can be disabled setting the environment variable
338 <code>FFMPEG_FORCE_NOCOLOR</code> or <code>NO_COLOR</code>, or can be forced setting
339 the environment variable <code>FFMPEG_FORCE_COLOR</code>.
340 The use of the environment variable <code>NO_COLOR</code> is deprecated and
341 will be dropped in a following FFmpeg version.
346 <a name="Main-options"></a>
347 <h2 class="section"><a href="ffplay.html#toc-Main-options">3.2 Main options</a></h2>
349 <dl compact="compact">
350 <dt> ‘<samp>-x <var>width</var></samp>’</dt>
351 <dd><p>Force displayed width.
353 <dt> ‘<samp>-y <var>height</var></samp>’</dt>
354 <dd><p>Force displayed height.
356 <dt> ‘<samp>-s <var>size</var></samp>’</dt>
357 <dd><p>This option has been removed. Use private format options for specifying the
360 <dt> ‘<samp>-an</samp>’</dt>
361 <dd><p>Disable audio.
363 <dt> ‘<samp>-vn</samp>’</dt>
364 <dd><p>Disable video.
366 <dt> ‘<samp>-ss <var>pos</var></samp>’</dt>
367 <dd><p>Seek to a given position in seconds.
369 <dt> ‘<samp>-t <var>duration</var></samp>’</dt>
370 <dd><p>play <duration> seconds of audio/video
372 <dt> ‘<samp>-bytes</samp>’</dt>
373 <dd><p>Seek by bytes.
375 <dt> ‘<samp>-nodisp</samp>’</dt>
376 <dd><p>Disable graphical display.
378 <dt> ‘<samp>-f <var>fmt</var></samp>’</dt>
381 <dt> ‘<samp>-window_title <var>title</var></samp>’</dt>
382 <dd><p>Set window title (default is the input filename).
384 <dt> ‘<samp>-loop <var>number</var></samp>’</dt>
385 <dd><p>Loops movie playback <number> times. 0 means forever.
387 <dt> ‘<samp>-showmode <var>mode</var></samp>’</dt>
388 <dd><p>Set the show mode to use.
389 Available values for <var>mode</var> are:
390 </p><dl compact="compact">
391 <dt> ‘<samp>0, video</samp>’</dt>
394 <dt> ‘<samp>1, waves</samp>’</dt>
395 <dd><p>show audio waves
397 <dt> ‘<samp>2, rdft</samp>’</dt>
398 <dd><p>show audio frequency band using RDFT ((Inverse) Real Discrete Fourier Transform)
402 <p>Default value is "video", if video is not present or cannot be played
403 "rdft" is automatically selected.
405 <p>You can interactively cycle through the available show modes by
406 pressing the key <w>.
409 <dt> ‘<samp>-vf <var>filter_graph</var></samp>’</dt>
410 <dd><p><var>filter_graph</var> is a description of the filter graph to apply to
412 Use the option "-filters" to show all the available filters (including
413 also sources and sinks).
416 <dt> ‘<samp>-i <var>input_file</var></samp>’</dt>
417 <dd><p>Read <var>input_file</var>.
421 <a name="Advanced-options"></a>
422 <h2 class="section"><a href="ffplay.html#toc-Advanced-options">3.3 Advanced options</a></h2>
423 <dl compact="compact">
424 <dt> ‘<samp>-pix_fmt <var>format</var></samp>’</dt>
425 <dd><p>This option has been removed. Use private options for specifying the
428 <dt> ‘<samp>-stats</samp>’</dt>
429 <dd><p>Show the stream duration, the codec parameters, the current position in
430 the stream and the audio/video synchronisation drift.
432 <dt> ‘<samp>-bug</samp>’</dt>
433 <dd><p>Work around bugs.
435 <dt> ‘<samp>-fast</samp>’</dt>
436 <dd><p>Non-spec-compliant optimizations.
438 <dt> ‘<samp>-genpts</samp>’</dt>
441 <dt> ‘<samp>-rtp_tcp</samp>’</dt>
442 <dd><p>Force RTP/TCP protocol usage instead of RTP/UDP. It is only meaningful
443 if you are streaming with the RTSP protocol.
445 <dt> ‘<samp>-sync <var>type</var></samp>’</dt>
446 <dd><p>Set the master clock to audio (<code>type=audio</code>), video
447 (<code>type=video</code>) or external (<code>type=ext</code>). Default is audio. The
448 master clock is used to control audio-video synchronization. Most media
449 players use audio as master clock, but in some cases (streaming or high
450 quality broadcast) it is necessary to change that. This option is mainly
451 used for debugging purposes.
453 <dt> ‘<samp>-threads <var>count</var></samp>’</dt>
454 <dd><p>Set the thread count.
456 <dt> ‘<samp>-ast <var>audio_stream_number</var></samp>’</dt>
457 <dd><p>Select the desired audio stream number, counting from 0. The number
458 refers to the list of all the input audio streams. If it is greater
459 than the number of audio streams minus one, then the last one is
460 selected, if it is negative the audio playback is disabled.
462 <dt> ‘<samp>-vst <var>video_stream_number</var></samp>’</dt>
463 <dd><p>Select the desired video stream number, counting from 0. The number
464 refers to the list of all the input video streams. If it is greater
465 than the number of video streams minus one, then the last one is
466 selected, if it is negative the video playback is disabled.
468 <dt> ‘<samp>-sst <var>subtitle_stream_number</var></samp>’</dt>
469 <dd><p>Select the desired subtitle stream number, counting from 0. The number
470 refers to the list of all the input subtitle streams. If it is greater
471 than the number of subtitle streams minus one, then the last one is
472 selected, if it is negative the subtitle rendering is disabled.
474 <dt> ‘<samp>-autoexit</samp>’</dt>
475 <dd><p>Exit when video is done playing.
477 <dt> ‘<samp>-exitonkeydown</samp>’</dt>
478 <dd><p>Exit if any key is pressed.
480 <dt> ‘<samp>-exitonmousedown</samp>’</dt>
481 <dd><p>Exit if any mouse button is pressed.
485 <a name="While-playing"></a>
486 <h2 class="section"><a href="ffplay.html#toc-While-playing">3.4 While playing</a></h2>
488 <dl compact="compact">
489 <dt> <q, ESC></dt>
494 <dd><p>Toggle full screen.
497 <dt> <p, SPC></dt>
502 <dd><p>Cycle audio channel.
506 <dd><p>Cycle video channel.
510 <dd><p>Cycle subtitle channel.
514 <dd><p>Show audio waves.
517 <dt> <left/right></dt>
518 <dd><p>Seek backward/forward 10 seconds.
521 <dt> <down/up></dt>
522 <dd><p>Seek backward/forward 1 minute.
525 <dt> <mouse click></dt>
526 <dd><p>Seek to percentage in file corresponding to fraction of width.
532 <a name="Expression-Evaluation"></a>
533 <h1 class="chapter"><a href="ffplay.html#toc-Expression-Evaluation">4. Expression Evaluation</a></h1>
535 <p>When evaluating an arithemetic expression, FFmpeg uses an internal
536 formula evaluator, implemented through the ‘<tt>libavutil/eval.h</tt>’
539 <p>An expression may contain unary, binary operators, constants, and
542 <p>Two expressions <var>expr1</var> and <var>expr2</var> can be combined to form
543 another expression "<var>expr1</var>;<var>expr2</var>".
544 <var>expr1</var> and <var>expr2</var> are evaluated in turn, and the new
545 expression evaluates to the value of <var>expr2</var>.
547 <p>The following binary operators are available: <code>+</code>, <code>-</code>,
548 <code>*</code>, <code>/</code>, <code>^</code>.
550 <p>The following unary operators are available: <code>+</code>, <code>-</code>.
552 <p>The following functions are available:
553 </p><dl compact="compact">
554 <dt> ‘<samp>sinh(x)</samp>’</dt>
555 <dt> ‘<samp>cosh(x)</samp>’</dt>
556 <dt> ‘<samp>tanh(x)</samp>’</dt>
557 <dt> ‘<samp>sin(x)</samp>’</dt>
558 <dt> ‘<samp>cos(x)</samp>’</dt>
559 <dt> ‘<samp>tan(x)</samp>’</dt>
560 <dt> ‘<samp>atan(x)</samp>’</dt>
561 <dt> ‘<samp>asin(x)</samp>’</dt>
562 <dt> ‘<samp>acos(x)</samp>’</dt>
563 <dt> ‘<samp>exp(x)</samp>’</dt>
564 <dt> ‘<samp>log(x)</samp>’</dt>
565 <dt> ‘<samp>abs(x)</samp>’</dt>
566 <dt> ‘<samp>squish(x)</samp>’</dt>
567 <dt> ‘<samp>gauss(x)</samp>’</dt>
568 <dt> ‘<samp>isnan(x)</samp>’</dt>
569 <dd><p>Return 1.0 if <var>x</var> is NAN, 0.0 otherwise.
572 <dt> ‘<samp>mod(x, y)</samp>’</dt>
573 <dt> ‘<samp>max(x, y)</samp>’</dt>
574 <dt> ‘<samp>min(x, y)</samp>’</dt>
575 <dt> ‘<samp>eq(x, y)</samp>’</dt>
576 <dt> ‘<samp>gte(x, y)</samp>’</dt>
577 <dt> ‘<samp>gt(x, y)</samp>’</dt>
578 <dt> ‘<samp>lte(x, y)</samp>’</dt>
579 <dt> ‘<samp>lt(x, y)</samp>’</dt>
580 <dt> ‘<samp>st(var, expr)</samp>’</dt>
581 <dd><p>Allow to store the value of the expression <var>expr</var> in an internal
582 variable. <var>var</var> specifies the number of the variable where to
583 store the value, and it is a value ranging from 0 to 9. The function
584 returns the value stored in the internal variable.
587 <dt> ‘<samp>ld(var)</samp>’</dt>
588 <dd><p>Allow to load the value of the internal variable with number
589 <var>var</var>, which was previosly stored with st(<var>var</var>, <var>expr</var>).
590 The function returns the loaded value.
593 <dt> ‘<samp>while(cond, expr)</samp>’</dt>
594 <dd><p>Evaluate expression <var>expr</var> while the expression <var>cond</var> is
595 non-zero, and returns the value of the last <var>expr</var> evaluation, or
596 NAN if <var>cond</var> was always false.
599 <dt> ‘<samp>ceil(expr)</samp>’</dt>
600 <dd><p>Round the value of expression <var>expr</var> upwards to the nearest
601 integer. For example, "ceil(1.5)" is "2.0".
604 <dt> ‘<samp>floor(expr)</samp>’</dt>
605 <dd><p>Round the value of expression <var>expr</var> downwards to the nearest
606 integer. For example, "floor(-1.5)" is "-2.0".
609 <dt> ‘<samp>trunc(expr)</samp>’</dt>
610 <dd><p>Round the value of expression <var>expr</var> towards zero to the nearest
611 integer. For example, "trunc(-1.5)" is "-1.0".
614 <dt> ‘<samp>sqrt(expr)</samp>’</dt>
615 <dd><p>Compute the square root of <var>expr</var>. This is equivalent to
616 "(<var>expr</var>)^.5".
619 <dt> ‘<samp>not(expr)</samp>’</dt>
620 <dd><p>Return 1.0 if <var>expr</var> is zero, 0.0 otherwise.
623 <dt> ‘<samp>pow(x, y)</samp>’</dt>
624 <dd><p>Compute the power of <var>x</var> elevated <var>y</var>, it is equivalent to
625 "(<var>x</var>)^(<var>y</var>)".
631 <p><code>*</code> works like AND
633 <p><code>+</code> works like OR
636 </p><table><tr><td> </td><td><pre class="example">if A then B else C
637 </pre></td></tr></table>
639 </p><table><tr><td> </td><td><pre class="example">A*B + not(A)*C
640 </pre></td></tr></table>
642 <p>In your C code, you can extend the list of unary and binary functions,
643 and define recognized constants, so that they are available for your
646 <p>The evaluator also recognizes the International System number
647 postfixes. If ’i’ is appended after the postfix, powers of 2 are used
648 instead of powers of 10. The ’B’ postfix multiplies the value for 8,
649 and can be appended after another postfix or used alone. This allows
650 using for example ’KB’, ’MiB’, ’G’ and ’B’ as postfix.
652 <p>Follows the list of available International System postfixes, with
653 indication of the corresponding powers of 10 and of 2.
654 </p><dl compact="compact">
655 <dt> ‘<samp>y</samp>’</dt>
658 <dt> ‘<samp>z</samp>’</dt>
661 <dt> ‘<samp>a</samp>’</dt>
664 <dt> ‘<samp>f</samp>’</dt>
667 <dt> ‘<samp>p</samp>’</dt>
670 <dt> ‘<samp>n</samp>’</dt>
673 <dt> ‘<samp>u</samp>’</dt>
676 <dt> ‘<samp>m</samp>’</dt>
679 <dt> ‘<samp>c</samp>’</dt>
682 <dt> ‘<samp>d</samp>’</dt>
685 <dt> ‘<samp>h</samp>’</dt>
688 <dt> ‘<samp>k</samp>’</dt>
691 <dt> ‘<samp>K</samp>’</dt>
694 <dt> ‘<samp>M</samp>’</dt>
697 <dt> ‘<samp>G</samp>’</dt>
700 <dt> ‘<samp>T</samp>’</dt>
703 <dt> ‘<samp>P</samp>’</dt>
706 <dt> ‘<samp>E</samp>’</dt>
709 <dt> ‘<samp>Z</samp>’</dt>
712 <dt> ‘<samp>Y</samp>’</dt>
717 <a name="Decoders"></a>
718 <h1 class="chapter"><a href="ffplay.html#toc-Decoders">5. Decoders</a></h1>
720 <p>Decoders are configured elements in FFmpeg which allow the decoding of
723 <p>When you configure your FFmpeg build, all the supported native decoders
724 are enabled by default. Decoders requiring an external library must be enabled
725 manually via the corresponding <code>--enable-lib</code> option. You can list all
726 available decoders using the configure option <code>--list-decoders</code>.
728 <p>You can disable all the decoders with the configure option
729 <code>--disable-decoders</code> and selectively enable / disable single decoders
730 with the options <code>--enable-decoder=<var>DECODER</var></code> /
731 <code>--disable-decoder=<var>DECODER</var></code>.
733 <p>The option <code>-codecs</code> of the ff* tools will display the list of
737 <a name="Video-Decoders"></a>
738 <h1 class="chapter"><a href="ffplay.html#toc-Video-Decoders">6. Video Decoders</a></h1>
740 <p>A description of some of the currently available video decoders
743 <a name="rawvideo"></a>
744 <h2 class="section"><a href="ffplay.html#toc-rawvideo">6.1 rawvideo</a></h2>
748 <p>This decoder decodes rawvideo streams.
750 <a name="Options-1"></a>
751 <h3 class="subsection"><a href="ffplay.html#toc-Options-1">6.1.1 Options</a></h3>
753 <dl compact="compact">
754 <dt> ‘<samp>top <var>top_field_first</var></samp>’</dt>
755 <dd><p>Specify the assumed field type of the input video.
756 </p><dl compact="compact">
757 <dt> ‘<samp>-1</samp>’</dt>
758 <dd><p>the video is assumed to be progressive (default)
760 <dt> ‘<samp>0</samp>’</dt>
761 <dd><p>bottom-field-first is assumed
763 <dt> ‘<samp>1</samp>’</dt>
764 <dd><p>top-field-first is assumed
771 <a name="Demuxers"></a>
772 <h1 class="chapter"><a href="ffplay.html#toc-Demuxers">7. Demuxers</a></h1>
774 <p>Demuxers are configured elements in FFmpeg which allow to read the
775 multimedia streams from a particular type of file.
777 <p>When you configure your FFmpeg build, all the supported demuxers
778 are enabled by default. You can list all available ones using the
779 configure option "–list-demuxers".
781 <p>You can disable all the demuxers using the configure option
782 "–disable-demuxers", and selectively enable a single demuxer with
783 the option "–enable-demuxer=<var>DEMUXER</var>", or disable it
784 with the option "–disable-demuxer=<var>DEMUXER</var>".
786 <p>The option "-formats" of the ff* tools will display the list of
789 <p>The description of some of the currently available demuxers follows.
791 <a name="image2-1"></a>
792 <h2 class="section"><a href="ffplay.html#toc-image2-1">7.1 image2</a></h2>
794 <p>Image file demuxer.
796 <p>This demuxer reads from a list of image files specified by a pattern.
798 <p>The pattern may contain the string "%d" or "%0<var>N</var>d", which
799 specifies the position of the characters representing a sequential
800 number in each filename matched by the pattern. If the form
801 "%d0<var>N</var>d" is used, the string representing the number in each
802 filename is 0-padded and <var>N</var> is the total number of 0-padded
803 digits representing the number. The literal character ’%’ can be
804 specified in the pattern with the string "%%".
806 <p>If the pattern contains "%d" or "%0<var>N</var>d", the first filename of
807 the file list specified by the pattern must contain a number
808 inclusively contained between 0 and 4, all the following numbers must
809 be sequential. This limitation may be hopefully fixed.
811 <p>The pattern may contain a suffix which is used to automatically
812 determine the format of the images contained in the files.
814 <p>For example the pattern "img-%03d.bmp" will match a sequence of
815 filenames of the form ‘<tt>img-001.bmp</tt>’, ‘<tt>img-002.bmp</tt>’, ...,
816 ‘<tt>img-010.bmp</tt>’, etc.; the pattern "i%%m%%g-%d.jpg" will match a
817 sequence of filenames of the form ‘<tt>i%m%g-1.jpg</tt>’,
818 ‘<tt>i%m%g-2.jpg</tt>’, ..., ‘<tt>i%m%g-10.jpg</tt>’, etc.
820 <p>The size, the pixel format, and the format of each image must be the
821 same for all the files in the sequence.
823 <p>The following example shows how to use ‘<tt>ffmpeg</tt>’ for creating a
824 video from the images in the file sequence ‘<tt>img-001.jpeg</tt>’,
825 ‘<tt>img-002.jpeg</tt>’, ..., assuming an input framerate of 10 frames per
827 </p><table><tr><td> </td><td><pre class="example">ffmpeg -r 10 -f image2 -i 'img-%03d.jpeg' out.avi
828 </pre></td></tr></table>
830 <p>Note that the pattern must not necessarily contain "%d" or
831 "%0<var>N</var>d", for example to convert a single image file
832 ‘<tt>img.jpeg</tt>’ you can employ the command:
833 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f image2 -i img.jpeg img.png
834 </pre></td></tr></table>
836 <a name="applehttp"></a>
837 <h2 class="section"><a href="ffplay.html#toc-applehttp">7.2 applehttp</a></h2>
839 <p>Apple HTTP Live Streaming demuxer.
841 <p>This demuxer presents all AVStreams from all variant streams.
842 The id field is set to the bitrate variant index number. By setting
843 the discard flags on AVStreams (by pressing ’a’ or ’v’ in ffplay),
844 the caller can decide which variant streams to actually receive.
845 The total bitrate of the variant that the stream belongs to is
846 available in a metadata key named "variant_bitrate".
848 <a name="Muxers"></a>
849 <h1 class="chapter"><a href="ffplay.html#toc-Muxers">8. Muxers</a></h1>
851 <p>Muxers are configured elements in FFmpeg which allow writing
852 multimedia streams to a particular type of file.
854 <p>When you configure your FFmpeg build, all the supported muxers
855 are enabled by default. You can list all available muxers using the
856 configure option <code>--list-muxers</code>.
858 <p>You can disable all the muxers with the configure option
859 <code>--disable-muxers</code> and selectively enable / disable single muxers
860 with the options <code>--enable-muxer=<var>MUXER</var></code> /
861 <code>--disable-muxer=<var>MUXER</var></code>.
863 <p>The option <code>-formats</code> of the ff* tools will display the list of
866 <p>A description of some of the currently available muxers follows.
868 <p><a name="crc"></a>
869 </p><a name="crc-1"></a>
870 <h2 class="section"><a href="ffplay.html#toc-crc-1">8.1 crc</a></h2>
872 <p>CRC (Cyclic Redundancy Check) testing format.
874 <p>This muxer computes and prints the Adler-32 CRC of all the input audio
875 and video frames. By default audio frames are converted to signed
876 16-bit raw audio and video frames to raw video before computing the
879 <p>The output of the muxer consists of a single line of the form:
880 CRC=0x<var>CRC</var>, where <var>CRC</var> is a hexadecimal number 0-padded to
881 8 digits containing the CRC for all the decoded input frames.
883 <p>For example to compute the CRC of the input, and store it in the file
884 ‘<tt>out.crc</tt>’:
885 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -f crc out.crc
886 </pre></td></tr></table>
888 <p>You can print the CRC to stdout with the command:
889 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -f crc -
890 </pre></td></tr></table>
892 <p>You can select the output format of each frame with ‘<tt>ffmpeg</tt>’ by
893 specifying the audio and video codec and format. For example to
894 compute the CRC of the input audio converted to PCM unsigned 8-bit
895 and the input video converted to MPEG-2 video, use the command:
896 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -acodec pcm_u8 -vcodec mpeg2video -f crc -
897 </pre></td></tr></table>
899 <p>See also the <a href="#framecrc">framecrc</a> muxer.
901 <p><a name="framecrc"></a>
902 </p><a name="framecrc-1"></a>
903 <h2 class="section"><a href="ffplay.html#toc-framecrc-1">8.2 framecrc</a></h2>
905 <p>Per-frame CRC (Cyclic Redundancy Check) testing format.
907 <p>This muxer computes and prints the Adler-32 CRC for each decoded audio
908 and video frame. By default audio frames are converted to signed
909 16-bit raw audio and video frames to raw video before computing the
912 <p>The output of the muxer consists of a line for each audio and video
913 frame of the form: <var>stream_index</var>, <var>frame_dts</var>,
914 <var>frame_size</var>, 0x<var>CRC</var>, where <var>CRC</var> is a hexadecimal
915 number 0-padded to 8 digits containing the CRC of the decoded frame.
917 <p>For example to compute the CRC of each decoded frame in the input, and
918 store it in the file ‘<tt>out.crc</tt>’:
919 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -f framecrc out.crc
920 </pre></td></tr></table>
922 <p>You can print the CRC of each decoded frame to stdout with the command:
923 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -f framecrc -
924 </pre></td></tr></table>
926 <p>You can select the output format of each frame with ‘<tt>ffmpeg</tt>’ by
927 specifying the audio and video codec and format. For example, to
928 compute the CRC of each decoded input audio frame converted to PCM
929 unsigned 8-bit and of each decoded input video frame converted to
930 MPEG-2 video, use the command:
931 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -acodec pcm_u8 -vcodec mpeg2video -f framecrc -
932 </pre></td></tr></table>
934 <p>See also the <a href="#crc">crc</a> muxer.
936 <a name="image2"></a>
937 <h2 class="section"><a href="ffplay.html#toc-image2">8.3 image2</a></h2>
941 <p>The image file muxer writes video frames to image files.
943 <p>The output filenames are specified by a pattern, which can be used to
944 produce sequentially numbered series of files.
945 The pattern may contain the string "%d" or "%0<var>N</var>d", this string
946 specifies the position of the characters representing a numbering in
947 the filenames. If the form "%0<var>N</var>d" is used, the string
948 representing the number in each filename is 0-padded to <var>N</var>
949 digits. The literal character ’%’ can be specified in the pattern with
950 the string "%%".
952 <p>If the pattern contains "%d" or "%0<var>N</var>d", the first filename of
953 the file list specified will contain the number 1, all the following
954 numbers will be sequential.
956 <p>The pattern may contain a suffix which is used to automatically
957 determine the format of the image files to write.
959 <p>For example the pattern "img-%03d.bmp" will specify a sequence of
960 filenames of the form ‘<tt>img-001.bmp</tt>’, ‘<tt>img-002.bmp</tt>’, ...,
961 ‘<tt>img-010.bmp</tt>’, etc.
962 The pattern "img%%-%d.jpg" will specify a sequence of filenames of the
963 form ‘<tt>img%-1.jpg</tt>’, ‘<tt>img%-2.jpg</tt>’, ..., ‘<tt>img%-10.jpg</tt>’,
966 <p>The following example shows how to use ‘<tt>ffmpeg</tt>’ for creating a
967 sequence of files ‘<tt>img-001.jpeg</tt>’, ‘<tt>img-002.jpeg</tt>’, ...,
968 taking one image every second from the input video:
969 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i in.avi -r 1 -f image2 'img-%03d.jpeg'
970 </pre></td></tr></table>
972 <p>Note that with ‘<tt>ffmpeg</tt>’, if the format is not specified with the
973 <code>-f</code> option and the output filename specifies an image file
974 format, the image2 muxer is automatically selected, so the previous
975 command can be written as:
976 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i in.avi -r 1 'img-%03d.jpeg'
977 </pre></td></tr></table>
979 <p>Note also that the pattern must not necessarily contain "%d" or
980 "%0<var>N</var>d", for example to create a single image file
981 ‘<tt>img.jpeg</tt>’ from the input video you can employ the command:
982 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i in.avi -f image2 -vframes 1 img.jpeg
983 </pre></td></tr></table>
985 <p>The image muxer supports the .Y.U.V image file format. This format is
986 special in that that each image frame consists of three files, for
987 each of the YUV420P components. To read or write this image file format,
988 specify the name of the ’.Y’ file. The muxer will automatically open the
989 ’.U’ and ’.V’ files as required.
991 <a name="mpegts"></a>
992 <h2 class="section"><a href="ffplay.html#toc-mpegts">8.4 mpegts</a></h2>
994 <p>MPEG transport stream muxer.
996 <p>This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
998 <p>The muxer options are:
1000 <dl compact="compact">
1001 <dt> ‘<samp>-mpegts_original_network_id <var>number</var></samp>’</dt>
1002 <dd><p>Set the original_network_id (default 0x0001). This is unique identifier
1003 of a network in DVB. Its main use is in the unique identification of a
1004 service through the path Original_Network_ID, Transport_Stream_ID.
1006 <dt> ‘<samp>-mpegts_transport_stream_id <var>number</var></samp>’</dt>
1007 <dd><p>Set the transport_stream_id (default 0x0001). This identifies a
1010 <dt> ‘<samp>-mpegts_service_id <var>number</var></samp>’</dt>
1011 <dd><p>Set the service_id (default 0x0001) also known as program in DVB.
1013 <dt> ‘<samp>-mpegts_pmt_start_pid <var>number</var></samp>’</dt>
1014 <dd><p>Set the first PID for PMT (default 0x1000, max 0x1f00).
1016 <dt> ‘<samp>-mpegts_start_pid <var>number</var></samp>’</dt>
1017 <dd><p>Set the first PID for data packets (default 0x0100, max 0x0f00).
1021 <p>The recognized metadata settings in mpegts muxer are <code>service_provider</code>
1022 and <code>service_name</code>. If they are not set the default for
1023 <code>service_provider</code> is "FFmpeg" and the default for
1024 <code>service_name</code> is "Service01".
1026 <table><tr><td> </td><td><pre class="example">ffmpeg -i file.mpg -acodec copy -vcodec copy \
1027 -mpegts_original_network_id 0x1122 \
1028 -mpegts_transport_stream_id 0x3344 \
1029 -mpegts_service_id 0x5566 \
1030 -mpegts_pmt_start_pid 0x1500 \
1031 -mpegts_start_pid 0x150 \
1032 -metadata service_provider="Some provider" \
1033 -metadata service_name="Some Channel" \
1035 </pre></td></tr></table>
1038 <h2 class="section"><a href="ffplay.html#toc-null">8.5 null</a></h2>
1042 <p>This muxer does not generate any output file, it is mainly useful for
1043 testing or benchmarking purposes.
1045 <p>For example to benchmark decoding with ‘<tt>ffmpeg</tt>’ you can use the
1047 </p><table><tr><td> </td><td><pre class="example">ffmpeg -benchmark -i INPUT -f null out.null
1048 </pre></td></tr></table>
1050 <p>Note that the above command does not read or write the ‘<tt>out.null</tt>’
1051 file, but specifying the output file is required by the ‘<tt>ffmpeg</tt>’
1054 <p>Alternatively you can write the command as:
1055 </p><table><tr><td> </td><td><pre class="example">ffmpeg -benchmark -i INPUT -f null -
1056 </pre></td></tr></table>
1058 <a name="matroska"></a>
1059 <h2 class="section"><a href="ffplay.html#toc-matroska">8.6 matroska</a></h2>
1061 <p>Matroska container muxer.
1063 <p>This muxer implements the matroska and webm container specs.
1065 <p>The recognized metadata settings in this muxer are:
1067 <dl compact="compact">
1068 <dt> ‘<samp>title=<var>title name</var></samp>’</dt>
1069 <dd><p>Name provided to a single track
1073 <dl compact="compact">
1074 <dt> ‘<samp>language=<var>language name</var></samp>’</dt>
1075 <dd><p>Specifies the language of the track in the Matroska languages form
1079 <dl compact="compact">
1080 <dt> ‘<samp>stereo_mode=<var>mode</var></samp>’</dt>
1081 <dd><p>Stereo 3D video layout of two views in a single video track
1082 </p><dl compact="compact">
1083 <dt> ‘<samp>mono</samp>’</dt>
1084 <dd><p>video is not stereo
1086 <dt> ‘<samp>left_right</samp>’</dt>
1087 <dd><p>Both views are arranged side by side, Left-eye view is on the left
1089 <dt> ‘<samp>bottom_top</samp>’</dt>
1090 <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is at bottom
1092 <dt> ‘<samp>top_bottom</samp>’</dt>
1093 <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is on top
1095 <dt> ‘<samp>checkerboard_rl</samp>’</dt>
1096 <dd><p>Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
1098 <dt> ‘<samp>checkerboard_lr</samp>’</dt>
1099 <dd><p>Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
1101 <dt> ‘<samp>row_interleaved_rl</samp>’</dt>
1102 <dd><p>Each view is constituted by a row based interleaving, Right-eye view is first row
1104 <dt> ‘<samp>row_interleaved_lr</samp>’</dt>
1105 <dd><p>Each view is constituted by a row based interleaving, Left-eye view is first row
1107 <dt> ‘<samp>col_interleaved_rl</samp>’</dt>
1108 <dd><p>Both views are arranged in a column based interleaving manner, Right-eye view is first column
1110 <dt> ‘<samp>col_interleaved_lr</samp>’</dt>
1111 <dd><p>Both views are arranged in a column based interleaving manner, Left-eye view is first column
1113 <dt> ‘<samp>anaglyph_cyan_red</samp>’</dt>
1114 <dd><p>All frames are in anaglyph format viewable through red-cyan filters
1116 <dt> ‘<samp>right_left</samp>’</dt>
1117 <dd><p>Both views are arranged side by side, Right-eye view is on the left
1119 <dt> ‘<samp>anaglyph_green_magenta</samp>’</dt>
1120 <dd><p>All frames are in anaglyph format viewable through green-magenta filters
1122 <dt> ‘<samp>block_lr</samp>’</dt>
1123 <dd><p>Both eyes laced in one Block, Left-eye view is first
1125 <dt> ‘<samp>block_rl</samp>’</dt>
1126 <dd><p>Both eyes laced in one Block, Right-eye view is first
1132 <p>For example a 3D WebM clip can be created using the following command line:
1133 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i sample_left_right_clip.mpg -an -vcodec libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
1134 </pre></td></tr></table>
1136 <a name="Input-Devices"></a>
1137 <h1 class="chapter"><a href="ffplay.html#toc-Input-Devices">9. Input Devices</a></h1>
1139 <p>Input devices are configured elements in FFmpeg which allow to access
1140 the data coming from a multimedia device attached to your system.
1142 <p>When you configure your FFmpeg build, all the supported input devices
1143 are enabled by default. You can list all available ones using the
1144 configure option "–list-indevs".
1146 <p>You can disable all the input devices using the configure option
1147 "–disable-indevs", and selectively enable an input device using the
1148 option "–enable-indev=<var>INDEV</var>", or you can disable a particular
1149 input device using the option "–disable-indev=<var>INDEV</var>".
1151 <p>The option "-formats" of the ff* tools will display the list of
1152 supported input devices (amongst the demuxers).
1154 <p>A description of the currently available input devices follows.
1156 <a name="alsa-1"></a>
1157 <h2 class="section"><a href="ffplay.html#toc-alsa-1">9.1 alsa</a></h2>
1159 <p>ALSA (Advanced Linux Sound Architecture) input device.
1161 <p>To enable this input device during configuration you need libasound
1162 installed on your system.
1164 <p>This device allows capturing from an ALSA device. The name of the
1165 device to capture has to be an ALSA card identifier.
1167 <p>An ALSA identifier has the syntax:
1168 </p><table><tr><td> </td><td><pre class="example">hw:<var>CARD</var>[,<var>DEV</var>[,<var>SUBDEV</var>]]
1169 </pre></td></tr></table>
1171 <p>where the <var>DEV</var> and <var>SUBDEV</var> components are optional.
1173 <p>The three arguments (in order: <var>CARD</var>,<var>DEV</var>,<var>SUBDEV</var>)
1174 specify card number or identifier, device number and subdevice number
1177 <p>To see the list of cards currently recognized by your system check the
1178 files ‘<tt>/proc/asound/cards</tt>’ and ‘<tt>/proc/asound/devices</tt>’.
1180 <p>For example to capture with ‘<tt>ffmpeg</tt>’ from an ALSA device with
1181 card id 0, you may run the command:
1182 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f alsa -i hw:0 alsaout.wav
1183 </pre></td></tr></table>
1185 <p>For more information see:
1186 <a href="http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html">http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html</a>
1189 <h2 class="section"><a href="ffplay.html#toc-bktr">9.2 bktr</a></h2>
1191 <p>BSD video input device.
1193 <a name="dv1394"></a>
1194 <h2 class="section"><a href="ffplay.html#toc-dv1394">9.3 dv1394</a></h2>
1196 <p>Linux DV 1394 input device.
1198 <a name="fbdev"></a>
1199 <h2 class="section"><a href="ffplay.html#toc-fbdev">9.4 fbdev</a></h2>
1201 <p>Linux framebuffer input device.
1203 <p>The Linux framebuffer is a graphic hardware-independent abstraction
1204 layer to show graphics on a computer monitor, typically on the
1205 console. It is accessed through a file device node, usually
1206 ‘<tt>/dev/fb0</tt>’.
1208 <p>For more detailed information read the file
1209 Documentation/fb/framebuffer.txt included in the Linux source tree.
1211 <p>To record from the framebuffer device ‘<tt>/dev/fb0</tt>’ with
1212 ‘<tt>ffmpeg</tt>’:
1213 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
1214 </pre></td></tr></table>
1216 <p>You can take a single screenshot image with the command:
1217 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f fbdev -vframes 1 -r 1 -i /dev/fb0 screenshot.jpeg
1218 </pre></td></tr></table>
1220 <p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
1223 <h2 class="section"><a href="ffplay.html#toc-jack">9.5 jack</a></h2>
1225 <p>JACK input device.
1227 <p>To enable this input device during configuration you need libjack
1228 installed on your system.
1230 <p>A JACK input device creates one or more JACK writable clients, one for
1231 each audio channel, with name <var>client_name</var>:input_<var>N</var>, where
1232 <var>client_name</var> is the name provided by the application, and <var>N</var>
1233 is a number which identifies the channel.
1234 Each writable client will send the acquired data to the FFmpeg input
1237 <p>Once you have created one or more JACK readable clients, you need to
1238 connect them to one or more JACK writable clients.
1240 <p>To connect or disconnect JACK clients you can use the
1241 ‘<tt>jack_connect</tt>’ and ‘<tt>jack_disconnect</tt>’ programs, or do it
1242 through a graphical interface, for example with ‘<tt>qjackctl</tt>’.
1244 <p>To list the JACK clients and their properties you can invoke the command
1245 ‘<tt>jack_lsp</tt>’.
1247 <p>Follows an example which shows how to capture a JACK readable client
1248 with ‘<tt>ffmpeg</tt>’.
1249 </p><table><tr><td> </td><td><pre class="example"># Create a JACK writable client with name "ffmpeg".
1250 $ ffmpeg -f jack -i ffmpeg -y out.wav
1252 # Start the sample jack_metro readable client.
1253 $ jack_metro -b 120 -d 0.2 -f 4000
1255 # List the current JACK clients.
1264 # Connect metro to the ffmpeg writable client.
1265 $ jack_connect metro:120_bpm ffmpeg:input_1
1266 </pre></td></tr></table>
1268 <p>For more information read:
1269 <a href="http://jackaudio.org/">http://jackaudio.org/</a>
1271 <a name="libdc1394"></a>
1272 <h2 class="section"><a href="ffplay.html#toc-libdc1394">9.6 libdc1394</a></h2>
1274 <p>IIDC1394 input device, based on libdc1394 and libraw1394.
1276 <a name="openal"></a>
1277 <h2 class="section"><a href="ffplay.html#toc-openal">9.7 openal</a></h2>
1279 <p>The OpenAL input device provides audio capture on all systems with a
1280 working OpenAL 1.1 implementation.
1282 <p>To enable this input device during configuration, you need OpenAL
1283 headers and libraries installed on your system, and need to configure
1284 FFmpeg with <code>--enable-openal</code>.
1286 <p>OpenAL headers and libraries should be provided as part of your OpenAL
1287 implementation, or as an additional download (an SDK). Depending on your
1288 installation you may need to specify additional flags via the
1289 <code>--extra-cflags</code> and <code>--extra-ldflags</code> for allowing the build
1290 system to locate the OpenAL headers and libraries.
1292 <p>An incomplete list of OpenAL implementations follows:
1294 <dl compact="compact">
1295 <dt> <strong>Creative</strong></dt>
1296 <dd><p>The official Windows implementation, providing hardware acceleration
1297 with supported devices and software fallback.
1298 See <a href="http://openal.org/">http://openal.org/</a>.
1300 <dt> <strong>OpenAL Soft</strong></dt>
1301 <dd><p>Portable, open source (LGPL) software implementation. Includes
1302 backends for the most common sound APIs on the Windows, Linux,
1303 Solaris, and BSD operating systems.
1304 See <a href="http://kcat.strangesoft.net/openal.html">http://kcat.strangesoft.net/openal.html</a>.
1306 <dt> <strong>Apple</strong></dt>
1307 <dd><p>OpenAL is part of Core Audio, the official Mac OS X Audio interface.
1308 See <a href="http://developer.apple.com/technologies/mac/audio-and-video.html">http://developer.apple.com/technologies/mac/audio-and-video.html</a>
1312 <p>This device allows to capture from an audio input device handled
1315 <p>You need to specify the name of the device to capture in the provided
1316 filename. If the empty string is provided, the device will
1317 automatically select the default device. You can get the list of the
1318 supported devices by using the option <var>list_devices</var>.
1320 <a name="Options"></a>
1321 <h3 class="subsection"><a href="ffplay.html#toc-Options">9.7.1 Options</a></h3>
1323 <dl compact="compact">
1324 <dt> ‘<samp>channels</samp>’</dt>
1325 <dd><p>Set the number of channels in the captured audio. Only the values
1326 ‘<samp>1</samp>’ (monaural) and ‘<samp>2</samp>’ (stereo) are currently supported.
1327 Defaults to ‘<samp>2</samp>’.
1330 <dt> ‘<samp>sample_size</samp>’</dt>
1331 <dd><p>Set the sample size (in bits) of the captured audio. Only the values
1332 ‘<samp>8</samp>’ and ‘<samp>16</samp>’ are currently supported. Defaults to
1333 ‘<samp>16</samp>’.
1336 <dt> ‘<samp>sample_rate</samp>’</dt>
1337 <dd><p>Set the sample rate (in Hz) of the captured audio.
1338 Defaults to ‘<samp>44.1k</samp>’.
1341 <dt> ‘<samp>list_devices</samp>’</dt>
1342 <dd><p>If set to ‘<samp>true</samp>’, print a list of devices and exit.
1343 Defaults to ‘<samp>false</samp>’.
1348 <a name="Examples"></a>
1349 <h3 class="subsection"><a href="ffplay.html#toc-Examples">9.7.2 Examples</a></h3>
1351 <p>Print the list of OpenAL supported devices and exit:
1352 </p><table><tr><td> </td><td><pre class="example">$ ffmpeg -list_devices true -f openal -i dummy out.ogg
1353 </pre></td></tr></table>
1355 <p>Capture from the OpenAL device ‘<tt>DR-BT101 via PulseAudio</tt>’:
1356 </p><table><tr><td> </td><td><pre class="example">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
1357 </pre></td></tr></table>
1359 <p>Capture from the default device (note the empty string ” as filename):
1360 </p><table><tr><td> </td><td><pre class="example">$ ffmpeg -f openal -i '' out.ogg
1361 </pre></td></tr></table>
1363 <p>Capture from two devices simultaneously, writing to two different files,
1364 within the same ‘<tt>ffmpeg</tt>’ command:
1365 </p><table><tr><td> </td><td><pre class="example">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
1366 </pre></td></tr></table>
1367 <p>Note: not all OpenAL implementations support multiple simultaneous capture -
1368 try the latest OpenAL Soft if the above does not work.
1371 <h2 class="section"><a href="ffplay.html#toc-oss">9.8 oss</a></h2>
1373 <p>Open Sound System input device.
1375 <p>The filename to provide to the input device is the device node
1376 representing the OSS input device, and is usually set to
1377 ‘<tt>/dev/dsp</tt>’.
1379 <p>For example to grab from ‘<tt>/dev/dsp</tt>’ using ‘<tt>ffmpeg</tt>’ use the
1381 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
1382 </pre></td></tr></table>
1384 <p>For more information about OSS see:
1385 <a href="http://manuals.opensound.com/usersguide/dsp.html">http://manuals.opensound.com/usersguide/dsp.html</a>
1387 <a name="sndio-1"></a>
1388 <h2 class="section"><a href="ffplay.html#toc-sndio-1">9.9 sndio</a></h2>
1390 <p>sndio input device.
1392 <p>To enable this input device during configuration you need libsndio
1393 installed on your system.
1395 <p>The filename to provide to the input device is the device node
1396 representing the sndio input device, and is usually set to
1397 ‘<tt>/dev/audio0</tt>’.
1399 <p>For example to grab from ‘<tt>/dev/audio0</tt>’ using ‘<tt>ffmpeg</tt>’ use the
1401 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
1402 </pre></td></tr></table>
1404 <a name="video4linux-and-video4linux2"></a>
1405 <h2 class="section"><a href="ffplay.html#toc-video4linux-and-video4linux2">9.10 video4linux and video4linux2</a></h2>
1407 <p>Video4Linux and Video4Linux2 input video devices.
1409 <p>The name of the device to grab is a file device node, usually Linux
1410 systems tend to automatically create such nodes when the device
1411 (e.g. an USB webcam) is plugged into the system, and has a name of the
1412 kind ‘<tt>/dev/video<var>N</var></tt>’, where <var>N</var> is a number associated to
1415 <p>Video4Linux and Video4Linux2 devices only support a limited set of
1416 <var>width</var>x<var>height</var> sizes and framerates. You can check which are
1417 supported for example with the command ‘<tt>dov4l</tt>’ for Video4Linux
1418 devices and the command ‘<tt>v4l-info</tt>’ for Video4Linux2 devices.
1420 <p>If the size for the device is set to 0x0, the input device will
1421 try to autodetect the size to use.
1422 Only for the video4linux2 device, if the frame rate is set to 0/0 the
1423 input device will use the frame rate value already set in the driver.
1425 <p>Video4Linux support is deprecated since Linux 2.6.30, and will be
1426 dropped in later versions.
1428 <p>Follow some usage examples of the video4linux devices with the ff*
1430 </p><table><tr><td> </td><td><pre class="example"># Grab and show the input of a video4linux device, frame rate is set
1431 # to the default of 25/1.
1432 ffplay -s 320x240 -f video4linux /dev/video0
1434 # Grab and show the input of a video4linux2 device, autoadjust size.
1435 ffplay -f video4linux2 /dev/video0
1437 # Grab and record the input of a video4linux2 device, autoadjust size,
1438 # frame rate value defaults to 0/0 so it is read from the video4linux2
1440 ffmpeg -f video4linux2 -i /dev/video0 out.mpeg
1441 </pre></td></tr></table>
1443 <a name="vfwcap"></a>
1444 <h2 class="section"><a href="ffplay.html#toc-vfwcap">9.11 vfwcap</a></h2>
1446 <p>VfW (Video for Windows) capture input device.
1448 <p>The filename passed as input is the capture driver number, ranging from
1449 0 to 9. You may use "list" as filename to print a list of drivers. Any
1450 other filename will be interpreted as device number 0.
1452 <a name="x11grab"></a>
1453 <h2 class="section"><a href="ffplay.html#toc-x11grab">9.12 x11grab</a></h2>
1455 <p>X11 video input device.
1457 <p>This device allows to capture a region of an X11 display.
1459 <p>The filename passed as input has the syntax:
1460 </p><table><tr><td> </td><td><pre class="example">[<var>hostname</var>]:<var>display_number</var>.<var>screen_number</var>[+<var>x_offset</var>,<var>y_offset</var>]
1461 </pre></td></tr></table>
1463 <p><var>hostname</var>:<var>display_number</var>.<var>screen_number</var> specifies the
1464 X11 display name of the screen to grab from. <var>hostname</var> can be
1465 ommitted, and defaults to "localhost". The environment variable
1466 <code>DISPLAY</code> contains the default display name.
1468 <p><var>x_offset</var> and <var>y_offset</var> specify the offsets of the grabbed
1469 area with respect to the top-left border of the X11 screen. They
1472 <p>Check the X11 documentation (e.g. man X) for more detailed information.
1474 <p>Use the ‘<tt>dpyinfo</tt>’ program for getting basic information about the
1475 properties of your X11 display (e.g. grep for "name" or "dimensions").
1477 <p>For example to grab from ‘<tt>:0.0</tt>’ using ‘<tt>ffmpeg</tt>’:
1478 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpg
1480 # Grab at position 10,20.
1481 ffmpeg -f x11grab -25 -s cif -i :0.0+10,20 out.mpg
1482 </pre></td></tr></table>
1484 <a name="Output-Devices"></a>
1485 <h1 class="chapter"><a href="ffplay.html#toc-Output-Devices">10. Output Devices</a></h1>
1487 <p>Output devices are configured elements in FFmpeg which allow to write
1488 multimedia data to an output device attached to your system.
1490 <p>When you configure your FFmpeg build, all the supported output devices
1491 are enabled by default. You can list all available ones using the
1492 configure option "–list-outdevs".
1494 <p>You can disable all the output devices using the configure option
1495 "–disable-outdevs", and selectively enable an output device using the
1496 option "–enable-outdev=<var>OUTDEV</var>", or you can disable a particular
1497 input device using the option "–disable-outdev=<var>OUTDEV</var>".
1499 <p>The option "-formats" of the ff* tools will display the list of
1500 enabled output devices (amongst the muxers).
1502 <p>A description of the currently available output devices follows.
1505 <h2 class="section"><a href="ffplay.html#toc-alsa">10.1 alsa</a></h2>
1507 <p>ALSA (Advanced Linux Sound Architecture) output device.
1509 <a name="oss-1"></a>
1510 <h2 class="section"><a href="ffplay.html#toc-oss-1">10.2 oss</a></h2>
1512 <p>OSS (Open Sound System) output device.
1515 <h2 class="section"><a href="ffplay.html#toc-sdl">10.3 sdl</a></h2>
1517 <p>SDL (Simple Directmedia Layer) output device.
1519 <p>This output devices allows to show a video stream in an SDL
1520 window. Only one SDL window is allowed per application, so you can
1521 have only one instance of this output device in an application.
1523 <p>To enable this output device you need libsdl installed on your system
1524 when configuring your build.
1526 <p>For more information about SDL, check:
1527 <a href="http://www.libsdl.org/">http://www.libsdl.org/</a>
1529 <a name="Options-2"></a>
1530 <h3 class="subsection"><a href="ffplay.html#toc-Options-2">10.3.1 Options</a></h3>
1532 <dl compact="compact">
1533 <dt> ‘<samp>window_title</samp>’</dt>
1534 <dd><p>Set the SDL window title, if not specified default to the filename
1535 specified for the output device.
1538 <dt> ‘<samp>icon_title</samp>’</dt>
1539 <dd><p>Set the name of the iconified SDL window, if not specified it is set
1540 to the same value of <var>window_title</var>.
1543 <dt> ‘<samp>window_size</samp>’</dt>
1544 <dd><p>Set the SDL window size, can be a string of the form
1545 <var>width</var>x<var>height</var> or a video size abbreviation.
1546 If not specified it defaults to the size of the input video.
1550 <a name="Examples-1"></a>
1551 <h3 class="subsection"><a href="ffplay.html#toc-Examples-1">10.3.2 Examples</a></h3>
1553 <p>The following command shows the ‘<tt>ffmpeg</tt>’ output is an
1554 SDL window, forcing its size to the qcif format:
1555 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -vcodec rawvideo -pix_fmt yuv420p -window_size qcif -f sdl "SDL output"
1556 </pre></td></tr></table>
1558 <a name="sndio"></a>
1559 <h2 class="section"><a href="ffplay.html#toc-sndio">10.4 sndio</a></h2>
1561 <p>sndio audio output device.
1563 <a name="Protocols"></a>
1564 <h1 class="chapter"><a href="ffplay.html#toc-Protocols">11. Protocols</a></h1>
1566 <p>Protocols are configured elements in FFmpeg which allow to access
1567 resources which require the use of a particular protocol.
1569 <p>When you configure your FFmpeg build, all the supported protocols are
1570 enabled by default. You can list all available ones using the
1571 configure option "–list-protocols".
1573 <p>You can disable all the protocols using the configure option
1574 "–disable-protocols", and selectively enable a protocol using the
1575 option "–enable-protocol=<var>PROTOCOL</var>", or you can disable a
1576 particular protocol using the option
1577 "–disable-protocol=<var>PROTOCOL</var>".
1579 <p>The option "-protocols" of the ff* tools will display the list of
1580 supported protocols.
1582 <p>A description of the currently available protocols follows.
1584 <a name="applehttp-1"></a>
1585 <h2 class="section"><a href="ffplay.html#toc-applehttp-1">11.1 applehttp</a></h2>
1587 <p>Read Apple HTTP Live Streaming compliant segmented stream as
1588 a uniform one. The M3U8 playlists describing the segments can be
1589 remote HTTP resources or local files, accessed using the standard
1591 HTTP is default, specific protocol can be declared by specifying
1592 "+<var>proto</var>" after the applehttp URI scheme name, where <var>proto</var>
1593 is either "file" or "http".
1595 <table><tr><td> </td><td><pre class="example">applehttp://host/path/to/remote/resource.m3u8
1596 applehttp+http://host/path/to/remote/resource.m3u8
1597 applehttp+file://path/to/local/resource.m3u8
1598 </pre></td></tr></table>
1600 <a name="concat"></a>
1601 <h2 class="section"><a href="ffplay.html#toc-concat">11.2 concat</a></h2>
1603 <p>Physical concatenation protocol.
1605 <p>Allow to read and seek from many resource in sequence as if they were
1608 <p>A URL accepted by this protocol has the syntax:
1609 </p><table><tr><td> </td><td><pre class="example">concat:<var>URL1</var>|<var>URL2</var>|...|<var>URLN</var>
1610 </pre></td></tr></table>
1612 <p>where <var>URL1</var>, <var>URL2</var>, ..., <var>URLN</var> are the urls of the
1613 resource to be concatenated, each one possibly specifying a distinct
1616 <p>For example to read a sequence of files ‘<tt>split1.mpeg</tt>’,
1617 ‘<tt>split2.mpeg</tt>’, ‘<tt>split3.mpeg</tt>’ with ‘<tt>ffplay</tt>’ use the
1619 </p><table><tr><td> </td><td><pre class="example">ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
1620 </pre></td></tr></table>
1622 <p>Note that you may need to escape the character "|" which is special for
1626 <h2 class="section"><a href="ffplay.html#toc-file">11.3 file</a></h2>
1628 <p>File access protocol.
1630 <p>Allow to read from or read to a file.
1632 <p>For example to read from a file ‘<tt>input.mpeg</tt>’ with ‘<tt>ffmpeg</tt>’
1634 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i file:input.mpeg output.mpeg
1635 </pre></td></tr></table>
1637 <p>The ff* tools default to the file protocol, that is a resource
1638 specified with the name "FILE.mpeg" is interpreted as the URL
1639 "file:FILE.mpeg".
1641 <a name="gopher"></a>
1642 <h2 class="section"><a href="ffplay.html#toc-gopher">11.4 gopher</a></h2>
1647 <h2 class="section"><a href="ffplay.html#toc-http">11.5 http</a></h2>
1649 <p>HTTP (Hyper Text Transfer Protocol).
1652 <h2 class="section"><a href="ffplay.html#toc-mmst">11.6 mmst</a></h2>
1654 <p>MMS (Microsoft Media Server) protocol over TCP.
1657 <h2 class="section"><a href="ffplay.html#toc-mmsh">11.7 mmsh</a></h2>
1659 <p>MMS (Microsoft Media Server) protocol over HTTP.
1661 <p>The required syntax is:
1662 </p><table><tr><td> </td><td><pre class="example">mmsh://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
1663 </pre></td></tr></table>
1666 <h2 class="section"><a href="ffplay.html#toc-md5">11.8 md5</a></h2>
1668 <p>MD5 output protocol.
1670 <p>Computes the MD5 hash of the data to be written, and on close writes
1671 this to the designated output or stdout if none is specified. It can
1672 be used to test muxers without writing an actual file.
1674 <p>Some examples follow.
1675 </p><table><tr><td> </td><td><pre class="example"># Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
1676 ffmpeg -i input.flv -f avi -y md5:output.avi.md5
1678 # Write the MD5 hash of the encoded AVI file to stdout.
1679 ffmpeg -i input.flv -f avi -y md5:
1680 </pre></td></tr></table>
1682 <p>Note that some formats (typically MOV) require the output protocol to
1683 be seekable, so they will fail with the MD5 output protocol.
1686 <h2 class="section"><a href="ffplay.html#toc-pipe">11.9 pipe</a></h2>
1688 <p>UNIX pipe access protocol.
1690 <p>Allow to read and write from UNIX pipes.
1692 <p>The accepted syntax is:
1693 </p><table><tr><td> </td><td><pre class="example">pipe:[<var>number</var>]
1694 </pre></td></tr></table>
1696 <p><var>number</var> is the number corresponding to the file descriptor of the
1697 pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If <var>number</var>
1698 is not specified, by default the stdout file descriptor will be used
1699 for writing, stdin for reading.
1701 <p>For example to read from stdin with ‘<tt>ffmpeg</tt>’:
1702 </p><table><tr><td> </td><td><pre class="example">cat test.wav | ffmpeg -i pipe:0
1703 # ...this is the same as...
1704 cat test.wav | ffmpeg -i pipe:
1705 </pre></td></tr></table>
1707 <p>For writing to stdout with ‘<tt>ffmpeg</tt>’:
1708 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi
1709 # ...this is the same as...
1710 ffmpeg -i test.wav -f avi pipe: | cat > test.avi
1711 </pre></td></tr></table>
1713 <p>Note that some formats (typically MOV), require the output protocol to
1714 be seekable, so they will fail with the pipe output protocol.
1717 <h2 class="section"><a href="ffplay.html#toc-rtmp">11.10 rtmp</a></h2>
1719 <p>Real-Time Messaging Protocol.
1721 <p>The Real-Time Messaging Protocol (RTMP) is used for streaming multime‐
1722 dia content across a TCP/IP network.
1724 <p>The required syntax is:
1725 </p><table><tr><td> </td><td><pre class="example">rtmp://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
1726 </pre></td></tr></table>
1728 <p>The accepted parameters are:
1729 </p><dl compact="compact">
1730 <dt> ‘<samp>server</samp>’</dt>
1731 <dd><p>The address of the RTMP server.
1734 <dt> ‘<samp>port</samp>’</dt>
1735 <dd><p>The number of the TCP port to use (by default is 1935).
1738 <dt> ‘<samp>app</samp>’</dt>
1739 <dd><p>It is the name of the application to access. It usually corresponds to
1740 the path where the application is installed on the RTMP server
1741 (e.g. ‘<tt>/ondemand/</tt>’, ‘<tt>/flash/live/</tt>’, etc.).
1744 <dt> ‘<samp>playpath</samp>’</dt>
1745 <dd><p>It is the path or name of the resource to play with reference to the
1746 application specified in <var>app</var>, may be prefixed by "mp4:".
1751 <p>For example to read with ‘<tt>ffplay</tt>’ a multimedia resource named
1752 "sample" from the application "vod" from an RTMP server "myserver":
1753 </p><table><tr><td> </td><td><pre class="example">ffplay rtmp://myserver/vod/sample
1754 </pre></td></tr></table>
1756 <a name="rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte"></a>
1757 <h2 class="section"><a href="ffplay.html#toc-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">11.11 rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></h2>
1759 <p>Real-Time Messaging Protocol and its variants supported through
1762 <p>Requires the presence of the librtmp headers and library during
1763 configuration. You need to explicitely configure the build with
1764 "–enable-librtmp". If enabled this will replace the native RTMP
1767 <p>This protocol provides most client functions and a few server
1768 functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
1769 encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
1770 variants of these encrypted types (RTMPTE, RTMPTS).
1772 <p>The required syntax is:
1773 </p><table><tr><td> </td><td><pre class="example"><var>rtmp_proto</var>://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>] <var>options</var>
1774 </pre></td></tr></table>
1776 <p>where <var>rtmp_proto</var> is one of the strings "rtmp", "rtmpt", "rtmpe",
1777 "rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and
1778 <var>server</var>, <var>port</var>, <var>app</var> and <var>playpath</var> have the same
1779 meaning as specified for the RTMP native protocol.
1780 <var>options</var> contains a list of space-separated options of the form
1781 <var>key</var>=<var>val</var>.
1783 <p>See the librtmp manual page (man 3 librtmp) for more information.
1785 <p>For example, to stream a file in real-time to an RTMP server using
1786 ‘<tt>ffmpeg</tt>’:
1787 </p><table><tr><td> </td><td><pre class="example">ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
1788 </pre></td></tr></table>
1790 <p>To play the same stream using ‘<tt>ffplay</tt>’:
1791 </p><table><tr><td> </td><td><pre class="example">ffplay "rtmp://myserver/live/mystream live=1"
1792 </pre></td></tr></table>
1795 <h2 class="section"><a href="ffplay.html#toc-rtp">11.12 rtp</a></h2>
1797 <p>Real-Time Protocol.
1800 <h2 class="section"><a href="ffplay.html#toc-rtsp">11.13 rtsp</a></h2>
1802 <p>RTSP is not technically a protocol handler in libavformat, it is a demuxer
1803 and muxer. The demuxer supports both normal RTSP (with data transferred
1804 over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
1805 data transferred over RDT).
1807 <p>The muxer can be used to send a stream using RTSP ANNOUNCE to a server
1808 supporting it (currently Darwin Streaming Server and Mischa Spiegelmock’s
1809 <a href="http://github.com/revmischa/rtsp-server">RTSP server</a>).
1811 <p>The required syntax for a RTSP url is:
1812 </p><table><tr><td> </td><td><pre class="example">rtsp://<var>hostname</var>[:<var>port</var>]/<var>path</var>[?<var>options</var>]
1813 </pre></td></tr></table>
1815 <p><var>options</var> is a <code>&</code>-separated list. The following options
1818 <dl compact="compact">
1819 <dt> ‘<samp>udp</samp>’</dt>
1820 <dd><p>Use UDP as lower transport protocol.
1823 <dt> ‘<samp>tcp</samp>’</dt>
1824 <dd><p>Use TCP (interleaving within the RTSP control channel) as lower
1828 <dt> ‘<samp>multicast</samp>’</dt>
1829 <dd><p>Use UDP multicast as lower transport protocol.
1832 <dt> ‘<samp>http</samp>’</dt>
1833 <dd><p>Use HTTP tunneling as lower transport protocol, which is useful for
1837 <dt> ‘<samp>filter_src</samp>’</dt>
1838 <dd><p>Accept packets only from negotiated peer address and port.
1842 <p>Multiple lower transport protocols may be specified, in that case they are
1843 tried one at a time (if the setup of one fails, the next one is tried).
1844 For the muxer, only the <code>tcp</code> and <code>udp</code> options are supported.
1846 <p>When receiving data over UDP, the demuxer tries to reorder received packets
1847 (since they may arrive out of order, or packets may get lost totally). In
1848 order for this to be enabled, a maximum delay must be specified in the
1849 <code>max_delay</code> field of AVFormatContext.
1851 <p>When watching multi-bitrate Real-RTSP streams with ‘<tt>ffplay</tt>’, the
1852 streams to display can be chosen with <code>-vst</code> <var>n</var> and
1853 <code>-ast</code> <var>n</var> for video and audio respectively, and can be switched
1854 on the fly by pressing <code>v</code> and <code>a</code>.
1856 <p>Example command lines:
1858 <p>To watch a stream over UDP, with a max reordering delay of 0.5 seconds:
1860 <table><tr><td> </td><td><pre class="example">ffplay -max_delay 500000 rtsp://server/video.mp4?udp
1861 </pre></td></tr></table>
1863 <p>To watch a stream tunneled over HTTP:
1865 <table><tr><td> </td><td><pre class="example">ffplay rtsp://server/video.mp4?http
1866 </pre></td></tr></table>
1868 <p>To send a stream in realtime to a RTSP server, for others to watch:
1870 <table><tr><td> </td><td><pre class="example">ffmpeg -re -i <var>input</var> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
1871 </pre></td></tr></table>
1874 <h2 class="section"><a href="ffplay.html#toc-sap">11.14 sap</a></h2>
1876 <p>Session Announcement Protocol (RFC 2974). This is not technically a
1877 protocol handler in libavformat, it is a muxer and demuxer.
1878 It is used for signalling of RTP streams, by announcing the SDP for the
1879 streams regularly on a separate port.
1881 <a name="Muxer"></a>
1882 <h3 class="subsection"><a href="ffplay.html#toc-Muxer">11.14.1 Muxer</a></h3>
1884 <p>The syntax for a SAP url given to the muxer is:
1885 </p><table><tr><td> </td><td><pre class="example">sap://<var>destination</var>[:<var>port</var>][?<var>options</var>]
1886 </pre></td></tr></table>
1888 <p>The RTP packets are sent to <var>destination</var> on port <var>port</var>,
1889 or to port 5004 if no port is specified.
1890 <var>options</var> is a <code>&</code>-separated list. The following options
1893 <dl compact="compact">
1894 <dt> ‘<samp>announce_addr=<var>address</var></samp>’</dt>
1895 <dd><p>Specify the destination IP address for sending the announcements to.
1896 If omitted, the announcements are sent to the commonly used SAP
1897 announcement multicast address 224.2.127.254 (sap.mcast.net), or
1898 ff0e::2:7ffe if <var>destination</var> is an IPv6 address.
1901 <dt> ‘<samp>announce_port=<var>port</var></samp>’</dt>
1902 <dd><p>Specify the port to send the announcements on, defaults to
1903 9875 if not specified.
1906 <dt> ‘<samp>ttl=<var>ttl</var></samp>’</dt>
1907 <dd><p>Specify the time to live value for the announcements and RTP packets,
1911 <dt> ‘<samp>same_port=<var>0|1</var></samp>’</dt>
1912 <dd><p>If set to 1, send all RTP streams on the same port pair. If zero (the
1913 default), all streams are sent on unique ports, with each stream on a
1914 port 2 numbers higher than the previous.
1915 VLC/Live555 requires this to be set to 1, to be able to receive the stream.
1916 The RTP stack in libavformat for receiving requires all streams to be sent
1921 <p>Example command lines follow.
1923 <p>To broadcast a stream on the local subnet, for watching in VLC:
1925 <table><tr><td> </td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255?same_port=1
1926 </pre></td></tr></table>
1928 <p>Similarly, for watching in ffplay:
1930 <table><tr><td> </td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255
1931 </pre></td></tr></table>
1933 <p>And for watching in ffplay, over IPv6:
1935 <table><tr><td> </td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://[ff0e::1:2:3:4]
1936 </pre></td></tr></table>
1938 <a name="Demuxer"></a>
1939 <h3 class="subsection"><a href="ffplay.html#toc-Demuxer">11.14.2 Demuxer</a></h3>
1941 <p>The syntax for a SAP url given to the demuxer is:
1942 </p><table><tr><td> </td><td><pre class="example">sap://[<var>address</var>][:<var>port</var>]
1943 </pre></td></tr></table>
1945 <p><var>address</var> is the multicast address to listen for announcements on,
1946 if omitted, the default 224.2.127.254 (sap.mcast.net) is used. <var>port</var>
1947 is the port that is listened on, 9875 if omitted.
1949 <p>The demuxers listens for announcements on the given address and port.
1950 Once an announcement is received, it tries to receive that particular stream.
1952 <p>Example command lines follow.
1954 <p>To play back the first stream announced on the normal SAP multicast address:
1956 <table><tr><td> </td><td><pre class="example">ffplay sap://
1957 </pre></td></tr></table>
1959 <p>To play back the first stream announced on one the default IPv6 SAP multicast address:
1961 <table><tr><td> </td><td><pre class="example">ffplay sap://[ff0e::2:7ffe]
1962 </pre></td></tr></table>
1965 <h2 class="section"><a href="ffplay.html#toc-tcp">11.15 tcp</a></h2>
1967 <p>Trasmission Control Protocol.
1969 <p>The required syntax for a TCP url is:
1970 </p><table><tr><td> </td><td><pre class="example">tcp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
1971 </pre></td></tr></table>
1973 <dl compact="compact">
1974 <dt> ‘<samp>listen</samp>’</dt>
1975 <dd><p>Listen for an incoming connection
1977 <table><tr><td> </td><td><pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> tcp://<var>hostname</var>:<var>port</var>?listen
1978 ffplay tcp://<var>hostname</var>:<var>port</var>
1979 </pre></td></tr></table>
1985 <h2 class="section"><a href="ffplay.html#toc-udp">11.16 udp</a></h2>
1987 <p>User Datagram Protocol.
1989 <p>The required syntax for a UDP url is:
1990 </p><table><tr><td> </td><td><pre class="example">udp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
1991 </pre></td></tr></table>
1993 <p><var>options</var> contains a list of &-seperated options of the form <var>key</var>=<var>val</var>.
1994 Follow the list of supported options.
1996 <dl compact="compact">
1997 <dt> ‘<samp>buffer_size=<var>size</var></samp>’</dt>
1998 <dd><p>set the UDP buffer size in bytes
2001 <dt> ‘<samp>localport=<var>port</var></samp>’</dt>
2002 <dd><p>override the local UDP port to bind with
2005 <dt> ‘<samp>pkt_size=<var>size</var></samp>’</dt>
2006 <dd><p>set the size in bytes of UDP packets
2009 <dt> ‘<samp>reuse=<var>1|0</var></samp>’</dt>
2010 <dd><p>explicitly allow or disallow reusing UDP sockets
2013 <dt> ‘<samp>ttl=<var>ttl</var></samp>’</dt>
2014 <dd><p>set the time to live value (for multicast only)
2017 <dt> ‘<samp>connect=<var>1|0</var></samp>’</dt>
2018 <dd><p>Initialize the UDP socket with <code>connect()</code>. In this case, the
2019 destination address can’t be changed with ff_udp_set_remote_url later.
2020 If the destination address isn’t known at the start, this option can
2021 be specified in ff_udp_set_remote_url, too.
2022 This allows finding out the source address for the packets with getsockname,
2023 and makes writes return with AVERROR(ECONNREFUSED) if "destination
2024 unreachable" is received.
2025 For receiving, this gives the benefit of only receiving packets from
2026 the specified peer address/port.
2030 <p>Some usage examples of the udp protocol with ‘<tt>ffmpeg</tt>’ follow.
2032 <p>To stream over UDP to a remote endpoint:
2033 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> udp://<var>hostname</var>:<var>port</var>
2034 </pre></td></tr></table>
2036 <p>To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer:
2037 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i <var>input</var> -f mpegts udp://<var>hostname</var>:<var>port</var>?pkt_size=188&buffer_size=65535
2038 </pre></td></tr></table>
2040 <p>To receive over UDP from a remote endpoint:
2041 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i udp://[<var>multicast-address</var>]:<var>port</var>
2042 </pre></td></tr></table>
2044 <a name="Filtergraph-description"></a>
2045 <h1 class="chapter"><a href="ffplay.html#toc-Filtergraph-description">12. Filtergraph description</a></h1>
2047 <p>A filtergraph is a directed graph of connected filters. It can contain
2048 cycles, and there can be multiple links between a pair of
2049 filters. Each link has one input pad on one side connecting it to one
2050 filter from which it takes its input, and one output pad on the other
2051 side connecting it to the one filter accepting its output.
2053 <p>Each filter in a filtergraph is an instance of a filter class
2054 registered in the application, which defines the features and the
2055 number of input and output pads of the filter.
2057 <p>A filter with no input pads is called a "source", a filter with no
2058 output pads is called a "sink".
2060 <a name="Filtergraph-syntax"></a>
2061 <h2 class="section"><a href="ffplay.html#toc-Filtergraph-syntax">12.1 Filtergraph syntax</a></h2>
2063 <p>A filtergraph can be represented using a textual representation, which
2064 is recognized by the <code>-vf</code> and <code>-af</code> options of the ff*
2065 tools, and by the <code>av_parse_graph()</code> function defined in
2066 ‘<tt>libavfilter/avfiltergraph</tt>’.
2068 <p>A filterchain consists of a sequence of connected filters, each one
2069 connected to the previous one in the sequence. A filterchain is
2070 represented by a list of ","-separated filter descriptions.
2072 <p>A filtergraph consists of a sequence of filterchains. A sequence of
2073 filterchains is represented by a list of ";"-separated filterchain
2076 <p>A filter is represented by a string of the form:
2077 [<var>in_link_1</var>]...[<var>in_link_N</var>]<var>filter_name</var>=<var>arguments</var>[<var>out_link_1</var>]...[<var>out_link_M</var>]
2079 <p><var>filter_name</var> is the name of the filter class of which the
2080 described filter is an instance of, and has to be the name of one of
2081 the filter classes registered in the program.
2082 The name of the filter class is optionally followed by a string
2083 "=<var>arguments</var>".
2085 <p><var>arguments</var> is a string which contains the parameters used to
2086 initialize the filter instance, and are described in the filter
2089 <p>The list of arguments can be quoted using the character "’" as initial
2090 and ending mark, and the character ’\’ for escaping the characters
2091 within the quoted text; otherwise the argument string is considered
2092 terminated when the next special character (belonging to the set
2093 "[]=;,") is encountered.
2095 <p>The name and arguments of the filter are optionally preceded and
2096 followed by a list of link labels.
2097 A link label allows to name a link and associate it to a filter output
2098 or input pad. The preceding labels <var>in_link_1</var>
2099 ... <var>in_link_N</var>, are associated to the filter input pads,
2100 the following labels <var>out_link_1</var> ... <var>out_link_M</var>, are
2101 associated to the output pads.
2103 <p>When two link labels with the same name are found in the
2104 filtergraph, a link between the corresponding input and output pad is
2107 <p>If an output pad is not labelled, it is linked by default to the first
2108 unlabelled input pad of the next filter in the filterchain.
2109 For example in the filterchain:
2110 </p><table><tr><td> </td><td><pre class="example">nullsrc, split[L1], [L2]overlay, nullsink
2111 </pre></td></tr></table>
2112 <p>the split filter instance has two output pads, and the overlay filter
2113 instance two input pads. The first output pad of split is labelled
2114 "L1", the first input pad of overlay is labelled "L2", and the second
2115 output pad of split is linked to the second input pad of overlay,
2116 which are both unlabelled.
2118 <p>In a complete filterchain all the unlabelled filter input and output
2119 pads must be connected. A filtergraph is considered valid if all the
2120 filter input and output pads of all the filterchains are connected.
2122 <p>Follows a BNF description for the filtergraph syntax:
2123 </p><table><tr><td> </td><td><pre class="example"><var>NAME</var> ::= sequence of alphanumeric characters and '_'
2124 <var>LINKLABEL</var> ::= "[" <var>NAME</var> "]"
2125 <var>LINKLABELS</var> ::= <var>LINKLABEL</var> [<var>LINKLABELS</var>]
2126 <var>FILTER_ARGUMENTS</var> ::= sequence of chars (eventually quoted)
2127 <var>FILTER</var> ::= [<var>LINKNAMES</var>] <var>NAME</var> ["=" <var>ARGUMENTS</var>] [<var>LINKNAMES</var>]
2128 <var>FILTERCHAIN</var> ::= <var>FILTER</var> [,<var>FILTERCHAIN</var>]
2129 <var>FILTERGRAPH</var> ::= <var>FILTERCHAIN</var> [;<var>FILTERGRAPH</var>]
2130 </pre></td></tr></table>
2133 <a name="Audio-Filters"></a>
2134 <h1 class="chapter"><a href="ffplay.html#toc-Audio-Filters">13. Audio Filters</a></h1>
2136 <p>When you configure your FFmpeg build, you can disable any of the
2137 existing filters using –disable-filters.
2138 The configure output will show the audio filters included in your
2141 <p>Below is a description of the currently available audio filters.
2143 <a name="anull"></a>
2144 <h2 class="section"><a href="ffplay.html#toc-anull">13.1 anull</a></h2>
2146 <p>Pass the audio source unchanged to the output.
2149 <a name="Audio-Sources"></a>
2150 <h1 class="chapter"><a href="ffplay.html#toc-Audio-Sources">14. Audio Sources</a></h1>
2152 <p>Below is a description of the currently available audio sources.
2154 <a name="anullsrc"></a>
2155 <h2 class="section"><a href="ffplay.html#toc-anullsrc">14.1 anullsrc</a></h2>
2157 <p>Null audio source, never return audio frames. It is mainly useful as a
2158 template and to be employed in analysis / debugging tools.
2160 <p>It accepts as optional parameter a string of the form
2161 <var>sample_rate</var>:<var>channel_layout</var>.
2163 <p><var>sample_rate</var> specify the sample rate, and defaults to 44100.
2165 <p><var>channel_layout</var> specify the channel layout, and can be either an
2166 integer or a string representing a channel layout. The default value
2167 of <var>channel_layout</var> is 3, which corresponds to CH_LAYOUT_STEREO.
2169 <p>Check the channel_layout_map definition in
2170 ‘<tt>libavcodec/audioconvert.c</tt>’ for the mapping between strings and
2171 channel layout values.
2173 <p>Follow some examples:
2174 </p><table><tr><td> </td><td><pre class="example"># set the sample rate to 48000 Hz and the channel layout to CH_LAYOUT_MONO.
2179 </pre></td></tr></table>
2182 <a name="Audio-Sinks"></a>
2183 <h1 class="chapter"><a href="ffplay.html#toc-Audio-Sinks">15. Audio Sinks</a></h1>
2185 <p>Below is a description of the currently available audio sinks.
2187 <a name="anullsink"></a>
2188 <h2 class="section"><a href="ffplay.html#toc-anullsink">15.1 anullsink</a></h2>
2190 <p>Null audio sink, do absolutely nothing with the input audio. It is
2191 mainly useful as a template and to be employed in analysis / debugging
2195 <a name="Video-Filters"></a>
2196 <h1 class="chapter"><a href="ffplay.html#toc-Video-Filters">16. Video Filters</a></h1>
2198 <p>When you configure your FFmpeg build, you can disable any of the
2199 existing filters using –disable-filters.
2200 The configure output will show the video filters included in your
2203 <p>Below is a description of the currently available video filters.
2205 <a name="blackframe"></a>
2206 <h2 class="section"><a href="ffplay.html#toc-blackframe">16.1 blackframe</a></h2>
2208 <p>Detect frames that are (almost) completely black. Can be useful to
2209 detect chapter transitions or commercials. Output lines consist of
2210 the frame number of the detected frame, the percentage of blackness,
2211 the position in the file if known or -1 and the timestamp in seconds.
2213 <p>In order to display the output lines, you need to set the loglevel at
2214 least to the AV_LOG_INFO value.
2216 <p>The filter accepts the syntax:
2217 </p><table><tr><td> </td><td><pre class="example">blackframe[=<var>amount</var>:[<var>threshold</var>]]
2218 </pre></td></tr></table>
2220 <p><var>amount</var> is the percentage of the pixels that have to be below the
2221 threshold, and defaults to 98.
2223 <p><var>threshold</var> is the threshold below which a pixel value is
2224 considered black, and defaults to 32.
2226 <a name="boxblur"></a>
2227 <h2 class="section"><a href="ffplay.html#toc-boxblur">16.2 boxblur</a></h2>
2229 <p>Apply boxblur algorithm to the input video.
2231 <p>This filter accepts the parameters:
2232 <var>luma_power</var>:<var>luma_radius</var>:<var>chroma_radius</var>:<var>chroma_power</var>:<var>alpha_radius</var>:<var>alpha_power</var>
2234 <p>Chroma and alpha parameters are optional, if not specified they default
2235 to the corresponding values set for <var>luma_radius</var> and
2236 <var>luma_power</var>.
2238 <p><var>luma_radius</var>, <var>chroma_radius</var>, and <var>alpha_radius</var> represent
2239 the radius in pixels of the box used for blurring the corresponding
2240 input plane. They are expressions, and can contain the following
2242 </p><dl compact="compact">
2243 <dt> ‘<samp>w, h</samp>’</dt>
2244 <dd><p>the input width and heigth in pixels
2247 <dt> ‘<samp>cw, ch</samp>’</dt>
2248 <dd><p>the input chroma image width and height in pixels
2251 <dt> ‘<samp>hsub, vsub</samp>’</dt>
2252 <dd><p>horizontal and vertical chroma subsample values. For example for the
2253 pixel format "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
2257 <p>The radius must be a non-negative number, and must be not greater than
2258 the value of the expression <code>min(w,h)/2</code> for the luma and alpha planes,
2259 and of <code>min(cw,ch)/2</code> for the chroma planes.
2261 <p><var>luma_power</var>, <var>chroma_power</var>, and <var>alpha_power</var> represent
2262 how many times the boxblur filter is applied to the corresponding
2265 <p>Some examples follow:
2269 Apply a boxblur filter with luma, chroma, and alpha radius
2271 <table><tr><td> </td><td><pre class="example">boxblur=2:1
2272 </pre></td></tr></table>
2275 Set luma radius to 2, alpha and chroma radius to 0
2276 <table><tr><td> </td><td><pre class="example">boxblur=2:1:0:0:0:0
2277 </pre></td></tr></table>
2280 Set luma and chroma radius to a fraction of the video dimension
2281 <table><tr><td> </td><td><pre class="example">boxblur=min(h\,w)/10:1:min(cw\,ch)/10:1
2282 </pre></td></tr></table>
2287 <h2 class="section"><a href="ffplay.html#toc-copy">16.3 copy</a></h2>
2289 <p>Copy the input source unchanged to the output. Mainly useful for
2293 <h2 class="section"><a href="ffplay.html#toc-crop">16.4 crop</a></h2>
2295 <p>Crop the input video to <var>out_w</var>:<var>out_h</var>:<var>x</var>:<var>y</var>.
2297 <p>The parameters are expressions containing the following constants:
2299 <dl compact="compact">
2300 <dt> ‘<samp>E, PI, PHI</samp>’</dt>
2301 <dd><p>the corresponding mathematical approximated values for e
2302 (euler number), pi (greek PI), PHI (golden ratio)
2305 <dt> ‘<samp>x, y</samp>’</dt>
2306 <dd><p>the computed values for <var>x</var> and <var>y</var>. They are evaluated for
2310 <dt> ‘<samp>in_w, in_h</samp>’</dt>
2311 <dd><p>the input width and heigth
2314 <dt> ‘<samp>iw, ih</samp>’</dt>
2315 <dd><p>same as <var>in_w</var> and <var>in_h</var>
2318 <dt> ‘<samp>out_w, out_h</samp>’</dt>
2319 <dd><p>the output (cropped) width and heigth
2322 <dt> ‘<samp>ow, oh</samp>’</dt>
2323 <dd><p>same as <var>out_w</var> and <var>out_h</var>
2326 <dt> ‘<samp>n</samp>’</dt>
2327 <dd><p>the number of input frame, starting from 0
2330 <dt> ‘<samp>pos</samp>’</dt>
2331 <dd><p>the position in the file of the input frame, NAN if unknown
2334 <dt> ‘<samp>t</samp>’</dt>
2335 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
2340 <p>The <var>out_w</var> and <var>out_h</var> parameters specify the expressions for
2341 the width and height of the output (cropped) video. They are
2342 evaluated just at the configuration of the filter.
2344 <p>The default value of <var>out_w</var> is "in_w", and the default value of
2345 <var>out_h</var> is "in_h".
2347 <p>The expression for <var>out_w</var> may depend on the value of <var>out_h</var>,
2348 and the expression for <var>out_h</var> may depend on <var>out_w</var>, but they
2349 cannot depend on <var>x</var> and <var>y</var>, as <var>x</var> and <var>y</var> are
2350 evaluated after <var>out_w</var> and <var>out_h</var>.
2352 <p>The <var>x</var> and <var>y</var> parameters specify the expressions for the
2353 position of the top-left corner of the output (non-cropped) area. They
2354 are evaluated for each frame. If the evaluated value is not valid, it
2355 is approximated to the nearest valid value.
2357 <p>The default value of <var>x</var> is "(in_w-out_w)/2", and the default
2358 value for <var>y</var> is "(in_h-out_h)/2", which set the cropped area at
2359 the center of the input image.
2361 <p>The expression for <var>x</var> may depend on <var>y</var>, and the expression
2362 for <var>y</var> may depend on <var>x</var>.
2364 <p>Follow some examples:
2365 </p><table><tr><td> </td><td><pre class="example"># crop the central input area with size 100x100
2368 # crop the central input area with size 2/3 of the input video
2369 "crop=2/3*in_w:2/3*in_h"
2371 # crop the input video central square
2374 # delimit the rectangle with the top-left corner placed at position
2375 # 100:100 and the right-bottom corner corresponding to the right-bottom
2376 # corner of the input image.
2377 crop=in_w-100:in_h-100:100:100
2379 # crop 10 pixels from the left and right borders, and 20 pixels from
2380 # the top and bottom borders
2381 "crop=in_w-2*10:in_h-2*20"
2383 # keep only the bottom right quarter of the input image
2384 "crop=in_w/2:in_h/2:in_w/2:in_h/2"
2386 # crop height for getting Greek harmony
2387 "crop=in_w:1/PHI*in_w"
2390 "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)"
2392 # erratic camera effect depending on timestamp
2393 "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)"
2395 # set x depending on the value of y
2396 "crop=in_w/2:in_h/2:y:10+10*sin(n/10)"
2397 </pre></td></tr></table>
2399 <a name="cropdetect"></a>
2400 <h2 class="section"><a href="ffplay.html#toc-cropdetect">16.5 cropdetect</a></h2>
2402 <p>Auto-detect crop size.
2404 <p>Calculate necessary cropping parameters and prints the recommended
2405 parameters through the logging system. The detected dimensions
2406 correspond to the non-black area of the input video.
2408 <p>It accepts the syntax:
2409 </p><table><tr><td> </td><td><pre class="example">cropdetect[=<var>limit</var>[:<var>round</var>[:<var>reset</var>]]]
2410 </pre></td></tr></table>
2412 <dl compact="compact">
2413 <dt> ‘<samp>limit</samp>’</dt>
2414 <dd><p>Threshold, which can be optionally specified from nothing (0) to
2415 everything (255), defaults to 24.
2418 <dt> ‘<samp>round</samp>’</dt>
2419 <dd><p>Value which the width/height should be divisible by, defaults to
2420 16. The offset is automatically adjusted to center the video. Use 2 to
2421 get only even dimensions (needed for 4:2:2 video). 16 is best when
2422 encoding to most video codecs.
2425 <dt> ‘<samp>reset</samp>’</dt>
2426 <dd><p>Counter that determines after how many frames cropdetect will reset
2427 the previously detected largest video area and start over to detect
2428 the current optimal crop area. Defaults to 0.
2430 <p>This can be useful when channel logos distort the video area. 0
2431 indicates never reset and return the largest area encountered during
2436 <a name="drawbox"></a>
2437 <h2 class="section"><a href="ffplay.html#toc-drawbox">16.6 drawbox</a></h2>
2439 <p>Draw a colored box on the input image.
2441 <p>It accepts the syntax:
2442 </p><table><tr><td> </td><td><pre class="example">drawbox=<var>x</var>:<var>y</var>:<var>width</var>:<var>height</var>:<var>color</var>
2443 </pre></td></tr></table>
2445 <dl compact="compact">
2446 <dt> ‘<samp>x, y</samp>’</dt>
2447 <dd><p>Specify the top left corner coordinates of the box. Default to 0.
2450 <dt> ‘<samp>width, height</samp>’</dt>
2451 <dd><p>Specify the width and height of the box, if 0 they are interpreted as
2452 the input width and height. Default to 0.
2455 <dt> ‘<samp>color</samp>’</dt>
2456 <dd><p>Specify the color of the box to write, it can be the name of a color
2457 (case insensitive match) or a 0xRRGGBB[AA] sequence.
2461 <p>Follow some examples:
2462 </p><table><tr><td> </td><td><pre class="example"># draw a black box around the edge of the input image
2465 # draw a box with color red and an opacity of 50%
2466 drawbox=10:20:200:60:red@0.5"
2467 </pre></td></tr></table>
2469 <a name="drawtext"></a>
2470 <h2 class="section"><a href="ffplay.html#toc-drawtext">16.7 drawtext</a></h2>
2472 <p>Draw text string or text from specified file on top of video using the
2473 libfreetype library.
2475 <p>To enable compilation of this filter you need to configure FFmpeg with
2476 <code>--enable-libfreetype</code>.
2478 <p>The filter also recognizes strftime() sequences in the provided text
2479 and expands them accordingly. Check the documentation of strftime().
2481 <p>The filter accepts parameters as a list of <var>key</var>=<var>value</var> pairs,
2482 separated by ":".
2484 <p>The description of the accepted parameters follows.
2486 <dl compact="compact">
2487 <dt> ‘<samp>fontfile</samp>’</dt>
2488 <dd><p>The font file to be used for drawing text. Path must be included.
2489 This parameter is mandatory.
2492 <dt> ‘<samp>text</samp>’</dt>
2493 <dd><p>The text string to be drawn. The text must be a sequence of UTF-8
2495 This parameter is mandatory if no file is specified with the parameter
2496 <var>textfile</var>.
2499 <dt> ‘<samp>textfile</samp>’</dt>
2500 <dd><p>A text file containing text to be drawn. The text must be a sequence
2501 of UTF-8 encoded characters.
2503 <p>This parameter is mandatory if no text string is specified with the
2504 parameter <var>text</var>.
2506 <p>If both text and textfile are specified, an error is thrown.
2509 <dt> ‘<samp>x, y</samp>’</dt>
2510 <dd><p>The offsets where text will be drawn within the video frame.
2511 Relative to the top/left border of the output image.
2513 <p>The default value of <var>x</var> and <var>y</var> is 0.
2516 <dt> ‘<samp>fontsize</samp>’</dt>
2517 <dd><p>The font size to be used for drawing text.
2518 The default value of <var>fontsize</var> is 16.
2521 <dt> ‘<samp>fontcolor</samp>’</dt>
2522 <dd><p>The color to be used for drawing fonts.
2523 Either a string (e.g. "red") or in 0xRRGGBB[AA] format
2524 (e.g. "0xff000033"), possibly followed by an alpha specifier.
2525 The default value of <var>fontcolor</var> is "black".
2528 <dt> ‘<samp>boxcolor</samp>’</dt>
2529 <dd><p>The color to be used for drawing box around text.
2530 Either a string (e.g. "yellow") or in 0xRRGGBB[AA] format
2531 (e.g. "0xff00ff"), possibly followed by an alpha specifier.
2532 The default value of <var>boxcolor</var> is "white".
2535 <dt> ‘<samp>box</samp>’</dt>
2536 <dd><p>Used to draw a box around text using background color.
2537 Value should be either 1 (enable) or 0 (disable).
2538 The default value of <var>box</var> is 0.
2541 <dt> ‘<samp>shadowx, shadowy</samp>’</dt>
2542 <dd><p>The x and y offsets for the text shadow position with respect to the
2543 position of the text. They can be either positive or negative
2544 values. Default value for both is "0".
2547 <dt> ‘<samp>shadowcolor</samp>’</dt>
2548 <dd><p>The color to be used for drawing a shadow behind the drawn text. It
2549 can be a color name (e.g. "yellow") or a string in the 0xRRGGBB[AA]
2550 form (e.g. "0xff00ff"), possibly followed by an alpha specifier.
2551 The default value of <var>shadowcolor</var> is "black".
2554 <dt> ‘<samp>ft_load_flags</samp>’</dt>
2555 <dd><p>Flags to be used for loading the fonts.
2557 <p>The flags map the corresponding flags supported by libfreetype, and are
2558 a combination of the following values:
2559 </p><dl compact="compact">
2560 <dt> <var>default</var></dt>
2561 <dt> <var>no_scale</var></dt>
2562 <dt> <var>no_hinting</var></dt>
2563 <dt> <var>render</var></dt>
2564 <dt> <var>no_bitmap</var></dt>
2565 <dt> <var>vertical_layout</var></dt>
2566 <dt> <var>force_autohint</var></dt>
2567 <dt> <var>crop_bitmap</var></dt>
2568 <dt> <var>pedantic</var></dt>
2569 <dt> <var>ignore_global_advance_width</var></dt>
2570 <dt> <var>no_recurse</var></dt>
2571 <dt> <var>ignore_transform</var></dt>
2572 <dt> <var>monochrome</var></dt>
2573 <dt> <var>linear_design</var></dt>
2574 <dt> <var>no_autohint</var></dt>
2575 <dt> <var>end table</var></dt>
2578 <p>Default value is "render".
2580 <p>For more information consult the documentation for the FT_LOAD_*
2584 <dt> ‘<samp>tabsize</samp>’</dt>
2585 <dd><p>The size in number of spaces to use for rendering the tab.
2590 <p>For example the command:
2591 </p><table><tr><td> </td><td><pre class="example">drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'"
2592 </pre></td></tr></table>
2594 <p>will draw "Test Text" with font FreeSerif, using the default values
2595 for the optional parameters.
2598 </p><table><tr><td> </td><td><pre class="example">drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
2599 x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2"
2600 </pre></td></tr></table>
2602 <p>will draw ’Test Text’ with font FreeSerif of size 24 at position x=100
2603 and y=50 (counting from the top-left corner of the screen), text is
2604 yellow with a red box around it. Both the text and the box have an
2607 <p>Note that the double quotes are not necessary if spaces are not used
2608 within the parameter list.
2610 <p>For more information about libfreetype, check:
2611 <a href="http://www.freetype.org/">http://www.freetype.org/</a>.
2614 <h2 class="section"><a href="ffplay.html#toc-fade">16.8 fade</a></h2>
2616 <p>Apply fade-in/out effect to input video.
2618 <p>It accepts the parameters:
2619 <var>type</var>:<var>start_frame</var>:<var>nb_frames</var>
2621 <p><var>type</var> specifies if the effect type, can be either "in" for
2622 fade-in, or "out" for a fade-out effect.
2624 <p><var>start_frame</var> specifies the number of the start frame for starting
2625 to apply the fade effect.
2627 <p><var>nb_frames</var> specifies the number of frames for which the fade
2628 effect has to last. At the end of the fade-in effect the output video
2629 will have the same intensity as the input video, at the end of the
2630 fade-out transition the output video will be completely black.
2632 <p>A few usage examples follow, usable too as test scenarios.
2633 </p><table><tr><td> </td><td><pre class="example"># fade in first 30 frames of video
2636 # fade out last 45 frames of a 200-frame video
2639 # fade in first 25 frames and fade out last 25 frames of a 1000-frame video
2640 fade=in:0:25, fade=out:975:25
2642 # make first 5 frames black, then fade in from frame 5-24
2644 </pre></td></tr></table>
2646 <a name="fieldorder"></a>
2647 <h2 class="section"><a href="ffplay.html#toc-fieldorder">16.9 fieldorder</a></h2>
2649 <p>Transform the field order of the input video.
2651 <p>It accepts one parameter which specifies the required field order that
2652 the input interlaced video will be transformed to. The parameter can
2653 assume one of the following values:
2655 <dl compact="compact">
2656 <dt> ‘<samp>0 or bff</samp>’</dt>
2657 <dd><p>output bottom field first
2659 <dt> ‘<samp>1 or tff</samp>’</dt>
2660 <dd><p>output top field first
2664 <p>Default value is "tff".
2666 <p>Transformation is achieved by shifting the picture content up or down
2667 by one line, and filling the remaining line with appropriate picture content.
2668 This method is consistent with most broadcast field order converters.
2670 <p>If the input video is not flagged as being interlaced, or it is already
2671 flagged as being of the required output field order then this filter does
2672 not alter the incoming video.
2674 <p>This filter is very useful when converting to or from PAL DV material,
2675 which is bottom field first.
2678 </p><table><tr><td> </td><td><pre class="example">./ffmpeg -i in.vob -vf "fieldorder=bff" out.dv
2679 </pre></td></tr></table>
2682 <h2 class="section"><a href="ffplay.html#toc-fifo">16.10 fifo</a></h2>
2684 <p>Buffer input images and send them when they are requested.
2686 <p>This filter is mainly useful when auto-inserted by the libavfilter
2689 <p>The filter does not take parameters.
2691 <a name="format"></a>
2692 <h2 class="section"><a href="ffplay.html#toc-format">16.11 format</a></h2>
2694 <p>Convert the input video to one of the specified pixel formats.
2695 Libavfilter will try to pick one that is supported for the input to
2698 <p>The filter accepts a list of pixel format names, separated by ":",
2699 for example "yuv420p:monow:rgb24".
2701 <p>Some examples follow:
2702 </p><table><tr><td> </td><td><pre class="example"># convert the input video to the format "yuv420p"
2705 # convert the input video to any of the formats in the list
2706 format=yuv420p:yuv444p:yuv410p
2707 </pre></td></tr></table>
2709 <p><a name="frei0r"></a>
2710 </p><a name="frei0r-1"></a>
2711 <h2 class="section"><a href="ffplay.html#toc-frei0r-1">16.12 frei0r</a></h2>
2713 <p>Apply a frei0r effect to the input video.
2715 <p>To enable compilation of this filter you need to install the frei0r
2716 header and configure FFmpeg with –enable-frei0r.
2718 <p>The filter supports the syntax:
2719 </p><table><tr><td> </td><td><pre class="example"><var>filter_name</var>[{:|=}<var>param1</var>:<var>param2</var>:...:<var>paramN</var>]
2720 </pre></td></tr></table>
2722 <p><var>filter_name</var> is the name to the frei0r effect to load. If the
2723 environment variable <code>FREI0R_PATH</code> is defined, the frei0r effect
2724 is searched in each one of the directories specified by the colon
2725 separated list in <code>FREIOR_PATH</code>, otherwise in the standard frei0r
2726 paths, which are in this order: ‘<tt>HOME/.frei0r-1/lib/</tt>’,
2727 ‘<tt>/usr/local/lib/frei0r-1/</tt>’, ‘<tt>/usr/lib/frei0r-1/</tt>’.
2729 <p><var>param1</var>, <var>param2</var>, ... , <var>paramN</var> specify the parameters
2730 for the frei0r effect.
2732 <p>A frei0r effect parameter can be a boolean (whose values are specified
2733 with "y" and "n"), a double, a color (specified by the syntax
2734 <var>R</var>/<var>G</var>/<var>B</var>, <var>R</var>, <var>G</var>, and <var>B</var> being float
2735 numbers from 0.0 to 1.0) or by an <code>av_parse_color()</code> color
2736 description), a position (specified by the syntax <var>X</var>/<var>Y</var>,
2737 <var>X</var> and <var>Y</var> being float numbers) and a string.
2739 <p>The number and kind of parameters depend on the loaded effect. If an
2740 effect parameter is not specified the default value is set.
2742 <p>Some examples follow:
2743 </p><table><tr><td> </td><td><pre class="example"># apply the distort0r effect, set the first two double parameters
2744 frei0r=distort0r:0.5:0.01
2746 # apply the colordistance effect, takes a color as first parameter
2747 frei0r=colordistance:0.2/0.3/0.4
2748 frei0r=colordistance:violet
2749 frei0r=colordistance:0x112233
2751 # apply the perspective effect, specify the top left and top right
2753 frei0r=perspective:0.2/0.2:0.8/0.2
2754 </pre></td></tr></table>
2756 <p>For more information see:
2757 <a href="http://piksel.org/frei0r">http://piksel.org/frei0r</a>
2759 <a name="gradfun"></a>
2760 <h2 class="section"><a href="ffplay.html#toc-gradfun">16.13 gradfun</a></h2>
2762 <p>Fix the banding artifacts that are sometimes introduced into nearly flat
2763 regions by truncation to 8bit colordepth.
2764 Interpolate the gradients that should go where the bands are, and
2767 <p>This filter is designed for playback only. Do not use it prior to
2768 lossy compression, because compression tends to lose the dither and
2769 bring back the bands.
2771 <p>The filter takes two optional parameters, separated by ’:’:
2772 <var>strength</var>:<var>radius</var>
2774 <p><var>strength</var> is the maximum amount by which the filter will change
2775 any one pixel. Also the threshold for detecting nearly flat
2776 regions. Acceptable values range from .51 to 255, default value is
2777 1.2, out-of-range values will be clipped to the valid range.
2779 <p><var>radius</var> is the neighborhood to fit the gradient to. A larger
2780 radius makes for smoother gradients, but also prevents the filter from
2781 modifying the pixels near detailed regions. Acceptable values are
2782 8-32, default value is 16, out-of-range values will be clipped to the
2785 <table><tr><td> </td><td><pre class="example"># default parameters
2790 </pre></td></tr></table>
2792 <a name="hflip"></a>
2793 <h2 class="section"><a href="ffplay.html#toc-hflip">16.14 hflip</a></h2>
2795 <p>Flip the input video horizontally.
2797 <p>For example to horizontally flip the video in input with
2798 ‘<tt>ffmpeg</tt>’:
2799 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i in.avi -vf "hflip" out.avi
2800 </pre></td></tr></table>
2802 <a name="hqdn3d"></a>
2803 <h2 class="section"><a href="ffplay.html#toc-hqdn3d">16.15 hqdn3d</a></h2>
2805 <p>High precision/quality 3d denoise filter. This filter aims to reduce
2806 image noise producing smooth images and making still images really
2807 still. It should enhance compressibility.
2809 <p>It accepts the following optional parameters:
2810 <var>luma_spatial</var>:<var>chroma_spatial</var>:<var>luma_tmp</var>:<var>chroma_tmp</var>
2812 <dl compact="compact">
2813 <dt> ‘<samp>luma_spatial</samp>’</dt>
2814 <dd><p>a non-negative float number which specifies spatial luma strength,
2818 <dt> ‘<samp>chroma_spatial</samp>’</dt>
2819 <dd><p>a non-negative float number which specifies spatial chroma strength,
2820 defaults to 3.0*<var>luma_spatial</var>/4.0
2823 <dt> ‘<samp>luma_tmp</samp>’</dt>
2824 <dd><p>a float number which specifies luma temporal strength, defaults to
2825 6.0*<var>luma_spatial</var>/4.0
2828 <dt> ‘<samp>chroma_tmp</samp>’</dt>
2829 <dd><p>a float number which specifies chroma temporal strength, defaults to
2830 <var>luma_tmp</var>*<var>chroma_spatial</var>/<var>luma_spatial</var>
2834 <a name="lut_002c-lutrgb_002c-lutyuv"></a>
2835 <h2 class="section"><a href="ffplay.html#toc-lut_002c-lutrgb_002c-lutyuv">16.16 lut, lutrgb, lutyuv</a></h2>
2837 <p>Compute a look-up table for binding each pixel component input value
2838 to an output value, and apply it to input video.
2840 <p><var>lutyuv</var> applies a lookup table to a YUV input video, <var>lutrgb</var>
2841 to an RGB input video.
2843 <p>These filters accept in input a ":"-separated list of options, which
2844 specify the expressions used for computing the lookup table for the
2845 corresponding pixel component values.
2847 <p>The <var>lut</var> filter requires either YUV or RGB pixel formats in
2848 input, and accepts the options:
2849 </p><dl compact="compact">
2850 <dd><p><var>c0</var> (first pixel component)
2851 <var>c1</var> (second pixel component)
2852 <var>c2</var> (third pixel component)
2853 <var>c3</var> (fourth pixel component, corresponds to the alpha component)
2857 <p>The exact component associated to each option depends on the format in
2860 <p>The <var>lutrgb</var> filter requires RGB pixel formats in input, and
2861 accepts the options:
2862 </p><dl compact="compact">
2863 <dd><p><var>r</var> (red component)
2864 <var>g</var> (green component)
2865 <var>b</var> (blue component)
2866 <var>a</var> (alpha component)
2870 <p>The <var>lutyuv</var> filter requires YUV pixel formats in input, and
2871 accepts the options:
2872 </p><dl compact="compact">
2873 <dd><p><var>y</var> (Y/luminance component)
2874 <var>u</var> (U/Cb component)
2875 <var>v</var> (V/Cr component)
2876 <var>a</var> (alpha component)
2880 <p>The expressions can contain the following constants and functions:
2882 <dl compact="compact">
2883 <dt> ‘<samp>E, PI, PHI</samp>’</dt>
2884 <dd><p>the corresponding mathematical approximated values for e
2885 (euler number), pi (greek PI), PHI (golden ratio)
2888 <dt> ‘<samp>w, h</samp>’</dt>
2889 <dd><p>the input width and heigth
2892 <dt> ‘<samp>val</samp>’</dt>
2893 <dd><p>input value for the pixel component
2896 <dt> ‘<samp>clipval</samp>’</dt>
2897 <dd><p>the input value clipped in the <var>minval</var>-<var>maxval</var> range
2900 <dt> ‘<samp>maxval</samp>’</dt>
2901 <dd><p>maximum value for the pixel component
2904 <dt> ‘<samp>minval</samp>’</dt>
2905 <dd><p>minimum value for the pixel component
2908 <dt> ‘<samp>negval</samp>’</dt>
2909 <dd><p>the negated value for the pixel component value clipped in the
2910 <var>minval</var>-<var>maxval</var> range , it corresponds to the expression
2911 "maxval-clipval+minval"
2914 <dt> ‘<samp>clip(val)</samp>’</dt>
2915 <dd><p>the computed value in <var>val</var> clipped in the
2916 <var>minval</var>-<var>maxval</var> range
2919 <dt> ‘<samp>gammaval(gamma)</samp>’</dt>
2920 <dd><p>the computed gamma correction value of the pixel component value
2921 clipped in the <var>minval</var>-<var>maxval</var> range, corresponds to the
2923 "pow((clipval-minval)/(maxval-minval)\,<var>gamma</var>)*(maxval-minval)+minval"
2928 <p>All expressions default to "val".
2930 <p>Some examples follow:
2931 </p><table><tr><td> </td><td><pre class="example"># negate input video
2932 lutrgb="r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val"
2933 lutyuv="y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val"
2935 # the above is the same as
2936 lutrgb="r=negval:g=negval:b=negval"
2937 lutyuv="y=negval:u=negval:v=negval"
2942 # remove chroma components, turns the video into a graytone image
2943 lutyuv="u=128:v=128"
2945 # apply a luma burning effect
2946 lutyuv="y=2*val"
2948 # remove green and blue components
2949 lutrgb="g=0:b=0"
2951 # set a constant alpha channel value on input
2952 format=rgba,lutrgb=a="maxval-minval/2"
2954 # correct luminance gamma by a 0.5 factor
2955 lutyuv=y=gammaval(0.5)
2956 </pre></td></tr></table>
2959 <h2 class="section"><a href="ffplay.html#toc-mp">16.17 mp</a></h2>
2961 <p>Apply an MPlayer filter to the input video.
2963 <p>This filter provides a wrapper around most of the filters of
2966 <p>This wrapper is considered experimental. Some of the wrapped filters
2967 may not work properly and we may drop support for them, as they will
2968 be implemented natively into FFmpeg. Thus you should avoid
2969 depending on them when writing portable scripts.
2971 <p>The filters accepts the parameters:
2972 <var>filter_name</var>[:=]<var>filter_params</var>
2974 <p><var>filter_name</var> is the name of a supported MPlayer filter,
2975 <var>filter_params</var> is a string containing the parameters accepted by
2978 <p>The list of the currently supported filters follows:
2979 </p><dl compact="compact">
2980 <dt> <var>2xsai</var></dt>
2981 <dt> <var>decimate</var></dt>
2982 <dt> <var>delogo</var></dt>
2983 <dt> <var>denoise3d</var></dt>
2984 <dt> <var>detc</var></dt>
2985 <dt> <var>dint</var></dt>
2986 <dt> <var>divtc</var></dt>
2987 <dt> <var>down3dright</var></dt>
2988 <dt> <var>dsize</var></dt>
2989 <dt> <var>eq2</var></dt>
2990 <dt> <var>eq</var></dt>
2991 <dt> <var>field</var></dt>
2992 <dt> <var>fil</var></dt>
2993 <dt> <var>fixpts</var></dt>
2994 <dt> <var>framestep</var></dt>
2995 <dt> <var>fspp</var></dt>
2996 <dt> <var>geq</var></dt>
2997 <dt> <var>gradfun</var></dt>
2998 <dt> <var>harddup</var></dt>
2999 <dt> <var>hqdn3d</var></dt>
3000 <dt> <var>hue</var></dt>
3001 <dt> <var>il</var></dt>
3002 <dt> <var>ilpack</var></dt>
3003 <dt> <var>ivtc</var></dt>
3004 <dt> <var>kerndeint</var></dt>
3005 <dt> <var>mcdeint</var></dt>
3006 <dt> <var>mirror</var></dt>
3007 <dt> <var>noise</var></dt>
3008 <dt> <var>ow</var></dt>
3009 <dt> <var>palette</var></dt>
3010 <dt> <var>perspective</var></dt>
3011 <dt> <var>phase</var></dt>
3012 <dt> <var>pp7</var></dt>
3013 <dt> <var>pullup</var></dt>
3014 <dt> <var>qp</var></dt>
3015 <dt> <var>rectangle</var></dt>
3016 <dt> <var>remove-logo</var></dt>
3017 <dt> <var>rotate</var></dt>
3018 <dt> <var>sab</var></dt>
3019 <dt> <var>screenshot</var></dt>
3020 <dt> <var>smartblur</var></dt>
3021 <dt> <var>softpulldown</var></dt>
3022 <dt> <var>softskip</var></dt>
3023 <dt> <var>spp</var></dt>
3024 <dt> <var>swapuv</var></dt>
3025 <dt> <var>telecine</var></dt>
3026 <dt> <var>test</var></dt>
3027 <dt> <var>tile</var></dt>
3028 <dt> <var>tinterlace</var></dt>
3029 <dt> <var>unsharp</var></dt>
3030 <dt> <var>uspp</var></dt>
3031 <dt> <var>yuvcsp</var></dt>
3032 <dt> <var>yvu9</var></dt>
3035 <p>The parameter syntax and behavior for the listed filters are the same
3036 of the corresponding MPlayer filters. For detailed instructions check
3037 the "VIDEO FILTERS" section in the MPlayer manual.
3039 <p>Some examples follow:
3040 </p><table><tr><td> </td><td><pre class="example"># remove a logo by interpolating the surrounding pixels
3041 mp=delogo=200:200:80:20:1
3043 # adjust gamma, brightness, contrast
3046 # tweak hue and saturation
3048 </pre></td></tr></table>
3050 <p>See also mplayer(1), <a href="http://www.mplayerhq.hu/">http://www.mplayerhq.hu/</a>.
3052 <a name="negate"></a>
3053 <h2 class="section"><a href="ffplay.html#toc-negate">16.18 negate</a></h2>
3055 <p>Negate input video.
3057 <p>This filter accepts an integer in input, if non-zero it negates the
3058 alpha component (if available). The default value in input is 0.
3060 <a name="noformat"></a>
3061 <h2 class="section"><a href="ffplay.html#toc-noformat">16.19 noformat</a></h2>
3063 <p>Force libavfilter not to use any of the specified pixel formats for the
3064 input to the next filter.
3066 <p>The filter accepts a list of pixel format names, separated by ":",
3067 for example "yuv420p:monow:rgb24".
3069 <p>Some examples follow:
3070 </p><table><tr><td> </td><td><pre class="example"># force libavfilter to use a format different from "yuv420p" for the
3071 # input to the vflip filter
3072 noformat=yuv420p,vflip
3074 # convert the input video to any of the formats not contained in the list
3075 noformat=yuv420p:yuv444p:yuv410p
3076 </pre></td></tr></table>
3078 <a name="null-1"></a>
3079 <h2 class="section"><a href="ffplay.html#toc-null-1">16.20 null</a></h2>
3081 <p>Pass the video source unchanged to the output.
3084 <h2 class="section"><a href="ffplay.html#toc-ocv">16.21 ocv</a></h2>
3086 <p>Apply video transform using libopencv.
3088 <p>To enable this filter install libopencv library and headers and
3089 configure FFmpeg with –enable-libopencv.
3091 <p>The filter takes the parameters: <var>filter_name</var>{:=}<var>filter_params</var>.
3093 <p><var>filter_name</var> is the name of the libopencv filter to apply.
3095 <p><var>filter_params</var> specifies the parameters to pass to the libopencv
3096 filter. If not specified the default values are assumed.
3098 <p>Refer to the official libopencv documentation for more precise
3100 <a href="http://opencv.willowgarage.com/documentation/c/image_filtering.html">http://opencv.willowgarage.com/documentation/c/image_filtering.html</a>
3102 <p>Follows the list of supported libopencv filters.
3104 <p><a name="dilate"></a>
3105 </p><a name="dilate-1"></a>
3106 <h3 class="subsection"><a href="ffplay.html#toc-dilate-1">16.21.1 dilate</a></h3>
3108 <p>Dilate an image by using a specific structuring element.
3109 This filter corresponds to the libopencv function <code>cvDilate</code>.
3111 <p>It accepts the parameters: <var>struct_el</var>:<var>nb_iterations</var>.
3113 <p><var>struct_el</var> represents a structuring element, and has the syntax:
3114 <var>cols</var>x<var>rows</var>+<var>anchor_x</var>x<var>anchor_y</var>/<var>shape</var>
3116 <p><var>cols</var> and <var>rows</var> represent the number of colums and rows of
3117 the structuring element, <var>anchor_x</var> and <var>anchor_y</var> the anchor
3118 point, and <var>shape</var> the shape for the structuring element, and
3119 can be one of the values "rect", "cross", "ellipse", "custom".
3121 <p>If the value for <var>shape</var> is "custom", it must be followed by a
3122 string of the form "=<var>filename</var>". The file with name
3123 <var>filename</var> is assumed to represent a binary image, with each
3124 printable character corresponding to a bright pixel. When a custom
3125 <var>shape</var> is used, <var>cols</var> and <var>rows</var> are ignored, the number
3126 or columns and rows of the read file are assumed instead.
3128 <p>The default value for <var>struct_el</var> is "3x3+0x0/rect".
3130 <p><var>nb_iterations</var> specifies the number of times the transform is
3131 applied to the image, and defaults to 1.
3133 <p>Follow some example:
3134 </p><table><tr><td> </td><td><pre class="example"># use the default values
3137 # dilate using a structuring element with a 5x5 cross, iterate two times
3138 ocv=dilate=5x5+2x2/cross:2
3140 # read the shape from the file diamond.shape, iterate two times
3141 # the file diamond.shape may contain a pattern of characters like this:
3147 # the specified cols and rows are ignored (but not the anchor point coordinates)
3148 ocv=0x0+2x2/custom=diamond.shape:2
3149 </pre></td></tr></table>
3151 <a name="erode"></a>
3152 <h3 class="subsection"><a href="ffplay.html#toc-erode">16.21.2 erode</a></h3>
3154 <p>Erode an image by using a specific structuring element.
3155 This filter corresponds to the libopencv function <code>cvErode</code>.
3157 <p>The filter accepts the parameters: <var>struct_el</var>:<var>nb_iterations</var>,
3158 with the same syntax and semantics as the <a href="#dilate">dilate</a> filter.
3160 <a name="smooth"></a>
3161 <h3 class="subsection"><a href="ffplay.html#toc-smooth">16.21.3 smooth</a></h3>
3163 <p>Smooth the input video.
3165 <p>The filter takes the following parameters:
3166 <var>type</var>:<var>param1</var>:<var>param2</var>:<var>param3</var>:<var>param4</var>.
3168 <p><var>type</var> is the type of smooth filter to apply, and can be one of
3169 the following values: "blur", "blur_no_scale", "median", "gaussian",
3170 "bilateral". The default value is "gaussian".
3172 <p><var>param1</var>, <var>param2</var>, <var>param3</var>, and <var>param4</var> are
3173 parameters whose meanings depend on smooth type. <var>param1</var> and
3174 <var>param2</var> accept integer positive values or 0, <var>param3</var> and
3175 <var>param4</var> accept float values.
3177 <p>The default value for <var>param1</var> is 3, the default value for the
3178 other parameters is 0.
3180 <p>These parameters correspond to the parameters assigned to the
3181 libopencv function <code>cvSmooth</code>.
3183 <a name="overlay"></a>
3184 <h2 class="section"><a href="ffplay.html#toc-overlay">16.22 overlay</a></h2>
3186 <p>Overlay one video on top of another.
3188 <p>It takes two inputs and one output, the first input is the "main"
3189 video on which the second input is overlayed.
3191 <p>It accepts the parameters: <var>x</var>:<var>y</var>.
3193 <p><var>x</var> is the x coordinate of the overlayed video on the main video,
3194 <var>y</var> is the y coordinate. The parameters are expressions containing
3195 the following parameters:
3197 <dl compact="compact">
3198 <dt> ‘<samp>main_w, main_h</samp>’</dt>
3199 <dd><p>main input width and height
3202 <dt> ‘<samp>W, H</samp>’</dt>
3203 <dd><p>same as <var>main_w</var> and <var>main_h</var>
3206 <dt> ‘<samp>overlay_w, overlay_h</samp>’</dt>
3207 <dd><p>overlay input width and height
3210 <dt> ‘<samp>w, h</samp>’</dt>
3211 <dd><p>same as <var>overlay_w</var> and <var>overlay_h</var>
3215 <p>Be aware that frames are taken from each input video in timestamp
3216 order, hence, if their initial timestamps differ, it is a a good idea
3217 to pass the two inputs through a <var>setpts=PTS-STARTPTS</var> filter to
3218 have them begin in the same zero timestamp, as it does the example for
3219 the <var>movie</var> filter.
3221 <p>Follow some examples:
3222 </p><table><tr><td> </td><td><pre class="example"># draw the overlay at 10 pixels from the bottom right
3223 # corner of the main video.
3224 overlay=main_w-overlay_w-10:main_h-overlay_h-10
3226 # insert a transparent PNG logo in the bottom left corner of the input
3227 movie=logo.png [logo];
3228 [in][logo] overlay=10:main_h-overlay_h-10 [out]
3230 # insert 2 different transparent PNG logos (second logo on bottom
3232 movie=logo1.png [logo1];
3233 movie=logo2.png [logo2];
3234 [in][logo1] overlay=10:H-h-10 [in+logo1];
3235 [in+logo1][logo2] overlay=W-w-10:H-h-10 [out]
3237 # add a transparent color layer on top of the main video,
3238 # WxH specifies the size of the main input to the overlay filter
3239 color=red.3:WxH [over]; [in][over] overlay [out]
3240 </pre></td></tr></table>
3242 <p>You can chain togheter more overlays but the efficiency of such
3243 approach is yet to be tested.
3246 <h2 class="section"><a href="ffplay.html#toc-pad">16.23 pad</a></h2>
3248 <p>Add paddings to the input image, and places the original input at the
3249 given coordinates <var>x</var>, <var>y</var>.
3251 <p>It accepts the following parameters:
3252 <var>width</var>:<var>height</var>:<var>x</var>:<var>y</var>:<var>color</var>.
3254 <p>The parameters <var>width</var>, <var>height</var>, <var>x</var>, and <var>y</var> are
3255 expressions containing the following constants:
3257 <dl compact="compact">
3258 <dt> ‘<samp>E, PI, PHI</samp>’</dt>
3259 <dd><p>the corresponding mathematical approximated values for e
3260 (euler number), pi (greek PI), phi (golden ratio)
3263 <dt> ‘<samp>in_w, in_h</samp>’</dt>
3264 <dd><p>the input video width and heigth
3267 <dt> ‘<samp>iw, ih</samp>’</dt>
3268 <dd><p>same as <var>in_w</var> and <var>in_h</var>
3271 <dt> ‘<samp>out_w, out_h</samp>’</dt>
3272 <dd><p>the output width and heigth, that is the size of the padded area as
3273 specified by the <var>width</var> and <var>height</var> expressions
3276 <dt> ‘<samp>ow, oh</samp>’</dt>
3277 <dd><p>same as <var>out_w</var> and <var>out_h</var>
3280 <dt> ‘<samp>x, y</samp>’</dt>
3281 <dd><p>x and y offsets as specified by the <var>x</var> and <var>y</var>
3282 expressions, or NAN if not yet specified
3285 <dt> ‘<samp>dar, a</samp>’</dt>
3286 <dd><p>input display aspect ratio, same as <var>iw</var> / <var>ih</var>
3289 <dt> ‘<samp>sar</samp>’</dt>
3290 <dd><p>input sample aspect ratio
3293 <dt> ‘<samp>hsub, vsub</samp>’</dt>
3294 <dd><p>horizontal and vertical chroma subsample values. For example for the
3295 pixel format "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
3299 <p>Follows the description of the accepted parameters.
3301 <dl compact="compact">
3302 <dt> ‘<samp>width, height</samp>’</dt>
3304 <p>Specify the size of the output image with the paddings added. If the
3305 value for <var>width</var> or <var>height</var> is 0, the corresponding input size
3306 is used for the output.
3308 <p>The <var>width</var> expression can reference the value set by the
3309 <var>height</var> expression, and viceversa.
3311 <p>The default value of <var>width</var> and <var>height</var> is 0.
3314 <dt> ‘<samp>x, y</samp>’</dt>
3316 <p>Specify the offsets where to place the input image in the padded area
3317 with respect to the top/left border of the output image.
3319 <p>The <var>x</var> expression can reference the value set by the <var>y</var>
3320 expression, and viceversa.
3322 <p>The default value of <var>x</var> and <var>y</var> is 0.
3325 <dt> ‘<samp>color</samp>’</dt>
3327 <p>Specify the color of the padded area, it can be the name of a color
3328 (case insensitive match) or a 0xRRGGBB[AA] sequence.
3330 <p>The default value of <var>color</var> is "black".
3335 <p>Some examples follow:
3337 <table><tr><td> </td><td><pre class="example"># Add paddings with color "violet" to the input video. Output video
3338 # size is 640x480, the top-left corner of the input video is placed at
3340 pad=640:480:0:40:violet
3342 # pad the input to get an output with dimensions increased bt 3/2,
3343 # and put the input video at the center of the padded area
3344 pad="3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2"
3346 # pad the input to get a squared output with size equal to the maximum
3347 # value between the input width and height, and put the input video at
3348 # the center of the padded area
3349 pad="max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2"
3351 # pad the input to get a final w/h ratio of 16:9
3352 pad="ih*16/9:ih:(ow-iw)/2:(oh-ih)/2"
3354 # double output size and put the input video in the bottom-right
3355 # corner of the output padded area
3356 pad="2*iw:2*ih:ow-iw:oh-ih"
3357 </pre></td></tr></table>
3359 <a name="pixdesctest"></a>
3360 <h2 class="section"><a href="ffplay.html#toc-pixdesctest">16.24 pixdesctest</a></h2>
3362 <p>Pixel format descriptor test filter, mainly useful for internal
3363 testing. The output video should be equal to the input video.
3366 </p><table><tr><td> </td><td><pre class="example">format=monow, pixdesctest
3367 </pre></td></tr></table>
3369 <p>can be used to test the monowhite pixel format descriptor definition.
3371 <a name="scale"></a>
3372 <h2 class="section"><a href="ffplay.html#toc-scale">16.25 scale</a></h2>
3374 <p>Scale the input video to <var>width</var>:<var>height</var> and/or convert the image format.
3376 <p>The parameters <var>width</var> and <var>height</var> are expressions containing
3377 the following constants:
3379 <dl compact="compact">
3380 <dt> ‘<samp>E, PI, PHI</samp>’</dt>
3381 <dd><p>the corresponding mathematical approximated values for e
3382 (euler number), pi (greek PI), phi (golden ratio)
3385 <dt> ‘<samp>in_w, in_h</samp>’</dt>
3386 <dd><p>the input width and heigth
3389 <dt> ‘<samp>iw, ih</samp>’</dt>
3390 <dd><p>same as <var>in_w</var> and <var>in_h</var>
3393 <dt> ‘<samp>out_w, out_h</samp>’</dt>
3394 <dd><p>the output (cropped) width and heigth
3397 <dt> ‘<samp>ow, oh</samp>’</dt>
3398 <dd><p>same as <var>out_w</var> and <var>out_h</var>
3401 <dt> ‘<samp>dar, a</samp>’</dt>
3402 <dd><p>input display aspect ratio, same as <var>iw</var> / <var>ih</var>
3405 <dt> ‘<samp>sar</samp>’</dt>
3406 <dd><p>input sample aspect ratio
3409 <dt> ‘<samp>hsub, vsub</samp>’</dt>
3410 <dd><p>horizontal and vertical chroma subsample values. For example for the
3411 pixel format "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
3415 <p>If the input image format is different from the format requested by
3416 the next filter, the scale filter will convert the input to the
3419 <p>If the value for <var>width</var> or <var>height</var> is 0, the respective input
3420 size is used for the output.
3422 <p>If the value for <var>width</var> or <var>height</var> is -1, the scale filter will
3423 use, for the respective output size, a value that maintains the aspect
3424 ratio of the input image.
3426 <p>The default value of <var>width</var> and <var>height</var> is 0.
3428 <p>Some examples follow:
3429 </p><table><tr><td> </td><td><pre class="example"># scale the input video to a size of 200x100.
3432 # scale the input to 2x
3434 # the above is the same as
3437 # scale the input to half size
3440 # increase the width, and set the height to the same size
3443 # seek for Greek harmony
3447 # increase the height, and set the width to 3/2 of the height
3450 # increase the size, but make the size a multiple of the chroma
3451 scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
3453 # increase the width to a maximum of 500 pixels, keep the same input aspect ratio
3454 scale='min(500\, iw*3/2):-1'
3455 </pre></td></tr></table>
3457 <a name="select"></a>
3458 <h2 class="section"><a href="ffplay.html#toc-select">16.26 select</a></h2>
3459 <p>Select frames to pass in output.
3461 <p>It accepts in input an expression, which is evaluated for each input
3462 frame. If the expression is evaluated to a non-zero value, the frame
3463 is selected and passed to the output, otherwise it is discarded.
3465 <p>The expression can contain the following constants:
3467 <dl compact="compact">
3468 <dt> ‘<samp>PI</samp>’</dt>
3472 <dt> ‘<samp>PHI</samp>’</dt>
3476 <dt> ‘<samp>E</samp>’</dt>
3480 <dt> ‘<samp>n</samp>’</dt>
3481 <dd><p>the sequential number of the filtered frame, starting from 0
3484 <dt> ‘<samp>selected_n</samp>’</dt>
3485 <dd><p>the sequential number of the selected frame, starting from 0
3488 <dt> ‘<samp>prev_selected_n</samp>’</dt>
3489 <dd><p>the sequential number of the last selected frame, NAN if undefined
3492 <dt> ‘<samp>TB</samp>’</dt>
3493 <dd><p>timebase of the input timestamps
3496 <dt> ‘<samp>pts</samp>’</dt>
3497 <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
3498 expressed in <var>TB</var> units, NAN if undefined
3501 <dt> ‘<samp>t</samp>’</dt>
3502 <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
3503 expressed in seconds, NAN if undefined
3506 <dt> ‘<samp>prev_pts</samp>’</dt>
3507 <dd><p>the PTS of the previously filtered video frame, NAN if undefined
3510 <dt> ‘<samp>prev_selected_pts</samp>’</dt>
3511 <dd><p>the PTS of the last previously filtered video frame, NAN if undefined
3514 <dt> ‘<samp>prev_selected_t</samp>’</dt>
3515 <dd><p>the PTS of the last previously selected video frame, NAN if undefined
3518 <dt> ‘<samp>start_pts</samp>’</dt>
3519 <dd><p>the PTS of the first video frame in the video, NAN if undefined
3522 <dt> ‘<samp>start_t</samp>’</dt>
3523 <dd><p>the time of the first video frame in the video, NAN if undefined
3526 <dt> ‘<samp>pict_type</samp>’</dt>
3527 <dd><p>the picture type of the filtered frame, can assume one of the following
3529 </p><dl compact="compact">
3530 <dt> ‘<samp>PICT_TYPE_I</samp>’</dt>
3531 <dt> ‘<samp>PICT_TYPE_P</samp>’</dt>
3532 <dt> ‘<samp>PICT_TYPE_B</samp>’</dt>
3533 <dt> ‘<samp>PICT_TYPE_S</samp>’</dt>
3534 <dt> ‘<samp>PICT_TYPE_SI</samp>’</dt>
3535 <dt> ‘<samp>PICT_TYPE_SP</samp>’</dt>
3536 <dt> ‘<samp>PICT_TYPE_BI</samp>’</dt>
3540 <dt> ‘<samp>interlace_type</samp>’</dt>
3541 <dd><p>the frame interlace type, can assume one of the following values:
3542 </p><dl compact="compact">
3543 <dt> ‘<samp>INTERLACE_TYPE_P</samp>’</dt>
3544 <dd><p>the frame is progressive (not interlaced)
3546 <dt> ‘<samp>INTERLACE_TYPE_T</samp>’</dt>
3547 <dd><p>the frame is top-field-first
3549 <dt> ‘<samp>INTERLACE_TYPE_B</samp>’</dt>
3550 <dd><p>the frame is bottom-field-first
3555 <dt> ‘<samp>key</samp>’</dt>
3556 <dd><p>1 if the filtered frame is a key-frame, 0 otherwise
3559 <dt> ‘<samp>pos</samp>’</dt>
3560 <dd><p>the position in the file of the filtered frame, -1 if the information
3561 is not available (e.g. for synthetic video)
3565 <p>The default value of the select expression is "1".
3567 <p>Some examples follow:
3569 <table><tr><td> </td><td><pre class="example"># select all frames in input
3572 # the above is the same as:
3578 # select only I-frames
3579 select='eq(pict_type\,PICT_TYPE_I)'
3581 # select one frame every 100
3582 select='not(mod(n\,100))'
3584 # select only frames contained in the 10-20 time interval
3585 select='gte(t\,10)*lte(t\,20)'
3587 # select only I frames contained in the 10-20 time interval
3588 select='gte(t\,10)*lte(t\,20)*eq(pict_type\,PICT_TYPE_I)'
3590 # select frames with a minimum distance of 10 seconds
3591 select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
3592 </pre></td></tr></table>
3594 <p><a name="setdar"></a>
3595 </p><a name="setdar-1"></a>
3596 <h2 class="section"><a href="ffplay.html#toc-setdar-1">16.27 setdar</a></h2>
3598 <p>Set the Display Aspect Ratio for the filter output video.
3600 <p>This is done by changing the specified Sample (aka Pixel) Aspect
3601 Ratio, according to the following equation:
3602 <em>DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR</em>
3604 <p>Keep in mind that this filter does not modify the pixel dimensions of
3605 the video frame. Also the display aspect ratio set by this filter may
3606 be changed by later filters in the filterchain, e.g. in case of
3607 scaling or if another "setdar" or a "setsar" filter is applied.
3609 <p>The filter accepts a parameter string which represents the wanted
3610 display aspect ratio.
3611 The parameter can be a floating point number string, or an expression
3612 of the form <var>num</var>:<var>den</var>, where <var>num</var> and <var>den</var> are the
3613 numerator and denominator of the aspect ratio.
3614 If the parameter is not specified, it is assumed the value "0:1".
3616 <p>For example to change the display aspect ratio to 16:9, specify:
3617 </p><table><tr><td> </td><td><pre class="example">setdar=16:9
3618 # the above is equivalent to
3620 </pre></td></tr></table>
3622 <p>See also the <a href="#setsar">setsar</a> filter documentation.
3624 <a name="setpts"></a>
3625 <h2 class="section"><a href="ffplay.html#toc-setpts">16.28 setpts</a></h2>
3627 <p>Change the PTS (presentation timestamp) of the input video frames.
3629 <p>Accept in input an expression evaluated through the eval API, which
3630 can contain the following constants:
3632 <dl compact="compact">
3633 <dt> ‘<samp>PTS</samp>’</dt>
3634 <dd><p>the presentation timestamp in input
3637 <dt> ‘<samp>PI</samp>’</dt>
3641 <dt> ‘<samp>PHI</samp>’</dt>
3645 <dt> ‘<samp>E</samp>’</dt>
3649 <dt> ‘<samp>N</samp>’</dt>
3650 <dd><p>the count of the input frame, starting from 0.
3653 <dt> ‘<samp>STARTPTS</samp>’</dt>
3654 <dd><p>the PTS of the first video frame
3657 <dt> ‘<samp>INTERLACED</samp>’</dt>
3658 <dd><p>tell if the current frame is interlaced
3661 <dt> ‘<samp>POS</samp>’</dt>
3662 <dd><p>original position in the file of the frame, or undefined if undefined
3663 for the current frame
3666 <dt> ‘<samp>PREV_INPTS</samp>’</dt>
3667 <dd><p>previous input PTS
3670 <dt> ‘<samp>PREV_OUTPTS</samp>’</dt>
3671 <dd><p>previous output PTS
3676 <p>Some examples follow:
3678 <table><tr><td> </td><td><pre class="example"># start counting PTS from zero
3690 # fixed rate 25 fps with some jitter
3691 setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
3692 </pre></td></tr></table>
3694 <p><a name="setsar"></a>
3695 </p><a name="setsar-1"></a>
3696 <h2 class="section"><a href="ffplay.html#toc-setsar-1">16.29 setsar</a></h2>
3698 <p>Set the Sample (aka Pixel) Aspect Ratio for the filter output video.
3700 <p>Note that as a consequence of the application of this filter, the
3701 output display aspect ratio will change according to the following
3703 <em>DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR</em>
3705 <p>Keep in mind that the sample aspect ratio set by this filter may be
3706 changed by later filters in the filterchain, e.g. if another "setsar"
3707 or a "setdar" filter is applied.
3709 <p>The filter accepts a parameter string which represents the wanted
3710 sample aspect ratio.
3711 The parameter can be a floating point number string, or an expression
3712 of the form <var>num</var>:<var>den</var>, where <var>num</var> and <var>den</var> are the
3713 numerator and denominator of the aspect ratio.
3714 If the parameter is not specified, it is assumed the value "0:1".
3716 <p>For example to change the sample aspect ratio to 10:11, specify:
3717 </p><table><tr><td> </td><td><pre class="example">setsar=10:11
3718 </pre></td></tr></table>
3720 <a name="settb"></a>
3721 <h2 class="section"><a href="ffplay.html#toc-settb">16.30 settb</a></h2>
3723 <p>Set the timebase to use for the output frames timestamps.
3724 It is mainly useful for testing timebase configuration.
3726 <p>It accepts in input an arithmetic expression representing a rational.
3727 The expression can contain the constants "PI", "E", "PHI", "AVTB" (the
3728 default timebase), and "intb" (the input timebase).
3730 <p>The default value for the input is "intb".
3732 <p>Follow some examples.
3734 <table><tr><td> </td><td><pre class="example"># set the timebase to 1/25
3737 # set the timebase to 1/10
3740 #set the timebase to 1001/1000
3743 #set the timebase to 2*intb
3746 #set the default timebase value
3748 </pre></td></tr></table>
3750 <a name="showinfo"></a>
3751 <h2 class="section"><a href="ffplay.html#toc-showinfo">16.31 showinfo</a></h2>
3753 <p>Show a line containing various information for each input video frame.
3754 The input video is not modified.
3756 <p>The shown line contains a sequence of key/value pairs of the form
3757 <var>key</var>:<var>value</var>.
3759 <p>A description of each shown parameter follows:
3761 <dl compact="compact">
3762 <dt> ‘<samp>n</samp>’</dt>
3763 <dd><p>sequential number of the input frame, starting from 0
3766 <dt> ‘<samp>pts</samp>’</dt>
3767 <dd><p>Presentation TimeStamp of the input frame, expressed as a number of
3768 time base units. The time base unit depends on the filter input pad.
3771 <dt> ‘<samp>pts_time</samp>’</dt>
3772 <dd><p>Presentation TimeStamp of the input frame, expressed as a number of
3776 <dt> ‘<samp>pos</samp>’</dt>
3777 <dd><p>position of the frame in the input stream, -1 if this information in
3778 unavailable and/or meanigless (for example in case of synthetic video)
3781 <dt> ‘<samp>fmt</samp>’</dt>
3782 <dd><p>pixel format name
3785 <dt> ‘<samp>sar</samp>’</dt>
3786 <dd><p>sample aspect ratio of the input frame, expressed in the form
3787 <var>num</var>/<var>den</var>
3790 <dt> ‘<samp>s</samp>’</dt>
3791 <dd><p>size of the input frame, expressed in the form
3792 <var>width</var>x<var>height</var>
3795 <dt> ‘<samp>i</samp>’</dt>
3796 <dd><p>interlaced mode ("P" for "progressive", "T" for top field first, "B"
3797 for bottom field first)
3800 <dt> ‘<samp>iskey</samp>’</dt>
3801 <dd><p>1 if the frame is a key frame, 0 otherwise
3804 <dt> ‘<samp>type</samp>’</dt>
3805 <dd><p>picture type of the input frame ("I" for an I-frame, "P" for a
3806 P-frame, "B" for a B-frame, "?" for unknown type).
3807 Check also the documentation of the <code>AVPictureType</code> enum and of
3808 the <code>av_get_picture_type_char</code> function defined in
3809 ‘<tt>libavutil/avutil.h</tt>’.
3812 <dt> ‘<samp>checksum</samp>’</dt>
3813 <dd><p>Adler-32 checksum of all the planes of the input frame
3816 <dt> ‘<samp>plane_checksum</samp>’</dt>
3817 <dd><p>Adler-32 checksum of each plane of the input frame, expressed in the form
3818 "[<var>c0</var> <var>c1</var> <var>c2</var> <var>c3</var>]"
3822 <a name="slicify"></a>
3823 <h2 class="section"><a href="ffplay.html#toc-slicify">16.32 slicify</a></h2>
3825 <p>Pass the images of input video on to next video filter as multiple
3828 <table><tr><td> </td><td><pre class="example">./ffmpeg -i in.avi -vf "slicify=32" out.avi
3829 </pre></td></tr></table>
3831 <p>The filter accepts the slice height as parameter. If the parameter is
3832 not specified it will use the default value of 16.
3834 <p>Adding this in the beginning of filter chains should make filtering
3835 faster due to better use of the memory cache.
3837 <a name="split"></a>
3838 <h2 class="section"><a href="ffplay.html#toc-split">16.33 split</a></h2>
3840 <p>Pass on the input video to two outputs. Both outputs are identical to
3844 </p><table><tr><td> </td><td><pre class="example">[in] split [splitout1][splitout2];
3845 [splitout1] crop=100:100:0:0 [cropout];
3846 [splitout2] pad=200:200:100:100 [padout];
3847 </pre></td></tr></table>
3849 <p>will create two separate outputs from the same input, one cropped and
3852 <a name="transpose"></a>
3853 <h2 class="section"><a href="ffplay.html#toc-transpose">16.34 transpose</a></h2>
3855 <p>Transpose rows with columns in the input video and optionally flip it.
3857 <p>It accepts a parameter representing an integer, which can assume the
3860 <dl compact="compact">
3861 <dt> ‘<samp>0</samp>’</dt>
3862 <dd><p>Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
3863 </p><table><tr><td> </td><td><pre class="example">L.R L.l
3866 </pre></td></tr></table>
3869 <dt> ‘<samp>1</samp>’</dt>
3870 <dd><p>Rotate by 90 degrees clockwise, that is:
3871 </p><table><tr><td> </td><td><pre class="example">L.R l.L
3874 </pre></td></tr></table>
3877 <dt> ‘<samp>2</samp>’</dt>
3878 <dd><p>Rotate by 90 degrees counterclockwise, that is:
3879 </p><table><tr><td> </td><td><pre class="example">L.R R.r
3882 </pre></td></tr></table>
3885 <dt> ‘<samp>3</samp>’</dt>
3886 <dd><p>Rotate by 90 degrees clockwise and vertically flip, that is:
3887 </p><table><tr><td> </td><td><pre class="example">L.R r.R
3890 </pre></td></tr></table>
3894 <a name="unsharp"></a>
3895 <h2 class="section"><a href="ffplay.html#toc-unsharp">16.35 unsharp</a></h2>
3897 <p>Sharpen or blur the input video.
3899 <p>It accepts the following parameters:
3900 <var>luma_msize_x</var>:<var>luma_msize_y</var>:<var>luma_amount</var>:<var>chroma_msize_x</var>:<var>chroma_msize_y</var>:<var>chroma_amount</var>
3902 <p>Negative values for the amount will blur the input video, while positive
3903 values will sharpen. All parameters are optional and default to the
3904 equivalent of the string ’5:5:1.0:0:0:0.0’.
3906 <dl compact="compact">
3907 <dt> ‘<samp>luma_msize_x</samp>’</dt>
3908 <dd><p>Set the luma matrix horizontal size. It can be an integer between 3
3909 and 13, default value is 5.
3912 <dt> ‘<samp>luma_msize_y</samp>’</dt>
3913 <dd><p>Set the luma matrix vertical size. It can be an integer between 3
3914 and 13, default value is 5.
3917 <dt> ‘<samp>luma_amount</samp>’</dt>
3918 <dd><p>Set the luma effect strength. It can be a float number between -2.0
3919 and 5.0, default value is 1.0.
3922 <dt> ‘<samp>chroma_msize_x</samp>’</dt>
3923 <dd><p>Set the chroma matrix horizontal size. It can be an integer between 3
3924 and 13, default value is 0.
3927 <dt> ‘<samp>chroma_msize_y</samp>’</dt>
3928 <dd><p>Set the chroma matrix vertical size. It can be an integer between 3
3929 and 13, default value is 0.
3932 <dt> ‘<samp>luma_amount</samp>’</dt>
3933 <dd><p>Set the chroma effect strength. It can be a float number between -2.0
3934 and 5.0, default value is 0.0.
3939 <table><tr><td> </td><td><pre class="example"># Strong luma sharpen effect parameters
3942 # Strong blur of both luma and chroma parameters
3943 unsharp=7:7:-2:7:7:-2
3945 # Use the default values with <code>ffmpeg</code>
3946 ./ffmpeg -i in.avi -vf "unsharp" out.mp4
3947 </pre></td></tr></table>
3949 <a name="vflip"></a>
3950 <h2 class="section"><a href="ffplay.html#toc-vflip">16.36 vflip</a></h2>
3952 <p>Flip the input video vertically.
3954 <table><tr><td> </td><td><pre class="example">./ffmpeg -i in.avi -vf "vflip" out.avi
3955 </pre></td></tr></table>
3957 <a name="yadif"></a>
3958 <h2 class="section"><a href="ffplay.html#toc-yadif">16.37 yadif</a></h2>
3960 <p>Deinterlace the input video ("yadif" means "yet another deinterlacing
3963 <p>It accepts the optional parameters: <var>mode</var>:<var>parity</var>:<var>auto</var>.
3965 <p><var>mode</var> specifies the interlacing mode to adopt, accepts one of the
3968 <dl compact="compact">
3969 <dt> ‘<samp>0</samp>’</dt>
3970 <dd><p>output 1 frame for each frame
3972 <dt> ‘<samp>1</samp>’</dt>
3973 <dd><p>output 1 frame for each field
3975 <dt> ‘<samp>2</samp>’</dt>
3976 <dd><p>like 0 but skips spatial interlacing check
3978 <dt> ‘<samp>3</samp>’</dt>
3979 <dd><p>like 1 but skips spatial interlacing check
3983 <p>Default value is 0.
3985 <p><var>parity</var> specifies the picture field parity assumed for the input
3986 interlaced video, accepts one of the following values:
3988 <dl compact="compact">
3989 <dt> ‘<samp>0</samp>’</dt>
3990 <dd><p>assume bottom field first
3992 <dt> ‘<samp>1</samp>’</dt>
3993 <dd><p>assume top field first
3995 <dt> ‘<samp>-1</samp>’</dt>
3996 <dd><p>enable automatic detection
4000 <p>Default value is -1.
4001 If interlacing is unknown or decoder does not export this information,
4002 top field first will be assumed.
4004 <p><var>auto</var> specifies if deinterlacer should trust the interlaced flag
4005 and only deinterlace frames marked as interlaced
4007 <dl compact="compact">
4008 <dt> ‘<samp>0</samp>’</dt>
4009 <dd><p>deinterlace all frames
4011 <dt> ‘<samp>1</samp>’</dt>
4012 <dd><p>only deinterlace frames marked as interlaced
4016 <p>Default value is 0.
4019 <a name="Video-Sources"></a>
4020 <h1 class="chapter"><a href="ffplay.html#toc-Video-Sources">17. Video Sources</a></h1>
4022 <p>Below is a description of the currently available video sources.
4024 <a name="buffer"></a>
4025 <h2 class="section"><a href="ffplay.html#toc-buffer">17.1 buffer</a></h2>
4027 <p>Buffer video frames, and make them available to the filter chain.
4029 <p>This source is mainly intended for a programmatic use, in particular
4030 through the interface defined in ‘<tt>libavfilter/vsrc_buffer.h</tt>’.
4032 <p>It accepts the following parameters:
4033 <var>width</var>:<var>height</var>:<var>pix_fmt_string</var>:<var>timebase_num</var>:<var>timebase_den</var>:<var>sample_aspect_ratio_num</var>:<var>sample_aspect_ratio.den</var>:<var>scale_params</var>
4035 <p>All the parameters but <var>scale_params</var> need to be explicitely
4038 <p>Follows the list of the accepted parameters.
4040 <dl compact="compact">
4041 <dt> ‘<samp>width, height</samp>’</dt>
4042 <dd><p>Specify the width and height of the buffered video frames.
4045 <dt> ‘<samp>pix_fmt_string</samp>’</dt>
4046 <dd><p>A string representing the pixel format of the buffered video frames.
4047 It may be a number corresponding to a pixel format, or a pixel format
4051 <dt> ‘<samp>timebase_num, timebase_den</samp>’</dt>
4052 <dd><p>Specify numerator and denomitor of the timebase assumed by the
4053 timestamps of the buffered frames.
4056 <dt> ‘<samp>sample_aspect_ratio.num, sample_aspect_ratio.den</samp>’</dt>
4057 <dd><p>Specify numerator and denominator of the sample aspect ratio assumed
4058 by the video frames.
4061 <dt> ‘<samp>scale_params</samp>’</dt>
4062 <dd><p>Specify the optional parameters to be used for the scale filter which
4063 is automatically inserted when an input change is detected in the
4064 input size or format.
4069 </p><table><tr><td> </td><td><pre class="example">buffer=320:240:yuv410p:1:24:1:1
4070 </pre></td></tr></table>
4072 <p>will instruct the source to accept video frames with size 320x240 and
4073 with format "yuv410p", assuming 1/24 as the timestamps timebase and
4074 square pixels (1:1 sample aspect ratio).
4075 Since the pixel format with name "yuv410p" corresponds to the number 6
4076 (check the enum PixelFormat definition in ‘<tt>libavutil/pixfmt.h</tt>’),
4077 this example corresponds to:
4078 </p><table><tr><td> </td><td><pre class="example">buffer=320:240:6:1:24:1:1
4079 </pre></td></tr></table>
4081 <a name="color"></a>
4082 <h2 class="section"><a href="ffplay.html#toc-color">17.2 color</a></h2>
4084 <p>Provide an uniformly colored input.
4086 <p>It accepts the following parameters:
4087 <var>color</var>:<var>frame_size</var>:<var>frame_rate</var>
4089 <p>Follows the description of the accepted parameters.
4091 <dl compact="compact">
4092 <dt> ‘<samp>color</samp>’</dt>
4093 <dd><p>Specify the color of the source. It can be the name of a color (case
4094 insensitive match) or a 0xRRGGBB[AA] sequence, possibly followed by an
4095 alpha specifier. The default value is "black".
4098 <dt> ‘<samp>frame_size</samp>’</dt>
4099 <dd><p>Specify the size of the sourced video, it may be a string of the form
4100 <var>width</var>x<var>heigth</var>, or the name of a size abbreviation. The
4101 default value is "320x240".
4104 <dt> ‘<samp>frame_rate</samp>’</dt>
4105 <dd><p>Specify the frame rate of the sourced video, as the number of frames
4106 generated per second. It has to be a string in the format
4107 <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a float
4108 number or a valid video frame rate abbreviation. The default value is
4114 <p>For example the following graph description will generate a red source
4115 with an opacity of 0.2, with size "qcif" and a frame rate of 10
4116 frames per second, which will be overlayed over the source connected
4117 to the pad with identifier "in".
4119 <table><tr><td> </td><td><pre class="example">"color=red@0.2:qcif:10 [color]; [in][color] overlay [out]"
4120 </pre></td></tr></table>
4122 <a name="movie"></a>
4123 <h2 class="section"><a href="ffplay.html#toc-movie">17.3 movie</a></h2>
4125 <p>Read a video stream from a movie container.
4127 <p>It accepts the syntax: <var>movie_name</var>[:<var>options</var>] where
4128 <var>movie_name</var> is the name of the resource to read (not necessarily
4129 a file but also a device or a stream accessed through some protocol),
4130 and <var>options</var> is an optional sequence of <var>key</var>=<var>value</var>
4131 pairs, separated by ":".
4133 <p>The description of the accepted options follows.
4135 <dl compact="compact">
4136 <dt> ‘<samp>format_name, f</samp>’</dt>
4137 <dd><p>Specifies the format assumed for the movie to read, and can be either
4138 the name of a container or an input device. If not specified the
4139 format is guessed from <var>movie_name</var> or by probing.
4142 <dt> ‘<samp>seek_point, sp</samp>’</dt>
4143 <dd><p>Specifies the seek point in seconds, the frames will be output
4144 starting from this seek point, the parameter is evaluated with
4145 <code>av_strtod</code> so the numerical value may be suffixed by an IS
4146 postfix. Default value is "0".
4149 <dt> ‘<samp>stream_index, si</samp>’</dt>
4150 <dd><p>Specifies the index of the video stream to read. If the value is -1,
4151 the best suited video stream will be automatically selected. Default
4152 value is "-1".
4157 <p>This filter allows to overlay a second video on top of main input of
4158 a filtergraph as shown in this graph:
4159 </p><table><tr><td> </td><td><pre class="example">input -----------> deltapts0 --> overlay --> output
4162 movie --> scale--> deltapts1 -------+
4163 </pre></td></tr></table>
4165 <p>Some examples follow:
4166 </p><table><tr><td> </td><td><pre class="example"># skip 3.2 seconds from the start of the avi file in.avi, and overlay it
4167 # on top of the input labelled as "in".
4168 movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [movie];
4169 [in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
4171 # read from a video4linux2 device, and overlay it on top of the input
4172 # labelled as "in"
4173 movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [movie];
4174 [in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
4176 </pre></td></tr></table>
4178 <a name="nullsrc"></a>
4179 <h2 class="section"><a href="ffplay.html#toc-nullsrc">17.4 nullsrc</a></h2>
4181 <p>Null video source, never return images. It is mainly useful as a
4182 template and to be employed in analysis / debugging tools.
4184 <p>It accepts as optional parameter a string of the form
4185 <var>width</var>:<var>height</var>:<var>timebase</var>.
4187 <p><var>width</var> and <var>height</var> specify the size of the configured
4188 source. The default values of <var>width</var> and <var>height</var> are
4189 respectively 352 and 288 (corresponding to the CIF size format).
4191 <p><var>timebase</var> specifies an arithmetic expression representing a
4192 timebase. The expression can contain the constants "PI", "E", "PHI",
4193 "AVTB" (the default timebase), and defaults to the value "AVTB".
4195 <a name="frei0r_005fsrc"></a>
4196 <h2 class="section"><a href="ffplay.html#toc-frei0r_005fsrc">17.5 frei0r_src</a></h2>
4198 <p>Provide a frei0r source.
4200 <p>To enable compilation of this filter you need to install the frei0r
4201 header and configure FFmpeg with –enable-frei0r.
4203 <p>The source supports the syntax:
4204 </p><table><tr><td> </td><td><pre class="example"><var>size</var>:<var>rate</var>:<var>src_name</var>[{=|:}<var>param1</var>:<var>param2</var>:...:<var>paramN</var>]
4205 </pre></td></tr></table>
4207 <p><var>size</var> is the size of the video to generate, may be a string of the
4208 form <var>width</var>x<var>height</var> or a frame size abbreviation.
4209 <var>rate</var> is the rate of the video to generate, may be a string of
4210 the form <var>num</var>/<var>den</var> or a frame rate abbreviation.
4211 <var>src_name</var> is the name to the frei0r source to load. For more
4212 information regarding frei0r and how to set the parameters read the
4213 section <a href="#frei0r">frei0r</a> in the description of the video filters.
4215 <p>Some examples follow:
4216 </p><table><tr><td> </td><td><pre class="example"># generate a frei0r partik0l source with size 200x200 and framerate 10
4217 # which is overlayed on the overlay filter main input
4218 frei0r_src=200x200:10:partik0l=1234 [overlay]; [in][overlay] overlay
4219 </pre></td></tr></table>
4221 <a name="rgbtestsrc_002c-testsrc"></a>
4222 <h2 class="section"><a href="ffplay.html#toc-rgbtestsrc_002c-testsrc">17.6 rgbtestsrc, testsrc</a></h2>
4224 <p>The <code>rgbtestsrc</code> source generates an RGB test pattern useful for
4225 detecting RGB vs BGR issues. You should see a red, green and blue
4226 stripe from top to bottom.
4228 <p>The <code>testsrc</code> source generates a test video pattern, showing a
4229 color pattern, a scrolling gradient and a timestamp. This is mainly
4230 intended for testing purposes.
4232 <p>Both sources accept an optional sequence of <var>key</var>=<var>value</var> pairs,
4233 separated by ":". The description of the accepted options follows.
4235 <dl compact="compact">
4236 <dt> ‘<samp>size, s</samp>’</dt>
4237 <dd><p>Specify the size of the sourced video, it may be a string of the form
4238 <var>width</var>x<var>heigth</var>, or the name of a size abbreviation. The
4239 default value is "320x240".
4242 <dt> ‘<samp>rate, r</samp>’</dt>
4243 <dd><p>Specify the frame rate of the sourced video, as the number of frames
4244 generated per second. It has to be a string in the format
4245 <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a float
4246 number or a valid video frame rate abbreviation. The default value is
4250 <dt> ‘<samp>duration</samp>’</dt>
4251 <dd><p>Set the video duration of the sourced video. The accepted syntax is:
4252 </p><table><tr><td> </td><td><pre class="example">[-]HH[:MM[:SS[.m...]]]
4254 </pre></td></tr></table>
4255 <p>See also the function <code>av_parse_time()</code>.
4257 <p>If not specified, or the expressed duration is negative, the video is
4258 supposed to be generated forever.
4262 <p>For example the following:
4263 </p><table><tr><td> </td><td><pre class="example">testsrc=duration=5.3:size=qcif:rate=10
4264 </pre></td></tr></table>
4266 <p>will generate a video with a duration of 5.3 seconds, with size
4267 176x144 and a framerate of 10 frames per second.
4270 <a name="Video-Sinks"></a>
4271 <h1 class="chapter"><a href="ffplay.html#toc-Video-Sinks">18. Video Sinks</a></h1>
4273 <p>Below is a description of the currently available video sinks.
4275 <a name="buffersink"></a>
4276 <h2 class="section"><a href="ffplay.html#toc-buffersink">18.1 buffersink</a></h2>
4278 <p>Buffer video frames, and make them available to the end of the filter
4281 <p>This sink is mainly intended for a programmatic use, in particular
4282 through the interface defined in ‘<tt>libavfilter/vsink_buffer.h</tt>’.
4284 <p>It does not require a string parameter in input, but you need to
4285 specify a pointer to a list of supported pixel formats terminated by
4286 -1 in the opaque parameter provided to <code>avfilter_init_filter</code>
4287 when initializing this sink.
4289 <a name="nullsink"></a>
4290 <h2 class="section"><a href="ffplay.html#toc-nullsink">18.2 nullsink</a></h2>
4292 <p>Null video sink, do absolutely nothing with the input video. It is
4293 mainly useful as a template and to be employed in analysis / debugging
4302 This document was generated by <em>Kyle Schwarz</em> on <em>July 23, 2011</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.