1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
3 <!-- Created on June 10, 2011 by texi2html 1.82
4 texi2html was written by:
5 Lionel Cons <Lionel.Cons@cern.ch> (original author)
6 Karl Berry <karl@freefriends.org>
7 Olaf Bachmann <obachman@mathematik.uni-kl.de>
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-2" href="#Options-2">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" href="#alsa">9.1 alsa</a></li>
88 <li><a name="toc-bktr" href="#bktr">9.2 bktr</a></li>
89 <li><a name="toc-dv1394" href="#dv1394">9.3 dv1394</a></li>
90 <li><a name="toc-fbdev" href="#fbdev">9.4 fbdev</a></li>
91 <li><a name="toc-jack" href="#jack">9.5 jack</a></li>
92 <li><a name="toc-libdc1394" href="#libdc1394">9.6 libdc1394</a></li>
93 <li><a name="toc-oss" href="#oss">9.7 oss</a></li>
94 <li><a name="toc-sndio" href="#sndio">9.8 sndio</a></li>
95 <li><a name="toc-video4linux-and-video4linux2" href="#video4linux-and-video4linux2">9.9 video4linux and video4linux2</a></li>
96 <li><a name="toc-vfwcap" href="#vfwcap">9.10 vfwcap</a></li>
97 <li><a name="toc-x11grab" href="#x11grab">9.11 x11grab</a></li>
99 <li><a name="toc-Output-Devices" href="#Output-Devices">10. Output Devices</a>
101 <li><a name="toc-alsa-1" href="#alsa-1">10.1 alsa</a></li>
102 <li><a name="toc-oss-1" href="#oss-1">10.2 oss</a></li>
103 <li><a name="toc-sdl" href="#sdl">10.3 sdl</a>
105 <li><a name="toc-Options" href="#Options">10.3.1 Options</a></li>
106 <li><a name="toc-Examples" href="#Examples">10.3.2 Examples</a></li>
108 <li><a name="toc-sndio-1" href="#sndio-1">10.4 sndio</a></li>
110 <li><a name="toc-Protocols" href="#Protocols">11. Protocols</a>
112 <li><a name="toc-applehttp-1" href="#applehttp-1">11.1 applehttp</a></li>
113 <li><a name="toc-concat" href="#concat">11.2 concat</a></li>
114 <li><a name="toc-file" href="#file">11.3 file</a></li>
115 <li><a name="toc-gopher" href="#gopher">11.4 gopher</a></li>
116 <li><a name="toc-http" href="#http">11.5 http</a></li>
117 <li><a name="toc-mmst" href="#mmst">11.6 mmst</a></li>
118 <li><a name="toc-mmsh" href="#mmsh">11.7 mmsh</a></li>
119 <li><a name="toc-md5" href="#md5">11.8 md5</a></li>
120 <li><a name="toc-pipe" href="#pipe">11.9 pipe</a></li>
121 <li><a name="toc-rtmp" href="#rtmp">11.10 rtmp</a></li>
122 <li><a name="toc-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte" href="#rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">11.11 rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></li>
123 <li><a name="toc-rtp" href="#rtp">11.12 rtp</a></li>
124 <li><a name="toc-rtsp" href="#rtsp">11.13 rtsp</a></li>
125 <li><a name="toc-sap" href="#sap">11.14 sap</a>
127 <li><a name="toc-Muxer" href="#Muxer">11.14.1 Muxer</a></li>
128 <li><a name="toc-Demuxer" href="#Demuxer">11.14.2 Demuxer</a></li>
130 <li><a name="toc-tcp" href="#tcp">11.15 tcp</a></li>
131 <li><a name="toc-udp" href="#udp">11.16 udp</a></li>
133 <li><a name="toc-Filtergraph-description" href="#Filtergraph-description">12. Filtergraph description</a>
135 <li><a name="toc-Filtergraph-syntax" href="#Filtergraph-syntax">12.1 Filtergraph syntax</a></li>
137 <li><a name="toc-Audio-Filters" href="#Audio-Filters">13. Audio Filters</a>
139 <li><a name="toc-anull" href="#anull">13.1 anull</a></li>
141 <li><a name="toc-Audio-Sources" href="#Audio-Sources">14. Audio Sources</a>
143 <li><a name="toc-anullsrc" href="#anullsrc">14.1 anullsrc</a></li>
145 <li><a name="toc-Audio-Sinks" href="#Audio-Sinks">15. Audio Sinks</a>
147 <li><a name="toc-anullsink" href="#anullsink">15.1 anullsink</a></li>
149 <li><a name="toc-Video-Filters" href="#Video-Filters">16. Video Filters</a>
151 <li><a name="toc-blackframe" href="#blackframe">16.1 blackframe</a></li>
152 <li><a name="toc-copy" href="#copy">16.2 copy</a></li>
153 <li><a name="toc-crop" href="#crop">16.3 crop</a></li>
154 <li><a name="toc-cropdetect" href="#cropdetect">16.4 cropdetect</a></li>
155 <li><a name="toc-drawbox" href="#drawbox">16.5 drawbox</a></li>
156 <li><a name="toc-drawtext" href="#drawtext">16.6 drawtext</a></li>
157 <li><a name="toc-fade" href="#fade">16.7 fade</a></li>
158 <li><a name="toc-fieldorder" href="#fieldorder">16.8 fieldorder</a></li>
159 <li><a name="toc-fifo" href="#fifo">16.9 fifo</a></li>
160 <li><a name="toc-format" href="#format">16.10 format</a></li>
161 <li><a name="toc-frei0r-1" href="#frei0r-1">16.11 frei0r</a></li>
162 <li><a name="toc-gradfun" href="#gradfun">16.12 gradfun</a></li>
163 <li><a name="toc-hflip" href="#hflip">16.13 hflip</a></li>
164 <li><a name="toc-hqdn3d" href="#hqdn3d">16.14 hqdn3d</a></li>
165 <li><a name="toc-mp" href="#mp">16.15 mp</a></li>
166 <li><a name="toc-noformat" href="#noformat">16.16 noformat</a></li>
167 <li><a name="toc-null-1" href="#null-1">16.17 null</a></li>
168 <li><a name="toc-ocv" href="#ocv">16.18 ocv</a>
170 <li><a name="toc-dilate-1" href="#dilate-1">16.18.1 dilate</a></li>
171 <li><a name="toc-erode" href="#erode">16.18.2 erode</a></li>
172 <li><a name="toc-smooth" href="#smooth">16.18.3 smooth</a></li>
174 <li><a name="toc-overlay" href="#overlay">16.19 overlay</a></li>
175 <li><a name="toc-pad" href="#pad">16.20 pad</a></li>
176 <li><a name="toc-pixdesctest" href="#pixdesctest">16.21 pixdesctest</a></li>
177 <li><a name="toc-scale" href="#scale">16.22 scale</a></li>
178 <li><a name="toc-select" href="#select">16.23 select</a></li>
179 <li><a name="toc-setdar-1" href="#setdar-1">16.24 setdar</a></li>
180 <li><a name="toc-setpts" href="#setpts">16.25 setpts</a></li>
181 <li><a name="toc-setsar-1" href="#setsar-1">16.26 setsar</a></li>
182 <li><a name="toc-settb" href="#settb">16.27 settb</a></li>
183 <li><a name="toc-showinfo" href="#showinfo">16.28 showinfo</a></li>
184 <li><a name="toc-slicify" href="#slicify">16.29 slicify</a></li>
185 <li><a name="toc-split" href="#split">16.30 split</a></li>
186 <li><a name="toc-transpose" href="#transpose">16.31 transpose</a></li>
187 <li><a name="toc-unsharp" href="#unsharp">16.32 unsharp</a></li>
188 <li><a name="toc-vflip" href="#vflip">16.33 vflip</a></li>
189 <li><a name="toc-yadif" href="#yadif">16.34 yadif</a></li>
191 <li><a name="toc-Video-Sources" href="#Video-Sources">17. Video Sources</a>
193 <li><a name="toc-buffer" href="#buffer">17.1 buffer</a></li>
194 <li><a name="toc-color" href="#color">17.2 color</a></li>
195 <li><a name="toc-movie" href="#movie">17.3 movie</a></li>
196 <li><a name="toc-nullsrc" href="#nullsrc">17.4 nullsrc</a></li>
197 <li><a name="toc-frei0r_005fsrc" href="#frei0r_005fsrc">17.5 frei0r_src</a></li>
199 <li><a name="toc-Video-Sinks" href="#Video-Sinks">18. Video Sinks</a>
201 <li><a name="toc-nullsink" href="#nullsink">18.1 nullsink</a></li>
208 <a name="Synopsis"></a>
209 <h1 class="chapter"><a href="ffplay.html#toc-Synopsis">1. Synopsis</a></h1>
211 <table><tr><td> </td><td><pre class="example">ffplay [options] [‘<tt>input_file</tt>’]
212 </pre></td></tr></table>
214 <a name="Description"></a>
215 <h1 class="chapter"><a href="ffplay.html#toc-Description">2. Description</a></h1>
217 <p>FFplay is a very simple and portable media player using the FFmpeg
218 libraries and the SDL library. It is mostly used as a testbed for the
221 <a name="Options-2"></a>
222 <h1 class="chapter"><a href="ffplay.html#toc-Options-2">3. Options</a></h1>
224 <p>All the numerical options, if not specified otherwise, accept in input
225 a string representing a number, which may contain one of the
226 International System number postfixes, for example ’K’, ’M’, ’G’.
227 If ’i’ is appended after the postfix, powers of 2 are used instead of
228 powers of 10. The ’B’ postfix multiplies the value for 8, and can be
229 appended after another postfix or used alone. This allows using for
230 example ’KB’, ’MiB’, ’G’ and ’B’ as postfix.
232 <p>Options which do not take arguments are boolean options, and set the
233 corresponding value to true. They can be set to false by prefixing
234 with "no" the option name, for example using "-nofoo" in the
235 commandline will set to false the boolean option with name "foo".
237 <a name="Generic-options"></a>
238 <h2 class="section"><a href="ffplay.html#toc-Generic-options">3.1 Generic options</a></h2>
240 <p>These options are shared amongst the ff* tools.
242 <dl compact="compact">
243 <dt> ‘<samp>-L</samp>’</dt>
247 <dt> ‘<samp>-h, -?, -help, --help</samp>’</dt>
251 <dt> ‘<samp>-version</samp>’</dt>
255 <dt> ‘<samp>-formats</samp>’</dt>
256 <dd><p>Show available formats.
258 <p>The fields preceding the format names have the following meanings:
259 </p><dl compact="compact">
260 <dt> ‘<samp>D</samp>’</dt>
261 <dd><p>Decoding available
263 <dt> ‘<samp>E</samp>’</dt>
264 <dd><p>Encoding available
269 <dt> ‘<samp>-codecs</samp>’</dt>
270 <dd><p>Show available codecs.
272 <p>The fields preceding the codec names have the following meanings:
273 </p><dl compact="compact">
274 <dt> ‘<samp>D</samp>’</dt>
275 <dd><p>Decoding available
277 <dt> ‘<samp>E</samp>’</dt>
278 <dd><p>Encoding available
280 <dt> ‘<samp>V/A/S</samp>’</dt>
281 <dd><p>Video/audio/subtitle codec
283 <dt> ‘<samp>S</samp>’</dt>
284 <dd><p>Codec supports slices
286 <dt> ‘<samp>D</samp>’</dt>
287 <dd><p>Codec supports direct rendering
289 <dt> ‘<samp>T</samp>’</dt>
290 <dd><p>Codec can handle input truncated at random locations instead of only at frame boundaries
295 <dt> ‘<samp>-bsfs</samp>’</dt>
296 <dd><p>Show available bitstream filters.
299 <dt> ‘<samp>-protocols</samp>’</dt>
300 <dd><p>Show available protocols.
303 <dt> ‘<samp>-filters</samp>’</dt>
304 <dd><p>Show available libavfilter filters.
307 <dt> ‘<samp>-pix_fmts</samp>’</dt>
308 <dd><p>Show available pixel formats.
311 <dt> ‘<samp>-loglevel <var>loglevel</var></samp>’</dt>
312 <dd><p>Set the logging level used by the library.
313 <var>loglevel</var> is a number or a string containing one of the following values:
314 </p><dl compact="compact">
315 <dt> ‘<samp>quiet</samp>’</dt>
316 <dt> ‘<samp>panic</samp>’</dt>
317 <dt> ‘<samp>fatal</samp>’</dt>
318 <dt> ‘<samp>error</samp>’</dt>
319 <dt> ‘<samp>warning</samp>’</dt>
320 <dt> ‘<samp>info</samp>’</dt>
321 <dt> ‘<samp>verbose</samp>’</dt>
322 <dt> ‘<samp>debug</samp>’</dt>
325 <p>By default the program logs to stderr, if coloring is supported by the
326 terminal, colors are used to mark errors and warnings. Log coloring
327 can be disabled setting the environment variable
328 <code>FFMPEG_FORCE_NOCOLOR</code> or <code>NO_COLOR</code>, or can be forced setting
329 the environment variable <code>FFMPEG_FORCE_COLOR</code>.
330 The use of the environment variable <code>NO_COLOR</code> is deprecated and
331 will be dropped in a following FFmpeg version.
336 <a name="Main-options"></a>
337 <h2 class="section"><a href="ffplay.html#toc-Main-options">3.2 Main options</a></h2>
339 <dl compact="compact">
340 <dt> ‘<samp>-x <var>width</var></samp>’</dt>
341 <dd><p>Force displayed width.
343 <dt> ‘<samp>-y <var>height</var></samp>’</dt>
344 <dd><p>Force displayed height.
346 <dt> ‘<samp>-s <var>size</var></samp>’</dt>
347 <dd><p>Set frame size (WxH or abbreviation), needed for videos which don’t
348 contain a header with the frame size like raw YUV.
350 <dt> ‘<samp>-an</samp>’</dt>
351 <dd><p>Disable audio.
353 <dt> ‘<samp>-vn</samp>’</dt>
354 <dd><p>Disable video.
356 <dt> ‘<samp>-ss <var>pos</var></samp>’</dt>
357 <dd><p>Seek to a given position in seconds.
359 <dt> ‘<samp>-t <var>duration</var></samp>’</dt>
360 <dd><p>play <duration> seconds of audio/video
362 <dt> ‘<samp>-bytes</samp>’</dt>
363 <dd><p>Seek by bytes.
365 <dt> ‘<samp>-nodisp</samp>’</dt>
366 <dd><p>Disable graphical display.
368 <dt> ‘<samp>-f <var>fmt</var></samp>’</dt>
371 <dt> ‘<samp>-window_title <var>title</var></samp>’</dt>
372 <dd><p>Set window title (default is the input filename).
374 <dt> ‘<samp>-loop <var>number</var></samp>’</dt>
375 <dd><p>Loops movie playback <number> times. 0 means forever.
377 <dt> ‘<samp>-showmode <var>mode</var></samp>’</dt>
378 <dd><p>Set the show mode to use.
379 Available values for <var>mode</var> are:
380 </p><dl compact="compact">
381 <dt> ‘<samp>0, video</samp>’</dt>
384 <dt> ‘<samp>1, waves</samp>’</dt>
385 <dd><p>show audio waves
387 <dt> ‘<samp>2, rdft</samp>’</dt>
388 <dd><p>show audio frequency band using RDFT ((Inverse) Real Discrete Fourier Transform)
392 <p>Default value is "video", if video is not present or cannot be played
393 "rdft" is automatically selected.
395 <p>You can interactively cycle through the available show modes by
396 pressing the key <w>.
399 <dt> ‘<samp>-vf <var>filter_graph</var></samp>’</dt>
400 <dd><p><var>filter_graph</var> is a description of the filter graph to apply to
402 Use the option "-filters" to show all the available filters (including
403 also sources and sinks).
406 <dt> ‘<samp>-i <var>input_file</var></samp>’</dt>
407 <dd><p>Read <var>input_file</var>.
411 <a name="Advanced-options"></a>
412 <h2 class="section"><a href="ffplay.html#toc-Advanced-options">3.3 Advanced options</a></h2>
413 <dl compact="compact">
414 <dt> ‘<samp>-pix_fmt <var>format</var></samp>’</dt>
415 <dd><p>Set pixel format.
417 <dt> ‘<samp>-stats</samp>’</dt>
418 <dd><p>Show the stream duration, the codec parameters, the current position in
419 the stream and the audio/video synchronisation drift.
421 <dt> ‘<samp>-bug</samp>’</dt>
422 <dd><p>Work around bugs.
424 <dt> ‘<samp>-fast</samp>’</dt>
425 <dd><p>Non-spec-compliant optimizations.
427 <dt> ‘<samp>-genpts</samp>’</dt>
430 <dt> ‘<samp>-rtp_tcp</samp>’</dt>
431 <dd><p>Force RTP/TCP protocol usage instead of RTP/UDP. It is only meaningful
432 if you are streaming with the RTSP protocol.
434 <dt> ‘<samp>-sync <var>type</var></samp>’</dt>
435 <dd><p>Set the master clock to audio (<code>type=audio</code>), video
436 (<code>type=video</code>) or external (<code>type=ext</code>). Default is audio. The
437 master clock is used to control audio-video synchronization. Most media
438 players use audio as master clock, but in some cases (streaming or high
439 quality broadcast) it is necessary to change that. This option is mainly
440 used for debugging purposes.
442 <dt> ‘<samp>-threads <var>count</var></samp>’</dt>
443 <dd><p>Set the thread count.
445 <dt> ‘<samp>-ast <var>audio_stream_number</var></samp>’</dt>
446 <dd><p>Select the desired audio stream number, counting from 0. The number
447 refers to the list of all the input audio streams. If it is greater
448 than the number of audio streams minus one, then the last one is
449 selected, if it is negative the audio playback is disabled.
451 <dt> ‘<samp>-vst <var>video_stream_number</var></samp>’</dt>
452 <dd><p>Select the desired video stream number, counting from 0. The number
453 refers to the list of all the input video streams. If it is greater
454 than the number of video streams minus one, then the last one is
455 selected, if it is negative the video playback is disabled.
457 <dt> ‘<samp>-sst <var>subtitle_stream_number</var></samp>’</dt>
458 <dd><p>Select the desired subtitle stream number, counting from 0. The number
459 refers to the list of all the input subtitle streams. If it is greater
460 than the number of subtitle streams minus one, then the last one is
461 selected, if it is negative the subtitle rendering is disabled.
463 <dt> ‘<samp>-autoexit</samp>’</dt>
464 <dd><p>Exit when video is done playing.
466 <dt> ‘<samp>-exitonkeydown</samp>’</dt>
467 <dd><p>Exit if any key is pressed.
469 <dt> ‘<samp>-exitonmousedown</samp>’</dt>
470 <dd><p>Exit if any mouse button is pressed.
474 <a name="While-playing"></a>
475 <h2 class="section"><a href="ffplay.html#toc-While-playing">3.4 While playing</a></h2>
477 <dl compact="compact">
478 <dt> <q, ESC></dt>
483 <dd><p>Toggle full screen.
486 <dt> <p, SPC></dt>
491 <dd><p>Cycle audio channel.
495 <dd><p>Cycle video channel.
499 <dd><p>Cycle subtitle channel.
503 <dd><p>Show audio waves.
506 <dt> <left/right></dt>
507 <dd><p>Seek backward/forward 10 seconds.
510 <dt> <down/up></dt>
511 <dd><p>Seek backward/forward 1 minute.
514 <dt> <mouse click></dt>
515 <dd><p>Seek to percentage in file corresponding to fraction of width.
521 <a name="Expression-Evaluation"></a>
522 <h1 class="chapter"><a href="ffplay.html#toc-Expression-Evaluation">4. Expression Evaluation</a></h1>
524 <p>When evaluating an arithemetic expression, FFmpeg uses an internal
525 formula evaluator, implemented through the ‘<tt>libavutil/eval.h</tt>’
528 <p>An expression may contain unary, binary operators, constants, and
531 <p>Two expressions <var>expr1</var> and <var>expr2</var> can be combined to form
532 another expression "<var>expr1</var>;<var>expr2</var>".
533 <var>expr1</var> and <var>expr2</var> are evaluated in turn, and the new
534 expression evaluates to the value of <var>expr2</var>.
536 <p>The following binary operators are available: <code>+</code>, <code>-</code>,
537 <code>*</code>, <code>/</code>, <code>^</code>.
539 <p>The following unary operators are available: <code>+</code>, <code>-</code>.
541 <p>The following functions are available:
542 </p><dl compact="compact">
543 <dt> ‘<samp>sinh(x)</samp>’</dt>
544 <dt> ‘<samp>cosh(x)</samp>’</dt>
545 <dt> ‘<samp>tanh(x)</samp>’</dt>
546 <dt> ‘<samp>sin(x)</samp>’</dt>
547 <dt> ‘<samp>cos(x)</samp>’</dt>
548 <dt> ‘<samp>tan(x)</samp>’</dt>
549 <dt> ‘<samp>atan(x)</samp>’</dt>
550 <dt> ‘<samp>asin(x)</samp>’</dt>
551 <dt> ‘<samp>acos(x)</samp>’</dt>
552 <dt> ‘<samp>exp(x)</samp>’</dt>
553 <dt> ‘<samp>log(x)</samp>’</dt>
554 <dt> ‘<samp>abs(x)</samp>’</dt>
555 <dt> ‘<samp>squish(x)</samp>’</dt>
556 <dt> ‘<samp>gauss(x)</samp>’</dt>
557 <dt> ‘<samp>isnan(x)</samp>’</dt>
558 <dd><p>Return 1.0 if <var>x</var> is NAN, 0.0 otherwise.
561 <dt> ‘<samp>mod(x, y)</samp>’</dt>
562 <dt> ‘<samp>max(x, y)</samp>’</dt>
563 <dt> ‘<samp>min(x, y)</samp>’</dt>
564 <dt> ‘<samp>eq(x, y)</samp>’</dt>
565 <dt> ‘<samp>gte(x, y)</samp>’</dt>
566 <dt> ‘<samp>gt(x, y)</samp>’</dt>
567 <dt> ‘<samp>lte(x, y)</samp>’</dt>
568 <dt> ‘<samp>lt(x, y)</samp>’</dt>
569 <dt> ‘<samp>st(var, expr)</samp>’</dt>
570 <dd><p>Allow to store the value of the expression <var>expr</var> in an internal
571 variable. <var>var</var> specifies the number of the variable where to
572 store the value, and it is a value ranging from 0 to 9. The function
573 returns the value stored in the internal variable.
576 <dt> ‘<samp>ld(var)</samp>’</dt>
577 <dd><p>Allow to load the value of the internal variable with number
578 <var>var</var>, which was previosly stored with st(<var>var</var>, <var>expr</var>).
579 The function returns the loaded value.
582 <dt> ‘<samp>while(cond, expr)</samp>’</dt>
583 <dd><p>Evaluate expression <var>expr</var> while the expression <var>cond</var> is
584 non-zero, and returns the value of the last <var>expr</var> evaluation, or
585 NAN if <var>cond</var> was always false.
588 <dt> ‘<samp>ceil(expr)</samp>’</dt>
589 <dd><p>Round the value of expression <var>expr</var> upwards to the nearest
590 integer. For example, "ceil(1.5)" is "2.0".
593 <dt> ‘<samp>floor(expr)</samp>’</dt>
594 <dd><p>Round the value of expression <var>expr</var> downwards to the nearest
595 integer. For example, "floor(-1.5)" is "-2.0".
598 <dt> ‘<samp>trunc(expr)</samp>’</dt>
599 <dd><p>Round the value of expression <var>expr</var> towards zero to the nearest
600 integer. For example, "trunc(-1.5)" is "-1.0".
603 <dt> ‘<samp>sqrt(expr)</samp>’</dt>
604 <dd><p>Compute the square root of <var>expr</var>. This is equivalent to
605 "(<var>expr</var>)^.5".
608 <dt> ‘<samp>not(expr)</samp>’</dt>
609 <dd><p>Return 1.0 if <var>expr</var> is zero, 0.0 otherwise.
612 <dt> ‘<samp>pow(x, y)</samp>’</dt>
613 <dd><p>Compute the power of <var>x</var> elevated <var>y</var>, it is equivalent to
614 "(<var>x</var>)^(<var>y</var>)".
620 <p><code>*</code> works like AND
622 <p><code>+</code> works like OR
625 </p><table><tr><td> </td><td><pre class="example">if A then B else C
626 </pre></td></tr></table>
628 </p><table><tr><td> </td><td><pre class="example">A*B + not(A)*C
629 </pre></td></tr></table>
631 <p>In your C code, you can extend the list of unary and binary functions,
632 and define recognized constants, so that they are available for your
635 <p>The evaluator also recognizes the International System number
636 postfixes. If ’i’ is appended after the postfix, powers of 2 are used
637 instead of powers of 10. The ’B’ postfix multiplies the value for 8,
638 and can be appended after another postfix or used alone. This allows
639 using for example ’KB’, ’MiB’, ’G’ and ’B’ as postfix.
641 <p>Follows the list of available International System postfixes, with
642 indication of the corresponding powers of 10 and of 2.
643 </p><dl compact="compact">
644 <dt> ‘<samp>y</samp>’</dt>
647 <dt> ‘<samp>z</samp>’</dt>
650 <dt> ‘<samp>a</samp>’</dt>
653 <dt> ‘<samp>f</samp>’</dt>
656 <dt> ‘<samp>p</samp>’</dt>
659 <dt> ‘<samp>n</samp>’</dt>
662 <dt> ‘<samp>u</samp>’</dt>
665 <dt> ‘<samp>m</samp>’</dt>
668 <dt> ‘<samp>c</samp>’</dt>
671 <dt> ‘<samp>d</samp>’</dt>
674 <dt> ‘<samp>h</samp>’</dt>
677 <dt> ‘<samp>k</samp>’</dt>
680 <dt> ‘<samp>K</samp>’</dt>
683 <dt> ‘<samp>M</samp>’</dt>
686 <dt> ‘<samp>G</samp>’</dt>
689 <dt> ‘<samp>T</samp>’</dt>
692 <dt> ‘<samp>P</samp>’</dt>
695 <dt> ‘<samp>E</samp>’</dt>
698 <dt> ‘<samp>Z</samp>’</dt>
701 <dt> ‘<samp>Y</samp>’</dt>
706 <a name="Decoders"></a>
707 <h1 class="chapter"><a href="ffplay.html#toc-Decoders">5. Decoders</a></h1>
709 <p>Decoders are configured elements in FFmpeg which allow the decoding of
712 <p>When you configure your FFmpeg build, all the supported native decoders
713 are enabled by default. Decoders requiring an external library must be enabled
714 manually via the corresponding <code>--enable-lib</code> option. You can list all
715 available decoders using the configure option <code>--list-decoders</code>.
717 <p>You can disable all the decoders with the configure option
718 <code>--disable-decoders</code> and selectively enable / disable single decoders
719 with the options <code>--enable-decoder=<var>DECODER</var></code> /
720 <code>--disable-decoder=<var>DECODER</var></code>.
722 <p>The option <code>-codecs</code> of the ff* tools will display the list of
726 <a name="Video-Decoders"></a>
727 <h1 class="chapter"><a href="ffplay.html#toc-Video-Decoders">6. Video Decoders</a></h1>
729 <p>A description of some of the currently available video decoders
732 <a name="rawvideo"></a>
733 <h2 class="section"><a href="ffplay.html#toc-rawvideo">6.1 rawvideo</a></h2>
737 <p>This decoder decodes rawvideo streams.
739 <a name="Options-1"></a>
740 <h3 class="subsection"><a href="ffplay.html#toc-Options-1">6.1.1 Options</a></h3>
742 <dl compact="compact">
743 <dt> ‘<samp>top <var>top_field_first</var></samp>’</dt>
744 <dd><p>Specify the assumed field type of the input video.
745 </p><dl compact="compact">
746 <dt> ‘<samp>-1</samp>’</dt>
747 <dd><p>the video is assumed to be progressive (default)
749 <dt> ‘<samp>0</samp>’</dt>
750 <dd><p>bottom-field-first is assumed
752 <dt> ‘<samp>1</samp>’</dt>
753 <dd><p>top-field-first is assumed
760 <a name="Demuxers"></a>
761 <h1 class="chapter"><a href="ffplay.html#toc-Demuxers">7. Demuxers</a></h1>
763 <p>Demuxers are configured elements in FFmpeg which allow to read the
764 multimedia streams from a particular type of file.
766 <p>When you configure your FFmpeg build, all the supported demuxers
767 are enabled by default. You can list all available ones using the
768 configure option "–list-demuxers".
770 <p>You can disable all the demuxers using the configure option
771 "–disable-demuxers", and selectively enable a single demuxer with
772 the option "–enable-demuxer=<var>DEMUXER</var>", or disable it
773 with the option "–disable-demuxer=<var>DEMUXER</var>".
775 <p>The option "-formats" of the ff* tools will display the list of
778 <p>The description of some of the currently available demuxers follows.
780 <a name="image2-1"></a>
781 <h2 class="section"><a href="ffplay.html#toc-image2-1">7.1 image2</a></h2>
783 <p>Image file demuxer.
785 <p>This demuxer reads from a list of image files specified by a pattern.
787 <p>The pattern may contain the string "%d" or "%0<var>N</var>d", which
788 specifies the position of the characters representing a sequential
789 number in each filename matched by the pattern. If the form
790 "%d0<var>N</var>d" is used, the string representing the number in each
791 filename is 0-padded and <var>N</var> is the total number of 0-padded
792 digits representing the number. The literal character ’%’ can be
793 specified in the pattern with the string "%%".
795 <p>If the pattern contains "%d" or "%0<var>N</var>d", the first filename of
796 the file list specified by the pattern must contain a number
797 inclusively contained between 0 and 4, all the following numbers must
798 be sequential. This limitation may be hopefully fixed.
800 <p>The pattern may contain a suffix which is used to automatically
801 determine the format of the images contained in the files.
803 <p>For example the pattern "img-%03d.bmp" will match a sequence of
804 filenames of the form ‘<tt>img-001.bmp</tt>’, ‘<tt>img-002.bmp</tt>’, ...,
805 ‘<tt>img-010.bmp</tt>’, etc.; the pattern "i%%m%%g-%d.jpg" will match a
806 sequence of filenames of the form ‘<tt>i%m%g-1.jpg</tt>’,
807 ‘<tt>i%m%g-2.jpg</tt>’, ..., ‘<tt>i%m%g-10.jpg</tt>’, etc.
809 <p>The size, the pixel format, and the format of each image must be the
810 same for all the files in the sequence.
812 <p>The following example shows how to use ‘<tt>ffmpeg</tt>’ for creating a
813 video from the images in the file sequence ‘<tt>img-001.jpeg</tt>’,
814 ‘<tt>img-002.jpeg</tt>’, ..., assuming an input framerate of 10 frames per
816 </p><table><tr><td> </td><td><pre class="example">ffmpeg -r 10 -f image2 -i 'img-%03d.jpeg' out.avi
817 </pre></td></tr></table>
819 <p>Note that the pattern must not necessarily contain "%d" or
820 "%0<var>N</var>d", for example to convert a single image file
821 ‘<tt>img.jpeg</tt>’ you can employ the command:
822 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f image2 -i img.jpeg img.png
823 </pre></td></tr></table>
825 <a name="applehttp"></a>
826 <h2 class="section"><a href="ffplay.html#toc-applehttp">7.2 applehttp</a></h2>
828 <p>Apple HTTP Live Streaming demuxer.
830 <p>This demuxer presents all AVStreams from all variant streams.
831 The id field is set to the bitrate variant index number. By setting
832 the discard flags on AVStreams (by pressing ’a’ or ’v’ in ffplay),
833 the caller can decide which variant streams to actually receive.
834 The total bitrate of the variant that the stream belongs to is
835 available in a metadata key named "variant_bitrate".
837 <a name="Muxers"></a>
838 <h1 class="chapter"><a href="ffplay.html#toc-Muxers">8. Muxers</a></h1>
840 <p>Muxers are configured elements in FFmpeg which allow writing
841 multimedia streams to a particular type of file.
843 <p>When you configure your FFmpeg build, all the supported muxers
844 are enabled by default. You can list all available muxers using the
845 configure option <code>--list-muxers</code>.
847 <p>You can disable all the muxers with the configure option
848 <code>--disable-muxers</code> and selectively enable / disable single muxers
849 with the options <code>--enable-muxer=<var>MUXER</var></code> /
850 <code>--disable-muxer=<var>MUXER</var></code>.
852 <p>The option <code>-formats</code> of the ff* tools will display the list of
855 <p>A description of some of the currently available muxers follows.
857 <p><a name="crc"></a>
858 </p><a name="crc-1"></a>
859 <h2 class="section"><a href="ffplay.html#toc-crc-1">8.1 crc</a></h2>
861 <p>CRC (Cyclic Redundancy Check) testing format.
863 <p>This muxer computes and prints the Adler-32 CRC of all the input audio
864 and video frames. By default audio frames are converted to signed
865 16-bit raw audio and video frames to raw video before computing the
868 <p>The output of the muxer consists of a single line of the form:
869 CRC=0x<var>CRC</var>, where <var>CRC</var> is a hexadecimal number 0-padded to
870 8 digits containing the CRC for all the decoded input frames.
872 <p>For example to compute the CRC of the input, and store it in the file
873 ‘<tt>out.crc</tt>’:
874 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -f crc out.crc
875 </pre></td></tr></table>
877 <p>You can print the CRC to stdout with the command:
878 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -f crc -
879 </pre></td></tr></table>
881 <p>You can select the output format of each frame with ‘<tt>ffmpeg</tt>’ by
882 specifying the audio and video codec and format. For example to
883 compute the CRC of the input audio converted to PCM unsigned 8-bit
884 and the input video converted to MPEG-2 video, use the command:
885 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -acodec pcm_u8 -vcodec mpeg2video -f crc -
886 </pre></td></tr></table>
888 <p>See also the <code>framecrc</code> muxer (see <a href="#framecrc">framecrc</a>).
890 <p><a name="framecrc"></a>
891 </p><a name="framecrc-1"></a>
892 <h2 class="section"><a href="ffplay.html#toc-framecrc-1">8.2 framecrc</a></h2>
894 <p>Per-frame CRC (Cyclic Redundancy Check) testing format.
896 <p>This muxer computes and prints the Adler-32 CRC for each decoded audio
897 and video frame. By default audio frames are converted to signed
898 16-bit raw audio and video frames to raw video before computing the
901 <p>The output of the muxer consists of a line for each audio and video
902 frame of the form: <var>stream_index</var>, <var>frame_dts</var>,
903 <var>frame_size</var>, 0x<var>CRC</var>, where <var>CRC</var> is a hexadecimal
904 number 0-padded to 8 digits containing the CRC of the decoded frame.
906 <p>For example to compute the CRC of each decoded frame in the input, and
907 store it in the file ‘<tt>out.crc</tt>’:
908 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -f framecrc out.crc
909 </pre></td></tr></table>
911 <p>You can print the CRC of each decoded frame to stdout with the command:
912 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -f framecrc -
913 </pre></td></tr></table>
915 <p>You can select the output format of each frame with ‘<tt>ffmpeg</tt>’ by
916 specifying the audio and video codec and format. For example, to
917 compute the CRC of each decoded input audio frame converted to PCM
918 unsigned 8-bit and of each decoded input video frame converted to
919 MPEG-2 video, use the command:
920 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -acodec pcm_u8 -vcodec mpeg2video -f framecrc -
921 </pre></td></tr></table>
923 <p>See also the <code>crc</code> muxer (see <a href="#crc">crc</a>).
925 <a name="image2"></a>
926 <h2 class="section"><a href="ffplay.html#toc-image2">8.3 image2</a></h2>
930 <p>The image file muxer writes video frames to image files.
932 <p>The output filenames are specified by a pattern, which can be used to
933 produce sequentially numbered series of files.
934 The pattern may contain the string "%d" or "%0<var>N</var>d", this string
935 specifies the position of the characters representing a numbering in
936 the filenames. If the form "%0<var>N</var>d" is used, the string
937 representing the number in each filename is 0-padded to <var>N</var>
938 digits. The literal character ’%’ can be specified in the pattern with
939 the string "%%".
941 <p>If the pattern contains "%d" or "%0<var>N</var>d", the first filename of
942 the file list specified will contain the number 1, all the following
943 numbers will be sequential.
945 <p>The pattern may contain a suffix which is used to automatically
946 determine the format of the image files to write.
948 <p>For example the pattern "img-%03d.bmp" will specify a sequence of
949 filenames of the form ‘<tt>img-001.bmp</tt>’, ‘<tt>img-002.bmp</tt>’, ...,
950 ‘<tt>img-010.bmp</tt>’, etc.
951 The pattern "img%%-%d.jpg" will specify a sequence of filenames of the
952 form ‘<tt>img%-1.jpg</tt>’, ‘<tt>img%-2.jpg</tt>’, ..., ‘<tt>img%-10.jpg</tt>’,
955 <p>The following example shows how to use ‘<tt>ffmpeg</tt>’ for creating a
956 sequence of files ‘<tt>img-001.jpeg</tt>’, ‘<tt>img-002.jpeg</tt>’, ...,
957 taking one image every second from the input video:
958 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i in.avi -r 1 -f image2 'img-%03d.jpeg'
959 </pre></td></tr></table>
961 <p>Note that with ‘<tt>ffmpeg</tt>’, if the format is not specified with the
962 <code>-f</code> option and the output filename specifies an image file
963 format, the image2 muxer is automatically selected, so the previous
964 command can be written as:
965 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i in.avi -r 1 'img-%03d.jpeg'
966 </pre></td></tr></table>
968 <p>Note also that the pattern must not necessarily contain "%d" or
969 "%0<var>N</var>d", for example to create a single image file
970 ‘<tt>img.jpeg</tt>’ from the input video you can employ the command:
971 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i in.avi -f image2 -vframes 1 img.jpeg
972 </pre></td></tr></table>
974 <p>The image muxer supports the .Y.U.V image file format. This format is
975 special in that that each image frame consists of three files, for
976 each of the YUV420P components. To read or write this image file format,
977 specify the name of the ’.Y’ file. The muxer will automatically open the
978 ’.U’ and ’.V’ files as required.
980 <a name="mpegts"></a>
981 <h2 class="section"><a href="ffplay.html#toc-mpegts">8.4 mpegts</a></h2>
983 <p>MPEG transport stream muxer.
985 <p>This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
987 <p>The muxer options are:
989 <dl compact="compact">
990 <dt> ‘<samp>-mpegts_original_network_id <var>number</var></samp>’</dt>
991 <dd><p>Set the original_network_id (default 0x0001). This is unique identifier
992 of a network in DVB. Its main use is in the unique identification of a
993 service through the path Original_Network_ID, Transport_Stream_ID.
995 <dt> ‘<samp>-mpegts_transport_stream_id <var>number</var></samp>’</dt>
996 <dd><p>Set the transport_stream_id (default 0x0001). This identifies a
999 <dt> ‘<samp>-mpegts_service_id <var>number</var></samp>’</dt>
1000 <dd><p>Set the service_id (default 0x0001) also known as program in DVB.
1002 <dt> ‘<samp>-mpegts_pmt_start_pid <var>number</var></samp>’</dt>
1003 <dd><p>Set the first PID for PMT (default 0x1000, max 0x1f00).
1005 <dt> ‘<samp>-mpegts_start_pid <var>number</var></samp>’</dt>
1006 <dd><p>Set the first PID for data packets (default 0x0100, max 0x0f00).
1010 <p>The recognized metadata settings in mpegts muxer are <code>service_provider</code>
1011 and <code>service_name</code>. If they are not set the default for
1012 <code>service_provider</code> is "FFmpeg" and the default for
1013 <code>service_name</code> is "Service01".
1015 <table><tr><td> </td><td><pre class="example">ffmpeg -i file.mpg -acodec copy -vcodec copy \
1016 -mpegts_original_network_id 0x1122 \
1017 -mpegts_transport_stream_id 0x3344 \
1018 -mpegts_service_id 0x5566 \
1019 -mpegts_pmt_start_pid 0x1500 \
1020 -mpegts_start_pid 0x150 \
1021 -metadata service_provider="Some provider" \
1022 -metadata service_name="Some Channel" \
1024 </pre></td></tr></table>
1027 <h2 class="section"><a href="ffplay.html#toc-null">8.5 null</a></h2>
1031 <p>This muxer does not generate any output file, it is mainly useful for
1032 testing or benchmarking purposes.
1034 <p>For example to benchmark decoding with ‘<tt>ffmpeg</tt>’ you can use the
1036 </p><table><tr><td> </td><td><pre class="example">ffmpeg -benchmark -i INPUT -f null out.null
1037 </pre></td></tr></table>
1039 <p>Note that the above command does not read or write the ‘<tt>out.null</tt>’
1040 file, but specifying the output file is required by the ‘<tt>ffmpeg</tt>’
1043 <p>Alternatively you can write the command as:
1044 </p><table><tr><td> </td><td><pre class="example">ffmpeg -benchmark -i INPUT -f null -
1045 </pre></td></tr></table>
1047 <a name="matroska"></a>
1048 <h2 class="section"><a href="ffplay.html#toc-matroska">8.6 matroska</a></h2>
1050 <p>Matroska container muxer.
1052 <p>This muxer implements the matroska and webm container specs.
1054 <p>The recognized metadata settings in this muxer are:
1056 <dl compact="compact">
1057 <dt> ‘<samp>title=<var>title name</var></samp>’</dt>
1058 <dd><p>Name provided to a single track
1062 <dl compact="compact">
1063 <dt> ‘<samp>language=<var>language name</var></samp>’</dt>
1064 <dd><p>Specifies the language of the track in the Matroska languages form
1068 <dl compact="compact">
1069 <dt> ‘<samp>stereo_mode=<var>mode</var></samp>’</dt>
1070 <dd><p>Stereo 3D video layout of two views in a single video track
1071 </p><dl compact="compact">
1072 <dt> ‘<samp>mono</samp>’</dt>
1073 <dd><p>video is not stereo
1075 <dt> ‘<samp>left_right</samp>’</dt>
1076 <dd><p>Both views are arranged side by side, Left-eye view is on the left
1078 <dt> ‘<samp>bottom_top</samp>’</dt>
1079 <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is at bottom
1081 <dt> ‘<samp>top_bottom</samp>’</dt>
1082 <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is on top
1084 <dt> ‘<samp>checkerboard_rl</samp>’</dt>
1085 <dd><p>Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
1087 <dt> ‘<samp>checkerboard_lr</samp>’</dt>
1088 <dd><p>Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
1090 <dt> ‘<samp>row_interleaved_rl</samp>’</dt>
1091 <dd><p>Each view is constituted by a row based interleaving, Right-eye view is first row
1093 <dt> ‘<samp>row_interleaved_lr</samp>’</dt>
1094 <dd><p>Each view is constituted by a row based interleaving, Left-eye view is first row
1096 <dt> ‘<samp>col_interleaved_rl</samp>’</dt>
1097 <dd><p>Both views are arranged in a column based interleaving manner, Right-eye view is first column
1099 <dt> ‘<samp>col_interleaved_lr</samp>’</dt>
1100 <dd><p>Both views are arranged in a column based interleaving manner, Left-eye view is first column
1102 <dt> ‘<samp>anaglyph_cyan_red</samp>’</dt>
1103 <dd><p>All frames are in anaglyph format viewable through red-cyan filters
1105 <dt> ‘<samp>right_left</samp>’</dt>
1106 <dd><p>Both views are arranged side by side, Right-eye view is on the left
1108 <dt> ‘<samp>anaglyph_green_magenta</samp>’</dt>
1109 <dd><p>All frames are in anaglyph format viewable through green-magenta filters
1111 <dt> ‘<samp>block_lr</samp>’</dt>
1112 <dd><p>Both eyes laced in one Block, Left-eye view is first
1114 <dt> ‘<samp>block_rl</samp>’</dt>
1115 <dd><p>Both eyes laced in one Block, Right-eye view is first
1121 <p>For example a 3D WebM clip can be created using the following command line:
1122 </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
1123 </pre></td></tr></table>
1125 <a name="Input-Devices"></a>
1126 <h1 class="chapter"><a href="ffplay.html#toc-Input-Devices">9. Input Devices</a></h1>
1128 <p>Input devices are configured elements in FFmpeg which allow to access
1129 the data coming from a multimedia device attached to your system.
1131 <p>When you configure your FFmpeg build, all the supported input devices
1132 are enabled by default. You can list all available ones using the
1133 configure option "–list-indevs".
1135 <p>You can disable all the input devices using the configure option
1136 "–disable-indevs", and selectively enable an input device using the
1137 option "–enable-indev=<var>INDEV</var>", or you can disable a particular
1138 input device using the option "–disable-indev=<var>INDEV</var>".
1140 <p>The option "-formats" of the ff* tools will display the list of
1141 supported input devices (amongst the demuxers).
1143 <p>A description of the currently available input devices follows.
1146 <h2 class="section"><a href="ffplay.html#toc-alsa">9.1 alsa</a></h2>
1148 <p>ALSA (Advanced Linux Sound Architecture) input device.
1150 <p>To enable this input device during configuration you need libasound
1151 installed on your system.
1153 <p>This device allows capturing from an ALSA device. The name of the
1154 device to capture has to be an ALSA card identifier.
1156 <p>An ALSA identifier has the syntax:
1157 </p><table><tr><td> </td><td><pre class="example">hw:<var>CARD</var>[,<var>DEV</var>[,<var>SUBDEV</var>]]
1158 </pre></td></tr></table>
1160 <p>where the <var>DEV</var> and <var>SUBDEV</var> components are optional.
1162 <p>The three arguments (in order: <var>CARD</var>,<var>DEV</var>,<var>SUBDEV</var>)
1163 specify card number or identifier, device number and subdevice number
1166 <p>To see the list of cards currently recognized by your system check the
1167 files ‘<tt>/proc/asound/cards</tt>’ and ‘<tt>/proc/asound/devices</tt>’.
1169 <p>For example to capture with ‘<tt>ffmpeg</tt>’ from an ALSA device with
1170 card id 0, you may run the command:
1171 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f alsa -i hw:0 alsaout.wav
1172 </pre></td></tr></table>
1174 <p>For more information see:
1175 <a href="http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html">http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html</a>
1178 <h2 class="section"><a href="ffplay.html#toc-bktr">9.2 bktr</a></h2>
1180 <p>BSD video input device.
1182 <a name="dv1394"></a>
1183 <h2 class="section"><a href="ffplay.html#toc-dv1394">9.3 dv1394</a></h2>
1185 <p>Linux DV 1394 input device.
1187 <a name="fbdev"></a>
1188 <h2 class="section"><a href="ffplay.html#toc-fbdev">9.4 fbdev</a></h2>
1190 <p>Linux framebuffer input device.
1192 <p>The Linux framebuffer is a graphic hardware-independent abstraction
1193 layer to show graphics on a computer monitor, typically on the
1194 console. It is accessed through a file device node, usually
1195 ‘<tt>/dev/fb0</tt>’.
1197 <p>For more detailed information read the file
1198 Documentation/fb/framebuffer.txt included in the Linux source tree.
1200 <p>To record from the framebuffer device ‘<tt>/dev/fb0</tt>’ with
1201 ‘<tt>ffmpeg</tt>’:
1202 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
1203 </pre></td></tr></table>
1205 <p>You can take a single screenshot image with the command:
1206 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f fbdev -vframes 1 -r 1 -i /dev/fb0 screenshot.jpeg
1207 </pre></td></tr></table>
1209 <p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
1212 <h2 class="section"><a href="ffplay.html#toc-jack">9.5 jack</a></h2>
1214 <p>JACK input device.
1216 <p>To enable this input device during configuration you need libjack
1217 installed on your system.
1219 <p>A JACK input device creates one or more JACK writable clients, one for
1220 each audio channel, with name <var>client_name</var>:input_<var>N</var>, where
1221 <var>client_name</var> is the name provided by the application, and <var>N</var>
1222 is a number which identifies the channel.
1223 Each writable client will send the acquired data to the FFmpeg input
1226 <p>Once you have created one or more JACK readable clients, you need to
1227 connect them to one or more JACK writable clients.
1229 <p>To connect or disconnect JACK clients you can use the
1230 ‘<tt>jack_connect</tt>’ and ‘<tt>jack_disconnect</tt>’ programs, or do it
1231 through a graphical interface, for example with ‘<tt>qjackctl</tt>’.
1233 <p>To list the JACK clients and their properties you can invoke the command
1234 ‘<tt>jack_lsp</tt>’.
1236 <p>Follows an example which shows how to capture a JACK readable client
1237 with ‘<tt>ffmpeg</tt>’.
1238 </p><table><tr><td> </td><td><pre class="example"># Create a JACK writable client with name "ffmpeg".
1239 $ ffmpeg -f jack -i ffmpeg -y out.wav
1241 # Start the sample jack_metro readable client.
1242 $ jack_metro -b 120 -d 0.2 -f 4000
1244 # List the current JACK clients.
1253 # Connect metro to the ffmpeg writable client.
1254 $ jack_connect metro:120_bpm ffmpeg:input_1
1255 </pre></td></tr></table>
1257 <p>For more information read:
1258 <a href="http://jackaudio.org/">http://jackaudio.org/</a>
1260 <a name="libdc1394"></a>
1261 <h2 class="section"><a href="ffplay.html#toc-libdc1394">9.6 libdc1394</a></h2>
1263 <p>IIDC1394 input device, based on libdc1394 and libraw1394.
1266 <h2 class="section"><a href="ffplay.html#toc-oss">9.7 oss</a></h2>
1268 <p>Open Sound System input device.
1270 <p>The filename to provide to the input device is the device node
1271 representing the OSS input device, and is usually set to
1272 ‘<tt>/dev/dsp</tt>’.
1274 <p>For example to grab from ‘<tt>/dev/dsp</tt>’ using ‘<tt>ffmpeg</tt>’ use the
1276 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
1277 </pre></td></tr></table>
1279 <p>For more information about OSS see:
1280 <a href="http://manuals.opensound.com/usersguide/dsp.html">http://manuals.opensound.com/usersguide/dsp.html</a>
1282 <a name="sndio"></a>
1283 <h2 class="section"><a href="ffplay.html#toc-sndio">9.8 sndio</a></h2>
1285 <p>sndio input device.
1287 <p>To enable this input device during configuration you need libsndio
1288 installed on your system.
1290 <p>The filename to provide to the input device is the device node
1291 representing the sndio input device, and is usually set to
1292 ‘<tt>/dev/audio0</tt>’.
1294 <p>For example to grab from ‘<tt>/dev/audio0</tt>’ using ‘<tt>ffmpeg</tt>’ use the
1296 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
1297 </pre></td></tr></table>
1299 <a name="video4linux-and-video4linux2"></a>
1300 <h2 class="section"><a href="ffplay.html#toc-video4linux-and-video4linux2">9.9 video4linux and video4linux2</a></h2>
1302 <p>Video4Linux and Video4Linux2 input video devices.
1304 <p>The name of the device to grab is a file device node, usually Linux
1305 systems tend to automatically create such nodes when the device
1306 (e.g. an USB webcam) is plugged into the system, and has a name of the
1307 kind ‘<tt>/dev/video<var>N</var></tt>’, where <var>N</var> is a number associated to
1310 <p>Video4Linux and Video4Linux2 devices only support a limited set of
1311 <var>width</var>x<var>height</var> sizes and framerates. You can check which are
1312 supported for example with the command ‘<tt>dov4l</tt>’ for Video4Linux
1313 devices and the command ‘<tt>v4l-info</tt>’ for Video4Linux2 devices.
1315 <p>If the size for the device is set to 0x0, the input device will
1316 try to autodetect the size to use.
1317 Only for the video4linux2 device, if the frame rate is set to 0/0 the
1318 input device will use the frame rate value already set in the driver.
1320 <p>Video4Linux support is deprecated since Linux 2.6.30, and will be
1321 dropped in later versions.
1323 <p>Follow some usage examples of the video4linux devices with the ff*
1325 </p><table><tr><td> </td><td><pre class="example"># Grab and show the input of a video4linux device, frame rate is set
1326 # to the default of 25/1.
1327 ffplay -s 320x240 -f video4linux /dev/video0
1329 # Grab and show the input of a video4linux2 device, autoadjust size.
1330 ffplay -f video4linux2 /dev/video0
1332 # Grab and record the input of a video4linux2 device, autoadjust size,
1333 # frame rate value defaults to 0/0 so it is read from the video4linux2
1335 ffmpeg -f video4linux2 -i /dev/video0 out.mpeg
1336 </pre></td></tr></table>
1338 <a name="vfwcap"></a>
1339 <h2 class="section"><a href="ffplay.html#toc-vfwcap">9.10 vfwcap</a></h2>
1341 <p>VfW (Video for Windows) capture input device.
1343 <p>The filename passed as input is the capture driver number, ranging from
1344 0 to 9. You may use "list" as filename to print a list of drivers. Any
1345 other filename will be interpreted as device number 0.
1347 <a name="x11grab"></a>
1348 <h2 class="section"><a href="ffplay.html#toc-x11grab">9.11 x11grab</a></h2>
1350 <p>X11 video input device.
1352 <p>This device allows to capture a region of an X11 display.
1354 <p>The filename passed as input has the syntax:
1355 </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>]
1356 </pre></td></tr></table>
1358 <p><var>hostname</var>:<var>display_number</var>.<var>screen_number</var> specifies the
1359 X11 display name of the screen to grab from. <var>hostname</var> can be
1360 ommitted, and defaults to "localhost". The environment variable
1361 <code>DISPLAY</code> contains the default display name.
1363 <p><var>x_offset</var> and <var>y_offset</var> specify the offsets of the grabbed
1364 area with respect to the top-left border of the X11 screen. They
1367 <p>Check the X11 documentation (e.g. man X) for more detailed information.
1369 <p>Use the ‘<tt>dpyinfo</tt>’ program for getting basic information about the
1370 properties of your X11 display (e.g. grep for "name" or "dimensions").
1372 <p>For example to grab from ‘<tt>:0.0</tt>’ using ‘<tt>ffmpeg</tt>’:
1373 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpg
1375 # Grab at position 10,20.
1376 ffmpeg -f x11grab -25 -s cif -i :0.0+10,20 out.mpg
1377 </pre></td></tr></table>
1379 <a name="Output-Devices"></a>
1380 <h1 class="chapter"><a href="ffplay.html#toc-Output-Devices">10. Output Devices</a></h1>
1382 <p>Output devices are configured elements in FFmpeg which allow to write
1383 multimedia data to an output device attached to your system.
1385 <p>When you configure your FFmpeg build, all the supported output devices
1386 are enabled by default. You can list all available ones using the
1387 configure option "–list-outdevs".
1389 <p>You can disable all the output devices using the configure option
1390 "–disable-outdevs", and selectively enable an output device using the
1391 option "–enable-outdev=<var>OUTDEV</var>", or you can disable a particular
1392 input device using the option "–disable-outdev=<var>OUTDEV</var>".
1394 <p>The option "-formats" of the ff* tools will display the list of
1395 enabled output devices (amongst the muxers).
1397 <p>A description of the currently available output devices follows.
1399 <a name="alsa-1"></a>
1400 <h2 class="section"><a href="ffplay.html#toc-alsa-1">10.1 alsa</a></h2>
1402 <p>ALSA (Advanced Linux Sound Architecture) output device.
1404 <a name="oss-1"></a>
1405 <h2 class="section"><a href="ffplay.html#toc-oss-1">10.2 oss</a></h2>
1407 <p>OSS (Open Sound System) output device.
1410 <h2 class="section"><a href="ffplay.html#toc-sdl">10.3 sdl</a></h2>
1412 <p>SDL (Simple Directmedia Layer) output device.
1414 <p>This output devices allows to show a video stream in an SDL
1415 window. Only one SDL window is allowed per application, so you can
1416 have only one instance of this output device in an application.
1418 <p>To enable this output device you need libsdl installed on your system
1419 when configuring your build.
1421 <p>For more information about SDL, check:
1422 <a href="http://www.libsdl.org/">http://www.libsdl.org/</a>
1424 <a name="Options"></a>
1425 <h3 class="subsection"><a href="ffplay.html#toc-Options">10.3.1 Options</a></h3>
1427 <dl compact="compact">
1428 <dt> ‘<samp>window_title</samp>’</dt>
1429 <dd><p>Set the SDL window title, if not specified default to the filename
1430 specified for the output device.
1433 <dt> ‘<samp>icon_title</samp>’</dt>
1434 <dd><p>Set the name of the iconified SDL window, if not specified it is set
1435 to the same value of <var>window_title</var>.
1438 <dt> ‘<samp>window_size</samp>’</dt>
1439 <dd><p>Set the SDL window size, can be a string of the form
1440 <var>width</var>x<var>height</var> or a video size abbreviation.
1441 If not specified it defaults to the size of the input video.
1445 <a name="Examples"></a>
1446 <h3 class="subsection"><a href="ffplay.html#toc-Examples">10.3.2 Examples</a></h3>
1448 <p>The following command shows the ‘<tt>ffmpeg</tt>’ output is an
1449 SDL window, forcing its size to the qcif format:
1450 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -vcodec rawvideo -pix_fmt yuv420p -window_size qcif -f sdl "SDL output"
1451 </pre></td></tr></table>
1453 <a name="sndio-1"></a>
1454 <h2 class="section"><a href="ffplay.html#toc-sndio-1">10.4 sndio</a></h2>
1456 <p>sndio audio output device.
1458 <a name="Protocols"></a>
1459 <h1 class="chapter"><a href="ffplay.html#toc-Protocols">11. Protocols</a></h1>
1461 <p>Protocols are configured elements in FFmpeg which allow to access
1462 resources which require the use of a particular protocol.
1464 <p>When you configure your FFmpeg build, all the supported protocols are
1465 enabled by default. You can list all available ones using the
1466 configure option "–list-protocols".
1468 <p>You can disable all the protocols using the configure option
1469 "–disable-protocols", and selectively enable a protocol using the
1470 option "–enable-protocol=<var>PROTOCOL</var>", or you can disable a
1471 particular protocol using the option
1472 "–disable-protocol=<var>PROTOCOL</var>".
1474 <p>The option "-protocols" of the ff* tools will display the list of
1475 supported protocols.
1477 <p>A description of the currently available protocols follows.
1479 <a name="applehttp-1"></a>
1480 <h2 class="section"><a href="ffplay.html#toc-applehttp-1">11.1 applehttp</a></h2>
1482 <p>Read Apple HTTP Live Streaming compliant segmented stream as
1483 a uniform one. The M3U8 playlists describing the segments can be
1484 remote HTTP resources or local files, accessed using the standard
1486 HTTP is default, specific protocol can be declared by specifying
1487 "+<var>proto</var>" after the applehttp URI scheme name, where <var>proto</var>
1488 is either "file" or "http".
1490 <table><tr><td> </td><td><pre class="example">applehttp://host/path/to/remote/resource.m3u8
1491 applehttp+http://host/path/to/remote/resource.m3u8
1492 applehttp+file://path/to/local/resource.m3u8
1493 </pre></td></tr></table>
1495 <a name="concat"></a>
1496 <h2 class="section"><a href="ffplay.html#toc-concat">11.2 concat</a></h2>
1498 <p>Physical concatenation protocol.
1500 <p>Allow to read and seek from many resource in sequence as if they were
1503 <p>A URL accepted by this protocol has the syntax:
1504 </p><table><tr><td> </td><td><pre class="example">concat:<var>URL1</var>|<var>URL2</var>|...|<var>URLN</var>
1505 </pre></td></tr></table>
1507 <p>where <var>URL1</var>, <var>URL2</var>, ..., <var>URLN</var> are the urls of the
1508 resource to be concatenated, each one possibly specifying a distinct
1511 <p>For example to read a sequence of files ‘<tt>split1.mpeg</tt>’,
1512 ‘<tt>split2.mpeg</tt>’, ‘<tt>split3.mpeg</tt>’ with ‘<tt>ffplay</tt>’ use the
1514 </p><table><tr><td> </td><td><pre class="example">ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
1515 </pre></td></tr></table>
1517 <p>Note that you may need to escape the character "|" which is special for
1521 <h2 class="section"><a href="ffplay.html#toc-file">11.3 file</a></h2>
1523 <p>File access protocol.
1525 <p>Allow to read from or read to a file.
1527 <p>For example to read from a file ‘<tt>input.mpeg</tt>’ with ‘<tt>ffmpeg</tt>’
1529 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i file:input.mpeg output.mpeg
1530 </pre></td></tr></table>
1532 <p>The ff* tools default to the file protocol, that is a resource
1533 specified with the name "FILE.mpeg" is interpreted as the URL
1534 "file:FILE.mpeg".
1536 <a name="gopher"></a>
1537 <h2 class="section"><a href="ffplay.html#toc-gopher">11.4 gopher</a></h2>
1542 <h2 class="section"><a href="ffplay.html#toc-http">11.5 http</a></h2>
1544 <p>HTTP (Hyper Text Transfer Protocol).
1547 <h2 class="section"><a href="ffplay.html#toc-mmst">11.6 mmst</a></h2>
1549 <p>MMS (Microsoft Media Server) protocol over TCP.
1552 <h2 class="section"><a href="ffplay.html#toc-mmsh">11.7 mmsh</a></h2>
1554 <p>MMS (Microsoft Media Server) protocol over HTTP.
1556 <p>The required syntax is:
1557 </p><table><tr><td> </td><td><pre class="example">mmsh://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
1558 </pre></td></tr></table>
1561 <h2 class="section"><a href="ffplay.html#toc-md5">11.8 md5</a></h2>
1563 <p>MD5 output protocol.
1565 <p>Computes the MD5 hash of the data to be written, and on close writes
1566 this to the designated output or stdout if none is specified. It can
1567 be used to test muxers without writing an actual file.
1569 <p>Some examples follow.
1570 </p><table><tr><td> </td><td><pre class="example"># Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
1571 ffmpeg -i input.flv -f avi -y md5:output.avi.md5
1573 # Write the MD5 hash of the encoded AVI file to stdout.
1574 ffmpeg -i input.flv -f avi -y md5:
1575 </pre></td></tr></table>
1577 <p>Note that some formats (typically MOV) require the output protocol to
1578 be seekable, so they will fail with the MD5 output protocol.
1581 <h2 class="section"><a href="ffplay.html#toc-pipe">11.9 pipe</a></h2>
1583 <p>UNIX pipe access protocol.
1585 <p>Allow to read and write from UNIX pipes.
1587 <p>The accepted syntax is:
1588 </p><table><tr><td> </td><td><pre class="example">pipe:[<var>number</var>]
1589 </pre></td></tr></table>
1591 <p><var>number</var> is the number corresponding to the file descriptor of the
1592 pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If <var>number</var>
1593 is not specified, by default the stdout file descriptor will be used
1594 for writing, stdin for reading.
1596 <p>For example to read from stdin with ‘<tt>ffmpeg</tt>’:
1597 </p><table><tr><td> </td><td><pre class="example">cat test.wav | ffmpeg -i pipe:0
1598 # ...this is the same as...
1599 cat test.wav | ffmpeg -i pipe:
1600 </pre></td></tr></table>
1602 <p>For writing to stdout with ‘<tt>ffmpeg</tt>’:
1603 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi
1604 # ...this is the same as...
1605 ffmpeg -i test.wav -f avi pipe: | cat > test.avi
1606 </pre></td></tr></table>
1608 <p>Note that some formats (typically MOV), require the output protocol to
1609 be seekable, so they will fail with the pipe output protocol.
1612 <h2 class="section"><a href="ffplay.html#toc-rtmp">11.10 rtmp</a></h2>
1614 <p>Real-Time Messaging Protocol.
1616 <p>The Real-Time Messaging Protocol (RTMP) is used for streaming multime‐
1617 dia content across a TCP/IP network.
1619 <p>The required syntax is:
1620 </p><table><tr><td> </td><td><pre class="example">rtmp://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
1621 </pre></td></tr></table>
1623 <p>The accepted parameters are:
1624 </p><dl compact="compact">
1625 <dt> ‘<samp>server</samp>’</dt>
1626 <dd><p>The address of the RTMP server.
1629 <dt> ‘<samp>port</samp>’</dt>
1630 <dd><p>The number of the TCP port to use (by default is 1935).
1633 <dt> ‘<samp>app</samp>’</dt>
1634 <dd><p>It is the name of the application to access. It usually corresponds to
1635 the path where the application is installed on the RTMP server
1636 (e.g. ‘<tt>/ondemand/</tt>’, ‘<tt>/flash/live/</tt>’, etc.).
1639 <dt> ‘<samp>playpath</samp>’</dt>
1640 <dd><p>It is the path or name of the resource to play with reference to the
1641 application specified in <var>app</var>, may be prefixed by "mp4:".
1646 <p>For example to read with ‘<tt>ffplay</tt>’ a multimedia resource named
1647 "sample" from the application "vod" from an RTMP server "myserver":
1648 </p><table><tr><td> </td><td><pre class="example">ffplay rtmp://myserver/vod/sample
1649 </pre></td></tr></table>
1651 <a name="rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte"></a>
1652 <h2 class="section"><a href="ffplay.html#toc-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">11.11 rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></h2>
1654 <p>Real-Time Messaging Protocol and its variants supported through
1657 <p>Requires the presence of the librtmp headers and library during
1658 configuration. You need to explicitely configure the build with
1659 "–enable-librtmp". If enabled this will replace the native RTMP
1662 <p>This protocol provides most client functions and a few server
1663 functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
1664 encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
1665 variants of these encrypted types (RTMPTE, RTMPTS).
1667 <p>The required syntax is:
1668 </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>
1669 </pre></td></tr></table>
1671 <p>where <var>rtmp_proto</var> is one of the strings "rtmp", "rtmpt", "rtmpe",
1672 "rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and
1673 <var>server</var>, <var>port</var>, <var>app</var> and <var>playpath</var> have the same
1674 meaning as specified for the RTMP native protocol.
1675 <var>options</var> contains a list of space-separated options of the form
1676 <var>key</var>=<var>val</var>.
1678 <p>See the librtmp manual page (man 3 librtmp) for more information.
1680 <p>For example, to stream a file in real-time to an RTMP server using
1681 ‘<tt>ffmpeg</tt>’:
1682 </p><table><tr><td> </td><td><pre class="example">ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
1683 </pre></td></tr></table>
1685 <p>To play the same stream using ‘<tt>ffplay</tt>’:
1686 </p><table><tr><td> </td><td><pre class="example">ffplay "rtmp://myserver/live/mystream live=1"
1687 </pre></td></tr></table>
1690 <h2 class="section"><a href="ffplay.html#toc-rtp">11.12 rtp</a></h2>
1692 <p>Real-Time Protocol.
1695 <h2 class="section"><a href="ffplay.html#toc-rtsp">11.13 rtsp</a></h2>
1697 <p>RTSP is not technically a protocol handler in libavformat, it is a demuxer
1698 and muxer. The demuxer supports both normal RTSP (with data transferred
1699 over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
1700 data transferred over RDT).
1702 <p>The muxer can be used to send a stream using RTSP ANNOUNCE to a server
1703 supporting it (currently Darwin Streaming Server and Mischa Spiegelmock’s
1704 RTSP server, <a href="http://github.com/revmischa/rtsp-server">http://github.com/revmischa/rtsp-server</a>).
1706 <p>The required syntax for a RTSP url is:
1707 </p><table><tr><td> </td><td><pre class="example">rtsp://<var>hostname</var>[:<var>port</var>]/<var>path</var>[?<var>options</var>]
1708 </pre></td></tr></table>
1710 <p><var>options</var> is a <code>&</code>-separated list. The following options
1713 <dl compact="compact">
1714 <dt> ‘<samp>udp</samp>’</dt>
1715 <dd><p>Use UDP as lower transport protocol.
1718 <dt> ‘<samp>tcp</samp>’</dt>
1719 <dd><p>Use TCP (interleaving within the RTSP control channel) as lower
1723 <dt> ‘<samp>multicast</samp>’</dt>
1724 <dd><p>Use UDP multicast as lower transport protocol.
1727 <dt> ‘<samp>http</samp>’</dt>
1728 <dd><p>Use HTTP tunneling as lower transport protocol, which is useful for
1732 <dt> ‘<samp>filter_src</samp>’</dt>
1733 <dd><p>Accept packets only from negotiated peer address and port.
1737 <p>Multiple lower transport protocols may be specified, in that case they are
1738 tried one at a time (if the setup of one fails, the next one is tried).
1739 For the muxer, only the <code>tcp</code> and <code>udp</code> options are supported.
1741 <p>When receiving data over UDP, the demuxer tries to reorder received packets
1742 (since they may arrive out of order, or packets may get lost totally). In
1743 order for this to be enabled, a maximum delay must be specified in the
1744 <code>max_delay</code> field of AVFormatContext.
1746 <p>When watching multi-bitrate Real-RTSP streams with ‘<tt>ffplay</tt>’, the
1747 streams to display can be chosen with <code>-vst</code> <var>n</var> and
1748 <code>-ast</code> <var>n</var> for video and audio respectively, and can be switched
1749 on the fly by pressing <code>v</code> and <code>a</code>.
1751 <p>Example command lines:
1753 <p>To watch a stream over UDP, with a max reordering delay of 0.5 seconds:
1755 <table><tr><td> </td><td><pre class="example">ffplay -max_delay 500000 rtsp://server/video.mp4?udp
1756 </pre></td></tr></table>
1758 <p>To watch a stream tunneled over HTTP:
1760 <table><tr><td> </td><td><pre class="example">ffplay rtsp://server/video.mp4?http
1761 </pre></td></tr></table>
1763 <p>To send a stream in realtime to a RTSP server, for others to watch:
1765 <table><tr><td> </td><td><pre class="example">ffmpeg -re -i <var>input</var> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
1766 </pre></td></tr></table>
1769 <h2 class="section"><a href="ffplay.html#toc-sap">11.14 sap</a></h2>
1771 <p>Session Announcement Protocol (RFC 2974). This is not technically a
1772 protocol handler in libavformat, it is a muxer and demuxer.
1773 It is used for signalling of RTP streams, by announcing the SDP for the
1774 streams regularly on a separate port.
1776 <a name="Muxer"></a>
1777 <h3 class="subsection"><a href="ffplay.html#toc-Muxer">11.14.1 Muxer</a></h3>
1779 <p>The syntax for a SAP url given to the muxer is:
1780 </p><table><tr><td> </td><td><pre class="example">sap://<var>destination</var>[:<var>port</var>][?<var>options</var>]
1781 </pre></td></tr></table>
1783 <p>The RTP packets are sent to <var>destination</var> on port <var>port</var>,
1784 or to port 5004 if no port is specified.
1785 <var>options</var> is a <code>&</code>-separated list. The following options
1788 <dl compact="compact">
1789 <dt> ‘<samp>announce_addr=<var>address</var></samp>’</dt>
1790 <dd><p>Specify the destination IP address for sending the announcements to.
1791 If omitted, the announcements are sent to the commonly used SAP
1792 announcement multicast address 224.2.127.254 (sap.mcast.net), or
1793 ff0e::2:7ffe if <var>destination</var> is an IPv6 address.
1796 <dt> ‘<samp>announce_port=<var>port</var></samp>’</dt>
1797 <dd><p>Specify the port to send the announcements on, defaults to
1798 9875 if not specified.
1801 <dt> ‘<samp>ttl=<var>ttl</var></samp>’</dt>
1802 <dd><p>Specify the time to live value for the announcements and RTP packets,
1806 <dt> ‘<samp>same_port=<var>0|1</var></samp>’</dt>
1807 <dd><p>If set to 1, send all RTP streams on the same port pair. If zero (the
1808 default), all streams are sent on unique ports, with each stream on a
1809 port 2 numbers higher than the previous.
1810 VLC/Live555 requires this to be set to 1, to be able to receive the stream.
1811 The RTP stack in libavformat for receiving requires all streams to be sent
1816 <p>Example command lines follow.
1818 <p>To broadcast a stream on the local subnet, for watching in VLC:
1820 <table><tr><td> </td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255?same_port=1
1821 </pre></td></tr></table>
1823 <p>Similarly, for watching in ffplay:
1825 <table><tr><td> </td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255
1826 </pre></td></tr></table>
1828 <p>And for watching in ffplay, over IPv6:
1830 <table><tr><td> </td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://[ff0e::1:2:3:4]
1831 </pre></td></tr></table>
1833 <a name="Demuxer"></a>
1834 <h3 class="subsection"><a href="ffplay.html#toc-Demuxer">11.14.2 Demuxer</a></h3>
1836 <p>The syntax for a SAP url given to the demuxer is:
1837 </p><table><tr><td> </td><td><pre class="example">sap://[<var>address</var>][:<var>port</var>]
1838 </pre></td></tr></table>
1840 <p><var>address</var> is the multicast address to listen for announcements on,
1841 if omitted, the default 224.2.127.254 (sap.mcast.net) is used. <var>port</var>
1842 is the port that is listened on, 9875 if omitted.
1844 <p>The demuxers listens for announcements on the given address and port.
1845 Once an announcement is received, it tries to receive that particular stream.
1847 <p>Example command lines follow.
1849 <p>To play back the first stream announced on the normal SAP multicast address:
1851 <table><tr><td> </td><td><pre class="example">ffplay sap://
1852 </pre></td></tr></table>
1854 <p>To play back the first stream announced on one the default IPv6 SAP multicast address:
1856 <table><tr><td> </td><td><pre class="example">ffplay sap://[ff0e::2:7ffe]
1857 </pre></td></tr></table>
1860 <h2 class="section"><a href="ffplay.html#toc-tcp">11.15 tcp</a></h2>
1862 <p>Trasmission Control Protocol.
1864 <p>The required syntax for a TCP url is:
1865 </p><table><tr><td> </td><td><pre class="example">tcp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
1866 </pre></td></tr></table>
1868 <dl compact="compact">
1869 <dt> ‘<samp>listen</samp>’</dt>
1870 <dd><p>Listen for an incoming connection
1872 <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
1873 ffplay tcp://<var>hostname</var>:<var>port</var>
1874 </pre></td></tr></table>
1880 <h2 class="section"><a href="ffplay.html#toc-udp">11.16 udp</a></h2>
1882 <p>User Datagram Protocol.
1884 <p>The required syntax for a UDP url is:
1885 </p><table><tr><td> </td><td><pre class="example">udp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
1886 </pre></td></tr></table>
1888 <p><var>options</var> contains a list of &-seperated options of the form <var>key</var>=<var>val</var>.
1889 Follow the list of supported options.
1891 <dl compact="compact">
1892 <dt> ‘<samp>buffer_size=<var>size</var></samp>’</dt>
1893 <dd><p>set the UDP buffer size in bytes
1896 <dt> ‘<samp>localport=<var>port</var></samp>’</dt>
1897 <dd><p>override the local UDP port to bind with
1900 <dt> ‘<samp>pkt_size=<var>size</var></samp>’</dt>
1901 <dd><p>set the size in bytes of UDP packets
1904 <dt> ‘<samp>reuse=<var>1|0</var></samp>’</dt>
1905 <dd><p>explicitly allow or disallow reusing UDP sockets
1908 <dt> ‘<samp>ttl=<var>ttl</var></samp>’</dt>
1909 <dd><p>set the time to live value (for multicast only)
1912 <dt> ‘<samp>connect=<var>1|0</var></samp>’</dt>
1913 <dd><p>Initialize the UDP socket with <code>connect()</code>. In this case, the
1914 destination address can’t be changed with ff_udp_set_remote_url later.
1915 If the destination address isn’t known at the start, this option can
1916 be specified in ff_udp_set_remote_url, too.
1917 This allows finding out the source address for the packets with getsockname,
1918 and makes writes return with AVERROR(ECONNREFUSED) if "destination
1919 unreachable" is received.
1920 For receiving, this gives the benefit of only receiving packets from
1921 the specified peer address/port.
1925 <p>Some usage examples of the udp protocol with ‘<tt>ffmpeg</tt>’ follow.
1927 <p>To stream over UDP to a remote endpoint:
1928 </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>
1929 </pre></td></tr></table>
1931 <p>To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer:
1932 </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
1933 </pre></td></tr></table>
1935 <p>To receive over UDP from a remote endpoint:
1936 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i udp://[<var>multicast-address</var>]:<var>port</var>
1937 </pre></td></tr></table>
1939 <a name="Filtergraph-description"></a>
1940 <h1 class="chapter"><a href="ffplay.html#toc-Filtergraph-description">12. Filtergraph description</a></h1>
1942 <p>A filtergraph is a directed graph of connected filters. It can contain
1943 cycles, and there can be multiple links between a pair of
1944 filters. Each link has one input pad on one side connecting it to one
1945 filter from which it takes its input, and one output pad on the other
1946 side connecting it to the one filter accepting its output.
1948 <p>Each filter in a filtergraph is an instance of a filter class
1949 registered in the application, which defines the features and the
1950 number of input and output pads of the filter.
1952 <p>A filter with no input pads is called a "source", a filter with no
1953 output pads is called a "sink".
1955 <a name="Filtergraph-syntax"></a>
1956 <h2 class="section"><a href="ffplay.html#toc-Filtergraph-syntax">12.1 Filtergraph syntax</a></h2>
1958 <p>A filtergraph can be represented using a textual representation, which
1959 is recognized by the <code>-vf</code> and <code>-af</code> options of the ff*
1960 tools, and by the <code>av_parse_graph()</code> function defined in
1961 ‘<tt>libavfilter/avfiltergraph</tt>’.
1963 <p>A filterchain consists of a sequence of connected filters, each one
1964 connected to the previous one in the sequence. A filterchain is
1965 represented by a list of ","-separated filter descriptions.
1967 <p>A filtergraph consists of a sequence of filterchains. A sequence of
1968 filterchains is represented by a list of ";"-separated filterchain
1971 <p>A filter is represented by a string of the form:
1972 [<var>in_link_1</var>]...[<var>in_link_N</var>]<var>filter_name</var>=<var>arguments</var>[<var>out_link_1</var>]...[<var>out_link_M</var>]
1974 <p><var>filter_name</var> is the name of the filter class of which the
1975 described filter is an instance of, and has to be the name of one of
1976 the filter classes registered in the program.
1977 The name of the filter class is optionally followed by a string
1978 "=<var>arguments</var>".
1980 <p><var>arguments</var> is a string which contains the parameters used to
1981 initialize the filter instance, and are described in the filter
1984 <p>The list of arguments can be quoted using the character "’" as initial
1985 and ending mark, and the character ’\’ for escaping the characters
1986 within the quoted text; otherwise the argument string is considered
1987 terminated when the next special character (belonging to the set
1988 "[]=;,") is encountered.
1990 <p>The name and arguments of the filter are optionally preceded and
1991 followed by a list of link labels.
1992 A link label allows to name a link and associate it to a filter output
1993 or input pad. The preceding labels <var>in_link_1</var>
1994 ... <var>in_link_N</var>, are associated to the filter input pads,
1995 the following labels <var>out_link_1</var> ... <var>out_link_M</var>, are
1996 associated to the output pads.
1998 <p>When two link labels with the same name are found in the
1999 filtergraph, a link between the corresponding input and output pad is
2002 <p>If an output pad is not labelled, it is linked by default to the first
2003 unlabelled input pad of the next filter in the filterchain.
2004 For example in the filterchain:
2005 </p><table><tr><td> </td><td><pre class="example">nullsrc, split[L1], [L2]overlay, nullsink
2006 </pre></td></tr></table>
2007 <p>the split filter instance has two output pads, and the overlay filter
2008 instance two input pads. The first output pad of split is labelled
2009 "L1", the first input pad of overlay is labelled "L2", and the second
2010 output pad of split is linked to the second input pad of overlay,
2011 which are both unlabelled.
2013 <p>In a complete filterchain all the unlabelled filter input and output
2014 pads must be connected. A filtergraph is considered valid if all the
2015 filter input and output pads of all the filterchains are connected.
2017 <p>Follows a BNF description for the filtergraph syntax:
2018 </p><table><tr><td> </td><td><pre class="example"><var>NAME</var> ::= sequence of alphanumeric characters and '_'
2019 <var>LINKLABEL</var> ::= "[" <var>NAME</var> "]"
2020 <var>LINKLABELS</var> ::= <var>LINKLABEL</var> [<var>LINKLABELS</var>]
2021 <var>FILTER_ARGUMENTS</var> ::= sequence of chars (eventually quoted)
2022 <var>FILTER</var> ::= [<var>LINKNAMES</var>] <var>NAME</var> ["=" <var>ARGUMENTS</var>] [<var>LINKNAMES</var>]
2023 <var>FILTERCHAIN</var> ::= <var>FILTER</var> [,<var>FILTERCHAIN</var>]
2024 <var>FILTERGRAPH</var> ::= <var>FILTERCHAIN</var> [;<var>FILTERGRAPH</var>]
2025 </pre></td></tr></table>
2028 <a name="Audio-Filters"></a>
2029 <h1 class="chapter"><a href="ffplay.html#toc-Audio-Filters">13. Audio Filters</a></h1>
2031 <p>When you configure your FFmpeg build, you can disable any of the
2032 existing filters using –disable-filters.
2033 The configure output will show the audio filters included in your
2036 <p>Below is a description of the currently available audio filters.
2038 <a name="anull"></a>
2039 <h2 class="section"><a href="ffplay.html#toc-anull">13.1 anull</a></h2>
2041 <p>Pass the audio source unchanged to the output.
2044 <a name="Audio-Sources"></a>
2045 <h1 class="chapter"><a href="ffplay.html#toc-Audio-Sources">14. Audio Sources</a></h1>
2047 <p>Below is a description of the currently available audio sources.
2049 <a name="anullsrc"></a>
2050 <h2 class="section"><a href="ffplay.html#toc-anullsrc">14.1 anullsrc</a></h2>
2052 <p>Null audio source, never return audio frames. It is mainly useful as a
2053 template and to be employed in analysis / debugging tools.
2055 <p>It accepts as optional parameter a string of the form
2056 <var>sample_rate</var>:<var>channel_layout</var>.
2058 <p><var>sample_rate</var> specify the sample rate, and defaults to 44100.
2060 <p><var>channel_layout</var> specify the channel layout, and can be either an
2061 integer or a string representing a channel layout. The default value
2062 of <var>channel_layout</var> is 3, which corresponds to CH_LAYOUT_STEREO.
2064 <p>Check the channel_layout_map definition in
2065 ‘<tt>libavcodec/audioconvert.c</tt>’ for the mapping between strings and
2066 channel layout values.
2068 <p>Follow some examples:
2069 </p><table><tr><td> </td><td><pre class="example"># set the sample rate to 48000 Hz and the channel layout to CH_LAYOUT_MONO.
2074 </pre></td></tr></table>
2077 <a name="Audio-Sinks"></a>
2078 <h1 class="chapter"><a href="ffplay.html#toc-Audio-Sinks">15. Audio Sinks</a></h1>
2080 <p>Below is a description of the currently available audio sinks.
2082 <a name="anullsink"></a>
2083 <h2 class="section"><a href="ffplay.html#toc-anullsink">15.1 anullsink</a></h2>
2085 <p>Null audio sink, do absolutely nothing with the input audio. It is
2086 mainly useful as a template and to be employed in analysis / debugging
2090 <a name="Video-Filters"></a>
2091 <h1 class="chapter"><a href="ffplay.html#toc-Video-Filters">16. Video Filters</a></h1>
2093 <p>When you configure your FFmpeg build, you can disable any of the
2094 existing filters using –disable-filters.
2095 The configure output will show the video filters included in your
2098 <p>Below is a description of the currently available video filters.
2100 <a name="blackframe"></a>
2101 <h2 class="section"><a href="ffplay.html#toc-blackframe">16.1 blackframe</a></h2>
2103 <p>Detect frames that are (almost) completely black. Can be useful to
2104 detect chapter transitions or commercials. Output lines consist of
2105 the frame number of the detected frame, the percentage of blackness,
2106 the position in the file if known or -1 and the timestamp in seconds.
2108 <p>In order to display the output lines, you need to set the loglevel at
2109 least to the AV_LOG_INFO value.
2111 <p>The filter accepts the syntax:
2112 </p><table><tr><td> </td><td><pre class="example">blackframe[=<var>amount</var>:[<var>threshold</var>]]
2113 </pre></td></tr></table>
2115 <p><var>amount</var> is the percentage of the pixels that have to be below the
2116 threshold, and defaults to 98.
2118 <p><var>threshold</var> is the threshold below which a pixel value is
2119 considered black, and defaults to 32.
2122 <h2 class="section"><a href="ffplay.html#toc-copy">16.2 copy</a></h2>
2124 <p>Copy the input source unchanged to the output. Mainly useful for
2128 <h2 class="section"><a href="ffplay.html#toc-crop">16.3 crop</a></h2>
2130 <p>Crop the input video to <var>out_w</var>:<var>out_h</var>:<var>x</var>:<var>y</var>.
2132 <p>The parameters are expressions containing the following constants:
2134 <dl compact="compact">
2135 <dt> ‘<samp>E, PI, PHI</samp>’</dt>
2136 <dd><p>the corresponding mathematical approximated values for e
2137 (euler number), pi (greek PI), PHI (golden ratio)
2140 <dt> ‘<samp>x, y</samp>’</dt>
2141 <dd><p>the computed values for <var>x</var> and <var>y</var>. They are evaluated for
2145 <dt> ‘<samp>in_w, in_h</samp>’</dt>
2146 <dd><p>the input width and heigth
2149 <dt> ‘<samp>iw, ih</samp>’</dt>
2150 <dd><p>same as <var>in_w</var> and <var>in_h</var>
2153 <dt> ‘<samp>out_w, out_h</samp>’</dt>
2154 <dd><p>the output (cropped) width and heigth
2157 <dt> ‘<samp>ow, oh</samp>’</dt>
2158 <dd><p>same as <var>out_w</var> and <var>out_h</var>
2161 <dt> ‘<samp>n</samp>’</dt>
2162 <dd><p>the number of input frame, starting from 0
2165 <dt> ‘<samp>pos</samp>’</dt>
2166 <dd><p>the position in the file of the input frame, NAN if unknown
2169 <dt> ‘<samp>t</samp>’</dt>
2170 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
2175 <p>The <var>out_w</var> and <var>out_h</var> parameters specify the expressions for
2176 the width and height of the output (cropped) video. They are
2177 evaluated just at the configuration of the filter.
2179 <p>The default value of <var>out_w</var> is "in_w", and the default value of
2180 <var>out_h</var> is "in_h".
2182 <p>The expression for <var>out_w</var> may depend on the value of <var>out_h</var>,
2183 and the expression for <var>out_h</var> may depend on <var>out_w</var>, but they
2184 cannot depend on <var>x</var> and <var>y</var>, as <var>x</var> and <var>y</var> are
2185 evaluated after <var>out_w</var> and <var>out_h</var>.
2187 <p>The <var>x</var> and <var>y</var> parameters specify the expressions for the
2188 position of the top-left corner of the output (non-cropped) area. They
2189 are evaluated for each frame. If the evaluated value is not valid, it
2190 is approximated to the nearest valid value.
2192 <p>The default value of <var>x</var> is "(in_w-out_w)/2", and the default
2193 value for <var>y</var> is "(in_h-out_h)/2", which set the cropped area at
2194 the center of the input image.
2196 <p>The expression for <var>x</var> may depend on <var>y</var>, and the expression
2197 for <var>y</var> may depend on <var>x</var>.
2199 <p>Follow some examples:
2200 </p><table><tr><td> </td><td><pre class="example"># crop the central input area with size 100x100
2203 # crop the central input area with size 2/3 of the input video
2204 "crop=2/3*in_w:2/3*in_h"
2206 # crop the input video central square
2209 # delimit the rectangle with the top-left corner placed at position
2210 # 100:100 and the right-bottom corner corresponding to the right-bottom
2211 # corner of the input image.
2212 crop=in_w-100:in_h-100:100:100
2214 # crop 10 pixels from the left and right borders, and 20 pixels from
2215 # the top and bottom borders
2216 "crop=in_w-2*10:in_h-2*20"
2218 # keep only the bottom right quarter of the input image
2219 "crop=in_w/2:in_h/2:in_w/2:in_h/2"
2221 # crop height for getting Greek harmony
2222 "crop=in_w:1/PHI*in_w"
2225 "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)"
2227 # erratic camera effect depending on timestamp
2228 "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)"
2230 # set x depending on the value of y
2231 "crop=in_w/2:in_h/2:y:10+10*sin(n/10)"
2232 </pre></td></tr></table>
2234 <a name="cropdetect"></a>
2235 <h2 class="section"><a href="ffplay.html#toc-cropdetect">16.4 cropdetect</a></h2>
2237 <p>Auto-detect crop size.
2239 <p>Calculate necessary cropping parameters and prints the recommended
2240 parameters through the logging system. The detected dimensions
2241 correspond to the non-black area of the input video.
2243 <p>It accepts the syntax:
2244 </p><table><tr><td> </td><td><pre class="example">cropdetect[=<var>limit</var>[:<var>round</var>[:<var>reset</var>]]]
2245 </pre></td></tr></table>
2247 <dl compact="compact">
2248 <dt> ‘<samp>limit</samp>’</dt>
2249 <dd><p>Threshold, which can be optionally specified from nothing (0) to
2250 everything (255), defaults to 24.
2253 <dt> ‘<samp>round</samp>’</dt>
2254 <dd><p>Value which the width/height should be divisible by, defaults to
2255 16. The offset is automatically adjusted to center the video. Use 2 to
2256 get only even dimensions (needed for 4:2:2 video). 16 is best when
2257 encoding to most video codecs.
2260 <dt> ‘<samp>reset</samp>’</dt>
2261 <dd><p>Counter that determines after how many frames cropdetect will reset
2262 the previously detected largest video area and start over to detect
2263 the current optimal crop area. Defaults to 0.
2265 <p>This can be useful when channel logos distort the video area. 0
2266 indicates never reset and return the largest area encountered during
2271 <a name="drawbox"></a>
2272 <h2 class="section"><a href="ffplay.html#toc-drawbox">16.5 drawbox</a></h2>
2274 <p>Draw a colored box on the input image.
2276 <p>It accepts the syntax:
2277 </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>
2278 </pre></td></tr></table>
2280 <dl compact="compact">
2281 <dt> ‘<samp>x, y</samp>’</dt>
2282 <dd><p>Specify the top left corner coordinates of the box. Default to 0.
2285 <dt> ‘<samp>width, height</samp>’</dt>
2286 <dd><p>Specify the width and height of the box, if 0 they are interpreted as
2287 the input width and height. Default to 0.
2290 <dt> ‘<samp>color</samp>’</dt>
2291 <dd><p>Specify the color of the box to write, it can be the name of a color
2292 (case insensitive match) or a 0xRRGGBB[AA] sequence.
2296 <p>Follow some examples:
2297 </p><table><tr><td> </td><td><pre class="example"># draw a black box around the edge of the input image
2300 # draw a box with color red and an opacity of 50%
2301 drawbox=10:20:200:60:red@0.5"
2302 </pre></td></tr></table>
2304 <a name="drawtext"></a>
2305 <h2 class="section"><a href="ffplay.html#toc-drawtext">16.6 drawtext</a></h2>
2307 <p>Draw text string or text from specified file on top of video using the
2308 libfreetype library.
2310 <p>To enable compilation of this filter you need to configure FFmpeg with
2311 <code>--enable-libfreetype</code>.
2313 <p>The filter also recognizes strftime() sequences in the provided text
2314 and expands them accordingly. Check the documentation of strftime().
2316 <p>The filter accepts parameters as a list of <var>key</var>=<var>value</var> pairs,
2317 separated by ":".
2319 <p>The description of the accepted parameters follows.
2321 <dl compact="compact">
2322 <dt> ‘<samp>fontfile</samp>’</dt>
2323 <dd><p>The font file to be used for drawing text. Path must be included.
2324 This parameter is mandatory.
2327 <dt> ‘<samp>text</samp>’</dt>
2328 <dd><p>The text string to be drawn. The text must be a sequence of UTF-8
2330 This parameter is mandatory if no file is specified with the parameter
2331 <var>textfile</var>.
2334 <dt> ‘<samp>textfile</samp>’</dt>
2335 <dd><p>A text file containing text to be drawn. The text must be a sequence
2336 of UTF-8 encoded characters.
2338 <p>This parameter is mandatory if no text string is specified with the
2339 parameter <var>text</var>.
2341 <p>If both text and textfile are specified, an error is thrown.
2344 <dt> ‘<samp>x, y</samp>’</dt>
2345 <dd><p>The offsets where text will be drawn within the video frame.
2346 Relative to the top/left border of the output image.
2348 <p>The default value of <var>x</var> and <var>y</var> is 0.
2351 <dt> ‘<samp>fontsize</samp>’</dt>
2352 <dd><p>The font size to be used for drawing text.
2353 The default value of <var>fontsize</var> is 16.
2356 <dt> ‘<samp>fontcolor</samp>’</dt>
2357 <dd><p>The color to be used for drawing fonts.
2358 Either a string (e.g. "red") or in 0xRRGGBB[AA] format
2359 (e.g. "0xff000033"), possibly followed by an alpha specifier.
2360 The default value of <var>fontcolor</var> is "black".
2363 <dt> ‘<samp>boxcolor</samp>’</dt>
2364 <dd><p>The color to be used for drawing box around text.
2365 Either a string (e.g. "yellow") or in 0xRRGGBB[AA] format
2366 (e.g. "0xff00ff"), possibly followed by an alpha specifier.
2367 The default value of <var>boxcolor</var> is "white".
2370 <dt> ‘<samp>box</samp>’</dt>
2371 <dd><p>Used to draw a box around text using background color.
2372 Value should be either 1 (enable) or 0 (disable).
2373 The default value of <var>box</var> is 0.
2376 <dt> ‘<samp>shadowx, shadowy</samp>’</dt>
2377 <dd><p>The x and y offsets for the text shadow position with respect to the
2378 position of the text. They can be either positive or negative
2379 values. Default value for both is "0".
2382 <dt> ‘<samp>shadowcolor</samp>’</dt>
2383 <dd><p>The color to be used for drawing a shadow behind the drawn text. It
2384 can be a color name (e.g. "yellow") or a string in the 0xRRGGBB[AA]
2385 form (e.g. "0xff00ff"), possibly followed by an alpha specifier.
2386 The default value of <var>shadowcolor</var> is "black".
2389 <dt> ‘<samp>ft_load_flags</samp>’</dt>
2390 <dd><p>Flags to be used for loading the fonts.
2392 <p>The flags map the corresponding flags supported by libfreetype, and are
2393 a combination of the following values:
2394 </p><dl compact="compact">
2395 <dt> <var>default</var></dt>
2396 <dt> <var>no_scale</var></dt>
2397 <dt> <var>no_hinting</var></dt>
2398 <dt> <var>render</var></dt>
2399 <dt> <var>no_bitmap</var></dt>
2400 <dt> <var>vertical_layout</var></dt>
2401 <dt> <var>force_autohint</var></dt>
2402 <dt> <var>crop_bitmap</var></dt>
2403 <dt> <var>pedantic</var></dt>
2404 <dt> <var>ignore_global_advance_width</var></dt>
2405 <dt> <var>no_recurse</var></dt>
2406 <dt> <var>ignore_transform</var></dt>
2407 <dt> <var>monochrome</var></dt>
2408 <dt> <var>linear_design</var></dt>
2409 <dt> <var>no_autohint</var></dt>
2410 <dt> <var>end table</var></dt>
2413 <p>Default value is "render".
2415 <p>For more information consult the documentation for the FT_LOAD_*
2419 <dt> ‘<samp>tabsize</samp>’</dt>
2420 <dd><p>The size in number of spaces to use for rendering the tab.
2425 <p>For example the command:
2426 </p><table><tr><td> </td><td><pre class="example">drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'"
2427 </pre></td></tr></table>
2429 <p>will draw "Test Text" with font FreeSerif, using the default values
2430 for the optional parameters.
2433 </p><table><tr><td> </td><td><pre class="example">drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
2434 x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2"
2435 </pre></td></tr></table>
2437 <p>will draw ’Test Text’ with font FreeSerif of size 24 at position x=100
2438 and y=50 (counting from the top-left corner of the screen), text is
2439 yellow with a red box around it. Both the text and the box have an
2442 <p>Note that the double quotes are not necessary if spaces are not used
2443 within the parameter list.
2445 <p>For more information about libfreetype, check:
2446 <a href="http://www.freetype.org/">http://www.freetype.org/</a>.
2449 <h2 class="section"><a href="ffplay.html#toc-fade">16.7 fade</a></h2>
2451 <p>Apply fade-in/out effect to input video.
2453 <p>It accepts the parameters:
2454 <var>type</var>:<var>start_frame</var>:<var>nb_frames</var>
2456 <p><var>type</var> specifies if the effect type, can be either "in" for
2457 fade-in, or "out" for a fade-out effect.
2459 <p><var>start_frame</var> specifies the number of the start frame for starting
2460 to apply the fade effect.
2462 <p><var>nb_frames</var> specifies the number of frames for which the fade
2463 effect has to last. At the end of the fade-in effect the output video
2464 will have the same intensity as the input video, at the end of the
2465 fade-out transition the output video will be completely black.
2467 <p>A few usage examples follow, usable too as test scenarios.
2468 </p><table><tr><td> </td><td><pre class="example"># fade in first 30 frames of video
2471 # fade out last 45 frames of a 200-frame video
2474 # fade in first 25 frames and fade out last 25 frames of a 1000-frame video
2475 fade=in:0:25, fade=out:975:25
2477 # make first 5 frames black, then fade in from frame 5-24
2479 </pre></td></tr></table>
2481 <a name="fieldorder"></a>
2482 <h2 class="section"><a href="ffplay.html#toc-fieldorder">16.8 fieldorder</a></h2>
2484 <p>Transform the field order of the input video.
2486 <p>It accepts one parameter which specifies the required field order that
2487 the input interlaced video will be transformed to. The parameter can
2488 assume one of the following values:
2490 <dl compact="compact">
2491 <dt> ‘<samp>0 or bff</samp>’</dt>
2492 <dd><p>output bottom field first
2494 <dt> ‘<samp>1 or tff</samp>’</dt>
2495 <dd><p>output top field first
2499 <p>Default value is "tff".
2501 <p>Transformation is achieved by shifting the picture content up or down
2502 by one line, and filling the remaining line with appropriate picture content.
2503 This method is consistent with most broadcast field order converters.
2505 <p>If the input video is not flagged as being interlaced, or it is already
2506 flagged as being of the required output field order then this filter does
2507 not alter the incoming video.
2509 <p>This filter is very useful when converting to or from PAL DV material,
2510 which is bottom field first.
2513 </p><table><tr><td> </td><td><pre class="example">./ffmpeg -i in.vob -vf "fieldorder=bff" out.dv
2514 </pre></td></tr></table>
2517 <h2 class="section"><a href="ffplay.html#toc-fifo">16.9 fifo</a></h2>
2519 <p>Buffer input images and send them when they are requested.
2521 <p>This filter is mainly useful when auto-inserted by the libavfilter
2524 <p>The filter does not take parameters.
2526 <a name="format"></a>
2527 <h2 class="section"><a href="ffplay.html#toc-format">16.10 format</a></h2>
2529 <p>Convert the input video to one of the specified pixel formats.
2530 Libavfilter will try to pick one that is supported for the input to
2533 <p>The filter accepts a list of pixel format names, separated by ":",
2534 for example "yuv420p:monow:rgb24".
2536 <p>Some examples follow:
2537 </p><table><tr><td> </td><td><pre class="example"># convert the input video to the format "yuv420p"
2540 # convert the input video to any of the formats in the list
2541 format=yuv420p:yuv444p:yuv410p
2542 </pre></td></tr></table>
2544 <p><a name="frei0r"></a>
2545 </p><a name="frei0r-1"></a>
2546 <h2 class="section"><a href="ffplay.html#toc-frei0r-1">16.11 frei0r</a></h2>
2548 <p>Apply a frei0r effect to the input video.
2550 <p>To enable compilation of this filter you need to install the frei0r
2551 header and configure FFmpeg with –enable-frei0r.
2553 <p>The filter supports the syntax:
2554 </p><table><tr><td> </td><td><pre class="example"><var>filter_name</var>[{:|=}<var>param1</var>:<var>param2</var>:...:<var>paramN</var>]
2555 </pre></td></tr></table>
2557 <p><var>filter_name</var> is the name to the frei0r effect to load. If the
2558 environment variable <code>FREI0R_PATH</code> is defined, the frei0r effect
2559 is searched in each one of the directories specified by the colon
2560 separated list in <code>FREIOR_PATH</code>, otherwise in the standard frei0r
2561 paths, which are in this order: ‘<tt>HOME/.frei0r-1/lib/</tt>’,
2562 ‘<tt>/usr/local/lib/frei0r-1/</tt>’, ‘<tt>/usr/lib/frei0r-1/</tt>’.
2564 <p><var>param1</var>, <var>param2</var>, ... , <var>paramN</var> specify the parameters
2565 for the frei0r effect.
2567 <p>A frei0r effect parameter can be a boolean (whose values are specified
2568 with "y" and "n"), a double, a color (specified by the syntax
2569 <var>R</var>/<var>G</var>/<var>B</var>, <var>R</var>, <var>G</var>, and <var>B</var> being float
2570 numbers from 0.0 to 1.0) or by an <code>av_parse_color()</code> color
2571 description), a position (specified by the syntax <var>X</var>/<var>Y</var>,
2572 <var>X</var> and <var>Y</var> being float numbers) and a string.
2574 <p>The number and kind of parameters depend on the loaded effect. If an
2575 effect parameter is not specified the default value is set.
2577 <p>Some examples follow:
2578 </p><table><tr><td> </td><td><pre class="example"># apply the distort0r effect, set the first two double parameters
2579 frei0r=distort0r:0.5:0.01
2581 # apply the colordistance effect, takes a color as first parameter
2582 frei0r=colordistance:0.2/0.3/0.4
2583 frei0r=colordistance:violet
2584 frei0r=colordistance:0x112233
2586 # apply the perspective effect, specify the top left and top right
2588 frei0r=perspective:0.2/0.2:0.8/0.2
2589 </pre></td></tr></table>
2591 <p>For more information see:
2592 <a href="http://piksel.org/frei0r">http://piksel.org/frei0r</a>
2594 <a name="gradfun"></a>
2595 <h2 class="section"><a href="ffplay.html#toc-gradfun">16.12 gradfun</a></h2>
2597 <p>Fix the banding artifacts that are sometimes introduced into nearly flat
2598 regions by truncation to 8bit colordepth.
2599 Interpolate the gradients that should go where the bands are, and
2602 <p>This filter is designed for playback only. Do not use it prior to
2603 lossy compression, because compression tends to lose the dither and
2604 bring back the bands.
2606 <p>The filter takes two optional parameters, separated by ’:’:
2607 <var>strength</var>:<var>radius</var>
2609 <p><var>strength</var> is the maximum amount by which the filter will change
2610 any one pixel. Also the threshold for detecting nearly flat
2611 regions. Acceptable values range from .51 to 255, default value is
2612 1.2, out-of-range values will be clipped to the valid range.
2614 <p><var>radius</var> is the neighborhood to fit the gradient to. A larger
2615 radius makes for smoother gradients, but also prevents the filter from
2616 modifying the pixels near detailed regions. Acceptable values are
2617 8-32, default value is 16, out-of-range values will be clipped to the
2620 <table><tr><td> </td><td><pre class="example"># default parameters
2625 </pre></td></tr></table>
2627 <a name="hflip"></a>
2628 <h2 class="section"><a href="ffplay.html#toc-hflip">16.13 hflip</a></h2>
2630 <p>Flip the input video horizontally.
2632 <p>For example to horizontally flip the video in input with
2633 ‘<tt>ffmpeg</tt>’:
2634 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i in.avi -vf "hflip" out.avi
2635 </pre></td></tr></table>
2637 <a name="hqdn3d"></a>
2638 <h2 class="section"><a href="ffplay.html#toc-hqdn3d">16.14 hqdn3d</a></h2>
2640 <p>High precision/quality 3d denoise filter. This filter aims to reduce
2641 image noise producing smooth images and making still images really
2642 still. It should enhance compressibility.
2644 <p>It accepts the following optional parameters:
2645 <var>luma_spatial</var>:<var>chroma_spatial</var>:<var>luma_tmp</var>:<var>chroma_tmp</var>
2647 <dl compact="compact">
2648 <dt> ‘<samp>luma_spatial</samp>’</dt>
2649 <dd><p>a non-negative float number which specifies spatial luma strength,
2653 <dt> ‘<samp>chroma_spatial</samp>’</dt>
2654 <dd><p>a non-negative float number which specifies spatial chroma strength,
2655 defaults to 3.0*<var>luma_spatial</var>/4.0
2658 <dt> ‘<samp>luma_tmp</samp>’</dt>
2659 <dd><p>a float number which specifies luma temporal strength, defaults to
2660 6.0*<var>luma_spatial</var>/4.0
2663 <dt> ‘<samp>chroma_tmp</samp>’</dt>
2664 <dd><p>a float number which specifies chroma temporal strength, defaults to
2665 <var>luma_tmp</var>*<var>chroma_spatial</var>/<var>luma_spatial</var>
2670 <h2 class="section"><a href="ffplay.html#toc-mp">16.15 mp</a></h2>
2672 <p>Apply an MPlayer filter to the input video.
2674 <p>This filter provides a wrapper around most of the filters of
2677 <p>This wrapper is considered experimental. Some of the wrapped filters
2678 may not work properly and we may drop support for them, as they will
2679 be implemented natively into FFmpeg. Thus you should avoid
2680 depending on them when writing portable scripts.
2682 <p>The filters accepts the parameters:
2683 <var>filter_name</var>[:=]<var>filter_params</var>
2685 <p><var>filter_name</var> is the name of a supported MPlayer filter,
2686 <var>filter_params</var> is a string containing the parameters accepted by
2689 <p>The list of the currently supported filters follows:
2690 </p><dl compact="compact">
2691 <dt> <var>2xsai</var></dt>
2692 <dt> <var>blackframe</var></dt>
2693 <dt> <var>boxblur</var></dt>
2694 <dt> <var>cropdetect</var></dt>
2695 <dt> <var>decimate</var></dt>
2696 <dt> <var>delogo</var></dt>
2697 <dt> <var>denoise3d</var></dt>
2698 <dt> <var>detc</var></dt>
2699 <dt> <var>dint</var></dt>
2700 <dt> <var>divtc</var></dt>
2701 <dt> <var>down3dright</var></dt>
2702 <dt> <var>dsize</var></dt>
2703 <dt> <var>eq2</var></dt>
2704 <dt> <var>eq</var></dt>
2705 <dt> <var>field</var></dt>
2706 <dt> <var>fil</var></dt>
2707 <dt> <var>fixpts</var></dt>
2708 <dt> <var>framestep</var></dt>
2709 <dt> <var>fspp</var></dt>
2710 <dt> <var>geq</var></dt>
2711 <dt> <var>gradfun</var></dt>
2712 <dt> <var>harddup</var></dt>
2713 <dt> <var>hqdn3d</var></dt>
2714 <dt> <var>hue</var></dt>
2715 <dt> <var>il</var></dt>
2716 <dt> <var>ilpack</var></dt>
2717 <dt> <var>ivtc</var></dt>
2718 <dt> <var>kerndeint</var></dt>
2719 <dt> <var>mcdeint</var></dt>
2720 <dt> <var>mirror</var></dt>
2721 <dt> <var>noise</var></dt>
2722 <dt> <var>ow</var></dt>
2723 <dt> <var>palette</var></dt>
2724 <dt> <var>perspective</var></dt>
2725 <dt> <var>phase</var></dt>
2726 <dt> <var>pp7</var></dt>
2727 <dt> <var>pullup</var></dt>
2728 <dt> <var>qp</var></dt>
2729 <dt> <var>rectangle</var></dt>
2730 <dt> <var>remove-logo</var></dt>
2731 <dt> <var>rgbtest</var></dt>
2732 <dt> <var>rotate</var></dt>
2733 <dt> <var>sab</var></dt>
2734 <dt> <var>screenshot</var></dt>
2735 <dt> <var>smartblur</var></dt>
2736 <dt> <var>softpulldown</var></dt>
2737 <dt> <var>softskip</var></dt>
2738 <dt> <var>spp</var></dt>
2739 <dt> <var>swapuv</var></dt>
2740 <dt> <var>telecine</var></dt>
2741 <dt> <var>test</var></dt>
2742 <dt> <var>tile</var></dt>
2743 <dt> <var>tinterlace</var></dt>
2744 <dt> <var>unsharp</var></dt>
2745 <dt> <var>uspp</var></dt>
2746 <dt> <var>yuvcsp</var></dt>
2747 <dt> <var>yvu9</var></dt>
2750 <p>The parameter syntax and behavior for the listed filters are the same
2751 of the corresponding MPlayer filters. For detailed instructions check
2752 the "VIDEO FILTERS" section in the MPlayer manual.
2754 <p>Some examples follow:
2755 </p><table><tr><td> </td><td><pre class="example"># remove a logo by interpolating the surrounding pixels
2756 mp=delogo=200:200:80:20:1
2758 # adjust gamma, brightness, contrast
2761 # tweak hue and saturation
2763 </pre></td></tr></table>
2765 <p>See also mplayer(1), <a href="http://www.mplayerhq.hu/">http://www.mplayerhq.hu/</a>.
2767 <a name="noformat"></a>
2768 <h2 class="section"><a href="ffplay.html#toc-noformat">16.16 noformat</a></h2>
2770 <p>Force libavfilter not to use any of the specified pixel formats for the
2771 input to the next filter.
2773 <p>The filter accepts a list of pixel format names, separated by ":",
2774 for example "yuv420p:monow:rgb24".
2776 <p>Some examples follow:
2777 </p><table><tr><td> </td><td><pre class="example"># force libavfilter to use a format different from "yuv420p" for the
2778 # input to the vflip filter
2779 noformat=yuv420p,vflip
2781 # convert the input video to any of the formats not contained in the list
2782 noformat=yuv420p:yuv444p:yuv410p
2783 </pre></td></tr></table>
2785 <a name="null-1"></a>
2786 <h2 class="section"><a href="ffplay.html#toc-null-1">16.17 null</a></h2>
2788 <p>Pass the video source unchanged to the output.
2791 <h2 class="section"><a href="ffplay.html#toc-ocv">16.18 ocv</a></h2>
2793 <p>Apply video transform using libopencv.
2795 <p>To enable this filter install libopencv library and headers and
2796 configure FFmpeg with –enable-libopencv.
2798 <p>The filter takes the parameters: <var>filter_name</var>{:=}<var>filter_params</var>.
2800 <p><var>filter_name</var> is the name of the libopencv filter to apply.
2802 <p><var>filter_params</var> specifies the parameters to pass to the libopencv
2803 filter. If not specified the default values are assumed.
2805 <p>Refer to the official libopencv documentation for more precise
2807 <a href="http://opencv.willowgarage.com/documentation/c/image_filtering.html">http://opencv.willowgarage.com/documentation/c/image_filtering.html</a>
2809 <p>Follows the list of supported libopencv filters.
2811 <p><a name="dilate"></a>
2812 </p><a name="dilate-1"></a>
2813 <h3 class="subsection"><a href="ffplay.html#toc-dilate-1">16.18.1 dilate</a></h3>
2815 <p>Dilate an image by using a specific structuring element.
2816 This filter corresponds to the libopencv function <code>cvDilate</code>.
2818 <p>It accepts the parameters: <var>struct_el</var>:<var>nb_iterations</var>.
2820 <p><var>struct_el</var> represents a structuring element, and has the syntax:
2821 <var>cols</var>x<var>rows</var>+<var>anchor_x</var>x<var>anchor_y</var>/<var>shape</var>
2823 <p><var>cols</var> and <var>rows</var> represent the number of colums and rows of
2824 the structuring element, <var>anchor_x</var> and <var>anchor_y</var> the anchor
2825 point, and <var>shape</var> the shape for the structuring element, and
2826 can be one of the values "rect", "cross", "ellipse", "custom".
2828 <p>If the value for <var>shape</var> is "custom", it must be followed by a
2829 string of the form "=<var>filename</var>". The file with name
2830 <var>filename</var> is assumed to represent a binary image, with each
2831 printable character corresponding to a bright pixel. When a custom
2832 <var>shape</var> is used, <var>cols</var> and <var>rows</var> are ignored, the number
2833 or columns and rows of the read file are assumed instead.
2835 <p>The default value for <var>struct_el</var> is "3x3+0x0/rect".
2837 <p><var>nb_iterations</var> specifies the number of times the transform is
2838 applied to the image, and defaults to 1.
2840 <p>Follow some example:
2841 </p><table><tr><td> </td><td><pre class="example"># use the default values
2844 # dilate using a structuring element with a 5x5 cross, iterate two times
2845 ocv=dilate=5x5+2x2/cross:2
2847 # read the shape from the file diamond.shape, iterate two times
2848 # the file diamond.shape may contain a pattern of characters like this:
2854 # the specified cols and rows are ignored (but not the anchor point coordinates)
2855 ocv=0x0+2x2/custom=diamond.shape:2
2856 </pre></td></tr></table>
2858 <a name="erode"></a>
2859 <h3 class="subsection"><a href="ffplay.html#toc-erode">16.18.2 erode</a></h3>
2861 <p>Erode an image by using a specific structuring element.
2862 This filter corresponds to the libopencv function <code>cvErode</code>.
2864 <p>The filter accepts the parameters: <var>struct_el</var>:<var>nb_iterations</var>,
2865 with the same meaning and use of those of the dilate filter
2866 (see <a href="#dilate">dilate</a>).
2868 <a name="smooth"></a>
2869 <h3 class="subsection"><a href="ffplay.html#toc-smooth">16.18.3 smooth</a></h3>
2871 <p>Smooth the input video.
2873 <p>The filter takes the following parameters:
2874 <var>type</var>:<var>param1</var>:<var>param2</var>:<var>param3</var>:<var>param4</var>.
2876 <p><var>type</var> is the type of smooth filter to apply, and can be one of
2877 the following values: "blur", "blur_no_scale", "median", "gaussian",
2878 "bilateral". The default value is "gaussian".
2880 <p><var>param1</var>, <var>param2</var>, <var>param3</var>, and <var>param4</var> are
2881 parameters whose meanings depend on smooth type. <var>param1</var> and
2882 <var>param2</var> accept integer positive values or 0, <var>param3</var> and
2883 <var>param4</var> accept float values.
2885 <p>The default value for <var>param1</var> is 3, the default value for the
2886 other parameters is 0.
2888 <p>These parameters correspond to the parameters assigned to the
2889 libopencv function <code>cvSmooth</code>.
2891 <a name="overlay"></a>
2892 <h2 class="section"><a href="ffplay.html#toc-overlay">16.19 overlay</a></h2>
2894 <p>Overlay one video on top of another.
2896 <p>It takes two inputs and one output, the first input is the "main"
2897 video on which the second input is overlayed.
2899 <p>It accepts the parameters: <var>x</var>:<var>y</var>.
2901 <p><var>x</var> is the x coordinate of the overlayed video on the main video,
2902 <var>y</var> is the y coordinate. The parameters are expressions containing
2903 the following parameters:
2905 <dl compact="compact">
2906 <dt> ‘<samp>main_w, main_h</samp>’</dt>
2907 <dd><p>main input width and height
2910 <dt> ‘<samp>W, H</samp>’</dt>
2911 <dd><p>same as <var>main_w</var> and <var>main_h</var>
2914 <dt> ‘<samp>overlay_w, overlay_h</samp>’</dt>
2915 <dd><p>overlay input width and height
2918 <dt> ‘<samp>w, h</samp>’</dt>
2919 <dd><p>same as <var>overlay_w</var> and <var>overlay_h</var>
2923 <p>Be aware that frames are taken from each input video in timestamp
2924 order, hence, if their initial timestamps differ, it is a a good idea
2925 to pass the two inputs through a <var>setpts=PTS-STARTPTS</var> filter to
2926 have them begin in the same zero timestamp, as it does the example for
2927 the <var>movie</var> filter.
2929 <p>Follow some examples:
2930 </p><table><tr><td> </td><td><pre class="example"># draw the overlay at 10 pixels from the bottom right
2931 # corner of the main video.
2932 overlay=main_w-overlay_w-10:main_h-overlay_h-10
2934 # insert a transparent PNG logo in the bottom left corner of the input
2935 movie=logo.png [logo];
2936 [in][logo] overlay=10:main_h-overlay_h-10 [out]
2938 # insert 2 different transparent PNG logos (second logo on bottom
2940 movie=logo1.png [logo1];
2941 movie=logo2.png [logo2];
2942 [in][logo1] overlay=10:H-h-10 [in+logo1];
2943 [in+logo1][logo2] overlay=W-w-10:H-h-10 [out]
2945 # add a transparent color layer on top of the main video,
2946 # WxH specifies the size of the main input to the overlay filter
2947 color=red.3:WxH [over]; [in][over] overlay [out]
2948 </pre></td></tr></table>
2950 <p>You can chain togheter more overlays but the efficiency of such
2951 approach is yet to be tested.
2954 <h2 class="section"><a href="ffplay.html#toc-pad">16.20 pad</a></h2>
2956 <p>Add paddings to the input image, and places the original input at the
2957 given coordinates <var>x</var>, <var>y</var>.
2959 <p>It accepts the following parameters:
2960 <var>width</var>:<var>height</var>:<var>x</var>:<var>y</var>:<var>color</var>.
2962 <p>The parameters <var>width</var>, <var>height</var>, <var>x</var>, and <var>y</var> are
2963 expressions containing the following constants:
2965 <dl compact="compact">
2966 <dt> ‘<samp>E, PI, PHI</samp>’</dt>
2967 <dd><p>the corresponding mathematical approximated values for e
2968 (euler number), pi (greek PI), phi (golden ratio)
2971 <dt> ‘<samp>in_w, in_h</samp>’</dt>
2972 <dd><p>the input video width and heigth
2975 <dt> ‘<samp>iw, ih</samp>’</dt>
2976 <dd><p>same as <var>in_w</var> and <var>in_h</var>
2979 <dt> ‘<samp>out_w, out_h</samp>’</dt>
2980 <dd><p>the output width and heigth, that is the size of the padded area as
2981 specified by the <var>width</var> and <var>height</var> expressions
2984 <dt> ‘<samp>ow, oh</samp>’</dt>
2985 <dd><p>same as <var>out_w</var> and <var>out_h</var>
2988 <dt> ‘<samp>x, y</samp>’</dt>
2989 <dd><p>x and y offsets as specified by the <var>x</var> and <var>y</var>
2990 expressions, or NAN if not yet specified
2993 <dt> ‘<samp>a</samp>’</dt>
2994 <dd><p>input display aspect ratio, same as <var>iw</var> / <var>ih</var>
2997 <dt> ‘<samp>hsub, vsub</samp>’</dt>
2998 <dd><p>horizontal and vertical chroma subsample values. For example for the
2999 pixel format "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
3003 <p>Follows the description of the accepted parameters.
3005 <dl compact="compact">
3006 <dt> ‘<samp>width, height</samp>’</dt>
3008 <p>Specify the size of the output image with the paddings added. If the
3009 value for <var>width</var> or <var>height</var> is 0, the corresponding input size
3010 is used for the output.
3012 <p>The <var>width</var> expression can reference the value set by the
3013 <var>height</var> expression, and viceversa.
3015 <p>The default value of <var>width</var> and <var>height</var> is 0.
3018 <dt> ‘<samp>x, y</samp>’</dt>
3020 <p>Specify the offsets where to place the input image in the padded area
3021 with respect to the top/left border of the output image.
3023 <p>The <var>x</var> expression can reference the value set by the <var>y</var>
3024 expression, and viceversa.
3026 <p>The default value of <var>x</var> and <var>y</var> is 0.
3029 <dt> ‘<samp>color</samp>’</dt>
3031 <p>Specify the color of the padded area, it can be the name of a color
3032 (case insensitive match) or a 0xRRGGBB[AA] sequence.
3034 <p>The default value of <var>color</var> is "black".
3039 <p>Some examples follow:
3041 <table><tr><td> </td><td><pre class="example"># Add paddings with color "violet" to the input video. Output video
3042 # size is 640x480, the top-left corner of the input video is placed at
3044 pad=640:480:0:40:violet
3046 # pad the input to get an output with dimensions increased bt 3/2,
3047 # and put the input video at the center of the padded area
3048 pad="3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2"
3050 # pad the input to get a squared output with size equal to the maximum
3051 # value between the input width and height, and put the input video at
3052 # the center of the padded area
3053 pad="max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2"
3055 # pad the input to get a final w/h ratio of 16:9
3056 pad="ih*16/9:ih:(ow-iw)/2:(oh-ih)/2"
3058 # double output size and put the input video in the bottom-right
3059 # corner of the output padded area
3060 pad="2*iw:2*ih:ow-iw:oh-ih"
3061 </pre></td></tr></table>
3063 <a name="pixdesctest"></a>
3064 <h2 class="section"><a href="ffplay.html#toc-pixdesctest">16.21 pixdesctest</a></h2>
3066 <p>Pixel format descriptor test filter, mainly useful for internal
3067 testing. The output video should be equal to the input video.
3070 </p><table><tr><td> </td><td><pre class="example">format=monow, pixdesctest
3071 </pre></td></tr></table>
3073 <p>can be used to test the monowhite pixel format descriptor definition.
3075 <a name="scale"></a>
3076 <h2 class="section"><a href="ffplay.html#toc-scale">16.22 scale</a></h2>
3078 <p>Scale the input video to <var>width</var>:<var>height</var> and/or convert the image format.
3080 <p>The parameters <var>width</var> and <var>height</var> are expressions containing
3081 the following constants:
3083 <dl compact="compact">
3084 <dt> ‘<samp>E, PI, PHI</samp>’</dt>
3085 <dd><p>the corresponding mathematical approximated values for e
3086 (euler number), pi (greek PI), phi (golden ratio)
3089 <dt> ‘<samp>in_w, in_h</samp>’</dt>
3090 <dd><p>the input width and heigth
3093 <dt> ‘<samp>iw, ih</samp>’</dt>
3094 <dd><p>same as <var>in_w</var> and <var>in_h</var>
3097 <dt> ‘<samp>out_w, out_h</samp>’</dt>
3098 <dd><p>the output (cropped) width and heigth
3101 <dt> ‘<samp>ow, oh</samp>’</dt>
3102 <dd><p>same as <var>out_w</var> and <var>out_h</var>
3105 <dt> ‘<samp>a</samp>’</dt>
3106 <dd><p>input display aspect ratio, same as <var>iw</var> / <var>ih</var>
3109 <dt> ‘<samp>hsub, vsub</samp>’</dt>
3110 <dd><p>horizontal and vertical chroma subsample values. For example for the
3111 pixel format "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
3115 <p>If the input image format is different from the format requested by
3116 the next filter, the scale filter will convert the input to the
3119 <p>If the value for <var>width</var> or <var>height</var> is 0, the respective input
3120 size is used for the output.
3122 <p>If the value for <var>width</var> or <var>height</var> is -1, the scale filter will
3123 use, for the respective output size, a value that maintains the aspect
3124 ratio of the input image.
3126 <p>The default value of <var>width</var> and <var>height</var> is 0.
3128 <p>Some examples follow:
3129 </p><table><tr><td> </td><td><pre class="example"># scale the input video to a size of 200x100.
3132 # scale the input to 2x
3134 # the above is the same as
3137 # scale the input to half size
3140 # increase the width, and set the height to the same size
3143 # seek for Greek harmony
3147 # increase the height, and set the width to 3/2 of the height
3150 # increase the size, but make the size a multiple of the chroma
3151 scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
3153 # increase the width to a maximum of 500 pixels, keep the same input aspect ratio
3154 scale='min(500\, iw*3/2):-1'
3155 </pre></td></tr></table>
3157 <a name="select"></a>
3158 <h2 class="section"><a href="ffplay.html#toc-select">16.23 select</a></h2>
3159 <p>Select frames to pass in output.
3161 <p>It accepts in input an expression, which is evaluated for each input
3162 frame. If the expression is evaluated to a non-zero value, the frame
3163 is selected and passed to the output, otherwise it is discarded.
3165 <p>The expression can contain the following constants:
3167 <dl compact="compact">
3168 <dt> ‘<samp>PI</samp>’</dt>
3172 <dt> ‘<samp>PHI</samp>’</dt>
3176 <dt> ‘<samp>E</samp>’</dt>
3180 <dt> ‘<samp>n</samp>’</dt>
3181 <dd><p>the sequential number of the filtered frame, starting from 0
3184 <dt> ‘<samp>selected_n</samp>’</dt>
3185 <dd><p>the sequential number of the selected frame, starting from 0
3188 <dt> ‘<samp>prev_selected_n</samp>’</dt>
3189 <dd><p>the sequential number of the last selected frame, NAN if undefined
3192 <dt> ‘<samp>TB</samp>’</dt>
3193 <dd><p>timebase of the input timestamps
3196 <dt> ‘<samp>pts</samp>’</dt>
3197 <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
3198 expressed in <var>TB</var> units, NAN if undefined
3201 <dt> ‘<samp>t</samp>’</dt>
3202 <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
3203 expressed in seconds, NAN if undefined
3206 <dt> ‘<samp>prev_pts</samp>’</dt>
3207 <dd><p>the PTS of the previously filtered video frame, NAN if undefined
3210 <dt> ‘<samp>prev_selected_pts</samp>’</dt>
3211 <dd><p>the PTS of the last previously filtered video frame, NAN if undefined
3214 <dt> ‘<samp>prev_selected_t</samp>’</dt>
3215 <dd><p>the PTS of the last previously selected video frame, NAN if undefined
3218 <dt> ‘<samp>start_pts</samp>’</dt>
3219 <dd><p>the PTS of the first video frame in the video, NAN if undefined
3222 <dt> ‘<samp>start_t</samp>’</dt>
3223 <dd><p>the time of the first video frame in the video, NAN if undefined
3226 <dt> ‘<samp>pict_type</samp>’</dt>
3227 <dd><p>the picture type of the filtered frame, can assume one of the following
3229 </p><dl compact="compact">
3230 <dt> ‘<samp>PICT_TYPE_I</samp>’</dt>
3231 <dt> ‘<samp>PICT_TYPE_P</samp>’</dt>
3232 <dt> ‘<samp>PICT_TYPE_B</samp>’</dt>
3233 <dt> ‘<samp>PICT_TYPE_S</samp>’</dt>
3234 <dt> ‘<samp>PICT_TYPE_SI</samp>’</dt>
3235 <dt> ‘<samp>PICT_TYPE_SP</samp>’</dt>
3236 <dt> ‘<samp>PICT_TYPE_BI</samp>’</dt>
3240 <dt> ‘<samp>interlace_type</samp>’</dt>
3241 <dd><p>the frame interlace type, can assume one of the following values:
3242 </p><dl compact="compact">
3243 <dt> ‘<samp>INTERLACE_TYPE_P</samp>’</dt>
3244 <dd><p>the frame is progressive (not interlaced)
3246 <dt> ‘<samp>INTERLACE_TYPE_T</samp>’</dt>
3247 <dd><p>the frame is top-field-first
3249 <dt> ‘<samp>INTERLACE_TYPE_B</samp>’</dt>
3250 <dd><p>the frame is bottom-field-first
3255 <dt> ‘<samp>key</samp>’</dt>
3256 <dd><p>1 if the filtered frame is a key-frame, 0 otherwise
3259 <dt> ‘<samp>pos</samp>’</dt>
3260 <dd><p>the position in the file of the filtered frame, -1 if the information
3261 is not available (e.g. for synthetic video)
3265 <p>The default value of the select expression is "1".
3267 <p>Some examples follow:
3269 <table><tr><td> </td><td><pre class="example"># select all frames in input
3272 # the above is the same as:
3278 # select only I-frames
3279 select='eq(pict_type\,PICT_TYPE_I)'
3281 # select one frame every 100
3282 select='not(mod(n\,100))'
3284 # select only frames contained in the 10-20 time interval
3285 select='gte(t\,10)*lte(t\,20)'
3287 # select only I frames contained in the 10-20 time interval
3288 select='gte(t\,10)*lte(t\,20)*eq(pict_type\,PICT_TYPE_I)'
3290 # select frames with a minimum distance of 10 seconds
3291 select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
3292 </pre></td></tr></table>
3294 <p><a name="setdar"></a>
3295 </p><a name="setdar-1"></a>
3296 <h2 class="section"><a href="ffplay.html#toc-setdar-1">16.24 setdar</a></h2>
3298 <p>Set the Display Aspect Ratio for the filter output video.
3300 <p>This is done by changing the specified Sample (aka Pixel) Aspect
3301 Ratio, according to the following equation:
3302 <em>DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR</em>
3304 <p>Keep in mind that this filter does not modify the pixel dimensions of
3305 the video frame. Also the display aspect ratio set by this filter may
3306 be changed by later filters in the filterchain, e.g. in case of
3307 scaling or if another "setdar" or a "setsar" filter is applied.
3309 <p>The filter accepts a parameter string which represents the wanted
3310 display aspect ratio.
3311 The parameter can be a floating point number string, or an expression
3312 of the form <var>num</var>:<var>den</var>, where <var>num</var> and <var>den</var> are the
3313 numerator and denominator of the aspect ratio.
3314 If the parameter is not specified, it is assumed the value "0:1".
3316 <p>For example to change the display aspect ratio to 16:9, specify:
3317 </p><table><tr><td> </td><td><pre class="example">setdar=16:9
3318 # the above is equivalent to
3320 </pre></td></tr></table>
3322 <p>See also the "setsar" filter documentation (see <a href="#setsar">setsar</a>).
3324 <a name="setpts"></a>
3325 <h2 class="section"><a href="ffplay.html#toc-setpts">16.25 setpts</a></h2>
3327 <p>Change the PTS (presentation timestamp) of the input video frames.
3329 <p>Accept in input an expression evaluated through the eval API, which
3330 can contain the following constants:
3332 <dl compact="compact">
3333 <dt> ‘<samp>PTS</samp>’</dt>
3334 <dd><p>the presentation timestamp in input
3337 <dt> ‘<samp>PI</samp>’</dt>
3341 <dt> ‘<samp>PHI</samp>’</dt>
3345 <dt> ‘<samp>E</samp>’</dt>
3349 <dt> ‘<samp>N</samp>’</dt>
3350 <dd><p>the count of the input frame, starting from 0.
3353 <dt> ‘<samp>STARTPTS</samp>’</dt>
3354 <dd><p>the PTS of the first video frame
3357 <dt> ‘<samp>INTERLACED</samp>’</dt>
3358 <dd><p>tell if the current frame is interlaced
3361 <dt> ‘<samp>POS</samp>’</dt>
3362 <dd><p>original position in the file of the frame, or undefined if undefined
3363 for the current frame
3366 <dt> ‘<samp>PREV_INPTS</samp>’</dt>
3367 <dd><p>previous input PTS
3370 <dt> ‘<samp>PREV_OUTPTS</samp>’</dt>
3371 <dd><p>previous output PTS
3376 <p>Some examples follow:
3378 <table><tr><td> </td><td><pre class="example"># start counting PTS from zero
3390 # fixed rate 25 fps with some jitter
3391 setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
3392 </pre></td></tr></table>
3394 <p><a name="setsar"></a>
3395 </p><a name="setsar-1"></a>
3396 <h2 class="section"><a href="ffplay.html#toc-setsar-1">16.26 setsar</a></h2>
3398 <p>Set the Sample (aka Pixel) Aspect Ratio for the filter output video.
3400 <p>Note that as a consequence of the application of this filter, the
3401 output display aspect ratio will change according to the following
3403 <em>DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR</em>
3405 <p>Keep in mind that the sample aspect ratio set by this filter may be
3406 changed by later filters in the filterchain, e.g. if another "setsar"
3407 or a "setdar" filter is applied.
3409 <p>The filter accepts a parameter string which represents the wanted
3410 sample aspect ratio.
3411 The parameter can be a floating point number string, or an expression
3412 of the form <var>num</var>:<var>den</var>, where <var>num</var> and <var>den</var> are the
3413 numerator and denominator of the aspect ratio.
3414 If the parameter is not specified, it is assumed the value "0:1".
3416 <p>For example to change the sample aspect ratio to 10:11, specify:
3417 </p><table><tr><td> </td><td><pre class="example">setsar=10:11
3418 </pre></td></tr></table>
3420 <a name="settb"></a>
3421 <h2 class="section"><a href="ffplay.html#toc-settb">16.27 settb</a></h2>
3423 <p>Set the timebase to use for the output frames timestamps.
3424 It is mainly useful for testing timebase configuration.
3426 <p>It accepts in input an arithmetic expression representing a rational.
3427 The expression can contain the constants "PI", "E", "PHI", "AVTB" (the
3428 default timebase), and "intb" (the input timebase).
3430 <p>The default value for the input is "intb".
3432 <p>Follow some examples.
3434 <table><tr><td> </td><td><pre class="example"># set the timebase to 1/25
3437 # set the timebase to 1/10
3440 #set the timebase to 1001/1000
3443 #set the timebase to 2*intb
3446 #set the default timebase value
3448 </pre></td></tr></table>
3450 <a name="showinfo"></a>
3451 <h2 class="section"><a href="ffplay.html#toc-showinfo">16.28 showinfo</a></h2>
3453 <p>Show a line containing various information for each input video frame.
3454 The input video is not modified.
3456 <p>The shown line contains a sequence of key/value pairs of the form
3457 <var>key</var>:<var>value</var>.
3459 <p>A description of each shown parameter follows:
3461 <dl compact="compact">
3462 <dt> ‘<samp>n</samp>’</dt>
3463 <dd><p>sequential number of the input frame, starting from 0
3466 <dt> ‘<samp>pts</samp>’</dt>
3467 <dd><p>Presentation TimeStamp of the input frame, expressed as a number of
3468 time base units. The time base unit depends on the filter input pad.
3471 <dt> ‘<samp>pts_time</samp>’</dt>
3472 <dd><p>Presentation TimeStamp of the input frame, expressed as a number of
3476 <dt> ‘<samp>pos</samp>’</dt>
3477 <dd><p>position of the frame in the input stream, -1 if this information in
3478 unavailable and/or meanigless (for example in case of synthetic video)
3481 <dt> ‘<samp>fmt</samp>’</dt>
3482 <dd><p>pixel format name
3485 <dt> ‘<samp>sar</samp>’</dt>
3486 <dd><p>sample aspect ratio of the input frame, expressed in the form
3487 <var>num</var>/<var>den</var>
3490 <dt> ‘<samp>s</samp>’</dt>
3491 <dd><p>size of the input frame, expressed in the form
3492 <var>width</var>x<var>height</var>
3495 <dt> ‘<samp>i</samp>’</dt>
3496 <dd><p>interlaced mode ("P" for "progressive", "T" for top field first, "B"
3497 for bottom field first)
3500 <dt> ‘<samp>iskey</samp>’</dt>
3501 <dd><p>1 if the frame is a key frame, 0 otherwise
3504 <dt> ‘<samp>type</samp>’</dt>
3505 <dd><p>picture type of the input frame ("I" for an I-frame, "P" for a
3506 P-frame, "B" for a B-frame, "?" for unknown type).
3507 Check also the documentation of the <code>AVPictureType</code> enum and of
3508 the <code>av_get_picture_type_char</code> function defined in
3509 ‘<tt>libavutil/avutil.h</tt>’.
3512 <dt> ‘<samp>checksum</samp>’</dt>
3513 <dd><p>Adler-32 checksum of all the planes of the input frame
3516 <dt> ‘<samp>plane_checksum</samp>’</dt>
3517 <dd><p>Adler-32 checksum of each plane of the input frame, expressed in the form
3518 "[<var>c0</var> <var>c1</var> <var>c2</var> <var>c3</var>]"
3522 <a name="slicify"></a>
3523 <h2 class="section"><a href="ffplay.html#toc-slicify">16.29 slicify</a></h2>
3525 <p>Pass the images of input video on to next video filter as multiple
3528 <table><tr><td> </td><td><pre class="example">./ffmpeg -i in.avi -vf "slicify=32" out.avi
3529 </pre></td></tr></table>
3531 <p>The filter accepts the slice height as parameter. If the parameter is
3532 not specified it will use the default value of 16.
3534 <p>Adding this in the beginning of filter chains should make filtering
3535 faster due to better use of the memory cache.
3537 <a name="split"></a>
3538 <h2 class="section"><a href="ffplay.html#toc-split">16.30 split</a></h2>
3540 <p>Pass on the input video to two outputs. Both outputs are identical to
3544 </p><table><tr><td> </td><td><pre class="example">[in] split [splitout1][splitout2];
3545 [splitout1] crop=100:100:0:0 [cropout];
3546 [splitout2] pad=200:200:100:100 [padout];
3547 </pre></td></tr></table>
3549 <p>will create two separate outputs from the same input, one cropped and
3552 <a name="transpose"></a>
3553 <h2 class="section"><a href="ffplay.html#toc-transpose">16.31 transpose</a></h2>
3555 <p>Transpose rows with columns in the input video and optionally flip it.
3557 <p>It accepts a parameter representing an integer, which can assume the
3560 <dl compact="compact">
3561 <dt> ‘<samp>0</samp>’</dt>
3562 <dd><p>Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
3563 </p><table><tr><td> </td><td><pre class="example">L.R L.l
3566 </pre></td></tr></table>
3569 <dt> ‘<samp>1</samp>’</dt>
3570 <dd><p>Rotate by 90 degrees clockwise, that is:
3571 </p><table><tr><td> </td><td><pre class="example">L.R l.L
3574 </pre></td></tr></table>
3577 <dt> ‘<samp>2</samp>’</dt>
3578 <dd><p>Rotate by 90 degrees counterclockwise, that is:
3579 </p><table><tr><td> </td><td><pre class="example">L.R R.r
3582 </pre></td></tr></table>
3585 <dt> ‘<samp>3</samp>’</dt>
3586 <dd><p>Rotate by 90 degrees clockwise and vertically flip, that is:
3587 </p><table><tr><td> </td><td><pre class="example">L.R r.R
3590 </pre></td></tr></table>
3594 <a name="unsharp"></a>
3595 <h2 class="section"><a href="ffplay.html#toc-unsharp">16.32 unsharp</a></h2>
3597 <p>Sharpen or blur the input video.
3599 <p>It accepts the following parameters:
3600 <var>luma_msize_x</var>:<var>luma_msize_y</var>:<var>luma_amount</var>:<var>chroma_msize_x</var>:<var>chroma_msize_y</var>:<var>chroma_amount</var>
3602 <p>Negative values for the amount will blur the input video, while positive
3603 values will sharpen. All parameters are optional and default to the
3604 equivalent of the string ’5:5:1.0:0:0:0.0’.
3606 <dl compact="compact">
3607 <dt> ‘<samp>luma_msize_x</samp>’</dt>
3608 <dd><p>Set the luma matrix horizontal size. It can be an integer between 3
3609 and 13, default value is 5.
3612 <dt> ‘<samp>luma_msize_y</samp>’</dt>
3613 <dd><p>Set the luma matrix vertical size. It can be an integer between 3
3614 and 13, default value is 5.
3617 <dt> ‘<samp>luma_amount</samp>’</dt>
3618 <dd><p>Set the luma effect strength. It can be a float number between -2.0
3619 and 5.0, default value is 1.0.
3622 <dt> ‘<samp>chroma_msize_x</samp>’</dt>
3623 <dd><p>Set the chroma matrix horizontal size. It can be an integer between 3
3624 and 13, default value is 0.
3627 <dt> ‘<samp>chroma_msize_y</samp>’</dt>
3628 <dd><p>Set the chroma matrix vertical size. It can be an integer between 3
3629 and 13, default value is 0.
3632 <dt> ‘<samp>luma_amount</samp>’</dt>
3633 <dd><p>Set the chroma effect strength. It can be a float number between -2.0
3634 and 5.0, default value is 0.0.
3639 <table><tr><td> </td><td><pre class="example"># Strong luma sharpen effect parameters
3642 # Strong blur of both luma and chroma parameters
3643 unsharp=7:7:-2:7:7:-2
3645 # Use the default values with <code>ffmpeg</code>
3646 ./ffmpeg -i in.avi -vf "unsharp" out.mp4
3647 </pre></td></tr></table>
3649 <a name="vflip"></a>
3650 <h2 class="section"><a href="ffplay.html#toc-vflip">16.33 vflip</a></h2>
3652 <p>Flip the input video vertically.
3654 <table><tr><td> </td><td><pre class="example">./ffmpeg -i in.avi -vf "vflip" out.avi
3655 </pre></td></tr></table>
3657 <a name="yadif"></a>
3658 <h2 class="section"><a href="ffplay.html#toc-yadif">16.34 yadif</a></h2>
3660 <p>Deinterlace the input video ("yadif" means "yet another deinterlacing
3663 <p>It accepts the optional parameters: <var>mode</var>:<var>parity</var>.
3665 <p><var>mode</var> specifies the interlacing mode to adopt, accepts one of the
3668 <dl compact="compact">
3669 <dt> ‘<samp>0</samp>’</dt>
3670 <dd><p>output 1 frame for each frame
3672 <dt> ‘<samp>1</samp>’</dt>
3673 <dd><p>output 1 frame for each field
3675 <dt> ‘<samp>2</samp>’</dt>
3676 <dd><p>like 0 but skips spatial interlacing check
3678 <dt> ‘<samp>3</samp>’</dt>
3679 <dd><p>like 1 but skips spatial interlacing check
3683 <p>Default value is 0.
3685 <p><var>parity</var> specifies the picture field parity assumed for the input
3686 interlaced video, accepts one of the following values:
3688 <dl compact="compact">
3689 <dt> ‘<samp>0</samp>’</dt>
3690 <dd><p>assume bottom field first
3692 <dt> ‘<samp>1</samp>’</dt>
3693 <dd><p>assume top field first
3695 <dt> ‘<samp>-1</samp>’</dt>
3696 <dd><p>enable automatic detection
3700 <p>Default value is -1.
3701 If interlacing is unknown or decoder does not export this information,
3702 top field first will be assumed.
3705 <a name="Video-Sources"></a>
3706 <h1 class="chapter"><a href="ffplay.html#toc-Video-Sources">17. Video Sources</a></h1>
3708 <p>Below is a description of the currently available video sources.
3710 <a name="buffer"></a>
3711 <h2 class="section"><a href="ffplay.html#toc-buffer">17.1 buffer</a></h2>
3713 <p>Buffer video frames, and make them available to the filter chain.
3715 <p>This source is mainly intended for a programmatic use, in particular
3716 through the interface defined in ‘<tt>libavfilter/vsrc_buffer.h</tt>’.
3718 <p>It accepts the following parameters:
3719 <var>width</var>:<var>height</var>:<var>pix_fmt_string</var>:<var>timebase_num</var>:<var>timebase_den</var>:<var>sample_aspect_ratio_num</var>:<var>sample_aspect_ratio.den</var>:<var>scale_params</var>
3721 <p>All the parameters but <var>scale_params</var> need to be explicitely
3724 <p>Follows the list of the accepted parameters.
3726 <dl compact="compact">
3727 <dt> ‘<samp>width, height</samp>’</dt>
3728 <dd><p>Specify the width and height of the buffered video frames.
3731 <dt> ‘<samp>pix_fmt_string</samp>’</dt>
3732 <dd><p>A string representing the pixel format of the buffered video frames.
3733 It may be a number corresponding to a pixel format, or a pixel format
3737 <dt> ‘<samp>timebase_num, timebase_den</samp>’</dt>
3738 <dd><p>Specify numerator and denomitor of the timebase assumed by the
3739 timestamps of the buffered frames.
3742 <dt> ‘<samp>sample_aspect_ratio.num, sample_aspect_ratio.den</samp>’</dt>
3743 <dd><p>Specify numerator and denominator of the sample aspect ratio assumed
3744 by the video frames.
3747 <dt> ‘<samp>scale_params</samp>’</dt>
3748 <dd><p>Specify the optional parameters to be used for the scale filter which
3749 is automatically inserted when an input change is detected in the
3750 input size or format.
3755 </p><table><tr><td> </td><td><pre class="example">buffer=320:240:yuv410p:1:24:1:1
3756 </pre></td></tr></table>
3758 <p>will instruct the source to accept video frames with size 320x240 and
3759 with format "yuv410p", assuming 1/24 as the timestamps timebase and
3760 square pixels (1:1 sample aspect ratio).
3761 Since the pixel format with name "yuv410p" corresponds to the number 6
3762 (check the enum PixelFormat definition in ‘<tt>libavutil/pixfmt.h</tt>’),
3763 this example corresponds to:
3764 </p><table><tr><td> </td><td><pre class="example">buffer=320:240:6:1:24:1:1
3765 </pre></td></tr></table>
3767 <a name="color"></a>
3768 <h2 class="section"><a href="ffplay.html#toc-color">17.2 color</a></h2>
3770 <p>Provide an uniformly colored input.
3772 <p>It accepts the following parameters:
3773 <var>color</var>:<var>frame_size</var>:<var>frame_rate</var>
3775 <p>Follows the description of the accepted parameters.
3777 <dl compact="compact">
3778 <dt> ‘<samp>color</samp>’</dt>
3779 <dd><p>Specify the color of the source. It can be the name of a color (case
3780 insensitive match) or a 0xRRGGBB[AA] sequence, possibly followed by an
3781 alpha specifier. The default value is "black".
3784 <dt> ‘<samp>frame_size</samp>’</dt>
3785 <dd><p>Specify the size of the sourced video, it may be a string of the form
3786 <var>width</var>x<var>heigth</var>, or the name of a size abbreviation. The
3787 default value is "320x240".
3790 <dt> ‘<samp>frame_rate</samp>’</dt>
3791 <dd><p>Specify the frame rate of the sourced video, as the number of frames
3792 generated per second. It has to be a string in the format
3793 <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a float
3794 number or a valid video frame rate abbreviation. The default value is
3800 <p>For example the following graph description will generate a red source
3801 with an opacity of 0.2, with size "qcif" and a frame rate of 10
3802 frames per second, which will be overlayed over the source connected
3803 to the pad with identifier "in".
3805 <table><tr><td> </td><td><pre class="example">"color=red@0.2:qcif:10 [color]; [in][color] overlay [out]"
3806 </pre></td></tr></table>
3808 <a name="movie"></a>
3809 <h2 class="section"><a href="ffplay.html#toc-movie">17.3 movie</a></h2>
3811 <p>Read a video stream from a movie container.
3813 <p>It accepts the syntax: <var>movie_name</var>[:<var>options</var>] where
3814 <var>movie_name</var> is the name of the resource to read (not necessarily
3815 a file but also a device or a stream accessed through some protocol),
3816 and <var>options</var> is an optional sequence of <var>key</var>=<var>value</var>
3817 pairs, separated by ":".
3819 <p>The description of the accepted options follows.
3821 <dl compact="compact">
3822 <dt> ‘<samp>format_name, f</samp>’</dt>
3823 <dd><p>Specifies the format assumed for the movie to read, and can be either
3824 the name of a container or an input device. If not specified the
3825 format is guessed from <var>movie_name</var> or by probing.
3828 <dt> ‘<samp>seek_point, sp</samp>’</dt>
3829 <dd><p>Specifies the seek point in seconds, the frames will be output
3830 starting from this seek point, the parameter is evaluated with
3831 <code>av_strtod</code> so the numerical value may be suffixed by an IS
3832 postfix. Default value is "0".
3835 <dt> ‘<samp>stream_index, si</samp>’</dt>
3836 <dd><p>Specifies the index of the video stream to read. If the value is -1,
3837 the best suited video stream will be automatically selected. Default
3838 value is "-1".
3843 <p>This filter allows to overlay a second video on top of main input of
3844 a filtergraph as shown in this graph:
3845 </p><table><tr><td> </td><td><pre class="example">input -----------> deltapts0 --> overlay --> output
3848 movie --> scale--> deltapts1 -------+
3849 </pre></td></tr></table>
3851 <p>Some examples follow:
3852 </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
3853 # on top of the input labelled as "in".
3854 movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [movie];
3855 [in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
3857 # read from a video4linux2 device, and overlay it on top of the input
3858 # labelled as "in"
3859 movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [movie];
3860 [in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
3862 </pre></td></tr></table>
3864 <a name="nullsrc"></a>
3865 <h2 class="section"><a href="ffplay.html#toc-nullsrc">17.4 nullsrc</a></h2>
3867 <p>Null video source, never return images. It is mainly useful as a
3868 template and to be employed in analysis / debugging tools.
3870 <p>It accepts as optional parameter a string of the form
3871 <var>width</var>:<var>height</var>:<var>timebase</var>.
3873 <p><var>width</var> and <var>height</var> specify the size of the configured
3874 source. The default values of <var>width</var> and <var>height</var> are
3875 respectively 352 and 288 (corresponding to the CIF size format).
3877 <p><var>timebase</var> specifies an arithmetic expression representing a
3878 timebase. The expression can contain the constants "PI", "E", "PHI",
3879 "AVTB" (the default timebase), and defaults to the value "AVTB".
3881 <a name="frei0r_005fsrc"></a>
3882 <h2 class="section"><a href="ffplay.html#toc-frei0r_005fsrc">17.5 frei0r_src</a></h2>
3884 <p>Provide a frei0r source.
3886 <p>To enable compilation of this filter you need to install the frei0r
3887 header and configure FFmpeg with –enable-frei0r.
3889 <p>The source supports the syntax:
3890 </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>]
3891 </pre></td></tr></table>
3893 <p><var>size</var> is the size of the video to generate, may be a string of the
3894 form <var>width</var>x<var>height</var> or a frame size abbreviation.
3895 <var>rate</var> is the rate of the video to generate, may be a string of
3896 the form <var>num</var>/<var>den</var> or a frame rate abbreviation.
3897 <var>src_name</var> is the name to the frei0r source to load. For more
3898 information regarding frei0r and how to set the parameters read the
3899 section "frei0r" (see <a href="#frei0r">frei0r</a>) in the description of the video
3902 <p>Some examples follow:
3903 </p><table><tr><td> </td><td><pre class="example"># generate a frei0r partik0l source with size 200x200 and framerate 10
3904 # which is overlayed on the overlay filter main input
3905 frei0r_src=200x200:10:partik0l=1234 [overlay]; [in][overlay] overlay
3906 </pre></td></tr></table>
3909 <a name="Video-Sinks"></a>
3910 <h1 class="chapter"><a href="ffplay.html#toc-Video-Sinks">18. Video Sinks</a></h1>
3912 <p>Below is a description of the currently available video sinks.
3914 <a name="nullsink"></a>
3915 <h2 class="section"><a href="ffplay.html#toc-nullsink">18.1 nullsink</a></h2>
3917 <p>Null video sink, do absolutely nothing with the input video. It is
3918 mainly useful as a template and to be employed in analysis / debugging
3927 This document was generated by <em>Kyle Schwarz</em> on <em>June 10, 2011</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.