]> git.sesse.net Git - casparcg/blob - ffmpeg 0.7/doc/libavfilter.html
2.0.2: INFO TEMPLATE works on both compressed and uncompressed templates.
[casparcg] / ffmpeg 0.7 / doc / libavfilter.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
2 <html>
3 <!-- Created on June 10, 2011 by texi2html 1.82
4 texi2html was written by: 
5             Lionel Cons <Lionel.Cons@cern.ch> (original author)
6             Karl Berry  <karl@freefriends.org>
7             Olaf Bachmann <obachman@mathematik.uni-kl.de>
8             and many others.
9 Maintained by: Many creative people.
10 Send bugs and suggestions to <texi2html-bug@nongnu.org>
11 -->
12 <head>
13 <title>Libavfilter Documentation</title>
14
15 <meta name="description" content="Libavfilter Documentation">
16 <meta name="keywords" content="Libavfilter Documentation">
17 <meta name="resource-type" content="document">
18 <meta name="distribution" content="global">
19 <meta name="Generator" content="texi2html 1.82">
20 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
21 <style type="text/css">
22 <!--
23 a.summary-letter {text-decoration: none}
24 blockquote.smallquotation {font-size: smaller}
25 pre.display {font-family: serif}
26 pre.format {font-family: serif}
27 pre.menu-comment {font-family: serif}
28 pre.menu-preformatted {font-family: serif}
29 pre.smalldisplay {font-family: serif; font-size: smaller}
30 pre.smallexample {font-size: smaller}
31 pre.smallformat {font-family: serif; font-size: smaller}
32 pre.smalllisp {font-size: smaller}
33 span.roman {font-family:serif; font-weight:normal;}
34 span.sansserif {font-family:sans-serif; font-weight:normal;}
35 ul.toc {list-style: none}
36 -->
37 </style>
38
39
40 </head>
41
42 <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
43
44 <a name="SEC_Top"></a>
45 <h1 class="settitle">Libavfilter Documentation</h1>
46
47 <a name="SEC_Contents"></a>
48 <h1>Table of Contents</h1>
49 <div class="contents">
50
51 <ul class="toc">
52   <li><a name="toc-Introduction" href="#Introduction">1. Introduction</a></li>
53   <li><a name="toc-Tutorial" href="#Tutorial">2. Tutorial</a></li>
54   <li><a name="toc-graph2dot" href="#graph2dot">3. graph2dot</a></li>
55   <li><a name="toc-Filtergraph-description" href="#Filtergraph-description">4. Filtergraph description</a>
56   <ul class="toc">
57     <li><a name="toc-Filtergraph-syntax" href="#Filtergraph-syntax">4.1 Filtergraph syntax</a></li>
58   </ul></li>
59   <li><a name="toc-Audio-Filters" href="#Audio-Filters">5. Audio Filters</a>
60   <ul class="toc">
61     <li><a name="toc-anull" href="#anull">5.1 anull</a></li>
62   </ul></li>
63   <li><a name="toc-Audio-Sources" href="#Audio-Sources">6. Audio Sources</a>
64   <ul class="toc">
65     <li><a name="toc-anullsrc" href="#anullsrc">6.1 anullsrc</a></li>
66   </ul></li>
67   <li><a name="toc-Audio-Sinks" href="#Audio-Sinks">7. Audio Sinks</a>
68   <ul class="toc">
69     <li><a name="toc-anullsink" href="#anullsink">7.1 anullsink</a></li>
70   </ul></li>
71   <li><a name="toc-Video-Filters" href="#Video-Filters">8. Video Filters</a>
72   <ul class="toc">
73     <li><a name="toc-blackframe" href="#blackframe">8.1 blackframe</a></li>
74     <li><a name="toc-copy" href="#copy">8.2 copy</a></li>
75     <li><a name="toc-crop" href="#crop">8.3 crop</a></li>
76     <li><a name="toc-cropdetect" href="#cropdetect">8.4 cropdetect</a></li>
77     <li><a name="toc-drawbox" href="#drawbox">8.5 drawbox</a></li>
78     <li><a name="toc-drawtext" href="#drawtext">8.6 drawtext</a></li>
79     <li><a name="toc-fade" href="#fade">8.7 fade</a></li>
80     <li><a name="toc-fieldorder" href="#fieldorder">8.8 fieldorder</a></li>
81     <li><a name="toc-fifo" href="#fifo">8.9 fifo</a></li>
82     <li><a name="toc-format" href="#format">8.10 format</a></li>
83     <li><a name="toc-frei0r-1" href="#frei0r-1">8.11 frei0r</a></li>
84     <li><a name="toc-gradfun" href="#gradfun">8.12 gradfun</a></li>
85     <li><a name="toc-hflip" href="#hflip">8.13 hflip</a></li>
86     <li><a name="toc-hqdn3d" href="#hqdn3d">8.14 hqdn3d</a></li>
87     <li><a name="toc-mp" href="#mp">8.15 mp</a></li>
88     <li><a name="toc-noformat" href="#noformat">8.16 noformat</a></li>
89     <li><a name="toc-null" href="#null">8.17 null</a></li>
90     <li><a name="toc-ocv" href="#ocv">8.18 ocv</a>
91     <ul class="toc">
92       <li><a name="toc-dilate-1" href="#dilate-1">8.18.1 dilate</a></li>
93       <li><a name="toc-erode" href="#erode">8.18.2 erode</a></li>
94       <li><a name="toc-smooth" href="#smooth">8.18.3 smooth</a></li>
95     </ul></li>
96     <li><a name="toc-overlay" href="#overlay">8.19 overlay</a></li>
97     <li><a name="toc-pad" href="#pad">8.20 pad</a></li>
98     <li><a name="toc-pixdesctest" href="#pixdesctest">8.21 pixdesctest</a></li>
99     <li><a name="toc-scale" href="#scale">8.22 scale</a></li>
100     <li><a name="toc-select" href="#select">8.23 select</a></li>
101     <li><a name="toc-setdar-1" href="#setdar-1">8.24 setdar</a></li>
102     <li><a name="toc-setpts" href="#setpts">8.25 setpts</a></li>
103     <li><a name="toc-setsar-1" href="#setsar-1">8.26 setsar</a></li>
104     <li><a name="toc-settb" href="#settb">8.27 settb</a></li>
105     <li><a name="toc-showinfo" href="#showinfo">8.28 showinfo</a></li>
106     <li><a name="toc-slicify" href="#slicify">8.29 slicify</a></li>
107     <li><a name="toc-split" href="#split">8.30 split</a></li>
108     <li><a name="toc-transpose" href="#transpose">8.31 transpose</a></li>
109     <li><a name="toc-unsharp" href="#unsharp">8.32 unsharp</a></li>
110     <li><a name="toc-vflip" href="#vflip">8.33 vflip</a></li>
111     <li><a name="toc-yadif" href="#yadif">8.34 yadif</a></li>
112   </ul></li>
113   <li><a name="toc-Video-Sources" href="#Video-Sources">9. Video Sources</a>
114   <ul class="toc">
115     <li><a name="toc-buffer" href="#buffer">9.1 buffer</a></li>
116     <li><a name="toc-color" href="#color">9.2 color</a></li>
117     <li><a name="toc-movie" href="#movie">9.3 movie</a></li>
118     <li><a name="toc-nullsrc" href="#nullsrc">9.4 nullsrc</a></li>
119     <li><a name="toc-frei0r_005fsrc" href="#frei0r_005fsrc">9.5 frei0r_src</a></li>
120   </ul></li>
121   <li><a name="toc-Video-Sinks" href="#Video-Sinks">10. Video Sinks</a>
122   <ul class="toc">
123     <li><a name="toc-nullsink" href="#nullsink">10.1 nullsink</a></li>
124   </ul>
125 </li>
126 </ul>
127 </div>
128
129 <hr size="1">
130 <a name="Introduction"></a>
131 <h1 class="chapter"><a href="libavfilter.html#toc-Introduction">1. Introduction</a></h1>
132
133 <p>Libavfilter is the filtering API of FFmpeg. It is the substitute of the
134 now deprecated &rsquo;vhooks&rsquo; and started as a Google Summer of Code project.
135 </p>
136 <p>Integrating libavfilter into the main FFmpeg repository is a work in
137 progress. If you wish to try the unfinished development code of
138 libavfilter then check it out from the libavfilter repository into
139 some directory of your choice by:
140 </p>
141 <table><tr><td>&nbsp;</td><td><pre class="example">   svn checkout svn://svn.ffmpeg.org/soc/libavfilter
142 </pre></td></tr></table>
143
144 <p>And then read the README file in the top directory to learn how to
145 integrate it into ffmpeg and ffplay.
146 </p>
147 <p>But note that there may still be serious bugs in the code and its API
148 and ABI should not be considered stable yet!
149 </p>
150 <a name="Tutorial"></a>
151 <h1 class="chapter"><a href="libavfilter.html#toc-Tutorial">2. Tutorial</a></h1>
152
153 <p>In libavfilter, it is possible for filters to have multiple inputs and
154 multiple outputs.
155 To illustrate the sorts of things that are possible, we can
156 use a complex filter graph. For example, the following one:
157 </p>
158 <table><tr><td>&nbsp;</td><td><pre class="example">input --&gt; split --&gt; fifo -----------------------&gt; overlay --&gt; output
159             |                                        ^
160             |                                        |
161             +------&gt; fifo --&gt; crop --&gt; vflip --------+
162 </pre></td></tr></table>
163
164 <p>splits the stream in two streams, sends one stream through the crop filter
165 and the vflip filter before merging it back with the other stream by
166 overlaying it on top. You can use the following command to achieve this:
167 </p>
168 <table><tr><td>&nbsp;</td><td><pre class="example">./ffmpeg -i in.avi -s 240x320 -vf &quot;[in] split [T1], fifo, [T2] overlay= 0:240 [out]; [T1] fifo, crop=0:0:-1:240, vflip [T2]
169 </pre></td></tr></table>
170
171 <p>where input_video.avi has a vertical resolution of 480 pixels. The
172 result will be that in output the top half of the video is mirrored
173 onto the bottom half.
174 </p>
175 <p>Video filters are loaded using the <var>-vf</var> option passed to
176 ffmpeg or to ffplay. Filters in the same linear chain are separated by
177 commas. In our example, <var>split, fifo, overlay</var> are in one linear
178 chain, and <var>fifo, crop, vflip</var> are in another. The points where
179 the linear chains join are labeled by names enclosed in square
180 brackets. In our example, that is <var>[T1]</var> and <var>[T2]</var>. The magic
181 labels <var>[in]</var> and <var>[out]</var> are the points where video is input
182 and output.
183 </p>
184 <p>Some filters take in input a list of parameters: they are specified
185 after the filter name and an equal sign, and are separated each other
186 by a semicolon.
187 </p>
188 <p>There exist so-called <var>source filters</var> that do not have a video
189 input, and we expect in the future some <var>sink filters</var> that will
190 not have video output.
191 </p>
192 <a name="graph2dot"></a>
193 <h1 class="chapter"><a href="libavfilter.html#toc-graph2dot">3. graph2dot</a></h1>
194
195 <p>The &lsquo;<tt>graph2dot</tt>&rsquo; program included in the FFmpeg &lsquo;<tt>tools</tt>&rsquo;
196 directory can be used to parse a filter graph description and issue a
197 corresponding textual representation in the dot language.
198 </p>
199 <p>Invoke the command:
200 </p><table><tr><td>&nbsp;</td><td><pre class="example">graph2dot -h
201 </pre></td></tr></table>
202
203 <p>to see how to use &lsquo;<tt>graph2dot</tt>&rsquo;.
204 </p>
205 <p>You can then pass the dot description to the &lsquo;<tt>dot</tt>&rsquo; program (from
206 the graphviz suite of programs) and obtain a graphical representation
207 of the filter graph.
208 </p>
209 <p>For example the sequence of commands:
210 </p><table><tr><td>&nbsp;</td><td><pre class="example">echo <var>GRAPH_DESCRIPTION</var> | \
211 tools/graph2dot -o graph.tmp &amp;&amp; \
212 dot -Tpng graph.tmp -o graph.png &amp;&amp; \
213 display graph.png
214 </pre></td></tr></table>
215
216 <p>can be used to create and display an image representing the graph
217 described by the <var>GRAPH_DESCRIPTION</var> string.
218 </p>
219 <a name="Filtergraph-description"></a>
220 <h1 class="chapter"><a href="libavfilter.html#toc-Filtergraph-description">4. Filtergraph description</a></h1>
221
222 <p>A filtergraph is a directed graph of connected filters. It can contain
223 cycles, and there can be multiple links between a pair of
224 filters. Each link has one input pad on one side connecting it to one
225 filter from which it takes its input, and one output pad on the other
226 side connecting it to the one filter accepting its output.
227 </p>
228 <p>Each filter in a filtergraph is an instance of a filter class
229 registered in the application, which defines the features and the
230 number of input and output pads of the filter.
231 </p>
232 <p>A filter with no input pads is called a &quot;source&quot;, a filter with no
233 output pads is called a &quot;sink&quot;.
234 </p>
235 <a name="Filtergraph-syntax"></a>
236 <h2 class="section"><a href="libavfilter.html#toc-Filtergraph-syntax">4.1 Filtergraph syntax</a></h2>
237
238 <p>A filtergraph can be represented using a textual representation, which
239 is recognized by the <code>-vf</code> and <code>-af</code> options of the ff*
240 tools, and by the <code>av_parse_graph()</code> function defined in
241 &lsquo;<tt>libavfilter/avfiltergraph</tt>&rsquo;.
242 </p>
243 <p>A filterchain consists of a sequence of connected filters, each one
244 connected to the previous one in the sequence. A filterchain is
245 represented by a list of &quot;,&quot;-separated filter descriptions.
246 </p>
247 <p>A filtergraph consists of a sequence of filterchains. A sequence of
248 filterchains is represented by a list of &quot;;&quot;-separated filterchain
249 descriptions.
250 </p>
251 <p>A filter is represented by a string of the form:
252 [<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>]
253 </p>
254 <p><var>filter_name</var> is the name of the filter class of which the
255 described filter is an instance of, and has to be the name of one of
256 the filter classes registered in the program.
257 The name of the filter class is optionally followed by a string
258 &quot;=<var>arguments</var>&quot;.
259 </p>
260 <p><var>arguments</var> is a string which contains the parameters used to
261 initialize the filter instance, and are described in the filter
262 descriptions below.
263 </p>
264 <p>The list of arguments can be quoted using the character &quot;&rsquo;&quot; as initial
265 and ending mark, and the character &rsquo;\&rsquo; for escaping the characters
266 within the quoted text; otherwise the argument string is considered
267 terminated when the next special character (belonging to the set
268 &quot;[]=;,&quot;) is encountered.
269 </p>
270 <p>The name and arguments of the filter are optionally preceded and
271 followed by a list of link labels.
272 A link label allows to name a link and associate it to a filter output
273 or input pad. The preceding labels <var>in_link_1</var>
274 ... <var>in_link_N</var>, are associated to the filter input pads,
275 the following labels <var>out_link_1</var> ... <var>out_link_M</var>, are
276 associated to the output pads.
277 </p>
278 <p>When two link labels with the same name are found in the
279 filtergraph, a link between the corresponding input and output pad is
280 created.
281 </p>
282 <p>If an output pad is not labelled, it is linked by default to the first
283 unlabelled input pad of the next filter in the filterchain.
284 For example in the filterchain:
285 </p><table><tr><td>&nbsp;</td><td><pre class="example">nullsrc, split[L1], [L2]overlay, nullsink
286 </pre></td></tr></table>
287 <p>the split filter instance has two output pads, and the overlay filter
288 instance two input pads. The first output pad of split is labelled
289 &quot;L1&quot;, the first input pad of overlay is labelled &quot;L2&quot;, and the second
290 output pad of split is linked to the second input pad of overlay,
291 which are both unlabelled.
292 </p>
293 <p>In a complete filterchain all the unlabelled filter input and output
294 pads must be connected. A filtergraph is considered valid if all the
295 filter input and output pads of all the filterchains are connected.
296 </p>
297 <p>Follows a BNF description for the filtergraph syntax:
298 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>NAME</var>             ::= sequence of alphanumeric characters and '_'
299 <var>LINKLABEL</var>        ::= &quot;[&quot; <var>NAME</var> &quot;]&quot;
300 <var>LINKLABELS</var>       ::= <var>LINKLABEL</var> [<var>LINKLABELS</var>]
301 <var>FILTER_ARGUMENTS</var> ::= sequence of chars (eventually quoted)
302 <var>FILTER</var>           ::= [<var>LINKNAMES</var>] <var>NAME</var> [&quot;=&quot; <var>ARGUMENTS</var>] [<var>LINKNAMES</var>]
303 <var>FILTERCHAIN</var>      ::= <var>FILTER</var> [,<var>FILTERCHAIN</var>]
304 <var>FILTERGRAPH</var>      ::= <var>FILTERCHAIN</var> [;<var>FILTERGRAPH</var>]
305 </pre></td></tr></table>
306
307
308 <a name="Audio-Filters"></a>
309 <h1 class="chapter"><a href="libavfilter.html#toc-Audio-Filters">5. Audio Filters</a></h1>
310
311 <p>When you configure your FFmpeg build, you can disable any of the
312 existing filters using &ndash;disable-filters.
313 The configure output will show the audio filters included in your
314 build.
315 </p>
316 <p>Below is a description of the currently available audio filters.
317 </p>
318 <a name="anull"></a>
319 <h2 class="section"><a href="libavfilter.html#toc-anull">5.1 anull</a></h2>
320
321 <p>Pass the audio source unchanged to the output.
322 </p>
323
324 <a name="Audio-Sources"></a>
325 <h1 class="chapter"><a href="libavfilter.html#toc-Audio-Sources">6. Audio Sources</a></h1>
326
327 <p>Below is a description of the currently available audio sources.
328 </p>
329 <a name="anullsrc"></a>
330 <h2 class="section"><a href="libavfilter.html#toc-anullsrc">6.1 anullsrc</a></h2>
331
332 <p>Null audio source, never return audio frames. It is mainly useful as a
333 template and to be employed in analysis / debugging tools.
334 </p>
335 <p>It accepts as optional parameter a string of the form
336 <var>sample_rate</var>:<var>channel_layout</var>.
337 </p>
338 <p><var>sample_rate</var> specify the sample rate, and defaults to 44100.
339 </p>
340 <p><var>channel_layout</var> specify the channel layout, and can be either an
341 integer or a string representing a channel layout. The default value
342 of <var>channel_layout</var> is 3, which corresponds to CH_LAYOUT_STEREO.
343 </p>
344 <p>Check the channel_layout_map definition in
345 &lsquo;<tt>libavcodec/audioconvert.c</tt>&rsquo; for the mapping between strings and
346 channel layout values.
347 </p>
348 <p>Follow some examples:
349 </p><table><tr><td>&nbsp;</td><td><pre class="example">#  set the sample rate to 48000 Hz and the channel layout to CH_LAYOUT_MONO.
350 anullsrc=48000:4
351
352 # same as
353 anullsrc=48000:mono
354 </pre></td></tr></table>
355
356
357 <a name="Audio-Sinks"></a>
358 <h1 class="chapter"><a href="libavfilter.html#toc-Audio-Sinks">7. Audio Sinks</a></h1>
359
360 <p>Below is a description of the currently available audio sinks.
361 </p>
362 <a name="anullsink"></a>
363 <h2 class="section"><a href="libavfilter.html#toc-anullsink">7.1 anullsink</a></h2>
364
365 <p>Null audio sink, do absolutely nothing with the input audio. It is
366 mainly useful as a template and to be employed in analysis / debugging
367 tools.
368 </p>
369
370 <a name="Video-Filters"></a>
371 <h1 class="chapter"><a href="libavfilter.html#toc-Video-Filters">8. Video Filters</a></h1>
372
373 <p>When you configure your FFmpeg build, you can disable any of the
374 existing filters using &ndash;disable-filters.
375 The configure output will show the video filters included in your
376 build.
377 </p>
378 <p>Below is a description of the currently available video filters.
379 </p>
380 <a name="blackframe"></a>
381 <h2 class="section"><a href="libavfilter.html#toc-blackframe">8.1 blackframe</a></h2>
382
383 <p>Detect frames that are (almost) completely black. Can be useful to
384 detect chapter transitions or commercials. Output lines consist of
385 the frame number of the detected frame, the percentage of blackness,
386 the position in the file if known or -1 and the timestamp in seconds.
387 </p>
388 <p>In order to display the output lines, you need to set the loglevel at
389 least to the AV_LOG_INFO value.
390 </p>
391 <p>The filter accepts the syntax:
392 </p><table><tr><td>&nbsp;</td><td><pre class="example">blackframe[=<var>amount</var>:[<var>threshold</var>]]
393 </pre></td></tr></table>
394
395 <p><var>amount</var> is the percentage of the pixels that have to be below the
396 threshold, and defaults to 98.
397 </p>
398 <p><var>threshold</var> is the threshold below which a pixel value is
399 considered black, and defaults to 32.
400 </p>
401 <a name="copy"></a>
402 <h2 class="section"><a href="libavfilter.html#toc-copy">8.2 copy</a></h2>
403
404 <p>Copy the input source unchanged to the output. Mainly useful for
405 testing purposes.
406 </p>
407 <a name="crop"></a>
408 <h2 class="section"><a href="libavfilter.html#toc-crop">8.3 crop</a></h2>
409
410 <p>Crop the input video to <var>out_w</var>:<var>out_h</var>:<var>x</var>:<var>y</var>.
411 </p>
412 <p>The parameters are expressions containing the following constants:
413 </p>
414 <dl compact="compact">
415 <dt> &lsquo;<samp>E, PI, PHI</samp>&rsquo;</dt>
416 <dd><p>the corresponding mathematical approximated values for e
417 (euler number), pi (greek PI), PHI (golden ratio)
418 </p>
419 </dd>
420 <dt> &lsquo;<samp>x, y</samp>&rsquo;</dt>
421 <dd><p>the computed values for <var>x</var> and <var>y</var>. They are evaluated for
422 each new frame.
423 </p>
424 </dd>
425 <dt> &lsquo;<samp>in_w, in_h</samp>&rsquo;</dt>
426 <dd><p>the input width and heigth
427 </p>
428 </dd>
429 <dt> &lsquo;<samp>iw, ih</samp>&rsquo;</dt>
430 <dd><p>same as <var>in_w</var> and <var>in_h</var>
431 </p>
432 </dd>
433 <dt> &lsquo;<samp>out_w, out_h</samp>&rsquo;</dt>
434 <dd><p>the output (cropped) width and heigth
435 </p>
436 </dd>
437 <dt> &lsquo;<samp>ow, oh</samp>&rsquo;</dt>
438 <dd><p>same as <var>out_w</var> and <var>out_h</var>
439 </p>
440 </dd>
441 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
442 <dd><p>the number of input frame, starting from 0
443 </p>
444 </dd>
445 <dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
446 <dd><p>the position in the file of the input frame, NAN if unknown
447 </p>
448 </dd>
449 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
450 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
451 </p>
452 </dd>
453 </dl>
454
455 <p>The <var>out_w</var> and <var>out_h</var> parameters specify the expressions for
456 the width and height of the output (cropped) video. They are
457 evaluated just at the configuration of the filter.
458 </p>
459 <p>The default value of <var>out_w</var> is &quot;in_w&quot;, and the default value of
460 <var>out_h</var> is &quot;in_h&quot;.
461 </p>
462 <p>The expression for <var>out_w</var> may depend on the value of <var>out_h</var>,
463 and the expression for <var>out_h</var> may depend on <var>out_w</var>, but they
464 cannot depend on <var>x</var> and <var>y</var>, as <var>x</var> and <var>y</var> are
465 evaluated after <var>out_w</var> and <var>out_h</var>.
466 </p>
467 <p>The <var>x</var> and <var>y</var> parameters specify the expressions for the
468 position of the top-left corner of the output (non-cropped) area. They
469 are evaluated for each frame. If the evaluated value is not valid, it
470 is approximated to the nearest valid value.
471 </p>
472 <p>The default value of <var>x</var> is &quot;(in_w-out_w)/2&quot;, and the default
473 value for <var>y</var> is &quot;(in_h-out_h)/2&quot;, which set the cropped area at
474 the center of the input image.
475 </p>
476 <p>The expression for <var>x</var> may depend on <var>y</var>, and the expression
477 for <var>y</var> may depend on <var>x</var>.
478 </p>
479 <p>Follow some examples:
480 </p><table><tr><td>&nbsp;</td><td><pre class="example"># crop the central input area with size 100x100
481 crop=100:100
482
483 # crop the central input area with size 2/3 of the input video
484 &quot;crop=2/3*in_w:2/3*in_h&quot;
485
486 # crop the input video central square
487 crop=in_h
488
489 # delimit the rectangle with the top-left corner placed at position
490 # 100:100 and the right-bottom corner corresponding to the right-bottom
491 # corner of the input image.
492 crop=in_w-100:in_h-100:100:100
493
494 # crop 10 pixels from the left and right borders, and 20 pixels from
495 # the top and bottom borders
496 &quot;crop=in_w-2*10:in_h-2*20&quot;
497
498 # keep only the bottom right quarter of the input image
499 &quot;crop=in_w/2:in_h/2:in_w/2:in_h/2&quot;
500
501 # crop height for getting Greek harmony
502 &quot;crop=in_w:1/PHI*in_w&quot;
503
504 # trembling effect
505 &quot;crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(n/7)&quot;
506
507 # erratic camera effect depending on timestamp
508 &quot;crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(t*10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t*13)&quot;
509
510 # set x depending on the value of y
511 &quot;crop=in_w/2:in_h/2:y:10+10*sin(n/10)&quot;
512 </pre></td></tr></table>
513
514 <a name="cropdetect"></a>
515 <h2 class="section"><a href="libavfilter.html#toc-cropdetect">8.4 cropdetect</a></h2>
516
517 <p>Auto-detect crop size.
518 </p>
519 <p>Calculate necessary cropping parameters and prints the recommended
520 parameters through the logging system. The detected dimensions
521 correspond to the non-black area of the input video.
522 </p>
523 <p>It accepts the syntax:
524 </p><table><tr><td>&nbsp;</td><td><pre class="example">cropdetect[=<var>limit</var>[:<var>round</var>[:<var>reset</var>]]]
525 </pre></td></tr></table>
526
527 <dl compact="compact">
528 <dt> &lsquo;<samp>limit</samp>&rsquo;</dt>
529 <dd><p>Threshold, which can be optionally specified from nothing (0) to
530 everything (255), defaults to 24.
531 </p>
532 </dd>
533 <dt> &lsquo;<samp>round</samp>&rsquo;</dt>
534 <dd><p>Value which the width/height should be divisible by, defaults to
535 16. The offset is automatically adjusted to center the video. Use 2 to
536 get only even dimensions (needed for 4:2:2 video). 16 is best when
537 encoding to most video codecs.
538 </p>
539 </dd>
540 <dt> &lsquo;<samp>reset</samp>&rsquo;</dt>
541 <dd><p>Counter that determines after how many frames cropdetect will reset
542 the previously detected largest video area and start over to detect
543 the current optimal crop area. Defaults to 0.
544 </p>
545 <p>This can be useful when channel logos distort the video area. 0
546 indicates never reset and return the largest area encountered during
547 playback.
548 </p></dd>
549 </dl>
550
551 <a name="drawbox"></a>
552 <h2 class="section"><a href="libavfilter.html#toc-drawbox">8.5 drawbox</a></h2>
553
554 <p>Draw a colored box on the input image.
555 </p>
556 <p>It accepts the syntax:
557 </p><table><tr><td>&nbsp;</td><td><pre class="example">drawbox=<var>x</var>:<var>y</var>:<var>width</var>:<var>height</var>:<var>color</var>
558 </pre></td></tr></table>
559
560 <dl compact="compact">
561 <dt> &lsquo;<samp>x, y</samp>&rsquo;</dt>
562 <dd><p>Specify the top left corner coordinates of the box. Default to 0.
563 </p>
564 </dd>
565 <dt> &lsquo;<samp>width, height</samp>&rsquo;</dt>
566 <dd><p>Specify the width and height of the box, if 0 they are interpreted as
567 the input width and height. Default to 0.
568 </p>
569 </dd>
570 <dt> &lsquo;<samp>color</samp>&rsquo;</dt>
571 <dd><p>Specify the color of the box to write, it can be the name of a color
572 (case insensitive match) or a 0xRRGGBB[AA] sequence.
573 </p></dd>
574 </dl>
575
576 <p>Follow some examples:
577 </p><table><tr><td>&nbsp;</td><td><pre class="example"># draw a black box around the edge of the input image
578 drawbox
579
580 # draw a box with color red and an opacity of 50%
581 drawbox=10:20:200:60:red@0.5&quot;
582 </pre></td></tr></table>
583
584 <a name="drawtext"></a>
585 <h2 class="section"><a href="libavfilter.html#toc-drawtext">8.6 drawtext</a></h2>
586
587 <p>Draw text string or text from specified file on top of video using the
588 libfreetype library.
589 </p>
590 <p>To enable compilation of this filter you need to configure FFmpeg with
591 <code>--enable-libfreetype</code>.
592 </p>
593 <p>The filter also recognizes strftime() sequences in the provided text
594 and expands them accordingly. Check the documentation of strftime().
595 </p>
596 <p>The filter accepts parameters as a list of <var>key</var>=<var>value</var> pairs,
597 separated by &quot;:&quot;.
598 </p>
599 <p>The description of the accepted parameters follows.
600 </p>
601 <dl compact="compact">
602 <dt> &lsquo;<samp>fontfile</samp>&rsquo;</dt>
603 <dd><p>The font file to be used for drawing text. Path must be included.
604 This parameter is mandatory.
605 </p>
606 </dd>
607 <dt> &lsquo;<samp>text</samp>&rsquo;</dt>
608 <dd><p>The text string to be drawn. The text must be a sequence of UTF-8
609 encoded characters.
610 This parameter is mandatory if no file is specified with the parameter
611 <var>textfile</var>.
612 </p>
613 </dd>
614 <dt> &lsquo;<samp>textfile</samp>&rsquo;</dt>
615 <dd><p>A text file containing text to be drawn. The text must be a sequence
616 of UTF-8 encoded characters.
617 </p>
618 <p>This parameter is mandatory if no text string is specified with the
619 parameter <var>text</var>.
620 </p>
621 <p>If both text and textfile are specified, an error is thrown.
622 </p>
623 </dd>
624 <dt> &lsquo;<samp>x, y</samp>&rsquo;</dt>
625 <dd><p>The offsets where text will be drawn within the video frame.
626 Relative to the top/left border of the output image.
627 </p>
628 <p>The default value of <var>x</var> and <var>y</var> is 0.
629 </p>
630 </dd>
631 <dt> &lsquo;<samp>fontsize</samp>&rsquo;</dt>
632 <dd><p>The font size to be used for drawing text.
633 The default value of <var>fontsize</var> is 16.
634 </p>
635 </dd>
636 <dt> &lsquo;<samp>fontcolor</samp>&rsquo;</dt>
637 <dd><p>The color to be used for drawing fonts.
638 Either a string (e.g. &quot;red&quot;) or in 0xRRGGBB[AA] format
639 (e.g. &quot;0xff000033&quot;), possibly followed by an alpha specifier.
640 The default value of <var>fontcolor</var> is &quot;black&quot;.
641 </p>
642 </dd>
643 <dt> &lsquo;<samp>boxcolor</samp>&rsquo;</dt>
644 <dd><p>The color to be used for drawing box around text.
645 Either a string (e.g. &quot;yellow&quot;) or in 0xRRGGBB[AA] format
646 (e.g. &quot;0xff00ff&quot;), possibly followed by an alpha specifier.
647 The default value of <var>boxcolor</var> is &quot;white&quot;.
648 </p>
649 </dd>
650 <dt> &lsquo;<samp>box</samp>&rsquo;</dt>
651 <dd><p>Used to draw a box around text using background color.
652 Value should be either 1 (enable) or 0 (disable).
653 The default value of <var>box</var> is 0.
654 </p>
655 </dd>
656 <dt> &lsquo;<samp>shadowx, shadowy</samp>&rsquo;</dt>
657 <dd><p>The x and y offsets for the text shadow position with respect to the
658 position of the text. They can be either positive or negative
659 values. Default value for both is &quot;0&quot;.
660 </p>
661 </dd>
662 <dt> &lsquo;<samp>shadowcolor</samp>&rsquo;</dt>
663 <dd><p>The color to be used for drawing a shadow behind the drawn text.  It
664 can be a color name (e.g. &quot;yellow&quot;) or a string in the 0xRRGGBB[AA]
665 form (e.g. &quot;0xff00ff&quot;), possibly followed by an alpha specifier.
666 The default value of <var>shadowcolor</var> is &quot;black&quot;.
667 </p>
668 </dd>
669 <dt> &lsquo;<samp>ft_load_flags</samp>&rsquo;</dt>
670 <dd><p>Flags to be used for loading the fonts.
671 </p>
672 <p>The flags map the corresponding flags supported by libfreetype, and are
673 a combination of the following values:
674 </p><dl compact="compact">
675 <dt> <var>default</var></dt>
676 <dt> <var>no_scale</var></dt>
677 <dt> <var>no_hinting</var></dt>
678 <dt> <var>render</var></dt>
679 <dt> <var>no_bitmap</var></dt>
680 <dt> <var>vertical_layout</var></dt>
681 <dt> <var>force_autohint</var></dt>
682 <dt> <var>crop_bitmap</var></dt>
683 <dt> <var>pedantic</var></dt>
684 <dt> <var>ignore_global_advance_width</var></dt>
685 <dt> <var>no_recurse</var></dt>
686 <dt> <var>ignore_transform</var></dt>
687 <dt> <var>monochrome</var></dt>
688 <dt> <var>linear_design</var></dt>
689 <dt> <var>no_autohint</var></dt>
690 <dt> <var>end table</var></dt>
691 </dl>
692
693 <p>Default value is &quot;render&quot;.
694 </p>
695 <p>For more information consult the documentation for the FT_LOAD_*
696 libfreetype flags.
697 </p>
698 </dd>
699 <dt> &lsquo;<samp>tabsize</samp>&rsquo;</dt>
700 <dd><p>The size in number of spaces to use for rendering the tab.
701 Default value is 4.
702 </p></dd>
703 </dl>
704
705 <p>For example the command:
706 </p><table><tr><td>&nbsp;</td><td><pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'&quot;
707 </pre></td></tr></table>
708
709 <p>will draw &quot;Test Text&quot; with font FreeSerif, using the default values
710 for the optional parameters.
711 </p>
712 <p>The command:
713 </p><table><tr><td>&nbsp;</td><td><pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
714           x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2&quot;
715 </pre></td></tr></table>
716
717 <p>will draw &rsquo;Test Text&rsquo; with font FreeSerif of size 24 at position x=100
718 and y=50 (counting from the top-left corner of the screen), text is
719 yellow with a red box around it. Both the text and the box have an
720 opacity of 20%.
721 </p>
722 <p>Note that the double quotes are not necessary if spaces are not used
723 within the parameter list.
724 </p>
725 <p>For more information about libfreetype, check:
726 <a href="http://www.freetype.org/">http://www.freetype.org/</a>.
727 </p>
728 <a name="fade"></a>
729 <h2 class="section"><a href="libavfilter.html#toc-fade">8.7 fade</a></h2>
730
731 <p>Apply fade-in/out effect to input video.
732 </p>
733 <p>It accepts the parameters:
734 <var>type</var>:<var>start_frame</var>:<var>nb_frames</var>
735 </p>
736 <p><var>type</var> specifies if the effect type, can be either &quot;in&quot; for
737 fade-in, or &quot;out&quot; for a fade-out effect.
738 </p>
739 <p><var>start_frame</var> specifies the number of the start frame for starting
740 to apply the fade effect.
741 </p>
742 <p><var>nb_frames</var> specifies the number of frames for which the fade
743 effect has to last. At the end of the fade-in effect the output video
744 will have the same intensity as the input video, at the end of the
745 fade-out transition the output video will be completely black.
746 </p>
747 <p>A few usage examples follow, usable too as test scenarios.
748 </p><table><tr><td>&nbsp;</td><td><pre class="example"># fade in first 30 frames of video
749 fade=in:0:30
750
751 # fade out last 45 frames of a 200-frame video
752 fade=out:155:45
753
754 # fade in first 25 frames and fade out last 25 frames of a 1000-frame video
755 fade=in:0:25, fade=out:975:25
756
757 # make first 5 frames black, then fade in from frame 5-24
758 fade=in:5:20
759 </pre></td></tr></table>
760
761 <a name="fieldorder"></a>
762 <h2 class="section"><a href="libavfilter.html#toc-fieldorder">8.8 fieldorder</a></h2>
763
764 <p>Transform the field order of the input video.
765 </p>
766 <p>It accepts one parameter which specifies the required field order that
767 the input interlaced video will be transformed to. The parameter can
768 assume one of the following values:
769 </p>
770 <dl compact="compact">
771 <dt> &lsquo;<samp>0 or bff</samp>&rsquo;</dt>
772 <dd><p>output bottom field first
773 </p></dd>
774 <dt> &lsquo;<samp>1 or tff</samp>&rsquo;</dt>
775 <dd><p>output top field first
776 </p></dd>
777 </dl>
778
779 <p>Default value is &quot;tff&quot;.
780 </p>
781 <p>Transformation is achieved by shifting the picture content up or down
782 by one line, and filling the remaining line with appropriate picture content.
783 This method is consistent with most broadcast field order converters.
784 </p>
785 <p>If the input video is not flagged as being interlaced, or it is already
786 flagged as being of the required output field order then this filter does
787 not alter the incoming video.
788 </p>
789 <p>This filter is very useful when converting to or from PAL DV material,
790 which is bottom field first.
791 </p>
792 <p>For example:
793 </p><table><tr><td>&nbsp;</td><td><pre class="example">./ffmpeg -i in.vob -vf &quot;fieldorder=bff&quot; out.dv
794 </pre></td></tr></table>
795
796 <a name="fifo"></a>
797 <h2 class="section"><a href="libavfilter.html#toc-fifo">8.9 fifo</a></h2>
798
799 <p>Buffer input images and send them when they are requested.
800 </p>
801 <p>This filter is mainly useful when auto-inserted by the libavfilter
802 framework.
803 </p>
804 <p>The filter does not take parameters.
805 </p>
806 <a name="format"></a>
807 <h2 class="section"><a href="libavfilter.html#toc-format">8.10 format</a></h2>
808
809 <p>Convert the input video to one of the specified pixel formats.
810 Libavfilter will try to pick one that is supported for the input to
811 the next filter.
812 </p>
813 <p>The filter accepts a list of pixel format names, separated by &quot;:&quot;,
814 for example &quot;yuv420p:monow:rgb24&quot;.
815 </p>
816 <p>Some examples follow:
817 </p><table><tr><td>&nbsp;</td><td><pre class="example"># convert the input video to the format &quot;yuv420p&quot;
818 format=yuv420p
819
820 # convert the input video to any of the formats in the list
821 format=yuv420p:yuv444p:yuv410p
822 </pre></td></tr></table>
823
824 <p><a name="frei0r"></a>
825 </p><a name="frei0r-1"></a>
826 <h2 class="section"><a href="libavfilter.html#toc-frei0r-1">8.11 frei0r</a></h2>
827
828 <p>Apply a frei0r effect to the input video.
829 </p>
830 <p>To enable compilation of this filter you need to install the frei0r
831 header and configure FFmpeg with &ndash;enable-frei0r.
832 </p>
833 <p>The filter supports the syntax:
834 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>filter_name</var>[{:|=}<var>param1</var>:<var>param2</var>:...:<var>paramN</var>]
835 </pre></td></tr></table>
836
837 <p><var>filter_name</var> is the name to the frei0r effect to load. If the
838 environment variable <code>FREI0R_PATH</code> is defined, the frei0r effect
839 is searched in each one of the directories specified by the colon
840 separated list in <code>FREIOR_PATH</code>, otherwise in the standard frei0r
841 paths, which are in this order: &lsquo;<tt>HOME/.frei0r-1/lib/</tt>&rsquo;,
842 &lsquo;<tt>/usr/local/lib/frei0r-1/</tt>&rsquo;, &lsquo;<tt>/usr/lib/frei0r-1/</tt>&rsquo;.
843 </p>
844 <p><var>param1</var>, <var>param2</var>, ... , <var>paramN</var> specify the parameters
845 for the frei0r effect.
846 </p>
847 <p>A frei0r effect parameter can be a boolean (whose values are specified
848 with &quot;y&quot; and &quot;n&quot;), a double, a color (specified by the syntax
849 <var>R</var>/<var>G</var>/<var>B</var>, <var>R</var>, <var>G</var>, and <var>B</var> being float
850 numbers from 0.0 to 1.0) or by an <code>av_parse_color()</code> color
851 description), a position (specified by the syntax <var>X</var>/<var>Y</var>,
852 <var>X</var> and <var>Y</var> being float numbers) and a string.
853 </p>
854 <p>The number and kind of parameters depend on the loaded effect. If an
855 effect parameter is not specified the default value is set.
856 </p>
857 <p>Some examples follow:
858 </p><table><tr><td>&nbsp;</td><td><pre class="example"># apply the distort0r effect, set the first two double parameters
859 frei0r=distort0r:0.5:0.01
860
861 # apply the colordistance effect, takes a color as first parameter
862 frei0r=colordistance:0.2/0.3/0.4
863 frei0r=colordistance:violet
864 frei0r=colordistance:0x112233
865
866 # apply the perspective effect, specify the top left and top right
867 # image positions
868 frei0r=perspective:0.2/0.2:0.8/0.2
869 </pre></td></tr></table>
870
871 <p>For more information see:
872 <a href="http://piksel.org/frei0r">http://piksel.org/frei0r</a>
873 </p>
874 <a name="gradfun"></a>
875 <h2 class="section"><a href="libavfilter.html#toc-gradfun">8.12 gradfun</a></h2>
876
877 <p>Fix the banding artifacts that are sometimes introduced into nearly flat
878 regions by truncation to 8bit colordepth.
879 Interpolate the gradients that should go where the bands are, and
880 dither them.
881 </p>
882 <p>This filter is designed for playback only.  Do not use it prior to
883 lossy compression, because compression tends to lose the dither and
884 bring back the bands.
885 </p>
886 <p>The filter takes two optional parameters, separated by &rsquo;:&rsquo;:
887 <var>strength</var>:<var>radius</var>
888 </p>
889 <p><var>strength</var> is the maximum amount by which the filter will change
890 any one pixel. Also the threshold for detecting nearly flat
891 regions. Acceptable values range from .51 to 255, default value is
892 1.2, out-of-range values will be clipped to the valid range.
893 </p>
894 <p><var>radius</var> is the neighborhood to fit the gradient to. A larger
895 radius makes for smoother gradients, but also prevents the filter from
896 modifying the pixels near detailed regions. Acceptable values are
897 8-32, default value is 16, out-of-range values will be clipped to the
898 valid range.
899 </p>
900 <table><tr><td>&nbsp;</td><td><pre class="example"># default parameters
901 gradfun=1.2:16
902
903 # omitting radius
904 gradfun=1.2
905 </pre></td></tr></table>
906
907 <a name="hflip"></a>
908 <h2 class="section"><a href="libavfilter.html#toc-hflip">8.13 hflip</a></h2>
909
910 <p>Flip the input video horizontally.
911 </p>
912 <p>For example to horizontally flip the video in input with
913 &lsquo;<tt>ffmpeg</tt>&rsquo;:
914 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -vf &quot;hflip&quot; out.avi
915 </pre></td></tr></table>
916
917 <a name="hqdn3d"></a>
918 <h2 class="section"><a href="libavfilter.html#toc-hqdn3d">8.14 hqdn3d</a></h2>
919
920 <p>High precision/quality 3d denoise filter. This filter aims to reduce
921 image noise producing smooth images and making still images really
922 still. It should enhance compressibility.
923 </p>
924 <p>It accepts the following optional parameters:
925 <var>luma_spatial</var>:<var>chroma_spatial</var>:<var>luma_tmp</var>:<var>chroma_tmp</var>
926 </p>
927 <dl compact="compact">
928 <dt> &lsquo;<samp>luma_spatial</samp>&rsquo;</dt>
929 <dd><p>a non-negative float number which specifies spatial luma strength,
930 defaults to 4.0
931 </p>
932 </dd>
933 <dt> &lsquo;<samp>chroma_spatial</samp>&rsquo;</dt>
934 <dd><p>a non-negative float number which specifies spatial chroma strength,
935 defaults to 3.0*<var>luma_spatial</var>/4.0
936 </p>
937 </dd>
938 <dt> &lsquo;<samp>luma_tmp</samp>&rsquo;</dt>
939 <dd><p>a float number which specifies luma temporal strength, defaults to
940 6.0*<var>luma_spatial</var>/4.0
941 </p>
942 </dd>
943 <dt> &lsquo;<samp>chroma_tmp</samp>&rsquo;</dt>
944 <dd><p>a float number which specifies chroma temporal strength, defaults to
945 <var>luma_tmp</var>*<var>chroma_spatial</var>/<var>luma_spatial</var>
946 </p></dd>
947 </dl>
948
949 <a name="mp"></a>
950 <h2 class="section"><a href="libavfilter.html#toc-mp">8.15 mp</a></h2>
951
952 <p>Apply an MPlayer filter to the input video.
953 </p>
954 <p>This filter provides a wrapper around most of the filters of
955 MPlayer/MEncoder.
956 </p>
957 <p>This wrapper is considered experimental. Some of the wrapped filters
958 may not work properly and we may drop support for them, as they will
959 be implemented natively into FFmpeg. Thus you should avoid
960 depending on them when writing portable scripts.
961 </p>
962 <p>The filters accepts the parameters:
963 <var>filter_name</var>[:=]<var>filter_params</var>
964 </p>
965 <p><var>filter_name</var> is the name of a supported MPlayer filter,
966 <var>filter_params</var> is a string containing the parameters accepted by
967 the named filter.
968 </p>
969 <p>The list of the currently supported filters follows:
970 </p><dl compact="compact">
971 <dt> <var>2xsai</var></dt>
972 <dt> <var>blackframe</var></dt>
973 <dt> <var>boxblur</var></dt>
974 <dt> <var>cropdetect</var></dt>
975 <dt> <var>decimate</var></dt>
976 <dt> <var>delogo</var></dt>
977 <dt> <var>denoise3d</var></dt>
978 <dt> <var>detc</var></dt>
979 <dt> <var>dint</var></dt>
980 <dt> <var>divtc</var></dt>
981 <dt> <var>down3dright</var></dt>
982 <dt> <var>dsize</var></dt>
983 <dt> <var>eq2</var></dt>
984 <dt> <var>eq</var></dt>
985 <dt> <var>field</var></dt>
986 <dt> <var>fil</var></dt>
987 <dt> <var>fixpts</var></dt>
988 <dt> <var>framestep</var></dt>
989 <dt> <var>fspp</var></dt>
990 <dt> <var>geq</var></dt>
991 <dt> <var>gradfun</var></dt>
992 <dt> <var>harddup</var></dt>
993 <dt> <var>hqdn3d</var></dt>
994 <dt> <var>hue</var></dt>
995 <dt> <var>il</var></dt>
996 <dt> <var>ilpack</var></dt>
997 <dt> <var>ivtc</var></dt>
998 <dt> <var>kerndeint</var></dt>
999 <dt> <var>mcdeint</var></dt>
1000 <dt> <var>mirror</var></dt>
1001 <dt> <var>noise</var></dt>
1002 <dt> <var>ow</var></dt>
1003 <dt> <var>palette</var></dt>
1004 <dt> <var>perspective</var></dt>
1005 <dt> <var>phase</var></dt>
1006 <dt> <var>pp7</var></dt>
1007 <dt> <var>pullup</var></dt>
1008 <dt> <var>qp</var></dt>
1009 <dt> <var>rectangle</var></dt>
1010 <dt> <var>remove-logo</var></dt>
1011 <dt> <var>rgbtest</var></dt>
1012 <dt> <var>rotate</var></dt>
1013 <dt> <var>sab</var></dt>
1014 <dt> <var>screenshot</var></dt>
1015 <dt> <var>smartblur</var></dt>
1016 <dt> <var>softpulldown</var></dt>
1017 <dt> <var>softskip</var></dt>
1018 <dt> <var>spp</var></dt>
1019 <dt> <var>swapuv</var></dt>
1020 <dt> <var>telecine</var></dt>
1021 <dt> <var>test</var></dt>
1022 <dt> <var>tile</var></dt>
1023 <dt> <var>tinterlace</var></dt>
1024 <dt> <var>unsharp</var></dt>
1025 <dt> <var>uspp</var></dt>
1026 <dt> <var>yuvcsp</var></dt>
1027 <dt> <var>yvu9</var></dt>
1028 </dl>
1029
1030 <p>The parameter syntax and behavior for the listed filters are the same
1031 of the corresponding MPlayer filters. For detailed instructions check
1032 the &quot;VIDEO FILTERS&quot; section in the MPlayer manual.
1033 </p>
1034 <p>Some examples follow:
1035 </p><table><tr><td>&nbsp;</td><td><pre class="example"># remove a logo by interpolating the surrounding pixels
1036 mp=delogo=200:200:80:20:1
1037
1038 # adjust gamma, brightness, contrast
1039 mp=eq2=1.0:2:0.5
1040
1041 # tweak hue and saturation
1042 mp=hue=100:-10
1043 </pre></td></tr></table>
1044
1045 <p>See also mplayer(1), <a href="http://www.mplayerhq.hu/">http://www.mplayerhq.hu/</a>.
1046 </p>
1047 <a name="noformat"></a>
1048 <h2 class="section"><a href="libavfilter.html#toc-noformat">8.16 noformat</a></h2>
1049
1050 <p>Force libavfilter not to use any of the specified pixel formats for the
1051 input to the next filter.
1052 </p>
1053 <p>The filter accepts a list of pixel format names, separated by &quot;:&quot;,
1054 for example &quot;yuv420p:monow:rgb24&quot;.
1055 </p>
1056 <p>Some examples follow:
1057 </p><table><tr><td>&nbsp;</td><td><pre class="example"># force libavfilter to use a format different from &quot;yuv420p&quot; for the
1058 # input to the vflip filter
1059 noformat=yuv420p,vflip
1060
1061 # convert the input video to any of the formats not contained in the list
1062 noformat=yuv420p:yuv444p:yuv410p
1063 </pre></td></tr></table>
1064
1065 <a name="null"></a>
1066 <h2 class="section"><a href="libavfilter.html#toc-null">8.17 null</a></h2>
1067
1068 <p>Pass the video source unchanged to the output.
1069 </p>
1070 <a name="ocv"></a>
1071 <h2 class="section"><a href="libavfilter.html#toc-ocv">8.18 ocv</a></h2>
1072
1073 <p>Apply video transform using libopencv.
1074 </p>
1075 <p>To enable this filter install libopencv library and headers and
1076 configure FFmpeg with &ndash;enable-libopencv.
1077 </p>
1078 <p>The filter takes the parameters: <var>filter_name</var>{:=}<var>filter_params</var>.
1079 </p>
1080 <p><var>filter_name</var> is the name of the libopencv filter to apply.
1081 </p>
1082 <p><var>filter_params</var> specifies the parameters to pass to the libopencv
1083 filter. If not specified the default values are assumed.
1084 </p>
1085 <p>Refer to the official libopencv documentation for more precise
1086 informations:
1087 <a href="http://opencv.willowgarage.com/documentation/c/image_filtering.html">http://opencv.willowgarage.com/documentation/c/image_filtering.html</a>
1088 </p>
1089 <p>Follows the list of supported libopencv filters.
1090 </p>
1091 <p><a name="dilate"></a>
1092 </p><a name="dilate-1"></a>
1093 <h3 class="subsection"><a href="libavfilter.html#toc-dilate-1">8.18.1 dilate</a></h3>
1094
1095 <p>Dilate an image by using a specific structuring element.
1096 This filter corresponds to the libopencv function <code>cvDilate</code>.
1097 </p>
1098 <p>It accepts the parameters: <var>struct_el</var>:<var>nb_iterations</var>.
1099 </p>
1100 <p><var>struct_el</var> represents a structuring element, and has the syntax:
1101 <var>cols</var>x<var>rows</var>+<var>anchor_x</var>x<var>anchor_y</var>/<var>shape</var>
1102 </p>
1103 <p><var>cols</var> and <var>rows</var> represent the number of colums and rows of
1104 the structuring element, <var>anchor_x</var> and <var>anchor_y</var> the anchor
1105 point, and <var>shape</var> the shape for the structuring element, and
1106 can be one of the values &quot;rect&quot;, &quot;cross&quot;, &quot;ellipse&quot;, &quot;custom&quot;.
1107 </p>
1108 <p>If the value for <var>shape</var> is &quot;custom&quot;, it must be followed by a
1109 string of the form &quot;=<var>filename</var>&quot;. The file with name
1110 <var>filename</var> is assumed to represent a binary image, with each
1111 printable character corresponding to a bright pixel. When a custom
1112 <var>shape</var> is used, <var>cols</var> and <var>rows</var> are ignored, the number
1113 or columns and rows of the read file are assumed instead.
1114 </p>
1115 <p>The default value for <var>struct_el</var> is &quot;3x3+0x0/rect&quot;.
1116 </p>
1117 <p><var>nb_iterations</var> specifies the number of times the transform is
1118 applied to the image, and defaults to 1.
1119 </p>
1120 <p>Follow some example:
1121 </p><table><tr><td>&nbsp;</td><td><pre class="example"># use the default values
1122 ocv=dilate
1123
1124 # dilate using a structuring element with a 5x5 cross, iterate two times
1125 ocv=dilate=5x5+2x2/cross:2
1126
1127 # read the shape from the file diamond.shape, iterate two times
1128 # the file diamond.shape may contain a pattern of characters like this:
1129 #   *
1130 #  ***
1131 # *****
1132 #  ***
1133 #   *
1134 # the specified cols and rows are ignored (but not the anchor point coordinates)
1135 ocv=0x0+2x2/custom=diamond.shape:2
1136 </pre></td></tr></table>
1137
1138 <a name="erode"></a>
1139 <h3 class="subsection"><a href="libavfilter.html#toc-erode">8.18.2 erode</a></h3>
1140
1141 <p>Erode an image by using a specific structuring element.
1142 This filter corresponds to the libopencv function <code>cvErode</code>.
1143 </p>
1144 <p>The filter accepts the parameters: <var>struct_el</var>:<var>nb_iterations</var>,
1145 with the same meaning and use of those of the dilate filter
1146 (see <a href="#dilate">dilate</a>).
1147 </p>
1148 <a name="smooth"></a>
1149 <h3 class="subsection"><a href="libavfilter.html#toc-smooth">8.18.3 smooth</a></h3>
1150
1151 <p>Smooth the input video.
1152 </p>
1153 <p>The filter takes the following parameters:
1154 <var>type</var>:<var>param1</var>:<var>param2</var>:<var>param3</var>:<var>param4</var>.
1155 </p>
1156 <p><var>type</var> is the type of smooth filter to apply, and can be one of
1157 the following values: &quot;blur&quot;, &quot;blur_no_scale&quot;, &quot;median&quot;, &quot;gaussian&quot;,
1158 &quot;bilateral&quot;. The default value is &quot;gaussian&quot;.
1159 </p>
1160 <p><var>param1</var>, <var>param2</var>, <var>param3</var>, and <var>param4</var> are
1161 parameters whose meanings depend on smooth type. <var>param1</var> and
1162 <var>param2</var> accept integer positive values or 0, <var>param3</var> and
1163 <var>param4</var> accept float values.
1164 </p>
1165 <p>The default value for <var>param1</var> is 3, the default value for the
1166 other parameters is 0.
1167 </p>
1168 <p>These parameters correspond to the parameters assigned to the
1169 libopencv function <code>cvSmooth</code>.
1170 </p>
1171 <a name="overlay"></a>
1172 <h2 class="section"><a href="libavfilter.html#toc-overlay">8.19 overlay</a></h2>
1173
1174 <p>Overlay one video on top of another.
1175 </p>
1176 <p>It takes two inputs and one output, the first input is the &quot;main&quot;
1177 video on which the second input is overlayed.
1178 </p>
1179 <p>It accepts the parameters: <var>x</var>:<var>y</var>.
1180 </p>
1181 <p><var>x</var> is the x coordinate of the overlayed video on the main video,
1182 <var>y</var> is the y coordinate. The parameters are expressions containing
1183 the following parameters:
1184 </p>
1185 <dl compact="compact">
1186 <dt> &lsquo;<samp>main_w, main_h</samp>&rsquo;</dt>
1187 <dd><p>main input width and height
1188 </p>
1189 </dd>
1190 <dt> &lsquo;<samp>W, H</samp>&rsquo;</dt>
1191 <dd><p>same as <var>main_w</var> and <var>main_h</var>
1192 </p>
1193 </dd>
1194 <dt> &lsquo;<samp>overlay_w, overlay_h</samp>&rsquo;</dt>
1195 <dd><p>overlay input width and height
1196 </p>
1197 </dd>
1198 <dt> &lsquo;<samp>w, h</samp>&rsquo;</dt>
1199 <dd><p>same as <var>overlay_w</var> and <var>overlay_h</var>
1200 </p></dd>
1201 </dl>
1202
1203 <p>Be aware that frames are taken from each input video in timestamp
1204 order, hence, if their initial timestamps differ, it is a a good idea
1205 to pass the two inputs through a <var>setpts=PTS-STARTPTS</var> filter to
1206 have them begin in the same zero timestamp, as it does the example for
1207 the <var>movie</var> filter.
1208 </p>
1209 <p>Follow some examples:
1210 </p><table><tr><td>&nbsp;</td><td><pre class="example"># draw the overlay at 10 pixels from the bottom right
1211 # corner of the main video.
1212 overlay=main_w-overlay_w-10:main_h-overlay_h-10
1213
1214 # insert a transparent PNG logo in the bottom left corner of the input
1215 movie=logo.png [logo];
1216 [in][logo] overlay=10:main_h-overlay_h-10 [out]
1217
1218 # insert 2 different transparent PNG logos (second logo on bottom
1219 # right corner):
1220 movie=logo1.png [logo1];
1221 movie=logo2.png [logo2];
1222 [in][logo1]       overlay=10:H-h-10 [in+logo1];
1223 [in+logo1][logo2] overlay=W-w-10:H-h-10 [out]
1224
1225 # add a transparent color layer on top of the main video,
1226 # WxH specifies the size of the main input to the overlay filter
1227 color=red.3:WxH [over]; [in][over] overlay [out]
1228 </pre></td></tr></table>
1229
1230 <p>You can chain togheter more overlays but the efficiency of such
1231 approach is yet to be tested.
1232 </p>
1233 <a name="pad"></a>
1234 <h2 class="section"><a href="libavfilter.html#toc-pad">8.20 pad</a></h2>
1235
1236 <p>Add paddings to the input image, and places the original input at the
1237 given coordinates <var>x</var>, <var>y</var>.
1238 </p>
1239 <p>It accepts the following parameters:
1240 <var>width</var>:<var>height</var>:<var>x</var>:<var>y</var>:<var>color</var>.
1241 </p>
1242 <p>The parameters <var>width</var>, <var>height</var>, <var>x</var>, and <var>y</var> are
1243 expressions containing the following constants:
1244 </p>
1245 <dl compact="compact">
1246 <dt> &lsquo;<samp>E, PI, PHI</samp>&rsquo;</dt>
1247 <dd><p>the corresponding mathematical approximated values for e
1248 (euler number), pi (greek PI), phi (golden ratio)
1249 </p>
1250 </dd>
1251 <dt> &lsquo;<samp>in_w, in_h</samp>&rsquo;</dt>
1252 <dd><p>the input video width and heigth
1253 </p>
1254 </dd>
1255 <dt> &lsquo;<samp>iw, ih</samp>&rsquo;</dt>
1256 <dd><p>same as <var>in_w</var> and <var>in_h</var>
1257 </p>
1258 </dd>
1259 <dt> &lsquo;<samp>out_w, out_h</samp>&rsquo;</dt>
1260 <dd><p>the output width and heigth, that is the size of the padded area as
1261 specified by the <var>width</var> and <var>height</var> expressions
1262 </p>
1263 </dd>
1264 <dt> &lsquo;<samp>ow, oh</samp>&rsquo;</dt>
1265 <dd><p>same as <var>out_w</var> and <var>out_h</var>
1266 </p>
1267 </dd>
1268 <dt> &lsquo;<samp>x, y</samp>&rsquo;</dt>
1269 <dd><p>x and y offsets as specified by the <var>x</var> and <var>y</var>
1270 expressions, or NAN if not yet specified
1271 </p>
1272 </dd>
1273 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
1274 <dd><p>input display aspect ratio, same as <var>iw</var> / <var>ih</var>
1275 </p>
1276 </dd>
1277 <dt> &lsquo;<samp>hsub, vsub</samp>&rsquo;</dt>
1278 <dd><p>horizontal and vertical chroma subsample values. For example for the
1279 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
1280 </p></dd>
1281 </dl>
1282
1283 <p>Follows the description of the accepted parameters.
1284 </p>
1285 <dl compact="compact">
1286 <dt> &lsquo;<samp>width, height</samp>&rsquo;</dt>
1287 <dd>
1288 <p>Specify the size of the output image with the paddings added. If the
1289 value for <var>width</var> or <var>height</var> is 0, the corresponding input size
1290 is used for the output.
1291 </p>
1292 <p>The <var>width</var> expression can reference the value set by the
1293 <var>height</var> expression, and viceversa.
1294 </p>
1295 <p>The default value of <var>width</var> and <var>height</var> is 0.
1296 </p>
1297 </dd>
1298 <dt> &lsquo;<samp>x, y</samp>&rsquo;</dt>
1299 <dd>
1300 <p>Specify the offsets where to place the input image in the padded area
1301 with respect to the top/left border of the output image.
1302 </p>
1303 <p>The <var>x</var> expression can reference the value set by the <var>y</var>
1304 expression, and viceversa.
1305 </p>
1306 <p>The default value of <var>x</var> and <var>y</var> is 0.
1307 </p>
1308 </dd>
1309 <dt> &lsquo;<samp>color</samp>&rsquo;</dt>
1310 <dd>
1311 <p>Specify the color of the padded area, it can be the name of a color
1312 (case insensitive match) or a 0xRRGGBB[AA] sequence.
1313 </p>
1314 <p>The default value of <var>color</var> is &quot;black&quot;.
1315 </p>
1316 </dd>
1317 </dl>
1318
1319 <p>Some examples follow:
1320 </p>
1321 <table><tr><td>&nbsp;</td><td><pre class="example"># Add paddings with color &quot;violet&quot; to the input video. Output video
1322 # size is 640x480, the top-left corner of the input video is placed at
1323 # column 0, row 40.
1324 pad=640:480:0:40:violet
1325
1326 # pad the input to get an output with dimensions increased bt 3/2,
1327 # and put the input video at the center of the padded area
1328 pad=&quot;3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2&quot;
1329
1330 # pad the input to get a squared output with size equal to the maximum
1331 # value between the input width and height, and put the input video at
1332 # the center of the padded area
1333 pad=&quot;max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2&quot;
1334
1335 # pad the input to get a final w/h ratio of 16:9
1336 pad=&quot;ih*16/9:ih:(ow-iw)/2:(oh-ih)/2&quot;
1337
1338 # double output size and put the input video in the bottom-right
1339 # corner of the output padded area
1340 pad=&quot;2*iw:2*ih:ow-iw:oh-ih&quot;
1341 </pre></td></tr></table>
1342
1343 <a name="pixdesctest"></a>
1344 <h2 class="section"><a href="libavfilter.html#toc-pixdesctest">8.21 pixdesctest</a></h2>
1345
1346 <p>Pixel format descriptor test filter, mainly useful for internal
1347 testing. The output video should be equal to the input video.
1348 </p>
1349 <p>For example:
1350 </p><table><tr><td>&nbsp;</td><td><pre class="example">format=monow, pixdesctest
1351 </pre></td></tr></table>
1352
1353 <p>can be used to test the monowhite pixel format descriptor definition.
1354 </p>
1355 <a name="scale"></a>
1356 <h2 class="section"><a href="libavfilter.html#toc-scale">8.22 scale</a></h2>
1357
1358 <p>Scale the input video to <var>width</var>:<var>height</var> and/or convert the image format.
1359 </p>
1360 <p>The parameters <var>width</var> and <var>height</var> are expressions containing
1361 the following constants:
1362 </p>
1363 <dl compact="compact">
1364 <dt> &lsquo;<samp>E, PI, PHI</samp>&rsquo;</dt>
1365 <dd><p>the corresponding mathematical approximated values for e
1366 (euler number), pi (greek PI), phi (golden ratio)
1367 </p>
1368 </dd>
1369 <dt> &lsquo;<samp>in_w, in_h</samp>&rsquo;</dt>
1370 <dd><p>the input width and heigth
1371 </p>
1372 </dd>
1373 <dt> &lsquo;<samp>iw, ih</samp>&rsquo;</dt>
1374 <dd><p>same as <var>in_w</var> and <var>in_h</var>
1375 </p>
1376 </dd>
1377 <dt> &lsquo;<samp>out_w, out_h</samp>&rsquo;</dt>
1378 <dd><p>the output (cropped) width and heigth
1379 </p>
1380 </dd>
1381 <dt> &lsquo;<samp>ow, oh</samp>&rsquo;</dt>
1382 <dd><p>same as <var>out_w</var> and <var>out_h</var>
1383 </p>
1384 </dd>
1385 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
1386 <dd><p>input display aspect ratio, same as <var>iw</var> / <var>ih</var>
1387 </p>
1388 </dd>
1389 <dt> &lsquo;<samp>hsub, vsub</samp>&rsquo;</dt>
1390 <dd><p>horizontal and vertical chroma subsample values. For example for the
1391 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
1392 </p></dd>
1393 </dl>
1394
1395 <p>If the input image format is different from the format requested by
1396 the next filter, the scale filter will convert the input to the
1397 requested format.
1398 </p>
1399 <p>If the value for <var>width</var> or <var>height</var> is 0, the respective input
1400 size is used for the output.
1401 </p>
1402 <p>If the value for <var>width</var> or <var>height</var> is -1, the scale filter will
1403 use, for the respective output size, a value that maintains the aspect
1404 ratio of the input image.
1405 </p>
1406 <p>The default value of <var>width</var> and <var>height</var> is 0.
1407 </p>
1408 <p>Some examples follow:
1409 </p><table><tr><td>&nbsp;</td><td><pre class="example"># scale the input video to a size of 200x100.
1410 scale=200:100
1411
1412 # scale the input to 2x
1413 scale=2*iw:2*ih
1414 # the above is the same as
1415 scale=2*in_w:2*in_h
1416
1417 # scale the input to half size
1418 scale=iw/2:ih/2
1419
1420 # increase the width, and set the height to the same size
1421 scale=3/2*iw:ow
1422
1423 # seek for Greek harmony
1424 scale=iw:1/PHI*iw
1425 scale=ih*PHI:ih
1426
1427 # increase the height, and set the width to 3/2 of the height
1428 scale=3/2*oh:3/5*ih
1429
1430 # increase the size, but make the size a multiple of the chroma
1431 scale=&quot;trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub&quot;
1432
1433 # increase the width to a maximum of 500 pixels, keep the same input aspect ratio
1434 scale='min(500\, iw*3/2):-1'
1435 </pre></td></tr></table>
1436
1437 <a name="select"></a>
1438 <h2 class="section"><a href="libavfilter.html#toc-select">8.23 select</a></h2>
1439 <p>Select frames to pass in output.
1440 </p>
1441 <p>It accepts in input an expression, which is evaluated for each input
1442 frame. If the expression is evaluated to a non-zero value, the frame
1443 is selected and passed to the output, otherwise it is discarded.
1444 </p>
1445 <p>The expression can contain the following constants:
1446 </p>
1447 <dl compact="compact">
1448 <dt> &lsquo;<samp>PI</samp>&rsquo;</dt>
1449 <dd><p>Greek PI
1450 </p>
1451 </dd>
1452 <dt> &lsquo;<samp>PHI</samp>&rsquo;</dt>
1453 <dd><p>golden ratio
1454 </p>
1455 </dd>
1456 <dt> &lsquo;<samp>E</samp>&rsquo;</dt>
1457 <dd><p>Euler number
1458 </p>
1459 </dd>
1460 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
1461 <dd><p>the sequential number of the filtered frame, starting from 0
1462 </p>
1463 </dd>
1464 <dt> &lsquo;<samp>selected_n</samp>&rsquo;</dt>
1465 <dd><p>the sequential number of the selected frame, starting from 0
1466 </p>
1467 </dd>
1468 <dt> &lsquo;<samp>prev_selected_n</samp>&rsquo;</dt>
1469 <dd><p>the sequential number of the last selected frame, NAN if undefined
1470 </p>
1471 </dd>
1472 <dt> &lsquo;<samp>TB</samp>&rsquo;</dt>
1473 <dd><p>timebase of the input timestamps
1474 </p>
1475 </dd>
1476 <dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
1477 <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
1478 expressed in <var>TB</var> units, NAN if undefined
1479 </p>
1480 </dd>
1481 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
1482 <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
1483 expressed in seconds, NAN if undefined
1484 </p>
1485 </dd>
1486 <dt> &lsquo;<samp>prev_pts</samp>&rsquo;</dt>
1487 <dd><p>the PTS of the previously filtered video frame, NAN if undefined
1488 </p>
1489 </dd>
1490 <dt> &lsquo;<samp>prev_selected_pts</samp>&rsquo;</dt>
1491 <dd><p>the PTS of the last previously filtered video frame, NAN if undefined
1492 </p>
1493 </dd>
1494 <dt> &lsquo;<samp>prev_selected_t</samp>&rsquo;</dt>
1495 <dd><p>the PTS of the last previously selected video frame, NAN if undefined
1496 </p>
1497 </dd>
1498 <dt> &lsquo;<samp>start_pts</samp>&rsquo;</dt>
1499 <dd><p>the PTS of the first video frame in the video, NAN if undefined
1500 </p>
1501 </dd>
1502 <dt> &lsquo;<samp>start_t</samp>&rsquo;</dt>
1503 <dd><p>the time of the first video frame in the video, NAN if undefined
1504 </p>
1505 </dd>
1506 <dt> &lsquo;<samp>pict_type</samp>&rsquo;</dt>
1507 <dd><p>the picture type of the filtered frame, can assume one of the following
1508 values:
1509 </p><dl compact="compact">
1510 <dt> &lsquo;<samp>PICT_TYPE_I</samp>&rsquo;</dt>
1511 <dt> &lsquo;<samp>PICT_TYPE_P</samp>&rsquo;</dt>
1512 <dt> &lsquo;<samp>PICT_TYPE_B</samp>&rsquo;</dt>
1513 <dt> &lsquo;<samp>PICT_TYPE_S</samp>&rsquo;</dt>
1514 <dt> &lsquo;<samp>PICT_TYPE_SI</samp>&rsquo;</dt>
1515 <dt> &lsquo;<samp>PICT_TYPE_SP</samp>&rsquo;</dt>
1516 <dt> &lsquo;<samp>PICT_TYPE_BI</samp>&rsquo;</dt>
1517 </dl>
1518
1519 </dd>
1520 <dt> &lsquo;<samp>interlace_type</samp>&rsquo;</dt>
1521 <dd><p>the frame interlace type, can assume one of the following values:
1522 </p><dl compact="compact">
1523 <dt> &lsquo;<samp>INTERLACE_TYPE_P</samp>&rsquo;</dt>
1524 <dd><p>the frame is progressive (not interlaced)
1525 </p></dd>
1526 <dt> &lsquo;<samp>INTERLACE_TYPE_T</samp>&rsquo;</dt>
1527 <dd><p>the frame is top-field-first
1528 </p></dd>
1529 <dt> &lsquo;<samp>INTERLACE_TYPE_B</samp>&rsquo;</dt>
1530 <dd><p>the frame is bottom-field-first
1531 </p></dd>
1532 </dl>
1533
1534 </dd>
1535 <dt> &lsquo;<samp>key</samp>&rsquo;</dt>
1536 <dd><p>1 if the filtered frame is a key-frame, 0 otherwise
1537 </p>
1538 </dd>
1539 <dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
1540 <dd><p>the position in the file of the filtered frame, -1 if the information
1541 is not available (e.g. for synthetic video)
1542 </p></dd>
1543 </dl>
1544
1545 <p>The default value of the select expression is &quot;1&quot;.
1546 </p>
1547 <p>Some examples follow:
1548 </p>
1549 <table><tr><td>&nbsp;</td><td><pre class="example"># select all frames in input
1550 select
1551
1552 # the above is the same as:
1553 select=1
1554
1555 # skip all frames:
1556 select=0
1557
1558 # select only I-frames
1559 select='eq(pict_type\,PICT_TYPE_I)'
1560
1561 # select one frame every 100
1562 select='not(mod(n\,100))'
1563
1564 # select only frames contained in the 10-20 time interval
1565 select='gte(t\,10)*lte(t\,20)'
1566
1567 # select only I frames contained in the 10-20 time interval
1568 select='gte(t\,10)*lte(t\,20)*eq(pict_type\,PICT_TYPE_I)'
1569
1570 # select frames with a minimum distance of 10 seconds
1571 select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
1572 </pre></td></tr></table>
1573
1574 <p><a name="setdar"></a>
1575 </p><a name="setdar-1"></a>
1576 <h2 class="section"><a href="libavfilter.html#toc-setdar-1">8.24 setdar</a></h2>
1577
1578 <p>Set the Display Aspect Ratio for the filter output video.
1579 </p>
1580 <p>This is done by changing the specified Sample (aka Pixel) Aspect
1581 Ratio, according to the following equation:
1582 <em>DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR</em>
1583 </p>
1584 <p>Keep in mind that this filter does not modify the pixel dimensions of
1585 the video frame. Also the display aspect ratio set by this filter may
1586 be changed by later filters in the filterchain, e.g. in case of
1587 scaling or if another &quot;setdar&quot; or a &quot;setsar&quot; filter is applied.
1588 </p>
1589 <p>The filter accepts a parameter string which represents the wanted
1590 display aspect ratio.
1591 The parameter can be a floating point number string, or an expression
1592 of the form <var>num</var>:<var>den</var>, where <var>num</var> and <var>den</var> are the
1593 numerator and denominator of the aspect ratio.
1594 If the parameter is not specified, it is assumed the value &quot;0:1&quot;.
1595 </p>
1596 <p>For example to change the display aspect ratio to 16:9, specify:
1597 </p><table><tr><td>&nbsp;</td><td><pre class="example">setdar=16:9
1598 # the above is equivalent to
1599 setdar=1.77777
1600 </pre></td></tr></table>
1601
1602 <p>See also the &quot;setsar&quot; filter documentation (see <a href="#setsar">setsar</a>).
1603 </p>
1604 <a name="setpts"></a>
1605 <h2 class="section"><a href="libavfilter.html#toc-setpts">8.25 setpts</a></h2>
1606
1607 <p>Change the PTS (presentation timestamp) of the input video frames.
1608 </p>
1609 <p>Accept in input an expression evaluated through the eval API, which
1610 can contain the following constants:
1611 </p>
1612 <dl compact="compact">
1613 <dt> &lsquo;<samp>PTS</samp>&rsquo;</dt>
1614 <dd><p>the presentation timestamp in input
1615 </p>
1616 </dd>
1617 <dt> &lsquo;<samp>PI</samp>&rsquo;</dt>
1618 <dd><p>Greek PI
1619 </p>
1620 </dd>
1621 <dt> &lsquo;<samp>PHI</samp>&rsquo;</dt>
1622 <dd><p>golden ratio
1623 </p>
1624 </dd>
1625 <dt> &lsquo;<samp>E</samp>&rsquo;</dt>
1626 <dd><p>Euler number
1627 </p>
1628 </dd>
1629 <dt> &lsquo;<samp>N</samp>&rsquo;</dt>
1630 <dd><p>the count of the input frame, starting from 0.
1631 </p>
1632 </dd>
1633 <dt> &lsquo;<samp>STARTPTS</samp>&rsquo;</dt>
1634 <dd><p>the PTS of the first video frame
1635 </p>
1636 </dd>
1637 <dt> &lsquo;<samp>INTERLACED</samp>&rsquo;</dt>
1638 <dd><p>tell if the current frame is interlaced
1639 </p>
1640 </dd>
1641 <dt> &lsquo;<samp>POS</samp>&rsquo;</dt>
1642 <dd><p>original position in the file of the frame, or undefined if undefined
1643 for the current frame
1644 </p>
1645 </dd>
1646 <dt> &lsquo;<samp>PREV_INPTS</samp>&rsquo;</dt>
1647 <dd><p>previous input PTS
1648 </p>
1649 </dd>
1650 <dt> &lsquo;<samp>PREV_OUTPTS</samp>&rsquo;</dt>
1651 <dd><p>previous output PTS
1652 </p>
1653 </dd>
1654 </dl>
1655
1656 <p>Some examples follow:
1657 </p>
1658 <table><tr><td>&nbsp;</td><td><pre class="example"># start counting PTS from zero
1659 setpts=PTS-STARTPTS
1660
1661 # fast motion
1662 setpts=0.5*PTS
1663
1664 # slow motion
1665 setpts=2.0*PTS
1666
1667 # fixed rate 25 fps
1668 setpts=N/(25*TB)
1669
1670 # fixed rate 25 fps with some jitter
1671 setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
1672 </pre></td></tr></table>
1673
1674 <p><a name="setsar"></a>
1675 </p><a name="setsar-1"></a>
1676 <h2 class="section"><a href="libavfilter.html#toc-setsar-1">8.26 setsar</a></h2>
1677
1678 <p>Set the Sample (aka Pixel) Aspect Ratio for the filter output video.
1679 </p>
1680 <p>Note that as a consequence of the application of this filter, the
1681 output display aspect ratio will change according to the following
1682 equation:
1683 <em>DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR</em>
1684 </p>
1685 <p>Keep in mind that the sample aspect ratio set by this filter may be
1686 changed by later filters in the filterchain, e.g. if another &quot;setsar&quot;
1687 or a &quot;setdar&quot; filter is applied.
1688 </p>
1689 <p>The filter accepts a parameter string which represents the wanted
1690 sample aspect ratio.
1691 The parameter can be a floating point number string, or an expression
1692 of the form <var>num</var>:<var>den</var>, where <var>num</var> and <var>den</var> are the
1693 numerator and denominator of the aspect ratio.
1694 If the parameter is not specified, it is assumed the value &quot;0:1&quot;.
1695 </p>
1696 <p>For example to change the sample aspect ratio to 10:11, specify:
1697 </p><table><tr><td>&nbsp;</td><td><pre class="example">setsar=10:11
1698 </pre></td></tr></table>
1699
1700 <a name="settb"></a>
1701 <h2 class="section"><a href="libavfilter.html#toc-settb">8.27 settb</a></h2>
1702
1703 <p>Set the timebase to use for the output frames timestamps.
1704 It is mainly useful for testing timebase configuration.
1705 </p>
1706 <p>It accepts in input an arithmetic expression representing a rational.
1707 The expression can contain the constants &quot;PI&quot;, &quot;E&quot;, &quot;PHI&quot;, &quot;AVTB&quot; (the
1708 default timebase), and &quot;intb&quot; (the input timebase).
1709 </p>
1710 <p>The default value for the input is &quot;intb&quot;.
1711 </p>
1712 <p>Follow some examples.
1713 </p>
1714 <table><tr><td>&nbsp;</td><td><pre class="example"># set the timebase to 1/25
1715 settb=1/25
1716
1717 # set the timebase to 1/10
1718 settb=0.1
1719
1720 #set the timebase to 1001/1000
1721 settb=1+0.001
1722
1723 #set the timebase to 2*intb
1724 settb=2*intb
1725
1726 #set the default timebase value
1727 settb=AVTB
1728 </pre></td></tr></table>
1729
1730 <a name="showinfo"></a>
1731 <h2 class="section"><a href="libavfilter.html#toc-showinfo">8.28 showinfo</a></h2>
1732
1733 <p>Show a line containing various information for each input video frame.
1734 The input video is not modified.
1735 </p>
1736 <p>The shown line contains a sequence of key/value pairs of the form
1737 <var>key</var>:<var>value</var>.
1738 </p>
1739 <p>A description of each shown parameter follows:
1740 </p>
1741 <dl compact="compact">
1742 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
1743 <dd><p>sequential number of the input frame, starting from 0
1744 </p>
1745 </dd>
1746 <dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
1747 <dd><p>Presentation TimeStamp of the input frame, expressed as a number of
1748 time base units. The time base unit depends on the filter input pad.
1749 </p>
1750 </dd>
1751 <dt> &lsquo;<samp>pts_time</samp>&rsquo;</dt>
1752 <dd><p>Presentation TimeStamp of the input frame, expressed as a number of
1753 seconds
1754 </p>
1755 </dd>
1756 <dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
1757 <dd><p>position of the frame in the input stream, -1 if this information in
1758 unavailable and/or meanigless (for example in case of synthetic video)
1759 </p>
1760 </dd>
1761 <dt> &lsquo;<samp>fmt</samp>&rsquo;</dt>
1762 <dd><p>pixel format name
1763 </p>
1764 </dd>
1765 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
1766 <dd><p>sample aspect ratio of the input frame, expressed in the form
1767 <var>num</var>/<var>den</var>
1768 </p>
1769 </dd>
1770 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
1771 <dd><p>size of the input frame, expressed in the form
1772 <var>width</var>x<var>height</var>
1773 </p>
1774 </dd>
1775 <dt> &lsquo;<samp>i</samp>&rsquo;</dt>
1776 <dd><p>interlaced mode (&quot;P&quot; for &quot;progressive&quot;, &quot;T&quot; for top field first, &quot;B&quot;
1777 for bottom field first)
1778 </p>
1779 </dd>
1780 <dt> &lsquo;<samp>iskey</samp>&rsquo;</dt>
1781 <dd><p>1 if the frame is a key frame, 0 otherwise
1782 </p>
1783 </dd>
1784 <dt> &lsquo;<samp>type</samp>&rsquo;</dt>
1785 <dd><p>picture type of the input frame (&quot;I&quot; for an I-frame, &quot;P&quot; for a
1786 P-frame, &quot;B&quot; for a B-frame, &quot;?&quot; for unknown type).
1787 Check also the documentation of the <code>AVPictureType</code> enum and of
1788 the <code>av_get_picture_type_char</code> function defined in
1789 &lsquo;<tt>libavutil/avutil.h</tt>&rsquo;.
1790 </p>
1791 </dd>
1792 <dt> &lsquo;<samp>checksum</samp>&rsquo;</dt>
1793 <dd><p>Adler-32 checksum of all the planes of the input frame
1794 </p>
1795 </dd>
1796 <dt> &lsquo;<samp>plane_checksum</samp>&rsquo;</dt>
1797 <dd><p>Adler-32 checksum of each plane of the input frame, expressed in the form
1798 &quot;[<var>c0</var> <var>c1</var> <var>c2</var> <var>c3</var>]&quot;
1799 </p></dd>
1800 </dl>
1801
1802 <a name="slicify"></a>
1803 <h2 class="section"><a href="libavfilter.html#toc-slicify">8.29 slicify</a></h2>
1804
1805 <p>Pass the images of input video on to next video filter as multiple
1806 slices.
1807 </p>
1808 <table><tr><td>&nbsp;</td><td><pre class="example">./ffmpeg -i in.avi -vf &quot;slicify=32&quot; out.avi
1809 </pre></td></tr></table>
1810
1811 <p>The filter accepts the slice height as parameter. If the parameter is
1812 not specified it will use the default value of 16.
1813 </p>
1814 <p>Adding this in the beginning of filter chains should make filtering
1815 faster due to better use of the memory cache.
1816 </p>
1817 <a name="split"></a>
1818 <h2 class="section"><a href="libavfilter.html#toc-split">8.30 split</a></h2>
1819
1820 <p>Pass on the input video to two outputs. Both outputs are identical to
1821 the input video.
1822 </p>
1823 <p>For example:
1824 </p><table><tr><td>&nbsp;</td><td><pre class="example">[in] split [splitout1][splitout2];
1825 [splitout1] crop=100:100:0:0    [cropout];
1826 [splitout2] pad=200:200:100:100 [padout];
1827 </pre></td></tr></table>
1828
1829 <p>will create two separate outputs from the same input, one cropped and
1830 one padded.
1831 </p>
1832 <a name="transpose"></a>
1833 <h2 class="section"><a href="libavfilter.html#toc-transpose">8.31 transpose</a></h2>
1834
1835 <p>Transpose rows with columns in the input video and optionally flip it.
1836 </p>
1837 <p>It accepts a parameter representing an integer, which can assume the
1838 values:
1839 </p>
1840 <dl compact="compact">
1841 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
1842 <dd><p>Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
1843 </p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     L.l
1844 . . -&gt;  . .
1845 l.r     R.r
1846 </pre></td></tr></table>
1847
1848 </dd>
1849 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
1850 <dd><p>Rotate by 90 degrees clockwise, that is:
1851 </p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     l.L
1852 . . -&gt;  . .
1853 l.r     r.R
1854 </pre></td></tr></table>
1855
1856 </dd>
1857 <dt> &lsquo;<samp>2</samp>&rsquo;</dt>
1858 <dd><p>Rotate by 90 degrees counterclockwise, that is:
1859 </p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     R.r
1860 . . -&gt;  . .
1861 l.r     L.l
1862 </pre></td></tr></table>
1863
1864 </dd>
1865 <dt> &lsquo;<samp>3</samp>&rsquo;</dt>
1866 <dd><p>Rotate by 90 degrees clockwise and vertically flip, that is:
1867 </p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     r.R
1868 . . -&gt;  . .
1869 l.r     l.L
1870 </pre></td></tr></table>
1871 </dd>
1872 </dl>
1873
1874 <a name="unsharp"></a>
1875 <h2 class="section"><a href="libavfilter.html#toc-unsharp">8.32 unsharp</a></h2>
1876
1877 <p>Sharpen or blur the input video.
1878 </p>
1879 <p>It accepts the following parameters:
1880 <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>
1881 </p>
1882 <p>Negative values for the amount will blur the input video, while positive
1883 values will sharpen. All parameters are optional and default to the
1884 equivalent of the string &rsquo;5:5:1.0:0:0:0.0&rsquo;.
1885 </p>
1886 <dl compact="compact">
1887 <dt> &lsquo;<samp>luma_msize_x</samp>&rsquo;</dt>
1888 <dd><p>Set the luma matrix horizontal size. It can be an integer between 3
1889 and 13, default value is 5.
1890 </p>
1891 </dd>
1892 <dt> &lsquo;<samp>luma_msize_y</samp>&rsquo;</dt>
1893 <dd><p>Set the luma matrix vertical size. It can be an integer between 3
1894 and 13, default value is 5.
1895 </p>
1896 </dd>
1897 <dt> &lsquo;<samp>luma_amount</samp>&rsquo;</dt>
1898 <dd><p>Set the luma effect strength. It can be a float number between -2.0
1899 and 5.0, default value is 1.0.
1900 </p>
1901 </dd>
1902 <dt> &lsquo;<samp>chroma_msize_x</samp>&rsquo;</dt>
1903 <dd><p>Set the chroma matrix horizontal size. It can be an integer between 3
1904 and 13, default value is 0.
1905 </p>
1906 </dd>
1907 <dt> &lsquo;<samp>chroma_msize_y</samp>&rsquo;</dt>
1908 <dd><p>Set the chroma matrix vertical size. It can be an integer between 3
1909 and 13, default value is 0.
1910 </p>
1911 </dd>
1912 <dt> &lsquo;<samp>luma_amount</samp>&rsquo;</dt>
1913 <dd><p>Set the chroma effect strength. It can be a float number between -2.0
1914 and 5.0, default value is 0.0.
1915 </p>
1916 </dd>
1917 </dl>
1918
1919 <table><tr><td>&nbsp;</td><td><pre class="example"># Strong luma sharpen effect parameters
1920 unsharp=7:7:2.5
1921
1922 # Strong blur of both luma and chroma parameters
1923 unsharp=7:7:-2:7:7:-2
1924
1925 # Use the default values with <code>ffmpeg</code>
1926 ./ffmpeg -i in.avi -vf &quot;unsharp&quot; out.mp4
1927 </pre></td></tr></table>
1928
1929 <a name="vflip"></a>
1930 <h2 class="section"><a href="libavfilter.html#toc-vflip">8.33 vflip</a></h2>
1931
1932 <p>Flip the input video vertically.
1933 </p>
1934 <table><tr><td>&nbsp;</td><td><pre class="example">./ffmpeg -i in.avi -vf &quot;vflip&quot; out.avi
1935 </pre></td></tr></table>
1936
1937 <a name="yadif"></a>
1938 <h2 class="section"><a href="libavfilter.html#toc-yadif">8.34 yadif</a></h2>
1939
1940 <p>Deinterlace the input video (&quot;yadif&quot; means &quot;yet another deinterlacing
1941 filter&quot;).
1942 </p>
1943 <p>It accepts the optional parameters: <var>mode</var>:<var>parity</var>.
1944 </p>
1945 <p><var>mode</var> specifies the interlacing mode to adopt, accepts one of the
1946 following values:
1947 </p>
1948 <dl compact="compact">
1949 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
1950 <dd><p>output 1 frame for each frame
1951 </p></dd>
1952 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
1953 <dd><p>output 1 frame for each field
1954 </p></dd>
1955 <dt> &lsquo;<samp>2</samp>&rsquo;</dt>
1956 <dd><p>like 0 but skips spatial interlacing check
1957 </p></dd>
1958 <dt> &lsquo;<samp>3</samp>&rsquo;</dt>
1959 <dd><p>like 1 but skips spatial interlacing check
1960 </p></dd>
1961 </dl>
1962
1963 <p>Default value is 0.
1964 </p>
1965 <p><var>parity</var> specifies the picture field parity assumed for the input
1966 interlaced video, accepts one of the following values:
1967 </p>
1968 <dl compact="compact">
1969 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
1970 <dd><p>assume bottom field first
1971 </p></dd>
1972 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
1973 <dd><p>assume top field first
1974 </p></dd>
1975 <dt> &lsquo;<samp>-1</samp>&rsquo;</dt>
1976 <dd><p>enable automatic detection
1977 </p></dd>
1978 </dl>
1979
1980 <p>Default value is -1.
1981 If interlacing is unknown or decoder does not export this information,
1982 top field first will be assumed.
1983 </p>
1984
1985 <a name="Video-Sources"></a>
1986 <h1 class="chapter"><a href="libavfilter.html#toc-Video-Sources">9. Video Sources</a></h1>
1987
1988 <p>Below is a description of the currently available video sources.
1989 </p>
1990 <a name="buffer"></a>
1991 <h2 class="section"><a href="libavfilter.html#toc-buffer">9.1 buffer</a></h2>
1992
1993 <p>Buffer video frames, and make them available to the filter chain.
1994 </p>
1995 <p>This source is mainly intended for a programmatic use, in particular
1996 through the interface defined in &lsquo;<tt>libavfilter/vsrc_buffer.h</tt>&rsquo;.
1997 </p>
1998 <p>It accepts the following parameters:
1999 <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>
2000 </p>
2001 <p>All the parameters but <var>scale_params</var> need to be explicitely
2002 defined.
2003 </p>
2004 <p>Follows the list of the accepted parameters.
2005 </p>
2006 <dl compact="compact">
2007 <dt> &lsquo;<samp>width, height</samp>&rsquo;</dt>
2008 <dd><p>Specify the width and height of the buffered video frames.
2009 </p>
2010 </dd>
2011 <dt> &lsquo;<samp>pix_fmt_string</samp>&rsquo;</dt>
2012 <dd><p>A string representing the pixel format of the buffered video frames.
2013 It may be a number corresponding to a pixel format, or a pixel format
2014 name.
2015 </p>
2016 </dd>
2017 <dt> &lsquo;<samp>timebase_num, timebase_den</samp>&rsquo;</dt>
2018 <dd><p>Specify numerator and denomitor of the timebase assumed by the
2019 timestamps of the buffered frames.
2020 </p>
2021 </dd>
2022 <dt> &lsquo;<samp>sample_aspect_ratio.num, sample_aspect_ratio.den</samp>&rsquo;</dt>
2023 <dd><p>Specify numerator and denominator of the sample aspect ratio assumed
2024 by the video frames.
2025 </p>
2026 </dd>
2027 <dt> &lsquo;<samp>scale_params</samp>&rsquo;</dt>
2028 <dd><p>Specify the optional parameters to be used for the scale filter which
2029 is automatically inserted when an input change is detected in the
2030 input size or format.
2031 </p></dd>
2032 </dl>
2033
2034 <p>For example:
2035 </p><table><tr><td>&nbsp;</td><td><pre class="example">buffer=320:240:yuv410p:1:24:1:1
2036 </pre></td></tr></table>
2037
2038 <p>will instruct the source to accept video frames with size 320x240 and
2039 with format &quot;yuv410p&quot;, assuming 1/24 as the timestamps timebase and
2040 square pixels (1:1 sample aspect ratio).
2041 Since the pixel format with name &quot;yuv410p&quot; corresponds to the number 6
2042 (check the enum PixelFormat definition in &lsquo;<tt>libavutil/pixfmt.h</tt>&rsquo;),
2043 this example corresponds to:
2044 </p><table><tr><td>&nbsp;</td><td><pre class="example">buffer=320:240:6:1:24:1:1
2045 </pre></td></tr></table>
2046
2047 <a name="color"></a>
2048 <h2 class="section"><a href="libavfilter.html#toc-color">9.2 color</a></h2>
2049
2050 <p>Provide an uniformly colored input.
2051 </p>
2052 <p>It accepts the following parameters:
2053 <var>color</var>:<var>frame_size</var>:<var>frame_rate</var>
2054 </p>
2055 <p>Follows the description of the accepted parameters.
2056 </p>
2057 <dl compact="compact">
2058 <dt> &lsquo;<samp>color</samp>&rsquo;</dt>
2059 <dd><p>Specify the color of the source. It can be the name of a color (case
2060 insensitive match) or a 0xRRGGBB[AA] sequence, possibly followed by an
2061 alpha specifier. The default value is &quot;black&quot;.
2062 </p>
2063 </dd>
2064 <dt> &lsquo;<samp>frame_size</samp>&rsquo;</dt>
2065 <dd><p>Specify the size of the sourced video, it may be a string of the form
2066 <var>width</var>x<var>heigth</var>, or the name of a size abbreviation. The
2067 default value is &quot;320x240&quot;.
2068 </p>
2069 </dd>
2070 <dt> &lsquo;<samp>frame_rate</samp>&rsquo;</dt>
2071 <dd><p>Specify the frame rate of the sourced video, as the number of frames
2072 generated per second. It has to be a string in the format
2073 <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a float
2074 number or a valid video frame rate abbreviation. The default value is
2075 &quot;25&quot;.
2076 </p>
2077 </dd>
2078 </dl>
2079
2080 <p>For example the following graph description will generate a red source
2081 with an opacity of 0.2, with size &quot;qcif&quot; and a frame rate of 10
2082 frames per second, which will be overlayed over the source connected
2083 to the pad with identifier &quot;in&quot;.
2084 </p>
2085 <table><tr><td>&nbsp;</td><td><pre class="example">&quot;color=red@0.2:qcif:10 [color]; [in][color] overlay [out]&quot;
2086 </pre></td></tr></table>
2087
2088 <a name="movie"></a>
2089 <h2 class="section"><a href="libavfilter.html#toc-movie">9.3 movie</a></h2>
2090
2091 <p>Read a video stream from a movie container.
2092 </p>
2093 <p>It accepts the syntax: <var>movie_name</var>[:<var>options</var>] where
2094 <var>movie_name</var> is the name of the resource to read (not necessarily
2095 a file but also a device or a stream accessed through some protocol),
2096 and <var>options</var> is an optional sequence of <var>key</var>=<var>value</var>
2097 pairs, separated by &quot;:&quot;.
2098 </p>
2099 <p>The description of the accepted options follows.
2100 </p>
2101 <dl compact="compact">
2102 <dt> &lsquo;<samp>format_name, f</samp>&rsquo;</dt>
2103 <dd><p>Specifies the format assumed for the movie to read, and can be either
2104 the name of a container or an input device. If not specified the
2105 format is guessed from <var>movie_name</var> or by probing.
2106 </p>
2107 </dd>
2108 <dt> &lsquo;<samp>seek_point, sp</samp>&rsquo;</dt>
2109 <dd><p>Specifies the seek point in seconds, the frames will be output
2110 starting from this seek point, the parameter is evaluated with
2111 <code>av_strtod</code> so the numerical value may be suffixed by an IS
2112 postfix. Default value is &quot;0&quot;.
2113 </p>
2114 </dd>
2115 <dt> &lsquo;<samp>stream_index, si</samp>&rsquo;</dt>
2116 <dd><p>Specifies the index of the video stream to read. If the value is -1,
2117 the best suited video stream will be automatically selected. Default
2118 value is &quot;-1&quot;.
2119 </p>
2120 </dd>
2121 </dl>
2122
2123 <p>This filter allows to overlay a second video on top of main input of
2124 a filtergraph as shown in this graph:
2125 </p><table><tr><td>&nbsp;</td><td><pre class="example">input -----------&gt; deltapts0 --&gt; overlay --&gt; output
2126                                     ^
2127                                     |
2128 movie --&gt; scale--&gt; deltapts1 -------+
2129 </pre></td></tr></table>
2130
2131 <p>Some examples follow:
2132 </p><table><tr><td>&nbsp;</td><td><pre class="example"># skip 3.2 seconds from the start of the avi file in.avi, and overlay it
2133 # on top of the input labelled as &quot;in&quot;.
2134 movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [movie];
2135 [in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
2136
2137 # read from a video4linux2 device, and overlay it on top of the input
2138 # labelled as &quot;in&quot;
2139 movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [movie];
2140 [in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
2141
2142 </pre></td></tr></table>
2143
2144 <a name="nullsrc"></a>
2145 <h2 class="section"><a href="libavfilter.html#toc-nullsrc">9.4 nullsrc</a></h2>
2146
2147 <p>Null video source, never return images. It is mainly useful as a
2148 template and to be employed in analysis / debugging tools.
2149 </p>
2150 <p>It accepts as optional parameter a string of the form
2151 <var>width</var>:<var>height</var>:<var>timebase</var>.
2152 </p>
2153 <p><var>width</var> and <var>height</var> specify the size of the configured
2154 source. The default values of <var>width</var> and <var>height</var> are
2155 respectively 352 and 288 (corresponding to the CIF size format).
2156 </p>
2157 <p><var>timebase</var> specifies an arithmetic expression representing a
2158 timebase. The expression can contain the constants &quot;PI&quot;, &quot;E&quot;, &quot;PHI&quot;,
2159 &quot;AVTB&quot; (the default timebase), and defaults to the value &quot;AVTB&quot;.
2160 </p>
2161 <a name="frei0r_005fsrc"></a>
2162 <h2 class="section"><a href="libavfilter.html#toc-frei0r_005fsrc">9.5 frei0r_src</a></h2>
2163
2164 <p>Provide a frei0r source.
2165 </p>
2166 <p>To enable compilation of this filter you need to install the frei0r
2167 header and configure FFmpeg with &ndash;enable-frei0r.
2168 </p>
2169 <p>The source supports the syntax:
2170 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>size</var>:<var>rate</var>:<var>src_name</var>[{=|:}<var>param1</var>:<var>param2</var>:...:<var>paramN</var>]
2171 </pre></td></tr></table>
2172
2173 <p><var>size</var> is the size of the video to generate, may be a string of the
2174 form <var>width</var>x<var>height</var> or a frame size abbreviation.
2175 <var>rate</var> is the rate of the video to generate, may be a string of
2176 the form <var>num</var>/<var>den</var> or a frame rate abbreviation.
2177 <var>src_name</var> is the name to the frei0r source to load. For more
2178 information regarding frei0r and how to set the parameters read the
2179 section &quot;frei0r&quot; (see <a href="#frei0r">frei0r</a>) in the description of the video
2180 filters.
2181 </p>
2182 <p>Some examples follow:
2183 </p><table><tr><td>&nbsp;</td><td><pre class="example"># generate a frei0r partik0l source with size 200x200 and framerate 10
2184 # which is overlayed on the overlay filter main input
2185 frei0r_src=200x200:10:partik0l=1234 [overlay]; [in][overlay] overlay
2186 </pre></td></tr></table>
2187
2188
2189 <a name="Video-Sinks"></a>
2190 <h1 class="chapter"><a href="libavfilter.html#toc-Video-Sinks">10. Video Sinks</a></h1>
2191
2192 <p>Below is a description of the currently available video sinks.
2193 </p>
2194 <a name="nullsink"></a>
2195 <h2 class="section"><a href="libavfilter.html#toc-nullsink">10.1 nullsink</a></h2>
2196
2197 <p>Null video sink, do absolutely nothing with the input video. It is
2198 mainly useful as a template and to be employed in analysis / debugging
2199 tools.
2200 </p>
2201
2202
2203 <hr size="1">
2204 <p>
2205  <font size="-1">
2206   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>.
2207  </font>
2208  <br>
2209
2210 </p>
2211 </body>
2212 </html>