]> git.sesse.net Git - casparcg/blob - dependencies64/ffmpeg/doc/ffplay-all.html
Fixed bug in server shut down.
[casparcg] / dependencies64 / ffmpeg / doc / ffplay-all.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3 <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
4   <head>
5     <meta charset="utf-8">
6     <title>
7       ffplay Documentation
8     </title>
9     <meta name="viewport" content="width=device-width,initial-scale=1.0">
10     <link rel="stylesheet" type="text/css" href="bootstrap.min.css">
11     <link rel="stylesheet" type="text/css" href="style.min.css">
12   </head>
13   <body>
14     <div style="width: 95%; margin: auto">
15       <h1>
16       ffplay Documentation
17       </h1>
18 <div align="center">
19 </div>
20
21
22 <a name="SEC_Top"></a>
23
24 <a name="SEC_Contents"></a>
25 <h2 class="contents-heading">Table of Contents</h2>
26
27 <div class="contents">
28
29 <ul class="no-bullet">
30   <li><a name="toc-Synopsis" href="#Synopsis">1 Synopsis</a></li>
31   <li><a name="toc-Description" href="#Description">2 Description</a></li>
32   <li><a name="toc-Options" href="#Options">3 Options</a>
33   <ul class="no-bullet">
34     <li><a name="toc-Stream-specifiers-1" href="#Stream-specifiers-1">3.1 Stream specifiers</a></li>
35     <li><a name="toc-Generic-options" href="#Generic-options">3.2 Generic options</a></li>
36     <li><a name="toc-AVOptions" href="#AVOptions">3.3 AVOptions</a></li>
37     <li><a name="toc-Main-options" href="#Main-options">3.4 Main options</a></li>
38     <li><a name="toc-Advanced-options" href="#Advanced-options">3.5 Advanced options</a></li>
39     <li><a name="toc-While-playing" href="#While-playing">3.6 While playing</a></li>
40   </ul></li>
41   <li><a name="toc-Syntax" href="#Syntax">4 Syntax</a>
42   <ul class="no-bullet">
43     <li><a name="toc-Quoting-and-escaping" href="#Quoting-and-escaping">4.1 Quoting and escaping</a>
44     <ul class="no-bullet">
45       <li><a name="toc-Examples" href="#Examples">4.1.1 Examples</a></li>
46     </ul></li>
47     <li><a name="toc-Date" href="#Date">4.2 Date</a></li>
48     <li><a name="toc-Time-duration" href="#Time-duration">4.3 Time duration</a>
49     <ul class="no-bullet">
50       <li><a name="toc-Examples-1" href="#Examples-1">4.3.1 Examples</a></li>
51     </ul></li>
52     <li><a name="toc-Video-size" href="#Video-size">4.4 Video size</a></li>
53     <li><a name="toc-Video-rate" href="#Video-rate">4.5 Video rate</a></li>
54     <li><a name="toc-Ratio" href="#Ratio">4.6 Ratio</a></li>
55     <li><a name="toc-Color" href="#Color">4.7 Color</a></li>
56     <li><a name="toc-Channel-Layout" href="#Channel-Layout">4.8 Channel Layout</a></li>
57   </ul></li>
58   <li><a name="toc-Expression-Evaluation" href="#Expression-Evaluation">5 Expression Evaluation</a></li>
59   <li><a name="toc-OpenCL-Options" href="#OpenCL-Options">6 OpenCL Options</a></li>
60   <li><a name="toc-Codec-Options" href="#Codec-Options">7 Codec Options</a></li>
61   <li><a name="toc-Decoders" href="#Decoders">8 Decoders</a></li>
62   <li><a name="toc-Video-Decoders" href="#Video-Decoders">9 Video Decoders</a>
63   <ul class="no-bullet">
64     <li><a name="toc-rawvideo" href="#rawvideo">9.1 rawvideo</a>
65     <ul class="no-bullet">
66       <li><a name="toc-Options-1" href="#Options-1">9.1.1 Options</a></li>
67     </ul></li>
68   </ul></li>
69   <li><a name="toc-Audio-Decoders" href="#Audio-Decoders">10 Audio Decoders</a>
70   <ul class="no-bullet">
71     <li><a name="toc-ac3" href="#ac3">10.1 ac3</a>
72     <ul class="no-bullet">
73       <li><a name="toc-AC_002d3-Decoder-Options" href="#AC_002d3-Decoder-Options">10.1.1 AC-3 Decoder Options</a></li>
74     </ul></li>
75     <li><a name="toc-flac" href="#flac">10.2 flac</a>
76     <ul class="no-bullet">
77       <li><a name="toc-FLAC-Decoder-options" href="#FLAC-Decoder-options">10.2.1 FLAC Decoder options</a></li>
78     </ul></li>
79     <li><a name="toc-ffwavesynth" href="#ffwavesynth">10.3 ffwavesynth</a></li>
80     <li><a name="toc-libcelt" href="#libcelt">10.4 libcelt</a></li>
81     <li><a name="toc-libgsm" href="#libgsm">10.5 libgsm</a></li>
82     <li><a name="toc-libilbc" href="#libilbc">10.6 libilbc</a>
83     <ul class="no-bullet">
84       <li><a name="toc-Options-2" href="#Options-2">10.6.1 Options</a></li>
85     </ul></li>
86     <li><a name="toc-libopencore_002damrnb" href="#libopencore_002damrnb">10.7 libopencore-amrnb</a></li>
87     <li><a name="toc-libopencore_002damrwb" href="#libopencore_002damrwb">10.8 libopencore-amrwb</a></li>
88     <li><a name="toc-libopus" href="#libopus">10.9 libopus</a></li>
89   </ul></li>
90   <li><a name="toc-Subtitles-Decoders" href="#Subtitles-Decoders">11 Subtitles Decoders</a>
91   <ul class="no-bullet">
92     <li><a name="toc-dvdsub" href="#dvdsub">11.1 dvdsub</a>
93     <ul class="no-bullet">
94       <li><a name="toc-Options-3" href="#Options-3">11.1.1 Options</a></li>
95     </ul></li>
96     <li><a name="toc-libzvbi_002dteletext" href="#libzvbi_002dteletext">11.2 libzvbi-teletext</a>
97     <ul class="no-bullet">
98       <li><a name="toc-Options-4" href="#Options-4">11.2.1 Options</a></li>
99     </ul></li>
100   </ul></li>
101   <li><a name="toc-Bitstream-Filters" href="#Bitstream-Filters">12 Bitstream Filters</a>
102   <ul class="no-bullet">
103     <li><a name="toc-aac_005fadtstoasc" href="#aac_005fadtstoasc">12.1 aac_adtstoasc</a></li>
104     <li><a name="toc-chomp" href="#chomp">12.2 chomp</a></li>
105     <li><a name="toc-dump_005fextra" href="#dump_005fextra">12.3 dump_extra</a></li>
106     <li><a name="toc-h264_005fmp4toannexb" href="#h264_005fmp4toannexb">12.4 h264_mp4toannexb</a></li>
107     <li><a name="toc-imxdump" href="#imxdump">12.5 imxdump</a></li>
108     <li><a name="toc-mjpeg2jpeg" href="#mjpeg2jpeg">12.6 mjpeg2jpeg</a></li>
109     <li><a name="toc-mjpega_005fdump_005fheader" href="#mjpega_005fdump_005fheader">12.7 mjpega_dump_header</a></li>
110     <li><a name="toc-movsub" href="#movsub">12.8 movsub</a></li>
111     <li><a name="toc-mp3_005fheader_005fdecompress" href="#mp3_005fheader_005fdecompress">12.9 mp3_header_decompress</a></li>
112     <li><a name="toc-mpeg4_005funpack_005fbframes" href="#mpeg4_005funpack_005fbframes">12.10 mpeg4_unpack_bframes</a></li>
113     <li><a name="toc-noise" href="#noise">12.11 noise</a></li>
114     <li><a name="toc-remove_005fextra" href="#remove_005fextra">12.12 remove_extra</a></li>
115   </ul></li>
116   <li><a name="toc-Format-Options" href="#Format-Options">13 Format Options</a>
117   <ul class="no-bullet">
118     <li><a name="toc-Format-stream-specifiers-1" href="#Format-stream-specifiers-1">13.1 Format stream specifiers</a></li>
119   </ul></li>
120   <li><a name="toc-Demuxers" href="#Demuxers">14 Demuxers</a>
121   <ul class="no-bullet">
122     <li><a name="toc-applehttp" href="#applehttp">14.1 applehttp</a></li>
123     <li><a name="toc-apng" href="#apng">14.2 apng</a></li>
124     <li><a name="toc-asf" href="#asf">14.3 asf</a></li>
125     <li><a name="toc-concat-1" href="#concat-1">14.4 concat</a>
126     <ul class="no-bullet">
127       <li><a name="toc-Syntax-1" href="#Syntax-1">14.4.1 Syntax</a></li>
128       <li><a name="toc-Options-5" href="#Options-5">14.4.2 Options</a></li>
129     </ul></li>
130     <li><a name="toc-flv" href="#flv">14.5 flv</a></li>
131     <li><a name="toc-libgme" href="#libgme">14.6 libgme</a></li>
132     <li><a name="toc-libquvi" href="#libquvi">14.7 libquvi</a></li>
133     <li><a name="toc-gif" href="#gif">14.8 gif</a></li>
134     <li><a name="toc-image2" href="#image2">14.9 image2</a>
135     <ul class="no-bullet">
136       <li><a name="toc-Examples-2" href="#Examples-2">14.9.1 Examples</a></li>
137     </ul></li>
138     <li><a name="toc-mpegts" href="#mpegts">14.10 mpegts</a></li>
139     <li><a name="toc-rawvideo-1" href="#rawvideo-1">14.11 rawvideo</a></li>
140     <li><a name="toc-sbg" href="#sbg">14.12 sbg</a></li>
141     <li><a name="toc-tedcaptions" href="#tedcaptions">14.13 tedcaptions</a></li>
142   </ul></li>
143   <li><a name="toc-Metadata" href="#Metadata">15 Metadata</a></li>
144   <li><a name="toc-Protocols" href="#Protocols">16 Protocols</a>
145   <ul class="no-bullet">
146     <li><a name="toc-bluray" href="#bluray">16.1 bluray</a></li>
147     <li><a name="toc-cache" href="#cache">16.2 cache</a></li>
148     <li><a name="toc-concat-2" href="#concat-2">16.3 concat</a></li>
149     <li><a name="toc-crypto" href="#crypto">16.4 crypto</a></li>
150     <li><a name="toc-data" href="#data">16.5 data</a></li>
151     <li><a name="toc-file" href="#file">16.6 file</a></li>
152     <li><a name="toc-ftp" href="#ftp">16.7 ftp</a></li>
153     <li><a name="toc-gopher" href="#gopher">16.8 gopher</a></li>
154     <li><a name="toc-hls" href="#hls">16.9 hls</a></li>
155     <li><a name="toc-http" href="#http">16.10 http</a>
156     <ul class="no-bullet">
157       <li><a name="toc-HTTP-Cookies" href="#HTTP-Cookies">16.10.1 HTTP Cookies</a></li>
158     </ul></li>
159     <li><a name="toc-Icecast" href="#Icecast">16.11 Icecast</a></li>
160     <li><a name="toc-mmst" href="#mmst">16.12 mmst</a></li>
161     <li><a name="toc-mmsh" href="#mmsh">16.13 mmsh</a></li>
162     <li><a name="toc-md5" href="#md5">16.14 md5</a></li>
163     <li><a name="toc-pipe" href="#pipe">16.15 pipe</a></li>
164     <li><a name="toc-rtmp" href="#rtmp">16.16 rtmp</a></li>
165     <li><a name="toc-rtmpe" href="#rtmpe">16.17 rtmpe</a></li>
166     <li><a name="toc-rtmps" href="#rtmps">16.18 rtmps</a></li>
167     <li><a name="toc-rtmpt" href="#rtmpt">16.19 rtmpt</a></li>
168     <li><a name="toc-rtmpte" href="#rtmpte">16.20 rtmpte</a></li>
169     <li><a name="toc-rtmpts" href="#rtmpts">16.21 rtmpts</a></li>
170     <li><a name="toc-libsmbclient" href="#libsmbclient">16.22 libsmbclient</a></li>
171     <li><a name="toc-libssh" href="#libssh">16.23 libssh</a></li>
172     <li><a name="toc-librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte" href="#librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">16.24 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></li>
173     <li><a name="toc-rtp" href="#rtp">16.25 rtp</a></li>
174     <li><a name="toc-rtsp" href="#rtsp">16.26 rtsp</a>
175     <ul class="no-bullet">
176       <li><a name="toc-Examples-3" href="#Examples-3">16.26.1 Examples</a></li>
177     </ul></li>
178     <li><a name="toc-sap" href="#sap">16.27 sap</a>
179     <ul class="no-bullet">
180       <li><a name="toc-Muxer" href="#Muxer">16.27.1 Muxer</a></li>
181       <li><a name="toc-Demuxer" href="#Demuxer">16.27.2 Demuxer</a></li>
182     </ul></li>
183     <li><a name="toc-sctp" href="#sctp">16.28 sctp</a></li>
184     <li><a name="toc-srtp" href="#srtp">16.29 srtp</a></li>
185     <li><a name="toc-subfile" href="#subfile">16.30 subfile</a></li>
186     <li><a name="toc-tcp" href="#tcp">16.31 tcp</a></li>
187     <li><a name="toc-tls" href="#tls">16.32 tls</a></li>
188     <li><a name="toc-udp" href="#udp">16.33 udp</a>
189     <ul class="no-bullet">
190       <li><a name="toc-Examples-4" href="#Examples-4">16.33.1 Examples</a></li>
191     </ul></li>
192     <li><a name="toc-unix" href="#unix">16.34 unix</a></li>
193   </ul></li>
194   <li><a name="toc-Device-Options" href="#Device-Options">17 Device Options</a></li>
195   <li><a name="toc-Input-Devices" href="#Input-Devices">18 Input Devices</a>
196   <ul class="no-bullet">
197     <li><a name="toc-alsa" href="#alsa">18.1 alsa</a></li>
198     <li><a name="toc-avfoundation" href="#avfoundation">18.2 avfoundation</a>
199     <ul class="no-bullet">
200       <li><a name="toc-Options-6" href="#Options-6">18.2.1 Options</a></li>
201       <li><a name="toc-Examples-5" href="#Examples-5">18.2.2 Examples</a></li>
202     </ul></li>
203     <li><a name="toc-bktr" href="#bktr">18.3 bktr</a></li>
204     <li><a name="toc-decklink" href="#decklink">18.4 decklink</a>
205     <ul class="no-bullet">
206       <li><a name="toc-Options-7" href="#Options-7">18.4.1 Options</a></li>
207       <li><a name="toc-Examples-6" href="#Examples-6">18.4.2 Examples</a></li>
208     </ul></li>
209     <li><a name="toc-dshow" href="#dshow">18.5 dshow</a>
210     <ul class="no-bullet">
211       <li><a name="toc-Options-8" href="#Options-8">18.5.1 Options</a></li>
212       <li><a name="toc-Examples-7" href="#Examples-7">18.5.2 Examples</a></li>
213     </ul></li>
214     <li><a name="toc-dv1394" href="#dv1394">18.6 dv1394</a></li>
215     <li><a name="toc-fbdev" href="#fbdev">18.7 fbdev</a></li>
216     <li><a name="toc-gdigrab" href="#gdigrab">18.8 gdigrab</a>
217     <ul class="no-bullet">
218       <li><a name="toc-Options-9" href="#Options-9">18.8.1 Options</a></li>
219     </ul></li>
220     <li><a name="toc-iec61883" href="#iec61883">18.9 iec61883</a>
221     <ul class="no-bullet">
222       <li><a name="toc-Options-10" href="#Options-10">18.9.1 Options</a></li>
223       <li><a name="toc-Examples-8" href="#Examples-8">18.9.2 Examples</a></li>
224     </ul></li>
225     <li><a name="toc-jack" href="#jack">18.10 jack</a></li>
226     <li><a name="toc-lavfi" href="#lavfi">18.11 lavfi</a>
227     <ul class="no-bullet">
228       <li><a name="toc-Options-11" href="#Options-11">18.11.1 Options</a></li>
229       <li><a name="toc-Examples-9" href="#Examples-9">18.11.2 Examples</a></li>
230     </ul></li>
231     <li><a name="toc-libcdio" href="#libcdio">18.12 libcdio</a>
232     <ul class="no-bullet">
233       <li><a name="toc-Options-12" href="#Options-12">18.12.1 Options</a></li>
234     </ul></li>
235     <li><a name="toc-libdc1394" href="#libdc1394">18.13 libdc1394</a></li>
236     <li><a name="toc-openal" href="#openal">18.14 openal</a>
237     <ul class="no-bullet">
238       <li><a name="toc-Options-13" href="#Options-13">18.14.1 Options</a></li>
239       <li><a name="toc-Examples-10" href="#Examples-10">18.14.2 Examples</a></li>
240     </ul></li>
241     <li><a name="toc-oss" href="#oss">18.15 oss</a></li>
242     <li><a name="toc-pulse" href="#pulse">18.16 pulse</a>
243     <ul class="no-bullet">
244       <li><a name="toc-Options-14" href="#Options-14">18.16.1 Options</a></li>
245       <li><a name="toc-Examples-11" href="#Examples-11">18.16.2 Examples</a></li>
246     </ul></li>
247     <li><a name="toc-qtkit" href="#qtkit">18.17 qtkit</a></li>
248     <li><a name="toc-sndio" href="#sndio">18.18 sndio</a></li>
249     <li><a name="toc-video4linux2_002c-v4l2" href="#video4linux2_002c-v4l2">18.19 video4linux2, v4l2</a>
250     <ul class="no-bullet">
251       <li><a name="toc-Options-15" href="#Options-15">18.19.1 Options</a></li>
252     </ul></li>
253     <li><a name="toc-vfwcap" href="#vfwcap">18.20 vfwcap</a></li>
254     <li><a name="toc-x11grab" href="#x11grab">18.21 x11grab</a>
255     <ul class="no-bullet">
256       <li><a name="toc-Options-16" href="#Options-16">18.21.1 Options</a></li>
257       <li><a name="toc-grab_005fx-grab_005fy-AVOption" href="#grab_005fx-grab_005fy-AVOption">18.21.2 <var>grab_x</var> <var>grab_y</var> AVOption</a></li>
258     </ul></li>
259   </ul></li>
260   <li><a name="toc-Resampler-Options" href="#Resampler-Options">19 Resampler Options</a></li>
261   <li><a name="toc-Scaler-Options" href="#Scaler-Options">20 Scaler Options</a></li>
262   <li><a name="toc-Filtering-Introduction" href="#Filtering-Introduction">21 Filtering Introduction</a></li>
263   <li><a name="toc-graph2dot" href="#graph2dot">22 graph2dot</a></li>
264   <li><a name="toc-Filtergraph-description" href="#Filtergraph-description">23 Filtergraph description</a>
265   <ul class="no-bullet">
266     <li><a name="toc-Filtergraph-syntax-1" href="#Filtergraph-syntax-1">23.1 Filtergraph syntax</a></li>
267     <li><a name="toc-Notes-on-filtergraph-escaping" href="#Notes-on-filtergraph-escaping">23.2 Notes on filtergraph escaping</a></li>
268   </ul></li>
269   <li><a name="toc-Timeline-editing" href="#Timeline-editing">24 Timeline editing</a></li>
270   <li><a name="toc-Audio-Filters" href="#Audio-Filters">25 Audio Filters</a>
271   <ul class="no-bullet">
272     <li><a name="toc-adelay" href="#adelay">25.1 adelay</a>
273     <ul class="no-bullet">
274       <li><a name="toc-Examples-12" href="#Examples-12">25.1.1 Examples</a></li>
275     </ul></li>
276     <li><a name="toc-aecho" href="#aecho">25.2 aecho</a>
277     <ul class="no-bullet">
278       <li><a name="toc-Examples-13" href="#Examples-13">25.2.1 Examples</a></li>
279     </ul></li>
280     <li><a name="toc-aeval" href="#aeval">25.3 aeval</a>
281     <ul class="no-bullet">
282       <li><a name="toc-Examples-14" href="#Examples-14">25.3.1 Examples</a></li>
283     </ul></li>
284     <li><a name="toc-afade" href="#afade">25.4 afade</a>
285     <ul class="no-bullet">
286       <li><a name="toc-Examples-15" href="#Examples-15">25.4.1 Examples</a></li>
287     </ul></li>
288     <li><a name="toc-aformat-1" href="#aformat-1">25.5 aformat</a></li>
289     <li><a name="toc-allpass" href="#allpass">25.6 allpass</a></li>
290     <li><a name="toc-amerge" href="#amerge">25.7 amerge</a>
291     <ul class="no-bullet">
292       <li><a name="toc-Examples-16" href="#Examples-16">25.7.1 Examples</a></li>
293     </ul></li>
294     <li><a name="toc-amix" href="#amix">25.8 amix</a></li>
295     <li><a name="toc-anull" href="#anull">25.9 anull</a></li>
296     <li><a name="toc-apad" href="#apad">25.10 apad</a>
297     <ul class="no-bullet">
298       <li><a name="toc-Examples-17" href="#Examples-17">25.10.1 Examples</a></li>
299     </ul></li>
300     <li><a name="toc-aphaser" href="#aphaser">25.11 aphaser</a></li>
301     <li><a name="toc-aresample-1" href="#aresample-1">25.12 aresample</a>
302     <ul class="no-bullet">
303       <li><a name="toc-Examples-18" href="#Examples-18">25.12.1 Examples</a></li>
304     </ul></li>
305     <li><a name="toc-asetnsamples" href="#asetnsamples">25.13 asetnsamples</a></li>
306     <li><a name="toc-asetrate" href="#asetrate">25.14 asetrate</a></li>
307     <li><a name="toc-ashowinfo" href="#ashowinfo">25.15 ashowinfo</a></li>
308     <li><a name="toc-astats-1" href="#astats-1">25.16 astats</a></li>
309     <li><a name="toc-astreamsync" href="#astreamsync">25.17 astreamsync</a>
310     <ul class="no-bullet">
311       <li><a name="toc-Examples-19" href="#Examples-19">25.17.1 Examples</a></li>
312     </ul></li>
313     <li><a name="toc-asyncts" href="#asyncts">25.18 asyncts</a></li>
314     <li><a name="toc-atempo" href="#atempo">25.19 atempo</a>
315     <ul class="no-bullet">
316       <li><a name="toc-Examples-20" href="#Examples-20">25.19.1 Examples</a></li>
317     </ul></li>
318     <li><a name="toc-atrim" href="#atrim">25.20 atrim</a></li>
319     <li><a name="toc-bandpass" href="#bandpass">25.21 bandpass</a></li>
320     <li><a name="toc-bandreject" href="#bandreject">25.22 bandreject</a></li>
321     <li><a name="toc-bass" href="#bass">25.23 bass</a></li>
322     <li><a name="toc-biquad" href="#biquad">25.24 biquad</a></li>
323     <li><a name="toc-bs2b" href="#bs2b">25.25 bs2b</a></li>
324     <li><a name="toc-channelmap" href="#channelmap">25.26 channelmap</a></li>
325     <li><a name="toc-channelsplit" href="#channelsplit">25.27 channelsplit</a></li>
326     <li><a name="toc-chorus" href="#chorus">25.28 chorus</a>
327     <ul class="no-bullet">
328       <li><a name="toc-Examples-21" href="#Examples-21">25.28.1 Examples</a></li>
329     </ul></li>
330     <li><a name="toc-compand" href="#compand">25.29 compand</a>
331     <ul class="no-bullet">
332       <li><a name="toc-Examples-22" href="#Examples-22">25.29.1 Examples</a></li>
333     </ul></li>
334     <li><a name="toc-dcshift" href="#dcshift">25.30 dcshift</a></li>
335     <li><a name="toc-earwax" href="#earwax">25.31 earwax</a></li>
336     <li><a name="toc-equalizer" href="#equalizer">25.32 equalizer</a>
337     <ul class="no-bullet">
338       <li><a name="toc-Examples-23" href="#Examples-23">25.32.1 Examples</a></li>
339     </ul></li>
340     <li><a name="toc-flanger" href="#flanger">25.33 flanger</a></li>
341     <li><a name="toc-highpass" href="#highpass">25.34 highpass</a></li>
342     <li><a name="toc-join" href="#join">25.35 join</a></li>
343     <li><a name="toc-ladspa" href="#ladspa">25.36 ladspa</a>
344     <ul class="no-bullet">
345       <li><a name="toc-Examples-24" href="#Examples-24">25.36.1 Examples</a></li>
346       <li><a name="toc-Commands" href="#Commands">25.36.2 Commands</a></li>
347     </ul></li>
348     <li><a name="toc-lowpass" href="#lowpass">25.37 lowpass</a></li>
349     <li><a name="toc-pan" href="#pan">25.38 pan</a>
350     <ul class="no-bullet">
351       <li><a name="toc-Mixing-examples" href="#Mixing-examples">25.38.1 Mixing examples</a></li>
352       <li><a name="toc-Remapping-examples" href="#Remapping-examples">25.38.2 Remapping examples</a></li>
353     </ul></li>
354     <li><a name="toc-replaygain" href="#replaygain">25.39 replaygain</a></li>
355     <li><a name="toc-resample" href="#resample">25.40 resample</a></li>
356     <li><a name="toc-silencedetect" href="#silencedetect">25.41 silencedetect</a>
357     <ul class="no-bullet">
358       <li><a name="toc-Examples-25" href="#Examples-25">25.41.1 Examples</a></li>
359     </ul></li>
360     <li><a name="toc-silenceremove" href="#silenceremove">25.42 silenceremove</a>
361     <ul class="no-bullet">
362       <li><a name="toc-Examples-26" href="#Examples-26">25.42.1 Examples</a></li>
363     </ul></li>
364     <li><a name="toc-treble" href="#treble">25.43 treble</a></li>
365     <li><a name="toc-volume" href="#volume">25.44 volume</a>
366     <ul class="no-bullet">
367       <li><a name="toc-Commands-1" href="#Commands-1">25.44.1 Commands</a></li>
368       <li><a name="toc-Examples-27" href="#Examples-27">25.44.2 Examples</a></li>
369     </ul></li>
370     <li><a name="toc-volumedetect" href="#volumedetect">25.45 volumedetect</a>
371     <ul class="no-bullet">
372       <li><a name="toc-Examples-28" href="#Examples-28">25.45.1 Examples</a></li>
373     </ul></li>
374   </ul></li>
375   <li><a name="toc-Audio-Sources" href="#Audio-Sources">26 Audio Sources</a>
376   <ul class="no-bullet">
377     <li><a name="toc-abuffer" href="#abuffer">26.1 abuffer</a>
378     <ul class="no-bullet">
379       <li><a name="toc-Examples-29" href="#Examples-29">26.1.1 Examples</a></li>
380     </ul></li>
381     <li><a name="toc-aevalsrc" href="#aevalsrc">26.2 aevalsrc</a>
382     <ul class="no-bullet">
383       <li><a name="toc-Examples-30" href="#Examples-30">26.2.1 Examples</a></li>
384     </ul></li>
385     <li><a name="toc-anullsrc" href="#anullsrc">26.3 anullsrc</a>
386     <ul class="no-bullet">
387       <li><a name="toc-Examples-31" href="#Examples-31">26.3.1 Examples</a></li>
388     </ul></li>
389     <li><a name="toc-flite" href="#flite">26.4 flite</a>
390     <ul class="no-bullet">
391       <li><a name="toc-Examples-32" href="#Examples-32">26.4.1 Examples</a></li>
392     </ul></li>
393     <li><a name="toc-sine" href="#sine">26.5 sine</a>
394     <ul class="no-bullet">
395       <li><a name="toc-Examples-33" href="#Examples-33">26.5.1 Examples</a></li>
396     </ul></li>
397   </ul></li>
398   <li><a name="toc-Audio-Sinks" href="#Audio-Sinks">27 Audio Sinks</a>
399   <ul class="no-bullet">
400     <li><a name="toc-abuffersink" href="#abuffersink">27.1 abuffersink</a></li>
401     <li><a name="toc-anullsink" href="#anullsink">27.2 anullsink</a></li>
402   </ul></li>
403   <li><a name="toc-Video-Filters" href="#Video-Filters">28 Video Filters</a>
404   <ul class="no-bullet">
405     <li><a name="toc-alphaextract" href="#alphaextract">28.1 alphaextract</a></li>
406     <li><a name="toc-alphamerge" href="#alphamerge">28.2 alphamerge</a></li>
407     <li><a name="toc-ass" href="#ass">28.3 ass</a></li>
408     <li><a name="toc-bbox" href="#bbox">28.4 bbox</a></li>
409     <li><a name="toc-blackdetect" href="#blackdetect">28.5 blackdetect</a></li>
410     <li><a name="toc-blackframe" href="#blackframe">28.6 blackframe</a></li>
411     <li><a name="toc-blend_002c-tblend" href="#blend_002c-tblend">28.7 blend, tblend</a>
412     <ul class="no-bullet">
413       <li><a name="toc-Examples-34" href="#Examples-34">28.7.1 Examples</a></li>
414     </ul></li>
415     <li><a name="toc-boxblur" href="#boxblur">28.8 boxblur</a>
416     <ul class="no-bullet">
417       <li><a name="toc-Examples-35" href="#Examples-35">28.8.1 Examples</a></li>
418     </ul></li>
419     <li><a name="toc-codecview" href="#codecview">28.9 codecview</a>
420     <ul class="no-bullet">
421       <li><a name="toc-Examples-36" href="#Examples-36">28.9.1 Examples</a></li>
422     </ul></li>
423     <li><a name="toc-colorbalance" href="#colorbalance">28.10 colorbalance</a>
424     <ul class="no-bullet">
425       <li><a name="toc-Examples-37" href="#Examples-37">28.10.1 Examples</a></li>
426     </ul></li>
427     <li><a name="toc-colorlevels" href="#colorlevels">28.11 colorlevels</a>
428     <ul class="no-bullet">
429       <li><a name="toc-Examples-38" href="#Examples-38">28.11.1 Examples</a></li>
430     </ul></li>
431     <li><a name="toc-colorchannelmixer" href="#colorchannelmixer">28.12 colorchannelmixer</a>
432     <ul class="no-bullet">
433       <li><a name="toc-Examples-39" href="#Examples-39">28.12.1 Examples</a></li>
434     </ul></li>
435     <li><a name="toc-colormatrix" href="#colormatrix">28.13 colormatrix</a></li>
436     <li><a name="toc-copy" href="#copy">28.14 copy</a></li>
437     <li><a name="toc-crop" href="#crop">28.15 crop</a>
438     <ul class="no-bullet">
439       <li><a name="toc-Examples-40" href="#Examples-40">28.15.1 Examples</a></li>
440     </ul></li>
441     <li><a name="toc-cropdetect" href="#cropdetect">28.16 cropdetect</a></li>
442     <li><a name="toc-curves-1" href="#curves-1">28.17 curves</a>
443     <ul class="no-bullet">
444       <li><a name="toc-Examples-41" href="#Examples-41">28.17.1 Examples</a></li>
445     </ul></li>
446     <li><a name="toc-dctdnoiz" href="#dctdnoiz">28.18 dctdnoiz</a>
447     <ul class="no-bullet">
448       <li><a name="toc-Examples-42" href="#Examples-42">28.18.1 Examples</a></li>
449     </ul></li>
450     <li><a name="toc-decimate-1" href="#decimate-1">28.19 decimate</a></li>
451     <li><a name="toc-dejudder" href="#dejudder">28.20 dejudder</a></li>
452     <li><a name="toc-delogo" href="#delogo">28.21 delogo</a>
453     <ul class="no-bullet">
454       <li><a name="toc-Examples-43" href="#Examples-43">28.21.1 Examples</a></li>
455     </ul></li>
456     <li><a name="toc-deshake" href="#deshake">28.22 deshake</a></li>
457     <li><a name="toc-detelecine" href="#detelecine">28.23 detelecine</a></li>
458     <li><a name="toc-drawbox" href="#drawbox">28.24 drawbox</a>
459     <ul class="no-bullet">
460       <li><a name="toc-Examples-44" href="#Examples-44">28.24.1 Examples</a></li>
461     </ul></li>
462     <li><a name="toc-drawgrid" href="#drawgrid">28.25 drawgrid</a>
463     <ul class="no-bullet">
464       <li><a name="toc-Examples-45" href="#Examples-45">28.25.1 Examples</a></li>
465     </ul></li>
466     <li><a name="toc-drawtext-1" href="#drawtext-1">28.26 drawtext</a>
467     <ul class="no-bullet">
468       <li><a name="toc-Syntax-2" href="#Syntax-2">28.26.1 Syntax</a></li>
469       <li><a name="toc-Text-expansion" href="#Text-expansion">28.26.2 Text expansion</a></li>
470       <li><a name="toc-Examples-46" href="#Examples-46">28.26.3 Examples</a></li>
471     </ul></li>
472     <li><a name="toc-edgedetect" href="#edgedetect">28.27 edgedetect</a>
473     <ul class="no-bullet">
474       <li><a name="toc-Examples-47" href="#Examples-47">28.27.1 Examples</a></li>
475     </ul></li>
476     <li><a name="toc-eq" href="#eq">28.28 eq</a>
477     <ul class="no-bullet">
478       <li><a name="toc-Commands-2" href="#Commands-2">28.28.1 Commands</a></li>
479     </ul></li>
480     <li><a name="toc-extractplanes" href="#extractplanes">28.29 extractplanes</a>
481     <ul class="no-bullet">
482       <li><a name="toc-Examples-48" href="#Examples-48">28.29.1 Examples</a></li>
483     </ul></li>
484     <li><a name="toc-elbg" href="#elbg">28.30 elbg</a></li>
485     <li><a name="toc-fade" href="#fade">28.31 fade</a>
486     <ul class="no-bullet">
487       <li><a name="toc-Examples-49" href="#Examples-49">28.31.1 Examples</a></li>
488     </ul></li>
489     <li><a name="toc-fftfilt" href="#fftfilt">28.32 fftfilt</a>
490     <ul class="no-bullet">
491       <li><a name="toc-Examples-50" href="#Examples-50">28.32.1 Examples</a></li>
492     </ul></li>
493     <li><a name="toc-field" href="#field">28.33 field</a></li>
494     <li><a name="toc-fieldmatch" href="#fieldmatch">28.34 fieldmatch</a>
495     <ul class="no-bullet">
496       <li><a name="toc-p_002fc_002fn_002fu_002fb-meaning-1" href="#p_002fc_002fn_002fu_002fb-meaning-1">28.34.1 p/c/n/u/b meaning</a>
497       <ul class="no-bullet">
498         <li><a name="toc-p_002fc_002fn" href="#p_002fc_002fn">28.34.1.1 p/c/n</a></li>
499         <li><a name="toc-u_002fb" href="#u_002fb">28.34.1.2 u/b</a></li>
500       </ul></li>
501       <li><a name="toc-Examples-51" href="#Examples-51">28.34.2 Examples</a></li>
502     </ul></li>
503     <li><a name="toc-fieldorder" href="#fieldorder">28.35 fieldorder</a></li>
504     <li><a name="toc-fifo" href="#fifo">28.36 fifo</a></li>
505     <li><a name="toc-find_005frect" href="#find_005frect">28.37 find_rect</a>
506     <ul class="no-bullet">
507       <li><a name="toc-Examples-52" href="#Examples-52">28.37.1 Examples</a></li>
508     </ul></li>
509     <li><a name="toc-cover_005frect" href="#cover_005frect">28.38 cover_rect</a>
510     <ul class="no-bullet">
511       <li><a name="toc-Examples-53" href="#Examples-53">28.38.1 Examples</a></li>
512     </ul></li>
513     <li><a name="toc-format-1" href="#format-1">28.39 format</a>
514     <ul class="no-bullet">
515       <li><a name="toc-Examples-54" href="#Examples-54">28.39.1 Examples</a></li>
516     </ul></li>
517     <li><a name="toc-fps-1" href="#fps-1">28.40 fps</a>
518     <ul class="no-bullet">
519       <li><a name="toc-Examples-55" href="#Examples-55">28.40.1 Examples</a></li>
520     </ul></li>
521     <li><a name="toc-framepack" href="#framepack">28.41 framepack</a></li>
522     <li><a name="toc-framestep" href="#framestep">28.42 framestep</a></li>
523     <li><a name="toc-frei0r-1" href="#frei0r-1">28.43 frei0r</a>
524     <ul class="no-bullet">
525       <li><a name="toc-Examples-56" href="#Examples-56">28.43.1 Examples</a></li>
526     </ul></li>
527     <li><a name="toc-fspp" href="#fspp">28.44 fspp</a></li>
528     <li><a name="toc-geq" href="#geq">28.45 geq</a>
529     <ul class="no-bullet">
530       <li><a name="toc-Examples-57" href="#Examples-57">28.45.1 Examples</a></li>
531     </ul></li>
532     <li><a name="toc-gradfun" href="#gradfun">28.46 gradfun</a>
533     <ul class="no-bullet">
534       <li><a name="toc-Examples-58" href="#Examples-58">28.46.1 Examples</a></li>
535     </ul></li>
536     <li><a name="toc-haldclut-1" href="#haldclut-1">28.47 haldclut</a>
537     <ul class="no-bullet">
538       <li><a name="toc-Workflow-examples" href="#Workflow-examples">28.47.1 Workflow examples</a>
539       <ul class="no-bullet">
540         <li><a name="toc-Hald-CLUT-video-stream" href="#Hald-CLUT-video-stream">28.47.1.1 Hald CLUT video stream</a></li>
541         <li><a name="toc-Hald-CLUT-with-preview" href="#Hald-CLUT-with-preview">28.47.1.2 Hald CLUT with preview</a></li>
542       </ul></li>
543     </ul></li>
544     <li><a name="toc-hflip" href="#hflip">28.48 hflip</a></li>
545     <li><a name="toc-histeq" href="#histeq">28.49 histeq</a></li>
546     <li><a name="toc-histogram" href="#histogram">28.50 histogram</a>
547     <ul class="no-bullet">
548       <li><a name="toc-Examples-59" href="#Examples-59">28.50.1 Examples</a></li>
549     </ul></li>
550     <li><a name="toc-hqdn3d-1" href="#hqdn3d-1">28.51 hqdn3d</a></li>
551     <li><a name="toc-hqx" href="#hqx">28.52 hqx</a></li>
552     <li><a name="toc-hue" href="#hue">28.53 hue</a>
553     <ul class="no-bullet">
554       <li><a name="toc-Examples-60" href="#Examples-60">28.53.1 Examples</a></li>
555       <li><a name="toc-Commands-3" href="#Commands-3">28.53.2 Commands</a></li>
556     </ul></li>
557     <li><a name="toc-idet" href="#idet">28.54 idet</a></li>
558     <li><a name="toc-il" href="#il">28.55 il</a></li>
559     <li><a name="toc-interlace" href="#interlace">28.56 interlace</a></li>
560     <li><a name="toc-kerndeint" href="#kerndeint">28.57 kerndeint</a>
561     <ul class="no-bullet">
562       <li><a name="toc-Examples-61" href="#Examples-61">28.57.1 Examples</a></li>
563     </ul></li>
564     <li><a name="toc-lenscorrection" href="#lenscorrection">28.58 lenscorrection</a>
565     <ul class="no-bullet">
566       <li><a name="toc-Options-17" href="#Options-17">28.58.1 Options</a></li>
567     </ul></li>
568     <li><a name="toc-lut3d-1" href="#lut3d-1">28.59 lut3d</a></li>
569     <li><a name="toc-lut_002c-lutrgb_002c-lutyuv" href="#lut_002c-lutrgb_002c-lutyuv">28.60 lut, lutrgb, lutyuv</a>
570     <ul class="no-bullet">
571       <li><a name="toc-Examples-62" href="#Examples-62">28.60.1 Examples</a></li>
572     </ul></li>
573     <li><a name="toc-mergeplanes" href="#mergeplanes">28.61 mergeplanes</a>
574     <ul class="no-bullet">
575       <li><a name="toc-Examples-63" href="#Examples-63">28.61.1 Examples</a></li>
576     </ul></li>
577     <li><a name="toc-mcdeint" href="#mcdeint">28.62 mcdeint</a></li>
578     <li><a name="toc-mpdecimate" href="#mpdecimate">28.63 mpdecimate</a></li>
579     <li><a name="toc-negate" href="#negate">28.64 negate</a></li>
580     <li><a name="toc-noformat" href="#noformat">28.65 noformat</a>
581     <ul class="no-bullet">
582       <li><a name="toc-Examples-64" href="#Examples-64">28.65.1 Examples</a></li>
583     </ul></li>
584     <li><a name="toc-noise-1" href="#noise-1">28.66 noise</a>
585     <ul class="no-bullet">
586       <li><a name="toc-Examples-65" href="#Examples-65">28.66.1 Examples</a></li>
587     </ul></li>
588     <li><a name="toc-null" href="#null">28.67 null</a></li>
589     <li><a name="toc-ocv" href="#ocv">28.68 ocv</a>
590     <ul class="no-bullet">
591       <li><a name="toc-dilate-1" href="#dilate-1">28.68.1 dilate</a></li>
592       <li><a name="toc-erode" href="#erode">28.68.2 erode</a></li>
593       <li><a name="toc-smooth" href="#smooth">28.68.3 smooth</a></li>
594     </ul></li>
595     <li><a name="toc-overlay-1" href="#overlay-1">28.69 overlay</a>
596     <ul class="no-bullet">
597       <li><a name="toc-Commands-4" href="#Commands-4">28.69.1 Commands</a></li>
598       <li><a name="toc-Examples-66" href="#Examples-66">28.69.2 Examples</a></li>
599     </ul></li>
600     <li><a name="toc-owdenoise" href="#owdenoise">28.70 owdenoise</a></li>
601     <li><a name="toc-pad" href="#pad">28.71 pad</a>
602     <ul class="no-bullet">
603       <li><a name="toc-Examples-67" href="#Examples-67">28.71.1 Examples</a></li>
604     </ul></li>
605     <li><a name="toc-palettegen-1" href="#palettegen-1">28.72 palettegen</a>
606     <ul class="no-bullet">
607       <li><a name="toc-Examples-68" href="#Examples-68">28.72.1 Examples</a></li>
608     </ul></li>
609     <li><a name="toc-paletteuse" href="#paletteuse">28.73 paletteuse</a>
610     <ul class="no-bullet">
611       <li><a name="toc-Examples-69" href="#Examples-69">28.73.1 Examples</a></li>
612     </ul></li>
613     <li><a name="toc-perspective" href="#perspective">28.74 perspective</a></li>
614     <li><a name="toc-phase" href="#phase">28.75 phase</a></li>
615     <li><a name="toc-pixdesctest" href="#pixdesctest">28.76 pixdesctest</a></li>
616     <li><a name="toc-pp" href="#pp">28.77 pp</a>
617     <ul class="no-bullet">
618       <li><a name="toc-Examples-70" href="#Examples-70">28.77.1 Examples</a></li>
619     </ul></li>
620     <li><a name="toc-pp7" href="#pp7">28.78 pp7</a></li>
621     <li><a name="toc-psnr" href="#psnr">28.79 psnr</a></li>
622     <li><a name="toc-pullup-1" href="#pullup-1">28.80 pullup</a></li>
623     <li><a name="toc-qp" href="#qp">28.81 qp</a>
624     <ul class="no-bullet">
625       <li><a name="toc-Examples-71" href="#Examples-71">28.81.1 Examples</a></li>
626     </ul></li>
627     <li><a name="toc-removelogo" href="#removelogo">28.82 removelogo</a></li>
628     <li><a name="toc-repeatfields" href="#repeatfields">28.83 repeatfields</a></li>
629     <li><a name="toc-rotate" href="#rotate">28.84 rotate</a>
630     <ul class="no-bullet">
631       <li><a name="toc-Examples-72" href="#Examples-72">28.84.1 Examples</a></li>
632       <li><a name="toc-Commands-5" href="#Commands-5">28.84.2 Commands</a></li>
633     </ul></li>
634     <li><a name="toc-sab" href="#sab">28.85 sab</a></li>
635     <li><a name="toc-scale-1" href="#scale-1">28.86 scale</a>
636     <ul class="no-bullet">
637       <li><a name="toc-Options-18" href="#Options-18">28.86.1 Options</a></li>
638       <li><a name="toc-Examples-73" href="#Examples-73">28.86.2 Examples</a></li>
639     </ul></li>
640     <li><a name="toc-separatefields" href="#separatefields">28.87 separatefields</a></li>
641     <li><a name="toc-setdar_002c-setsar" href="#setdar_002c-setsar">28.88 setdar, setsar</a>
642     <ul class="no-bullet">
643       <li><a name="toc-Examples-74" href="#Examples-74">28.88.1 Examples</a></li>
644     </ul></li>
645     <li><a name="toc-setfield-1" href="#setfield-1">28.89 setfield</a></li>
646     <li><a name="toc-showinfo" href="#showinfo">28.90 showinfo</a></li>
647     <li><a name="toc-showpalette" href="#showpalette">28.91 showpalette</a></li>
648     <li><a name="toc-shuffleplanes" href="#shuffleplanes">28.92 shuffleplanes</a></li>
649     <li><a name="toc-signalstats" href="#signalstats">28.93 signalstats</a>
650     <ul class="no-bullet">
651       <li><a name="toc-Examples-75" href="#Examples-75">28.93.1 Examples</a></li>
652     </ul></li>
653     <li><a name="toc-smartblur-1" href="#smartblur-1">28.94 smartblur</a></li>
654     <li><a name="toc-stereo3d" href="#stereo3d">28.95 stereo3d</a>
655     <ul class="no-bullet">
656       <li><a name="toc-Examples-76" href="#Examples-76">28.95.1 Examples</a></li>
657     </ul></li>
658     <li><a name="toc-spp-1" href="#spp-1">28.96 spp</a></li>
659     <li><a name="toc-subtitles-1" href="#subtitles-1">28.97 subtitles</a></li>
660     <li><a name="toc-super2xsai" href="#super2xsai">28.98 super2xsai</a></li>
661     <li><a name="toc-swapuv" href="#swapuv">28.99 swapuv</a></li>
662     <li><a name="toc-telecine" href="#telecine">28.100 telecine</a></li>
663     <li><a name="toc-thumbnail" href="#thumbnail">28.101 thumbnail</a>
664     <ul class="no-bullet">
665       <li><a name="toc-Examples-77" href="#Examples-77">28.101.1 Examples</a></li>
666     </ul></li>
667     <li><a name="toc-tile" href="#tile">28.102 tile</a>
668     <ul class="no-bullet">
669       <li><a name="toc-Examples-78" href="#Examples-78">28.102.1 Examples</a></li>
670     </ul></li>
671     <li><a name="toc-tinterlace" href="#tinterlace">28.103 tinterlace</a></li>
672     <li><a name="toc-transpose" href="#transpose">28.104 transpose</a></li>
673     <li><a name="toc-trim" href="#trim">28.105 trim</a></li>
674     <li><a name="toc-unsharp-1" href="#unsharp-1">28.106 unsharp</a>
675     <ul class="no-bullet">
676       <li><a name="toc-Examples-79" href="#Examples-79">28.106.1 Examples</a></li>
677     </ul></li>
678     <li><a name="toc-uspp" href="#uspp">28.107 uspp</a></li>
679     <li><a name="toc-vidstabdetect-1" href="#vidstabdetect-1">28.108 vidstabdetect</a>
680     <ul class="no-bullet">
681       <li><a name="toc-Examples-80" href="#Examples-80">28.108.1 Examples</a></li>
682     </ul></li>
683     <li><a name="toc-vidstabtransform-1" href="#vidstabtransform-1">28.109 vidstabtransform</a>
684     <ul class="no-bullet">
685       <li><a name="toc-Options-19" href="#Options-19">28.109.1 Options</a></li>
686       <li><a name="toc-Examples-81" href="#Examples-81">28.109.2 Examples</a></li>
687     </ul></li>
688     <li><a name="toc-vflip" href="#vflip">28.110 vflip</a></li>
689     <li><a name="toc-vignette-1" href="#vignette-1">28.111 vignette</a>
690     <ul class="no-bullet">
691       <li><a name="toc-Expressions" href="#Expressions">28.111.1 Expressions</a></li>
692       <li><a name="toc-Examples-82" href="#Examples-82">28.111.2 Examples</a></li>
693     </ul></li>
694     <li><a name="toc-w3fdif" href="#w3fdif">28.112 w3fdif</a></li>
695     <li><a name="toc-xbr" href="#xbr">28.113 xbr</a></li>
696     <li><a name="toc-yadif-1" href="#yadif-1">28.114 yadif</a></li>
697     <li><a name="toc-zoompan" href="#zoompan">28.115 zoompan</a>
698     <ul class="no-bullet">
699       <li><a name="toc-Examples-83" href="#Examples-83">28.115.1 Examples</a></li>
700     </ul></li>
701   </ul></li>
702   <li><a name="toc-Video-Sources" href="#Video-Sources">29 Video Sources</a>
703   <ul class="no-bullet">
704     <li><a name="toc-buffer" href="#buffer">29.1 buffer</a></li>
705     <li><a name="toc-cellauto" href="#cellauto">29.2 cellauto</a>
706     <ul class="no-bullet">
707       <li><a name="toc-Examples-84" href="#Examples-84">29.2.1 Examples</a></li>
708     </ul></li>
709     <li><a name="toc-mandelbrot" href="#mandelbrot">29.3 mandelbrot</a></li>
710     <li><a name="toc-mptestsrc" href="#mptestsrc">29.4 mptestsrc</a></li>
711     <li><a name="toc-frei0r_005fsrc" href="#frei0r_005fsrc">29.5 frei0r_src</a></li>
712     <li><a name="toc-life" href="#life">29.6 life</a>
713     <ul class="no-bullet">
714       <li><a name="toc-Examples-85" href="#Examples-85">29.6.1 Examples</a></li>
715     </ul></li>
716     <li><a name="toc-color_002c-haldclutsrc_002c-nullsrc_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc" href="#color_002c-haldclutsrc_002c-nullsrc_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc">29.7 color, haldclutsrc, nullsrc, rgbtestsrc, smptebars, smptehdbars, testsrc</a>
717     <ul class="no-bullet">
718       <li><a name="toc-Commands-6" href="#Commands-6">29.7.1 Commands</a></li>
719     </ul></li>
720   </ul></li>
721   <li><a name="toc-Video-Sinks" href="#Video-Sinks">30 Video Sinks</a>
722   <ul class="no-bullet">
723     <li><a name="toc-buffersink" href="#buffersink">30.1 buffersink</a></li>
724     <li><a name="toc-nullsink" href="#nullsink">30.2 nullsink</a></li>
725   </ul></li>
726   <li><a name="toc-Multimedia-Filters" href="#Multimedia-Filters">31 Multimedia Filters</a>
727   <ul class="no-bullet">
728     <li><a name="toc-avectorscope" href="#avectorscope">31.1 avectorscope</a>
729     <ul class="no-bullet">
730       <li><a name="toc-Examples-86" href="#Examples-86">31.1.1 Examples</a></li>
731     </ul></li>
732     <li><a name="toc-concat-3" href="#concat-3">31.2 concat</a>
733     <ul class="no-bullet">
734       <li><a name="toc-Examples-87" href="#Examples-87">31.2.1 Examples</a></li>
735     </ul></li>
736     <li><a name="toc-ebur128" href="#ebur128">31.3 ebur128</a>
737     <ul class="no-bullet">
738       <li><a name="toc-Examples-88" href="#Examples-88">31.3.1 Examples</a></li>
739     </ul></li>
740     <li><a name="toc-interleave_002c-ainterleave" href="#interleave_002c-ainterleave">31.4 interleave, ainterleave</a>
741     <ul class="no-bullet">
742       <li><a name="toc-Examples-89" href="#Examples-89">31.4.1 Examples</a></li>
743     </ul></li>
744     <li><a name="toc-perms_002c-aperms" href="#perms_002c-aperms">31.5 perms, aperms</a></li>
745     <li><a name="toc-select_002c-aselect" href="#select_002c-aselect">31.6 select, aselect</a>
746     <ul class="no-bullet">
747       <li><a name="toc-Examples-90" href="#Examples-90">31.6.1 Examples</a></li>
748     </ul></li>
749     <li><a name="toc-sendcmd_002c-asendcmd" href="#sendcmd_002c-asendcmd">31.7 sendcmd, asendcmd</a>
750     <ul class="no-bullet">
751       <li><a name="toc-Commands-syntax" href="#Commands-syntax">31.7.1 Commands syntax</a></li>
752       <li><a name="toc-Examples-91" href="#Examples-91">31.7.2 Examples</a></li>
753     </ul></li>
754     <li><a name="toc-setpts_002c-asetpts" href="#setpts_002c-asetpts">31.8 setpts, asetpts</a>
755     <ul class="no-bullet">
756       <li><a name="toc-Examples-92" href="#Examples-92">31.8.1 Examples</a></li>
757     </ul></li>
758     <li><a name="toc-settb_002c-asettb" href="#settb_002c-asettb">31.9 settb, asettb</a>
759     <ul class="no-bullet">
760       <li><a name="toc-Examples-93" href="#Examples-93">31.9.1 Examples</a></li>
761     </ul></li>
762     <li><a name="toc-showcqt" href="#showcqt">31.10 showcqt</a>
763     <ul class="no-bullet">
764       <li><a name="toc-Examples-94" href="#Examples-94">31.10.1 Examples</a></li>
765     </ul></li>
766     <li><a name="toc-showspectrum" href="#showspectrum">31.11 showspectrum</a>
767     <ul class="no-bullet">
768       <li><a name="toc-Examples-95" href="#Examples-95">31.11.1 Examples</a></li>
769     </ul></li>
770     <li><a name="toc-showwaves" href="#showwaves">31.12 showwaves</a>
771     <ul class="no-bullet">
772       <li><a name="toc-Examples-96" href="#Examples-96">31.12.1 Examples</a></li>
773     </ul></li>
774     <li><a name="toc-showwavespic" href="#showwavespic">31.13 showwavespic</a>
775     <ul class="no-bullet">
776       <li><a name="toc-Examples-97" href="#Examples-97">31.13.1 Examples</a></li>
777     </ul></li>
778     <li><a name="toc-split_002c-asplit" href="#split_002c-asplit">31.14 split, asplit</a>
779     <ul class="no-bullet">
780       <li><a name="toc-Examples-98" href="#Examples-98">31.14.1 Examples</a></li>
781     </ul></li>
782     <li><a name="toc-zmq_002c-azmq" href="#zmq_002c-azmq">31.15 zmq, azmq</a>
783     <ul class="no-bullet">
784       <li><a name="toc-Examples-99" href="#Examples-99">31.15.1 Examples</a></li>
785     </ul></li>
786   </ul></li>
787   <li><a name="toc-Multimedia-Sources" href="#Multimedia-Sources">32 Multimedia Sources</a>
788   <ul class="no-bullet">
789     <li><a name="toc-amovie" href="#amovie">32.1 amovie</a></li>
790     <li><a name="toc-movie-1" href="#movie-1">32.2 movie</a>
791     <ul class="no-bullet">
792       <li><a name="toc-Examples-100" href="#Examples-100">32.2.1 Examples</a></li>
793     </ul></li>
794   </ul></li>
795   <li><a name="toc-See-Also" href="#See-Also">33 See Also</a></li>
796   <li><a name="toc-Authors" href="#Authors">34 Authors</a></li>
797 </ul>
798 </div>
799
800
801 <a name="Synopsis"></a>
802 <h2 class="chapter">1 Synopsis<span class="pull-right"><a class="anchor hidden-xs" href="#Synopsis" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Synopsis" aria-hidden="true">TOC</a></span></h2>
803
804 <p>ffplay [<var>options</var>] [<samp>input_file</samp>]
805 </p>
806 <a name="Description"></a>
807 <h2 class="chapter">2 Description<span class="pull-right"><a class="anchor hidden-xs" href="#Description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Description" aria-hidden="true">TOC</a></span></h2>
808
809 <p>FFplay is a very simple and portable media player using the FFmpeg
810 libraries and the SDL library. It is mostly used as a testbed for the
811 various FFmpeg APIs.
812 </p>
813 <a name="Options"></a>
814 <h2 class="chapter">3 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options" aria-hidden="true">TOC</a></span></h2>
815
816 <p>All the numerical options, if not specified otherwise, accept a string
817 representing a number as input, which may be followed by one of the SI
818 unit prefixes, for example: &rsquo;K&rsquo;, &rsquo;M&rsquo;, or &rsquo;G&rsquo;.
819 </p>
820 <p>If &rsquo;i&rsquo; is appended to the SI unit prefix, the complete prefix will be
821 interpreted as a unit prefix for binary multiples, which are based on
822 powers of 1024 instead of powers of 1000. Appending &rsquo;B&rsquo; to the SI unit
823 prefix multiplies the value by 8. This allows using, for example:
824 &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;, &rsquo;G&rsquo; and &rsquo;B&rsquo; as number suffixes.
825 </p>
826 <p>Options which do not take arguments are boolean options, and set the
827 corresponding value to true. They can be set to false by prefixing
828 the option name with &quot;no&quot;. For example using &quot;-nofoo&quot;
829 will set the boolean option with name &quot;foo&quot; to false.
830 </p>
831 <a name="Stream-specifiers"></a><a name="Stream-specifiers-1"></a>
832 <h3 class="section">3.1 Stream specifiers<span class="pull-right"><a class="anchor hidden-xs" href="#Stream-specifiers-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Stream-specifiers-1" aria-hidden="true">TOC</a></span></h3>
833 <p>Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
834 are used to precisely specify which stream(s) a given option belongs to.
835 </p>
836 <p>A stream specifier is a string generally appended to the option name and
837 separated from it by a colon. E.g. <code>-codec:a:1 ac3</code> contains the
838 <code>a:1</code> stream specifier, which matches the second audio stream. Therefore, it
839 would select the ac3 codec for the second audio stream.
840 </p>
841 <p>A stream specifier can match several streams, so that the option is applied to all
842 of them. E.g. the stream specifier in <code>-b:a 128k</code> matches all audio
843 streams.
844 </p>
845 <p>An empty stream specifier matches all streams. For example, <code>-codec copy</code>
846 or <code>-codec: copy</code> would copy all the streams without reencoding.
847 </p>
848 <p>Possible forms of stream specifiers are:
849 </p><dl compact="compact">
850 <dt><samp><var>stream_index</var></samp></dt>
851 <dd><p>Matches the stream with this index. E.g. <code>-threads:1 4</code> would set the
852 thread count for the second stream to 4.
853 </p></dd>
854 <dt><samp><var>stream_type</var>[:<var>stream_index</var>]</samp></dt>
855 <dd><p><var>stream_type</var> is one of following: &rsquo;v&rsquo; for video, &rsquo;a&rsquo; for audio, &rsquo;s&rsquo; for subtitle,
856 &rsquo;d&rsquo; for data, and &rsquo;t&rsquo; for attachments. If <var>stream_index</var> is given, then it matches
857 stream number <var>stream_index</var> of this type. Otherwise, it matches all
858 streams of this type.
859 </p></dd>
860 <dt><samp>p:<var>program_id</var>[:<var>stream_index</var>]</samp></dt>
861 <dd><p>If <var>stream_index</var> is given, then it matches the stream with number <var>stream_index</var>
862 in the program with the id <var>program_id</var>. Otherwise, it matches all streams in the
863 program.
864 </p></dd>
865 <dt><samp>#<var>stream_id</var> or i:<var>stream_id</var></samp></dt>
866 <dd><p>Match the stream by stream id (e.g. PID in MPEG-TS container).
867 </p></dd>
868 <dt><samp>m:<var>key</var>[:<var>value</var>]</samp></dt>
869 <dd><p>Matches streams with the metadata tag <var>key</var> having the specified value. If
870 <var>value</var> is not given, matches streams that contain the given tag with any
871 value.
872 </p></dd>
873 <dt><samp>u</samp></dt>
874 <dd><p>Matches streams with usable configuration, the codec must be defined and the
875 essential information such as video dimension or audio sample rate must be present.
876 </p>
877 <p>Note that in <code>ffmpeg</code>, matching by metadata will only work properly for
878 input files.
879 </p></dd>
880 </dl>
881
882 <a name="Generic-options"></a>
883 <h3 class="section">3.2 Generic options<span class="pull-right"><a class="anchor hidden-xs" href="#Generic-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Generic-options" aria-hidden="true">TOC</a></span></h3>
884
885 <p>These options are shared amongst the ff* tools.
886 </p>
887 <dl compact="compact">
888 <dt><samp>-L</samp></dt>
889 <dd><p>Show license.
890 </p>
891 </dd>
892 <dt><samp>-h, -?, -help, --help [<var>arg</var>]</samp></dt>
893 <dd><p>Show help. An optional parameter may be specified to print help about a specific
894 item. If no argument is specified, only basic (non advanced) tool
895 options are shown.
896 </p>
897 <p>Possible values of <var>arg</var> are:
898 </p><dl compact="compact">
899 <dt><samp>long</samp></dt>
900 <dd><p>Print advanced tool options in addition to the basic tool options.
901 </p>
902 </dd>
903 <dt><samp>full</samp></dt>
904 <dd><p>Print complete list of options, including shared and private options
905 for encoders, decoders, demuxers, muxers, filters, etc.
906 </p>
907 </dd>
908 <dt><samp>decoder=<var>decoder_name</var></samp></dt>
909 <dd><p>Print detailed information about the decoder named <var>decoder_name</var>. Use the
910 <samp>-decoders</samp> option to get a list of all decoders.
911 </p>
912 </dd>
913 <dt><samp>encoder=<var>encoder_name</var></samp></dt>
914 <dd><p>Print detailed information about the encoder named <var>encoder_name</var>. Use the
915 <samp>-encoders</samp> option to get a list of all encoders.
916 </p>
917 </dd>
918 <dt><samp>demuxer=<var>demuxer_name</var></samp></dt>
919 <dd><p>Print detailed information about the demuxer named <var>demuxer_name</var>. Use the
920 <samp>-formats</samp> option to get a list of all demuxers and muxers.
921 </p>
922 </dd>
923 <dt><samp>muxer=<var>muxer_name</var></samp></dt>
924 <dd><p>Print detailed information about the muxer named <var>muxer_name</var>. Use the
925 <samp>-formats</samp> option to get a list of all muxers and demuxers.
926 </p>
927 </dd>
928 <dt><samp>filter=<var>filter_name</var></samp></dt>
929 <dd><p>Print detailed information about the filter name <var>filter_name</var>. Use the
930 <samp>-filters</samp> option to get a list of all filters.
931 </p></dd>
932 </dl>
933
934 </dd>
935 <dt><samp>-version</samp></dt>
936 <dd><p>Show version.
937 </p>
938 </dd>
939 <dt><samp>-formats</samp></dt>
940 <dd><p>Show available formats (including devices).
941 </p>
942 </dd>
943 <dt><samp>-devices</samp></dt>
944 <dd><p>Show available devices.
945 </p>
946 </dd>
947 <dt><samp>-codecs</samp></dt>
948 <dd><p>Show all codecs known to libavcodec.
949 </p>
950 <p>Note that the term &rsquo;codec&rsquo; is used throughout this documentation as a shortcut
951 for what is more correctly called a media bitstream format.
952 </p>
953 </dd>
954 <dt><samp>-decoders</samp></dt>
955 <dd><p>Show available decoders.
956 </p>
957 </dd>
958 <dt><samp>-encoders</samp></dt>
959 <dd><p>Show all available encoders.
960 </p>
961 </dd>
962 <dt><samp>-bsfs</samp></dt>
963 <dd><p>Show available bitstream filters.
964 </p>
965 </dd>
966 <dt><samp>-protocols</samp></dt>
967 <dd><p>Show available protocols.
968 </p>
969 </dd>
970 <dt><samp>-filters</samp></dt>
971 <dd><p>Show available libavfilter filters.
972 </p>
973 </dd>
974 <dt><samp>-pix_fmts</samp></dt>
975 <dd><p>Show available pixel formats.
976 </p>
977 </dd>
978 <dt><samp>-sample_fmts</samp></dt>
979 <dd><p>Show available sample formats.
980 </p>
981 </dd>
982 <dt><samp>-layouts</samp></dt>
983 <dd><p>Show channel names and standard channel layouts.
984 </p>
985 </dd>
986 <dt><samp>-colors</samp></dt>
987 <dd><p>Show recognized color names.
988 </p>
989 </dd>
990 <dt><samp>-sources <var>device</var>[,<var>opt1</var>=<var>val1</var>[,<var>opt2</var>=<var>val2</var>]...]</samp></dt>
991 <dd><p>Show autodetected sources of the intput device.
992 Some devices may provide system-dependent source names that cannot be autodetected.
993 The returned list cannot be assumed to be always complete.
994 </p><div class="example">
995 <pre class="example">ffmpeg -sources pulse,server=192.168.0.4
996 </pre></div>
997
998 </dd>
999 <dt><samp>-sinks <var>device</var>[,<var>opt1</var>=<var>val1</var>[,<var>opt2</var>=<var>val2</var>]...]</samp></dt>
1000 <dd><p>Show autodetected sinks of the output device.
1001 Some devices may provide system-dependent sink names that cannot be autodetected.
1002 The returned list cannot be assumed to be always complete.
1003 </p><div class="example">
1004 <pre class="example">ffmpeg -sinks pulse,server=192.168.0.4
1005 </pre></div>
1006
1007 </dd>
1008 <dt><samp>-loglevel [repeat+]<var>loglevel</var> | -v [repeat+]<var>loglevel</var></samp></dt>
1009 <dd><p>Set the logging level used by the library.
1010 Adding &quot;repeat+&quot; indicates that repeated log output should not be compressed
1011 to the first line and the &quot;Last message repeated n times&quot; line will be
1012 omitted. &quot;repeat&quot; can also be used alone.
1013 If &quot;repeat&quot; is used alone, and with no prior loglevel set, the default
1014 loglevel will be used. If multiple loglevel parameters are given, using
1015 &rsquo;repeat&rsquo; will not change the loglevel.
1016 <var>loglevel</var> is a string or a number containing one of the following values:
1017 </p><dl compact="compact">
1018 <dt>&lsquo;<samp>quiet, -8</samp>&rsquo;</dt>
1019 <dd><p>Show nothing at all; be silent.
1020 </p></dd>
1021 <dt>&lsquo;<samp>panic, 0</samp>&rsquo;</dt>
1022 <dd><p>Only show fatal errors which could lead the process to crash, such as
1023 and assert failure. This is not currently used for anything.
1024 </p></dd>
1025 <dt>&lsquo;<samp>fatal, 8</samp>&rsquo;</dt>
1026 <dd><p>Only show fatal errors. These are errors after which the process absolutely
1027 cannot continue after.
1028 </p></dd>
1029 <dt>&lsquo;<samp>error, 16</samp>&rsquo;</dt>
1030 <dd><p>Show all errors, including ones which can be recovered from.
1031 </p></dd>
1032 <dt>&lsquo;<samp>warning, 24</samp>&rsquo;</dt>
1033 <dd><p>Show all warnings and errors. Any message related to possibly
1034 incorrect or unexpected events will be shown.
1035 </p></dd>
1036 <dt>&lsquo;<samp>info, 32</samp>&rsquo;</dt>
1037 <dd><p>Show informative messages during processing. This is in addition to
1038 warnings and errors. This is the default value.
1039 </p></dd>
1040 <dt>&lsquo;<samp>verbose, 40</samp>&rsquo;</dt>
1041 <dd><p>Same as <code>info</code>, except more verbose.
1042 </p></dd>
1043 <dt>&lsquo;<samp>debug, 48</samp>&rsquo;</dt>
1044 <dd><p>Show everything, including debugging information.
1045 </p></dd>
1046 <dt>&lsquo;<samp>trace, 56</samp>&rsquo;</dt>
1047 </dl>
1048
1049 <p>By default the program logs to stderr, if coloring is supported by the
1050 terminal, colors are used to mark errors and warnings. Log coloring
1051 can be disabled setting the environment variable
1052 <code>AV_LOG_FORCE_NOCOLOR</code> or <code>NO_COLOR</code>, or can be forced setting
1053 the environment variable <code>AV_LOG_FORCE_COLOR</code>.
1054 The use of the environment variable <code>NO_COLOR</code> is deprecated and
1055 will be dropped in a following FFmpeg version.
1056 </p>
1057 </dd>
1058 <dt><samp>-report</samp></dt>
1059 <dd><p>Dump full command line and console output to a file named
1060 <code><var>program</var>-<var>YYYYMMDD</var>-<var>HHMMSS</var>.log</code> in the current
1061 directory.
1062 This file can be useful for bug reports.
1063 It also implies <code>-loglevel verbose</code>.
1064 </p>
1065 <p>Setting the environment variable <code>FFREPORT</code> to any value has the
1066 same effect. If the value is a &rsquo;:&rsquo;-separated key=value sequence, these
1067 options will affect the report; option values must be escaped if they
1068 contain special characters or the options delimiter &rsquo;:&rsquo; (see the
1069 &ldquo;Quoting and escaping&rdquo; section in the ffmpeg-utils manual).
1070 </p>
1071 <p>The following options are recognized:
1072 </p><dl compact="compact">
1073 <dt><samp>file</samp></dt>
1074 <dd><p>set the file name to use for the report; <code>%p</code> is expanded to the name
1075 of the program, <code>%t</code> is expanded to a timestamp, <code>%%</code> is expanded
1076 to a plain <code>%</code>
1077 </p></dd>
1078 <dt><samp>level</samp></dt>
1079 <dd><p>set the log verbosity level using a numerical value (see <code>-loglevel</code>).
1080 </p></dd>
1081 </dl>
1082
1083 <p>For example, to output a report to a file named <samp>ffreport.log</samp>
1084 using a log level of <code>32</code> (alias for log level <code>info</code>):
1085 </p>
1086 <div class="example">
1087 <pre class="example">FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
1088 </pre></div>
1089
1090 <p>Errors in parsing the environment variable are not fatal, and will not
1091 appear in the report.
1092 </p>
1093 </dd>
1094 <dt><samp>-hide_banner</samp></dt>
1095 <dd><p>Suppress printing banner.
1096 </p>
1097 <p>All FFmpeg tools will normally show a copyright notice, build options
1098 and library versions. This option can be used to suppress printing
1099 this information.
1100 </p>
1101 </dd>
1102 <dt><samp>-cpuflags flags (<em>global</em>)</samp></dt>
1103 <dd><p>Allows setting and clearing cpu flags. This option is intended
1104 for testing. Do not use it unless you know what you&rsquo;re doing.
1105 </p><div class="example">
1106 <pre class="example">ffmpeg -cpuflags -sse+mmx ...
1107 ffmpeg -cpuflags mmx ...
1108 ffmpeg -cpuflags 0 ...
1109 </pre></div>
1110 <p>Possible flags for this option are:
1111 </p><dl compact="compact">
1112 <dt>&lsquo;<samp>x86</samp>&rsquo;</dt>
1113 <dd><dl compact="compact">
1114 <dt>&lsquo;<samp>mmx</samp>&rsquo;</dt>
1115 <dt>&lsquo;<samp>mmxext</samp>&rsquo;</dt>
1116 <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
1117 <dt>&lsquo;<samp>sse2</samp>&rsquo;</dt>
1118 <dt>&lsquo;<samp>sse2slow</samp>&rsquo;</dt>
1119 <dt>&lsquo;<samp>sse3</samp>&rsquo;</dt>
1120 <dt>&lsquo;<samp>sse3slow</samp>&rsquo;</dt>
1121 <dt>&lsquo;<samp>ssse3</samp>&rsquo;</dt>
1122 <dt>&lsquo;<samp>atom</samp>&rsquo;</dt>
1123 <dt>&lsquo;<samp>sse4.1</samp>&rsquo;</dt>
1124 <dt>&lsquo;<samp>sse4.2</samp>&rsquo;</dt>
1125 <dt>&lsquo;<samp>avx</samp>&rsquo;</dt>
1126 <dt>&lsquo;<samp>avx2</samp>&rsquo;</dt>
1127 <dt>&lsquo;<samp>xop</samp>&rsquo;</dt>
1128 <dt>&lsquo;<samp>fma3</samp>&rsquo;</dt>
1129 <dt>&lsquo;<samp>fma4</samp>&rsquo;</dt>
1130 <dt>&lsquo;<samp>3dnow</samp>&rsquo;</dt>
1131 <dt>&lsquo;<samp>3dnowext</samp>&rsquo;</dt>
1132 <dt>&lsquo;<samp>bmi1</samp>&rsquo;</dt>
1133 <dt>&lsquo;<samp>bmi2</samp>&rsquo;</dt>
1134 <dt>&lsquo;<samp>cmov</samp>&rsquo;</dt>
1135 </dl>
1136 </dd>
1137 <dt>&lsquo;<samp>ARM</samp>&rsquo;</dt>
1138 <dd><dl compact="compact">
1139 <dt>&lsquo;<samp>armv5te</samp>&rsquo;</dt>
1140 <dt>&lsquo;<samp>armv6</samp>&rsquo;</dt>
1141 <dt>&lsquo;<samp>armv6t2</samp>&rsquo;</dt>
1142 <dt>&lsquo;<samp>vfp</samp>&rsquo;</dt>
1143 <dt>&lsquo;<samp>vfpv3</samp>&rsquo;</dt>
1144 <dt>&lsquo;<samp>neon</samp>&rsquo;</dt>
1145 <dt>&lsquo;<samp>setend</samp>&rsquo;</dt>
1146 </dl>
1147 </dd>
1148 <dt>&lsquo;<samp>AArch64</samp>&rsquo;</dt>
1149 <dd><dl compact="compact">
1150 <dt>&lsquo;<samp>armv8</samp>&rsquo;</dt>
1151 <dt>&lsquo;<samp>vfp</samp>&rsquo;</dt>
1152 <dt>&lsquo;<samp>neon</samp>&rsquo;</dt>
1153 </dl>
1154 </dd>
1155 <dt>&lsquo;<samp>PowerPC</samp>&rsquo;</dt>
1156 <dd><dl compact="compact">
1157 <dt>&lsquo;<samp>altivec</samp>&rsquo;</dt>
1158 </dl>
1159 </dd>
1160 <dt>&lsquo;<samp>Specific Processors</samp>&rsquo;</dt>
1161 <dd><dl compact="compact">
1162 <dt>&lsquo;<samp>pentium2</samp>&rsquo;</dt>
1163 <dt>&lsquo;<samp>pentium3</samp>&rsquo;</dt>
1164 <dt>&lsquo;<samp>pentium4</samp>&rsquo;</dt>
1165 <dt>&lsquo;<samp>k6</samp>&rsquo;</dt>
1166 <dt>&lsquo;<samp>k62</samp>&rsquo;</dt>
1167 <dt>&lsquo;<samp>athlon</samp>&rsquo;</dt>
1168 <dt>&lsquo;<samp>athlonxp</samp>&rsquo;</dt>
1169 <dt>&lsquo;<samp>k8</samp>&rsquo;</dt>
1170 </dl>
1171 </dd>
1172 </dl>
1173
1174 </dd>
1175 <dt><samp>-opencl_bench</samp></dt>
1176 <dd><p>This option is used to benchmark all available OpenCL devices and print the
1177 results. This option is only available when FFmpeg has been compiled with
1178 <code>--enable-opencl</code>.
1179 </p>
1180 <p>When FFmpeg is configured with <code>--enable-opencl</code>, the options for the
1181 global OpenCL context are set via <samp>-opencl_options</samp>. See the
1182 &quot;OpenCL Options&quot; section in the ffmpeg-utils manual for the complete list of
1183 supported options. Amongst others, these options include the ability to select
1184 a specific platform and device to run the OpenCL code on. By default, FFmpeg
1185 will run on the first device of the first platform. While the options for the
1186 global OpenCL context provide flexibility to the user in selecting the OpenCL
1187 device of their choice, most users would probably want to select the fastest
1188 OpenCL device for their system.
1189 </p>
1190 <p>This option assists the selection of the most efficient configuration by
1191 identifying the appropriate device for the user&rsquo;s system. The built-in
1192 benchmark is run on all the OpenCL devices and the performance is measured for
1193 each device. The devices in the results list are sorted based on their
1194 performance with the fastest device listed first. The user can subsequently
1195 invoke <code>ffmpeg</code> using the device deemed most appropriate via
1196 <samp>-opencl_options</samp> to obtain the best performance for the OpenCL
1197 accelerated code.
1198 </p>
1199 <p>Typical usage to use the fastest OpenCL device involve the following steps.
1200 </p>
1201 <p>Run the command:
1202 </p><div class="example">
1203 <pre class="example">ffmpeg -opencl_bench
1204 </pre></div>
1205 <p>Note down the platform ID (<var>pidx</var>) and device ID (<var>didx</var>) of the first
1206 i.e. fastest device in the list.
1207 Select the platform and device using the command:
1208 </p><div class="example">
1209 <pre class="example">ffmpeg -opencl_options platform_idx=<var>pidx</var>:device_idx=<var>didx</var> ...
1210 </pre></div>
1211
1212 </dd>
1213 <dt><samp>-opencl_options options (<em>global</em>)</samp></dt>
1214 <dd><p>Set OpenCL environment options. This option is only available when
1215 FFmpeg has been compiled with <code>--enable-opencl</code>.
1216 </p>
1217 <p><var>options</var> must be a list of <var>key</var>=<var>value</var> option pairs
1218 separated by &rsquo;:&rsquo;. See the &ldquo;OpenCL Options&rdquo; section in the
1219 ffmpeg-utils manual for the list of supported options.
1220 </p></dd>
1221 </dl>
1222
1223 <a name="AVOptions"></a>
1224 <h3 class="section">3.3 AVOptions<span class="pull-right"><a class="anchor hidden-xs" href="#AVOptions" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-AVOptions" aria-hidden="true">TOC</a></span></h3>
1225
1226 <p>These options are provided directly by the libavformat, libavdevice and
1227 libavcodec libraries. To see the list of available AVOptions, use the
1228 <samp>-help</samp> option. They are separated into two categories:
1229 </p><dl compact="compact">
1230 <dt><samp>generic</samp></dt>
1231 <dd><p>These options can be set for any container, codec or device. Generic options
1232 are listed under AVFormatContext options for containers/devices and under
1233 AVCodecContext options for codecs.
1234 </p></dd>
1235 <dt><samp>private</samp></dt>
1236 <dd><p>These options are specific to the given container, device or codec. Private
1237 options are listed under their corresponding containers/devices/codecs.
1238 </p></dd>
1239 </dl>
1240
1241 <p>For example to write an ID3v2.3 header instead of a default ID3v2.4 to
1242 an MP3 file, use the <samp>id3v2_version</samp> private option of the MP3
1243 muxer:
1244 </p><div class="example">
1245 <pre class="example">ffmpeg -i input.flac -id3v2_version 3 out.mp3
1246 </pre></div>
1247
1248 <p>All codec AVOptions are per-stream, and thus a stream specifier
1249 should be attached to them.
1250 </p>
1251 <p>Note: the <samp>-nooption</samp> syntax cannot be used for boolean
1252 AVOptions, use <samp>-option 0</samp>/<samp>-option 1</samp>.
1253 </p>
1254 <p>Note: the old undocumented way of specifying per-stream AVOptions by
1255 prepending v/a/s to the options name is now obsolete and will be
1256 removed soon.
1257 </p>
1258 <a name="Main-options"></a>
1259 <h3 class="section">3.4 Main options<span class="pull-right"><a class="anchor hidden-xs" href="#Main-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Main-options" aria-hidden="true">TOC</a></span></h3>
1260
1261 <dl compact="compact">
1262 <dt><samp>-x <var>width</var></samp></dt>
1263 <dd><p>Force displayed width.
1264 </p></dd>
1265 <dt><samp>-y <var>height</var></samp></dt>
1266 <dd><p>Force displayed height.
1267 </p></dd>
1268 <dt><samp>-s <var>size</var></samp></dt>
1269 <dd><p>Set frame size (WxH or abbreviation), needed for videos which do
1270 not contain a header with the frame size like raw YUV.  This option
1271 has been deprecated in favor of private options, try -video_size.
1272 </p></dd>
1273 <dt><samp>-fs</samp></dt>
1274 <dd><p>Start in fullscreen mode.
1275 </p></dd>
1276 <dt><samp>-an</samp></dt>
1277 <dd><p>Disable audio.
1278 </p></dd>
1279 <dt><samp>-vn</samp></dt>
1280 <dd><p>Disable video.
1281 </p></dd>
1282 <dt><samp>-sn</samp></dt>
1283 <dd><p>Disable subtitles.
1284 </p></dd>
1285 <dt><samp>-ss <var>pos</var></samp></dt>
1286 <dd><p>Seek to a given position in seconds.
1287 </p></dd>
1288 <dt><samp>-t <var>duration</var></samp></dt>
1289 <dd><p>play &lt;duration&gt; seconds of audio/video
1290 </p></dd>
1291 <dt><samp>-bytes</samp></dt>
1292 <dd><p>Seek by bytes.
1293 </p></dd>
1294 <dt><samp>-nodisp</samp></dt>
1295 <dd><p>Disable graphical display.
1296 </p></dd>
1297 <dt><samp>-f <var>fmt</var></samp></dt>
1298 <dd><p>Force format.
1299 </p></dd>
1300 <dt><samp>-window_title <var>title</var></samp></dt>
1301 <dd><p>Set window title (default is the input filename).
1302 </p></dd>
1303 <dt><samp>-loop <var>number</var></samp></dt>
1304 <dd><p>Loops movie playback &lt;number&gt; times. 0 means forever.
1305 </p></dd>
1306 <dt><samp>-showmode <var>mode</var></samp></dt>
1307 <dd><p>Set the show mode to use.
1308 Available values for <var>mode</var> are:
1309 </p><dl compact="compact">
1310 <dt>&lsquo;<samp>0, video</samp>&rsquo;</dt>
1311 <dd><p>show video
1312 </p></dd>
1313 <dt>&lsquo;<samp>1, waves</samp>&rsquo;</dt>
1314 <dd><p>show audio waves
1315 </p></dd>
1316 <dt>&lsquo;<samp>2, rdft</samp>&rsquo;</dt>
1317 <dd><p>show audio frequency band using RDFT ((Inverse) Real Discrete Fourier Transform)
1318 </p></dd>
1319 </dl>
1320
1321 <p>Default value is &quot;video&quot;, if video is not present or cannot be played
1322 &quot;rdft&quot; is automatically selected.
1323 </p>
1324 <p>You can interactively cycle through the available show modes by
1325 pressing the key <tt class="key">w</tt>.
1326 </p>
1327 </dd>
1328 <dt><samp>-vf <var>filtergraph</var></samp></dt>
1329 <dd><p>Create the filtergraph specified by <var>filtergraph</var> and use it to
1330 filter the video stream.
1331 </p>
1332 <p><var>filtergraph</var> is a description of the filtergraph to apply to
1333 the stream, and must have a single video input and a single video
1334 output. In the filtergraph, the input is associated to the label
1335 <code>in</code>, and the output to the label <code>out</code>. See the
1336 ffmpeg-filters manual for more information about the filtergraph
1337 syntax.
1338 </p>
1339 <p>You can specify this parameter multiple times and cycle through the specified
1340 filtergraphs along with the show modes by pressing the key <tt class="key">w</tt>.
1341 </p>
1342 </dd>
1343 <dt><samp>-af <var>filtergraph</var></samp></dt>
1344 <dd><p><var>filtergraph</var> is a description of the filtergraph to apply to
1345 the input audio.
1346 Use the option &quot;-filters&quot; to show all the available filters (including
1347 sources and sinks).
1348 </p>
1349 </dd>
1350 <dt><samp>-i <var>input_file</var></samp></dt>
1351 <dd><p>Read <var>input_file</var>.
1352 </p></dd>
1353 </dl>
1354
1355 <a name="Advanced-options"></a>
1356 <h3 class="section">3.5 Advanced options<span class="pull-right"><a class="anchor hidden-xs" href="#Advanced-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Advanced-options" aria-hidden="true">TOC</a></span></h3>
1357 <dl compact="compact">
1358 <dt><samp>-pix_fmt <var>format</var></samp></dt>
1359 <dd><p>Set pixel format.
1360 This option has been deprecated in favor of private options, try -pixel_format.
1361 </p>
1362 </dd>
1363 <dt><samp>-stats</samp></dt>
1364 <dd><p>Print several playback statistics, in particular show the stream
1365 duration, the codec parameters, the current position in the stream and
1366 the audio/video synchronisation drift. It is on by default, to
1367 explicitly disable it you need to specify <code>-nostats</code>.
1368 </p>
1369 </dd>
1370 <dt><samp>-fast</samp></dt>
1371 <dd><p>Non-spec-compliant optimizations.
1372 </p></dd>
1373 <dt><samp>-genpts</samp></dt>
1374 <dd><p>Generate pts.
1375 </p></dd>
1376 <dt><samp>-sync <var>type</var></samp></dt>
1377 <dd><p>Set the master clock to audio (<code>type=audio</code>), video
1378 (<code>type=video</code>) or external (<code>type=ext</code>). Default is audio. The
1379 master clock is used to control audio-video synchronization. Most media
1380 players use audio as master clock, but in some cases (streaming or high
1381 quality broadcast) it is necessary to change that. This option is mainly
1382 used for debugging purposes.
1383 </p></dd>
1384 <dt><samp>-ast <var>audio_stream_specifier</var></samp></dt>
1385 <dd><p>Select the desired audio stream using the given stream specifier. The stream
1386 specifiers are described in the <a href="#Stream-specifiers">Stream specifiers</a> chapter. If this option
1387 is not specified, the &quot;best&quot; audio stream is selected in the program of the
1388 already selected video stream.
1389 </p></dd>
1390 <dt><samp>-vst <var>video_stream_specifier</var></samp></dt>
1391 <dd><p>Select the desired video stream using the given stream specifier. The stream
1392 specifiers are described in the <a href="#Stream-specifiers">Stream specifiers</a> chapter. If this option
1393 is not specified, the &quot;best&quot; video stream is selected.
1394 </p></dd>
1395 <dt><samp>-sst <var>subtitle_stream_specifier</var></samp></dt>
1396 <dd><p>Select the desired subtitle stream using the given stream specifier. The stream
1397 specifiers are described in the <a href="#Stream-specifiers">Stream specifiers</a> chapter. If this option
1398 is not specified, the &quot;best&quot; subtitle stream is selected in the program of the
1399 already selected video or audio stream.
1400 </p></dd>
1401 <dt><samp>-autoexit</samp></dt>
1402 <dd><p>Exit when video is done playing.
1403 </p></dd>
1404 <dt><samp>-exitonkeydown</samp></dt>
1405 <dd><p>Exit if any key is pressed.
1406 </p></dd>
1407 <dt><samp>-exitonmousedown</samp></dt>
1408 <dd><p>Exit if any mouse button is pressed.
1409 </p>
1410 </dd>
1411 <dt><samp>-codec:<var>media_specifier</var> <var>codec_name</var></samp></dt>
1412 <dd><p>Force a specific decoder implementation for the stream identified by
1413 <var>media_specifier</var>, which can assume the values <code>a</code> (audio),
1414 <code>v</code> (video), and <code>s</code> subtitle.
1415 </p>
1416 </dd>
1417 <dt><samp>-acodec <var>codec_name</var></samp></dt>
1418 <dd><p>Force a specific audio decoder.
1419 </p>
1420 </dd>
1421 <dt><samp>-vcodec <var>codec_name</var></samp></dt>
1422 <dd><p>Force a specific video decoder.
1423 </p>
1424 </dd>
1425 <dt><samp>-scodec <var>codec_name</var></samp></dt>
1426 <dd><p>Force a specific subtitle decoder.
1427 </p>
1428 </dd>
1429 <dt><samp>-autorotate</samp></dt>
1430 <dd><p>Automatically rotate the video according to file metadata. Enabled by
1431 default, use <samp>-noautorotate</samp> to disable it.
1432 </p>
1433 </dd>
1434 <dt><samp>-framedrop</samp></dt>
1435 <dd><p>Drop video frames if video is out of sync. Enabled by default if the master
1436 clock is not set to video. Use this option to enable frame dropping for all
1437 master clock sources, use <samp>-noframedrop</samp> to disable it.
1438 </p>
1439 </dd>
1440 <dt><samp>-infbuf</samp></dt>
1441 <dd><p>Do not limit the input buffer size, read as much data as possible from the
1442 input as soon as possible. Enabled by default for realtime streams, where data
1443 may be dropped if not read in time. Use this option to enable infinite buffers
1444 for all inputs, use <samp>-noinfbuf</samp> to disable it.
1445 </p>
1446 </dd>
1447 </dl>
1448
1449 <a name="While-playing"></a>
1450 <h3 class="section">3.6 While playing<span class="pull-right"><a class="anchor hidden-xs" href="#While-playing" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-While-playing" aria-hidden="true">TOC</a></span></h3>
1451
1452 <dl compact="compact">
1453 <dt><tt class="key">q, ESC</tt></dt>
1454 <dd><p>Quit.
1455 </p>
1456 </dd>
1457 <dt><tt class="key">f</tt></dt>
1458 <dd><p>Toggle full screen.
1459 </p>
1460 </dd>
1461 <dt><tt class="key">p, SPC</tt></dt>
1462 <dd><p>Pause.
1463 </p>
1464 </dd>
1465 <dt><tt class="key">a</tt></dt>
1466 <dd><p>Cycle audio channel in the current program.
1467 </p>
1468 </dd>
1469 <dt><tt class="key">v</tt></dt>
1470 <dd><p>Cycle video channel.
1471 </p>
1472 </dd>
1473 <dt><tt class="key">t</tt></dt>
1474 <dd><p>Cycle subtitle channel in the current program.
1475 </p>
1476 </dd>
1477 <dt><tt class="key">c</tt></dt>
1478 <dd><p>Cycle program.
1479 </p>
1480 </dd>
1481 <dt><tt class="key">w</tt></dt>
1482 <dd><p>Cycle video filters or show modes.
1483 </p>
1484 </dd>
1485 <dt><tt class="key">s</tt></dt>
1486 <dd><p>Step to the next frame.
1487 </p>
1488 <p>Pause if the stream is not already paused, step to the next video
1489 frame, and pause.
1490 </p>
1491 </dd>
1492 <dt><tt class="key">left/right</tt></dt>
1493 <dd><p>Seek backward/forward 10 seconds.
1494 </p>
1495 </dd>
1496 <dt><tt class="key">down/up</tt></dt>
1497 <dd><p>Seek backward/forward 1 minute.
1498 </p>
1499 </dd>
1500 <dt><tt class="key">page down/page up</tt></dt>
1501 <dd><p>Seek to the previous/next chapter.
1502 or if there are no chapters
1503 Seek backward/forward 10 minutes.
1504 </p>
1505 </dd>
1506 <dt><tt class="key">mouse click</tt></dt>
1507 <dd><p>Seek to percentage in file corresponding to fraction of width.
1508 </p>
1509 </dd>
1510 </dl>
1511
1512
1513 <a name="Syntax"></a>
1514 <h2 class="chapter">4 Syntax<span class="pull-right"><a class="anchor hidden-xs" href="#Syntax" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Syntax" aria-hidden="true">TOC</a></span></h2>
1515
1516 <p>This section documents the syntax and formats employed by the FFmpeg
1517 libraries and tools.
1518 </p>
1519 <a name="quoting_005fand_005fescaping"></a><a name="Quoting-and-escaping"></a>
1520 <h3 class="section">4.1 Quoting and escaping<span class="pull-right"><a class="anchor hidden-xs" href="#Quoting-and-escaping" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Quoting-and-escaping" aria-hidden="true">TOC</a></span></h3>
1521
1522 <p>FFmpeg adopts the following quoting and escaping mechanism, unless
1523 explicitly specified. The following rules are applied:
1524 </p>
1525 <ul>
1526 <li> &lsquo;<samp>'</samp>&rsquo; and &lsquo;<samp>\</samp>&rsquo; are special characters (respectively used for
1527 quoting and escaping). In addition to them, there might be other
1528 special characters depending on the specific syntax where the escaping
1529 and quoting are employed.
1530
1531 </li><li> A special character is escaped by prefixing it with a &lsquo;<samp>\</samp>&rsquo;.
1532
1533 </li><li> All characters enclosed between &lsquo;<samp>''</samp>&rsquo; are included literally in the
1534 parsed string. The quote character &lsquo;<samp>'</samp>&rsquo; itself cannot be quoted,
1535 so you may need to close the quote and escape it.
1536
1537 </li><li> Leading and trailing whitespaces, unless escaped or quoted, are
1538 removed from the parsed string.
1539 </li></ul>
1540
1541 <p>Note that you may need to add a second level of escaping when using
1542 the command line or a script, which depends on the syntax of the
1543 adopted shell language.
1544 </p>
1545 <p>The function <code>av_get_token</code> defined in
1546 <samp>libavutil/avstring.h</samp> can be used to parse a token quoted or
1547 escaped according to the rules defined above.
1548 </p>
1549 <p>The tool <samp>tools/ffescape</samp> in the FFmpeg source tree can be used
1550 to automatically quote or escape a string in a script.
1551 </p>
1552 <a name="Examples"></a>
1553 <h4 class="subsection">4.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples" aria-hidden="true">TOC</a></span></h4>
1554
1555 <ul>
1556 <li> Escape the string <code>Crime d'Amour</code> containing the <code>'</code> special
1557 character:
1558 <div class="example">
1559 <pre class="example">Crime d\'Amour
1560 </pre></div>
1561
1562 </li><li> The string above contains a quote, so the <code>'</code> needs to be escaped
1563 when quoting it:
1564 <div class="example">
1565 <pre class="example">'Crime d'\''Amour'
1566 </pre></div>
1567
1568 </li><li> Include leading or trailing whitespaces using quoting:
1569 <div class="example">
1570 <pre class="example">'  this string starts and ends with whitespaces  '
1571 </pre></div>
1572
1573 </li><li> Escaping and quoting can be mixed together:
1574 <div class="example">
1575 <pre class="example">' The string '\'string\'' is a string '
1576 </pre></div>
1577
1578 </li><li> To include a literal &lsquo;<samp>\</samp>&rsquo; you can use either escaping or quoting:
1579 <div class="example">
1580 <pre class="example">'c:\foo' can be written as c:\\foo
1581 </pre></div>
1582 </li></ul>
1583
1584 <a name="date-syntax"></a><a name="Date"></a>
1585 <h3 class="section">4.2 Date<span class="pull-right"><a class="anchor hidden-xs" href="#Date" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Date" aria-hidden="true">TOC</a></span></h3>
1586
1587 <p>The accepted syntax is:
1588 </p><div class="example">
1589 <pre class="example">[(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
1590 now
1591 </pre></div>
1592
1593 <p>If the value is &quot;now&quot; it takes the current time.
1594 </p>
1595 <p>Time is local time unless Z is appended, in which case it is
1596 interpreted as UTC.
1597 If the year-month-day part is not specified it takes the current
1598 year-month-day.
1599 </p>
1600 <a name="time-duration-syntax"></a><a name="Time-duration"></a>
1601 <h3 class="section">4.3 Time duration<span class="pull-right"><a class="anchor hidden-xs" href="#Time-duration" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Time-duration" aria-hidden="true">TOC</a></span></h3>
1602
1603 <p>There are two accepted syntaxes for expressing time duration.
1604 </p>
1605 <div class="example">
1606 <pre class="example">[-][<var>HH</var>:]<var>MM</var>:<var>SS</var>[.<var>m</var>...]
1607 </pre></div>
1608
1609 <p><var>HH</var> expresses the number of hours, <var>MM</var> the number of minutes
1610 for a maximum of 2 digits, and <var>SS</var> the number of seconds for a
1611 maximum of 2 digits. The <var>m</var> at the end expresses decimal value for
1612 <var>SS</var>.
1613 </p>
1614 <p><em>or</em>
1615 </p>
1616 <div class="example">
1617 <pre class="example">[-]<var>S</var>+[.<var>m</var>...]
1618 </pre></div>
1619
1620 <p><var>S</var> expresses the number of seconds, with the optional decimal part
1621 <var>m</var>.
1622 </p>
1623 <p>In both expressions, the optional &lsquo;<samp>-</samp>&rsquo; indicates negative duration.
1624 </p>
1625 <a name="Examples-1"></a>
1626 <h4 class="subsection">4.3.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-1" aria-hidden="true">TOC</a></span></h4>
1627
1628 <p>The following examples are all valid time duration:
1629 </p>
1630 <dl compact="compact">
1631 <dt>&lsquo;<samp>55</samp>&rsquo;</dt>
1632 <dd><p>55 seconds
1633 </p>
1634 </dd>
1635 <dt>&lsquo;<samp>12:03:45</samp>&rsquo;</dt>
1636 <dd><p>12 hours, 03 minutes and 45 seconds
1637 </p>
1638 </dd>
1639 <dt>&lsquo;<samp>23.189</samp>&rsquo;</dt>
1640 <dd><p>23.189 seconds
1641 </p></dd>
1642 </dl>
1643
1644 <a name="video-size-syntax"></a><a name="Video-size"></a>
1645 <h3 class="section">4.4 Video size<span class="pull-right"><a class="anchor hidden-xs" href="#Video-size" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-size" aria-hidden="true">TOC</a></span></h3>
1646 <p>Specify the size of the sourced video, it may be a string of the form
1647 <var>width</var>x<var>height</var>, or the name of a size abbreviation.
1648 </p>
1649 <p>The following abbreviations are recognized:
1650 </p><dl compact="compact">
1651 <dt>&lsquo;<samp>ntsc</samp>&rsquo;</dt>
1652 <dd><p>720x480
1653 </p></dd>
1654 <dt>&lsquo;<samp>pal</samp>&rsquo;</dt>
1655 <dd><p>720x576
1656 </p></dd>
1657 <dt>&lsquo;<samp>qntsc</samp>&rsquo;</dt>
1658 <dd><p>352x240
1659 </p></dd>
1660 <dt>&lsquo;<samp>qpal</samp>&rsquo;</dt>
1661 <dd><p>352x288
1662 </p></dd>
1663 <dt>&lsquo;<samp>sntsc</samp>&rsquo;</dt>
1664 <dd><p>640x480
1665 </p></dd>
1666 <dt>&lsquo;<samp>spal</samp>&rsquo;</dt>
1667 <dd><p>768x576
1668 </p></dd>
1669 <dt>&lsquo;<samp>film</samp>&rsquo;</dt>
1670 <dd><p>352x240
1671 </p></dd>
1672 <dt>&lsquo;<samp>ntsc-film</samp>&rsquo;</dt>
1673 <dd><p>352x240
1674 </p></dd>
1675 <dt>&lsquo;<samp>sqcif</samp>&rsquo;</dt>
1676 <dd><p>128x96
1677 </p></dd>
1678 <dt>&lsquo;<samp>qcif</samp>&rsquo;</dt>
1679 <dd><p>176x144
1680 </p></dd>
1681 <dt>&lsquo;<samp>cif</samp>&rsquo;</dt>
1682 <dd><p>352x288
1683 </p></dd>
1684 <dt>&lsquo;<samp>4cif</samp>&rsquo;</dt>
1685 <dd><p>704x576
1686 </p></dd>
1687 <dt>&lsquo;<samp>16cif</samp>&rsquo;</dt>
1688 <dd><p>1408x1152
1689 </p></dd>
1690 <dt>&lsquo;<samp>qqvga</samp>&rsquo;</dt>
1691 <dd><p>160x120
1692 </p></dd>
1693 <dt>&lsquo;<samp>qvga</samp>&rsquo;</dt>
1694 <dd><p>320x240
1695 </p></dd>
1696 <dt>&lsquo;<samp>vga</samp>&rsquo;</dt>
1697 <dd><p>640x480
1698 </p></dd>
1699 <dt>&lsquo;<samp>svga</samp>&rsquo;</dt>
1700 <dd><p>800x600
1701 </p></dd>
1702 <dt>&lsquo;<samp>xga</samp>&rsquo;</dt>
1703 <dd><p>1024x768
1704 </p></dd>
1705 <dt>&lsquo;<samp>uxga</samp>&rsquo;</dt>
1706 <dd><p>1600x1200
1707 </p></dd>
1708 <dt>&lsquo;<samp>qxga</samp>&rsquo;</dt>
1709 <dd><p>2048x1536
1710 </p></dd>
1711 <dt>&lsquo;<samp>sxga</samp>&rsquo;</dt>
1712 <dd><p>1280x1024
1713 </p></dd>
1714 <dt>&lsquo;<samp>qsxga</samp>&rsquo;</dt>
1715 <dd><p>2560x2048
1716 </p></dd>
1717 <dt>&lsquo;<samp>hsxga</samp>&rsquo;</dt>
1718 <dd><p>5120x4096
1719 </p></dd>
1720 <dt>&lsquo;<samp>wvga</samp>&rsquo;</dt>
1721 <dd><p>852x480
1722 </p></dd>
1723 <dt>&lsquo;<samp>wxga</samp>&rsquo;</dt>
1724 <dd><p>1366x768
1725 </p></dd>
1726 <dt>&lsquo;<samp>wsxga</samp>&rsquo;</dt>
1727 <dd><p>1600x1024
1728 </p></dd>
1729 <dt>&lsquo;<samp>wuxga</samp>&rsquo;</dt>
1730 <dd><p>1920x1200
1731 </p></dd>
1732 <dt>&lsquo;<samp>woxga</samp>&rsquo;</dt>
1733 <dd><p>2560x1600
1734 </p></dd>
1735 <dt>&lsquo;<samp>wqsxga</samp>&rsquo;</dt>
1736 <dd><p>3200x2048
1737 </p></dd>
1738 <dt>&lsquo;<samp>wquxga</samp>&rsquo;</dt>
1739 <dd><p>3840x2400
1740 </p></dd>
1741 <dt>&lsquo;<samp>whsxga</samp>&rsquo;</dt>
1742 <dd><p>6400x4096
1743 </p></dd>
1744 <dt>&lsquo;<samp>whuxga</samp>&rsquo;</dt>
1745 <dd><p>7680x4800
1746 </p></dd>
1747 <dt>&lsquo;<samp>cga</samp>&rsquo;</dt>
1748 <dd><p>320x200
1749 </p></dd>
1750 <dt>&lsquo;<samp>ega</samp>&rsquo;</dt>
1751 <dd><p>640x350
1752 </p></dd>
1753 <dt>&lsquo;<samp>hd480</samp>&rsquo;</dt>
1754 <dd><p>852x480
1755 </p></dd>
1756 <dt>&lsquo;<samp>hd720</samp>&rsquo;</dt>
1757 <dd><p>1280x720
1758 </p></dd>
1759 <dt>&lsquo;<samp>hd1080</samp>&rsquo;</dt>
1760 <dd><p>1920x1080
1761 </p></dd>
1762 <dt>&lsquo;<samp>2k</samp>&rsquo;</dt>
1763 <dd><p>2048x1080
1764 </p></dd>
1765 <dt>&lsquo;<samp>2kflat</samp>&rsquo;</dt>
1766 <dd><p>1998x1080
1767 </p></dd>
1768 <dt>&lsquo;<samp>2kscope</samp>&rsquo;</dt>
1769 <dd><p>2048x858
1770 </p></dd>
1771 <dt>&lsquo;<samp>4k</samp>&rsquo;</dt>
1772 <dd><p>4096x2160
1773 </p></dd>
1774 <dt>&lsquo;<samp>4kflat</samp>&rsquo;</dt>
1775 <dd><p>3996x2160
1776 </p></dd>
1777 <dt>&lsquo;<samp>4kscope</samp>&rsquo;</dt>
1778 <dd><p>4096x1716
1779 </p></dd>
1780 <dt>&lsquo;<samp>nhd</samp>&rsquo;</dt>
1781 <dd><p>640x360
1782 </p></dd>
1783 <dt>&lsquo;<samp>hqvga</samp>&rsquo;</dt>
1784 <dd><p>240x160
1785 </p></dd>
1786 <dt>&lsquo;<samp>wqvga</samp>&rsquo;</dt>
1787 <dd><p>400x240
1788 </p></dd>
1789 <dt>&lsquo;<samp>fwqvga</samp>&rsquo;</dt>
1790 <dd><p>432x240
1791 </p></dd>
1792 <dt>&lsquo;<samp>hvga</samp>&rsquo;</dt>
1793 <dd><p>480x320
1794 </p></dd>
1795 <dt>&lsquo;<samp>qhd</samp>&rsquo;</dt>
1796 <dd><p>960x540
1797 </p></dd>
1798 </dl>
1799
1800 <a name="video-rate-syntax"></a><a name="Video-rate"></a>
1801 <h3 class="section">4.5 Video rate<span class="pull-right"><a class="anchor hidden-xs" href="#Video-rate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-rate" aria-hidden="true">TOC</a></span></h3>
1802
1803 <p>Specify the frame rate of a video, expressed as the number of frames
1804 generated per second. It has to be a string in the format
1805 <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a float
1806 number or a valid video frame rate abbreviation.
1807 </p>
1808 <p>The following abbreviations are recognized:
1809 </p><dl compact="compact">
1810 <dt>&lsquo;<samp>ntsc</samp>&rsquo;</dt>
1811 <dd><p>30000/1001
1812 </p></dd>
1813 <dt>&lsquo;<samp>pal</samp>&rsquo;</dt>
1814 <dd><p>25/1
1815 </p></dd>
1816 <dt>&lsquo;<samp>qntsc</samp>&rsquo;</dt>
1817 <dd><p>30000/1001
1818 </p></dd>
1819 <dt>&lsquo;<samp>qpal</samp>&rsquo;</dt>
1820 <dd><p>25/1
1821 </p></dd>
1822 <dt>&lsquo;<samp>sntsc</samp>&rsquo;</dt>
1823 <dd><p>30000/1001
1824 </p></dd>
1825 <dt>&lsquo;<samp>spal</samp>&rsquo;</dt>
1826 <dd><p>25/1
1827 </p></dd>
1828 <dt>&lsquo;<samp>film</samp>&rsquo;</dt>
1829 <dd><p>24/1
1830 </p></dd>
1831 <dt>&lsquo;<samp>ntsc-film</samp>&rsquo;</dt>
1832 <dd><p>24000/1001
1833 </p></dd>
1834 </dl>
1835
1836 <a name="ratio-syntax"></a><a name="Ratio"></a>
1837 <h3 class="section">4.6 Ratio<span class="pull-right"><a class="anchor hidden-xs" href="#Ratio" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Ratio" aria-hidden="true">TOC</a></span></h3>
1838
1839 <p>A ratio can be expressed as an expression, or in the form
1840 <var>numerator</var>:<var>denominator</var>.
1841 </p>
1842 <p>Note that a ratio with infinite (1/0) or negative value is
1843 considered valid, so you should check on the returned value if you
1844 want to exclude those values.
1845 </p>
1846 <p>The undefined value can be expressed using the &quot;0:0&quot; string.
1847 </p>
1848 <a name="color-syntax"></a><a name="Color"></a>
1849 <h3 class="section">4.7 Color<span class="pull-right"><a class="anchor hidden-xs" href="#Color" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Color" aria-hidden="true">TOC</a></span></h3>
1850
1851 <p>It can be the name of a color as defined below (case insensitive match) or a
1852 <code>[0x|#]RRGGBB[AA]</code> sequence, possibly followed by @ and a string
1853 representing the alpha component.
1854 </p>
1855 <p>The alpha component may be a string composed by &quot;0x&quot; followed by an
1856 hexadecimal number or a decimal number between 0.0 and 1.0, which
1857 represents the opacity value (&lsquo;<samp>0x00</samp>&rsquo; or &lsquo;<samp>0.0</samp>&rsquo; means completely
1858 transparent, &lsquo;<samp>0xff</samp>&rsquo; or &lsquo;<samp>1.0</samp>&rsquo; completely opaque). If the alpha
1859 component is not specified then &lsquo;<samp>0xff</samp>&rsquo; is assumed.
1860 </p>
1861 <p>The string &lsquo;<samp>random</samp>&rsquo; will result in a random color.
1862 </p>
1863 <p>The following names of colors are recognized:
1864 </p><dl compact="compact">
1865 <dt>&lsquo;<samp>AliceBlue</samp>&rsquo;</dt>
1866 <dd><p>0xF0F8FF
1867 </p></dd>
1868 <dt>&lsquo;<samp>AntiqueWhite</samp>&rsquo;</dt>
1869 <dd><p>0xFAEBD7
1870 </p></dd>
1871 <dt>&lsquo;<samp>Aqua</samp>&rsquo;</dt>
1872 <dd><p>0x00FFFF
1873 </p></dd>
1874 <dt>&lsquo;<samp>Aquamarine</samp>&rsquo;</dt>
1875 <dd><p>0x7FFFD4
1876 </p></dd>
1877 <dt>&lsquo;<samp>Azure</samp>&rsquo;</dt>
1878 <dd><p>0xF0FFFF
1879 </p></dd>
1880 <dt>&lsquo;<samp>Beige</samp>&rsquo;</dt>
1881 <dd><p>0xF5F5DC
1882 </p></dd>
1883 <dt>&lsquo;<samp>Bisque</samp>&rsquo;</dt>
1884 <dd><p>0xFFE4C4
1885 </p></dd>
1886 <dt>&lsquo;<samp>Black</samp>&rsquo;</dt>
1887 <dd><p>0x000000
1888 </p></dd>
1889 <dt>&lsquo;<samp>BlanchedAlmond</samp>&rsquo;</dt>
1890 <dd><p>0xFFEBCD
1891 </p></dd>
1892 <dt>&lsquo;<samp>Blue</samp>&rsquo;</dt>
1893 <dd><p>0x0000FF
1894 </p></dd>
1895 <dt>&lsquo;<samp>BlueViolet</samp>&rsquo;</dt>
1896 <dd><p>0x8A2BE2
1897 </p></dd>
1898 <dt>&lsquo;<samp>Brown</samp>&rsquo;</dt>
1899 <dd><p>0xA52A2A
1900 </p></dd>
1901 <dt>&lsquo;<samp>BurlyWood</samp>&rsquo;</dt>
1902 <dd><p>0xDEB887
1903 </p></dd>
1904 <dt>&lsquo;<samp>CadetBlue</samp>&rsquo;</dt>
1905 <dd><p>0x5F9EA0
1906 </p></dd>
1907 <dt>&lsquo;<samp>Chartreuse</samp>&rsquo;</dt>
1908 <dd><p>0x7FFF00
1909 </p></dd>
1910 <dt>&lsquo;<samp>Chocolate</samp>&rsquo;</dt>
1911 <dd><p>0xD2691E
1912 </p></dd>
1913 <dt>&lsquo;<samp>Coral</samp>&rsquo;</dt>
1914 <dd><p>0xFF7F50
1915 </p></dd>
1916 <dt>&lsquo;<samp>CornflowerBlue</samp>&rsquo;</dt>
1917 <dd><p>0x6495ED
1918 </p></dd>
1919 <dt>&lsquo;<samp>Cornsilk</samp>&rsquo;</dt>
1920 <dd><p>0xFFF8DC
1921 </p></dd>
1922 <dt>&lsquo;<samp>Crimson</samp>&rsquo;</dt>
1923 <dd><p>0xDC143C
1924 </p></dd>
1925 <dt>&lsquo;<samp>Cyan</samp>&rsquo;</dt>
1926 <dd><p>0x00FFFF
1927 </p></dd>
1928 <dt>&lsquo;<samp>DarkBlue</samp>&rsquo;</dt>
1929 <dd><p>0x00008B
1930 </p></dd>
1931 <dt>&lsquo;<samp>DarkCyan</samp>&rsquo;</dt>
1932 <dd><p>0x008B8B
1933 </p></dd>
1934 <dt>&lsquo;<samp>DarkGoldenRod</samp>&rsquo;</dt>
1935 <dd><p>0xB8860B
1936 </p></dd>
1937 <dt>&lsquo;<samp>DarkGray</samp>&rsquo;</dt>
1938 <dd><p>0xA9A9A9
1939 </p></dd>
1940 <dt>&lsquo;<samp>DarkGreen</samp>&rsquo;</dt>
1941 <dd><p>0x006400
1942 </p></dd>
1943 <dt>&lsquo;<samp>DarkKhaki</samp>&rsquo;</dt>
1944 <dd><p>0xBDB76B
1945 </p></dd>
1946 <dt>&lsquo;<samp>DarkMagenta</samp>&rsquo;</dt>
1947 <dd><p>0x8B008B
1948 </p></dd>
1949 <dt>&lsquo;<samp>DarkOliveGreen</samp>&rsquo;</dt>
1950 <dd><p>0x556B2F
1951 </p></dd>
1952 <dt>&lsquo;<samp>Darkorange</samp>&rsquo;</dt>
1953 <dd><p>0xFF8C00
1954 </p></dd>
1955 <dt>&lsquo;<samp>DarkOrchid</samp>&rsquo;</dt>
1956 <dd><p>0x9932CC
1957 </p></dd>
1958 <dt>&lsquo;<samp>DarkRed</samp>&rsquo;</dt>
1959 <dd><p>0x8B0000
1960 </p></dd>
1961 <dt>&lsquo;<samp>DarkSalmon</samp>&rsquo;</dt>
1962 <dd><p>0xE9967A
1963 </p></dd>
1964 <dt>&lsquo;<samp>DarkSeaGreen</samp>&rsquo;</dt>
1965 <dd><p>0x8FBC8F
1966 </p></dd>
1967 <dt>&lsquo;<samp>DarkSlateBlue</samp>&rsquo;</dt>
1968 <dd><p>0x483D8B
1969 </p></dd>
1970 <dt>&lsquo;<samp>DarkSlateGray</samp>&rsquo;</dt>
1971 <dd><p>0x2F4F4F
1972 </p></dd>
1973 <dt>&lsquo;<samp>DarkTurquoise</samp>&rsquo;</dt>
1974 <dd><p>0x00CED1
1975 </p></dd>
1976 <dt>&lsquo;<samp>DarkViolet</samp>&rsquo;</dt>
1977 <dd><p>0x9400D3
1978 </p></dd>
1979 <dt>&lsquo;<samp>DeepPink</samp>&rsquo;</dt>
1980 <dd><p>0xFF1493
1981 </p></dd>
1982 <dt>&lsquo;<samp>DeepSkyBlue</samp>&rsquo;</dt>
1983 <dd><p>0x00BFFF
1984 </p></dd>
1985 <dt>&lsquo;<samp>DimGray</samp>&rsquo;</dt>
1986 <dd><p>0x696969
1987 </p></dd>
1988 <dt>&lsquo;<samp>DodgerBlue</samp>&rsquo;</dt>
1989 <dd><p>0x1E90FF
1990 </p></dd>
1991 <dt>&lsquo;<samp>FireBrick</samp>&rsquo;</dt>
1992 <dd><p>0xB22222
1993 </p></dd>
1994 <dt>&lsquo;<samp>FloralWhite</samp>&rsquo;</dt>
1995 <dd><p>0xFFFAF0
1996 </p></dd>
1997 <dt>&lsquo;<samp>ForestGreen</samp>&rsquo;</dt>
1998 <dd><p>0x228B22
1999 </p></dd>
2000 <dt>&lsquo;<samp>Fuchsia</samp>&rsquo;</dt>
2001 <dd><p>0xFF00FF
2002 </p></dd>
2003 <dt>&lsquo;<samp>Gainsboro</samp>&rsquo;</dt>
2004 <dd><p>0xDCDCDC
2005 </p></dd>
2006 <dt>&lsquo;<samp>GhostWhite</samp>&rsquo;</dt>
2007 <dd><p>0xF8F8FF
2008 </p></dd>
2009 <dt>&lsquo;<samp>Gold</samp>&rsquo;</dt>
2010 <dd><p>0xFFD700
2011 </p></dd>
2012 <dt>&lsquo;<samp>GoldenRod</samp>&rsquo;</dt>
2013 <dd><p>0xDAA520
2014 </p></dd>
2015 <dt>&lsquo;<samp>Gray</samp>&rsquo;</dt>
2016 <dd><p>0x808080
2017 </p></dd>
2018 <dt>&lsquo;<samp>Green</samp>&rsquo;</dt>
2019 <dd><p>0x008000
2020 </p></dd>
2021 <dt>&lsquo;<samp>GreenYellow</samp>&rsquo;</dt>
2022 <dd><p>0xADFF2F
2023 </p></dd>
2024 <dt>&lsquo;<samp>HoneyDew</samp>&rsquo;</dt>
2025 <dd><p>0xF0FFF0
2026 </p></dd>
2027 <dt>&lsquo;<samp>HotPink</samp>&rsquo;</dt>
2028 <dd><p>0xFF69B4
2029 </p></dd>
2030 <dt>&lsquo;<samp>IndianRed</samp>&rsquo;</dt>
2031 <dd><p>0xCD5C5C
2032 </p></dd>
2033 <dt>&lsquo;<samp>Indigo</samp>&rsquo;</dt>
2034 <dd><p>0x4B0082
2035 </p></dd>
2036 <dt>&lsquo;<samp>Ivory</samp>&rsquo;</dt>
2037 <dd><p>0xFFFFF0
2038 </p></dd>
2039 <dt>&lsquo;<samp>Khaki</samp>&rsquo;</dt>
2040 <dd><p>0xF0E68C
2041 </p></dd>
2042 <dt>&lsquo;<samp>Lavender</samp>&rsquo;</dt>
2043 <dd><p>0xE6E6FA
2044 </p></dd>
2045 <dt>&lsquo;<samp>LavenderBlush</samp>&rsquo;</dt>
2046 <dd><p>0xFFF0F5
2047 </p></dd>
2048 <dt>&lsquo;<samp>LawnGreen</samp>&rsquo;</dt>
2049 <dd><p>0x7CFC00
2050 </p></dd>
2051 <dt>&lsquo;<samp>LemonChiffon</samp>&rsquo;</dt>
2052 <dd><p>0xFFFACD
2053 </p></dd>
2054 <dt>&lsquo;<samp>LightBlue</samp>&rsquo;</dt>
2055 <dd><p>0xADD8E6
2056 </p></dd>
2057 <dt>&lsquo;<samp>LightCoral</samp>&rsquo;</dt>
2058 <dd><p>0xF08080
2059 </p></dd>
2060 <dt>&lsquo;<samp>LightCyan</samp>&rsquo;</dt>
2061 <dd><p>0xE0FFFF
2062 </p></dd>
2063 <dt>&lsquo;<samp>LightGoldenRodYellow</samp>&rsquo;</dt>
2064 <dd><p>0xFAFAD2
2065 </p></dd>
2066 <dt>&lsquo;<samp>LightGreen</samp>&rsquo;</dt>
2067 <dd><p>0x90EE90
2068 </p></dd>
2069 <dt>&lsquo;<samp>LightGrey</samp>&rsquo;</dt>
2070 <dd><p>0xD3D3D3
2071 </p></dd>
2072 <dt>&lsquo;<samp>LightPink</samp>&rsquo;</dt>
2073 <dd><p>0xFFB6C1
2074 </p></dd>
2075 <dt>&lsquo;<samp>LightSalmon</samp>&rsquo;</dt>
2076 <dd><p>0xFFA07A
2077 </p></dd>
2078 <dt>&lsquo;<samp>LightSeaGreen</samp>&rsquo;</dt>
2079 <dd><p>0x20B2AA
2080 </p></dd>
2081 <dt>&lsquo;<samp>LightSkyBlue</samp>&rsquo;</dt>
2082 <dd><p>0x87CEFA
2083 </p></dd>
2084 <dt>&lsquo;<samp>LightSlateGray</samp>&rsquo;</dt>
2085 <dd><p>0x778899
2086 </p></dd>
2087 <dt>&lsquo;<samp>LightSteelBlue</samp>&rsquo;</dt>
2088 <dd><p>0xB0C4DE
2089 </p></dd>
2090 <dt>&lsquo;<samp>LightYellow</samp>&rsquo;</dt>
2091 <dd><p>0xFFFFE0
2092 </p></dd>
2093 <dt>&lsquo;<samp>Lime</samp>&rsquo;</dt>
2094 <dd><p>0x00FF00
2095 </p></dd>
2096 <dt>&lsquo;<samp>LimeGreen</samp>&rsquo;</dt>
2097 <dd><p>0x32CD32
2098 </p></dd>
2099 <dt>&lsquo;<samp>Linen</samp>&rsquo;</dt>
2100 <dd><p>0xFAF0E6
2101 </p></dd>
2102 <dt>&lsquo;<samp>Magenta</samp>&rsquo;</dt>
2103 <dd><p>0xFF00FF
2104 </p></dd>
2105 <dt>&lsquo;<samp>Maroon</samp>&rsquo;</dt>
2106 <dd><p>0x800000
2107 </p></dd>
2108 <dt>&lsquo;<samp>MediumAquaMarine</samp>&rsquo;</dt>
2109 <dd><p>0x66CDAA
2110 </p></dd>
2111 <dt>&lsquo;<samp>MediumBlue</samp>&rsquo;</dt>
2112 <dd><p>0x0000CD
2113 </p></dd>
2114 <dt>&lsquo;<samp>MediumOrchid</samp>&rsquo;</dt>
2115 <dd><p>0xBA55D3
2116 </p></dd>
2117 <dt>&lsquo;<samp>MediumPurple</samp>&rsquo;</dt>
2118 <dd><p>0x9370D8
2119 </p></dd>
2120 <dt>&lsquo;<samp>MediumSeaGreen</samp>&rsquo;</dt>
2121 <dd><p>0x3CB371
2122 </p></dd>
2123 <dt>&lsquo;<samp>MediumSlateBlue</samp>&rsquo;</dt>
2124 <dd><p>0x7B68EE
2125 </p></dd>
2126 <dt>&lsquo;<samp>MediumSpringGreen</samp>&rsquo;</dt>
2127 <dd><p>0x00FA9A
2128 </p></dd>
2129 <dt>&lsquo;<samp>MediumTurquoise</samp>&rsquo;</dt>
2130 <dd><p>0x48D1CC
2131 </p></dd>
2132 <dt>&lsquo;<samp>MediumVioletRed</samp>&rsquo;</dt>
2133 <dd><p>0xC71585
2134 </p></dd>
2135 <dt>&lsquo;<samp>MidnightBlue</samp>&rsquo;</dt>
2136 <dd><p>0x191970
2137 </p></dd>
2138 <dt>&lsquo;<samp>MintCream</samp>&rsquo;</dt>
2139 <dd><p>0xF5FFFA
2140 </p></dd>
2141 <dt>&lsquo;<samp>MistyRose</samp>&rsquo;</dt>
2142 <dd><p>0xFFE4E1
2143 </p></dd>
2144 <dt>&lsquo;<samp>Moccasin</samp>&rsquo;</dt>
2145 <dd><p>0xFFE4B5
2146 </p></dd>
2147 <dt>&lsquo;<samp>NavajoWhite</samp>&rsquo;</dt>
2148 <dd><p>0xFFDEAD
2149 </p></dd>
2150 <dt>&lsquo;<samp>Navy</samp>&rsquo;</dt>
2151 <dd><p>0x000080
2152 </p></dd>
2153 <dt>&lsquo;<samp>OldLace</samp>&rsquo;</dt>
2154 <dd><p>0xFDF5E6
2155 </p></dd>
2156 <dt>&lsquo;<samp>Olive</samp>&rsquo;</dt>
2157 <dd><p>0x808000
2158 </p></dd>
2159 <dt>&lsquo;<samp>OliveDrab</samp>&rsquo;</dt>
2160 <dd><p>0x6B8E23
2161 </p></dd>
2162 <dt>&lsquo;<samp>Orange</samp>&rsquo;</dt>
2163 <dd><p>0xFFA500
2164 </p></dd>
2165 <dt>&lsquo;<samp>OrangeRed</samp>&rsquo;</dt>
2166 <dd><p>0xFF4500
2167 </p></dd>
2168 <dt>&lsquo;<samp>Orchid</samp>&rsquo;</dt>
2169 <dd><p>0xDA70D6
2170 </p></dd>
2171 <dt>&lsquo;<samp>PaleGoldenRod</samp>&rsquo;</dt>
2172 <dd><p>0xEEE8AA
2173 </p></dd>
2174 <dt>&lsquo;<samp>PaleGreen</samp>&rsquo;</dt>
2175 <dd><p>0x98FB98
2176 </p></dd>
2177 <dt>&lsquo;<samp>PaleTurquoise</samp>&rsquo;</dt>
2178 <dd><p>0xAFEEEE
2179 </p></dd>
2180 <dt>&lsquo;<samp>PaleVioletRed</samp>&rsquo;</dt>
2181 <dd><p>0xD87093
2182 </p></dd>
2183 <dt>&lsquo;<samp>PapayaWhip</samp>&rsquo;</dt>
2184 <dd><p>0xFFEFD5
2185 </p></dd>
2186 <dt>&lsquo;<samp>PeachPuff</samp>&rsquo;</dt>
2187 <dd><p>0xFFDAB9
2188 </p></dd>
2189 <dt>&lsquo;<samp>Peru</samp>&rsquo;</dt>
2190 <dd><p>0xCD853F
2191 </p></dd>
2192 <dt>&lsquo;<samp>Pink</samp>&rsquo;</dt>
2193 <dd><p>0xFFC0CB
2194 </p></dd>
2195 <dt>&lsquo;<samp>Plum</samp>&rsquo;</dt>
2196 <dd><p>0xDDA0DD
2197 </p></dd>
2198 <dt>&lsquo;<samp>PowderBlue</samp>&rsquo;</dt>
2199 <dd><p>0xB0E0E6
2200 </p></dd>
2201 <dt>&lsquo;<samp>Purple</samp>&rsquo;</dt>
2202 <dd><p>0x800080
2203 </p></dd>
2204 <dt>&lsquo;<samp>Red</samp>&rsquo;</dt>
2205 <dd><p>0xFF0000
2206 </p></dd>
2207 <dt>&lsquo;<samp>RosyBrown</samp>&rsquo;</dt>
2208 <dd><p>0xBC8F8F
2209 </p></dd>
2210 <dt>&lsquo;<samp>RoyalBlue</samp>&rsquo;</dt>
2211 <dd><p>0x4169E1
2212 </p></dd>
2213 <dt>&lsquo;<samp>SaddleBrown</samp>&rsquo;</dt>
2214 <dd><p>0x8B4513
2215 </p></dd>
2216 <dt>&lsquo;<samp>Salmon</samp>&rsquo;</dt>
2217 <dd><p>0xFA8072
2218 </p></dd>
2219 <dt>&lsquo;<samp>SandyBrown</samp>&rsquo;</dt>
2220 <dd><p>0xF4A460
2221 </p></dd>
2222 <dt>&lsquo;<samp>SeaGreen</samp>&rsquo;</dt>
2223 <dd><p>0x2E8B57
2224 </p></dd>
2225 <dt>&lsquo;<samp>SeaShell</samp>&rsquo;</dt>
2226 <dd><p>0xFFF5EE
2227 </p></dd>
2228 <dt>&lsquo;<samp>Sienna</samp>&rsquo;</dt>
2229 <dd><p>0xA0522D
2230 </p></dd>
2231 <dt>&lsquo;<samp>Silver</samp>&rsquo;</dt>
2232 <dd><p>0xC0C0C0
2233 </p></dd>
2234 <dt>&lsquo;<samp>SkyBlue</samp>&rsquo;</dt>
2235 <dd><p>0x87CEEB
2236 </p></dd>
2237 <dt>&lsquo;<samp>SlateBlue</samp>&rsquo;</dt>
2238 <dd><p>0x6A5ACD
2239 </p></dd>
2240 <dt>&lsquo;<samp>SlateGray</samp>&rsquo;</dt>
2241 <dd><p>0x708090
2242 </p></dd>
2243 <dt>&lsquo;<samp>Snow</samp>&rsquo;</dt>
2244 <dd><p>0xFFFAFA
2245 </p></dd>
2246 <dt>&lsquo;<samp>SpringGreen</samp>&rsquo;</dt>
2247 <dd><p>0x00FF7F
2248 </p></dd>
2249 <dt>&lsquo;<samp>SteelBlue</samp>&rsquo;</dt>
2250 <dd><p>0x4682B4
2251 </p></dd>
2252 <dt>&lsquo;<samp>Tan</samp>&rsquo;</dt>
2253 <dd><p>0xD2B48C
2254 </p></dd>
2255 <dt>&lsquo;<samp>Teal</samp>&rsquo;</dt>
2256 <dd><p>0x008080
2257 </p></dd>
2258 <dt>&lsquo;<samp>Thistle</samp>&rsquo;</dt>
2259 <dd><p>0xD8BFD8
2260 </p></dd>
2261 <dt>&lsquo;<samp>Tomato</samp>&rsquo;</dt>
2262 <dd><p>0xFF6347
2263 </p></dd>
2264 <dt>&lsquo;<samp>Turquoise</samp>&rsquo;</dt>
2265 <dd><p>0x40E0D0
2266 </p></dd>
2267 <dt>&lsquo;<samp>Violet</samp>&rsquo;</dt>
2268 <dd><p>0xEE82EE
2269 </p></dd>
2270 <dt>&lsquo;<samp>Wheat</samp>&rsquo;</dt>
2271 <dd><p>0xF5DEB3
2272 </p></dd>
2273 <dt>&lsquo;<samp>White</samp>&rsquo;</dt>
2274 <dd><p>0xFFFFFF
2275 </p></dd>
2276 <dt>&lsquo;<samp>WhiteSmoke</samp>&rsquo;</dt>
2277 <dd><p>0xF5F5F5
2278 </p></dd>
2279 <dt>&lsquo;<samp>Yellow</samp>&rsquo;</dt>
2280 <dd><p>0xFFFF00
2281 </p></dd>
2282 <dt>&lsquo;<samp>YellowGreen</samp>&rsquo;</dt>
2283 <dd><p>0x9ACD32
2284 </p></dd>
2285 </dl>
2286
2287 <a name="channel-layout-syntax"></a><a name="Channel-Layout"></a>
2288 <h3 class="section">4.8 Channel Layout<span class="pull-right"><a class="anchor hidden-xs" href="#Channel-Layout" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Channel-Layout" aria-hidden="true">TOC</a></span></h3>
2289
2290 <p>A channel layout specifies the spatial disposition of the channels in
2291 a multi-channel audio stream. To specify a channel layout, FFmpeg
2292 makes use of a special syntax.
2293 </p>
2294 <p>Individual channels are identified by an id, as given by the table
2295 below:
2296 </p><dl compact="compact">
2297 <dt>&lsquo;<samp>FL</samp>&rsquo;</dt>
2298 <dd><p>front left
2299 </p></dd>
2300 <dt>&lsquo;<samp>FR</samp>&rsquo;</dt>
2301 <dd><p>front right
2302 </p></dd>
2303 <dt>&lsquo;<samp>FC</samp>&rsquo;</dt>
2304 <dd><p>front center
2305 </p></dd>
2306 <dt>&lsquo;<samp>LFE</samp>&rsquo;</dt>
2307 <dd><p>low frequency
2308 </p></dd>
2309 <dt>&lsquo;<samp>BL</samp>&rsquo;</dt>
2310 <dd><p>back left
2311 </p></dd>
2312 <dt>&lsquo;<samp>BR</samp>&rsquo;</dt>
2313 <dd><p>back right
2314 </p></dd>
2315 <dt>&lsquo;<samp>FLC</samp>&rsquo;</dt>
2316 <dd><p>front left-of-center
2317 </p></dd>
2318 <dt>&lsquo;<samp>FRC</samp>&rsquo;</dt>
2319 <dd><p>front right-of-center
2320 </p></dd>
2321 <dt>&lsquo;<samp>BC</samp>&rsquo;</dt>
2322 <dd><p>back center
2323 </p></dd>
2324 <dt>&lsquo;<samp>SL</samp>&rsquo;</dt>
2325 <dd><p>side left
2326 </p></dd>
2327 <dt>&lsquo;<samp>SR</samp>&rsquo;</dt>
2328 <dd><p>side right
2329 </p></dd>
2330 <dt>&lsquo;<samp>TC</samp>&rsquo;</dt>
2331 <dd><p>top center
2332 </p></dd>
2333 <dt>&lsquo;<samp>TFL</samp>&rsquo;</dt>
2334 <dd><p>top front left
2335 </p></dd>
2336 <dt>&lsquo;<samp>TFC</samp>&rsquo;</dt>
2337 <dd><p>top front center
2338 </p></dd>
2339 <dt>&lsquo;<samp>TFR</samp>&rsquo;</dt>
2340 <dd><p>top front right
2341 </p></dd>
2342 <dt>&lsquo;<samp>TBL</samp>&rsquo;</dt>
2343 <dd><p>top back left
2344 </p></dd>
2345 <dt>&lsquo;<samp>TBC</samp>&rsquo;</dt>
2346 <dd><p>top back center
2347 </p></dd>
2348 <dt>&lsquo;<samp>TBR</samp>&rsquo;</dt>
2349 <dd><p>top back right
2350 </p></dd>
2351 <dt>&lsquo;<samp>DL</samp>&rsquo;</dt>
2352 <dd><p>downmix left
2353 </p></dd>
2354 <dt>&lsquo;<samp>DR</samp>&rsquo;</dt>
2355 <dd><p>downmix right
2356 </p></dd>
2357 <dt>&lsquo;<samp>WL</samp>&rsquo;</dt>
2358 <dd><p>wide left
2359 </p></dd>
2360 <dt>&lsquo;<samp>WR</samp>&rsquo;</dt>
2361 <dd><p>wide right
2362 </p></dd>
2363 <dt>&lsquo;<samp>SDL</samp>&rsquo;</dt>
2364 <dd><p>surround direct left
2365 </p></dd>
2366 <dt>&lsquo;<samp>SDR</samp>&rsquo;</dt>
2367 <dd><p>surround direct right
2368 </p></dd>
2369 <dt>&lsquo;<samp>LFE2</samp>&rsquo;</dt>
2370 <dd><p>low frequency 2
2371 </p></dd>
2372 </dl>
2373
2374 <p>Standard channel layout compositions can be specified by using the
2375 following identifiers:
2376 </p><dl compact="compact">
2377 <dt>&lsquo;<samp>mono</samp>&rsquo;</dt>
2378 <dd><p>FC
2379 </p></dd>
2380 <dt>&lsquo;<samp>stereo</samp>&rsquo;</dt>
2381 <dd><p>FL+FR
2382 </p></dd>
2383 <dt>&lsquo;<samp>2.1</samp>&rsquo;</dt>
2384 <dd><p>FL+FR+LFE
2385 </p></dd>
2386 <dt>&lsquo;<samp>3.0</samp>&rsquo;</dt>
2387 <dd><p>FL+FR+FC
2388 </p></dd>
2389 <dt>&lsquo;<samp>3.0(back)</samp>&rsquo;</dt>
2390 <dd><p>FL+FR+BC
2391 </p></dd>
2392 <dt>&lsquo;<samp>4.0</samp>&rsquo;</dt>
2393 <dd><p>FL+FR+FC+BC
2394 </p></dd>
2395 <dt>&lsquo;<samp>quad</samp>&rsquo;</dt>
2396 <dd><p>FL+FR+BL+BR
2397 </p></dd>
2398 <dt>&lsquo;<samp>quad(side)</samp>&rsquo;</dt>
2399 <dd><p>FL+FR+SL+SR
2400 </p></dd>
2401 <dt>&lsquo;<samp>3.1</samp>&rsquo;</dt>
2402 <dd><p>FL+FR+FC+LFE
2403 </p></dd>
2404 <dt>&lsquo;<samp>5.0</samp>&rsquo;</dt>
2405 <dd><p>FL+FR+FC+BL+BR
2406 </p></dd>
2407 <dt>&lsquo;<samp>5.0(side)</samp>&rsquo;</dt>
2408 <dd><p>FL+FR+FC+SL+SR
2409 </p></dd>
2410 <dt>&lsquo;<samp>4.1</samp>&rsquo;</dt>
2411 <dd><p>FL+FR+FC+LFE+BC
2412 </p></dd>
2413 <dt>&lsquo;<samp>5.1</samp>&rsquo;</dt>
2414 <dd><p>FL+FR+FC+LFE+BL+BR
2415 </p></dd>
2416 <dt>&lsquo;<samp>5.1(side)</samp>&rsquo;</dt>
2417 <dd><p>FL+FR+FC+LFE+SL+SR
2418 </p></dd>
2419 <dt>&lsquo;<samp>6.0</samp>&rsquo;</dt>
2420 <dd><p>FL+FR+FC+BC+SL+SR
2421 </p></dd>
2422 <dt>&lsquo;<samp>6.0(front)</samp>&rsquo;</dt>
2423 <dd><p>FL+FR+FLC+FRC+SL+SR
2424 </p></dd>
2425 <dt>&lsquo;<samp>hexagonal</samp>&rsquo;</dt>
2426 <dd><p>FL+FR+FC+BL+BR+BC
2427 </p></dd>
2428 <dt>&lsquo;<samp>6.1</samp>&rsquo;</dt>
2429 <dd><p>FL+FR+FC+LFE+BC+SL+SR
2430 </p></dd>
2431 <dt>&lsquo;<samp>6.1</samp>&rsquo;</dt>
2432 <dd><p>FL+FR+FC+LFE+BL+BR+BC
2433 </p></dd>
2434 <dt>&lsquo;<samp>6.1(front)</samp>&rsquo;</dt>
2435 <dd><p>FL+FR+LFE+FLC+FRC+SL+SR
2436 </p></dd>
2437 <dt>&lsquo;<samp>7.0</samp>&rsquo;</dt>
2438 <dd><p>FL+FR+FC+BL+BR+SL+SR
2439 </p></dd>
2440 <dt>&lsquo;<samp>7.0(front)</samp>&rsquo;</dt>
2441 <dd><p>FL+FR+FC+FLC+FRC+SL+SR
2442 </p></dd>
2443 <dt>&lsquo;<samp>7.1</samp>&rsquo;</dt>
2444 <dd><p>FL+FR+FC+LFE+BL+BR+SL+SR
2445 </p></dd>
2446 <dt>&lsquo;<samp>7.1(wide)</samp>&rsquo;</dt>
2447 <dd><p>FL+FR+FC+LFE+BL+BR+FLC+FRC
2448 </p></dd>
2449 <dt>&lsquo;<samp>7.1(wide-side)</samp>&rsquo;</dt>
2450 <dd><p>FL+FR+FC+LFE+FLC+FRC+SL+SR
2451 </p></dd>
2452 <dt>&lsquo;<samp>octagonal</samp>&rsquo;</dt>
2453 <dd><p>FL+FR+FC+BL+BR+BC+SL+SR
2454 </p></dd>
2455 <dt>&lsquo;<samp>downmix</samp>&rsquo;</dt>
2456 <dd><p>DL+DR
2457 </p></dd>
2458 </dl>
2459
2460 <p>A custom channel layout can be specified as a sequence of terms, separated by
2461 &rsquo;+&rsquo; or &rsquo;|&rsquo;. Each term can be:
2462 </p><ul>
2463 <li> the name of a standard channel layout (e.g. &lsquo;<samp>mono</samp>&rsquo;,
2464 &lsquo;<samp>stereo</samp>&rsquo;, &lsquo;<samp>4.0</samp>&rsquo;, &lsquo;<samp>quad</samp>&rsquo;, &lsquo;<samp>5.0</samp>&rsquo;, etc.)
2465
2466 </li><li> the name of a single channel (e.g. &lsquo;<samp>FL</samp>&rsquo;, &lsquo;<samp>FR</samp>&rsquo;, &lsquo;<samp>FC</samp>&rsquo;, &lsquo;<samp>LFE</samp>&rsquo;, etc.)
2467
2468 </li><li> a number of channels, in decimal, optionally followed by &rsquo;c&rsquo;, yielding
2469 the default channel layout for that number of channels (see the
2470 function <code>av_get_default_channel_layout</code>)
2471
2472 </li><li> a channel layout mask, in hexadecimal starting with &quot;0x&quot; (see the
2473 <code>AV_CH_*</code> macros in <samp>libavutil/channel_layout.h</samp>.
2474 </li></ul>
2475
2476 <p>Starting from libavutil version 53 the trailing character &quot;c&quot; to
2477 specify a number of channels will be required, while a channel layout
2478 mask could also be specified as a decimal number (if and only if not
2479 followed by &quot;c&quot;).
2480 </p>
2481 <p>See also the function <code>av_get_channel_layout</code> defined in
2482 <samp>libavutil/channel_layout.h</samp>.
2483 </p>
2484 <a name="Expression-Evaluation"></a>
2485 <h2 class="chapter">5 Expression Evaluation<span class="pull-right"><a class="anchor hidden-xs" href="#Expression-Evaluation" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Expression-Evaluation" aria-hidden="true">TOC</a></span></h2>
2486
2487 <p>When evaluating an arithmetic expression, FFmpeg uses an internal
2488 formula evaluator, implemented through the <samp>libavutil/eval.h</samp>
2489 interface.
2490 </p>
2491 <p>An expression may contain unary, binary operators, constants, and
2492 functions.
2493 </p>
2494 <p>Two expressions <var>expr1</var> and <var>expr2</var> can be combined to form
2495 another expression &quot;<var>expr1</var>;<var>expr2</var>&quot;.
2496 <var>expr1</var> and <var>expr2</var> are evaluated in turn, and the new
2497 expression evaluates to the value of <var>expr2</var>.
2498 </p>
2499 <p>The following binary operators are available: <code>+</code>, <code>-</code>,
2500 <code>*</code>, <code>/</code>, <code>^</code>.
2501 </p>
2502 <p>The following unary operators are available: <code>+</code>, <code>-</code>.
2503 </p>
2504 <p>The following functions are available:
2505 </p><dl compact="compact">
2506 <dt><samp>abs(x)</samp></dt>
2507 <dd><p>Compute absolute value of <var>x</var>.
2508 </p>
2509 </dd>
2510 <dt><samp>acos(x)</samp></dt>
2511 <dd><p>Compute arccosine of <var>x</var>.
2512 </p>
2513 </dd>
2514 <dt><samp>asin(x)</samp></dt>
2515 <dd><p>Compute arcsine of <var>x</var>.
2516 </p>
2517 </dd>
2518 <dt><samp>atan(x)</samp></dt>
2519 <dd><p>Compute arctangent of <var>x</var>.
2520 </p>
2521 </dd>
2522 <dt><samp>between(x, min, max)</samp></dt>
2523 <dd><p>Return 1 if <var>x</var> is greater than or equal to <var>min</var> and lesser than or
2524 equal to <var>max</var>, 0 otherwise.
2525 </p>
2526 </dd>
2527 <dt><samp>bitand(x, y)</samp></dt>
2528 <dt><samp>bitor(x, y)</samp></dt>
2529 <dd><p>Compute bitwise and/or operation on <var>x</var> and <var>y</var>.
2530 </p>
2531 <p>The results of the evaluation of <var>x</var> and <var>y</var> are converted to
2532 integers before executing the bitwise operation.
2533 </p>
2534 <p>Note that both the conversion to integer and the conversion back to
2535 floating point can lose precision. Beware of unexpected results for
2536 large numbers (usually 2^53 and larger).
2537 </p>
2538 </dd>
2539 <dt><samp>ceil(expr)</samp></dt>
2540 <dd><p>Round the value of expression <var>expr</var> upwards to the nearest
2541 integer. For example, &quot;ceil(1.5)&quot; is &quot;2.0&quot;.
2542 </p>
2543 </dd>
2544 <dt><samp>clip(x, min, max)</samp></dt>
2545 <dd><p>Return the value of <var>x</var> clipped between <var>min</var> and <var>max</var>.
2546 </p>
2547 </dd>
2548 <dt><samp>cos(x)</samp></dt>
2549 <dd><p>Compute cosine of <var>x</var>.
2550 </p>
2551 </dd>
2552 <dt><samp>cosh(x)</samp></dt>
2553 <dd><p>Compute hyperbolic cosine of <var>x</var>.
2554 </p>
2555 </dd>
2556 <dt><samp>eq(x, y)</samp></dt>
2557 <dd><p>Return 1 if <var>x</var> and <var>y</var> are equivalent, 0 otherwise.
2558 </p>
2559 </dd>
2560 <dt><samp>exp(x)</samp></dt>
2561 <dd><p>Compute exponential of <var>x</var> (with base <code>e</code>, the Euler&rsquo;s number).
2562 </p>
2563 </dd>
2564 <dt><samp>floor(expr)</samp></dt>
2565 <dd><p>Round the value of expression <var>expr</var> downwards to the nearest
2566 integer. For example, &quot;floor(-1.5)&quot; is &quot;-2.0&quot;.
2567 </p>
2568 </dd>
2569 <dt><samp>gauss(x)</samp></dt>
2570 <dd><p>Compute Gauss function of <var>x</var>, corresponding to
2571 <code>exp(-x*x/2) / sqrt(2*PI)</code>.
2572 </p>
2573 </dd>
2574 <dt><samp>gcd(x, y)</samp></dt>
2575 <dd><p>Return the greatest common divisor of <var>x</var> and <var>y</var>. If both <var>x</var> and
2576 <var>y</var> are 0 or either or both are less than zero then behavior is undefined.
2577 </p>
2578 </dd>
2579 <dt><samp>gt(x, y)</samp></dt>
2580 <dd><p>Return 1 if <var>x</var> is greater than <var>y</var>, 0 otherwise.
2581 </p>
2582 </dd>
2583 <dt><samp>gte(x, y)</samp></dt>
2584 <dd><p>Return 1 if <var>x</var> is greater than or equal to <var>y</var>, 0 otherwise.
2585 </p>
2586 </dd>
2587 <dt><samp>hypot(x, y)</samp></dt>
2588 <dd><p>This function is similar to the C function with the same name; it returns
2589 &quot;sqrt(<var>x</var>*<var>x</var> + <var>y</var>*<var>y</var>)&quot;, the length of the hypotenuse of a
2590 right triangle with sides of length <var>x</var> and <var>y</var>, or the distance of the
2591 point (<var>x</var>, <var>y</var>) from the origin.
2592 </p>
2593 </dd>
2594 <dt><samp>if(x, y)</samp></dt>
2595 <dd><p>Evaluate <var>x</var>, and if the result is non-zero return the result of
2596 the evaluation of <var>y</var>, return 0 otherwise.
2597 </p>
2598 </dd>
2599 <dt><samp>if(x, y, z)</samp></dt>
2600 <dd><p>Evaluate <var>x</var>, and if the result is non-zero return the evaluation
2601 result of <var>y</var>, otherwise the evaluation result of <var>z</var>.
2602 </p>
2603 </dd>
2604 <dt><samp>ifnot(x, y)</samp></dt>
2605 <dd><p>Evaluate <var>x</var>, and if the result is zero return the result of the
2606 evaluation of <var>y</var>, return 0 otherwise.
2607 </p>
2608 </dd>
2609 <dt><samp>ifnot(x, y, z)</samp></dt>
2610 <dd><p>Evaluate <var>x</var>, and if the result is zero return the evaluation
2611 result of <var>y</var>, otherwise the evaluation result of <var>z</var>.
2612 </p>
2613 </dd>
2614 <dt><samp>isinf(x)</samp></dt>
2615 <dd><p>Return 1.0 if <var>x</var> is +/-INFINITY, 0.0 otherwise.
2616 </p>
2617 </dd>
2618 <dt><samp>isnan(x)</samp></dt>
2619 <dd><p>Return 1.0 if <var>x</var> is NAN, 0.0 otherwise.
2620 </p>
2621 </dd>
2622 <dt><samp>ld(var)</samp></dt>
2623 <dd><p>Load the value of the internal variable with number
2624 <var>var</var>, which was previously stored with st(<var>var</var>, <var>expr</var>).
2625 The function returns the loaded value.
2626 </p>
2627 </dd>
2628 <dt><samp>log(x)</samp></dt>
2629 <dd><p>Compute natural logarithm of <var>x</var>.
2630 </p>
2631 </dd>
2632 <dt><samp>lt(x, y)</samp></dt>
2633 <dd><p>Return 1 if <var>x</var> is lesser than <var>y</var>, 0 otherwise.
2634 </p>
2635 </dd>
2636 <dt><samp>lte(x, y)</samp></dt>
2637 <dd><p>Return 1 if <var>x</var> is lesser than or equal to <var>y</var>, 0 otherwise.
2638 </p>
2639 </dd>
2640 <dt><samp>max(x, y)</samp></dt>
2641 <dd><p>Return the maximum between <var>x</var> and <var>y</var>.
2642 </p>
2643 </dd>
2644 <dt><samp>min(x, y)</samp></dt>
2645 <dd><p>Return the maximum between <var>x</var> and <var>y</var>.
2646 </p>
2647 </dd>
2648 <dt><samp>mod(x, y)</samp></dt>
2649 <dd><p>Compute the remainder of division of <var>x</var> by <var>y</var>.
2650 </p>
2651 </dd>
2652 <dt><samp>not(expr)</samp></dt>
2653 <dd><p>Return 1.0 if <var>expr</var> is zero, 0.0 otherwise.
2654 </p>
2655 </dd>
2656 <dt><samp>pow(x, y)</samp></dt>
2657 <dd><p>Compute the power of <var>x</var> elevated <var>y</var>, it is equivalent to
2658 &quot;(<var>x</var>)^(<var>y</var>)&quot;.
2659 </p>
2660 </dd>
2661 <dt><samp>print(t)</samp></dt>
2662 <dt><samp>print(t, l)</samp></dt>
2663 <dd><p>Print the value of expression <var>t</var> with loglevel <var>l</var>. If
2664 <var>l</var> is not specified then a default log level is used.
2665 Returns the value of the expression printed.
2666 </p>
2667 <p>Prints t with loglevel l
2668 </p>
2669 </dd>
2670 <dt><samp>random(x)</samp></dt>
2671 <dd><p>Return a pseudo random value between 0.0 and 1.0. <var>x</var> is the index of the
2672 internal variable which will be used to save the seed/state.
2673 </p>
2674 </dd>
2675 <dt><samp>root(expr, max)</samp></dt>
2676 <dd><p>Find an input value for which the function represented by <var>expr</var>
2677 with argument <var>ld(0)</var> is 0 in the interval 0..<var>max</var>.
2678 </p>
2679 <p>The expression in <var>expr</var> must denote a continuous function or the
2680 result is undefined.
2681 </p>
2682 <p><var>ld(0)</var> is used to represent the function input value, which means
2683 that the given expression will be evaluated multiple times with
2684 various input values that the expression can access through
2685 <code>ld(0)</code>. When the expression evaluates to 0 then the
2686 corresponding input value will be returned.
2687 </p>
2688 </dd>
2689 <dt><samp>sin(x)</samp></dt>
2690 <dd><p>Compute sine of <var>x</var>.
2691 </p>
2692 </dd>
2693 <dt><samp>sinh(x)</samp></dt>
2694 <dd><p>Compute hyperbolic sine of <var>x</var>.
2695 </p>
2696 </dd>
2697 <dt><samp>sqrt(expr)</samp></dt>
2698 <dd><p>Compute the square root of <var>expr</var>. This is equivalent to
2699 &quot;(<var>expr</var>)^.5&quot;.
2700 </p>
2701 </dd>
2702 <dt><samp>squish(x)</samp></dt>
2703 <dd><p>Compute expression <code>1/(1 + exp(4*x))</code>.
2704 </p>
2705 </dd>
2706 <dt><samp>st(var, expr)</samp></dt>
2707 <dd><p>Store the value of the expression <var>expr</var> in an internal
2708 variable. <var>var</var> specifies the number of the variable where to
2709 store the value, and it is a value ranging from 0 to 9. The function
2710 returns the value stored in the internal variable.
2711 Note, Variables are currently not shared between expressions.
2712 </p>
2713 </dd>
2714 <dt><samp>tan(x)</samp></dt>
2715 <dd><p>Compute tangent of <var>x</var>.
2716 </p>
2717 </dd>
2718 <dt><samp>tanh(x)</samp></dt>
2719 <dd><p>Compute hyperbolic tangent of <var>x</var>.
2720 </p>
2721 </dd>
2722 <dt><samp>taylor(expr, x)</samp></dt>
2723 <dt><samp>taylor(expr, x, id)</samp></dt>
2724 <dd><p>Evaluate a Taylor series at <var>x</var>, given an expression representing
2725 the <code>ld(id)</code>-th derivative of a function at 0.
2726 </p>
2727 <p>When the series does not converge the result is undefined.
2728 </p>
2729 <p><var>ld(id)</var> is used to represent the derivative order in <var>expr</var>,
2730 which means that the given expression will be evaluated multiple times
2731 with various input values that the expression can access through
2732 <code>ld(id)</code>. If <var>id</var> is not specified then 0 is assumed.
2733 </p>
2734 <p>Note, when you have the derivatives at y instead of 0,
2735 <code>taylor(expr, x-y)</code> can be used.
2736 </p>
2737 </dd>
2738 <dt><samp>time(0)</samp></dt>
2739 <dd><p>Return the current (wallclock) time in seconds.
2740 </p>
2741 </dd>
2742 <dt><samp>trunc(expr)</samp></dt>
2743 <dd><p>Round the value of expression <var>expr</var> towards zero to the nearest
2744 integer. For example, &quot;trunc(-1.5)&quot; is &quot;-1.0&quot;.
2745 </p>
2746 </dd>
2747 <dt><samp>while(cond, expr)</samp></dt>
2748 <dd><p>Evaluate expression <var>expr</var> while the expression <var>cond</var> is
2749 non-zero, and returns the value of the last <var>expr</var> evaluation, or
2750 NAN if <var>cond</var> was always false.
2751 </p></dd>
2752 </dl>
2753
2754 <p>The following constants are available:
2755 </p><dl compact="compact">
2756 <dt><samp>PI</samp></dt>
2757 <dd><p>area of the unit disc, approximately 3.14
2758 </p></dd>
2759 <dt><samp>E</samp></dt>
2760 <dd><p>exp(1) (Euler&rsquo;s number), approximately 2.718
2761 </p></dd>
2762 <dt><samp>PHI</samp></dt>
2763 <dd><p>golden ratio (1+sqrt(5))/2, approximately 1.618
2764 </p></dd>
2765 </dl>
2766
2767 <p>Assuming that an expression is considered &quot;true&quot; if it has a non-zero
2768 value, note that:
2769 </p>
2770 <p><code>*</code> works like AND
2771 </p>
2772 <p><code>+</code> works like OR
2773 </p>
2774 <p>For example the construct:
2775 </p><div class="example">
2776 <pre class="example">if (A AND B) then C
2777 </pre></div>
2778 <p>is equivalent to:
2779 </p><div class="example">
2780 <pre class="example">if(A*B, C)
2781 </pre></div>
2782
2783 <p>In your C code, you can extend the list of unary and binary functions,
2784 and define recognized constants, so that they are available for your
2785 expressions.
2786 </p>
2787 <p>The evaluator also recognizes the International System unit prefixes.
2788 If &rsquo;i&rsquo; is appended after the prefix, binary prefixes are used, which
2789 are based on powers of 1024 instead of powers of 1000.
2790 The &rsquo;B&rsquo; postfix multiplies the value by 8, and can be appended after a
2791 unit prefix or used alone. This allows using for example &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;,
2792 &rsquo;G&rsquo; and &rsquo;B&rsquo; as number postfix.
2793 </p>
2794 <p>The list of available International System prefixes follows, with
2795 indication of the corresponding powers of 10 and of 2.
2796 </p><dl compact="compact">
2797 <dt><samp>y</samp></dt>
2798 <dd><p>10^-24 / 2^-80
2799 </p></dd>
2800 <dt><samp>z</samp></dt>
2801 <dd><p>10^-21 / 2^-70
2802 </p></dd>
2803 <dt><samp>a</samp></dt>
2804 <dd><p>10^-18 / 2^-60
2805 </p></dd>
2806 <dt><samp>f</samp></dt>
2807 <dd><p>10^-15 / 2^-50
2808 </p></dd>
2809 <dt><samp>p</samp></dt>
2810 <dd><p>10^-12 / 2^-40
2811 </p></dd>
2812 <dt><samp>n</samp></dt>
2813 <dd><p>10^-9 / 2^-30
2814 </p></dd>
2815 <dt><samp>u</samp></dt>
2816 <dd><p>10^-6 / 2^-20
2817 </p></dd>
2818 <dt><samp>m</samp></dt>
2819 <dd><p>10^-3 / 2^-10
2820 </p></dd>
2821 <dt><samp>c</samp></dt>
2822 <dd><p>10^-2
2823 </p></dd>
2824 <dt><samp>d</samp></dt>
2825 <dd><p>10^-1
2826 </p></dd>
2827 <dt><samp>h</samp></dt>
2828 <dd><p>10^2
2829 </p></dd>
2830 <dt><samp>k</samp></dt>
2831 <dd><p>10^3 / 2^10
2832 </p></dd>
2833 <dt><samp>K</samp></dt>
2834 <dd><p>10^3 / 2^10
2835 </p></dd>
2836 <dt><samp>M</samp></dt>
2837 <dd><p>10^6 / 2^20
2838 </p></dd>
2839 <dt><samp>G</samp></dt>
2840 <dd><p>10^9 / 2^30
2841 </p></dd>
2842 <dt><samp>T</samp></dt>
2843 <dd><p>10^12 / 2^40
2844 </p></dd>
2845 <dt><samp>P</samp></dt>
2846 <dd><p>10^15 / 2^40
2847 </p></dd>
2848 <dt><samp>E</samp></dt>
2849 <dd><p>10^18 / 2^50
2850 </p></dd>
2851 <dt><samp>Z</samp></dt>
2852 <dd><p>10^21 / 2^60
2853 </p></dd>
2854 <dt><samp>Y</samp></dt>
2855 <dd><p>10^24 / 2^70
2856 </p></dd>
2857 </dl>
2858
2859
2860 <a name="OpenCL-Options"></a>
2861 <h2 class="chapter">6 OpenCL Options<span class="pull-right"><a class="anchor hidden-xs" href="#OpenCL-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-OpenCL-Options" aria-hidden="true">TOC</a></span></h2>
2862
2863 <p>When FFmpeg is configured with <code>--enable-opencl</code>, it is possible
2864 to set the options for the global OpenCL context.
2865 </p>
2866 <p>The list of supported options follows:
2867 </p>
2868 <dl compact="compact">
2869 <dt><samp>build_options</samp></dt>
2870 <dd><p>Set build options used to compile the registered kernels.
2871 </p>
2872 <p>See reference &quot;OpenCL Specification Version: 1.2 chapter 5.6.4&quot;.
2873 </p>
2874 </dd>
2875 <dt><samp>platform_idx</samp></dt>
2876 <dd><p>Select the index of the platform to run OpenCL code.
2877 </p>
2878 <p>The specified index must be one of the indexes in the device list
2879 which can be obtained with <code>ffmpeg -opencl_bench</code> or <code>av_opencl_get_device_list()</code>.
2880 </p>
2881 </dd>
2882 <dt><samp>device_idx</samp></dt>
2883 <dd><p>Select the index of the device used to run OpenCL code.
2884 </p>
2885 <p>The specified index must be one of the indexes in the device list which
2886 can be obtained with <code>ffmpeg -opencl_bench</code> or <code>av_opencl_get_device_list()</code>.
2887 </p>
2888 </dd>
2889 </dl>
2890
2891 <a name="codec_002doptions"></a><a name="Codec-Options"></a>
2892 <h2 class="chapter">7 Codec Options<span class="pull-right"><a class="anchor hidden-xs" href="#Codec-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Codec-Options" aria-hidden="true">TOC</a></span></h2>
2893
2894 <p>libavcodec provides some generic global options, which can be set on
2895 all the encoders and decoders. In addition each codec may support
2896 so-called private options, which are specific for a given codec.
2897 </p>
2898 <p>Sometimes, a global option may only affect a specific kind of codec,
2899 and may be nonsensical or ignored by another, so you need to be aware
2900 of the meaning of the specified options. Also some options are
2901 meant only for decoding or encoding.
2902 </p>
2903 <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
2904 FFmpeg tools, or by setting the value explicitly in the
2905 <code>AVCodecContext</code> options or using the <samp>libavutil/opt.h</samp> API
2906 for programmatic use.
2907 </p>
2908 <p>The list of supported options follow:
2909 </p>
2910 <dl compact="compact">
2911 <dt><samp>b <var>integer</var> (<em>encoding,audio,video</em>)</samp></dt>
2912 <dd><p>Set bitrate in bits/s. Default value is 200K.
2913 </p>
2914 </dd>
2915 <dt><samp>ab <var>integer</var> (<em>encoding,audio</em>)</samp></dt>
2916 <dd><p>Set audio bitrate (in bits/s). Default value is 128K.
2917 </p>
2918 </dd>
2919 <dt><samp>bt <var>integer</var> (<em>encoding,video</em>)</samp></dt>
2920 <dd><p>Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate
2921 tolerance specifies how far ratecontrol is willing to deviate from the
2922 target average bitrate value. This is not related to min/max
2923 bitrate. Lowering tolerance too much has an adverse effect on quality.
2924 </p>
2925 </dd>
2926 <dt><samp>flags <var>flags</var> (<em>decoding/encoding,audio,video,subtitles</em>)</samp></dt>
2927 <dd><p>Set generic flags.
2928 </p>
2929 <p>Possible values:
2930 </p><dl compact="compact">
2931 <dt>&lsquo;<samp>mv4</samp>&rsquo;</dt>
2932 <dd><p>Use four motion vector by macroblock (mpeg4).
2933 </p></dd>
2934 <dt>&lsquo;<samp>qpel</samp>&rsquo;</dt>
2935 <dd><p>Use 1/4 pel motion compensation.
2936 </p></dd>
2937 <dt>&lsquo;<samp>loop</samp>&rsquo;</dt>
2938 <dd><p>Use loop filter.
2939 </p></dd>
2940 <dt>&lsquo;<samp>qscale</samp>&rsquo;</dt>
2941 <dd><p>Use fixed qscale.
2942 </p></dd>
2943 <dt>&lsquo;<samp>gmc</samp>&rsquo;</dt>
2944 <dd><p>Use gmc.
2945 </p></dd>
2946 <dt>&lsquo;<samp>mv0</samp>&rsquo;</dt>
2947 <dd><p>Always try a mb with mv=&lt;0,0&gt;.
2948 </p></dd>
2949 <dt>&lsquo;<samp>input_preserved</samp>&rsquo;</dt>
2950 <dt>&lsquo;<samp>pass1</samp>&rsquo;</dt>
2951 <dd><p>Use internal 2pass ratecontrol in first pass mode.
2952 </p></dd>
2953 <dt>&lsquo;<samp>pass2</samp>&rsquo;</dt>
2954 <dd><p>Use internal 2pass ratecontrol in second pass mode.
2955 </p></dd>
2956 <dt>&lsquo;<samp>gray</samp>&rsquo;</dt>
2957 <dd><p>Only decode/encode grayscale.
2958 </p></dd>
2959 <dt>&lsquo;<samp>emu_edge</samp>&rsquo;</dt>
2960 <dd><p>Do not draw edges.
2961 </p></dd>
2962 <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
2963 <dd><p>Set error[?] variables during encoding.
2964 </p></dd>
2965 <dt>&lsquo;<samp>truncated</samp>&rsquo;</dt>
2966 <dt>&lsquo;<samp>naq</samp>&rsquo;</dt>
2967 <dd><p>Normalize adaptive quantization.
2968 </p></dd>
2969 <dt>&lsquo;<samp>ildct</samp>&rsquo;</dt>
2970 <dd><p>Use interlaced DCT.
2971 </p></dd>
2972 <dt>&lsquo;<samp>low_delay</samp>&rsquo;</dt>
2973 <dd><p>Force low delay.
2974 </p></dd>
2975 <dt>&lsquo;<samp>global_header</samp>&rsquo;</dt>
2976 <dd><p>Place global headers in extradata instead of every keyframe.
2977 </p></dd>
2978 <dt>&lsquo;<samp>bitexact</samp>&rsquo;</dt>
2979 <dd><p>Only write platform-, build- and time-independent data. (except (I)DCT).
2980 This ensures that file and data checksums are reproducible and match between
2981 platforms. Its primary use is for regression testing.
2982 </p></dd>
2983 <dt>&lsquo;<samp>aic</samp>&rsquo;</dt>
2984 <dd><p>Apply H263 advanced intra coding / mpeg4 ac prediction.
2985 </p></dd>
2986 <dt>&lsquo;<samp>cbp</samp>&rsquo;</dt>
2987 <dd><p>Deprecated, use mpegvideo private options instead.
2988 </p></dd>
2989 <dt>&lsquo;<samp>qprd</samp>&rsquo;</dt>
2990 <dd><p>Deprecated, use mpegvideo private options instead.
2991 </p></dd>
2992 <dt>&lsquo;<samp>ilme</samp>&rsquo;</dt>
2993 <dd><p>Apply interlaced motion estimation.
2994 </p></dd>
2995 <dt>&lsquo;<samp>cgop</samp>&rsquo;</dt>
2996 <dd><p>Use closed gop.
2997 </p></dd>
2998 </dl>
2999
3000 </dd>
3001 <dt><samp>me_method <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3002 <dd><p>Set motion estimation method.
3003 </p>
3004 <p>Possible values:
3005 </p><dl compact="compact">
3006 <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
3007 <dd><p>zero motion estimation (fastest)
3008 </p></dd>
3009 <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
3010 <dd><p>full motion estimation (slowest)
3011 </p></dd>
3012 <dt>&lsquo;<samp>epzs</samp>&rsquo;</dt>
3013 <dd><p>EPZS motion estimation (default)
3014 </p></dd>
3015 <dt>&lsquo;<samp>esa</samp>&rsquo;</dt>
3016 <dd><p>esa motion estimation (alias for full)
3017 </p></dd>
3018 <dt>&lsquo;<samp>tesa</samp>&rsquo;</dt>
3019 <dd><p>tesa motion estimation
3020 </p></dd>
3021 <dt>&lsquo;<samp>dia</samp>&rsquo;</dt>
3022 <dd><p>dia motion estimation (alias for epzs)
3023 </p></dd>
3024 <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
3025 <dd><p>log motion estimation
3026 </p></dd>
3027 <dt>&lsquo;<samp>phods</samp>&rsquo;</dt>
3028 <dd><p>phods motion estimation
3029 </p></dd>
3030 <dt>&lsquo;<samp>x1</samp>&rsquo;</dt>
3031 <dd><p>X1 motion estimation
3032 </p></dd>
3033 <dt>&lsquo;<samp>hex</samp>&rsquo;</dt>
3034 <dd><p>hex motion estimation
3035 </p></dd>
3036 <dt>&lsquo;<samp>umh</samp>&rsquo;</dt>
3037 <dd><p>umh motion estimation
3038 </p></dd>
3039 <dt>&lsquo;<samp>iter</samp>&rsquo;</dt>
3040 <dd><p>iter motion estimation
3041 </p></dd>
3042 </dl>
3043
3044 </dd>
3045 <dt><samp>extradata_size <var>integer</var></samp></dt>
3046 <dd><p>Set extradata size.
3047 </p>
3048 </dd>
3049 <dt><samp>time_base <var>rational number</var></samp></dt>
3050 <dd><p>Set codec time base.
3051 </p>
3052 <p>It is the fundamental unit of time (in seconds) in terms of which
3053 frame timestamps are represented. For fixed-fps content, timebase
3054 should be <code>1 / frame_rate</code> and timestamp increments should be
3055 identically 1.
3056 </p>
3057 </dd>
3058 <dt><samp>g <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3059 <dd><p>Set the group of picture size. Default value is 12.
3060 </p>
3061 </dd>
3062 <dt><samp>ar <var>integer</var> (<em>decoding/encoding,audio</em>)</samp></dt>
3063 <dd><p>Set audio sampling rate (in Hz).
3064 </p>
3065 </dd>
3066 <dt><samp>ac <var>integer</var> (<em>decoding/encoding,audio</em>)</samp></dt>
3067 <dd><p>Set number of audio channels.
3068 </p>
3069 </dd>
3070 <dt><samp>cutoff <var>integer</var> (<em>encoding,audio</em>)</samp></dt>
3071 <dd><p>Set cutoff bandwidth.
3072 </p>
3073 </dd>
3074 <dt><samp>frame_size <var>integer</var> (<em>encoding,audio</em>)</samp></dt>
3075 <dd><p>Set audio frame size.
3076 </p>
3077 <p>Each submitted frame except the last must contain exactly frame_size
3078 samples per channel. May be 0 when the codec has
3079 CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not
3080 restricted. It is set by some decoders to indicate constant frame
3081 size.
3082 </p>
3083 </dd>
3084 <dt><samp>frame_number <var>integer</var></samp></dt>
3085 <dd><p>Set the frame number.
3086 </p>
3087 </dd>
3088 <dt><samp>delay <var>integer</var></samp></dt>
3089 <dt><samp>qcomp <var>float</var> (<em>encoding,video</em>)</samp></dt>
3090 <dd><p>Set video quantizer scale compression (VBR). It is used as a constant
3091 in the ratecontrol equation. Recommended range for default rc_eq:
3092 0.0-1.0.
3093 </p>
3094 </dd>
3095 <dt><samp>qblur <var>float</var> (<em>encoding,video</em>)</samp></dt>
3096 <dd><p>Set video quantizer scale blur (VBR).
3097 </p>
3098 </dd>
3099 <dt><samp>qmin <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3100 <dd><p>Set min video quantizer scale (VBR). Must be included between -1 and
3101 69, default value is 2.
3102 </p>
3103 </dd>
3104 <dt><samp>qmax <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3105 <dd><p>Set max video quantizer scale (VBR). Must be included between -1 and
3106 1024, default value is 31.
3107 </p>
3108 </dd>
3109 <dt><samp>qdiff <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3110 <dd><p>Set max difference between the quantizer scale (VBR).
3111 </p>
3112 </dd>
3113 <dt><samp>bf <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3114 <dd><p>Set max number of B frames between non-B-frames.
3115 </p>
3116 <p>Must be an integer between -1 and 16. 0 means that B-frames are
3117 disabled. If a value of -1 is used, it will choose an automatic value
3118 depending on the encoder.
3119 </p>
3120 <p>Default value is 0.
3121 </p>
3122 </dd>
3123 <dt><samp>b_qfactor <var>float</var> (<em>encoding,video</em>)</samp></dt>
3124 <dd><p>Set qp factor between P and B frames.
3125 </p>
3126 </dd>
3127 <dt><samp>rc_strategy <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3128 <dd><p>Set ratecontrol method.
3129 </p>
3130 </dd>
3131 <dt><samp>b_strategy <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3132 <dd><p>Set strategy to choose between I/P/B-frames.
3133 </p>
3134 </dd>
3135 <dt><samp>ps <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3136 <dd><p>Set RTP payload size in bytes.
3137 </p>
3138 </dd>
3139 <dt><samp>mv_bits <var>integer</var></samp></dt>
3140 <dt><samp>header_bits <var>integer</var></samp></dt>
3141 <dt><samp>i_tex_bits <var>integer</var></samp></dt>
3142 <dt><samp>p_tex_bits <var>integer</var></samp></dt>
3143 <dt><samp>i_count <var>integer</var></samp></dt>
3144 <dt><samp>p_count <var>integer</var></samp></dt>
3145 <dt><samp>skip_count <var>integer</var></samp></dt>
3146 <dt><samp>misc_bits <var>integer</var></samp></dt>
3147 <dt><samp>frame_bits <var>integer</var></samp></dt>
3148 <dt><samp>codec_tag <var>integer</var></samp></dt>
3149 <dt><samp>bug <var>flags</var> (<em>decoding,video</em>)</samp></dt>
3150 <dd><p>Workaround not auto detected encoder bugs.
3151 </p>
3152 <p>Possible values:
3153 </p><dl compact="compact">
3154 <dt>&lsquo;<samp>autodetect</samp>&rsquo;</dt>
3155 <dt>&lsquo;<samp>old_msmpeg4</samp>&rsquo;</dt>
3156 <dd><p>some old lavc generated msmpeg4v3 files (no autodetection)
3157 </p></dd>
3158 <dt>&lsquo;<samp>xvid_ilace</samp>&rsquo;</dt>
3159 <dd><p>Xvid interlacing bug (autodetected if fourcc==XVIX)
3160 </p></dd>
3161 <dt>&lsquo;<samp>ump4</samp>&rsquo;</dt>
3162 <dd><p>(autodetected if fourcc==UMP4)
3163 </p></dd>
3164 <dt>&lsquo;<samp>no_padding</samp>&rsquo;</dt>
3165 <dd><p>padding bug (autodetected)
3166 </p></dd>
3167 <dt>&lsquo;<samp>amv</samp>&rsquo;</dt>
3168 <dt>&lsquo;<samp>ac_vlc</samp>&rsquo;</dt>
3169 <dd><p>illegal vlc bug (autodetected per fourcc)
3170 </p></dd>
3171 <dt>&lsquo;<samp>qpel_chroma</samp>&rsquo;</dt>
3172 <dt>&lsquo;<samp>std_qpel</samp>&rsquo;</dt>
3173 <dd><p>old standard qpel (autodetected per fourcc/version)
3174 </p></dd>
3175 <dt>&lsquo;<samp>qpel_chroma2</samp>&rsquo;</dt>
3176 <dt>&lsquo;<samp>direct_blocksize</samp>&rsquo;</dt>
3177 <dd><p>direct-qpel-blocksize bug (autodetected per fourcc/version)
3178 </p></dd>
3179 <dt>&lsquo;<samp>edge</samp>&rsquo;</dt>
3180 <dd><p>edge padding bug (autodetected per fourcc/version)
3181 </p></dd>
3182 <dt>&lsquo;<samp>hpel_chroma</samp>&rsquo;</dt>
3183 <dt>&lsquo;<samp>dc_clip</samp>&rsquo;</dt>
3184 <dt>&lsquo;<samp>ms</samp>&rsquo;</dt>
3185 <dd><p>Workaround various bugs in microsoft broken decoders.
3186 </p></dd>
3187 <dt>&lsquo;<samp>trunc</samp>&rsquo;</dt>
3188 <dd><p>trancated frames
3189 </p></dd>
3190 </dl>
3191
3192 </dd>
3193 <dt><samp>lelim <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3194 <dd><p>Set single coefficient elimination threshold for luminance (negative
3195 values also consider DC coefficient).
3196 </p>
3197 </dd>
3198 <dt><samp>celim <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3199 <dd><p>Set single coefficient elimination threshold for chrominance (negative
3200 values also consider dc coefficient)
3201 </p>
3202 </dd>
3203 <dt><samp>strict <var>integer</var> (<em>decoding/encoding,audio,video</em>)</samp></dt>
3204 <dd><p>Specify how strictly to follow the standards.
3205 </p>
3206 <p>Possible values:
3207 </p><dl compact="compact">
3208 <dt>&lsquo;<samp>very</samp>&rsquo;</dt>
3209 <dd><p>strictly conform to a older more strict version of the spec or reference software
3210 </p></dd>
3211 <dt>&lsquo;<samp>strict</samp>&rsquo;</dt>
3212 <dd><p>strictly conform to all the things in the spec no matter what consequences
3213 </p></dd>
3214 <dt>&lsquo;<samp>normal</samp>&rsquo;</dt>
3215 <dt>&lsquo;<samp>unofficial</samp>&rsquo;</dt>
3216 <dd><p>allow unofficial extensions
3217 </p></dd>
3218 <dt>&lsquo;<samp>experimental</samp>&rsquo;</dt>
3219 <dd><p>allow non standardized experimental things, experimental
3220 (unfinished/work in progress/not well tested) decoders and encoders.
3221 Note: experimental decoders can pose a security risk, do not use this for
3222 decoding untrusted input.
3223 </p></dd>
3224 </dl>
3225
3226 </dd>
3227 <dt><samp>b_qoffset <var>float</var> (<em>encoding,video</em>)</samp></dt>
3228 <dd><p>Set QP offset between P and B frames.
3229 </p>
3230 </dd>
3231 <dt><samp>err_detect <var>flags</var> (<em>decoding,audio,video</em>)</samp></dt>
3232 <dd><p>Set error detection flags.
3233 </p>
3234 <p>Possible values:
3235 </p><dl compact="compact">
3236 <dt>&lsquo;<samp>crccheck</samp>&rsquo;</dt>
3237 <dd><p>verify embedded CRCs
3238 </p></dd>
3239 <dt>&lsquo;<samp>bitstream</samp>&rsquo;</dt>
3240 <dd><p>detect bitstream specification deviations
3241 </p></dd>
3242 <dt>&lsquo;<samp>buffer</samp>&rsquo;</dt>
3243 <dd><p>detect improper bitstream length
3244 </p></dd>
3245 <dt>&lsquo;<samp>explode</samp>&rsquo;</dt>
3246 <dd><p>abort decoding on minor error detection
3247 </p></dd>
3248 <dt>&lsquo;<samp>ignore_err</samp>&rsquo;</dt>
3249 <dd><p>ignore decoding errors, and continue decoding.
3250 This is useful if you want to analyze the content of a video and thus want
3251 everything to be decoded no matter what. This option will not result in a video
3252 that is pleasing to watch in case of errors.
3253 </p></dd>
3254 <dt>&lsquo;<samp>careful</samp>&rsquo;</dt>
3255 <dd><p>consider things that violate the spec and have not been seen in the wild as errors
3256 </p></dd>
3257 <dt>&lsquo;<samp>compliant</samp>&rsquo;</dt>
3258 <dd><p>consider all spec non compliancies as errors
3259 </p></dd>
3260 <dt>&lsquo;<samp>aggressive</samp>&rsquo;</dt>
3261 <dd><p>consider things that a sane encoder should not do as an error
3262 </p></dd>
3263 </dl>
3264
3265 </dd>
3266 <dt><samp>has_b_frames <var>integer</var></samp></dt>
3267 <dt><samp>block_align <var>integer</var></samp></dt>
3268 <dt><samp>mpeg_quant <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3269 <dd><p>Use MPEG quantizers instead of H.263.
3270 </p>
3271 </dd>
3272 <dt><samp>qsquish <var>float</var> (<em>encoding,video</em>)</samp></dt>
3273 <dd><p>How to keep quantizer between qmin and qmax (0 = clip, 1 = use
3274 differentiable function).
3275 </p>
3276 </dd>
3277 <dt><samp>rc_qmod_amp <var>float</var> (<em>encoding,video</em>)</samp></dt>
3278 <dd><p>Set experimental quantizer modulation.
3279 </p>
3280 </dd>
3281 <dt><samp>rc_qmod_freq <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3282 <dd><p>Set experimental quantizer modulation.
3283 </p>
3284 </dd>
3285 <dt><samp>rc_override_count <var>integer</var></samp></dt>
3286 <dt><samp>rc_eq <var>string</var> (<em>encoding,video</em>)</samp></dt>
3287 <dd><p>Set rate control equation. When computing the expression, besides the
3288 standard functions defined in the section &rsquo;Expression Evaluation&rsquo;, the
3289 following functions are available: bits2qp(bits), qp2bits(qp). Also
3290 the following constants are available: iTex pTex tex mv fCode iCount
3291 mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex
3292 avgTex.
3293 </p>
3294 </dd>
3295 <dt><samp>maxrate <var>integer</var> (<em>encoding,audio,video</em>)</samp></dt>
3296 <dd><p>Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
3297 </p>
3298 </dd>
3299 <dt><samp>minrate <var>integer</var> (<em>encoding,audio,video</em>)</samp></dt>
3300 <dd><p>Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR
3301 encode. It is of little use elsewise.
3302 </p>
3303 </dd>
3304 <dt><samp>bufsize <var>integer</var> (<em>encoding,audio,video</em>)</samp></dt>
3305 <dd><p>Set ratecontrol buffer size (in bits).
3306 </p>
3307 </dd>
3308 <dt><samp>rc_buf_aggressivity <var>float</var> (<em>encoding,video</em>)</samp></dt>
3309 <dd><p>Currently useless.
3310 </p>
3311 </dd>
3312 <dt><samp>i_qfactor <var>float</var> (<em>encoding,video</em>)</samp></dt>
3313 <dd><p>Set QP factor between P and I frames.
3314 </p>
3315 </dd>
3316 <dt><samp>i_qoffset <var>float</var> (<em>encoding,video</em>)</samp></dt>
3317 <dd><p>Set QP offset between P and I frames.
3318 </p>
3319 </dd>
3320 <dt><samp>rc_init_cplx <var>float</var> (<em>encoding,video</em>)</samp></dt>
3321 <dd><p>Set initial complexity for 1-pass encoding.
3322 </p>
3323 </dd>
3324 <dt><samp>dct <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3325 <dd><p>Set DCT algorithm.
3326 </p>
3327 <p>Possible values:
3328 </p><dl compact="compact">
3329 <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
3330 <dd><p>autoselect a good one (default)
3331 </p></dd>
3332 <dt>&lsquo;<samp>fastint</samp>&rsquo;</dt>
3333 <dd><p>fast integer
3334 </p></dd>
3335 <dt>&lsquo;<samp>int</samp>&rsquo;</dt>
3336 <dd><p>accurate integer
3337 </p></dd>
3338 <dt>&lsquo;<samp>mmx</samp>&rsquo;</dt>
3339 <dt>&lsquo;<samp>altivec</samp>&rsquo;</dt>
3340 <dt>&lsquo;<samp>faan</samp>&rsquo;</dt>
3341 <dd><p>floating point AAN DCT
3342 </p></dd>
3343 </dl>
3344
3345 </dd>
3346 <dt><samp>lumi_mask <var>float</var> (<em>encoding,video</em>)</samp></dt>
3347 <dd><p>Compress bright areas stronger than medium ones.
3348 </p>
3349 </dd>
3350 <dt><samp>tcplx_mask <var>float</var> (<em>encoding,video</em>)</samp></dt>
3351 <dd><p>Set temporal complexity masking.
3352 </p>
3353 </dd>
3354 <dt><samp>scplx_mask <var>float</var> (<em>encoding,video</em>)</samp></dt>
3355 <dd><p>Set spatial complexity masking.
3356 </p>
3357 </dd>
3358 <dt><samp>p_mask <var>float</var> (<em>encoding,video</em>)</samp></dt>
3359 <dd><p>Set inter masking.
3360 </p>
3361 </dd>
3362 <dt><samp>dark_mask <var>float</var> (<em>encoding,video</em>)</samp></dt>
3363 <dd><p>Compress dark areas stronger than medium ones.
3364 </p>
3365 </dd>
3366 <dt><samp>idct <var>integer</var> (<em>decoding/encoding,video</em>)</samp></dt>
3367 <dd><p>Select IDCT implementation.
3368 </p>
3369 <p>Possible values:
3370 </p><dl compact="compact">
3371 <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
3372 <dt>&lsquo;<samp>int</samp>&rsquo;</dt>
3373 <dt>&lsquo;<samp>simple</samp>&rsquo;</dt>
3374 <dt>&lsquo;<samp>simplemmx</samp>&rsquo;</dt>
3375 <dt>&lsquo;<samp>simpleauto</samp>&rsquo;</dt>
3376 <dd><p>Automatically pick a IDCT compatible with the simple one
3377 </p>
3378 </dd>
3379 <dt>&lsquo;<samp>arm</samp>&rsquo;</dt>
3380 <dt>&lsquo;<samp>altivec</samp>&rsquo;</dt>
3381 <dt>&lsquo;<samp>sh4</samp>&rsquo;</dt>
3382 <dt>&lsquo;<samp>simplearm</samp>&rsquo;</dt>
3383 <dt>&lsquo;<samp>simplearmv5te</samp>&rsquo;</dt>
3384 <dt>&lsquo;<samp>simplearmv6</samp>&rsquo;</dt>
3385 <dt>&lsquo;<samp>simpleneon</samp>&rsquo;</dt>
3386 <dt>&lsquo;<samp>simplealpha</samp>&rsquo;</dt>
3387 <dt>&lsquo;<samp>ipp</samp>&rsquo;</dt>
3388 <dt>&lsquo;<samp>xvidmmx</samp>&rsquo;</dt>
3389 <dt>&lsquo;<samp>faani</samp>&rsquo;</dt>
3390 <dd><p>floating point AAN IDCT
3391 </p></dd>
3392 </dl>
3393
3394 </dd>
3395 <dt><samp>slice_count <var>integer</var></samp></dt>
3396 <dt><samp>ec <var>flags</var> (<em>decoding,video</em>)</samp></dt>
3397 <dd><p>Set error concealment strategy.
3398 </p>
3399 <p>Possible values:
3400 </p><dl compact="compact">
3401 <dt>&lsquo;<samp>guess_mvs</samp>&rsquo;</dt>
3402 <dd><p>iterative motion vector (MV) search (slow)
3403 </p></dd>
3404 <dt>&lsquo;<samp>deblock</samp>&rsquo;</dt>
3405 <dd><p>use strong deblock filter for damaged MBs
3406 </p></dd>
3407 <dt>&lsquo;<samp>favor_inter</samp>&rsquo;</dt>
3408 <dd><p>favor predicting from the previous frame instead of the current
3409 </p></dd>
3410 </dl>
3411
3412 </dd>
3413 <dt><samp>bits_per_coded_sample <var>integer</var></samp></dt>
3414 <dt><samp>pred <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3415 <dd><p>Set prediction method.
3416 </p>
3417 <p>Possible values:
3418 </p><dl compact="compact">
3419 <dt>&lsquo;<samp>left</samp>&rsquo;</dt>
3420 <dt>&lsquo;<samp>plane</samp>&rsquo;</dt>
3421 <dt>&lsquo;<samp>median</samp>&rsquo;</dt>
3422 </dl>
3423
3424 </dd>
3425 <dt><samp>aspect <var>rational number</var> (<em>encoding,video</em>)</samp></dt>
3426 <dd><p>Set sample aspect ratio.
3427 </p>
3428 </dd>
3429 <dt><samp>debug <var>flags</var> (<em>decoding/encoding,audio,video,subtitles</em>)</samp></dt>
3430 <dd><p>Print specific debug info.
3431 </p>
3432 <p>Possible values:
3433 </p><dl compact="compact">
3434 <dt>&lsquo;<samp>pict</samp>&rsquo;</dt>
3435 <dd><p>picture info
3436 </p></dd>
3437 <dt>&lsquo;<samp>rc</samp>&rsquo;</dt>
3438 <dd><p>rate control
3439 </p></dd>
3440 <dt>&lsquo;<samp>bitstream</samp>&rsquo;</dt>
3441 <dt>&lsquo;<samp>mb_type</samp>&rsquo;</dt>
3442 <dd><p>macroblock (MB) type
3443 </p></dd>
3444 <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
3445 <dd><p>per-block quantization parameter (QP)
3446 </p></dd>
3447 <dt>&lsquo;<samp>mv</samp>&rsquo;</dt>
3448 <dd><p>motion vector
3449 </p></dd>
3450 <dt>&lsquo;<samp>dct_coeff</samp>&rsquo;</dt>
3451 <dt>&lsquo;<samp>skip</samp>&rsquo;</dt>
3452 <dt>&lsquo;<samp>startcode</samp>&rsquo;</dt>
3453 <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
3454 <dt>&lsquo;<samp>er</samp>&rsquo;</dt>
3455 <dd><p>error recognition
3456 </p></dd>
3457 <dt>&lsquo;<samp>mmco</samp>&rsquo;</dt>
3458 <dd><p>memory management control operations (H.264)
3459 </p></dd>
3460 <dt>&lsquo;<samp>bugs</samp>&rsquo;</dt>
3461 <dt>&lsquo;<samp>vis_qp</samp>&rsquo;</dt>
3462 <dd><p>visualize quantization parameter (QP), lower QP are tinted greener
3463 </p></dd>
3464 <dt>&lsquo;<samp>vis_mb_type</samp>&rsquo;</dt>
3465 <dd><p>visualize block types
3466 </p></dd>
3467 <dt>&lsquo;<samp>buffers</samp>&rsquo;</dt>
3468 <dd><p>picture buffer allocations
3469 </p></dd>
3470 <dt>&lsquo;<samp>thread_ops</samp>&rsquo;</dt>
3471 <dd><p>threading operations
3472 </p></dd>
3473 <dt>&lsquo;<samp>nomc</samp>&rsquo;</dt>
3474 <dd><p>skip motion compensation
3475 </p></dd>
3476 </dl>
3477
3478 </dd>
3479 <dt><samp>vismv <var>integer</var> (<em>decoding,video</em>)</samp></dt>
3480 <dd><p>Visualize motion vectors (MVs).
3481 </p>
3482 <p>This option is deprecated, see the codecview filter instead.
3483 </p>
3484 <p>Possible values:
3485 </p><dl compact="compact">
3486 <dt>&lsquo;<samp>pf</samp>&rsquo;</dt>
3487 <dd><p>forward predicted MVs of P-frames
3488 </p></dd>
3489 <dt>&lsquo;<samp>bf</samp>&rsquo;</dt>
3490 <dd><p>forward predicted MVs of B-frames
3491 </p></dd>
3492 <dt>&lsquo;<samp>bb</samp>&rsquo;</dt>
3493 <dd><p>backward predicted MVs of B-frames
3494 </p></dd>
3495 </dl>
3496
3497 </dd>
3498 <dt><samp>cmp <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3499 <dd><p>Set full pel me compare function.
3500 </p>
3501 <p>Possible values:
3502 </p><dl compact="compact">
3503 <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
3504 <dd><p>sum of absolute differences, fast (default)
3505 </p></dd>
3506 <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
3507 <dd><p>sum of squared errors
3508 </p></dd>
3509 <dt>&lsquo;<samp>satd</samp>&rsquo;</dt>
3510 <dd><p>sum of absolute Hadamard transformed differences
3511 </p></dd>
3512 <dt>&lsquo;<samp>dct</samp>&rsquo;</dt>
3513 <dd><p>sum of absolute DCT transformed differences
3514 </p></dd>
3515 <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
3516 <dd><p>sum of squared quantization errors (avoid, low quality)
3517 </p></dd>
3518 <dt>&lsquo;<samp>bit</samp>&rsquo;</dt>
3519 <dd><p>number of bits needed for the block
3520 </p></dd>
3521 <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
3522 <dd><p>rate distortion optimal, slow
3523 </p></dd>
3524 <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
3525 <dd><p>0
3526 </p></dd>
3527 <dt>&lsquo;<samp>vsad</samp>&rsquo;</dt>
3528 <dd><p>sum of absolute vertical differences
3529 </p></dd>
3530 <dt>&lsquo;<samp>vsse</samp>&rsquo;</dt>
3531 <dd><p>sum of squared vertical differences
3532 </p></dd>
3533 <dt>&lsquo;<samp>nsse</samp>&rsquo;</dt>
3534 <dd><p>noise preserving sum of squared differences
3535 </p></dd>
3536 <dt>&lsquo;<samp>w53</samp>&rsquo;</dt>
3537 <dd><p>5/3 wavelet, only used in snow
3538 </p></dd>
3539 <dt>&lsquo;<samp>w97</samp>&rsquo;</dt>
3540 <dd><p>9/7 wavelet, only used in snow
3541 </p></dd>
3542 <dt>&lsquo;<samp>dctmax</samp>&rsquo;</dt>
3543 <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
3544 </dl>
3545
3546 </dd>
3547 <dt><samp>subcmp <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3548 <dd><p>Set sub pel me compare function.
3549 </p>
3550 <p>Possible values:
3551 </p><dl compact="compact">
3552 <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
3553 <dd><p>sum of absolute differences, fast (default)
3554 </p></dd>
3555 <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
3556 <dd><p>sum of squared errors
3557 </p></dd>
3558 <dt>&lsquo;<samp>satd</samp>&rsquo;</dt>
3559 <dd><p>sum of absolute Hadamard transformed differences
3560 </p></dd>
3561 <dt>&lsquo;<samp>dct</samp>&rsquo;</dt>
3562 <dd><p>sum of absolute DCT transformed differences
3563 </p></dd>
3564 <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
3565 <dd><p>sum of squared quantization errors (avoid, low quality)
3566 </p></dd>
3567 <dt>&lsquo;<samp>bit</samp>&rsquo;</dt>
3568 <dd><p>number of bits needed for the block
3569 </p></dd>
3570 <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
3571 <dd><p>rate distortion optimal, slow
3572 </p></dd>
3573 <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
3574 <dd><p>0
3575 </p></dd>
3576 <dt>&lsquo;<samp>vsad</samp>&rsquo;</dt>
3577 <dd><p>sum of absolute vertical differences
3578 </p></dd>
3579 <dt>&lsquo;<samp>vsse</samp>&rsquo;</dt>
3580 <dd><p>sum of squared vertical differences
3581 </p></dd>
3582 <dt>&lsquo;<samp>nsse</samp>&rsquo;</dt>
3583 <dd><p>noise preserving sum of squared differences
3584 </p></dd>
3585 <dt>&lsquo;<samp>w53</samp>&rsquo;</dt>
3586 <dd><p>5/3 wavelet, only used in snow
3587 </p></dd>
3588 <dt>&lsquo;<samp>w97</samp>&rsquo;</dt>
3589 <dd><p>9/7 wavelet, only used in snow
3590 </p></dd>
3591 <dt>&lsquo;<samp>dctmax</samp>&rsquo;</dt>
3592 <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
3593 </dl>
3594
3595 </dd>
3596 <dt><samp>mbcmp <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3597 <dd><p>Set macroblock compare function.
3598 </p>
3599 <p>Possible values:
3600 </p><dl compact="compact">
3601 <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
3602 <dd><p>sum of absolute differences, fast (default)
3603 </p></dd>
3604 <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
3605 <dd><p>sum of squared errors
3606 </p></dd>
3607 <dt>&lsquo;<samp>satd</samp>&rsquo;</dt>
3608 <dd><p>sum of absolute Hadamard transformed differences
3609 </p></dd>
3610 <dt>&lsquo;<samp>dct</samp>&rsquo;</dt>
3611 <dd><p>sum of absolute DCT transformed differences
3612 </p></dd>
3613 <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
3614 <dd><p>sum of squared quantization errors (avoid, low quality)
3615 </p></dd>
3616 <dt>&lsquo;<samp>bit</samp>&rsquo;</dt>
3617 <dd><p>number of bits needed for the block
3618 </p></dd>
3619 <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
3620 <dd><p>rate distortion optimal, slow
3621 </p></dd>
3622 <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
3623 <dd><p>0
3624 </p></dd>
3625 <dt>&lsquo;<samp>vsad</samp>&rsquo;</dt>
3626 <dd><p>sum of absolute vertical differences
3627 </p></dd>
3628 <dt>&lsquo;<samp>vsse</samp>&rsquo;</dt>
3629 <dd><p>sum of squared vertical differences
3630 </p></dd>
3631 <dt>&lsquo;<samp>nsse</samp>&rsquo;</dt>
3632 <dd><p>noise preserving sum of squared differences
3633 </p></dd>
3634 <dt>&lsquo;<samp>w53</samp>&rsquo;</dt>
3635 <dd><p>5/3 wavelet, only used in snow
3636 </p></dd>
3637 <dt>&lsquo;<samp>w97</samp>&rsquo;</dt>
3638 <dd><p>9/7 wavelet, only used in snow
3639 </p></dd>
3640 <dt>&lsquo;<samp>dctmax</samp>&rsquo;</dt>
3641 <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
3642 </dl>
3643
3644 </dd>
3645 <dt><samp>ildctcmp <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3646 <dd><p>Set interlaced dct compare function.
3647 </p>
3648 <p>Possible values:
3649 </p><dl compact="compact">
3650 <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
3651 <dd><p>sum of absolute differences, fast (default)
3652 </p></dd>
3653 <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
3654 <dd><p>sum of squared errors
3655 </p></dd>
3656 <dt>&lsquo;<samp>satd</samp>&rsquo;</dt>
3657 <dd><p>sum of absolute Hadamard transformed differences
3658 </p></dd>
3659 <dt>&lsquo;<samp>dct</samp>&rsquo;</dt>
3660 <dd><p>sum of absolute DCT transformed differences
3661 </p></dd>
3662 <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
3663 <dd><p>sum of squared quantization errors (avoid, low quality)
3664 </p></dd>
3665 <dt>&lsquo;<samp>bit</samp>&rsquo;</dt>
3666 <dd><p>number of bits needed for the block
3667 </p></dd>
3668 <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
3669 <dd><p>rate distortion optimal, slow
3670 </p></dd>
3671 <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
3672 <dd><p>0
3673 </p></dd>
3674 <dt>&lsquo;<samp>vsad</samp>&rsquo;</dt>
3675 <dd><p>sum of absolute vertical differences
3676 </p></dd>
3677 <dt>&lsquo;<samp>vsse</samp>&rsquo;</dt>
3678 <dd><p>sum of squared vertical differences
3679 </p></dd>
3680 <dt>&lsquo;<samp>nsse</samp>&rsquo;</dt>
3681 <dd><p>noise preserving sum of squared differences
3682 </p></dd>
3683 <dt>&lsquo;<samp>w53</samp>&rsquo;</dt>
3684 <dd><p>5/3 wavelet, only used in snow
3685 </p></dd>
3686 <dt>&lsquo;<samp>w97</samp>&rsquo;</dt>
3687 <dd><p>9/7 wavelet, only used in snow
3688 </p></dd>
3689 <dt>&lsquo;<samp>dctmax</samp>&rsquo;</dt>
3690 <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
3691 </dl>
3692
3693 </dd>
3694 <dt><samp>dia_size <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3695 <dd><p>Set diamond type &amp; size for motion estimation.
3696 </p>
3697 </dd>
3698 <dt><samp>last_pred <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3699 <dd><p>Set amount of motion predictors from the previous frame.
3700 </p>
3701 </dd>
3702 <dt><samp>preme <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3703 <dd><p>Set pre motion estimation.
3704 </p>
3705 </dd>
3706 <dt><samp>precmp <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3707 <dd><p>Set pre motion estimation compare function.
3708 </p>
3709 <p>Possible values:
3710 </p><dl compact="compact">
3711 <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
3712 <dd><p>sum of absolute differences, fast (default)
3713 </p></dd>
3714 <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
3715 <dd><p>sum of squared errors
3716 </p></dd>
3717 <dt>&lsquo;<samp>satd</samp>&rsquo;</dt>
3718 <dd><p>sum of absolute Hadamard transformed differences
3719 </p></dd>
3720 <dt>&lsquo;<samp>dct</samp>&rsquo;</dt>
3721 <dd><p>sum of absolute DCT transformed differences
3722 </p></dd>
3723 <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
3724 <dd><p>sum of squared quantization errors (avoid, low quality)
3725 </p></dd>
3726 <dt>&lsquo;<samp>bit</samp>&rsquo;</dt>
3727 <dd><p>number of bits needed for the block
3728 </p></dd>
3729 <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
3730 <dd><p>rate distortion optimal, slow
3731 </p></dd>
3732 <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
3733 <dd><p>0
3734 </p></dd>
3735 <dt>&lsquo;<samp>vsad</samp>&rsquo;</dt>
3736 <dd><p>sum of absolute vertical differences
3737 </p></dd>
3738 <dt>&lsquo;<samp>vsse</samp>&rsquo;</dt>
3739 <dd><p>sum of squared vertical differences
3740 </p></dd>
3741 <dt>&lsquo;<samp>nsse</samp>&rsquo;</dt>
3742 <dd><p>noise preserving sum of squared differences
3743 </p></dd>
3744 <dt>&lsquo;<samp>w53</samp>&rsquo;</dt>
3745 <dd><p>5/3 wavelet, only used in snow
3746 </p></dd>
3747 <dt>&lsquo;<samp>w97</samp>&rsquo;</dt>
3748 <dd><p>9/7 wavelet, only used in snow
3749 </p></dd>
3750 <dt>&lsquo;<samp>dctmax</samp>&rsquo;</dt>
3751 <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
3752 </dl>
3753
3754 </dd>
3755 <dt><samp>pre_dia_size <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3756 <dd><p>Set diamond type &amp; size for motion estimation pre-pass.
3757 </p>
3758 </dd>
3759 <dt><samp>subq <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3760 <dd><p>Set sub pel motion estimation quality.
3761 </p>
3762 </dd>
3763 <dt><samp>dtg_active_format <var>integer</var></samp></dt>
3764 <dt><samp>me_range <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3765 <dd><p>Set limit motion vectors range (1023 for DivX player).
3766 </p>
3767 </dd>
3768 <dt><samp>ibias <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3769 <dd><p>Set intra quant bias.
3770 </p>
3771 </dd>
3772 <dt><samp>pbias <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3773 <dd><p>Set inter quant bias.
3774 </p>
3775 </dd>
3776 <dt><samp>color_table_id <var>integer</var></samp></dt>
3777 <dt><samp>global_quality <var>integer</var> (<em>encoding,audio,video</em>)</samp></dt>
3778 <dt><samp>coder <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3779 <dd>
3780 <p>Possible values:
3781 </p><dl compact="compact">
3782 <dt>&lsquo;<samp>vlc</samp>&rsquo;</dt>
3783 <dd><p>variable length coder / huffman coder
3784 </p></dd>
3785 <dt>&lsquo;<samp>ac</samp>&rsquo;</dt>
3786 <dd><p>arithmetic coder
3787 </p></dd>
3788 <dt>&lsquo;<samp>raw</samp>&rsquo;</dt>
3789 <dd><p>raw (no encoding)
3790 </p></dd>
3791 <dt>&lsquo;<samp>rle</samp>&rsquo;</dt>
3792 <dd><p>run-length coder
3793 </p></dd>
3794 <dt>&lsquo;<samp>deflate</samp>&rsquo;</dt>
3795 <dd><p>deflate-based coder
3796 </p></dd>
3797 </dl>
3798
3799 </dd>
3800 <dt><samp>context <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3801 <dd><p>Set context model.
3802 </p>
3803 </dd>
3804 <dt><samp>slice_flags <var>integer</var></samp></dt>
3805 <dt><samp>xvmc_acceleration <var>integer</var></samp></dt>
3806 <dt><samp>mbd <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3807 <dd><p>Set macroblock decision algorithm (high quality mode).
3808 </p>
3809 <p>Possible values:
3810 </p><dl compact="compact">
3811 <dt>&lsquo;<samp>simple</samp>&rsquo;</dt>
3812 <dd><p>use mbcmp (default)
3813 </p></dd>
3814 <dt>&lsquo;<samp>bits</samp>&rsquo;</dt>
3815 <dd><p>use fewest bits
3816 </p></dd>
3817 <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
3818 <dd><p>use best rate distortion
3819 </p></dd>
3820 </dl>
3821
3822 </dd>
3823 <dt><samp>stream_codec_tag <var>integer</var></samp></dt>
3824 <dt><samp>sc_threshold <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3825 <dd><p>Set scene change threshold.
3826 </p>
3827 </dd>
3828 <dt><samp>lmin <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3829 <dd><p>Set min lagrange factor (VBR).
3830 </p>
3831 </dd>
3832 <dt><samp>lmax <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3833 <dd><p>Set max lagrange factor (VBR).
3834 </p>
3835 </dd>
3836 <dt><samp>nr <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3837 <dd><p>Set noise reduction.
3838 </p>
3839 </dd>
3840 <dt><samp>rc_init_occupancy <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3841 <dd><p>Set number of bits which should be loaded into the rc buffer before
3842 decoding starts.
3843 </p>
3844 </dd>
3845 <dt><samp>flags2 <var>flags</var> (<em>decoding/encoding,audio,video</em>)</samp></dt>
3846 <dd>
3847 <p>Possible values:
3848 </p><dl compact="compact">
3849 <dt>&lsquo;<samp>fast</samp>&rsquo;</dt>
3850 <dd><p>Allow non spec compliant speedup tricks.
3851 </p></dd>
3852 <dt>&lsquo;<samp>sgop</samp>&rsquo;</dt>
3853 <dd><p>Deprecated, use mpegvideo private options instead.
3854 </p></dd>
3855 <dt>&lsquo;<samp>noout</samp>&rsquo;</dt>
3856 <dd><p>Skip bitstream encoding.
3857 </p></dd>
3858 <dt>&lsquo;<samp>ignorecrop</samp>&rsquo;</dt>
3859 <dd><p>Ignore cropping information from sps.
3860 </p></dd>
3861 <dt>&lsquo;<samp>local_header</samp>&rsquo;</dt>
3862 <dd><p>Place global headers at every keyframe instead of in extradata.
3863 </p></dd>
3864 <dt>&lsquo;<samp>chunks</samp>&rsquo;</dt>
3865 <dd><p>Frame data might be split into multiple chunks.
3866 </p></dd>
3867 <dt>&lsquo;<samp>showall</samp>&rsquo;</dt>
3868 <dd><p>Show all frames before the first keyframe.
3869 </p></dd>
3870 <dt>&lsquo;<samp>skiprd</samp>&rsquo;</dt>
3871 <dd><p>Deprecated, use mpegvideo private options instead.
3872 </p></dd>
3873 <dt>&lsquo;<samp>export_mvs</samp>&rsquo;</dt>
3874 <dd><p>Export motion vectors into frame side-data (see <code>AV_FRAME_DATA_MOTION_VECTORS</code>)
3875 for codecs that support it. See also <samp>doc/examples/export_mvs.c</samp>.
3876 </p></dd>
3877 </dl>
3878
3879 </dd>
3880 <dt><samp>error <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3881 <dt><samp>qns <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3882 <dd><p>Deprecated, use mpegvideo private options instead.
3883 </p>
3884 </dd>
3885 <dt><samp>threads <var>integer</var> (<em>decoding/encoding,video</em>)</samp></dt>
3886 <dd>
3887 <p>Possible values:
3888 </p><dl compact="compact">
3889 <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
3890 <dd><p>detect a good number of threads
3891 </p></dd>
3892 </dl>
3893
3894 </dd>
3895 <dt><samp>me_threshold <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3896 <dd><p>Set motion estimation threshold.
3897 </p>
3898 </dd>
3899 <dt><samp>mb_threshold <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3900 <dd><p>Set macroblock threshold.
3901 </p>
3902 </dd>
3903 <dt><samp>dc <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3904 <dd><p>Set intra_dc_precision.
3905 </p>
3906 </dd>
3907 <dt><samp>nssew <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3908 <dd><p>Set nsse weight.
3909 </p>
3910 </dd>
3911 <dt><samp>skip_top <var>integer</var> (<em>decoding,video</em>)</samp></dt>
3912 <dd><p>Set number of macroblock rows at the top which are skipped.
3913 </p>
3914 </dd>
3915 <dt><samp>skip_bottom <var>integer</var> (<em>decoding,video</em>)</samp></dt>
3916 <dd><p>Set number of macroblock rows at the bottom which are skipped.
3917 </p>
3918 </dd>
3919 <dt><samp>profile <var>integer</var> (<em>encoding,audio,video</em>)</samp></dt>
3920 <dd>
3921 <p>Possible values:
3922 </p><dl compact="compact">
3923 <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
3924 <dt>&lsquo;<samp>aac_main</samp>&rsquo;</dt>
3925 <dt>&lsquo;<samp>aac_low</samp>&rsquo;</dt>
3926 <dt>&lsquo;<samp>aac_ssr</samp>&rsquo;</dt>
3927 <dt>&lsquo;<samp>aac_ltp</samp>&rsquo;</dt>
3928 <dt>&lsquo;<samp>aac_he</samp>&rsquo;</dt>
3929 <dt>&lsquo;<samp>aac_he_v2</samp>&rsquo;</dt>
3930 <dt>&lsquo;<samp>aac_ld</samp>&rsquo;</dt>
3931 <dt>&lsquo;<samp>aac_eld</samp>&rsquo;</dt>
3932 <dt>&lsquo;<samp>mpeg2_aac_low</samp>&rsquo;</dt>
3933 <dt>&lsquo;<samp>mpeg2_aac_he</samp>&rsquo;</dt>
3934 <dt>&lsquo;<samp>mpeg4_sp</samp>&rsquo;</dt>
3935 <dt>&lsquo;<samp>mpeg4_core</samp>&rsquo;</dt>
3936 <dt>&lsquo;<samp>mpeg4_main</samp>&rsquo;</dt>
3937 <dt>&lsquo;<samp>mpeg4_asp</samp>&rsquo;</dt>
3938 <dt>&lsquo;<samp>dts</samp>&rsquo;</dt>
3939 <dt>&lsquo;<samp>dts_es</samp>&rsquo;</dt>
3940 <dt>&lsquo;<samp>dts_96_24</samp>&rsquo;</dt>
3941 <dt>&lsquo;<samp>dts_hd_hra</samp>&rsquo;</dt>
3942 <dt>&lsquo;<samp>dts_hd_ma</samp>&rsquo;</dt>
3943 </dl>
3944
3945 </dd>
3946 <dt><samp>level <var>integer</var> (<em>encoding,audio,video</em>)</samp></dt>
3947 <dd>
3948 <p>Possible values:
3949 </p><dl compact="compact">
3950 <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
3951 </dl>
3952
3953 </dd>
3954 <dt><samp>lowres <var>integer</var> (<em>decoding,audio,video</em>)</samp></dt>
3955 <dd><p>Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
3956 </p>
3957 </dd>
3958 <dt><samp>skip_threshold <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3959 <dd><p>Set frame skip threshold.
3960 </p>
3961 </dd>
3962 <dt><samp>skip_factor <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3963 <dd><p>Set frame skip factor.
3964 </p>
3965 </dd>
3966 <dt><samp>skip_exp <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3967 <dd><p>Set frame skip exponent.
3968 Negative values behave identical to the corresponding positive ones, except
3969 that the score is normalized.
3970 Positive values exist primarily for compatibility reasons and are not so useful.
3971 </p>
3972 </dd>
3973 <dt><samp>skipcmp <var>integer</var> (<em>encoding,video</em>)</samp></dt>
3974 <dd><p>Set frame skip compare function.
3975 </p>
3976 <p>Possible values:
3977 </p><dl compact="compact">
3978 <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
3979 <dd><p>sum of absolute differences, fast (default)
3980 </p></dd>
3981 <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
3982 <dd><p>sum of squared errors
3983 </p></dd>
3984 <dt>&lsquo;<samp>satd</samp>&rsquo;</dt>
3985 <dd><p>sum of absolute Hadamard transformed differences
3986 </p></dd>
3987 <dt>&lsquo;<samp>dct</samp>&rsquo;</dt>
3988 <dd><p>sum of absolute DCT transformed differences
3989 </p></dd>
3990 <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
3991 <dd><p>sum of squared quantization errors (avoid, low quality)
3992 </p></dd>
3993 <dt>&lsquo;<samp>bit</samp>&rsquo;</dt>
3994 <dd><p>number of bits needed for the block
3995 </p></dd>
3996 <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
3997 <dd><p>rate distortion optimal, slow
3998 </p></dd>
3999 <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
4000 <dd><p>0
4001 </p></dd>
4002 <dt>&lsquo;<samp>vsad</samp>&rsquo;</dt>
4003 <dd><p>sum of absolute vertical differences
4004 </p></dd>
4005 <dt>&lsquo;<samp>vsse</samp>&rsquo;</dt>
4006 <dd><p>sum of squared vertical differences
4007 </p></dd>
4008 <dt>&lsquo;<samp>nsse</samp>&rsquo;</dt>
4009 <dd><p>noise preserving sum of squared differences
4010 </p></dd>
4011 <dt>&lsquo;<samp>w53</samp>&rsquo;</dt>
4012 <dd><p>5/3 wavelet, only used in snow
4013 </p></dd>
4014 <dt>&lsquo;<samp>w97</samp>&rsquo;</dt>
4015 <dd><p>9/7 wavelet, only used in snow
4016 </p></dd>
4017 <dt>&lsquo;<samp>dctmax</samp>&rsquo;</dt>
4018 <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
4019 </dl>
4020
4021 </dd>
4022 <dt><samp>border_mask <var>float</var> (<em>encoding,video</em>)</samp></dt>
4023 <dd><p>Increase the quantizer for macroblocks close to borders.
4024 </p>
4025 </dd>
4026 <dt><samp>mblmin <var>integer</var> (<em>encoding,video</em>)</samp></dt>
4027 <dd><p>Set min macroblock lagrange factor (VBR).
4028 </p>
4029 </dd>
4030 <dt><samp>mblmax <var>integer</var> (<em>encoding,video</em>)</samp></dt>
4031 <dd><p>Set max macroblock lagrange factor (VBR).
4032 </p>
4033 </dd>
4034 <dt><samp>mepc <var>integer</var> (<em>encoding,video</em>)</samp></dt>
4035 <dd><p>Set motion estimation bitrate penalty compensation (1.0 = 256).
4036 </p>
4037 </dd>
4038 <dt><samp>skip_loop_filter <var>integer</var> (<em>decoding,video</em>)</samp></dt>
4039 <dt><samp>skip_idct        <var>integer</var> (<em>decoding,video</em>)</samp></dt>
4040 <dt><samp>skip_frame       <var>integer</var> (<em>decoding,video</em>)</samp></dt>
4041 <dd>
4042 <p>Make decoder discard processing depending on the frame type selected
4043 by the option value.
4044 </p>
4045 <p><samp>skip_loop_filter</samp> skips frame loop filtering, <samp>skip_idct</samp>
4046 skips frame IDCT/dequantization, <samp>skip_frame</samp> skips decoding.
4047 </p>
4048 <p>Possible values:
4049 </p><dl compact="compact">
4050 <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
4051 <dd><p>Discard no frame.
4052 </p>
4053 </dd>
4054 <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
4055 <dd><p>Discard useless frames like 0-sized frames.
4056 </p>
4057 </dd>
4058 <dt>&lsquo;<samp>noref</samp>&rsquo;</dt>
4059 <dd><p>Discard all non-reference frames.
4060 </p>
4061 </dd>
4062 <dt>&lsquo;<samp>bidir</samp>&rsquo;</dt>
4063 <dd><p>Discard all bidirectional frames.
4064 </p>
4065 </dd>
4066 <dt>&lsquo;<samp>nokey</samp>&rsquo;</dt>
4067 <dd><p>Discard all frames excepts keyframes.
4068 </p>
4069 </dd>
4070 <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
4071 <dd><p>Discard all frames.
4072 </p></dd>
4073 </dl>
4074
4075 <p>Default value is &lsquo;<samp>default</samp>&rsquo;.
4076 </p>
4077 </dd>
4078 <dt><samp>bidir_refine <var>integer</var> (<em>encoding,video</em>)</samp></dt>
4079 <dd><p>Refine the two motion vectors used in bidirectional macroblocks.
4080 </p>
4081 </dd>
4082 <dt><samp>brd_scale <var>integer</var> (<em>encoding,video</em>)</samp></dt>
4083 <dd><p>Downscale frames for dynamic B-frame decision.
4084 </p>
4085 </dd>
4086 <dt><samp>keyint_min <var>integer</var> (<em>encoding,video</em>)</samp></dt>
4087 <dd><p>Set minimum interval between IDR-frames.
4088 </p>
4089 </dd>
4090 <dt><samp>refs <var>integer</var> (<em>encoding,video</em>)</samp></dt>
4091 <dd><p>Set reference frames to consider for motion compensation.
4092 </p>
4093 </dd>
4094 <dt><samp>chromaoffset <var>integer</var> (<em>encoding,video</em>)</samp></dt>
4095 <dd><p>Set chroma qp offset from luma.
4096 </p>
4097 </dd>
4098 <dt><samp>trellis <var>integer</var> (<em>encoding,audio,video</em>)</samp></dt>
4099 <dd><p>Set rate-distortion optimal quantization.
4100 </p>
4101 </dd>
4102 <dt><samp>sc_factor <var>integer</var> (<em>encoding,video</em>)</samp></dt>
4103 <dd><p>Set value multiplied by qscale for each frame and added to
4104 scene_change_score.
4105 </p>
4106 </dd>
4107 <dt><samp>mv0_threshold <var>integer</var> (<em>encoding,video</em>)</samp></dt>
4108 <dt><samp>b_sensitivity <var>integer</var> (<em>encoding,video</em>)</samp></dt>
4109 <dd><p>Adjust sensitivity of b_frame_strategy 1.
4110 </p>
4111 </dd>
4112 <dt><samp>compression_level <var>integer</var> (<em>encoding,audio,video</em>)</samp></dt>
4113 <dt><samp>min_prediction_order <var>integer</var> (<em>encoding,audio</em>)</samp></dt>
4114 <dt><samp>max_prediction_order <var>integer</var> (<em>encoding,audio</em>)</samp></dt>
4115 <dt><samp>timecode_frame_start <var>integer</var> (<em>encoding,video</em>)</samp></dt>
4116 <dd><p>Set GOP timecode frame start number, in non drop frame format.
4117 </p>
4118 </dd>
4119 <dt><samp>request_channels <var>integer</var> (<em>decoding,audio</em>)</samp></dt>
4120 <dd><p>Set desired number of audio channels.
4121 </p>
4122 </dd>
4123 <dt><samp>bits_per_raw_sample <var>integer</var></samp></dt>
4124 <dt><samp>channel_layout <var>integer</var> (<em>decoding/encoding,audio</em>)</samp></dt>
4125 <dd>
4126 <p>Possible values:
4127 </p></dd>
4128 <dt><samp>request_channel_layout <var>integer</var> (<em>decoding,audio</em>)</samp></dt>
4129 <dd>
4130 <p>Possible values:
4131 </p></dd>
4132 <dt><samp>rc_max_vbv_use <var>float</var> (<em>encoding,video</em>)</samp></dt>
4133 <dt><samp>rc_min_vbv_use <var>float</var> (<em>encoding,video</em>)</samp></dt>
4134 <dt><samp>ticks_per_frame <var>integer</var> (<em>decoding/encoding,audio,video</em>)</samp></dt>
4135 <dt><samp>color_primaries <var>integer</var> (<em>decoding/encoding,video</em>)</samp></dt>
4136 <dt><samp>color_trc <var>integer</var> (<em>decoding/encoding,video</em>)</samp></dt>
4137 <dt><samp>colorspace <var>integer</var> (<em>decoding/encoding,video</em>)</samp></dt>
4138 <dt><samp>color_range <var>integer</var> (<em>decoding/encoding,video</em>)</samp></dt>
4139 <dt><samp>chroma_sample_location <var>integer</var> (<em>decoding/encoding,video</em>)</samp></dt>
4140 <dt><samp>log_level_offset <var>integer</var></samp></dt>
4141 <dd><p>Set the log level offset.
4142 </p>
4143 </dd>
4144 <dt><samp>slices <var>integer</var> (<em>encoding,video</em>)</samp></dt>
4145 <dd><p>Number of slices, used in parallelized encoding.
4146 </p>
4147 </dd>
4148 <dt><samp>thread_type <var>flags</var> (<em>decoding/encoding,video</em>)</samp></dt>
4149 <dd><p>Select which multithreading methods to use.
4150 </p>
4151 <p>Use of &lsquo;<samp>frame</samp>&rsquo; will increase decoding delay by one frame per
4152 thread, so clients which cannot provide future frames should not use
4153 it.
4154 </p>
4155 <p>Possible values:
4156 </p><dl compact="compact">
4157 <dt>&lsquo;<samp>slice</samp>&rsquo;</dt>
4158 <dd><p>Decode more than one part of a single frame at once.
4159 </p>
4160 <p>Multithreading using slices works only when the video was encoded with
4161 slices.
4162 </p>
4163 </dd>
4164 <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
4165 <dd><p>Decode more than one frame at once.
4166 </p></dd>
4167 </dl>
4168
4169 <p>Default value is &lsquo;<samp>slice+frame</samp>&rsquo;.
4170 </p>
4171 </dd>
4172 <dt><samp>audio_service_type <var>integer</var> (<em>encoding,audio</em>)</samp></dt>
4173 <dd><p>Set audio service type.
4174 </p>
4175 <p>Possible values:
4176 </p><dl compact="compact">
4177 <dt>&lsquo;<samp>ma</samp>&rsquo;</dt>
4178 <dd><p>Main Audio Service
4179 </p></dd>
4180 <dt>&lsquo;<samp>ef</samp>&rsquo;</dt>
4181 <dd><p>Effects
4182 </p></dd>
4183 <dt>&lsquo;<samp>vi</samp>&rsquo;</dt>
4184 <dd><p>Visually Impaired
4185 </p></dd>
4186 <dt>&lsquo;<samp>hi</samp>&rsquo;</dt>
4187 <dd><p>Hearing Impaired
4188 </p></dd>
4189 <dt>&lsquo;<samp>di</samp>&rsquo;</dt>
4190 <dd><p>Dialogue
4191 </p></dd>
4192 <dt>&lsquo;<samp>co</samp>&rsquo;</dt>
4193 <dd><p>Commentary
4194 </p></dd>
4195 <dt>&lsquo;<samp>em</samp>&rsquo;</dt>
4196 <dd><p>Emergency
4197 </p></dd>
4198 <dt>&lsquo;<samp>vo</samp>&rsquo;</dt>
4199 <dd><p>Voice Over
4200 </p></dd>
4201 <dt>&lsquo;<samp>ka</samp>&rsquo;</dt>
4202 <dd><p>Karaoke
4203 </p></dd>
4204 </dl>
4205
4206 </dd>
4207 <dt><samp>request_sample_fmt <var>sample_fmt</var> (<em>decoding,audio</em>)</samp></dt>
4208 <dd><p>Set sample format audio decoders should prefer. Default value is
4209 <code>none</code>.
4210 </p>
4211 </dd>
4212 <dt><samp>pkt_timebase <var>rational number</var></samp></dt>
4213 <dt><samp>sub_charenc <var>encoding</var> (<em>decoding,subtitles</em>)</samp></dt>
4214 <dd><p>Set the input subtitles character encoding.
4215 </p>
4216 </dd>
4217 <dt><samp>field_order  <var>field_order</var> (<em>video</em>)</samp></dt>
4218 <dd><p>Set/override the field order of the video.
4219 Possible values:
4220 </p><dl compact="compact">
4221 <dt>&lsquo;<samp>progressive</samp>&rsquo;</dt>
4222 <dd><p>Progressive video
4223 </p></dd>
4224 <dt>&lsquo;<samp>tt</samp>&rsquo;</dt>
4225 <dd><p>Interlaced video, top field coded and displayed first
4226 </p></dd>
4227 <dt>&lsquo;<samp>bb</samp>&rsquo;</dt>
4228 <dd><p>Interlaced video, bottom field coded and displayed first
4229 </p></dd>
4230 <dt>&lsquo;<samp>tb</samp>&rsquo;</dt>
4231 <dd><p>Interlaced video, top coded first, bottom displayed first
4232 </p></dd>
4233 <dt>&lsquo;<samp>bt</samp>&rsquo;</dt>
4234 <dd><p>Interlaced video, bottom coded first, top displayed first
4235 </p></dd>
4236 </dl>
4237
4238 </dd>
4239 <dt><samp>skip_alpha <var>integer</var> (<em>decoding,video</em>)</samp></dt>
4240 <dd><p>Set to 1 to disable processing alpha (transparency). This works like the
4241 &lsquo;<samp>gray</samp>&rsquo; flag in the <samp>flags</samp> option which skips chroma information
4242 instead of alpha. Default is 0.
4243 </p>
4244 </dd>
4245 <dt><samp>codec_whitelist <var>list</var> (<em>input</em>)</samp></dt>
4246 <dd><p>&quot;,&quot; separated List of allowed decoders. By default all are allowed.
4247 </p>
4248 </dd>
4249 <dt><samp>dump_separator <var>string</var> (<em>input</em>)</samp></dt>
4250 <dd><p>Separator used to separate the fields printed on the command line about the
4251 Stream parameters.
4252 For example to separate the fields with newlines and indention:
4253 </p><div class="example">
4254 <pre class="example">ffprobe -dump_separator &quot;
4255                           &quot;  -i ~/videos/matrixbench_mpeg2.mpg
4256 </pre></div>
4257
4258 </dd>
4259 </dl>
4260
4261
4262 <a name="Decoders"></a>
4263 <h2 class="chapter">8 Decoders<span class="pull-right"><a class="anchor hidden-xs" href="#Decoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Decoders" aria-hidden="true">TOC</a></span></h2>
4264
4265 <p>Decoders are configured elements in FFmpeg which allow the decoding of
4266 multimedia streams.
4267 </p>
4268 <p>When you configure your FFmpeg build, all the supported native decoders
4269 are enabled by default. Decoders requiring an external library must be enabled
4270 manually via the corresponding <code>--enable-lib</code> option. You can list all
4271 available decoders using the configure option <code>--list-decoders</code>.
4272 </p>
4273 <p>You can disable all the decoders with the configure option
4274 <code>--disable-decoders</code> and selectively enable / disable single decoders
4275 with the options <code>--enable-decoder=<var>DECODER</var></code> /
4276 <code>--disable-decoder=<var>DECODER</var></code>.
4277 </p>
4278 <p>The option <code>-decoders</code> of the ff* tools will display the list of
4279 enabled decoders.
4280 </p>
4281
4282 <a name="Video-Decoders"></a>
4283 <h2 class="chapter">9 Video Decoders<span class="pull-right"><a class="anchor hidden-xs" href="#Video-Decoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-Decoders" aria-hidden="true">TOC</a></span></h2>
4284
4285 <p>A description of some of the currently available video decoders
4286 follows.
4287 </p>
4288 <a name="rawvideo"></a>
4289 <h3 class="section">9.1 rawvideo<span class="pull-right"><a class="anchor hidden-xs" href="#rawvideo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rawvideo" aria-hidden="true">TOC</a></span></h3>
4290
4291 <p>Raw video decoder.
4292 </p>
4293 <p>This decoder decodes rawvideo streams.
4294 </p>
4295 <a name="Options-1"></a>
4296 <h4 class="subsection">9.1.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-1" aria-hidden="true">TOC</a></span></h4>
4297
4298 <dl compact="compact">
4299 <dt><samp>top <var>top_field_first</var></samp></dt>
4300 <dd><p>Specify the assumed field type of the input video.
4301 </p><dl compact="compact">
4302 <dt><samp>-1</samp></dt>
4303 <dd><p>the video is assumed to be progressive (default)
4304 </p></dd>
4305 <dt><samp>0</samp></dt>
4306 <dd><p>bottom-field-first is assumed
4307 </p></dd>
4308 <dt><samp>1</samp></dt>
4309 <dd><p>top-field-first is assumed
4310 </p></dd>
4311 </dl>
4312
4313 </dd>
4314 </dl>
4315
4316
4317 <a name="Audio-Decoders"></a>
4318 <h2 class="chapter">10 Audio Decoders<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Decoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Decoders" aria-hidden="true">TOC</a></span></h2>
4319
4320 <p>A description of some of the currently available audio decoders
4321 follows.
4322 </p>
4323 <a name="ac3"></a>
4324 <h3 class="section">10.1 ac3<span class="pull-right"><a class="anchor hidden-xs" href="#ac3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ac3" aria-hidden="true">TOC</a></span></h3>
4325
4326 <p>AC-3 audio decoder.
4327 </p>
4328 <p>This decoder implements part of ATSC A/52:2010 and ETSI TS 102 366, as well as
4329 the undocumented RealAudio 3 (a.k.a. dnet).
4330 </p>
4331 <a name="AC_002d3-Decoder-Options"></a>
4332 <h4 class="subsection">10.1.1 AC-3 Decoder Options<span class="pull-right"><a class="anchor hidden-xs" href="#AC_002d3-Decoder-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-AC_002d3-Decoder-Options" aria-hidden="true">TOC</a></span></h4>
4333
4334 <dl compact="compact">
4335 <dt><samp>-drc_scale <var>value</var></samp></dt>
4336 <dd><p>Dynamic Range Scale Factor. The factor to apply to dynamic range values
4337 from the AC-3 stream. This factor is applied exponentially.
4338 There are 3 notable scale factor ranges:
4339 </p><dl compact="compact">
4340 <dt><samp>drc_scale == 0</samp></dt>
4341 <dd><p>DRC disabled. Produces full range audio.
4342 </p></dd>
4343 <dt><samp>0 &lt; drc_scale &lt;= 1</samp></dt>
4344 <dd><p>DRC enabled.  Applies a fraction of the stream DRC value.
4345 Audio reproduction is between full range and full compression.
4346 </p></dd>
4347 <dt><samp>drc_scale &gt; 1</samp></dt>
4348 <dd><p>DRC enabled. Applies drc_scale asymmetrically.
4349 Loud sounds are fully compressed.  Soft sounds are enhanced.
4350 </p></dd>
4351 </dl>
4352
4353 </dd>
4354 </dl>
4355
4356 <a name="flac"></a>
4357 <h3 class="section">10.2 flac<span class="pull-right"><a class="anchor hidden-xs" href="#flac" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flac" aria-hidden="true">TOC</a></span></h3>
4358
4359 <p>FLAC audio decoder.
4360 </p>
4361 <p>This decoder aims to implement the complete FLAC specification from Xiph.
4362 </p>
4363 <a name="FLAC-Decoder-options"></a>
4364 <h4 class="subsection">10.2.1 FLAC Decoder options<span class="pull-right"><a class="anchor hidden-xs" href="#FLAC-Decoder-options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-FLAC-Decoder-options" aria-hidden="true">TOC</a></span></h4>
4365
4366 <dl compact="compact">
4367 <dt><samp>-use_buggy_lpc</samp></dt>
4368 <dd><p>The lavc FLAC encoder used to produce buggy streams with high lpc values
4369 (like the default value). This option allows to decode such streams
4370 correctly by using lavc&rsquo;s old buggy lpc logic for decoding.
4371 </p>
4372 </dd>
4373 </dl>
4374
4375 <a name="ffwavesynth"></a>
4376 <h3 class="section">10.3 ffwavesynth<span class="pull-right"><a class="anchor hidden-xs" href="#ffwavesynth" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ffwavesynth" aria-hidden="true">TOC</a></span></h3>
4377
4378 <p>Internal wave synthetizer.
4379 </p>
4380 <p>This decoder generates wave patterns according to predefined sequences. Its
4381 use is purely internal and the format of the data it accepts is not publicly
4382 documented.
4383 </p>
4384 <a name="libcelt"></a>
4385 <h3 class="section">10.4 libcelt<span class="pull-right"><a class="anchor hidden-xs" href="#libcelt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libcelt" aria-hidden="true">TOC</a></span></h3>
4386
4387 <p>libcelt decoder wrapper.
4388 </p>
4389 <p>libcelt allows libavcodec to decode the Xiph CELT ultra-low delay audio codec.
4390 Requires the presence of the libcelt headers and library during configuration.
4391 You need to explicitly configure the build with <code>--enable-libcelt</code>.
4392 </p>
4393 <a name="libgsm"></a>
4394 <h3 class="section">10.5 libgsm<span class="pull-right"><a class="anchor hidden-xs" href="#libgsm" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libgsm" aria-hidden="true">TOC</a></span></h3>
4395
4396 <p>libgsm decoder wrapper.
4397 </p>
4398 <p>libgsm allows libavcodec to decode the GSM full rate audio codec. Requires
4399 the presence of the libgsm headers and library during configuration. You need
4400 to explicitly configure the build with <code>--enable-libgsm</code>.
4401 </p>
4402 <p>This decoder supports both the ordinary GSM and the Microsoft variant.
4403 </p>
4404 <a name="libilbc"></a>
4405 <h3 class="section">10.6 libilbc<span class="pull-right"><a class="anchor hidden-xs" href="#libilbc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libilbc" aria-hidden="true">TOC</a></span></h3>
4406
4407 <p>libilbc decoder wrapper.
4408 </p>
4409 <p>libilbc allows libavcodec to decode the Internet Low Bitrate Codec (iLBC)
4410 audio codec. Requires the presence of the libilbc headers and library during
4411 configuration. You need to explicitly configure the build with
4412 <code>--enable-libilbc</code>.
4413 </p>
4414 <a name="Options-2"></a>
4415 <h4 class="subsection">10.6.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-2" aria-hidden="true">TOC</a></span></h4>
4416
4417 <p>The following option is supported by the libilbc wrapper.
4418 </p>
4419 <dl compact="compact">
4420 <dt><samp>enhance</samp></dt>
4421 <dd>
4422 <p>Enable the enhancement of the decoded audio when set to 1. The default
4423 value is 0 (disabled).
4424 </p>
4425 </dd>
4426 </dl>
4427
4428 <a name="libopencore_002damrnb"></a>
4429 <h3 class="section">10.7 libopencore-amrnb<span class="pull-right"><a class="anchor hidden-xs" href="#libopencore_002damrnb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libopencore_002damrnb" aria-hidden="true">TOC</a></span></h3>
4430
4431 <p>libopencore-amrnb decoder wrapper.
4432 </p>
4433 <p>libopencore-amrnb allows libavcodec to decode the Adaptive Multi-Rate
4434 Narrowband audio codec. Using it requires the presence of the
4435 libopencore-amrnb headers and library during configuration. You need to
4436 explicitly configure the build with <code>--enable-libopencore-amrnb</code>.
4437 </p>
4438 <p>An FFmpeg native decoder for AMR-NB exists, so users can decode AMR-NB
4439 without this library.
4440 </p>
4441 <a name="libopencore_002damrwb"></a>
4442 <h3 class="section">10.8 libopencore-amrwb<span class="pull-right"><a class="anchor hidden-xs" href="#libopencore_002damrwb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libopencore_002damrwb" aria-hidden="true">TOC</a></span></h3>
4443
4444 <p>libopencore-amrwb decoder wrapper.
4445 </p>
4446 <p>libopencore-amrwb allows libavcodec to decode the Adaptive Multi-Rate
4447 Wideband audio codec. Using it requires the presence of the
4448 libopencore-amrwb headers and library during configuration. You need to
4449 explicitly configure the build with <code>--enable-libopencore-amrwb</code>.
4450 </p>
4451 <p>An FFmpeg native decoder for AMR-WB exists, so users can decode AMR-WB
4452 without this library.
4453 </p>
4454 <a name="libopus"></a>
4455 <h3 class="section">10.9 libopus<span class="pull-right"><a class="anchor hidden-xs" href="#libopus" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libopus" aria-hidden="true">TOC</a></span></h3>
4456
4457 <p>libopus decoder wrapper.
4458 </p>
4459 <p>libopus allows libavcodec to decode the Opus Interactive Audio Codec.
4460 Requires the presence of the libopus headers and library during
4461 configuration. You need to explicitly configure the build with
4462 <code>--enable-libopus</code>.
4463 </p>
4464 <p>An FFmpeg native decoder for Opus exists, so users can decode Opus
4465 without this library.
4466 </p>
4467
4468 <a name="Subtitles-Decoders"></a>
4469 <h2 class="chapter">11 Subtitles Decoders<span class="pull-right"><a class="anchor hidden-xs" href="#Subtitles-Decoders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Subtitles-Decoders" aria-hidden="true">TOC</a></span></h2>
4470
4471 <a name="dvdsub"></a>
4472 <h3 class="section">11.1 dvdsub<span class="pull-right"><a class="anchor hidden-xs" href="#dvdsub" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dvdsub" aria-hidden="true">TOC</a></span></h3>
4473
4474 <p>This codec decodes the bitmap subtitles used in DVDs; the same subtitles can
4475 also be found in VobSub file pairs and in some Matroska files.
4476 </p>
4477 <a name="Options-3"></a>
4478 <h4 class="subsection">11.1.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-3" aria-hidden="true">TOC</a></span></h4>
4479
4480 <dl compact="compact">
4481 <dt><samp>palette</samp></dt>
4482 <dd><p>Specify the global palette used by the bitmaps. When stored in VobSub, the
4483 palette is normally specified in the index file; in Matroska, the palette is
4484 stored in the codec extra-data in the same format as in VobSub. In DVDs, the
4485 palette is stored in the IFO file, and therefore not available when reading
4486 from dumped VOB files.
4487 </p>
4488 <p>The format for this option is a string containing 16 24-bits hexadecimal
4489 numbers (without 0x prefix) separated by comas, for example <code>0d00ee,
4490 ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
4491 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b</code>.
4492 </p>
4493 </dd>
4494 <dt><samp>ifo_palette</samp></dt>
4495 <dd><p>Specify the IFO file from which the global palette is obtained.
4496 (experimental)
4497 </p>
4498 </dd>
4499 <dt><samp>forced_subs_only</samp></dt>
4500 <dd><p>Only decode subtitle entries marked as forced. Some titles have forced
4501 and non-forced subtitles in the same track. Setting this flag to <code>1</code>
4502 will only keep the forced subtitles. Default value is <code>0</code>.
4503 </p></dd>
4504 </dl>
4505
4506 <a name="libzvbi_002dteletext"></a>
4507 <h3 class="section">11.2 libzvbi-teletext<span class="pull-right"><a class="anchor hidden-xs" href="#libzvbi_002dteletext" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libzvbi_002dteletext" aria-hidden="true">TOC</a></span></h3>
4508
4509 <p>Libzvbi allows libavcodec to decode DVB teletext pages and DVB teletext
4510 subtitles. Requires the presence of the libzvbi headers and library during
4511 configuration. You need to explicitly configure the build with
4512 <code>--enable-libzvbi</code>.
4513 </p>
4514 <a name="Options-4"></a>
4515 <h4 class="subsection">11.2.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-4" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-4" aria-hidden="true">TOC</a></span></h4>
4516
4517 <dl compact="compact">
4518 <dt><samp>txt_page</samp></dt>
4519 <dd><p>List of teletext page numbers to decode. You may use the special * string to
4520 match all pages. Pages that do not match the specified list are dropped.
4521 Default value is *.
4522 </p></dd>
4523 <dt><samp>txt_chop_top</samp></dt>
4524 <dd><p>Discards the top teletext line. Default value is 1.
4525 </p></dd>
4526 <dt><samp>txt_format</samp></dt>
4527 <dd><p>Specifies the format of the decoded subtitles. The teletext decoder is capable
4528 of decoding the teletext pages to bitmaps or to simple text, you should use
4529 &quot;bitmap&quot; for teletext pages, because certain graphics and colors cannot be
4530 expressed in simple text. You might use &quot;text&quot; for teletext based subtitles if
4531 your application can handle simple text based subtitles. Default value is
4532 bitmap.
4533 </p></dd>
4534 <dt><samp>txt_left</samp></dt>
4535 <dd><p>X offset of generated bitmaps, default is 0.
4536 </p></dd>
4537 <dt><samp>txt_top</samp></dt>
4538 <dd><p>Y offset of generated bitmaps, default is 0.
4539 </p></dd>
4540 <dt><samp>txt_chop_spaces</samp></dt>
4541 <dd><p>Chops leading and trailing spaces and removes empty lines from the generated
4542 text. This option is useful for teletext based subtitles where empty spaces may
4543 be present at the start or at the end of the lines or empty lines may be
4544 present between the subtitle lines because of double-sized teletext charactes.
4545 Default value is 1.
4546 </p></dd>
4547 <dt><samp>txt_duration</samp></dt>
4548 <dd><p>Sets the display duration of the decoded teletext pages or subtitles in
4549 miliseconds. Default value is 30000 which is 30 seconds.
4550 </p></dd>
4551 <dt><samp>txt_transparent</samp></dt>
4552 <dd><p>Force transparent background of the generated teletext bitmaps. Default value
4553 is 0 which means an opaque (black) background.
4554 </p></dd>
4555 </dl>
4556
4557 <a name="Bitstream-Filters"></a>
4558 <h2 class="chapter">12 Bitstream Filters<span class="pull-right"><a class="anchor hidden-xs" href="#Bitstream-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Bitstream-Filters" aria-hidden="true">TOC</a></span></h2>
4559
4560 <p>When you configure your FFmpeg build, all the supported bitstream
4561 filters are enabled by default. You can list all available ones using
4562 the configure option <code>--list-bsfs</code>.
4563 </p>
4564 <p>You can disable all the bitstream filters using the configure option
4565 <code>--disable-bsfs</code>, and selectively enable any bitstream filter using
4566 the option <code>--enable-bsf=BSF</code>, or you can disable a particular
4567 bitstream filter using the option <code>--disable-bsf=BSF</code>.
4568 </p>
4569 <p>The option <code>-bsfs</code> of the ff* tools will display the list of
4570 all the supported bitstream filters included in your build.
4571 </p>
4572 <p>The ff* tools have a -bsf option applied per stream, taking a
4573 comma-separated list of filters, whose parameters follow the filter
4574 name after a &rsquo;=&rsquo;.
4575 </p>
4576 <div class="example">
4577 <pre class="example">ffmpeg -i INPUT -c:v copy -bsf:v filter1[=opt1=str1/opt2=str2][,filter2] OUTPUT
4578 </pre></div>
4579
4580 <p>Below is a description of the currently available bitstream filters,
4581 with their parameters, if any.
4582 </p>
4583 <a name="aac_005fadtstoasc"></a>
4584 <h3 class="section">12.1 aac_adtstoasc<span class="pull-right"><a class="anchor hidden-xs" href="#aac_005fadtstoasc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aac_005fadtstoasc" aria-hidden="true">TOC</a></span></h3>
4585
4586 <p>Convert MPEG-2/4 AAC ADTS to MPEG-4 Audio Specific Configuration
4587 bitstream filter.
4588 </p>
4589 <p>This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4
4590 ADTS header and removes the ADTS header.
4591 </p>
4592 <p>This is required for example when copying an AAC stream from a raw
4593 ADTS AAC container to a FLV or a MOV/MP4 file.
4594 </p>
4595 <a name="chomp"></a>
4596 <h3 class="section">12.2 chomp<span class="pull-right"><a class="anchor hidden-xs" href="#chomp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chomp" aria-hidden="true">TOC</a></span></h3>
4597
4598 <p>Remove zero padding at the end of a packet.
4599 </p>
4600 <a name="dump_005fextra"></a>
4601 <h3 class="section">12.3 dump_extra<span class="pull-right"><a class="anchor hidden-xs" href="#dump_005fextra" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dump_005fextra" aria-hidden="true">TOC</a></span></h3>
4602
4603 <p>Add extradata to the beginning of the filtered packets.
4604 </p>
4605 <p>The additional argument specifies which packets should be filtered.
4606 It accepts the values:
4607 </p><dl compact="compact">
4608 <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
4609 <dd><p>add extradata to all key packets, but only if <var>local_header</var> is
4610 set in the <samp>flags2</samp> codec context field
4611 </p>
4612 </dd>
4613 <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
4614 <dd><p>add extradata to all key packets
4615 </p>
4616 </dd>
4617 <dt>&lsquo;<samp>e</samp>&rsquo;</dt>
4618 <dd><p>add extradata to all packets
4619 </p></dd>
4620 </dl>
4621
4622 <p>If not specified it is assumed &lsquo;<samp>k</samp>&rsquo;.
4623 </p>
4624 <p>For example the following <code>ffmpeg</code> command forces a global
4625 header (thus disabling individual packet headers) in the H.264 packets
4626 generated by the <code>libx264</code> encoder, but corrects them by adding
4627 the header stored in extradata to the key packets:
4628 </p><div class="example">
4629 <pre class="example">ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts
4630 </pre></div>
4631
4632 <a name="h264_005fmp4toannexb"></a>
4633 <h3 class="section">12.4 h264_mp4toannexb<span class="pull-right"><a class="anchor hidden-xs" href="#h264_005fmp4toannexb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-h264_005fmp4toannexb" aria-hidden="true">TOC</a></span></h3>
4634
4635 <p>Convert an H.264 bitstream from length prefixed mode to start code
4636 prefixed mode (as defined in the Annex B of the ITU-T H.264
4637 specification).
4638 </p>
4639 <p>This is required by some streaming formats, typically the MPEG-2
4640 transport stream format (&quot;mpegts&quot;).
4641 </p>
4642 <p>For example to remux an MP4 file containing an H.264 stream to mpegts
4643 format with <code>ffmpeg</code>, you can use the command:
4644 </p>
4645 <div class="example">
4646 <pre class="example">ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
4647 </pre></div>
4648
4649 <a name="imxdump"></a>
4650 <h3 class="section">12.5 imxdump<span class="pull-right"><a class="anchor hidden-xs" href="#imxdump" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-imxdump" aria-hidden="true">TOC</a></span></h3>
4651
4652 <p>Modifies the bitstream to fit in MOV and to be usable by the Final Cut
4653 Pro decoder. This filter only applies to the mpeg2video codec, and is
4654 likely not needed for Final Cut Pro 7 and newer with the appropriate
4655 <samp>-tag:v</samp>.
4656 </p>
4657 <p>For example, to remux 30 MB/sec NTSC IMX to MOV:
4658 </p>
4659 <div class="example">
4660 <pre class="example">ffmpeg -i input.mxf -c copy -bsf:v imxdump -tag:v mx3n output.mov
4661 </pre></div>
4662
4663 <a name="mjpeg2jpeg"></a>
4664 <h3 class="section">12.6 mjpeg2jpeg<span class="pull-right"><a class="anchor hidden-xs" href="#mjpeg2jpeg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mjpeg2jpeg" aria-hidden="true">TOC</a></span></h3>
4665
4666 <p>Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
4667 </p>
4668 <p>MJPEG is a video codec wherein each video frame is essentially a
4669 JPEG image. The individual frames can be extracted without loss,
4670 e.g. by
4671 </p>
4672 <div class="example">
4673 <pre class="example">ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
4674 </pre></div>
4675
4676 <p>Unfortunately, these chunks are incomplete JPEG images, because
4677 they lack the DHT segment required for decoding. Quoting from
4678 <a href="http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml">http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml</a>:
4679 </p>
4680 <p>Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
4681 commented that &quot;MJPEG, or at least the MJPEG in AVIs having the
4682 MJPG fourcc, is restricted JPEG with a fixed &ndash; and *omitted* &ndash;
4683 Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2,
4684 and it must use basic Huffman encoding, not arithmetic or
4685 progressive. . . . You can indeed extract the MJPEG frames and
4686 decode them with a regular JPEG decoder, but you have to prepend
4687 the DHT segment to them, or else the decoder won&rsquo;t have any idea
4688 how to decompress the data. The exact table necessary is given in
4689 the OpenDML spec.&quot;
4690 </p>
4691 <p>This bitstream filter patches the header of frames extracted from an MJPEG
4692 stream (carrying the AVI1 header ID and lacking a DHT segment) to
4693 produce fully qualified JPEG images.
4694 </p>
4695 <div class="example">
4696 <pre class="example">ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
4697 exiftran -i -9 frame*.jpg
4698 ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
4699 </pre></div>
4700
4701 <a name="mjpega_005fdump_005fheader"></a>
4702 <h3 class="section">12.7 mjpega_dump_header<span class="pull-right"><a class="anchor hidden-xs" href="#mjpega_005fdump_005fheader" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mjpega_005fdump_005fheader" aria-hidden="true">TOC</a></span></h3>
4703
4704 <a name="movsub"></a>
4705 <h3 class="section">12.8 movsub<span class="pull-right"><a class="anchor hidden-xs" href="#movsub" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-movsub" aria-hidden="true">TOC</a></span></h3>
4706
4707 <a name="mp3_005fheader_005fdecompress"></a>
4708 <h3 class="section">12.9 mp3_header_decompress<span class="pull-right"><a class="anchor hidden-xs" href="#mp3_005fheader_005fdecompress" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mp3_005fheader_005fdecompress" aria-hidden="true">TOC</a></span></h3>
4709
4710 <a name="mpeg4_005funpack_005fbframes"></a>
4711 <h3 class="section">12.10 mpeg4_unpack_bframes<span class="pull-right"><a class="anchor hidden-xs" href="#mpeg4_005funpack_005fbframes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpeg4_005funpack_005fbframes" aria-hidden="true">TOC</a></span></h3>
4712
4713 <p>Unpack DivX-style packed B-frames.
4714 </p>
4715 <p>DivX-style packed B-frames are not valid MPEG-4 and were only a
4716 workaround for the broken Video for Windows subsystem.
4717 They use more space, can cause minor AV sync issues, require more
4718 CPU power to decode (unless the player has some decoded picture queue
4719 to compensate the 2,0,2,0 frame per packet style) and cause
4720 trouble if copied into a standard container like mp4 or mpeg-ps/ts,
4721 because MPEG-4 decoders may not be able to decode them, since they are
4722 not valid MPEG-4.
4723 </p>
4724 <p>For example to fix an AVI file containing an MPEG-4 stream with
4725 DivX-style packed B-frames using <code>ffmpeg</code>, you can use the command:
4726 </p>
4727 <div class="example">
4728 <pre class="example">ffmpeg -i INPUT.avi -codec copy -bsf:v mpeg4_unpack_bframes OUTPUT.avi
4729 </pre></div>
4730
4731 <a name="noise"></a>
4732 <h3 class="section">12.11 noise<span class="pull-right"><a class="anchor hidden-xs" href="#noise" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-noise" aria-hidden="true">TOC</a></span></h3>
4733
4734 <p>Damages the contents of packets without damaging the container. Can be
4735 used for fuzzing or testing error resilience/concealment.
4736 </p>
4737 <p>Parameters:
4738 A numeral string, whose value is related to how often output bytes will
4739 be modified. Therefore, values below or equal to 0 are forbidden, and
4740 the lower the more frequent bytes will be modified, with 1 meaning
4741 every byte is modified.
4742 </p>
4743 <div class="example">
4744 <pre class="example">ffmpeg -i INPUT -c copy -bsf noise[=1] output.mkv
4745 </pre></div>
4746 <p>applies the modification to every byte.
4747 </p>
4748 <a name="remove_005fextra"></a>
4749 <h3 class="section">12.12 remove_extra<span class="pull-right"><a class="anchor hidden-xs" href="#remove_005fextra" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-remove_005fextra" aria-hidden="true">TOC</a></span></h3>
4750
4751 <a name="Format-Options"></a>
4752 <h2 class="chapter">13 Format Options<span class="pull-right"><a class="anchor hidden-xs" href="#Format-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Format-Options" aria-hidden="true">TOC</a></span></h2>
4753
4754 <p>The libavformat library provides some generic global options, which
4755 can be set on all the muxers and demuxers. In addition each muxer or
4756 demuxer may support so-called private options, which are specific for
4757 that component.
4758 </p>
4759 <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
4760 FFmpeg tools, or by setting the value explicitly in the
4761 <code>AVFormatContext</code> options or using the <samp>libavutil/opt.h</samp> API
4762 for programmatic use.
4763 </p>
4764 <p>The list of supported options follows:
4765 </p>
4766 <dl compact="compact">
4767 <dt><samp>avioflags <var>flags</var> (<em>input/output</em>)</samp></dt>
4768 <dd><p>Possible values:
4769 </p><dl compact="compact">
4770 <dt>&lsquo;<samp>direct</samp>&rsquo;</dt>
4771 <dd><p>Reduce buffering.
4772 </p></dd>
4773 </dl>
4774
4775 </dd>
4776 <dt><samp>probesize <var>integer</var> (<em>input</em>)</samp></dt>
4777 <dd><p>Set probing size in bytes, i.e. the size of the data to analyze to get
4778 stream information. A higher value will enable detecting more
4779 information in case it is dispersed into the stream, but will increase
4780 latency. Must be an integer not lesser than 32. It is 5000000 by default.
4781 </p>
4782 </dd>
4783 <dt><samp>packetsize <var>integer</var> (<em>output</em>)</samp></dt>
4784 <dd><p>Set packet size.
4785 </p>
4786 </dd>
4787 <dt><samp>fflags <var>flags</var> (<em>input/output</em>)</samp></dt>
4788 <dd><p>Set format flags.
4789 </p>
4790 <p>Possible values:
4791 </p><dl compact="compact">
4792 <dt>&lsquo;<samp>ignidx</samp>&rsquo;</dt>
4793 <dd><p>Ignore index.
4794 </p></dd>
4795 <dt>&lsquo;<samp>fastseek</samp>&rsquo;</dt>
4796 <dd><p>Enable fast, but inaccurate seeks for some formats.
4797 </p></dd>
4798 <dt>&lsquo;<samp>genpts</samp>&rsquo;</dt>
4799 <dd><p>Generate PTS.
4800 </p></dd>
4801 <dt>&lsquo;<samp>nofillin</samp>&rsquo;</dt>
4802 <dd><p>Do not fill in missing values that can be exactly calculated.
4803 </p></dd>
4804 <dt>&lsquo;<samp>noparse</samp>&rsquo;</dt>
4805 <dd><p>Disable AVParsers, this needs <code>+nofillin</code> too.
4806 </p></dd>
4807 <dt>&lsquo;<samp>igndts</samp>&rsquo;</dt>
4808 <dd><p>Ignore DTS.
4809 </p></dd>
4810 <dt>&lsquo;<samp>discardcorrupt</samp>&rsquo;</dt>
4811 <dd><p>Discard corrupted frames.
4812 </p></dd>
4813 <dt>&lsquo;<samp>sortdts</samp>&rsquo;</dt>
4814 <dd><p>Try to interleave output packets by DTS.
4815 </p></dd>
4816 <dt>&lsquo;<samp>keepside</samp>&rsquo;</dt>
4817 <dd><p>Do not merge side data.
4818 </p></dd>
4819 <dt>&lsquo;<samp>latm</samp>&rsquo;</dt>
4820 <dd><p>Enable RTP MP4A-LATM payload.
4821 </p></dd>
4822 <dt>&lsquo;<samp>nobuffer</samp>&rsquo;</dt>
4823 <dd><p>Reduce the latency introduced by optional buffering
4824 </p></dd>
4825 <dt>&lsquo;<samp>bitexact</samp>&rsquo;</dt>
4826 <dd><p>Only write platform-, build- and time-independent data.
4827 This ensures that file and data checksums are reproducible and match between
4828 platforms. Its primary use is for regression testing.
4829 </p></dd>
4830 </dl>
4831
4832 </dd>
4833 <dt><samp>seek2any <var>integer</var> (<em>input</em>)</samp></dt>
4834 <dd><p>Allow seeking to non-keyframes on demuxer level when supported if set to 1.
4835 Default is 0.
4836 </p>
4837 </dd>
4838 <dt><samp>analyzeduration <var>integer</var> (<em>input</em>)</samp></dt>
4839 <dd><p>Specify how many microseconds are analyzed to probe the input. A
4840 higher value will enable detecting more accurate information, but will
4841 increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
4842 </p>
4843 </dd>
4844 <dt><samp>cryptokey <var>hexadecimal string</var> (<em>input</em>)</samp></dt>
4845 <dd><p>Set decryption key.
4846 </p>
4847 </dd>
4848 <dt><samp>indexmem <var>integer</var> (<em>input</em>)</samp></dt>
4849 <dd><p>Set max memory used for timestamp index (per stream).
4850 </p>
4851 </dd>
4852 <dt><samp>rtbufsize <var>integer</var> (<em>input</em>)</samp></dt>
4853 <dd><p>Set max memory used for buffering real-time frames.
4854 </p>
4855 </dd>
4856 <dt><samp>fdebug <var>flags</var> (<em>input/output</em>)</samp></dt>
4857 <dd><p>Print specific debug info.
4858 </p>
4859 <p>Possible values:
4860 </p><dl compact="compact">
4861 <dt>&lsquo;<samp>ts</samp>&rsquo;</dt>
4862 </dl>
4863
4864 </dd>
4865 <dt><samp>max_delay <var>integer</var> (<em>input/output</em>)</samp></dt>
4866 <dd><p>Set maximum muxing or demuxing delay in microseconds.
4867 </p>
4868 </dd>
4869 <dt><samp>fpsprobesize <var>integer</var> (<em>input</em>)</samp></dt>
4870 <dd><p>Set number of frames used to probe fps.
4871 </p>
4872 </dd>
4873 <dt><samp>audio_preload <var>integer</var> (<em>output</em>)</samp></dt>
4874 <dd><p>Set microseconds by which audio packets should be interleaved earlier.
4875 </p>
4876 </dd>
4877 <dt><samp>chunk_duration <var>integer</var> (<em>output</em>)</samp></dt>
4878 <dd><p>Set microseconds for each chunk.
4879 </p>
4880 </dd>
4881 <dt><samp>chunk_size <var>integer</var> (<em>output</em>)</samp></dt>
4882 <dd><p>Set size in bytes for each chunk.
4883 </p>
4884 </dd>
4885 <dt><samp>err_detect, f_err_detect <var>flags</var> (<em>input</em>)</samp></dt>
4886 <dd><p>Set error detection flags. <code>f_err_detect</code> is deprecated and
4887 should be used only via the <code>ffmpeg</code> tool.
4888 </p>
4889 <p>Possible values:
4890 </p><dl compact="compact">
4891 <dt>&lsquo;<samp>crccheck</samp>&rsquo;</dt>
4892 <dd><p>Verify embedded CRCs.
4893 </p></dd>
4894 <dt>&lsquo;<samp>bitstream</samp>&rsquo;</dt>
4895 <dd><p>Detect bitstream specification deviations.
4896 </p></dd>
4897 <dt>&lsquo;<samp>buffer</samp>&rsquo;</dt>
4898 <dd><p>Detect improper bitstream length.
4899 </p></dd>
4900 <dt>&lsquo;<samp>explode</samp>&rsquo;</dt>
4901 <dd><p>Abort decoding on minor error detection.
4902 </p></dd>
4903 <dt>&lsquo;<samp>careful</samp>&rsquo;</dt>
4904 <dd><p>Consider things that violate the spec and have not been seen in the
4905 wild as errors.
4906 </p></dd>
4907 <dt>&lsquo;<samp>compliant</samp>&rsquo;</dt>
4908 <dd><p>Consider all spec non compliancies as errors.
4909 </p></dd>
4910 <dt>&lsquo;<samp>aggressive</samp>&rsquo;</dt>
4911 <dd><p>Consider things that a sane encoder should not do as an error.
4912 </p></dd>
4913 </dl>
4914
4915 </dd>
4916 <dt><samp>max_interleave_delta <var>integer</var> (<em>output</em>)</samp></dt>
4917 <dd><p>Set maximum buffering duration for interleaving. The duration is
4918 expressed in microseconds, and defaults to 1000000 (1 second).
4919 </p>
4920 <p>To ensure all the streams are interleaved correctly, libavformat will
4921 wait until it has at least one packet for each stream before actually
4922 writing any packets to the output file. When some streams are
4923 &quot;sparse&quot; (i.e. there are large gaps between successive packets), this
4924 can result in excessive buffering.
4925 </p>
4926 <p>This field specifies the maximum difference between the timestamps of the
4927 first and the last packet in the muxing queue, above which libavformat
4928 will output a packet regardless of whether it has queued a packet for all
4929 the streams.
4930 </p>
4931 <p>If set to 0, libavformat will continue buffering packets until it has
4932 a packet for each stream, regardless of the maximum timestamp
4933 difference between the buffered packets.
4934 </p>
4935 </dd>
4936 <dt><samp>use_wallclock_as_timestamps <var>integer</var> (<em>input</em>)</samp></dt>
4937 <dd><p>Use wallclock as timestamps.
4938 </p>
4939 </dd>
4940 <dt><samp>avoid_negative_ts <var>integer</var> (<em>output</em>)</samp></dt>
4941 <dd>
4942 <p>Possible values:
4943 </p><dl compact="compact">
4944 <dt>&lsquo;<samp>make_non_negative</samp>&rsquo;</dt>
4945 <dd><p>Shift timestamps to make them non-negative.
4946 Also note that this affects only leading negative timestamps, and not
4947 non-monotonic negative timestamps.
4948 </p></dd>
4949 <dt>&lsquo;<samp>make_zero</samp>&rsquo;</dt>
4950 <dd><p>Shift timestamps so that the first timestamp is 0.
4951 </p></dd>
4952 <dt>&lsquo;<samp>auto (default)</samp>&rsquo;</dt>
4953 <dd><p>Enables shifting when required by the target format.
4954 </p></dd>
4955 <dt>&lsquo;<samp>disabled</samp>&rsquo;</dt>
4956 <dd><p>Disables shifting of timestamp.
4957 </p></dd>
4958 </dl>
4959
4960 <p>When shifting is enabled, all output timestamps are shifted by the
4961 same amount. Audio, video, and subtitles desynching and relative
4962 timestamp differences are preserved compared to how they would have
4963 been without shifting.
4964 </p>
4965 </dd>
4966 <dt><samp>skip_initial_bytes <var>integer</var> (<em>input</em>)</samp></dt>
4967 <dd><p>Set number of bytes to skip before reading header and frames if set to 1.
4968 Default is 0.
4969 </p>
4970 </dd>
4971 <dt><samp>correct_ts_overflow <var>integer</var> (<em>input</em>)</samp></dt>
4972 <dd><p>Correct single timestamp overflows if set to 1. Default is 1.
4973 </p>
4974 </dd>
4975 <dt><samp>flush_packets <var>integer</var> (<em>output</em>)</samp></dt>
4976 <dd><p>Flush the underlying I/O stream after each packet. Default 1 enables it, and
4977 has the effect of reducing the latency; 0 disables it and may slightly
4978 increase performance in some cases.
4979 </p>
4980 </dd>
4981 <dt><samp>output_ts_offset <var>offset</var> (<em>output</em>)</samp></dt>
4982 <dd><p>Set the output time offset.
4983 </p>
4984 <p><var>offset</var> must be a time duration specification,
4985 see <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
4986 </p>
4987 <p>The offset is added by the muxer to the output timestamps.
4988 </p>
4989 <p>Specifying a positive offset means that the corresponding streams are
4990 delayed bt the time duration specified in <var>offset</var>. Default value
4991 is <code>0</code> (meaning that no offset is applied).
4992 </p>
4993 </dd>
4994 <dt><samp>format_whitelist <var>list</var> (<em>input</em>)</samp></dt>
4995 <dd><p>&quot;,&quot; separated List of allowed demuxers. By default all are allowed.
4996 </p>
4997 </dd>
4998 <dt><samp>dump_separator <var>string</var> (<em>input</em>)</samp></dt>
4999 <dd><p>Separator used to separate the fields printed on the command line about the
5000 Stream parameters.
5001 For example to separate the fields with newlines and indention:
5002 </p><div class="example">
5003 <pre class="example">ffprobe -dump_separator &quot;
5004                           &quot;  -i ~/videos/matrixbench_mpeg2.mpg
5005 </pre></div>
5006 </dd>
5007 </dl>
5008
5009
5010 <a name="Format-stream-specifiers"></a><a name="Format-stream-specifiers-1"></a>
5011 <h3 class="section">13.1 Format stream specifiers<span class="pull-right"><a class="anchor hidden-xs" href="#Format-stream-specifiers-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Format-stream-specifiers-1" aria-hidden="true">TOC</a></span></h3>
5012
5013 <p>Format stream specifiers allow selection of one or more streams that
5014 match specific properties.
5015 </p>
5016 <p>Possible forms of stream specifiers are:
5017 </p><dl compact="compact">
5018 <dt><samp><var>stream_index</var></samp></dt>
5019 <dd><p>Matches the stream with this index.
5020 </p>
5021 </dd>
5022 <dt><samp><var>stream_type</var>[:<var>stream_index</var>]</samp></dt>
5023 <dd><p><var>stream_type</var> is one of following: &rsquo;v&rsquo; for video, &rsquo;a&rsquo; for audio,
5024 &rsquo;s&rsquo; for subtitle, &rsquo;d&rsquo; for data, and &rsquo;t&rsquo; for attachments. If
5025 <var>stream_index</var> is given, then it matches the stream number
5026 <var>stream_index</var> of this type. Otherwise, it matches all streams of
5027 this type.
5028 </p>
5029 </dd>
5030 <dt><samp>p:<var>program_id</var>[:<var>stream_index</var>]</samp></dt>
5031 <dd><p>If <var>stream_index</var> is given, then it matches the stream with number
5032 <var>stream_index</var> in the program with the id
5033 <var>program_id</var>. Otherwise, it matches all streams in the program.
5034 </p>
5035 </dd>
5036 <dt><samp>#<var>stream_id</var></samp></dt>
5037 <dd><p>Matches the stream by a format-specific ID.
5038 </p></dd>
5039 </dl>
5040
5041 <p>The exact semantics of stream specifiers is defined by the
5042 <code>avformat_match_stream_specifier()</code> function declared in the
5043 <samp>libavformat/avformat.h</samp> header.
5044 </p>
5045 <a name="Demuxers"></a>
5046 <h2 class="chapter">14 Demuxers<span class="pull-right"><a class="anchor hidden-xs" href="#Demuxers" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Demuxers" aria-hidden="true">TOC</a></span></h2>
5047
5048 <p>Demuxers are configured elements in FFmpeg that can read the
5049 multimedia streams from a particular type of file.
5050 </p>
5051 <p>When you configure your FFmpeg build, all the supported demuxers
5052 are enabled by default. You can list all available ones using the
5053 configure option <code>--list-demuxers</code>.
5054 </p>
5055 <p>You can disable all the demuxers using the configure option
5056 <code>--disable-demuxers</code>, and selectively enable a single demuxer with
5057 the option <code>--enable-demuxer=<var>DEMUXER</var></code>, or disable it
5058 with the option <code>--disable-demuxer=<var>DEMUXER</var></code>.
5059 </p>
5060 <p>The option <code>-formats</code> of the ff* tools will display the list of
5061 enabled demuxers.
5062 </p>
5063 <p>The description of some of the currently available demuxers follows.
5064 </p>
5065 <a name="applehttp"></a>
5066 <h3 class="section">14.1 applehttp<span class="pull-right"><a class="anchor hidden-xs" href="#applehttp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-applehttp" aria-hidden="true">TOC</a></span></h3>
5067
5068 <p>Apple HTTP Live Streaming demuxer.
5069 </p>
5070 <p>This demuxer presents all AVStreams from all variant streams.
5071 The id field is set to the bitrate variant index number. By setting
5072 the discard flags on AVStreams (by pressing &rsquo;a&rsquo; or &rsquo;v&rsquo; in ffplay),
5073 the caller can decide which variant streams to actually receive.
5074 The total bitrate of the variant that the stream belongs to is
5075 available in a metadata key named &quot;variant_bitrate&quot;.
5076 </p>
5077 <a name="apng"></a>
5078 <h3 class="section">14.2 apng<span class="pull-right"><a class="anchor hidden-xs" href="#apng" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-apng" aria-hidden="true">TOC</a></span></h3>
5079
5080 <p>Animated Portable Network Graphics demuxer.
5081 </p>
5082 <p>This demuxer is used to demux APNG files.
5083 All headers, but the PNG signature, up to (but not including) the first
5084 fcTL chunk are transmitted as extradata.
5085 Frames are then split as being all the chunks between two fcTL ones, or
5086 between the last fcTL and IEND chunks.
5087 </p>
5088 <dl compact="compact">
5089 <dt><samp>-ignore_loop <var>bool</var></samp></dt>
5090 <dd><p>Ignore the loop variable in the file if set.
5091 </p></dd>
5092 <dt><samp>-max_fps <var>int</var></samp></dt>
5093 <dd><p>Maximum framerate in frames per second (0 for no limit).
5094 </p></dd>
5095 <dt><samp>-default_fps <var>int</var></samp></dt>
5096 <dd><p>Default framerate in frames per second when none is specified in the file
5097 (0 meaning as fast as possible).
5098 </p></dd>
5099 </dl>
5100
5101 <a name="asf"></a>
5102 <h3 class="section">14.3 asf<span class="pull-right"><a class="anchor hidden-xs" href="#asf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asf" aria-hidden="true">TOC</a></span></h3>
5103
5104 <p>Advanced Systems Format demuxer.
5105 </p>
5106 <p>This demuxer is used to demux ASF files and MMS network streams.
5107 </p>
5108 <dl compact="compact">
5109 <dt><samp>-no_resync_search <var>bool</var></samp></dt>
5110 <dd><p>Do not try to resynchronize by looking for a certain optional start code.
5111 </p></dd>
5112 </dl>
5113
5114 <a name="concat"></a><a name="concat-1"></a>
5115 <h3 class="section">14.4 concat<span class="pull-right"><a class="anchor hidden-xs" href="#concat-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-concat-1" aria-hidden="true">TOC</a></span></h3>
5116
5117 <p>Virtual concatenation script demuxer.
5118 </p>
5119 <p>This demuxer reads a list of files and other directives from a text file and
5120 demuxes them one after the other, as if all their packet had been muxed
5121 together.
5122 </p>
5123 <p>The timestamps in the files are adjusted so that the first file starts at 0
5124 and each next file starts where the previous one finishes. Note that it is
5125 done globally and may cause gaps if all streams do not have exactly the same
5126 length.
5127 </p>
5128 <p>All files must have the same streams (same codecs, same time base, etc.).
5129 </p>
5130 <p>The duration of each file is used to adjust the timestamps of the next file:
5131 if the duration is incorrect (because it was computed using the bit-rate or
5132 because the file is truncated, for example), it can cause artifacts. The
5133 <code>duration</code> directive can be used to override the duration stored in
5134 each file.
5135 </p>
5136 <a name="Syntax-1"></a>
5137 <h4 class="subsection">14.4.1 Syntax<span class="pull-right"><a class="anchor hidden-xs" href="#Syntax-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Syntax-1" aria-hidden="true">TOC</a></span></h4>
5138
5139 <p>The script is a text file in extended-ASCII, with one directive per line.
5140 Empty lines, leading spaces and lines starting with &rsquo;#&rsquo; are ignored. The
5141 following directive is recognized:
5142 </p>
5143 <dl compact="compact">
5144 <dt><samp><code>file <var>path</var></code></samp></dt>
5145 <dd><p>Path to a file to read; special characters and spaces must be escaped with
5146 backslash or single quotes.
5147 </p>
5148 <p>All subsequent file-related directives apply to that file.
5149 </p>
5150 </dd>
5151 <dt><samp><code>ffconcat version 1.0</code></samp></dt>
5152 <dd><p>Identify the script type and version. It also sets the <samp>safe</samp> option
5153 to 1 if it was to its default -1.
5154 </p>
5155 <p>To make FFmpeg recognize the format automatically, this directive must
5156 appears exactly as is (no extra space or byte-order-mark) on the very first
5157 line of the script.
5158 </p>
5159 </dd>
5160 <dt><samp><code>duration <var>dur</var></code></samp></dt>
5161 <dd><p>Duration of the file. This information can be specified from the file;
5162 specifying it here may be more efficient or help if the information from the
5163 file is not available or accurate.
5164 </p>
5165 <p>If the duration is set for all files, then it is possible to seek in the
5166 whole concatenated video.
5167 </p>
5168 </dd>
5169 <dt><samp><code>stream</code></samp></dt>
5170 <dd><p>Introduce a stream in the virtual file.
5171 All subsequent stream-related directives apply to the last introduced
5172 stream.
5173 Some streams properties must be set in order to allow identifying the
5174 matching streams in the subfiles.
5175 If no streams are defined in the script, the streams from the first file are
5176 copied.
5177 </p>
5178 </dd>
5179 <dt><samp><code>exact_stream_id <var>id</var></code></samp></dt>
5180 <dd><p>Set the id of the stream.
5181 If this directive is given, the string with the corresponding id in the
5182 subfiles will be used.
5183 This is especially useful for MPEG-PS (VOB) files, where the order of the
5184 streams is not reliable.
5185 </p>
5186 </dd>
5187 </dl>
5188
5189 <a name="Options-5"></a>
5190 <h4 class="subsection">14.4.2 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-5" aria-hidden="true">TOC</a></span></h4>
5191
5192 <p>This demuxer accepts the following option:
5193 </p>
5194 <dl compact="compact">
5195 <dt><samp>safe</samp></dt>
5196 <dd><p>If set to 1, reject unsafe file paths. A file path is considered safe if it
5197 does not contain a protocol specification and is relative and all components
5198 only contain characters from the portable character set (letters, digits,
5199 period, underscore and hyphen) and have no period at the beginning of a
5200 component.
5201 </p>
5202 <p>If set to 0, any file name is accepted.
5203 </p>
5204 <p>The default is -1, it is equivalent to 1 if the format was automatically
5205 probed and 0 otherwise.
5206 </p>
5207 </dd>
5208 <dt><samp>auto_convert</samp></dt>
5209 <dd><p>If set to 1, try to perform automatic conversions on packet data to make the
5210 streams concatenable.
5211 The default is 1.
5212 </p>
5213 <p>Currently, the only conversion is adding the h264_mp4toannexb bitstream
5214 filter to H.264 streams in MP4 format. This is necessary in particular if
5215 there are resolution changes.
5216 </p>
5217 </dd>
5218 </dl>
5219
5220 <a name="flv"></a>
5221 <h3 class="section">14.5 flv<span class="pull-right"><a class="anchor hidden-xs" href="#flv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flv" aria-hidden="true">TOC</a></span></h3>
5222
5223 <p>Adobe Flash Video Format demuxer.
5224 </p>
5225 <p>This demuxer is used to demux FLV files and RTMP network streams.
5226 </p>
5227 <dl compact="compact">
5228 <dt><samp>-flv_metadata <var>bool</var></samp></dt>
5229 <dd><p>Allocate the streams according to the onMetaData array content.
5230 </p></dd>
5231 </dl>
5232
5233 <a name="libgme"></a>
5234 <h3 class="section">14.6 libgme<span class="pull-right"><a class="anchor hidden-xs" href="#libgme" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libgme" aria-hidden="true">TOC</a></span></h3>
5235
5236 <p>The Game Music Emu library is a collection of video game music file emulators.
5237 </p>
5238 <p>See <a href="http://code.google.com/p/game-music-emu/">http://code.google.com/p/game-music-emu/</a> for more information.
5239 </p>
5240 <p>Some files have multiple tracks. The demuxer will pick the first track by
5241 default. The <samp>track_index</samp> option can be used to select a different
5242 track. Track indexes start at 0. The demuxer exports the number of tracks as
5243 <var>tracks</var> meta data entry.
5244 </p>
5245 <p>For very large files, the <samp>max_size</samp> option may have to be adjusted.
5246 </p>
5247 <a name="libquvi"></a>
5248 <h3 class="section">14.7 libquvi<span class="pull-right"><a class="anchor hidden-xs" href="#libquvi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libquvi" aria-hidden="true">TOC</a></span></h3>
5249
5250 <p>Play media from Internet services using the quvi project.
5251 </p>
5252 <p>The demuxer accepts a <samp>format</samp> option to request a specific quality. It
5253 is by default set to <var>best</var>.
5254 </p>
5255 <p>See <a href="http://quvi.sourceforge.net/">http://quvi.sourceforge.net/</a> for more information.
5256 </p>
5257 <p>FFmpeg needs to be built with <code>--enable-libquvi</code> for this demuxer to be
5258 enabled.
5259 </p>
5260 <a name="gif"></a>
5261 <h3 class="section">14.8 gif<span class="pull-right"><a class="anchor hidden-xs" href="#gif" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gif" aria-hidden="true">TOC</a></span></h3>
5262
5263 <p>Animated GIF demuxer.
5264 </p>
5265 <p>It accepts the following options:
5266 </p>
5267 <dl compact="compact">
5268 <dt><samp>min_delay</samp></dt>
5269 <dd><p>Set the minimum valid delay between frames in hundredths of seconds.
5270 Range is 0 to 6000. Default value is 2.
5271 </p>
5272 </dd>
5273 <dt><samp>max_gif_delay</samp></dt>
5274 <dd><p>Set the maximum valid delay between frames in hundredth of seconds.
5275 Range is 0 to 65535. Default value is 65535 (nearly eleven minutes),
5276 the maximum value allowed by the specification.
5277 </p>
5278 </dd>
5279 <dt><samp>default_delay</samp></dt>
5280 <dd><p>Set the default delay between frames in hundredths of seconds.
5281 Range is 0 to 6000. Default value is 10.
5282 </p>
5283 </dd>
5284 <dt><samp>ignore_loop</samp></dt>
5285 <dd><p>GIF files can contain information to loop a certain number of times (or
5286 infinitely). If <samp>ignore_loop</samp> is set to 1, then the loop setting
5287 from the input will be ignored and looping will not occur. If set to 0,
5288 then looping will occur and will cycle the number of times according to
5289 the GIF. Default value is 1.
5290 </p></dd>
5291 </dl>
5292
5293 <p>For example, with the overlay filter, place an infinitely looping GIF
5294 over another video:
5295 </p><div class="example">
5296 <pre class="example">ffmpeg -i input.mp4 -ignore_loop 0 -i input.gif -filter_complex overlay=shortest=1 out.mkv
5297 </pre></div>
5298
5299 <p>Note that in the above example the shortest option for overlay filter is
5300 used to end the output video at the length of the shortest input file,
5301 which in this case is <samp>input.mp4</samp> as the GIF in this example loops
5302 infinitely.
5303 </p>
5304 <a name="image2"></a>
5305 <h3 class="section">14.9 image2<span class="pull-right"><a class="anchor hidden-xs" href="#image2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-image2" aria-hidden="true">TOC</a></span></h3>
5306
5307 <p>Image file demuxer.
5308 </p>
5309 <p>This demuxer reads from a list of image files specified by a pattern.
5310 The syntax and meaning of the pattern is specified by the
5311 option <var>pattern_type</var>.
5312 </p>
5313 <p>The pattern may contain a suffix which is used to automatically
5314 determine the format of the images contained in the files.
5315 </p>
5316 <p>The size, the pixel format, and the format of each image must be the
5317 same for all the files in the sequence.
5318 </p>
5319 <p>This demuxer accepts the following options:
5320 </p><dl compact="compact">
5321 <dt><samp>framerate</samp></dt>
5322 <dd><p>Set the frame rate for the video stream. It defaults to 25.
5323 </p></dd>
5324 <dt><samp>loop</samp></dt>
5325 <dd><p>If set to 1, loop over the input. Default value is 0.
5326 </p></dd>
5327 <dt><samp>pattern_type</samp></dt>
5328 <dd><p>Select the pattern type used to interpret the provided filename.
5329 </p>
5330 <p><var>pattern_type</var> accepts one of the following values.
5331 </p><dl compact="compact">
5332 <dt><samp>none</samp></dt>
5333 <dd><p>Disable pattern matching, therefore the video will only contain the specified
5334 image. You should use this option if you do not want to create sequences from
5335 multiple images and your filenames may contain special pattern characters.
5336 </p></dd>
5337 <dt><samp>sequence</samp></dt>
5338 <dd><p>Select a sequence pattern type, used to specify a sequence of files
5339 indexed by sequential numbers.
5340 </p>
5341 <p>A sequence pattern may contain the string &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, which
5342 specifies the position of the characters representing a sequential
5343 number in each filename matched by the pattern. If the form
5344 &quot;%d0<var>N</var>d&quot; is used, the string representing the number in each
5345 filename is 0-padded and <var>N</var> is the total number of 0-padded
5346 digits representing the number. The literal character &rsquo;%&rsquo; can be
5347 specified in the pattern with the string &quot;%%&quot;.
5348 </p>
5349 <p>If the sequence pattern contains &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, the first filename of
5350 the file list specified by the pattern must contain a number
5351 inclusively contained between <var>start_number</var> and
5352 <var>start_number</var>+<var>start_number_range</var>-1, and all the following
5353 numbers must be sequential.
5354 </p>
5355 <p>For example the pattern &quot;img-%03d.bmp&quot; will match a sequence of
5356 filenames of the form <samp>img-001.bmp</samp>, <samp>img-002.bmp</samp>, ...,
5357 <samp>img-010.bmp</samp>, etc.; the pattern &quot;i%%m%%g-%d.jpg&quot; will match a
5358 sequence of filenames of the form <samp>i%m%g-1.jpg</samp>,
5359 <samp>i%m%g-2.jpg</samp>, ..., <samp>i%m%g-10.jpg</samp>, etc.
5360 </p>
5361 <p>Note that the pattern must not necessarily contain &quot;%d&quot; or
5362 &quot;%0<var>N</var>d&quot;, for example to convert a single image file
5363 <samp>img.jpeg</samp> you can employ the command:
5364 </p><div class="example">
5365 <pre class="example">ffmpeg -i img.jpeg img.png
5366 </pre></div>
5367
5368 </dd>
5369 <dt><samp>glob</samp></dt>
5370 <dd><p>Select a glob wildcard pattern type.
5371 </p>
5372 <p>The pattern is interpreted like a <code>glob()</code> pattern. This is only
5373 selectable if libavformat was compiled with globbing support.
5374 </p>
5375 </dd>
5376 <dt><samp>glob_sequence <em>(deprecated, will be removed)</em></samp></dt>
5377 <dd><p>Select a mixed glob wildcard/sequence pattern.
5378 </p>
5379 <p>If your version of libavformat was compiled with globbing support, and
5380 the provided pattern contains at least one glob meta character among
5381 <code>%*?[]{}</code> that is preceded by an unescaped &quot;%&quot;, the pattern is
5382 interpreted like a <code>glob()</code> pattern, otherwise it is interpreted
5383 like a sequence pattern.
5384 </p>
5385 <p>All glob special characters <code>%*?[]{}</code> must be prefixed
5386 with &quot;%&quot;. To escape a literal &quot;%&quot; you shall use &quot;%%&quot;.
5387 </p>
5388 <p>For example the pattern <code>foo-%*.jpeg</code> will match all the
5389 filenames prefixed by &quot;foo-&quot; and terminating with &quot;.jpeg&quot;, and
5390 <code>foo-%?%?%?.jpeg</code> will match all the filenames prefixed with
5391 &quot;foo-&quot;, followed by a sequence of three characters, and terminating
5392 with &quot;.jpeg&quot;.
5393 </p>
5394 <p>This pattern type is deprecated in favor of <var>glob</var> and
5395 <var>sequence</var>.
5396 </p></dd>
5397 </dl>
5398
5399 <p>Default value is <var>glob_sequence</var>.
5400 </p></dd>
5401 <dt><samp>pixel_format</samp></dt>
5402 <dd><p>Set the pixel format of the images to read. If not specified the pixel
5403 format is guessed from the first image file in the sequence.
5404 </p></dd>
5405 <dt><samp>start_number</samp></dt>
5406 <dd><p>Set the index of the file matched by the image file pattern to start
5407 to read from. Default value is 0.
5408 </p></dd>
5409 <dt><samp>start_number_range</samp></dt>
5410 <dd><p>Set the index interval range to check when looking for the first image
5411 file in the sequence, starting from <var>start_number</var>. Default value
5412 is 5.
5413 </p></dd>
5414 <dt><samp>ts_from_file</samp></dt>
5415 <dd><p>If set to 1, will set frame timestamp to modification time of image file. Note
5416 that monotonity of timestamps is not provided: images go in the same order as
5417 without this option. Default value is 0.
5418 If set to 2, will set frame timestamp to the modification time of the image file in
5419 nanosecond precision.
5420 </p></dd>
5421 <dt><samp>video_size</samp></dt>
5422 <dd><p>Set the video size of the images to read. If not specified the video
5423 size is guessed from the first image file in the sequence.
5424 </p></dd>
5425 </dl>
5426
5427 <a name="Examples-2"></a>
5428 <h4 class="subsection">14.9.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-2" aria-hidden="true">TOC</a></span></h4>
5429
5430 <ul>
5431 <li> Use <code>ffmpeg</code> for creating a video from the images in the file
5432 sequence <samp>img-001.jpeg</samp>, <samp>img-002.jpeg</samp>, ..., assuming an
5433 input frame rate of 10 frames per second:
5434 <div class="example">
5435 <pre class="example">ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
5436 </pre></div>
5437
5438 </li><li> As above, but start by reading from a file with index 100 in the sequence:
5439 <div class="example">
5440 <pre class="example">ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
5441 </pre></div>
5442
5443 </li><li> Read images matching the &quot;*.png&quot; glob pattern , that is all the files
5444 terminating with the &quot;.png&quot; suffix:
5445 <div class="example">
5446 <pre class="example">ffmpeg -framerate 10 -pattern_type glob -i &quot;*.png&quot; out.mkv
5447 </pre></div>
5448 </li></ul>
5449
5450 <a name="mpegts"></a>
5451 <h3 class="section">14.10 mpegts<span class="pull-right"><a class="anchor hidden-xs" href="#mpegts" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpegts" aria-hidden="true">TOC</a></span></h3>
5452
5453 <p>MPEG-2 transport stream demuxer.
5454 </p>
5455 <dl compact="compact">
5456 <dt><samp>fix_teletext_pts</samp></dt>
5457 <dd><p>Overrides teletext packet PTS and DTS values with the timestamps calculated
5458 from the PCR of the first program which the teletext stream is part of and is
5459 not discarded. Default value is 1, set this option to 0 if you want your
5460 teletext packet PTS and DTS values untouched.
5461 </p></dd>
5462 </dl>
5463
5464 <a name="rawvideo-1"></a>
5465 <h3 class="section">14.11 rawvideo<span class="pull-right"><a class="anchor hidden-xs" href="#rawvideo-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rawvideo-1" aria-hidden="true">TOC</a></span></h3>
5466
5467 <p>Raw video demuxer.
5468 </p>
5469 <p>This demuxer allows one to read raw video data. Since there is no header
5470 specifying the assumed video parameters, the user must specify them
5471 in order to be able to decode the data correctly.
5472 </p>
5473 <p>This demuxer accepts the following options:
5474 </p><dl compact="compact">
5475 <dt><samp>framerate</samp></dt>
5476 <dd><p>Set input video frame rate. Default value is 25.
5477 </p>
5478 </dd>
5479 <dt><samp>pixel_format</samp></dt>
5480 <dd><p>Set the input video pixel format. Default value is <code>yuv420p</code>.
5481 </p>
5482 </dd>
5483 <dt><samp>video_size</samp></dt>
5484 <dd><p>Set the input video size. This value must be specified explicitly.
5485 </p></dd>
5486 </dl>
5487
5488 <p>For example to read a rawvideo file <samp>input.raw</samp> with
5489 <code>ffplay</code>, assuming a pixel format of <code>rgb24</code>, a video
5490 size of <code>320x240</code>, and a frame rate of 10 images per second, use
5491 the command:
5492 </p><div class="example">
5493 <pre class="example">ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
5494 </pre></div>
5495
5496 <a name="sbg"></a>
5497 <h3 class="section">14.12 sbg<span class="pull-right"><a class="anchor hidden-xs" href="#sbg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sbg" aria-hidden="true">TOC</a></span></h3>
5498
5499 <p>SBaGen script demuxer.
5500 </p>
5501 <p>This demuxer reads the script language used by SBaGen
5502 <a href="http://uazu.net/sbagen/">http://uazu.net/sbagen/</a> to generate binaural beats sessions. A SBG
5503 script looks like that:
5504 </p><div class="example">
5505 <pre class="example">-SE
5506 a: 300-2.5/3 440+4.5/0
5507 b: 300-2.5/0 440+4.5/3
5508 off: -
5509 NOW      == a
5510 +0:07:00 == b
5511 +0:14:00 == a
5512 +0:21:00 == b
5513 +0:30:00    off
5514 </pre></div>
5515
5516 <p>A SBG script can mix absolute and relative timestamps. If the script uses
5517 either only absolute timestamps (including the script start time) or only
5518 relative ones, then its layout is fixed, and the conversion is
5519 straightforward. On the other hand, if the script mixes both kind of
5520 timestamps, then the <var>NOW</var> reference for relative timestamps will be
5521 taken from the current time of day at the time the script is read, and the
5522 script layout will be frozen according to that reference. That means that if
5523 the script is directly played, the actual times will match the absolute
5524 timestamps up to the sound controller&rsquo;s clock accuracy, but if the user
5525 somehow pauses the playback or seeks, all times will be shifted accordingly.
5526 </p>
5527 <a name="tedcaptions"></a>
5528 <h3 class="section">14.13 tedcaptions<span class="pull-right"><a class="anchor hidden-xs" href="#tedcaptions" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tedcaptions" aria-hidden="true">TOC</a></span></h3>
5529
5530 <p>JSON captions used for <a href="http://www.ted.com/">TED Talks</a>.
5531 </p>
5532 <p>TED does not provide links to the captions, but they can be guessed from the
5533 page. The file <samp>tools/bookmarklets.html</samp> from the FFmpeg source tree
5534 contains a bookmarklet to expose them.
5535 </p>
5536 <p>This demuxer accepts the following option:
5537 </p><dl compact="compact">
5538 <dt><samp>start_time</samp></dt>
5539 <dd><p>Set the start time of the TED talk, in milliseconds. The default is 15000
5540 (15s). It is used to sync the captions with the downloadable videos, because
5541 they include a 15s intro.
5542 </p></dd>
5543 </dl>
5544
5545 <p>Example: convert the captions to a format most players understand:
5546 </p><div class="example">
5547 <pre class="example">ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
5548 </pre></div>
5549
5550 <a name="Metadata"></a>
5551 <h2 class="chapter">15 Metadata<span class="pull-right"><a class="anchor hidden-xs" href="#Metadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Metadata" aria-hidden="true">TOC</a></span></h2>
5552
5553 <p>FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded
5554 INI-like text file and then load it back using the metadata muxer/demuxer.
5555 </p>
5556 <p>The file format is as follows:
5557 </p><ol>
5558 <li> A file consists of a header and a number of metadata tags divided into sections,
5559 each on its own line.
5560
5561 </li><li> The header is a &lsquo;<samp>;FFMETADATA</samp>&rsquo; string, followed by a version number (now 1).
5562
5563 </li><li> Metadata tags are of the form &lsquo;<samp>key=value</samp>&rsquo;
5564
5565 </li><li> Immediately after header follows global metadata
5566
5567 </li><li> After global metadata there may be sections with per-stream/per-chapter
5568 metadata.
5569
5570 </li><li> A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
5571 brackets (&lsquo;<samp>[</samp>&rsquo;, &lsquo;<samp>]</samp>&rsquo;) and ends with next section or end of file.
5572
5573 </li><li> At the beginning of a chapter section there may be an optional timebase to be
5574 used for start/end values. It must be in form
5575 &lsquo;<samp>TIMEBASE=<var>num</var>/<var>den</var></samp>&rsquo;, where <var>num</var> and <var>den</var> are
5576 integers. If the timebase is missing then start/end times are assumed to
5577 be in milliseconds.
5578
5579 <p>Next a chapter section must contain chapter start and end times in form
5580 &lsquo;<samp>START=<var>num</var></samp>&rsquo;, &lsquo;<samp>END=<var>num</var></samp>&rsquo;, where <var>num</var> is a positive
5581 integer.
5582 </p>
5583 </li><li> Empty lines and lines starting with &lsquo;<samp>;</samp>&rsquo; or &lsquo;<samp>#</samp>&rsquo; are ignored.
5584
5585 </li><li> Metadata keys or values containing special characters (&lsquo;<samp>=</samp>&rsquo;, &lsquo;<samp>;</samp>&rsquo;,
5586 &lsquo;<samp>#</samp>&rsquo;, &lsquo;<samp>\</samp>&rsquo; and a newline) must be escaped with a backslash &lsquo;<samp>\</samp>&rsquo;.
5587
5588 </li><li> Note that whitespace in metadata (e.g. &lsquo;<samp>foo = bar</samp>&rsquo;) is considered to be
5589 a part of the tag (in the example above key is &lsquo;<samp>foo </samp>&rsquo;, value is
5590 &lsquo;<samp> bar</samp>&rsquo;).
5591 </li></ol>
5592
5593 <p>A ffmetadata file might look like this:
5594 </p><div class="example">
5595 <pre class="example">;FFMETADATA1
5596 title=bike\\shed
5597 ;this is a comment
5598 artist=FFmpeg troll team
5599
5600 [CHAPTER]
5601 TIMEBASE=1/1000
5602 START=0
5603 #chapter ends at 0:01:00
5604 END=60000
5605 title=chapter \#1
5606 [STREAM]
5607 title=multi\
5608 line
5609 </pre></div>
5610
5611 <p>By using the ffmetadata muxer and demuxer it is possible to extract
5612 metadata from an input file to an ffmetadata file, and then transcode
5613 the file into an output file with the edited ffmetadata file.
5614 </p>
5615 <p>Extracting an ffmetadata file with <samp>ffmpeg</samp> goes as follows:
5616 </p><div class="example">
5617 <pre class="example">ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
5618 </pre></div>
5619
5620 <p>Reinserting edited metadata information from the FFMETADATAFILE file can
5621 be done as:
5622 </p><div class="example">
5623 <pre class="example">ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
5624 </pre></div>
5625
5626 <a name="Protocols"></a>
5627 <h2 class="chapter">16 Protocols<span class="pull-right"><a class="anchor hidden-xs" href="#Protocols" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Protocols" aria-hidden="true">TOC</a></span></h2>
5628
5629 <p>Protocols are configured elements in FFmpeg that enable access to
5630 resources that require specific protocols.
5631 </p>
5632 <p>When you configure your FFmpeg build, all the supported protocols are
5633 enabled by default. You can list all available ones using the
5634 configure option &quot;&ndash;list-protocols&quot;.
5635 </p>
5636 <p>You can disable all the protocols using the configure option
5637 &quot;&ndash;disable-protocols&quot;, and selectively enable a protocol using the
5638 option &quot;&ndash;enable-protocol=<var>PROTOCOL</var>&quot;, or you can disable a
5639 particular protocol using the option
5640 &quot;&ndash;disable-protocol=<var>PROTOCOL</var>&quot;.
5641 </p>
5642 <p>The option &quot;-protocols&quot; of the ff* tools will display the list of
5643 supported protocols.
5644 </p>
5645 <p>A description of the currently available protocols follows.
5646 </p>
5647 <a name="bluray"></a>
5648 <h3 class="section">16.1 bluray<span class="pull-right"><a class="anchor hidden-xs" href="#bluray" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bluray" aria-hidden="true">TOC</a></span></h3>
5649
5650 <p>Read BluRay playlist.
5651 </p>
5652 <p>The accepted options are:
5653 </p><dl compact="compact">
5654 <dt><samp>angle</samp></dt>
5655 <dd><p>BluRay angle
5656 </p>
5657 </dd>
5658 <dt><samp>chapter</samp></dt>
5659 <dd><p>Start chapter (1...N)
5660 </p>
5661 </dd>
5662 <dt><samp>playlist</samp></dt>
5663 <dd><p>Playlist to read (BDMV/PLAYLIST/?????.mpls)
5664 </p>
5665 </dd>
5666 </dl>
5667
5668 <p>Examples:
5669 </p>
5670 <p>Read longest playlist from BluRay mounted to /mnt/bluray:
5671 </p><div class="example">
5672 <pre class="example">bluray:/mnt/bluray
5673 </pre></div>
5674
5675 <p>Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2:
5676 </p><div class="example">
5677 <pre class="example">-playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
5678 </pre></div>
5679
5680 <a name="cache"></a>
5681 <h3 class="section">16.2 cache<span class="pull-right"><a class="anchor hidden-xs" href="#cache" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cache" aria-hidden="true">TOC</a></span></h3>
5682
5683 <p>Caching wrapper for input stream.
5684 </p>
5685 <p>Cache the input stream to temporary file. It brings seeking capability to live streams.
5686 </p>
5687 <div class="example">
5688 <pre class="example">cache:<var>URL</var>
5689 </pre></div>
5690
5691 <a name="concat-2"></a>
5692 <h3 class="section">16.3 concat<span class="pull-right"><a class="anchor hidden-xs" href="#concat-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-concat-2" aria-hidden="true">TOC</a></span></h3>
5693
5694 <p>Physical concatenation protocol.
5695 </p>
5696 <p>Read and seek from many resources in sequence as if they were
5697 a unique resource.
5698 </p>
5699 <p>A URL accepted by this protocol has the syntax:
5700 </p><div class="example">
5701 <pre class="example">concat:<var>URL1</var>|<var>URL2</var>|...|<var>URLN</var>
5702 </pre></div>
5703
5704 <p>where <var>URL1</var>, <var>URL2</var>, ..., <var>URLN</var> are the urls of the
5705 resource to be concatenated, each one possibly specifying a distinct
5706 protocol.
5707 </p>
5708 <p>For example to read a sequence of files <samp>split1.mpeg</samp>,
5709 <samp>split2.mpeg</samp>, <samp>split3.mpeg</samp> with <code>ffplay</code> use the
5710 command:
5711 </p><div class="example">
5712 <pre class="example">ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
5713 </pre></div>
5714
5715 <p>Note that you may need to escape the character &quot;|&quot; which is special for
5716 many shells.
5717 </p>
5718 <a name="crypto"></a>
5719 <h3 class="section">16.4 crypto<span class="pull-right"><a class="anchor hidden-xs" href="#crypto" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-crypto" aria-hidden="true">TOC</a></span></h3>
5720
5721 <p>AES-encrypted stream reading protocol.
5722 </p>
5723 <p>The accepted options are:
5724 </p><dl compact="compact">
5725 <dt><samp>key</samp></dt>
5726 <dd><p>Set the AES decryption key binary block from given hexadecimal representation.
5727 </p>
5728 </dd>
5729 <dt><samp>iv</samp></dt>
5730 <dd><p>Set the AES decryption initialization vector binary block from given hexadecimal representation.
5731 </p></dd>
5732 </dl>
5733
5734 <p>Accepted URL formats:
5735 </p><div class="example">
5736 <pre class="example">crypto:<var>URL</var>
5737 crypto+<var>URL</var>
5738 </pre></div>
5739
5740 <a name="data"></a>
5741 <h3 class="section">16.5 data<span class="pull-right"><a class="anchor hidden-xs" href="#data" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-data" aria-hidden="true">TOC</a></span></h3>
5742
5743 <p>Data in-line in the URI. See <a href="http://en.wikipedia.org/wiki/Data_URI_scheme">http://en.wikipedia.org/wiki/Data_URI_scheme</a>.
5744 </p>
5745 <p>For example, to convert a GIF file given inline with <code>ffmpeg</code>:
5746 </p><div class="example">
5747 <pre class="example">ffmpeg -i &quot;data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=&quot; smiley.png
5748 </pre></div>
5749
5750 <a name="file"></a>
5751 <h3 class="section">16.6 file<span class="pull-right"><a class="anchor hidden-xs" href="#file" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-file" aria-hidden="true">TOC</a></span></h3>
5752
5753 <p>File access protocol.
5754 </p>
5755 <p>Read from or write to a file.
5756 </p>
5757 <p>A file URL can have the form:
5758 </p><div class="example">
5759 <pre class="example">file:<var>filename</var>
5760 </pre></div>
5761
5762 <p>where <var>filename</var> is the path of the file to read.
5763 </p>
5764 <p>An URL that does not have a protocol prefix will be assumed to be a
5765 file URL. Depending on the build, an URL that looks like a Windows
5766 path with the drive letter at the beginning will also be assumed to be
5767 a file URL (usually not the case in builds for unix-like systems).
5768 </p>
5769 <p>For example to read from a file <samp>input.mpeg</samp> with <code>ffmpeg</code>
5770 use the command:
5771 </p><div class="example">
5772 <pre class="example">ffmpeg -i file:input.mpeg output.mpeg
5773 </pre></div>
5774
5775 <p>This protocol accepts the following options:
5776 </p>
5777 <dl compact="compact">
5778 <dt><samp>truncate</samp></dt>
5779 <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
5780 truncating. Default value is 1.
5781 </p>
5782 </dd>
5783 <dt><samp>blocksize</samp></dt>
5784 <dd><p>Set I/O operation maximum block size, in bytes. Default value is
5785 <code>INT_MAX</code>, which results in not limiting the requested block size.
5786 Setting this value reasonably low improves user termination request reaction
5787 time, which is valuable for files on slow medium.
5788 </p></dd>
5789 </dl>
5790
5791 <a name="ftp"></a>
5792 <h3 class="section">16.7 ftp<span class="pull-right"><a class="anchor hidden-xs" href="#ftp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ftp" aria-hidden="true">TOC</a></span></h3>
5793
5794 <p>FTP (File Transfer Protocol).
5795 </p>
5796 <p>Read from or write to remote resources using FTP protocol.
5797 </p>
5798 <p>Following syntax is required.
5799 </p><div class="example">
5800 <pre class="example">ftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
5801 </pre></div>
5802
5803 <p>This protocol accepts the following options.
5804 </p>
5805 <dl compact="compact">
5806 <dt><samp>timeout</samp></dt>
5807 <dd><p>Set timeout in microseconds of socket I/O operations used by the underlying low level
5808 operation. By default it is set to -1, which means that the timeout is
5809 not specified.
5810 </p>
5811 </dd>
5812 <dt><samp>ftp-anonymous-password</samp></dt>
5813 <dd><p>Password used when login as anonymous user. Typically an e-mail address
5814 should be used.
5815 </p>
5816 </dd>
5817 <dt><samp>ftp-write-seekable</samp></dt>
5818 <dd><p>Control seekability of connection during encoding. If set to 1 the
5819 resource is supposed to be seekable, if set to 0 it is assumed not
5820 to be seekable. Default value is 0.
5821 </p></dd>
5822 </dl>
5823
5824 <p>NOTE: Protocol can be used as output, but it is recommended to not do
5825 it, unless special care is taken (tests, customized server configuration
5826 etc.). Different FTP servers behave in different way during seek
5827 operation. ff* tools may produce incomplete content due to server limitations.
5828 </p>
5829 <a name="gopher"></a>
5830 <h3 class="section">16.8 gopher<span class="pull-right"><a class="anchor hidden-xs" href="#gopher" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gopher" aria-hidden="true">TOC</a></span></h3>
5831
5832 <p>Gopher protocol.
5833 </p>
5834 <a name="hls"></a>
5835 <h3 class="section">16.9 hls<span class="pull-right"><a class="anchor hidden-xs" href="#hls" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hls" aria-hidden="true">TOC</a></span></h3>
5836
5837 <p>Read Apple HTTP Live Streaming compliant segmented stream as
5838 a uniform one. The M3U8 playlists describing the segments can be
5839 remote HTTP resources or local files, accessed using the standard
5840 file protocol.
5841 The nested protocol is declared by specifying
5842 &quot;+<var>proto</var>&quot; after the hls URI scheme name, where <var>proto</var>
5843 is either &quot;file&quot; or &quot;http&quot;.
5844 </p>
5845 <div class="example">
5846 <pre class="example">hls+http://host/path/to/remote/resource.m3u8
5847 hls+file://path/to/local/resource.m3u8
5848 </pre></div>
5849
5850 <p>Using this protocol is discouraged - the hls demuxer should work
5851 just as well (if not, please report the issues) and is more complete.
5852 To use the hls demuxer instead, simply use the direct URLs to the
5853 m3u8 files.
5854 </p>
5855 <a name="http"></a>
5856 <h3 class="section">16.10 http<span class="pull-right"><a class="anchor hidden-xs" href="#http" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-http" aria-hidden="true">TOC</a></span></h3>
5857
5858 <p>HTTP (Hyper Text Transfer Protocol).
5859 </p>
5860 <p>This protocol accepts the following options:
5861 </p>
5862 <dl compact="compact">
5863 <dt><samp>seekable</samp></dt>
5864 <dd><p>Control seekability of connection. If set to 1 the resource is
5865 supposed to be seekable, if set to 0 it is assumed not to be seekable,
5866 if set to -1 it will try to autodetect if it is seekable. Default
5867 value is -1.
5868 </p>
5869 </dd>
5870 <dt><samp>chunked_post</samp></dt>
5871 <dd><p>If set to 1 use chunked Transfer-Encoding for posts, default is 1.
5872 </p>
5873 </dd>
5874 <dt><samp>content_type</samp></dt>
5875 <dd><p>Set a specific content type for the POST messages.
5876 </p>
5877 </dd>
5878 <dt><samp>headers</samp></dt>
5879 <dd><p>Set custom HTTP headers, can override built in default headers. The
5880 value must be a string encoding the headers.
5881 </p>
5882 </dd>
5883 <dt><samp>multiple_requests</samp></dt>
5884 <dd><p>Use persistent connections if set to 1, default is 0.
5885 </p>
5886 </dd>
5887 <dt><samp>post_data</samp></dt>
5888 <dd><p>Set custom HTTP post data.
5889 </p>
5890 </dd>
5891 <dt><samp>user-agent</samp></dt>
5892 <dt><samp>user_agent</samp></dt>
5893 <dd><p>Override the User-Agent header. If not specified the protocol will use a
5894 string describing the libavformat build. (&quot;Lavf/&lt;version&gt;&quot;)
5895 </p>
5896 </dd>
5897 <dt><samp>timeout</samp></dt>
5898 <dd><p>Set timeout in microseconds of socket I/O operations used by the underlying low level
5899 operation. By default it is set to -1, which means that the timeout is
5900 not specified.
5901 </p>
5902 </dd>
5903 <dt><samp>mime_type</samp></dt>
5904 <dd><p>Export the MIME type.
5905 </p>
5906 </dd>
5907 <dt><samp>icy</samp></dt>
5908 <dd><p>If set to 1 request ICY (SHOUTcast) metadata from the server. If the server
5909 supports this, the metadata has to be retrieved by the application by reading
5910 the <samp>icy_metadata_headers</samp> and <samp>icy_metadata_packet</samp> options.
5911 The default is 1.
5912 </p>
5913 </dd>
5914 <dt><samp>icy_metadata_headers</samp></dt>
5915 <dd><p>If the server supports ICY metadata, this contains the ICY-specific HTTP reply
5916 headers, separated by newline characters.
5917 </p>
5918 </dd>
5919 <dt><samp>icy_metadata_packet</samp></dt>
5920 <dd><p>If the server supports ICY metadata, and <samp>icy</samp> was set to 1, this
5921 contains the last non-empty metadata packet sent by the server. It should be
5922 polled in regular intervals by applications interested in mid-stream metadata
5923 updates.
5924 </p>
5925 </dd>
5926 <dt><samp>cookies</samp></dt>
5927 <dd><p>Set the cookies to be sent in future requests. The format of each cookie is the
5928 same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
5929 delimited by a newline character.
5930 </p>
5931 </dd>
5932 <dt><samp>offset</samp></dt>
5933 <dd><p>Set initial byte offset.
5934 </p>
5935 </dd>
5936 <dt><samp>end_offset</samp></dt>
5937 <dd><p>Try to limit the request to bytes preceding this offset.
5938 </p>
5939 </dd>
5940 <dt><samp>method</samp></dt>
5941 <dd><p>When used as a client option it sets the HTTP method for the request.
5942 </p>
5943 <p>When used as a server option it sets the HTTP method that is going to be
5944 expected from the client(s).
5945 If the expected and the received HTTP method do not match the client will
5946 be given a Bad Request response.
5947 When unset the HTTP method is not checked for now. This will be replaced by
5948 autodetection in the future.
5949 </p>
5950 </dd>
5951 <dt><samp>listen</samp></dt>
5952 <dd><p>If set to 1 enables experimental HTTP server. This can be used to send data when
5953 used as an output option, or read data from a client with HTTP POST when used as
5954 an input option.
5955 </p><div class="example">
5956 <pre class="example"># Server side (sending):
5957 ffmpeg -i somefile.ogg -c copy -listen 1 -f ogg http://<var>server</var>:<var>port</var>
5958
5959 # Client side (receiving):
5960 ffmpeg -i http://<var>server</var>:<var>port</var> -c copy somefile.ogg
5961
5962 # Client can also be done with wget:
5963 wget http://<var>server</var>:<var>port</var> -O somefile.ogg
5964
5965 # Server side (receiving):
5966 ffmpeg -listen 1 -i http://<var>server</var>:<var>port</var> -c copy somefile.ogg
5967
5968 # Client side (sending):
5969 ffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://<var>server</var>:<var>port</var>
5970
5971 # Client can also be done with wget:
5972 wget --post-file=somefile.ogg http://<var>server</var>:<var>port</var>
5973 </pre></div>
5974
5975 </dd>
5976 </dl>
5977
5978 <a name="HTTP-Cookies"></a>
5979 <h4 class="subsection">16.10.1 HTTP Cookies<span class="pull-right"><a class="anchor hidden-xs" href="#HTTP-Cookies" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-HTTP-Cookies" aria-hidden="true">TOC</a></span></h4>
5980
5981 <p>Some HTTP requests will be denied unless cookie values are passed in with the
5982 request. The <samp>cookies</samp> option allows these cookies to be specified. At
5983 the very least, each cookie must specify a value along with a path and domain.
5984 HTTP requests that match both the domain and path will automatically include the
5985 cookie value in the HTTP Cookie header field. Multiple cookies can be delimited
5986 by a newline.
5987 </p>
5988 <p>The required syntax to play a stream specifying a cookie is:
5989 </p><div class="example">
5990 <pre class="example">ffplay -cookies &quot;nlqptid=nltid=tsn; path=/; domain=somedomain.com;&quot; http://somedomain.com/somestream.m3u8
5991 </pre></div>
5992
5993 <a name="Icecast"></a>
5994 <h3 class="section">16.11 Icecast<span class="pull-right"><a class="anchor hidden-xs" href="#Icecast" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Icecast" aria-hidden="true">TOC</a></span></h3>
5995
5996 <p>Icecast protocol (stream to Icecast servers)
5997 </p>
5998 <p>This protocol accepts the following options:
5999 </p>
6000 <dl compact="compact">
6001 <dt><samp>ice_genre</samp></dt>
6002 <dd><p>Set the stream genre.
6003 </p>
6004 </dd>
6005 <dt><samp>ice_name</samp></dt>
6006 <dd><p>Set the stream name.
6007 </p>
6008 </dd>
6009 <dt><samp>ice_description</samp></dt>
6010 <dd><p>Set the stream description.
6011 </p>
6012 </dd>
6013 <dt><samp>ice_url</samp></dt>
6014 <dd><p>Set the stream website URL.
6015 </p>
6016 </dd>
6017 <dt><samp>ice_public</samp></dt>
6018 <dd><p>Set if the stream should be public.
6019 The default is 0 (not public).
6020 </p>
6021 </dd>
6022 <dt><samp>user_agent</samp></dt>
6023 <dd><p>Override the User-Agent header. If not specified a string of the form
6024 &quot;Lavf/&lt;version&gt;&quot; will be used.
6025 </p>
6026 </dd>
6027 <dt><samp>password</samp></dt>
6028 <dd><p>Set the Icecast mountpoint password.
6029 </p>
6030 </dd>
6031 <dt><samp>content_type</samp></dt>
6032 <dd><p>Set the stream content type. This must be set if it is different from
6033 audio/mpeg.
6034 </p>
6035 </dd>
6036 <dt><samp>legacy_icecast</samp></dt>
6037 <dd><p>This enables support for Icecast versions &lt; 2.4.0, that do not support the
6038 HTTP PUT method but the SOURCE method.
6039 </p>
6040 </dd>
6041 </dl>
6042
6043 <div class="example">
6044 <pre class="example">icecast://[<var>username</var>[:<var>password</var>]@]<var>server</var>:<var>port</var>/<var>mountpoint</var>
6045 </pre></div>
6046
6047 <a name="mmst"></a>
6048 <h3 class="section">16.12 mmst<span class="pull-right"><a class="anchor hidden-xs" href="#mmst" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mmst" aria-hidden="true">TOC</a></span></h3>
6049
6050 <p>MMS (Microsoft Media Server) protocol over TCP.
6051 </p>
6052 <a name="mmsh"></a>
6053 <h3 class="section">16.13 mmsh<span class="pull-right"><a class="anchor hidden-xs" href="#mmsh" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mmsh" aria-hidden="true">TOC</a></span></h3>
6054
6055 <p>MMS (Microsoft Media Server) protocol over HTTP.
6056 </p>
6057 <p>The required syntax is:
6058 </p><div class="example">
6059 <pre class="example">mmsh://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
6060 </pre></div>
6061
6062 <a name="md5"></a>
6063 <h3 class="section">16.14 md5<span class="pull-right"><a class="anchor hidden-xs" href="#md5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-md5" aria-hidden="true">TOC</a></span></h3>
6064
6065 <p>MD5 output protocol.
6066 </p>
6067 <p>Computes the MD5 hash of the data to be written, and on close writes
6068 this to the designated output or stdout if none is specified. It can
6069 be used to test muxers without writing an actual file.
6070 </p>
6071 <p>Some examples follow.
6072 </p><div class="example">
6073 <pre class="example"># Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
6074 ffmpeg -i input.flv -f avi -y md5:output.avi.md5
6075
6076 # Write the MD5 hash of the encoded AVI file to stdout.
6077 ffmpeg -i input.flv -f avi -y md5:
6078 </pre></div>
6079
6080 <p>Note that some formats (typically MOV) require the output protocol to
6081 be seekable, so they will fail with the MD5 output protocol.
6082 </p>
6083 <a name="pipe"></a>
6084 <h3 class="section">16.15 pipe<span class="pull-right"><a class="anchor hidden-xs" href="#pipe" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pipe" aria-hidden="true">TOC</a></span></h3>
6085
6086 <p>UNIX pipe access protocol.
6087 </p>
6088 <p>Read and write from UNIX pipes.
6089 </p>
6090 <p>The accepted syntax is:
6091 </p><div class="example">
6092 <pre class="example">pipe:[<var>number</var>]
6093 </pre></div>
6094
6095 <p><var>number</var> is the number corresponding to the file descriptor of the
6096 pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr).  If <var>number</var>
6097 is not specified, by default the stdout file descriptor will be used
6098 for writing, stdin for reading.
6099 </p>
6100 <p>For example to read from stdin with <code>ffmpeg</code>:
6101 </p><div class="example">
6102 <pre class="example">cat test.wav | ffmpeg -i pipe:0
6103 # ...this is the same as...
6104 cat test.wav | ffmpeg -i pipe:
6105 </pre></div>
6106
6107 <p>For writing to stdout with <code>ffmpeg</code>:
6108 </p><div class="example">
6109 <pre class="example">ffmpeg -i test.wav -f avi pipe:1 | cat &gt; test.avi
6110 # ...this is the same as...
6111 ffmpeg -i test.wav -f avi pipe: | cat &gt; test.avi
6112 </pre></div>
6113
6114 <p>This protocol accepts the following options:
6115 </p>
6116 <dl compact="compact">
6117 <dt><samp>blocksize</samp></dt>
6118 <dd><p>Set I/O operation maximum block size, in bytes. Default value is
6119 <code>INT_MAX</code>, which results in not limiting the requested block size.
6120 Setting this value reasonably low improves user termination request reaction
6121 time, which is valuable if data transmission is slow.
6122 </p></dd>
6123 </dl>
6124
6125 <p>Note that some formats (typically MOV), require the output protocol to
6126 be seekable, so they will fail with the pipe output protocol.
6127 </p>
6128 <a name="rtmp"></a>
6129 <h3 class="section">16.16 rtmp<span class="pull-right"><a class="anchor hidden-xs" href="#rtmp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmp" aria-hidden="true">TOC</a></span></h3>
6130
6131 <p>Real-Time Messaging Protocol.
6132 </p>
6133 <p>The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
6134 content across a TCP/IP network.
6135 </p>
6136 <p>The required syntax is:
6137 </p><div class="example">
6138 <pre class="example">rtmp://[<var>username</var>:<var>password</var>@]<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>instance</var>][/<var>playpath</var>]
6139 </pre></div>
6140
6141 <p>The accepted parameters are:
6142 </p><dl compact="compact">
6143 <dt><samp>username</samp></dt>
6144 <dd><p>An optional username (mostly for publishing).
6145 </p>
6146 </dd>
6147 <dt><samp>password</samp></dt>
6148 <dd><p>An optional password (mostly for publishing).
6149 </p>
6150 </dd>
6151 <dt><samp>server</samp></dt>
6152 <dd><p>The address of the RTMP server.
6153 </p>
6154 </dd>
6155 <dt><samp>port</samp></dt>
6156 <dd><p>The number of the TCP port to use (by default is 1935).
6157 </p>
6158 </dd>
6159 <dt><samp>app</samp></dt>
6160 <dd><p>It is the name of the application to access. It usually corresponds to
6161 the path where the application is installed on the RTMP server
6162 (e.g. <samp>/ondemand/</samp>, <samp>/flash/live/</samp>, etc.). You can override
6163 the value parsed from the URI through the <code>rtmp_app</code> option, too.
6164 </p>
6165 </dd>
6166 <dt><samp>playpath</samp></dt>
6167 <dd><p>It is the path or name of the resource to play with reference to the
6168 application specified in <var>app</var>, may be prefixed by &quot;mp4:&quot;. You
6169 can override the value parsed from the URI through the <code>rtmp_playpath</code>
6170 option, too.
6171 </p>
6172 </dd>
6173 <dt><samp>listen</samp></dt>
6174 <dd><p>Act as a server, listening for an incoming connection.
6175 </p>
6176 </dd>
6177 <dt><samp>timeout</samp></dt>
6178 <dd><p>Maximum time to wait for the incoming connection. Implies listen.
6179 </p></dd>
6180 </dl>
6181
6182 <p>Additionally, the following parameters can be set via command line options
6183 (or in code via <code>AVOption</code>s):
6184 </p><dl compact="compact">
6185 <dt><samp>rtmp_app</samp></dt>
6186 <dd><p>Name of application to connect on the RTMP server. This option
6187 overrides the parameter specified in the URI.
6188 </p>
6189 </dd>
6190 <dt><samp>rtmp_buffer</samp></dt>
6191 <dd><p>Set the client buffer time in milliseconds. The default is 3000.
6192 </p>
6193 </dd>
6194 <dt><samp>rtmp_conn</samp></dt>
6195 <dd><p>Extra arbitrary AMF connection parameters, parsed from a string,
6196 e.g. like <code>B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0</code>.
6197 Each value is prefixed by a single character denoting the type,
6198 B for Boolean, N for number, S for string, O for object, or Z for null,
6199 followed by a colon. For Booleans the data must be either 0 or 1 for
6200 FALSE or TRUE, respectively.  Likewise for Objects the data must be 0 or
6201 1 to end or begin an object, respectively. Data items in subobjects may
6202 be named, by prefixing the type with &rsquo;N&rsquo; and specifying the name before
6203 the value (i.e. <code>NB:myFlag:1</code>). This option may be used multiple
6204 times to construct arbitrary AMF sequences.
6205 </p>
6206 </dd>
6207 <dt><samp>rtmp_flashver</samp></dt>
6208 <dd><p>Version of the Flash plugin used to run the SWF player. The default
6209 is LNX 9,0,124,2. (When publishing, the default is FMLE/3.0 (compatible;
6210 &lt;libavformat version&gt;).)
6211 </p>
6212 </dd>
6213 <dt><samp>rtmp_flush_interval</samp></dt>
6214 <dd><p>Number of packets flushed in the same request (RTMPT only). The default
6215 is 10.
6216 </p>
6217 </dd>
6218 <dt><samp>rtmp_live</samp></dt>
6219 <dd><p>Specify that the media is a live stream. No resuming or seeking in
6220 live streams is possible. The default value is <code>any</code>, which means the
6221 subscriber first tries to play the live stream specified in the
6222 playpath. If a live stream of that name is not found, it plays the
6223 recorded stream. The other possible values are <code>live</code> and
6224 <code>recorded</code>.
6225 </p>
6226 </dd>
6227 <dt><samp>rtmp_pageurl</samp></dt>
6228 <dd><p>URL of the web page in which the media was embedded. By default no
6229 value will be sent.
6230 </p>
6231 </dd>
6232 <dt><samp>rtmp_playpath</samp></dt>
6233 <dd><p>Stream identifier to play or to publish. This option overrides the
6234 parameter specified in the URI.
6235 </p>
6236 </dd>
6237 <dt><samp>rtmp_subscribe</samp></dt>
6238 <dd><p>Name of live stream to subscribe to. By default no value will be sent.
6239 It is only sent if the option is specified or if rtmp_live
6240 is set to live.
6241 </p>
6242 </dd>
6243 <dt><samp>rtmp_swfhash</samp></dt>
6244 <dd><p>SHA256 hash of the decompressed SWF file (32 bytes).
6245 </p>
6246 </dd>
6247 <dt><samp>rtmp_swfsize</samp></dt>
6248 <dd><p>Size of the decompressed SWF file, required for SWFVerification.
6249 </p>
6250 </dd>
6251 <dt><samp>rtmp_swfurl</samp></dt>
6252 <dd><p>URL of the SWF player for the media. By default no value will be sent.
6253 </p>
6254 </dd>
6255 <dt><samp>rtmp_swfverify</samp></dt>
6256 <dd><p>URL to player swf file, compute hash/size automatically.
6257 </p>
6258 </dd>
6259 <dt><samp>rtmp_tcurl</samp></dt>
6260 <dd><p>URL of the target stream. Defaults to proto://host[:port]/app.
6261 </p>
6262 </dd>
6263 </dl>
6264
6265 <p>For example to read with <code>ffplay</code> a multimedia resource named
6266 &quot;sample&quot; from the application &quot;vod&quot; from an RTMP server &quot;myserver&quot;:
6267 </p><div class="example">
6268 <pre class="example">ffplay rtmp://myserver/vod/sample
6269 </pre></div>
6270
6271 <p>To publish to a password protected server, passing the playpath and
6272 app names separately:
6273 </p><div class="example">
6274 <pre class="example">ffmpeg -re -i &lt;input&gt; -f flv -rtmp_playpath some/long/path -rtmp_app long/app/name rtmp://username:password@myserver/
6275 </pre></div>
6276
6277 <a name="rtmpe"></a>
6278 <h3 class="section">16.17 rtmpe<span class="pull-right"><a class="anchor hidden-xs" href="#rtmpe" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmpe" aria-hidden="true">TOC</a></span></h3>
6279
6280 <p>Encrypted Real-Time Messaging Protocol.
6281 </p>
6282 <p>The Encrypted Real-Time Messaging Protocol (RTMPE) is used for
6283 streaming multimedia content within standard cryptographic primitives,
6284 consisting of Diffie-Hellman key exchange and HMACSHA256, generating
6285 a pair of RC4 keys.
6286 </p>
6287 <a name="rtmps"></a>
6288 <h3 class="section">16.18 rtmps<span class="pull-right"><a class="anchor hidden-xs" href="#rtmps" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmps" aria-hidden="true">TOC</a></span></h3>
6289
6290 <p>Real-Time Messaging Protocol over a secure SSL connection.
6291 </p>
6292 <p>The Real-Time Messaging Protocol (RTMPS) is used for streaming
6293 multimedia content across an encrypted connection.
6294 </p>
6295 <a name="rtmpt"></a>
6296 <h3 class="section">16.19 rtmpt<span class="pull-right"><a class="anchor hidden-xs" href="#rtmpt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmpt" aria-hidden="true">TOC</a></span></h3>
6297
6298 <p>Real-Time Messaging Protocol tunneled through HTTP.
6299 </p>
6300 <p>The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used
6301 for streaming multimedia content within HTTP requests to traverse
6302 firewalls.
6303 </p>
6304 <a name="rtmpte"></a>
6305 <h3 class="section">16.20 rtmpte<span class="pull-right"><a class="anchor hidden-xs" href="#rtmpte" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmpte" aria-hidden="true">TOC</a></span></h3>
6306
6307 <p>Encrypted Real-Time Messaging Protocol tunneled through HTTP.
6308 </p>
6309 <p>The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE)
6310 is used for streaming multimedia content within HTTP requests to traverse
6311 firewalls.
6312 </p>
6313 <a name="rtmpts"></a>
6314 <h3 class="section">16.21 rtmpts<span class="pull-right"><a class="anchor hidden-xs" href="#rtmpts" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtmpts" aria-hidden="true">TOC</a></span></h3>
6315
6316 <p>Real-Time Messaging Protocol tunneled through HTTPS.
6317 </p>
6318 <p>The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used
6319 for streaming multimedia content within HTTPS requests to traverse
6320 firewalls.
6321 </p>
6322 <a name="libsmbclient"></a>
6323 <h3 class="section">16.22 libsmbclient<span class="pull-right"><a class="anchor hidden-xs" href="#libsmbclient" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libsmbclient" aria-hidden="true">TOC</a></span></h3>
6324
6325 <p>libsmbclient permits one to manipulate CIFS/SMB network resources.
6326 </p>
6327 <p>Following syntax is required.
6328 </p>
6329 <div class="example">
6330 <pre class="example">smb://[[domain:]user[:password@]]server[/share[/path[/file]]]
6331 </pre></div>
6332
6333 <p>This protocol accepts the following options.
6334 </p>
6335 <dl compact="compact">
6336 <dt><samp>timeout</samp></dt>
6337 <dd><p>Set timeout in miliseconds of socket I/O operations used by the underlying
6338 low level operation. By default it is set to -1, which means that the timeout
6339 is not specified.
6340 </p>
6341 </dd>
6342 <dt><samp>truncate</samp></dt>
6343 <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
6344 truncating. Default value is 1.
6345 </p>
6346 </dd>
6347 <dt><samp>workgroup</samp></dt>
6348 <dd><p>Set the workgroup used for making connections. By default workgroup is not specified.
6349 </p>
6350 </dd>
6351 </dl>
6352
6353 <p>For more information see: <a href="http://www.samba.org/">http://www.samba.org/</a>.
6354 </p>
6355 <a name="libssh"></a>
6356 <h3 class="section">16.23 libssh<span class="pull-right"><a class="anchor hidden-xs" href="#libssh" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libssh" aria-hidden="true">TOC</a></span></h3>
6357
6358 <p>Secure File Transfer Protocol via libssh
6359 </p>
6360 <p>Read from or write to remote resources using SFTP protocol.
6361 </p>
6362 <p>Following syntax is required.
6363 </p>
6364 <div class="example">
6365 <pre class="example">sftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
6366 </pre></div>
6367
6368 <p>This protocol accepts the following options.
6369 </p>
6370 <dl compact="compact">
6371 <dt><samp>timeout</samp></dt>
6372 <dd><p>Set timeout of socket I/O operations used by the underlying low level
6373 operation. By default it is set to -1, which means that the timeout
6374 is not specified.
6375 </p>
6376 </dd>
6377 <dt><samp>truncate</samp></dt>
6378 <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
6379 truncating. Default value is 1.
6380 </p>
6381 </dd>
6382 <dt><samp>private_key</samp></dt>
6383 <dd><p>Specify the path of the file containing private key to use during authorization.
6384 By default libssh searches for keys in the <samp>~/.ssh/</samp> directory.
6385 </p>
6386 </dd>
6387 </dl>
6388
6389 <p>Example: Play a file stored on remote server.
6390 </p>
6391 <div class="example">
6392 <pre class="example">ffplay sftp://user:password@server_address:22/home/user/resource.mpeg
6393 </pre></div>
6394
6395 <a name="librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte"></a>
6396 <h3 class="section">16.24 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte<span class="pull-right"><a class="anchor hidden-xs" href="#librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte" aria-hidden="true">TOC</a></span></h3>
6397
6398 <p>Real-Time Messaging Protocol and its variants supported through
6399 librtmp.
6400 </p>
6401 <p>Requires the presence of the librtmp headers and library during
6402 configuration. You need to explicitly configure the build with
6403 &quot;&ndash;enable-librtmp&quot;. If enabled this will replace the native RTMP
6404 protocol.
6405 </p>
6406 <p>This protocol provides most client functions and a few server
6407 functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
6408 encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
6409 variants of these encrypted types (RTMPTE, RTMPTS).
6410 </p>
6411 <p>The required syntax is:
6412 </p><div class="example">
6413 <pre class="example"><var>rtmp_proto</var>://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>] <var>options</var>
6414 </pre></div>
6415
6416 <p>where <var>rtmp_proto</var> is one of the strings &quot;rtmp&quot;, &quot;rtmpt&quot;, &quot;rtmpe&quot;,
6417 &quot;rtmps&quot;, &quot;rtmpte&quot;, &quot;rtmpts&quot; corresponding to each RTMP variant, and
6418 <var>server</var>, <var>port</var>, <var>app</var> and <var>playpath</var> have the same
6419 meaning as specified for the RTMP native protocol.
6420 <var>options</var> contains a list of space-separated options of the form
6421 <var>key</var>=<var>val</var>.
6422 </p>
6423 <p>See the librtmp manual page (man 3 librtmp) for more information.
6424 </p>
6425 <p>For example, to stream a file in real-time to an RTMP server using
6426 <code>ffmpeg</code>:
6427 </p><div class="example">
6428 <pre class="example">ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
6429 </pre></div>
6430
6431 <p>To play the same stream using <code>ffplay</code>:
6432 </p><div class="example">
6433 <pre class="example">ffplay &quot;rtmp://myserver/live/mystream live=1&quot;
6434 </pre></div>
6435
6436 <a name="rtp"></a>
6437 <h3 class="section">16.25 rtp<span class="pull-right"><a class="anchor hidden-xs" href="#rtp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtp" aria-hidden="true">TOC</a></span></h3>
6438
6439 <p>Real-time Transport Protocol.
6440 </p>
6441 <p>The required syntax for an RTP URL is:
6442 rtp://<var>hostname</var>[:<var>port</var>][?<var>option</var>=<var>val</var>...]
6443 </p>
6444 <p><var>port</var> specifies the RTP port to use.
6445 </p>
6446 <p>The following URL options are supported:
6447 </p>
6448 <dl compact="compact">
6449 <dt><samp>ttl=<var>n</var></samp></dt>
6450 <dd><p>Set the TTL (Time-To-Live) value (for multicast only).
6451 </p>
6452 </dd>
6453 <dt><samp>rtcpport=<var>n</var></samp></dt>
6454 <dd><p>Set the remote RTCP port to <var>n</var>.
6455 </p>
6456 </dd>
6457 <dt><samp>localrtpport=<var>n</var></samp></dt>
6458 <dd><p>Set the local RTP port to <var>n</var>.
6459 </p>
6460 </dd>
6461 <dt><samp>localrtcpport=<var>n</var>'</samp></dt>
6462 <dd><p>Set the local RTCP port to <var>n</var>.
6463 </p>
6464 </dd>
6465 <dt><samp>pkt_size=<var>n</var></samp></dt>
6466 <dd><p>Set max packet size (in bytes) to <var>n</var>.
6467 </p>
6468 </dd>
6469 <dt><samp>connect=0|1</samp></dt>
6470 <dd><p>Do a <code>connect()</code> on the UDP socket (if set to 1) or not (if set
6471 to 0).
6472 </p>
6473 </dd>
6474 <dt><samp>sources=<var>ip</var>[,<var>ip</var>]</samp></dt>
6475 <dd><p>List allowed source IP addresses.
6476 </p>
6477 </dd>
6478 <dt><samp>block=<var>ip</var>[,<var>ip</var>]</samp></dt>
6479 <dd><p>List disallowed (blocked) source IP addresses.
6480 </p>
6481 </dd>
6482 <dt><samp>write_to_source=0|1</samp></dt>
6483 <dd><p>Send packets to the source address of the latest received packet (if
6484 set to 1) or to a default remote address (if set to 0).
6485 </p>
6486 </dd>
6487 <dt><samp>localport=<var>n</var></samp></dt>
6488 <dd><p>Set the local RTP port to <var>n</var>.
6489 </p>
6490 <p>This is a deprecated option. Instead, <samp>localrtpport</samp> should be
6491 used.
6492 </p>
6493 </dd>
6494 </dl>
6495
6496 <p>Important notes:
6497 </p>
6498 <ol>
6499 <li> If <samp>rtcpport</samp> is not set the RTCP port will be set to the RTP
6500 port value plus 1.
6501
6502 </li><li> If <samp>localrtpport</samp> (the local RTP port) is not set any available
6503 port will be used for the local RTP and RTCP ports.
6504
6505 </li><li> If <samp>localrtcpport</samp> (the local RTCP port) is not set it will be
6506 set to the local RTP port value plus 1.
6507 </li></ol>
6508
6509 <a name="rtsp"></a>
6510 <h3 class="section">16.26 rtsp<span class="pull-right"><a class="anchor hidden-xs" href="#rtsp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rtsp" aria-hidden="true">TOC</a></span></h3>
6511
6512 <p>Real-Time Streaming Protocol.
6513 </p>
6514 <p>RTSP is not technically a protocol handler in libavformat, it is a demuxer
6515 and muxer. The demuxer supports both normal RTSP (with data transferred
6516 over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
6517 data transferred over RDT).
6518 </p>
6519 <p>The muxer can be used to send a stream using RTSP ANNOUNCE to a server
6520 supporting it (currently Darwin Streaming Server and Mischa Spiegelmock&rsquo;s
6521 <a href="https://github.com/revmischa/rtsp-server">RTSP server</a>).
6522 </p>
6523 <p>The required syntax for a RTSP url is:
6524 </p><div class="example">
6525 <pre class="example">rtsp://<var>hostname</var>[:<var>port</var>]/<var>path</var>
6526 </pre></div>
6527
6528 <p>Options can be set on the <code>ffmpeg</code>/<code>ffplay</code> command
6529 line, or set in code via <code>AVOption</code>s or in
6530 <code>avformat_open_input</code>.
6531 </p>
6532 <p>The following options are supported.
6533 </p>
6534 <dl compact="compact">
6535 <dt><samp>initial_pause</samp></dt>
6536 <dd><p>Do not start playing the stream immediately if set to 1. Default value
6537 is 0.
6538 </p>
6539 </dd>
6540 <dt><samp>rtsp_transport</samp></dt>
6541 <dd><p>Set RTSP transport protocols.
6542 </p>
6543 <p>It accepts the following values:
6544 </p><dl compact="compact">
6545 <dt>&lsquo;<samp>udp</samp>&rsquo;</dt>
6546 <dd><p>Use UDP as lower transport protocol.
6547 </p>
6548 </dd>
6549 <dt>&lsquo;<samp>tcp</samp>&rsquo;</dt>
6550 <dd><p>Use TCP (interleaving within the RTSP control channel) as lower
6551 transport protocol.
6552 </p>
6553 </dd>
6554 <dt>&lsquo;<samp>udp_multicast</samp>&rsquo;</dt>
6555 <dd><p>Use UDP multicast as lower transport protocol.
6556 </p>
6557 </dd>
6558 <dt>&lsquo;<samp>http</samp>&rsquo;</dt>
6559 <dd><p>Use HTTP tunneling as lower transport protocol, which is useful for
6560 passing proxies.
6561 </p></dd>
6562 </dl>
6563
6564 <p>Multiple lower transport protocols may be specified, in that case they are
6565 tried one at a time (if the setup of one fails, the next one is tried).
6566 For the muxer, only the &lsquo;<samp>tcp</samp>&rsquo; and &lsquo;<samp>udp</samp>&rsquo; options are supported.
6567 </p>
6568 </dd>
6569 <dt><samp>rtsp_flags</samp></dt>
6570 <dd><p>Set RTSP flags.
6571 </p>
6572 <p>The following values are accepted:
6573 </p><dl compact="compact">
6574 <dt>&lsquo;<samp>filter_src</samp>&rsquo;</dt>
6575 <dd><p>Accept packets only from negotiated peer address and port.
6576 </p></dd>
6577 <dt>&lsquo;<samp>listen</samp>&rsquo;</dt>
6578 <dd><p>Act as a server, listening for an incoming connection.
6579 </p></dd>
6580 <dt>&lsquo;<samp>prefer_tcp</samp>&rsquo;</dt>
6581 <dd><p>Try TCP for RTP transport first, if TCP is available as RTSP RTP transport.
6582 </p></dd>
6583 </dl>
6584
6585 <p>Default value is &lsquo;<samp>none</samp>&rsquo;.
6586 </p>
6587 </dd>
6588 <dt><samp>allowed_media_types</samp></dt>
6589 <dd><p>Set media types to accept from the server.
6590 </p>
6591 <p>The following flags are accepted:
6592 </p><dl compact="compact">
6593 <dt>&lsquo;<samp>video</samp>&rsquo;</dt>
6594 <dt>&lsquo;<samp>audio</samp>&rsquo;</dt>
6595 <dt>&lsquo;<samp>data</samp>&rsquo;</dt>
6596 </dl>
6597
6598 <p>By default it accepts all media types.
6599 </p>
6600 </dd>
6601 <dt><samp>min_port</samp></dt>
6602 <dd><p>Set minimum local UDP port. Default value is 5000.
6603 </p>
6604 </dd>
6605 <dt><samp>max_port</samp></dt>
6606 <dd><p>Set maximum local UDP port. Default value is 65000.
6607 </p>
6608 </dd>
6609 <dt><samp>timeout</samp></dt>
6610 <dd><p>Set maximum timeout (in seconds) to wait for incoming connections.
6611 </p>
6612 <p>A value of -1 means infinite (default). This option implies the
6613 <samp>rtsp_flags</samp> set to &lsquo;<samp>listen</samp>&rsquo;.
6614 </p>
6615 </dd>
6616 <dt><samp>reorder_queue_size</samp></dt>
6617 <dd><p>Set number of packets to buffer for handling of reordered packets.
6618 </p>
6619 </dd>
6620 <dt><samp>stimeout</samp></dt>
6621 <dd><p>Set socket TCP I/O timeout in microseconds.
6622 </p>
6623 </dd>
6624 <dt><samp>user-agent</samp></dt>
6625 <dd><p>Override User-Agent header. If not specified, it defaults to the
6626 libavformat identifier string.
6627 </p></dd>
6628 </dl>
6629
6630 <p>When receiving data over UDP, the demuxer tries to reorder received packets
6631 (since they may arrive out of order, or packets may get lost totally). This
6632 can be disabled by setting the maximum demuxing delay to zero (via
6633 the <code>max_delay</code> field of AVFormatContext).
6634 </p>
6635 <p>When watching multi-bitrate Real-RTSP streams with <code>ffplay</code>, the
6636 streams to display can be chosen with <code>-vst</code> <var>n</var> and
6637 <code>-ast</code> <var>n</var> for video and audio respectively, and can be switched
6638 on the fly by pressing <code>v</code> and <code>a</code>.
6639 </p>
6640 <a name="Examples-3"></a>
6641 <h4 class="subsection">16.26.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-3" aria-hidden="true">TOC</a></span></h4>
6642
6643 <p>The following examples all make use of the <code>ffplay</code> and
6644 <code>ffmpeg</code> tools.
6645 </p>
6646 <ul>
6647 <li> Watch a stream over UDP, with a max reordering delay of 0.5 seconds:
6648 <div class="example">
6649 <pre class="example">ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
6650 </pre></div>
6651
6652 </li><li> Watch a stream tunneled over HTTP:
6653 <div class="example">
6654 <pre class="example">ffplay -rtsp_transport http rtsp://server/video.mp4
6655 </pre></div>
6656
6657 </li><li> Send a stream in realtime to a RTSP server, for others to watch:
6658 <div class="example">
6659 <pre class="example">ffmpeg -re -i <var>input</var> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
6660 </pre></div>
6661
6662 </li><li> Receive a stream in realtime:
6663 <div class="example">
6664 <pre class="example">ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp <var>output</var>
6665 </pre></div>
6666 </li></ul>
6667
6668 <a name="sap"></a>
6669 <h3 class="section">16.27 sap<span class="pull-right"><a class="anchor hidden-xs" href="#sap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sap" aria-hidden="true">TOC</a></span></h3>
6670
6671 <p>Session Announcement Protocol (RFC 2974). This is not technically a
6672 protocol handler in libavformat, it is a muxer and demuxer.
6673 It is used for signalling of RTP streams, by announcing the SDP for the
6674 streams regularly on a separate port.
6675 </p>
6676 <a name="Muxer"></a>
6677 <h4 class="subsection">16.27.1 Muxer<span class="pull-right"><a class="anchor hidden-xs" href="#Muxer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Muxer" aria-hidden="true">TOC</a></span></h4>
6678
6679 <p>The syntax for a SAP url given to the muxer is:
6680 </p><div class="example">
6681 <pre class="example">sap://<var>destination</var>[:<var>port</var>][?<var>options</var>]
6682 </pre></div>
6683
6684 <p>The RTP packets are sent to <var>destination</var> on port <var>port</var>,
6685 or to port 5004 if no port is specified.
6686 <var>options</var> is a <code>&amp;</code>-separated list. The following options
6687 are supported:
6688 </p>
6689 <dl compact="compact">
6690 <dt><samp>announce_addr=<var>address</var></samp></dt>
6691 <dd><p>Specify the destination IP address for sending the announcements to.
6692 If omitted, the announcements are sent to the commonly used SAP
6693 announcement multicast address 224.2.127.254 (sap.mcast.net), or
6694 ff0e::2:7ffe if <var>destination</var> is an IPv6 address.
6695 </p>
6696 </dd>
6697 <dt><samp>announce_port=<var>port</var></samp></dt>
6698 <dd><p>Specify the port to send the announcements on, defaults to
6699 9875 if not specified.
6700 </p>
6701 </dd>
6702 <dt><samp>ttl=<var>ttl</var></samp></dt>
6703 <dd><p>Specify the time to live value for the announcements and RTP packets,
6704 defaults to 255.
6705 </p>
6706 </dd>
6707 <dt><samp>same_port=<var>0|1</var></samp></dt>
6708 <dd><p>If set to 1, send all RTP streams on the same port pair. If zero (the
6709 default), all streams are sent on unique ports, with each stream on a
6710 port 2 numbers higher than the previous.
6711 VLC/Live555 requires this to be set to 1, to be able to receive the stream.
6712 The RTP stack in libavformat for receiving requires all streams to be sent
6713 on unique ports.
6714 </p></dd>
6715 </dl>
6716
6717 <p>Example command lines follow.
6718 </p>
6719 <p>To broadcast a stream on the local subnet, for watching in VLC:
6720 </p>
6721 <div class="example">
6722 <pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255?same_port=1
6723 </pre></div>
6724
6725 <p>Similarly, for watching in <code>ffplay</code>:
6726 </p>
6727 <div class="example">
6728 <pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255
6729 </pre></div>
6730
6731 <p>And for watching in <code>ffplay</code>, over IPv6:
6732 </p>
6733 <div class="example">
6734 <pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://[ff0e::1:2:3:4]
6735 </pre></div>
6736
6737 <a name="Demuxer"></a>
6738 <h4 class="subsection">16.27.2 Demuxer<span class="pull-right"><a class="anchor hidden-xs" href="#Demuxer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Demuxer" aria-hidden="true">TOC</a></span></h4>
6739
6740 <p>The syntax for a SAP url given to the demuxer is:
6741 </p><div class="example">
6742 <pre class="example">sap://[<var>address</var>][:<var>port</var>]
6743 </pre></div>
6744
6745 <p><var>address</var> is the multicast address to listen for announcements on,
6746 if omitted, the default 224.2.127.254 (sap.mcast.net) is used. <var>port</var>
6747 is the port that is listened on, 9875 if omitted.
6748 </p>
6749 <p>The demuxers listens for announcements on the given address and port.
6750 Once an announcement is received, it tries to receive that particular stream.
6751 </p>
6752 <p>Example command lines follow.
6753 </p>
6754 <p>To play back the first stream announced on the normal SAP multicast address:
6755 </p>
6756 <div class="example">
6757 <pre class="example">ffplay sap://
6758 </pre></div>
6759
6760 <p>To play back the first stream announced on one the default IPv6 SAP multicast address:
6761 </p>
6762 <div class="example">
6763 <pre class="example">ffplay sap://[ff0e::2:7ffe]
6764 </pre></div>
6765
6766 <a name="sctp"></a>
6767 <h3 class="section">16.28 sctp<span class="pull-right"><a class="anchor hidden-xs" href="#sctp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sctp" aria-hidden="true">TOC</a></span></h3>
6768
6769 <p>Stream Control Transmission Protocol.
6770 </p>
6771 <p>The accepted URL syntax is:
6772 </p><div class="example">
6773 <pre class="example">sctp://<var>host</var>:<var>port</var>[?<var>options</var>]
6774 </pre></div>
6775
6776 <p>The protocol accepts the following options:
6777 </p><dl compact="compact">
6778 <dt><samp>listen</samp></dt>
6779 <dd><p>If set to any value, listen for an incoming connection. Outgoing connection is done by default.
6780 </p>
6781 </dd>
6782 <dt><samp>max_streams</samp></dt>
6783 <dd><p>Set the maximum number of streams. By default no limit is set.
6784 </p></dd>
6785 </dl>
6786
6787 <a name="srtp"></a>
6788 <h3 class="section">16.29 srtp<span class="pull-right"><a class="anchor hidden-xs" href="#srtp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-srtp" aria-hidden="true">TOC</a></span></h3>
6789
6790 <p>Secure Real-time Transport Protocol.
6791 </p>
6792 <p>The accepted options are:
6793 </p><dl compact="compact">
6794 <dt><samp>srtp_in_suite</samp></dt>
6795 <dt><samp>srtp_out_suite</samp></dt>
6796 <dd><p>Select input and output encoding suites.
6797 </p>
6798 <p>Supported values:
6799 </p><dl compact="compact">
6800 <dt>&lsquo;<samp>AES_CM_128_HMAC_SHA1_80</samp>&rsquo;</dt>
6801 <dt>&lsquo;<samp>SRTP_AES128_CM_HMAC_SHA1_80</samp>&rsquo;</dt>
6802 <dt>&lsquo;<samp>AES_CM_128_HMAC_SHA1_32</samp>&rsquo;</dt>
6803 <dt>&lsquo;<samp>SRTP_AES128_CM_HMAC_SHA1_32</samp>&rsquo;</dt>
6804 </dl>
6805
6806 </dd>
6807 <dt><samp>srtp_in_params</samp></dt>
6808 <dt><samp>srtp_out_params</samp></dt>
6809 <dd><p>Set input and output encoding parameters, which are expressed by a
6810 base64-encoded representation of a binary block. The first 16 bytes of
6811 this binary block are used as master key, the following 14 bytes are
6812 used as master salt.
6813 </p></dd>
6814 </dl>
6815
6816 <a name="subfile"></a>
6817 <h3 class="section">16.30 subfile<span class="pull-right"><a class="anchor hidden-xs" href="#subfile" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-subfile" aria-hidden="true">TOC</a></span></h3>
6818
6819 <p>Virtually extract a segment of a file or another stream.
6820 The underlying stream must be seekable.
6821 </p>
6822 <p>Accepted options:
6823 </p><dl compact="compact">
6824 <dt><samp>start</samp></dt>
6825 <dd><p>Start offset of the extracted segment, in bytes.
6826 </p></dd>
6827 <dt><samp>end</samp></dt>
6828 <dd><p>End offset of the extracted segment, in bytes.
6829 </p></dd>
6830 </dl>
6831
6832 <p>Examples:
6833 </p>
6834 <p>Extract a chapter from a DVD VOB file (start and end sectors obtained
6835 externally and multiplied by 2048):
6836 </p><div class="example">
6837 <pre class="example">subfile,,start,153391104,end,268142592,,:/media/dvd/VIDEO_TS/VTS_08_1.VOB
6838 </pre></div>
6839
6840 <p>Play an AVI file directly from a TAR archive:
6841 </p><div class="example">
6842 <pre class="example">subfile,,start,183241728,end,366490624,,:archive.tar
6843 </pre></div>
6844
6845 <a name="tcp"></a>
6846 <h3 class="section">16.31 tcp<span class="pull-right"><a class="anchor hidden-xs" href="#tcp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tcp" aria-hidden="true">TOC</a></span></h3>
6847
6848 <p>Transmission Control Protocol.
6849 </p>
6850 <p>The required syntax for a TCP url is:
6851 </p><div class="example">
6852 <pre class="example">tcp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
6853 </pre></div>
6854
6855 <p><var>options</var> contains a list of &amp;-separated options of the form
6856 <var>key</var>=<var>val</var>.
6857 </p>
6858 <p>The list of supported options follows.
6859 </p>
6860 <dl compact="compact">
6861 <dt><samp>listen=<var>1|0</var></samp></dt>
6862 <dd><p>Listen for an incoming connection. Default value is 0.
6863 </p>
6864 </dd>
6865 <dt><samp>timeout=<var>microseconds</var></samp></dt>
6866 <dd><p>Set raise error timeout, expressed in microseconds.
6867 </p>
6868 <p>This option is only relevant in read mode: if no data arrived in more
6869 than this time interval, raise error.
6870 </p>
6871 </dd>
6872 <dt><samp>listen_timeout=<var>milliseconds</var></samp></dt>
6873 <dd><p>Set listen timeout, expressed in milliseconds.
6874 </p></dd>
6875 </dl>
6876
6877 <p>The following example shows how to setup a listening TCP connection
6878 with <code>ffmpeg</code>, which is then accessed with <code>ffplay</code>:
6879 </p><div class="example">
6880 <pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> tcp://<var>hostname</var>:<var>port</var>?listen
6881 ffplay tcp://<var>hostname</var>:<var>port</var>
6882 </pre></div>
6883
6884 <a name="tls"></a>
6885 <h3 class="section">16.32 tls<span class="pull-right"><a class="anchor hidden-xs" href="#tls" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tls" aria-hidden="true">TOC</a></span></h3>
6886
6887 <p>Transport Layer Security (TLS) / Secure Sockets Layer (SSL)
6888 </p>
6889 <p>The required syntax for a TLS/SSL url is:
6890 </p><div class="example">
6891 <pre class="example">tls://<var>hostname</var>:<var>port</var>[?<var>options</var>]
6892 </pre></div>
6893
6894 <p>The following parameters can be set via command line options
6895 (or in code via <code>AVOption</code>s):
6896 </p>
6897 <dl compact="compact">
6898 <dt><samp>ca_file, cafile=<var>filename</var></samp></dt>
6899 <dd><p>A file containing certificate authority (CA) root certificates to treat
6900 as trusted. If the linked TLS library contains a default this might not
6901 need to be specified for verification to work, but not all libraries and
6902 setups have defaults built in.
6903 The file must be in OpenSSL PEM format.
6904 </p>
6905 </dd>
6906 <dt><samp>tls_verify=<var>1|0</var></samp></dt>
6907 <dd><p>If enabled, try to verify the peer that we are communicating with.
6908 Note, if using OpenSSL, this currently only makes sure that the
6909 peer certificate is signed by one of the root certificates in the CA
6910 database, but it does not validate that the certificate actually
6911 matches the host name we are trying to connect to. (With GnuTLS,
6912 the host name is validated as well.)
6913 </p>
6914 <p>This is disabled by default since it requires a CA database to be
6915 provided by the caller in many cases.
6916 </p>
6917 </dd>
6918 <dt><samp>cert_file, cert=<var>filename</var></samp></dt>
6919 <dd><p>A file containing a certificate to use in the handshake with the peer.
6920 (When operating as server, in listen mode, this is more often required
6921 by the peer, while client certificates only are mandated in certain
6922 setups.)
6923 </p>
6924 </dd>
6925 <dt><samp>key_file, key=<var>filename</var></samp></dt>
6926 <dd><p>A file containing the private key for the certificate.
6927 </p>
6928 </dd>
6929 <dt><samp>listen=<var>1|0</var></samp></dt>
6930 <dd><p>If enabled, listen for connections on the provided port, and assume
6931 the server role in the handshake instead of the client role.
6932 </p>
6933 </dd>
6934 </dl>
6935
6936 <p>Example command lines:
6937 </p>
6938 <p>To create a TLS/SSL server that serves an input stream.
6939 </p>
6940 <div class="example">
6941 <pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> tls://<var>hostname</var>:<var>port</var>?listen&amp;cert=<var>server.crt</var>&amp;key=<var>server.key</var>
6942 </pre></div>
6943
6944 <p>To play back a stream from the TLS/SSL server using <code>ffplay</code>:
6945 </p>
6946 <div class="example">
6947 <pre class="example">ffplay tls://<var>hostname</var>:<var>port</var>
6948 </pre></div>
6949
6950 <a name="udp"></a>
6951 <h3 class="section">16.33 udp<span class="pull-right"><a class="anchor hidden-xs" href="#udp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-udp" aria-hidden="true">TOC</a></span></h3>
6952
6953 <p>User Datagram Protocol.
6954 </p>
6955 <p>The required syntax for an UDP URL is:
6956 </p><div class="example">
6957 <pre class="example">udp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
6958 </pre></div>
6959
6960 <p><var>options</var> contains a list of &amp;-separated options of the form <var>key</var>=<var>val</var>.
6961 </p>
6962 <p>In case threading is enabled on the system, a circular buffer is used
6963 to store the incoming data, which allows one to reduce loss of data due to
6964 UDP socket buffer overruns. The <var>fifo_size</var> and
6965 <var>overrun_nonfatal</var> options are related to this buffer.
6966 </p>
6967 <p>The list of supported options follows.
6968 </p>
6969 <dl compact="compact">
6970 <dt><samp>buffer_size=<var>size</var></samp></dt>
6971 <dd><p>Set the UDP maximum socket buffer size in bytes. This is used to set either
6972 the receive or send buffer size, depending on what the socket is used for.
6973 Default is 64KB.  See also <var>fifo_size</var>.
6974 </p>
6975 </dd>
6976 <dt><samp>localport=<var>port</var></samp></dt>
6977 <dd><p>Override the local UDP port to bind with.
6978 </p>
6979 </dd>
6980 <dt><samp>localaddr=<var>addr</var></samp></dt>
6981 <dd><p>Choose the local IP address. This is useful e.g. if sending multicast
6982 and the host has multiple interfaces, where the user can choose
6983 which interface to send on by specifying the IP address of that interface.
6984 </p>
6985 </dd>
6986 <dt><samp>pkt_size=<var>size</var></samp></dt>
6987 <dd><p>Set the size in bytes of UDP packets.
6988 </p>
6989 </dd>
6990 <dt><samp>reuse=<var>1|0</var></samp></dt>
6991 <dd><p>Explicitly allow or disallow reusing UDP sockets.
6992 </p>
6993 </dd>
6994 <dt><samp>ttl=<var>ttl</var></samp></dt>
6995 <dd><p>Set the time to live value (for multicast only).
6996 </p>
6997 </dd>
6998 <dt><samp>connect=<var>1|0</var></samp></dt>
6999 <dd><p>Initialize the UDP socket with <code>connect()</code>. In this case, the
7000 destination address can&rsquo;t be changed with ff_udp_set_remote_url later.
7001 If the destination address isn&rsquo;t known at the start, this option can
7002 be specified in ff_udp_set_remote_url, too.
7003 This allows finding out the source address for the packets with getsockname,
7004 and makes writes return with AVERROR(ECONNREFUSED) if &quot;destination
7005 unreachable&quot; is received.
7006 For receiving, this gives the benefit of only receiving packets from
7007 the specified peer address/port.
7008 </p>
7009 </dd>
7010 <dt><samp>sources=<var>address</var>[,<var>address</var>]</samp></dt>
7011 <dd><p>Only receive packets sent to the multicast group from one of the
7012 specified sender IP addresses.
7013 </p>
7014 </dd>
7015 <dt><samp>block=<var>address</var>[,<var>address</var>]</samp></dt>
7016 <dd><p>Ignore packets sent to the multicast group from the specified
7017 sender IP addresses.
7018 </p>
7019 </dd>
7020 <dt><samp>fifo_size=<var>units</var></samp></dt>
7021 <dd><p>Set the UDP receiving circular buffer size, expressed as a number of
7022 packets with size of 188 bytes. If not specified defaults to 7*4096.
7023 </p>
7024 </dd>
7025 <dt><samp>overrun_nonfatal=<var>1|0</var></samp></dt>
7026 <dd><p>Survive in case of UDP receiving circular buffer overrun. Default
7027 value is 0.
7028 </p>
7029 </dd>
7030 <dt><samp>timeout=<var>microseconds</var></samp></dt>
7031 <dd><p>Set raise error timeout, expressed in microseconds.
7032 </p>
7033 <p>This option is only relevant in read mode: if no data arrived in more
7034 than this time interval, raise error.
7035 </p>
7036 </dd>
7037 <dt><samp>broadcast=<var>1|0</var></samp></dt>
7038 <dd><p>Explicitly allow or disallow UDP broadcasting.
7039 </p>
7040 <p>Note that broadcasting may not work properly on networks having
7041 a broadcast storm protection.
7042 </p></dd>
7043 </dl>
7044
7045 <a name="Examples-4"></a>
7046 <h4 class="subsection">16.33.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-4" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-4" aria-hidden="true">TOC</a></span></h4>
7047
7048 <ul>
7049 <li> Use <code>ffmpeg</code> to stream over UDP to a remote endpoint:
7050 <div class="example">
7051 <pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> udp://<var>hostname</var>:<var>port</var>
7052 </pre></div>
7053
7054 </li><li> Use <code>ffmpeg</code> to stream in mpegts format over UDP using 188
7055 sized UDP packets, using a large input buffer:
7056 <div class="example">
7057 <pre class="example">ffmpeg -i <var>input</var> -f mpegts udp://<var>hostname</var>:<var>port</var>?pkt_size=188&amp;buffer_size=65535
7058 </pre></div>
7059
7060 </li><li> Use <code>ffmpeg</code> to receive over UDP from a remote endpoint:
7061 <div class="example">
7062 <pre class="example">ffmpeg -i udp://[<var>multicast-address</var>]:<var>port</var> ...
7063 </pre></div>
7064 </li></ul>
7065
7066 <a name="unix"></a>
7067 <h3 class="section">16.34 unix<span class="pull-right"><a class="anchor hidden-xs" href="#unix" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-unix" aria-hidden="true">TOC</a></span></h3>
7068
7069 <p>Unix local socket
7070 </p>
7071 <p>The required syntax for a Unix socket URL is:
7072 </p>
7073 <div class="example">
7074 <pre class="example">unix://<var>filepath</var>
7075 </pre></div>
7076
7077 <p>The following parameters can be set via command line options
7078 (or in code via <code>AVOption</code>s):
7079 </p>
7080 <dl compact="compact">
7081 <dt><samp>timeout</samp></dt>
7082 <dd><p>Timeout in ms.
7083 </p></dd>
7084 <dt><samp>listen</samp></dt>
7085 <dd><p>Create the Unix socket in listening mode.
7086 </p></dd>
7087 </dl>
7088
7089 <a name="Device-Options"></a>
7090 <h2 class="chapter">17 Device Options<span class="pull-right"><a class="anchor hidden-xs" href="#Device-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Device-Options" aria-hidden="true">TOC</a></span></h2>
7091
7092 <p>The libavdevice library provides the same interface as
7093 libavformat. Namely, an input device is considered like a demuxer, and
7094 an output device like a muxer, and the interface and generic device
7095 options are the same provided by libavformat (see the ffmpeg-formats
7096 manual).
7097 </p>
7098 <p>In addition each input or output device may support so-called private
7099 options, which are specific for that component.
7100 </p>
7101 <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
7102 FFmpeg tools, or by setting the value explicitly in the device
7103 <code>AVFormatContext</code> options or using the <samp>libavutil/opt.h</samp> API
7104 for programmatic use.
7105 </p>
7106
7107 <a name="Input-Devices"></a>
7108 <h2 class="chapter">18 Input Devices<span class="pull-right"><a class="anchor hidden-xs" href="#Input-Devices" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Input-Devices" aria-hidden="true">TOC</a></span></h2>
7109
7110 <p>Input devices are configured elements in FFmpeg which enable accessing
7111 the data coming from a multimedia device attached to your system.
7112 </p>
7113 <p>When you configure your FFmpeg build, all the supported input devices
7114 are enabled by default. You can list all available ones using the
7115 configure option &quot;&ndash;list-indevs&quot;.
7116 </p>
7117 <p>You can disable all the input devices using the configure option
7118 &quot;&ndash;disable-indevs&quot;, and selectively enable an input device using the
7119 option &quot;&ndash;enable-indev=<var>INDEV</var>&quot;, or you can disable a particular
7120 input device using the option &quot;&ndash;disable-indev=<var>INDEV</var>&quot;.
7121 </p>
7122 <p>The option &quot;-devices&quot; of the ff* tools will display the list of
7123 supported input devices.
7124 </p>
7125 <p>A description of the currently available input devices follows.
7126 </p>
7127 <a name="alsa"></a>
7128 <h3 class="section">18.1 alsa<span class="pull-right"><a class="anchor hidden-xs" href="#alsa" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-alsa" aria-hidden="true">TOC</a></span></h3>
7129
7130 <p>ALSA (Advanced Linux Sound Architecture) input device.
7131 </p>
7132 <p>To enable this input device during configuration you need libasound
7133 installed on your system.
7134 </p>
7135 <p>This device allows capturing from an ALSA device. The name of the
7136 device to capture has to be an ALSA card identifier.
7137 </p>
7138 <p>An ALSA identifier has the syntax:
7139 </p><div class="example">
7140 <pre class="example">hw:<var>CARD</var>[,<var>DEV</var>[,<var>SUBDEV</var>]]
7141 </pre></div>
7142
7143 <p>where the <var>DEV</var> and <var>SUBDEV</var> components are optional.
7144 </p>
7145 <p>The three arguments (in order: <var>CARD</var>,<var>DEV</var>,<var>SUBDEV</var>)
7146 specify card number or identifier, device number and subdevice number
7147 (-1 means any).
7148 </p>
7149 <p>To see the list of cards currently recognized by your system check the
7150 files <samp>/proc/asound/cards</samp> and <samp>/proc/asound/devices</samp>.
7151 </p>
7152 <p>For example to capture with <code>ffmpeg</code> from an ALSA device with
7153 card id 0, you may run the command:
7154 </p><div class="example">
7155 <pre class="example">ffmpeg -f alsa -i hw:0 alsaout.wav
7156 </pre></div>
7157
7158 <p>For more information see:
7159 <a href="http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html">http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html</a>
7160 </p>
7161 <a name="avfoundation"></a>
7162 <h3 class="section">18.2 avfoundation<span class="pull-right"><a class="anchor hidden-xs" href="#avfoundation" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avfoundation" aria-hidden="true">TOC</a></span></h3>
7163
7164 <p>AVFoundation input device.
7165 </p>
7166 <p>AVFoundation is the currently recommended framework by Apple for streamgrabbing on OSX &gt;= 10.7 as well as on iOS.
7167 The older QTKit framework has been marked deprecated since OSX version 10.7.
7168 </p>
7169 <p>The input filename has to be given in the following syntax:
7170 </p><div class="example">
7171 <pre class="example">-i &quot;[[VIDEO]:[AUDIO]]&quot;
7172 </pre></div>
7173 <p>The first entry selects the video input while the latter selects the audio input.
7174 The stream has to be specified by the device name or the device index as shown by the device list.
7175 Alternatively, the video and/or audio input device can be chosen by index using the
7176 <samp>
7177     -video_device_index &lt;INDEX&gt;
7178 </samp>
7179 and/or
7180 <samp>
7181     -audio_device_index &lt;INDEX&gt;
7182 </samp>
7183 , overriding any
7184 device name or index given in the input filename.
7185 </p>
7186 <p>All available devices can be enumerated by using <samp>-list_devices true</samp>, listing
7187 all device names and corresponding indices.
7188 </p>
7189 <p>There are two device name aliases:
7190 </p><dl compact="compact">
7191 <dt><code>default</code></dt>
7192 <dd><p>Select the AVFoundation default device of the corresponding type.
7193 </p>
7194 </dd>
7195 <dt><code>none</code></dt>
7196 <dd><p>Do not record the corresponding media type.
7197 This is equivalent to specifying an empty device name or index.
7198 </p>
7199 </dd>
7200 </dl>
7201
7202 <a name="Options-6"></a>
7203 <h4 class="subsection">18.2.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-6" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-6" aria-hidden="true">TOC</a></span></h4>
7204
7205 <p>AVFoundation supports the following options:
7206 </p>
7207 <dl compact="compact">
7208 <dt><samp>-list_devices &lt;TRUE|FALSE&gt;</samp></dt>
7209 <dd><p>If set to true, a list of all available input devices is given showing all
7210 device names and indices.
7211 </p>
7212 </dd>
7213 <dt><samp>-video_device_index &lt;INDEX&gt;</samp></dt>
7214 <dd><p>Specify the video device by its index. Overrides anything given in the input filename.
7215 </p>
7216 </dd>
7217 <dt><samp>-audio_device_index &lt;INDEX&gt;</samp></dt>
7218 <dd><p>Specify the audio device by its index. Overrides anything given in the input filename.
7219 </p>
7220 </dd>
7221 <dt><samp>-pixel_format &lt;FORMAT&gt;</samp></dt>
7222 <dd><p>Request the video device to use a specific pixel format.
7223 If the specified format is not supported, a list of available formats is given
7224 und the first one in this list is used instead. Available pixel formats are:
7225 <code>monob, rgb555be, rgb555le, rgb565be, rgb565le, rgb24, bgr24, 0rgb, bgr0, 0bgr, rgb0,
7226  bgr48be, uyvy422, yuva444p, yuva444p16le, yuv444p, yuv422p16, yuv422p10, yuv444p10,
7227  yuv420p, nv12, yuyv422, gray</code>
7228 </p>
7229 </dd>
7230 </dl>
7231
7232 <a name="Examples-5"></a>
7233 <h4 class="subsection">18.2.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-5" aria-hidden="true">TOC</a></span></h4>
7234
7235 <ul>
7236 <li> Print the list of AVFoundation supported devices and exit:
7237 <div class="example">
7238 <pre class="example">$ ffmpeg -f avfoundation -list_devices true -i &quot;&quot;
7239 </pre></div>
7240
7241 </li><li> Record video from video device 0 and audio from audio device 0 into out.avi:
7242 <div class="example">
7243 <pre class="example">$ ffmpeg -f avfoundation -i &quot;0:0&quot; out.avi
7244 </pre></div>
7245
7246 </li><li> Record video from video device 2 and audio from audio device 1 into out.avi:
7247 <div class="example">
7248 <pre class="example">$ ffmpeg -f avfoundation -video_device_index 2 -i &quot;:1&quot; out.avi
7249 </pre></div>
7250
7251 </li><li> Record video from the system default video device using the pixel format bgr0 and do not record any audio into out.avi:
7252 <div class="example">
7253 <pre class="example">$ ffmpeg -f avfoundation -pixel_format bgr0 -i &quot;default:none&quot; out.avi
7254 </pre></div>
7255
7256 </li></ul>
7257
7258 <a name="bktr"></a>
7259 <h3 class="section">18.3 bktr<span class="pull-right"><a class="anchor hidden-xs" href="#bktr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bktr" aria-hidden="true">TOC</a></span></h3>
7260
7261 <p>BSD video input device.
7262 </p>
7263 <a name="decklink"></a>
7264 <h3 class="section">18.4 decklink<span class="pull-right"><a class="anchor hidden-xs" href="#decklink" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-decklink" aria-hidden="true">TOC</a></span></h3>
7265
7266 <p>The decklink input device provides capture capabilities for Blackmagic
7267 DeckLink devices.
7268 </p>
7269 <p>To enable this input device, you need the Blackmagic DeckLink SDK and you
7270 need to configure with the appropriate <code>--extra-cflags</code>
7271 and <code>--extra-ldflags</code>.
7272 On Windows, you need to run the IDL files through <code>widl</code>.
7273 </p>
7274 <p>DeckLink is very picky about the formats it supports. Pixel format is
7275 uyvy422 or v210, framerate and video size must be determined for your device with
7276 <code>-list_formats 1</code>. Audio sample rate is always 48 kHz and the number
7277 of channels can be 2, 8 or 16.
7278 </p>
7279 <a name="Options-7"></a>
7280 <h4 class="subsection">18.4.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-7" aria-hidden="true">TOC</a></span></h4>
7281
7282 <dl compact="compact">
7283 <dt><samp>list_devices</samp></dt>
7284 <dd><p>If set to <samp>true</samp>, print a list of devices and exit.
7285 Defaults to <samp>false</samp>.
7286 </p>
7287 </dd>
7288 <dt><samp>list_formats</samp></dt>
7289 <dd><p>If set to <samp>true</samp>, print a list of supported formats and exit.
7290 Defaults to <samp>false</samp>.
7291 </p>
7292 </dd>
7293 <dt><samp>bm_v210</samp></dt>
7294 <dd><p>If set to &lsquo;<samp>1</samp>&rsquo;, video is captured in 10 bit v210 instead
7295 of uyvy422. Not all Blackmagic devices support this option.
7296 </p>
7297 </dd>
7298 </dl>
7299
7300 <a name="Examples-6"></a>
7301 <h4 class="subsection">18.4.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-6" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-6" aria-hidden="true">TOC</a></span></h4>
7302
7303 <ul>
7304 <li> List input devices:
7305 <div class="example">
7306 <pre class="example">ffmpeg -f decklink -list_devices 1 -i dummy
7307 </pre></div>
7308
7309 </li><li> List supported formats:
7310 <div class="example">
7311 <pre class="example">ffmpeg -f decklink -list_formats 1 -i 'Intensity Pro'
7312 </pre></div>
7313
7314 </li><li> Capture video clip at 1080i50 (format 11):
7315 <div class="example">
7316 <pre class="example">ffmpeg -f decklink -i 'Intensity Pro@11' -acodec copy -vcodec copy output.avi
7317 </pre></div>
7318
7319 </li><li> Capture video clip at 1080i50 10 bit:
7320 <div class="example">
7321 <pre class="example">ffmpeg -bm_v210 1 -f decklink -i 'UltraStudio Mini Recorder@11' -acodec copy -vcodec copy output.avi
7322 </pre></div>
7323
7324 </li><li> Capture video clip at 720p50 with 32bit audio:
7325 <div class="example">
7326 <pre class="example">ffmpeg -bm_audiodepth 32 -f decklink -i 'UltraStudio Mini Recorder@14' -acodec copy -vcodec copy output.avi
7327 </pre></div>
7328
7329 </li><li> Capture video clip at 576i50 with 8 audio channels:
7330 <div class="example">
7331 <pre class="example">ffmpeg -bm_channels 8 -f decklink -i 'UltraStudio Mini Recorder@3' -acodec copy -vcodec copy output.avi
7332 </pre></div>
7333
7334 </li></ul>
7335
7336 <a name="dshow"></a>
7337 <h3 class="section">18.5 dshow<span class="pull-right"><a class="anchor hidden-xs" href="#dshow" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dshow" aria-hidden="true">TOC</a></span></h3>
7338
7339 <p>Windows DirectShow input device.
7340 </p>
7341 <p>DirectShow support is enabled when FFmpeg is built with the mingw-w64 project.
7342 Currently only audio and video devices are supported.
7343 </p>
7344 <p>Multiple devices may be opened as separate inputs, but they may also be
7345 opened on the same input, which should improve synchronism between them.
7346 </p>
7347 <p>The input name should be in the format:
7348 </p>
7349 <div class="example">
7350 <pre class="example"><var>TYPE</var>=<var>NAME</var>[:<var>TYPE</var>=<var>NAME</var>]
7351 </pre></div>
7352
7353 <p>where <var>TYPE</var> can be either <var>audio</var> or <var>video</var>,
7354 and <var>NAME</var> is the device&rsquo;s name or alternative name..
7355 </p>
7356 <a name="Options-8"></a>
7357 <h4 class="subsection">18.5.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-8" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-8" aria-hidden="true">TOC</a></span></h4>
7358
7359 <p>If no options are specified, the device&rsquo;s defaults are used.
7360 If the device does not support the requested options, it will
7361 fail to open.
7362 </p>
7363 <dl compact="compact">
7364 <dt><samp>video_size</samp></dt>
7365 <dd><p>Set the video size in the captured video.
7366 </p>
7367 </dd>
7368 <dt><samp>framerate</samp></dt>
7369 <dd><p>Set the frame rate in the captured video.
7370 </p>
7371 </dd>
7372 <dt><samp>sample_rate</samp></dt>
7373 <dd><p>Set the sample rate (in Hz) of the captured audio.
7374 </p>
7375 </dd>
7376 <dt><samp>sample_size</samp></dt>
7377 <dd><p>Set the sample size (in bits) of the captured audio.
7378 </p>
7379 </dd>
7380 <dt><samp>channels</samp></dt>
7381 <dd><p>Set the number of channels in the captured audio.
7382 </p>
7383 </dd>
7384 <dt><samp>list_devices</samp></dt>
7385 <dd><p>If set to <samp>true</samp>, print a list of devices and exit.
7386 </p>
7387 </dd>
7388 <dt><samp>list_options</samp></dt>
7389 <dd><p>If set to <samp>true</samp>, print a list of selected device&rsquo;s options
7390 and exit.
7391 </p>
7392 </dd>
7393 <dt><samp>video_device_number</samp></dt>
7394 <dd><p>Set video device number for devices with same name (starts at 0,
7395 defaults to 0).
7396 </p>
7397 </dd>
7398 <dt><samp>audio_device_number</samp></dt>
7399 <dd><p>Set audio device number for devices with same name (starts at 0,
7400 defaults to 0).
7401 </p>
7402 </dd>
7403 <dt><samp>pixel_format</samp></dt>
7404 <dd><p>Select pixel format to be used by DirectShow. This may only be set when
7405 the video codec is not set or set to rawvideo.
7406 </p>
7407 </dd>
7408 <dt><samp>audio_buffer_size</samp></dt>
7409 <dd><p>Set audio device buffer size in milliseconds (which can directly
7410 impact latency, depending on the device).
7411 Defaults to using the audio device&rsquo;s
7412 default buffer size (typically some multiple of 500ms).
7413 Setting this value too low can degrade performance.
7414 See also
7415 <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx">http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx</a>
7416 </p>
7417 </dd>
7418 <dt><samp>video_pin_name</samp></dt>
7419 <dd><p>Select video capture pin to use by name or alternative name.
7420 </p>
7421 </dd>
7422 <dt><samp>audio_pin_name</samp></dt>
7423 <dd><p>Select audio capture pin to use by name or alternative name.
7424 </p>
7425 </dd>
7426 <dt><samp>crossbar_video_input_pin_number</samp></dt>
7427 <dd><p>Select video input pin number for crossbar device. This will be
7428 routed to the crossbar device&rsquo;s Video Decoder output pin.
7429 Note that changing this value can affect future invocations
7430 (sets a new default) until system reboot occurs.
7431 </p>
7432 </dd>
7433 <dt><samp>crossbar_audio_input_pin_number</samp></dt>
7434 <dd><p>Select audio input pin number for crossbar device. This will be
7435 routed to the crossbar device&rsquo;s Audio Decoder output pin.
7436 Note that changing this value can affect future invocations
7437 (sets a new default) until system reboot occurs.
7438 </p>
7439 </dd>
7440 <dt><samp>show_video_device_dialog</samp></dt>
7441 <dd><p>If set to <samp>true</samp>, before capture starts, popup a display dialog
7442 to the end user, allowing them to change video filter properties
7443 and configurations manually.
7444 Note that for crossbar devices, adjusting values in this dialog
7445 may be needed at times to toggle between PAL (25 fps) and NTSC (29.97)
7446 input frame rates, sizes, interlacing, etc.  Changing these values can
7447 enable different scan rates/frame rates and avoiding green bars at
7448 the bottom, flickering scan lines, etc.
7449 Note that with some devices, changing these properties can also affect future
7450 invocations (sets new defaults) until system reboot occurs.
7451 </p>
7452 </dd>
7453 <dt><samp>show_audio_device_dialog</samp></dt>
7454 <dd><p>If set to <samp>true</samp>, before capture starts, popup a display dialog
7455 to the end user, allowing them to change audio filter properties
7456 and configurations manually.
7457 </p>
7458 </dd>
7459 <dt><samp>show_video_crossbar_connection_dialog</samp></dt>
7460 <dd><p>If set to <samp>true</samp>, before capture starts, popup a display
7461 dialog to the end user, allowing them to manually
7462 modify crossbar pin routings, when it opens a video device.
7463 </p>
7464 </dd>
7465 <dt><samp>show_audio_crossbar_connection_dialog</samp></dt>
7466 <dd><p>If set to <samp>true</samp>, before capture starts, popup a display
7467 dialog to the end user, allowing them to manually
7468 modify crossbar pin routings, when it opens an audio device.
7469 </p>
7470 </dd>
7471 <dt><samp>show_analog_tv_tuner_dialog</samp></dt>
7472 <dd><p>If set to <samp>true</samp>, before capture starts, popup a display
7473 dialog to the end user, allowing them to manually
7474 modify TV channels and frequencies.
7475 </p>
7476 </dd>
7477 <dt><samp>show_analog_tv_tuner_audio_dialog</samp></dt>
7478 <dd><p>If set to <samp>true</samp>, before capture starts, popup a display
7479 dialog to the end user, allowing them to manually
7480 modify TV audio (like mono vs. stereo, Language A,B or C).
7481 </p>
7482 </dd>
7483 <dt><samp>audio_device_load</samp></dt>
7484 <dd><p>Load an audio capture filter device from file instead of searching
7485 it by name. It may load additional parameters too, if the filter
7486 supports the serialization of its properties to.
7487 To use this an audio capture source has to be specified, but it can
7488 be anything even fake one.
7489 </p>
7490 </dd>
7491 <dt><samp>audio_device_save</samp></dt>
7492 <dd><p>Save the currently used audio capture filter device and its
7493 parameters (if the filter supports it) to a file.
7494 If a file with the same name exists it will be overwritten.
7495 </p>
7496 </dd>
7497 <dt><samp>video_device_load</samp></dt>
7498 <dd><p>Load a video capture filter device from file instead of searching
7499 it by name. It may load additional parameters too, if the filter
7500 supports the serialization of its properties to.
7501 To use this a video capture source has to be specified, but it can
7502 be anything even fake one.
7503 </p>
7504 </dd>
7505 <dt><samp>video_device_save</samp></dt>
7506 <dd><p>Save the currently used video capture filter device and its
7507 parameters (if the filter supports it) to a file.
7508 If a file with the same name exists it will be overwritten.
7509 </p>
7510 </dd>
7511 </dl>
7512
7513 <a name="Examples-7"></a>
7514 <h4 class="subsection">18.5.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-7" aria-hidden="true">TOC</a></span></h4>
7515
7516 <ul>
7517 <li> Print the list of DirectShow supported devices and exit:
7518 <div class="example">
7519 <pre class="example">$ ffmpeg -list_devices true -f dshow -i dummy
7520 </pre></div>
7521
7522 </li><li> Open video device <var>Camera</var>:
7523 <div class="example">
7524 <pre class="example">$ ffmpeg -f dshow -i video=&quot;Camera&quot;
7525 </pre></div>
7526
7527 </li><li> Open second video device with name <var>Camera</var>:
7528 <div class="example">
7529 <pre class="example">$ ffmpeg -f dshow -video_device_number 1 -i video=&quot;Camera&quot;
7530 </pre></div>
7531
7532 </li><li> Open video device <var>Camera</var> and audio device <var>Microphone</var>:
7533 <div class="example">
7534 <pre class="example">$ ffmpeg -f dshow -i video=&quot;Camera&quot;:audio=&quot;Microphone&quot;
7535 </pre></div>
7536
7537 </li><li> Print the list of supported options in selected device and exit:
7538 <div class="example">
7539 <pre class="example">$ ffmpeg -list_options true -f dshow -i video=&quot;Camera&quot;
7540 </pre></div>
7541
7542 </li><li> Specify pin names to capture by name or alternative name, specify alternative device name:
7543 <div class="example">
7544 <pre class="example">$ ffmpeg -f dshow -audio_pin_name &quot;Audio Out&quot; -video_pin_name 2 -i video=video=&quot;@device_pnp_\\?\pci#ven_1a0a&amp;dev_6200&amp;subsys_62021461&amp;rev_01#4&amp;e2c7dd6&amp;0&amp;00e1#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{ca465100-deb0-4d59-818f-8c477184adf6}&quot;:audio=&quot;Microphone&quot;
7545 </pre></div>
7546
7547 </li><li> Configure a crossbar device, specifying crossbar pins, allow user to adjust video capture properties at startup:
7548 <div class="example">
7549 <pre class="example">$ ffmpeg -f dshow -show_video_device_dialog true -crossbar_video_input_pin_number 0
7550      -crossbar_audio_input_pin_number 3 -i video=&quot;AVerMedia BDA Analog Capture&quot;:audio=&quot;AVerMedia BDA Analog Capture&quot;
7551 </pre></div>
7552
7553 </li></ul>
7554
7555 <a name="dv1394"></a>
7556 <h3 class="section">18.6 dv1394<span class="pull-right"><a class="anchor hidden-xs" href="#dv1394" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dv1394" aria-hidden="true">TOC</a></span></h3>
7557
7558 <p>Linux DV 1394 input device.
7559 </p>
7560 <a name="fbdev"></a>
7561 <h3 class="section">18.7 fbdev<span class="pull-right"><a class="anchor hidden-xs" href="#fbdev" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fbdev" aria-hidden="true">TOC</a></span></h3>
7562
7563 <p>Linux framebuffer input device.
7564 </p>
7565 <p>The Linux framebuffer is a graphic hardware-independent abstraction
7566 layer to show graphics on a computer monitor, typically on the
7567 console. It is accessed through a file device node, usually
7568 <samp>/dev/fb0</samp>.
7569 </p>
7570 <p>For more detailed information read the file
7571 Documentation/fb/framebuffer.txt included in the Linux source tree.
7572 </p>
7573 <p>To record from the framebuffer device <samp>/dev/fb0</samp> with
7574 <code>ffmpeg</code>:
7575 </p><div class="example">
7576 <pre class="example">ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
7577 </pre></div>
7578
7579 <p>You can take a single screenshot image with the command:
7580 </p><div class="example">
7581 <pre class="example">ffmpeg -f fbdev -frames:v 1 -r 1 -i /dev/fb0 screenshot.jpeg
7582 </pre></div>
7583
7584 <p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
7585 </p>
7586 <a name="gdigrab"></a>
7587 <h3 class="section">18.8 gdigrab<span class="pull-right"><a class="anchor hidden-xs" href="#gdigrab" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gdigrab" aria-hidden="true">TOC</a></span></h3>
7588
7589 <p>Win32 GDI-based screen capture device.
7590 </p>
7591 <p>This device allows you to capture a region of the display on Windows.
7592 </p>
7593 <p>There are two options for the input filename:
7594 </p><div class="example">
7595 <pre class="example">desktop
7596 </pre></div>
7597 <p>or
7598 </p><div class="example">
7599 <pre class="example">title=<var>window_title</var>
7600 </pre></div>
7601
7602 <p>The first option will capture the entire desktop, or a fixed region of the
7603 desktop. The second option will instead capture the contents of a single
7604 window, regardless of its position on the screen.
7605 </p>
7606 <p>For example, to grab the entire desktop using <code>ffmpeg</code>:
7607 </p><div class="example">
7608 <pre class="example">ffmpeg -f gdigrab -framerate 6 -i desktop out.mpg
7609 </pre></div>
7610
7611 <p>Grab a 640x480 region at position <code>10,20</code>:
7612 </p><div class="example">
7613 <pre class="example">ffmpeg -f gdigrab -framerate 6 -offset_x 10 -offset_y 20 -video_size vga -i desktop out.mpg
7614 </pre></div>
7615
7616 <p>Grab the contents of the window named &quot;Calculator&quot;
7617 </p><div class="example">
7618 <pre class="example">ffmpeg -f gdigrab -framerate 6 -i title=Calculator out.mpg
7619 </pre></div>
7620
7621 <a name="Options-9"></a>
7622 <h4 class="subsection">18.8.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-9" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-9" aria-hidden="true">TOC</a></span></h4>
7623
7624 <dl compact="compact">
7625 <dt><samp>draw_mouse</samp></dt>
7626 <dd><p>Specify whether to draw the mouse pointer. Use the value <code>0</code> to
7627 not draw the pointer. Default value is <code>1</code>.
7628 </p>
7629 </dd>
7630 <dt><samp>framerate</samp></dt>
7631 <dd><p>Set the grabbing frame rate. Default value is <code>ntsc</code>,
7632 corresponding to a frame rate of <code>30000/1001</code>.
7633 </p>
7634 </dd>
7635 <dt><samp>show_region</samp></dt>
7636 <dd><p>Show grabbed region on screen.
7637 </p>
7638 <p>If <var>show_region</var> is specified with <code>1</code>, then the grabbing
7639 region will be indicated on screen. With this option, it is easy to
7640 know what is being grabbed if only a portion of the screen is grabbed.
7641 </p>
7642 <p>Note that <var>show_region</var> is incompatible with grabbing the contents
7643 of a single window.
7644 </p>
7645 <p>For example:
7646 </p><div class="example">
7647 <pre class="example">ffmpeg -f gdigrab -show_region 1 -framerate 6 -video_size cif -offset_x 10 -offset_y 20 -i desktop out.mpg
7648 </pre></div>
7649
7650 </dd>
7651 <dt><samp>video_size</samp></dt>
7652 <dd><p>Set the video frame size. The default is to capture the full screen if <samp>desktop</samp> is selected, or the full window size if <samp>title=<var>window_title</var></samp> is selected.
7653 </p>
7654 </dd>
7655 <dt><samp>offset_x</samp></dt>
7656 <dd><p>When capturing a region with <var>video_size</var>, set the distance from the left edge of the screen or desktop.
7657 </p>
7658 <p>Note that the offset calculation is from the top left corner of the primary monitor on Windows. If you have a monitor positioned to the left of your primary monitor, you will need to use a negative <var>offset_x</var> value to move the region to that monitor.
7659 </p>
7660 </dd>
7661 <dt><samp>offset_y</samp></dt>
7662 <dd><p>When capturing a region with <var>video_size</var>, set the distance from the top edge of the screen or desktop.
7663 </p>
7664 <p>Note that the offset calculation is from the top left corner of the primary monitor on Windows. If you have a monitor positioned above your primary monitor, you will need to use a negative <var>offset_y</var> value to move the region to that monitor.
7665 </p>
7666 </dd>
7667 </dl>
7668
7669 <a name="iec61883"></a>
7670 <h3 class="section">18.9 iec61883<span class="pull-right"><a class="anchor hidden-xs" href="#iec61883" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-iec61883" aria-hidden="true">TOC</a></span></h3>
7671
7672 <p>FireWire DV/HDV input device using libiec61883.
7673 </p>
7674 <p>To enable this input device, you need libiec61883, libraw1394 and
7675 libavc1394 installed on your system. Use the configure option
7676 <code>--enable-libiec61883</code> to compile with the device enabled.
7677 </p>
7678 <p>The iec61883 capture device supports capturing from a video device
7679 connected via IEEE1394 (FireWire), using libiec61883 and the new Linux
7680 FireWire stack (juju). This is the default DV/HDV input method in Linux
7681 Kernel 2.6.37 and later, since the old FireWire stack was removed.
7682 </p>
7683 <p>Specify the FireWire port to be used as input file, or &quot;auto&quot;
7684 to choose the first port connected.
7685 </p>
7686 <a name="Options-10"></a>
7687 <h4 class="subsection">18.9.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-10" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-10" aria-hidden="true">TOC</a></span></h4>
7688
7689 <dl compact="compact">
7690 <dt><samp>dvtype</samp></dt>
7691 <dd><p>Override autodetection of DV/HDV. This should only be used if auto
7692 detection does not work, or if usage of a different device type
7693 should be prohibited. Treating a DV device as HDV (or vice versa) will
7694 not work and result in undefined behavior.
7695 The values <samp>auto</samp>, <samp>dv</samp> and <samp>hdv</samp> are supported.
7696 </p>
7697 </dd>
7698 <dt><samp>dvbuffer</samp></dt>
7699 <dd><p>Set maximum size of buffer for incoming data, in frames. For DV, this
7700 is an exact value. For HDV, it is not frame exact, since HDV does
7701 not have a fixed frame size.
7702 </p>
7703 </dd>
7704 <dt><samp>dvguid</samp></dt>
7705 <dd><p>Select the capture device by specifying it&rsquo;s GUID. Capturing will only
7706 be performed from the specified device and fails if no device with the
7707 given GUID is found. This is useful to select the input if multiple
7708 devices are connected at the same time.
7709 Look at /sys/bus/firewire/devices to find out the GUIDs.
7710 </p>
7711 </dd>
7712 </dl>
7713
7714 <a name="Examples-8"></a>
7715 <h4 class="subsection">18.9.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-8" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-8" aria-hidden="true">TOC</a></span></h4>
7716
7717 <ul>
7718 <li> Grab and show the input of a FireWire DV/HDV device.
7719 <div class="example">
7720 <pre class="example">ffplay -f iec61883 -i auto
7721 </pre></div>
7722
7723 </li><li> Grab and record the input of a FireWire DV/HDV device,
7724 using a packet buffer of 100000 packets if the source is HDV.
7725 <div class="example">
7726 <pre class="example">ffmpeg -f iec61883 -i auto -hdvbuffer 100000 out.mpg
7727 </pre></div>
7728
7729 </li></ul>
7730
7731 <a name="jack"></a>
7732 <h3 class="section">18.10 jack<span class="pull-right"><a class="anchor hidden-xs" href="#jack" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-jack" aria-hidden="true">TOC</a></span></h3>
7733
7734 <p>JACK input device.
7735 </p>
7736 <p>To enable this input device during configuration you need libjack
7737 installed on your system.
7738 </p>
7739 <p>A JACK input device creates one or more JACK writable clients, one for
7740 each audio channel, with name <var>client_name</var>:input_<var>N</var>, where
7741 <var>client_name</var> is the name provided by the application, and <var>N</var>
7742 is a number which identifies the channel.
7743 Each writable client will send the acquired data to the FFmpeg input
7744 device.
7745 </p>
7746 <p>Once you have created one or more JACK readable clients, you need to
7747 connect them to one or more JACK writable clients.
7748 </p>
7749 <p>To connect or disconnect JACK clients you can use the <code>jack_connect</code>
7750 and <code>jack_disconnect</code> programs, or do it through a graphical interface,
7751 for example with <code>qjackctl</code>.
7752 </p>
7753 <p>To list the JACK clients and their properties you can invoke the command
7754 <code>jack_lsp</code>.
7755 </p>
7756 <p>Follows an example which shows how to capture a JACK readable client
7757 with <code>ffmpeg</code>.
7758 </p><div class="example">
7759 <pre class="example"># Create a JACK writable client with name &quot;ffmpeg&quot;.
7760 $ ffmpeg -f jack -i ffmpeg -y out.wav
7761
7762 # Start the sample jack_metro readable client.
7763 $ jack_metro -b 120 -d 0.2 -f 4000
7764
7765 # List the current JACK clients.
7766 $ jack_lsp -c
7767 system:capture_1
7768 system:capture_2
7769 system:playback_1
7770 system:playback_2
7771 ffmpeg:input_1
7772 metro:120_bpm
7773
7774 # Connect metro to the ffmpeg writable client.
7775 $ jack_connect metro:120_bpm ffmpeg:input_1
7776 </pre></div>
7777
7778 <p>For more information read:
7779 <a href="http://jackaudio.org/">http://jackaudio.org/</a>
7780 </p>
7781 <a name="lavfi"></a>
7782 <h3 class="section">18.11 lavfi<span class="pull-right"><a class="anchor hidden-xs" href="#lavfi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lavfi" aria-hidden="true">TOC</a></span></h3>
7783
7784 <p>Libavfilter input virtual device.
7785 </p>
7786 <p>This input device reads data from the open output pads of a libavfilter
7787 filtergraph.
7788 </p>
7789 <p>For each filtergraph open output, the input device will create a
7790 corresponding stream which is mapped to the generated output. Currently
7791 only video data is supported. The filtergraph is specified through the
7792 option <samp>graph</samp>.
7793 </p>
7794 <a name="Options-11"></a>
7795 <h4 class="subsection">18.11.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-11" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-11" aria-hidden="true">TOC</a></span></h4>
7796
7797 <dl compact="compact">
7798 <dt><samp>graph</samp></dt>
7799 <dd><p>Specify the filtergraph to use as input. Each video open output must be
7800 labelled by a unique string of the form &quot;out<var>N</var>&quot;, where <var>N</var> is a
7801 number starting from 0 corresponding to the mapped input stream
7802 generated by the device.
7803 The first unlabelled output is automatically assigned to the &quot;out0&quot;
7804 label, but all the others need to be specified explicitly.
7805 </p>
7806 <p>The suffix &quot;+subcc&quot; can be appended to the output label to create an extra
7807 stream with the closed captions packets attached to that output
7808 (experimental; only for EIA-608 / CEA-708 for now).
7809 The subcc streams are created after all the normal streams, in the order of
7810 the corresponding stream.
7811 For example, if there is &quot;out19+subcc&quot;, &quot;out7+subcc&quot; and up to &quot;out42&quot;, the
7812 stream #43 is subcc for stream #7 and stream #44 is subcc for stream #19.
7813 </p>
7814 <p>If not specified defaults to the filename specified for the input
7815 device.
7816 </p>
7817 </dd>
7818 <dt><samp>graph_file</samp></dt>
7819 <dd><p>Set the filename of the filtergraph to be read and sent to the other
7820 filters. Syntax of the filtergraph is the same as the one specified by
7821 the option <var>graph</var>.
7822 </p>
7823 </dd>
7824 </dl>
7825
7826 <a name="Examples-9"></a>
7827 <h4 class="subsection">18.11.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-9" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-9" aria-hidden="true">TOC</a></span></h4>
7828
7829 <ul>
7830 <li> Create a color video stream and play it back with <code>ffplay</code>:
7831 <div class="example">
7832 <pre class="example">ffplay -f lavfi -graph &quot;color=c=pink [out0]&quot; dummy
7833 </pre></div>
7834
7835 </li><li> As the previous example, but use filename for specifying the graph
7836 description, and omit the &quot;out0&quot; label:
7837 <div class="example">
7838 <pre class="example">ffplay -f lavfi color=c=pink
7839 </pre></div>
7840
7841 </li><li> Create three different video test filtered sources and play them:
7842 <div class="example">
7843 <pre class="example">ffplay -f lavfi -graph &quot;testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]&quot; test3
7844 </pre></div>
7845
7846 </li><li> Read an audio stream from a file using the amovie source and play it
7847 back with <code>ffplay</code>:
7848 <div class="example">
7849 <pre class="example">ffplay -f lavfi &quot;amovie=test.wav&quot;
7850 </pre></div>
7851
7852 </li><li> Read an audio stream and a video stream and play it back with
7853 <code>ffplay</code>:
7854 <div class="example">
7855 <pre class="example">ffplay -f lavfi &quot;movie=test.avi[out0];amovie=test.wav[out1]&quot;
7856 </pre></div>
7857
7858 </li><li> Dump decoded frames to images and closed captions to a file (experimental):
7859 <div class="example">
7860 <pre class="example">ffmpeg -f lavfi -i &quot;movie=test.ts[out0+subcc]&quot; -map v frame%08d.png -map s -c copy -f rawvideo subcc.bin
7861 </pre></div>
7862
7863 </li></ul>
7864
7865 <a name="libcdio"></a>
7866 <h3 class="section">18.12 libcdio<span class="pull-right"><a class="anchor hidden-xs" href="#libcdio" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libcdio" aria-hidden="true">TOC</a></span></h3>
7867
7868 <p>Audio-CD input device based on libcdio.
7869 </p>
7870 <p>To enable this input device during configuration you need libcdio
7871 installed on your system. It requires the configure option
7872 <code>--enable-libcdio</code>.
7873 </p>
7874 <p>This device allows playing and grabbing from an Audio-CD.
7875 </p>
7876 <p>For example to copy with <code>ffmpeg</code> the entire Audio-CD in <samp>/dev/sr0</samp>,
7877 you may run the command:
7878 </p><div class="example">
7879 <pre class="example">ffmpeg -f libcdio -i /dev/sr0 cd.wav
7880 </pre></div>
7881
7882 <a name="Options-12"></a>
7883 <h4 class="subsection">18.12.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-12" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-12" aria-hidden="true">TOC</a></span></h4>
7884 <dl compact="compact">
7885 <dt><samp>speed</samp></dt>
7886 <dd><p>Set drive reading speed. Default value is 0.
7887 </p>
7888 <p>The speed is specified CD-ROM speed units. The speed is set through
7889 the libcdio <code>cdio_cddap_speed_set</code> function. On many CD-ROM
7890 drives, specifying a value too large will result in using the fastest
7891 speed.
7892 </p>
7893 </dd>
7894 <dt><samp>paranoia_mode</samp></dt>
7895 <dd><p>Set paranoia recovery mode flags. It accepts one of the following values:
7896 </p>
7897 <dl compact="compact">
7898 <dt>&lsquo;<samp>disable</samp>&rsquo;</dt>
7899 <dt>&lsquo;<samp>verify</samp>&rsquo;</dt>
7900 <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
7901 <dt>&lsquo;<samp>neverskip</samp>&rsquo;</dt>
7902 <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
7903 </dl>
7904
7905 <p>Default value is &lsquo;<samp>disable</samp>&rsquo;.
7906 </p>
7907 <p>For more information about the available recovery modes, consult the
7908 paranoia project documentation.
7909 </p></dd>
7910 </dl>
7911
7912 <a name="libdc1394"></a>
7913 <h3 class="section">18.13 libdc1394<span class="pull-right"><a class="anchor hidden-xs" href="#libdc1394" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libdc1394" aria-hidden="true">TOC</a></span></h3>
7914
7915 <p>IIDC1394 input device, based on libdc1394 and libraw1394.
7916 </p>
7917 <p>Requires the configure option <code>--enable-libdc1394</code>.
7918 </p>
7919 <a name="openal"></a>
7920 <h3 class="section">18.14 openal<span class="pull-right"><a class="anchor hidden-xs" href="#openal" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-openal" aria-hidden="true">TOC</a></span></h3>
7921
7922 <p>The OpenAL input device provides audio capture on all systems with a
7923 working OpenAL 1.1 implementation.
7924 </p>
7925 <p>To enable this input device during configuration, you need OpenAL
7926 headers and libraries installed on your system, and need to configure
7927 FFmpeg with <code>--enable-openal</code>.
7928 </p>
7929 <p>OpenAL headers and libraries should be provided as part of your OpenAL
7930 implementation, or as an additional download (an SDK). Depending on your
7931 installation you may need to specify additional flags via the
7932 <code>--extra-cflags</code> and <code>--extra-ldflags</code> for allowing the build
7933 system to locate the OpenAL headers and libraries.
7934 </p>
7935 <p>An incomplete list of OpenAL implementations follows:
7936 </p>
7937 <dl compact="compact">
7938 <dt><strong>Creative</strong></dt>
7939 <dd><p>The official Windows implementation, providing hardware acceleration
7940 with supported devices and software fallback.
7941 See <a href="http://openal.org/">http://openal.org/</a>.
7942 </p></dd>
7943 <dt><strong>OpenAL Soft</strong></dt>
7944 <dd><p>Portable, open source (LGPL) software implementation. Includes
7945 backends for the most common sound APIs on the Windows, Linux,
7946 Solaris, and BSD operating systems.
7947 See <a href="http://kcat.strangesoft.net/openal.html">http://kcat.strangesoft.net/openal.html</a>.
7948 </p></dd>
7949 <dt><strong>Apple</strong></dt>
7950 <dd><p>OpenAL is part of Core Audio, the official Mac OS X Audio interface.
7951 See <a href="http://developer.apple.com/technologies/mac/audio-and-video.html">http://developer.apple.com/technologies/mac/audio-and-video.html</a>
7952 </p></dd>
7953 </dl>
7954
7955 <p>This device allows one to capture from an audio input device handled
7956 through OpenAL.
7957 </p>
7958 <p>You need to specify the name of the device to capture in the provided
7959 filename. If the empty string is provided, the device will
7960 automatically select the default device. You can get the list of the
7961 supported devices by using the option <var>list_devices</var>.
7962 </p>
7963 <a name="Options-13"></a>
7964 <h4 class="subsection">18.14.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-13" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-13" aria-hidden="true">TOC</a></span></h4>
7965
7966 <dl compact="compact">
7967 <dt><samp>channels</samp></dt>
7968 <dd><p>Set the number of channels in the captured audio. Only the values
7969 <samp>1</samp> (monaural) and <samp>2</samp> (stereo) are currently supported.
7970 Defaults to <samp>2</samp>.
7971 </p>
7972 </dd>
7973 <dt><samp>sample_size</samp></dt>
7974 <dd><p>Set the sample size (in bits) of the captured audio. Only the values
7975 <samp>8</samp> and <samp>16</samp> are currently supported. Defaults to
7976 <samp>16</samp>.
7977 </p>
7978 </dd>
7979 <dt><samp>sample_rate</samp></dt>
7980 <dd><p>Set the sample rate (in Hz) of the captured audio.
7981 Defaults to <samp>44.1k</samp>.
7982 </p>
7983 </dd>
7984 <dt><samp>list_devices</samp></dt>
7985 <dd><p>If set to <samp>true</samp>, print a list of devices and exit.
7986 Defaults to <samp>false</samp>.
7987 </p>
7988 </dd>
7989 </dl>
7990
7991 <a name="Examples-10"></a>
7992 <h4 class="subsection">18.14.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-10" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-10" aria-hidden="true">TOC</a></span></h4>
7993
7994 <p>Print the list of OpenAL supported devices and exit:
7995 </p><div class="example">
7996 <pre class="example">$ ffmpeg -list_devices true -f openal -i dummy out.ogg
7997 </pre></div>
7998
7999 <p>Capture from the OpenAL device <samp>DR-BT101 via PulseAudio</samp>:
8000 </p><div class="example">
8001 <pre class="example">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
8002 </pre></div>
8003
8004 <p>Capture from the default device (note the empty string &rdquo; as filename):
8005 </p><div class="example">
8006 <pre class="example">$ ffmpeg -f openal -i '' out.ogg
8007 </pre></div>
8008
8009 <p>Capture from two devices simultaneously, writing to two different files,
8010 within the same <code>ffmpeg</code> command:
8011 </p><div class="example">
8012 <pre class="example">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
8013 </pre></div>
8014 <p>Note: not all OpenAL implementations support multiple simultaneous capture -
8015 try the latest OpenAL Soft if the above does not work.
8016 </p>
8017 <a name="oss"></a>
8018 <h3 class="section">18.15 oss<span class="pull-right"><a class="anchor hidden-xs" href="#oss" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-oss" aria-hidden="true">TOC</a></span></h3>
8019
8020 <p>Open Sound System input device.
8021 </p>
8022 <p>The filename to provide to the input device is the device node
8023 representing the OSS input device, and is usually set to
8024 <samp>/dev/dsp</samp>.
8025 </p>
8026 <p>For example to grab from <samp>/dev/dsp</samp> using <code>ffmpeg</code> use the
8027 command:
8028 </p><div class="example">
8029 <pre class="example">ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
8030 </pre></div>
8031
8032 <p>For more information about OSS see:
8033 <a href="http://manuals.opensound.com/usersguide/dsp.html">http://manuals.opensound.com/usersguide/dsp.html</a>
8034 </p>
8035 <a name="pulse"></a>
8036 <h3 class="section">18.16 pulse<span class="pull-right"><a class="anchor hidden-xs" href="#pulse" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pulse" aria-hidden="true">TOC</a></span></h3>
8037
8038 <p>PulseAudio input device.
8039 </p>
8040 <p>To enable this output device you need to configure FFmpeg with <code>--enable-libpulse</code>.
8041 </p>
8042 <p>The filename to provide to the input device is a source device or the
8043 string &quot;default&quot;
8044 </p>
8045 <p>To list the PulseAudio source devices and their properties you can invoke
8046 the command <code>pactl list sources</code>.
8047 </p>
8048 <p>More information about PulseAudio can be found on <a href="http://www.pulseaudio.org">http://www.pulseaudio.org</a>.
8049 </p>
8050 <a name="Options-14"></a>
8051 <h4 class="subsection">18.16.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-14" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-14" aria-hidden="true">TOC</a></span></h4>
8052 <dl compact="compact">
8053 <dt><samp>server</samp></dt>
8054 <dd><p>Connect to a specific PulseAudio server, specified by an IP address.
8055 Default server is used when not provided.
8056 </p>
8057 </dd>
8058 <dt><samp>name</samp></dt>
8059 <dd><p>Specify the application name PulseAudio will use when showing active clients,
8060 by default it is the <code>LIBAVFORMAT_IDENT</code> string.
8061 </p>
8062 </dd>
8063 <dt><samp>stream_name</samp></dt>
8064 <dd><p>Specify the stream name PulseAudio will use when showing active streams,
8065 by default it is &quot;record&quot;.
8066 </p>
8067 </dd>
8068 <dt><samp>sample_rate</samp></dt>
8069 <dd><p>Specify the samplerate in Hz, by default 48kHz is used.
8070 </p>
8071 </dd>
8072 <dt><samp>channels</samp></dt>
8073 <dd><p>Specify the channels in use, by default 2 (stereo) is set.
8074 </p>
8075 </dd>
8076 <dt><samp>frame_size</samp></dt>
8077 <dd><p>Specify the number of bytes per frame, by default it is set to 1024.
8078 </p>
8079 </dd>
8080 <dt><samp>fragment_size</samp></dt>
8081 <dd><p>Specify the minimal buffering fragment in PulseAudio, it will affect the
8082 audio latency. By default it is unset.
8083 </p></dd>
8084 </dl>
8085
8086 <a name="Examples-11"></a>
8087 <h4 class="subsection">18.16.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-11" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-11" aria-hidden="true">TOC</a></span></h4>
8088 <p>Record a stream from default device:
8089 </p><div class="example">
8090 <pre class="example">ffmpeg -f pulse -i default /tmp/pulse.wav
8091 </pre></div>
8092
8093 <a name="qtkit"></a>
8094 <h3 class="section">18.17 qtkit<span class="pull-right"><a class="anchor hidden-xs" href="#qtkit" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-qtkit" aria-hidden="true">TOC</a></span></h3>
8095
8096 <p>QTKit input device.
8097 </p>
8098 <p>The filename passed as input is parsed to contain either a device name or index.
8099 The device index can also be given by using -video_device_index.
8100 A given device index will override any given device name.
8101 If the desired device consists of numbers only, use -video_device_index to identify it.
8102 The default device will be chosen if an empty string  or the device name &quot;default&quot; is given.
8103 The available devices can be enumerated by using -list_devices.
8104 </p>
8105 <div class="example">
8106 <pre class="example">ffmpeg -f qtkit -i &quot;0&quot; out.mpg
8107 </pre></div>
8108
8109 <div class="example">
8110 <pre class="example">ffmpeg -f qtkit -video_device_index 0 -i &quot;&quot; out.mpg
8111 </pre></div>
8112
8113 <div class="example">
8114 <pre class="example">ffmpeg -f qtkit -i &quot;default&quot; out.mpg
8115 </pre></div>
8116
8117 <div class="example">
8118 <pre class="example">ffmpeg -f qtkit -list_devices true -i &quot;&quot;
8119 </pre></div>
8120
8121 <a name="sndio"></a>
8122 <h3 class="section">18.18 sndio<span class="pull-right"><a class="anchor hidden-xs" href="#sndio" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sndio" aria-hidden="true">TOC</a></span></h3>
8123
8124 <p>sndio input device.
8125 </p>
8126 <p>To enable this input device during configuration you need libsndio
8127 installed on your system.
8128 </p>
8129 <p>The filename to provide to the input device is the device node
8130 representing the sndio input device, and is usually set to
8131 <samp>/dev/audio0</samp>.
8132 </p>
8133 <p>For example to grab from <samp>/dev/audio0</samp> using <code>ffmpeg</code> use the
8134 command:
8135 </p><div class="example">
8136 <pre class="example">ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
8137 </pre></div>
8138
8139 <a name="video4linux2_002c-v4l2"></a>
8140 <h3 class="section">18.19 video4linux2, v4l2<span class="pull-right"><a class="anchor hidden-xs" href="#video4linux2_002c-v4l2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-video4linux2_002c-v4l2" aria-hidden="true">TOC</a></span></h3>
8141
8142 <p>Video4Linux2 input video device.
8143 </p>
8144 <p>&quot;v4l2&quot; can be used as alias for &quot;video4linux2&quot;.
8145 </p>
8146 <p>If FFmpeg is built with v4l-utils support (by using the
8147 <code>--enable-libv4l2</code> configure option), it is possible to use it with the
8148 <code>-use_libv4l2</code> input device option.
8149 </p>
8150 <p>The name of the device to grab is a file device node, usually Linux
8151 systems tend to automatically create such nodes when the device
8152 (e.g. an USB webcam) is plugged into the system, and has a name of the
8153 kind <samp>/dev/video<var>N</var></samp>, where <var>N</var> is a number associated to
8154 the device.
8155 </p>
8156 <p>Video4Linux2 devices usually support a limited set of
8157 <var>width</var>x<var>height</var> sizes and frame rates. You can check which are
8158 supported using <code>-list_formats all</code> for Video4Linux2 devices.
8159 Some devices, like TV cards, support one or more standards. It is possible
8160 to list all the supported standards using <code>-list_standards all</code>.
8161 </p>
8162 <p>The time base for the timestamps is 1 microsecond. Depending on the kernel
8163 version and configuration, the timestamps may be derived from the real time
8164 clock (origin at the Unix Epoch) or the monotonic clock (origin usually at
8165 boot time, unaffected by NTP or manual changes to the clock). The
8166 <samp>-timestamps abs</samp> or <samp>-ts abs</samp> option can be used to force
8167 conversion into the real time clock.
8168 </p>
8169 <p>Some usage examples of the video4linux2 device with <code>ffmpeg</code>
8170 and <code>ffplay</code>:
8171 </p><ul>
8172 <li> List supported formats for a video4linux2 device:
8173 <div class="example">
8174 <pre class="example">ffplay -f video4linux2 -list_formats all /dev/video0
8175 </pre></div>
8176
8177 </li><li> Grab and show the input of a video4linux2 device:
8178 <div class="example">
8179 <pre class="example">ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
8180 </pre></div>
8181
8182 </li><li> Grab and record the input of a video4linux2 device, leave the
8183 frame rate and size as previously set:
8184 <div class="example">
8185 <pre class="example">ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
8186 </pre></div>
8187 </li></ul>
8188
8189 <p>For more information about Video4Linux, check <a href="http://linuxtv.org/">http://linuxtv.org/</a>.
8190 </p>
8191 <a name="Options-15"></a>
8192 <h4 class="subsection">18.19.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-15" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-15" aria-hidden="true">TOC</a></span></h4>
8193
8194 <dl compact="compact">
8195 <dt><samp>standard</samp></dt>
8196 <dd><p>Set the standard. Must be the name of a supported standard. To get a
8197 list of the supported standards, use the <samp>list_standards</samp>
8198 option.
8199 </p>
8200 </dd>
8201 <dt><samp>channel</samp></dt>
8202 <dd><p>Set the input channel number. Default to -1, which means using the
8203 previously selected channel.
8204 </p>
8205 </dd>
8206 <dt><samp>video_size</samp></dt>
8207 <dd><p>Set the video frame size. The argument must be a string in the form
8208 <var>WIDTH</var>x<var>HEIGHT</var> or a valid size abbreviation.
8209 </p>
8210 </dd>
8211 <dt><samp>pixel_format</samp></dt>
8212 <dd><p>Select the pixel format (only valid for raw video input).
8213 </p>
8214 </dd>
8215 <dt><samp>input_format</samp></dt>
8216 <dd><p>Set the preferred pixel format (for raw video) or a codec name.
8217 This option allows one to select the input format, when several are
8218 available.
8219 </p>
8220 </dd>
8221 <dt><samp>framerate</samp></dt>
8222 <dd><p>Set the preferred video frame rate.
8223 </p>
8224 </dd>
8225 <dt><samp>list_formats</samp></dt>
8226 <dd><p>List available formats (supported pixel formats, codecs, and frame
8227 sizes) and exit.
8228 </p>
8229 <p>Available values are:
8230 </p><dl compact="compact">
8231 <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
8232 <dd><p>Show all available (compressed and non-compressed) formats.
8233 </p>
8234 </dd>
8235 <dt>&lsquo;<samp>raw</samp>&rsquo;</dt>
8236 <dd><p>Show only raw video (non-compressed) formats.
8237 </p>
8238 </dd>
8239 <dt>&lsquo;<samp>compressed</samp>&rsquo;</dt>
8240 <dd><p>Show only compressed formats.
8241 </p></dd>
8242 </dl>
8243
8244 </dd>
8245 <dt><samp>list_standards</samp></dt>
8246 <dd><p>List supported standards and exit.
8247 </p>
8248 <p>Available values are:
8249 </p><dl compact="compact">
8250 <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
8251 <dd><p>Show all supported standards.
8252 </p></dd>
8253 </dl>
8254
8255 </dd>
8256 <dt><samp>timestamps, ts</samp></dt>
8257 <dd><p>Set type of timestamps for grabbed frames.
8258 </p>
8259 <p>Available values are:
8260 </p><dl compact="compact">
8261 <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
8262 <dd><p>Use timestamps from the kernel.
8263 </p>
8264 </dd>
8265 <dt>&lsquo;<samp>abs</samp>&rsquo;</dt>
8266 <dd><p>Use absolute timestamps (wall clock).
8267 </p>
8268 </dd>
8269 <dt>&lsquo;<samp>mono2abs</samp>&rsquo;</dt>
8270 <dd><p>Force conversion from monotonic to absolute timestamps.
8271 </p></dd>
8272 </dl>
8273
8274 <p>Default value is <code>default</code>.
8275 </p></dd>
8276 </dl>
8277
8278 <a name="vfwcap"></a>
8279 <h3 class="section">18.20 vfwcap<span class="pull-right"><a class="anchor hidden-xs" href="#vfwcap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vfwcap" aria-hidden="true">TOC</a></span></h3>
8280
8281 <p>VfW (Video for Windows) capture input device.
8282 </p>
8283 <p>The filename passed as input is the capture driver number, ranging from
8284 0 to 9. You may use &quot;list&quot; as filename to print a list of drivers. Any
8285 other filename will be interpreted as device number 0.
8286 </p>
8287 <a name="x11grab"></a>
8288 <h3 class="section">18.21 x11grab<span class="pull-right"><a class="anchor hidden-xs" href="#x11grab" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-x11grab" aria-hidden="true">TOC</a></span></h3>
8289
8290 <p>X11 video input device.
8291 </p>
8292 <p>To enable this input device during configuration you need libxcb
8293 installed on your system. It will be automatically detected during
8294 configuration.
8295 </p>
8296 <p>Alternatively, the configure option <samp>--enable-x11grab</samp> exists
8297 for legacy Xlib users.
8298 </p>
8299 <p>This device allows one to capture a region of an X11 display.
8300 </p>
8301 <p>The filename passed as input has the syntax:
8302 </p><div class="example">
8303 <pre class="example">[<var>hostname</var>]:<var>display_number</var>.<var>screen_number</var>[+<var>x_offset</var>,<var>y_offset</var>]
8304 </pre></div>
8305
8306 <p><var>hostname</var>:<var>display_number</var>.<var>screen_number</var> specifies the
8307 X11 display name of the screen to grab from. <var>hostname</var> can be
8308 omitted, and defaults to &quot;localhost&quot;. The environment variable
8309 <code>DISPLAY</code> contains the default display name.
8310 </p>
8311 <p><var>x_offset</var> and <var>y_offset</var> specify the offsets of the grabbed
8312 area with respect to the top-left border of the X11 screen. They
8313 default to 0.
8314 </p>
8315 <p>Check the X11 documentation (e.g. <code>man X</code>) for more detailed
8316 information.
8317 </p>
8318 <p>Use the <code>xdpyinfo</code> program for getting basic information about
8319 the properties of your X11 display (e.g. grep for &quot;name&quot; or
8320 &quot;dimensions&quot;).
8321 </p>
8322 <p>For example to grab from <samp>:0.0</samp> using <code>ffmpeg</code>:
8323 </p><div class="example">
8324 <pre class="example">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0 out.mpg
8325 </pre></div>
8326
8327 <p>Grab at position <code>10,20</code>:
8328 </p><div class="example">
8329 <pre class="example">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
8330 </pre></div>
8331
8332 <a name="Options-16"></a>
8333 <h4 class="subsection">18.21.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-16" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-16" aria-hidden="true">TOC</a></span></h4>
8334
8335 <dl compact="compact">
8336 <dt><samp>draw_mouse</samp></dt>
8337 <dd><p>Specify whether to draw the mouse pointer. A value of <code>0</code> specify
8338 not to draw the pointer. Default value is <code>1</code>.
8339 </p>
8340 </dd>
8341 <dt><samp>follow_mouse</samp></dt>
8342 <dd><p>Make the grabbed area follow the mouse. The argument can be
8343 <code>centered</code> or a number of pixels <var>PIXELS</var>.
8344 </p>
8345 <p>When it is specified with &quot;centered&quot;, the grabbing region follows the mouse
8346 pointer and keeps the pointer at the center of region; otherwise, the region
8347 follows only when the mouse pointer reaches within <var>PIXELS</var> (greater than
8348 zero) to the edge of region.
8349 </p>
8350 <p>For example:
8351 </p><div class="example">
8352 <pre class="example">ffmpeg -f x11grab -follow_mouse centered -framerate 25 -video_size cif -i :0.0 out.mpg
8353 </pre></div>
8354
8355 <p>To follow only when the mouse pointer reaches within 100 pixels to edge:
8356 </p><div class="example">
8357 <pre class="example">ffmpeg -f x11grab -follow_mouse 100 -framerate 25 -video_size cif -i :0.0 out.mpg
8358 </pre></div>
8359
8360 </dd>
8361 <dt><samp>framerate</samp></dt>
8362 <dd><p>Set the grabbing frame rate. Default value is <code>ntsc</code>,
8363 corresponding to a frame rate of <code>30000/1001</code>.
8364 </p>
8365 </dd>
8366 <dt><samp>show_region</samp></dt>
8367 <dd><p>Show grabbed region on screen.
8368 </p>
8369 <p>If <var>show_region</var> is specified with <code>1</code>, then the grabbing
8370 region will be indicated on screen. With this option, it is easy to
8371 know what is being grabbed if only a portion of the screen is grabbed.
8372 </p>
8373 </dd>
8374 <dt><samp>region_border</samp></dt>
8375 <dd><p>Set the region border thickness if <samp>-show_region 1</samp> is used.
8376 Range is 1 to 128 and default is 3 (XCB-based x11grab only).
8377 </p>
8378 <p>For example:
8379 </p><div class="example">
8380 <pre class="example">ffmpeg -f x11grab -show_region 1 -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
8381 </pre></div>
8382
8383 <p>With <var>follow_mouse</var>:
8384 </p><div class="example">
8385 <pre class="example">ffmpeg -f x11grab -follow_mouse centered -show_region 1 -framerate 25 -video_size cif -i :0.0 out.mpg
8386 </pre></div>
8387
8388 </dd>
8389 <dt><samp>video_size</samp></dt>
8390 <dd><p>Set the video frame size. Default value is <code>vga</code>.
8391 </p>
8392 </dd>
8393 <dt><samp>use_shm</samp></dt>
8394 <dd><p>Use the MIT-SHM extension for shared memory. Default value is <code>1</code>.
8395 It may be necessary to disable it for remote displays (legacy x11grab
8396 only).
8397 </p></dd>
8398 </dl>
8399
8400 <a name="grab_005fx-grab_005fy-AVOption"></a>
8401 <h4 class="subsection">18.21.2 <var>grab_x</var> <var>grab_y</var> AVOption<span class="pull-right"><a class="anchor hidden-xs" href="#grab_005fx-grab_005fy-AVOption" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-grab_005fx-grab_005fy-AVOption" aria-hidden="true">TOC</a></span></h4>
8402
8403 <p>The syntax is:
8404 </p><div class="example">
8405 <pre class="example">-grab_x <var>x_offset</var> -grab_y <var>y_offset</var>
8406 </pre></div>
8407
8408 <p>Set the grabbing region coordinates. They are expressed as offset from the top left
8409 corner of the X11 window. The default value is 0.
8410 </p>
8411
8412 <a name="Resampler-Options"></a>
8413 <h2 class="chapter">19 Resampler Options<span class="pull-right"><a class="anchor hidden-xs" href="#Resampler-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Resampler-Options" aria-hidden="true">TOC</a></span></h2>
8414
8415 <p>The audio resampler supports the following named options.
8416 </p>
8417 <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
8418 FFmpeg tools, <var>option</var>=<var>value</var> for the aresample filter,
8419 by setting the value explicitly in the
8420 <code>SwrContext</code> options or using the <samp>libavutil/opt.h</samp> API for
8421 programmatic use.
8422 </p>
8423 <dl compact="compact">
8424 <dt><samp>ich, in_channel_count</samp></dt>
8425 <dd><p>Set the number of input channels. Default value is 0. Setting this
8426 value is not mandatory if the corresponding channel layout
8427 <samp>in_channel_layout</samp> is set.
8428 </p>
8429 </dd>
8430 <dt><samp>och, out_channel_count</samp></dt>
8431 <dd><p>Set the number of output channels. Default value is 0. Setting this
8432 value is not mandatory if the corresponding channel layout
8433 <samp>out_channel_layout</samp> is set.
8434 </p>
8435 </dd>
8436 <dt><samp>uch, used_channel_count</samp></dt>
8437 <dd><p>Set the number of used input channels. Default value is 0. This option is
8438 only used for special remapping.
8439 </p>
8440 </dd>
8441 <dt><samp>isr, in_sample_rate</samp></dt>
8442 <dd><p>Set the input sample rate. Default value is 0.
8443 </p>
8444 </dd>
8445 <dt><samp>osr, out_sample_rate</samp></dt>
8446 <dd><p>Set the output sample rate. Default value is 0.
8447 </p>
8448 </dd>
8449 <dt><samp>isf, in_sample_fmt</samp></dt>
8450 <dd><p>Specify the input sample format. It is set by default to <code>none</code>.
8451 </p>
8452 </dd>
8453 <dt><samp>osf, out_sample_fmt</samp></dt>
8454 <dd><p>Specify the output sample format. It is set by default to <code>none</code>.
8455 </p>
8456 </dd>
8457 <dt><samp>tsf, internal_sample_fmt</samp></dt>
8458 <dd><p>Set the internal sample format. Default value is <code>none</code>.
8459 This will automatically be chosen when it is not explicitly set.
8460 </p>
8461 </dd>
8462 <dt><samp>icl, in_channel_layout</samp></dt>
8463 <dt><samp>ocl, out_channel_layout</samp></dt>
8464 <dd><p>Set the input/output channel layout.
8465 </p>
8466 <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual</a>
8467 for the required syntax.
8468 </p>
8469 </dd>
8470 <dt><samp>clev, center_mix_level</samp></dt>
8471 <dd><p>Set the center mix level. It is a value expressed in deciBel, and must be
8472 in the interval [-32,32].
8473 </p>
8474 </dd>
8475 <dt><samp>slev, surround_mix_level</samp></dt>
8476 <dd><p>Set the surround mix level. It is a value expressed in deciBel, and must
8477 be in the interval [-32,32].
8478 </p>
8479 </dd>
8480 <dt><samp>lfe_mix_level</samp></dt>
8481 <dd><p>Set LFE mix into non LFE level. It is used when there is a LFE input but no
8482 LFE output. It is a value expressed in deciBel, and must
8483 be in the interval [-32,32].
8484 </p>
8485 </dd>
8486 <dt><samp>rmvol, rematrix_volume</samp></dt>
8487 <dd><p>Set rematrix volume. Default value is 1.0.
8488 </p>
8489 </dd>
8490 <dt><samp>rematrix_maxval</samp></dt>
8491 <dd><p>Set maximum output value for rematrixing.
8492 This can be used to prevent clipping vs. preventing volumn reduction
8493 A value of 1.0 prevents cliping.
8494 </p>
8495 </dd>
8496 <dt><samp>flags, swr_flags</samp></dt>
8497 <dd><p>Set flags used by the converter. Default value is 0.
8498 </p>
8499 <p>It supports the following individual flags:
8500 </p><dl compact="compact">
8501 <dt><samp>res</samp></dt>
8502 <dd><p>force resampling, this flag forces resampling to be used even when the
8503 input and output sample rates match.
8504 </p></dd>
8505 </dl>
8506
8507 </dd>
8508 <dt><samp>dither_scale</samp></dt>
8509 <dd><p>Set the dither scale. Default value is 1.
8510 </p>
8511 </dd>
8512 <dt><samp>dither_method</samp></dt>
8513 <dd><p>Set dither method. Default value is 0.
8514 </p>
8515 <p>Supported values:
8516 </p><dl compact="compact">
8517 <dt>&lsquo;<samp>rectangular</samp>&rsquo;</dt>
8518 <dd><p>select rectangular dither
8519 </p></dd>
8520 <dt>&lsquo;<samp>triangular</samp>&rsquo;</dt>
8521 <dd><p>select triangular dither
8522 </p></dd>
8523 <dt>&lsquo;<samp>triangular_hp</samp>&rsquo;</dt>
8524 <dd><p>select triangular dither with high pass
8525 </p></dd>
8526 <dt>&lsquo;<samp>lipshitz</samp>&rsquo;</dt>
8527 <dd><p>select lipshitz noise shaping dither
8528 </p></dd>
8529 <dt>&lsquo;<samp>shibata</samp>&rsquo;</dt>
8530 <dd><p>select shibata noise shaping dither
8531 </p></dd>
8532 <dt>&lsquo;<samp>low_shibata</samp>&rsquo;</dt>
8533 <dd><p>select low shibata noise shaping dither
8534 </p></dd>
8535 <dt>&lsquo;<samp>high_shibata</samp>&rsquo;</dt>
8536 <dd><p>select high shibata noise shaping dither
8537 </p></dd>
8538 <dt>&lsquo;<samp>f_weighted</samp>&rsquo;</dt>
8539 <dd><p>select f-weighted noise shaping dither
8540 </p></dd>
8541 <dt>&lsquo;<samp>modified_e_weighted</samp>&rsquo;</dt>
8542 <dd><p>select modified-e-weighted noise shaping dither
8543 </p></dd>
8544 <dt>&lsquo;<samp>improved_e_weighted</samp>&rsquo;</dt>
8545 <dd><p>select improved-e-weighted noise shaping dither
8546 </p>
8547 </dd>
8548 </dl>
8549
8550 </dd>
8551 <dt><samp>resampler</samp></dt>
8552 <dd><p>Set resampling engine. Default value is swr.
8553 </p>
8554 <p>Supported values:
8555 </p><dl compact="compact">
8556 <dt>&lsquo;<samp>swr</samp>&rsquo;</dt>
8557 <dd><p>select the native SW Resampler; filter options precision and cheby are not
8558 applicable in this case.
8559 </p></dd>
8560 <dt>&lsquo;<samp>soxr</samp>&rsquo;</dt>
8561 <dd><p>select the SoX Resampler (where available); compensation, and filter options
8562 filter_size, phase_shift, filter_type &amp; kaiser_beta, are not applicable in this
8563 case.
8564 </p></dd>
8565 </dl>
8566
8567 </dd>
8568 <dt><samp>filter_size</samp></dt>
8569 <dd><p>For swr only, set resampling filter size, default value is 32.
8570 </p>
8571 </dd>
8572 <dt><samp>phase_shift</samp></dt>
8573 <dd><p>For swr only, set resampling phase shift, default value is 10, and must be in
8574 the interval [0,30].
8575 </p>
8576 </dd>
8577 <dt><samp>linear_interp</samp></dt>
8578 <dd><p>Use Linear Interpolation if set to 1, default value is 0.
8579 </p>
8580 </dd>
8581 <dt><samp>cutoff</samp></dt>
8582 <dd><p>Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
8583 value between 0 and 1.  Default value is 0.97 with swr, and 0.91 with soxr
8584 (which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
8585 </p>
8586 </dd>
8587 <dt><samp>precision</samp></dt>
8588 <dd><p>For soxr only, the precision in bits to which the resampled signal will be
8589 calculated.  The default value of 20 (which, with suitable dithering, is
8590 appropriate for a destination bit-depth of 16) gives SoX&rsquo;s &rsquo;High Quality&rsquo;; a
8591 value of 28 gives SoX&rsquo;s &rsquo;Very High Quality&rsquo;.
8592 </p>
8593 </dd>
8594 <dt><samp>cheby</samp></dt>
8595 <dd><p>For soxr only, selects passband rolloff none (Chebyshev) &amp; higher-precision
8596 approximation for &rsquo;irrational&rsquo; ratios. Default value is 0.
8597 </p>
8598 </dd>
8599 <dt><samp>async</samp></dt>
8600 <dd><p>For swr only, simple 1 parameter audio sync to timestamps using stretching,
8601 squeezing, filling and trimming. Setting this to 1 will enable filling and
8602 trimming, larger values represent the maximum amount in samples that the data
8603 may be stretched or squeezed for each second.
8604 Default value is 0, thus no compensation is applied to make the samples match
8605 the audio timestamps.
8606 </p>
8607 </dd>
8608 <dt><samp>first_pts</samp></dt>
8609 <dd><p>For swr only, assume the first pts should be this value. The time unit is 1 / sample rate.
8610 This allows for padding/trimming at the start of stream. By default, no
8611 assumption is made about the first frame&rsquo;s expected pts, so no padding or
8612 trimming is done. For example, this could be set to 0 to pad the beginning with
8613 silence if an audio stream starts after the video stream or to trim any samples
8614 with a negative pts due to encoder delay.
8615 </p>
8616 </dd>
8617 <dt><samp>min_comp</samp></dt>
8618 <dd><p>For swr only, set the minimum difference between timestamps and audio data (in
8619 seconds) to trigger stretching/squeezing/filling or trimming of the
8620 data to make it match the timestamps. The default is that
8621 stretching/squeezing/filling and trimming is disabled
8622 (<samp>min_comp</samp> = <code>FLT_MAX</code>).
8623 </p>
8624 </dd>
8625 <dt><samp>min_hard_comp</samp></dt>
8626 <dd><p>For swr only, set the minimum difference between timestamps and audio data (in
8627 seconds) to trigger adding/dropping samples to make it match the
8628 timestamps.  This option effectively is a threshold to select between
8629 hard (trim/fill) and soft (squeeze/stretch) compensation. Note that
8630 all compensation is by default disabled through <samp>min_comp</samp>.
8631 The default is 0.1.
8632 </p>
8633 </dd>
8634 <dt><samp>comp_duration</samp></dt>
8635 <dd><p>For swr only, set duration (in seconds) over which data is stretched/squeezed
8636 to make it match the timestamps. Must be a non-negative double float value,
8637 default value is 1.0.
8638 </p>
8639 </dd>
8640 <dt><samp>max_soft_comp</samp></dt>
8641 <dd><p>For swr only, set maximum factor by which data is stretched/squeezed to make it
8642 match the timestamps. Must be a non-negative double float value, default value
8643 is 0.
8644 </p>
8645 </dd>
8646 <dt><samp>matrix_encoding</samp></dt>
8647 <dd><p>Select matrixed stereo encoding.
8648 </p>
8649 <p>It accepts the following values:
8650 </p><dl compact="compact">
8651 <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
8652 <dd><p>select none
8653 </p></dd>
8654 <dt>&lsquo;<samp>dolby</samp>&rsquo;</dt>
8655 <dd><p>select Dolby
8656 </p></dd>
8657 <dt>&lsquo;<samp>dplii</samp>&rsquo;</dt>
8658 <dd><p>select Dolby Pro Logic II
8659 </p></dd>
8660 </dl>
8661
8662 <p>Default value is <code>none</code>.
8663 </p>
8664 </dd>
8665 <dt><samp>filter_type</samp></dt>
8666 <dd><p>For swr only, select resampling filter type. This only affects resampling
8667 operations.
8668 </p>
8669 <p>It accepts the following values:
8670 </p><dl compact="compact">
8671 <dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
8672 <dd><p>select cubic
8673 </p></dd>
8674 <dt>&lsquo;<samp>blackman_nuttall</samp>&rsquo;</dt>
8675 <dd><p>select Blackman Nuttall Windowed Sinc
8676 </p></dd>
8677 <dt>&lsquo;<samp>kaiser</samp>&rsquo;</dt>
8678 <dd><p>select Kaiser Windowed Sinc
8679 </p></dd>
8680 </dl>
8681
8682 </dd>
8683 <dt><samp>kaiser_beta</samp></dt>
8684 <dd><p>For swr only, set Kaiser Window Beta value. Must be an integer in the
8685 interval [2,16], default value is 9.
8686 </p>
8687 </dd>
8688 <dt><samp>output_sample_bits</samp></dt>
8689 <dd><p>For swr only, set number of used output sample bits for dithering. Must be an integer in the
8690 interval [0,64], default value is 0, which means it&rsquo;s not used.
8691 </p>
8692 </dd>
8693 </dl>
8694
8695 <a name="scaler_005foptions"></a><a name="Scaler-Options"></a>
8696 <h2 class="chapter">20 Scaler Options<span class="pull-right"><a class="anchor hidden-xs" href="#Scaler-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Scaler-Options" aria-hidden="true">TOC</a></span></h2>
8697
8698 <p>The video scaler supports the following named options.
8699 </p>
8700 <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
8701 FFmpeg tools. For programmatic use, they can be set explicitly in the
8702 <code>SwsContext</code> options or through the <samp>libavutil/opt.h</samp> API.
8703 </p>
8704 <dl compact="compact">
8705 <dd>
8706 <a name="sws_005fflags"></a></dd>
8707 <dt><samp>sws_flags</samp></dt>
8708 <dd><p>Set the scaler flags. This is also used to set the scaling
8709 algorithm. Only a single algorithm should be selected.
8710 </p>
8711 <p>It accepts the following values:
8712 </p><dl compact="compact">
8713 <dt>&lsquo;<samp>fast_bilinear</samp>&rsquo;</dt>
8714 <dd><p>Select fast bilinear scaling algorithm.
8715 </p>
8716 </dd>
8717 <dt>&lsquo;<samp>bilinear</samp>&rsquo;</dt>
8718 <dd><p>Select bilinear scaling algorithm.
8719 </p>
8720 </dd>
8721 <dt>&lsquo;<samp>bicubic</samp>&rsquo;</dt>
8722 <dd><p>Select bicubic scaling algorithm.
8723 </p>
8724 </dd>
8725 <dt>&lsquo;<samp>experimental</samp>&rsquo;</dt>
8726 <dd><p>Select experimental scaling algorithm.
8727 </p>
8728 </dd>
8729 <dt>&lsquo;<samp>neighbor</samp>&rsquo;</dt>
8730 <dd><p>Select nearest neighbor rescaling algorithm.
8731 </p>
8732 </dd>
8733 <dt>&lsquo;<samp>area</samp>&rsquo;</dt>
8734 <dd><p>Select averaging area rescaling algorithm.
8735 </p>
8736 </dd>
8737 <dt>&lsquo;<samp>bicublin</samp>&rsquo;</dt>
8738 <dd><p>Select bicubic scaling algorithm for the luma component, bilinear for
8739 chroma components.
8740 </p>
8741 </dd>
8742 <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
8743 <dd><p>Select Gaussian rescaling algorithm.
8744 </p>
8745 </dd>
8746 <dt>&lsquo;<samp>sinc</samp>&rsquo;</dt>
8747 <dd><p>Select sinc rescaling algorithm.
8748 </p>
8749 </dd>
8750 <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
8751 <dd><p>Select lanczos rescaling algorithm.
8752 </p>
8753 </dd>
8754 <dt>&lsquo;<samp>spline</samp>&rsquo;</dt>
8755 <dd><p>Select natural bicubic spline rescaling algorithm.
8756 </p>
8757 </dd>
8758 <dt>&lsquo;<samp>print_info</samp>&rsquo;</dt>
8759 <dd><p>Enable printing/debug logging.
8760 </p>
8761 </dd>
8762 <dt>&lsquo;<samp>accurate_rnd</samp>&rsquo;</dt>
8763 <dd><p>Enable accurate rounding.
8764 </p>
8765 </dd>
8766 <dt>&lsquo;<samp>full_chroma_int</samp>&rsquo;</dt>
8767 <dd><p>Enable full chroma interpolation.
8768 </p>
8769 </dd>
8770 <dt>&lsquo;<samp>full_chroma_inp</samp>&rsquo;</dt>
8771 <dd><p>Select full chroma input.
8772 </p>
8773 </dd>
8774 <dt>&lsquo;<samp>bitexact</samp>&rsquo;</dt>
8775 <dd><p>Enable bitexact output.
8776 </p></dd>
8777 </dl>
8778
8779 </dd>
8780 <dt><samp>srcw</samp></dt>
8781 <dd><p>Set source width.
8782 </p>
8783 </dd>
8784 <dt><samp>srch</samp></dt>
8785 <dd><p>Set source height.
8786 </p>
8787 </dd>
8788 <dt><samp>dstw</samp></dt>
8789 <dd><p>Set destination width.
8790 </p>
8791 </dd>
8792 <dt><samp>dsth</samp></dt>
8793 <dd><p>Set destination height.
8794 </p>
8795 </dd>
8796 <dt><samp>src_format</samp></dt>
8797 <dd><p>Set source pixel format (must be expressed as an integer).
8798 </p>
8799 </dd>
8800 <dt><samp>dst_format</samp></dt>
8801 <dd><p>Set destination pixel format (must be expressed as an integer).
8802 </p>
8803 </dd>
8804 <dt><samp>src_range</samp></dt>
8805 <dd><p>Select source range.
8806 </p>
8807 </dd>
8808 <dt><samp>dst_range</samp></dt>
8809 <dd><p>Select destination range.
8810 </p>
8811 </dd>
8812 <dt><samp>param0, param1</samp></dt>
8813 <dd><p>Set scaling algorithm parameters. The specified values are specific of
8814 some scaling algorithms and ignored by others. The specified values
8815 are floating point number values.
8816 </p>
8817 </dd>
8818 <dt><samp>sws_dither</samp></dt>
8819 <dd><p>Set the dithering algorithm. Accepts one of the following
8820 values. Default value is &lsquo;<samp>auto</samp>&rsquo;.
8821 </p>
8822 <dl compact="compact">
8823 <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
8824 <dd><p>automatic choice
8825 </p>
8826 </dd>
8827 <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
8828 <dd><p>no dithering
8829 </p>
8830 </dd>
8831 <dt>&lsquo;<samp>bayer</samp>&rsquo;</dt>
8832 <dd><p>bayer dither
8833 </p>
8834 </dd>
8835 <dt>&lsquo;<samp>ed</samp>&rsquo;</dt>
8836 <dd><p>error diffusion dither
8837 </p>
8838 </dd>
8839 <dt>&lsquo;<samp>a_dither</samp>&rsquo;</dt>
8840 <dd><p>arithmetic dither, based using addition
8841 </p>
8842 </dd>
8843 <dt>&lsquo;<samp>x_dither</samp>&rsquo;</dt>
8844 <dd><p>arithmetic dither, based using xor (more random/less apparent patterning that
8845 a_dither).
8846 </p>
8847 </dd>
8848 </dl>
8849
8850 </dd>
8851 </dl>
8852
8853 <a name="Filtering-Introduction"></a>
8854 <h2 class="chapter">21 Filtering Introduction<span class="pull-right"><a class="anchor hidden-xs" href="#Filtering-Introduction" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Filtering-Introduction" aria-hidden="true">TOC</a></span></h2>
8855
8856 <p>Filtering in FFmpeg is enabled through the libavfilter library.
8857 </p>
8858 <p>In libavfilter, a filter can have multiple inputs and multiple
8859 outputs.
8860 To illustrate the sorts of things that are possible, we consider the
8861 following filtergraph.
8862 </p>
8863 <pre class="verbatim">                [main]
8864 input --&gt; split ---------------------&gt; overlay --&gt; output
8865             |                             ^
8866             |[tmp]                  [flip]|
8867             +-----&gt; crop --&gt; vflip -------+
8868 </pre>
8869 <p>This filtergraph splits the input stream in two streams, then sends one
8870 stream through the crop filter and the vflip filter, before merging it
8871 back with the other stream by overlaying it on top. You can use the
8872 following command to achieve this:
8873 </p>
8874 <div class="example">
8875 <pre class="example">ffmpeg -i INPUT -vf &quot;split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2&quot; OUTPUT
8876 </pre></div>
8877
8878 <p>The result will be that the top half of the video is mirrored
8879 onto the bottom half of the output video.
8880 </p>
8881 <p>Filters in the same linear chain are separated by commas, and distinct
8882 linear chains of filters are separated by semicolons. In our example,
8883 <var>crop,vflip</var> are in one linear chain, <var>split</var> and
8884 <var>overlay</var> are separately in another. The points where the linear
8885 chains join are labelled by names enclosed in square brackets. In the
8886 example, the split filter generates two outputs that are associated to
8887 the labels <var>[main]</var> and <var>[tmp]</var>.
8888 </p>
8889 <p>The stream sent to the second output of <var>split</var>, labelled as
8890 <var>[tmp]</var>, is processed through the <var>crop</var> filter, which crops
8891 away the lower half part of the video, and then vertically flipped. The
8892 <var>overlay</var> filter takes in input the first unchanged output of the
8893 split filter (which was labelled as <var>[main]</var>), and overlay on its
8894 lower half the output generated by the <var>crop,vflip</var> filterchain.
8895 </p>
8896 <p>Some filters take in input a list of parameters: they are specified
8897 after the filter name and an equal sign, and are separated from each other
8898 by a colon.
8899 </p>
8900 <p>There exist so-called <var>source filters</var> that do not have an
8901 audio/video input, and <var>sink filters</var> that will not have audio/video
8902 output.
8903 </p>
8904
8905 <a name="graph2dot"></a>
8906 <h2 class="chapter">22 graph2dot<span class="pull-right"><a class="anchor hidden-xs" href="#graph2dot" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-graph2dot" aria-hidden="true">TOC</a></span></h2>
8907
8908 <p>The <samp>graph2dot</samp> program included in the FFmpeg <samp>tools</samp>
8909 directory can be used to parse a filtergraph description and issue a
8910 corresponding textual representation in the dot language.
8911 </p>
8912 <p>Invoke the command:
8913 </p><div class="example">
8914 <pre class="example">graph2dot -h
8915 </pre></div>
8916
8917 <p>to see how to use <samp>graph2dot</samp>.
8918 </p>
8919 <p>You can then pass the dot description to the <samp>dot</samp> program (from
8920 the graphviz suite of programs) and obtain a graphical representation
8921 of the filtergraph.
8922 </p>
8923 <p>For example the sequence of commands:
8924 </p><div class="example">
8925 <pre class="example">echo <var>GRAPH_DESCRIPTION</var> | \
8926 tools/graph2dot -o graph.tmp &amp;&amp; \
8927 dot -Tpng graph.tmp -o graph.png &amp;&amp; \
8928 display graph.png
8929 </pre></div>
8930
8931 <p>can be used to create and display an image representing the graph
8932 described by the <var>GRAPH_DESCRIPTION</var> string. Note that this string must be
8933 a complete self-contained graph, with its inputs and outputs explicitly defined.
8934 For example if your command line is of the form:
8935 </p><div class="example">
8936 <pre class="example">ffmpeg -i infile -vf scale=640:360 outfile
8937 </pre></div>
8938 <p>your <var>GRAPH_DESCRIPTION</var> string will need to be of the form:
8939 </p><div class="example">
8940 <pre class="example">nullsrc,scale=640:360,nullsink
8941 </pre></div>
8942 <p>you may also need to set the <var>nullsrc</var> parameters and add a <var>format</var>
8943 filter in order to simulate a specific input file.
8944 </p>
8945
8946 <a name="Filtergraph-description"></a>
8947 <h2 class="chapter">23 Filtergraph description<span class="pull-right"><a class="anchor hidden-xs" href="#Filtergraph-description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Filtergraph-description" aria-hidden="true">TOC</a></span></h2>
8948
8949 <p>A filtergraph is a directed graph of connected filters. It can contain
8950 cycles, and there can be multiple links between a pair of
8951 filters. Each link has one input pad on one side connecting it to one
8952 filter from which it takes its input, and one output pad on the other
8953 side connecting it to one filter accepting its output.
8954 </p>
8955 <p>Each filter in a filtergraph is an instance of a filter class
8956 registered in the application, which defines the features and the
8957 number of input and output pads of the filter.
8958 </p>
8959 <p>A filter with no input pads is called a &quot;source&quot;, and a filter with no
8960 output pads is called a &quot;sink&quot;.
8961 </p>
8962 <a name="Filtergraph-syntax"></a><a name="Filtergraph-syntax-1"></a>
8963 <h3 class="section">23.1 Filtergraph syntax<span class="pull-right"><a class="anchor hidden-xs" href="#Filtergraph-syntax-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Filtergraph-syntax-1" aria-hidden="true">TOC</a></span></h3>
8964
8965 <p>A filtergraph has a textual representation, which is recognized by the
8966 <samp>-filter</samp>/<samp>-vf</samp>/<samp>-af</samp> and
8967 <samp>-filter_complex</samp> options in <code>ffmpeg</code> and
8968 <samp>-vf</samp>/<samp>-af</samp> in <code>ffplay</code>, and by the
8969 <code>avfilter_graph_parse_ptr()</code> function defined in
8970 <samp>libavfilter/avfilter.h</samp>.
8971 </p>
8972 <p>A filterchain consists of a sequence of connected filters, each one
8973 connected to the previous one in the sequence. A filterchain is
8974 represented by a list of &quot;,&quot;-separated filter descriptions.
8975 </p>
8976 <p>A filtergraph consists of a sequence of filterchains. A sequence of
8977 filterchains is represented by a list of &quot;;&quot;-separated filterchain
8978 descriptions.
8979 </p>
8980 <p>A filter is represented by a string of the form:
8981 [<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>]
8982 </p>
8983 <p><var>filter_name</var> is the name of the filter class of which the
8984 described filter is an instance of, and has to be the name of one of
8985 the filter classes registered in the program.
8986 The name of the filter class is optionally followed by a string
8987 &quot;=<var>arguments</var>&quot;.
8988 </p>
8989 <p><var>arguments</var> is a string which contains the parameters used to
8990 initialize the filter instance. It may have one of two forms:
8991 </p><ul>
8992 <li> A &rsquo;:&rsquo;-separated list of <var>key=value</var> pairs.
8993
8994 </li><li> A &rsquo;:&rsquo;-separated list of <var>value</var>. In this case, the keys are assumed to be
8995 the option names in the order they are declared. E.g. the <code>fade</code> filter
8996 declares three options in this order &ndash; <samp>type</samp>, <samp>start_frame</samp> and
8997 <samp>nb_frames</samp>. Then the parameter list <var>in:0:30</var> means that the value
8998 <var>in</var> is assigned to the option <samp>type</samp>, <var>0</var> to
8999 <samp>start_frame</samp> and <var>30</var> to <samp>nb_frames</samp>.
9000
9001 </li><li> A &rsquo;:&rsquo;-separated list of mixed direct <var>value</var> and long <var>key=value</var>
9002 pairs. The direct <var>value</var> must precede the <var>key=value</var> pairs, and
9003 follow the same constraints order of the previous point. The following
9004 <var>key=value</var> pairs can be set in any preferred order.
9005
9006 </li></ul>
9007
9008 <p>If the option value itself is a list of items (e.g. the <code>format</code> filter
9009 takes a list of pixel formats), the items in the list are usually separated by
9010 &lsquo;<samp>|</samp>&rsquo;.
9011 </p>
9012 <p>The list of arguments can be quoted using the character &lsquo;<samp>'</samp>&rsquo; as initial
9013 and ending mark, and the character &lsquo;<samp>\</samp>&rsquo; for escaping the characters
9014 within the quoted text; otherwise the argument string is considered
9015 terminated when the next special character (belonging to the set
9016 &lsquo;<samp>[]=;,</samp>&rsquo;) is encountered.
9017 </p>
9018 <p>The name and arguments of the filter are optionally preceded and
9019 followed by a list of link labels.
9020 A link label allows one to name a link and associate it to a filter output
9021 or input pad. The preceding labels <var>in_link_1</var>
9022 ... <var>in_link_N</var>, are associated to the filter input pads,
9023 the following labels <var>out_link_1</var> ... <var>out_link_M</var>, are
9024 associated to the output pads.
9025 </p>
9026 <p>When two link labels with the same name are found in the
9027 filtergraph, a link between the corresponding input and output pad is
9028 created.
9029 </p>
9030 <p>If an output pad is not labelled, it is linked by default to the first
9031 unlabelled input pad of the next filter in the filterchain.
9032 For example in the filterchain
9033 </p><div class="example">
9034 <pre class="example">nullsrc, split[L1], [L2]overlay, nullsink
9035 </pre></div>
9036 <p>the split filter instance has two output pads, and the overlay filter
9037 instance two input pads. The first output pad of split is labelled
9038 &quot;L1&quot;, the first input pad of overlay is labelled &quot;L2&quot;, and the second
9039 output pad of split is linked to the second input pad of overlay,
9040 which are both unlabelled.
9041 </p>
9042 <p>In a filter description, if the input label of the first filter is not
9043 specified, &quot;in&quot; is assumed; if the output label of the last filter is not
9044 specified, &quot;out&quot; is assumed.
9045 </p>
9046 <p>In a complete filterchain all the unlabelled filter input and output
9047 pads must be connected. A filtergraph is considered valid if all the
9048 filter input and output pads of all the filterchains are connected.
9049 </p>
9050 <p>Libavfilter will automatically insert <a href="#scale">scale</a> filters where format
9051 conversion is required. It is possible to specify swscale flags
9052 for those automatically inserted scalers by prepending
9053 <code>sws_flags=<var>flags</var>;</code>
9054 to the filtergraph description.
9055 </p>
9056 <p>Here is a BNF description of the filtergraph syntax:
9057 </p><div class="example">
9058 <pre class="example"><var>NAME</var>             ::= sequence of alphanumeric characters and '_'
9059 <var>LINKLABEL</var>        ::= &quot;[&quot; <var>NAME</var> &quot;]&quot;
9060 <var>LINKLABELS</var>       ::= <var>LINKLABEL</var> [<var>LINKLABELS</var>]
9061 <var>FILTER_ARGUMENTS</var> ::= sequence of chars (possibly quoted)
9062 <var>FILTER</var>           ::= [<var>LINKLABELS</var>] <var>NAME</var> [&quot;=&quot; <var>FILTER_ARGUMENTS</var>] [<var>LINKLABELS</var>]
9063 <var>FILTERCHAIN</var>      ::= <var>FILTER</var> [,<var>FILTERCHAIN</var>]
9064 <var>FILTERGRAPH</var>      ::= [sws_flags=<var>flags</var>;] <var>FILTERCHAIN</var> [;<var>FILTERGRAPH</var>]
9065 </pre></div>
9066
9067 <a name="Notes-on-filtergraph-escaping"></a>
9068 <h3 class="section">23.2 Notes on filtergraph escaping<span class="pull-right"><a class="anchor hidden-xs" href="#Notes-on-filtergraph-escaping" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Notes-on-filtergraph-escaping" aria-hidden="true">TOC</a></span></h3>
9069
9070 <p>Filtergraph description composition entails several levels of
9071 escaping. See <a href="ffmpeg-utils.html#quoting_005fand_005fescaping">(ffmpeg-utils)the &quot;Quoting and escaping&quot;
9072 section in the ffmpeg-utils(1) manual</a> for more
9073 information about the employed escaping procedure.
9074 </p>
9075 <p>A first level escaping affects the content of each filter option
9076 value, which may contain the special character <code>:</code> used to
9077 separate values, or one of the escaping characters <code>\'</code>.
9078 </p>
9079 <p>A second level escaping affects the whole filter description, which
9080 may contain the escaping characters <code>\'</code> or the special
9081 characters <code>[],;</code> used by the filtergraph description.
9082 </p>
9083 <p>Finally, when you specify a filtergraph on a shell commandline, you
9084 need to perform a third level escaping for the shell special
9085 characters contained within it.
9086 </p>
9087 <p>For example, consider the following string to be embedded in
9088 the <a href="#drawtext">drawtext</a> filter description <samp>text</samp> value:
9089 </p><div class="example">
9090 <pre class="example">this is a 'string': may contain one, or more, special characters
9091 </pre></div>
9092
9093 <p>This string contains the <code>'</code> special escaping character, and the
9094 <code>:</code> special character, so it needs to be escaped in this way:
9095 </p><div class="example">
9096 <pre class="example">text=this is a \'string\'\: may contain one, or more, special characters
9097 </pre></div>
9098
9099 <p>A second level of escaping is required when embedding the filter
9100 description in a filtergraph description, in order to escape all the
9101 filtergraph special characters. Thus the example above becomes:
9102 </p><div class="example">
9103 <pre class="example">drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
9104 </pre></div>
9105 <p>(note that in addition to the <code>\'</code> escaping special characters,
9106 also <code>,</code> needs to be escaped).
9107 </p>
9108 <p>Finally an additional level of escaping is needed when writing the
9109 filtergraph description in a shell command, which depends on the
9110 escaping rules of the adopted shell. For example, assuming that
9111 <code>\</code> is special and needs to be escaped with another <code>\</code>, the
9112 previous string will finally result in:
9113 </p><div class="example">
9114 <pre class="example">-vf &quot;drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters&quot;
9115 </pre></div>
9116
9117 <a name="Timeline-editing"></a>
9118 <h2 class="chapter">24 Timeline editing<span class="pull-right"><a class="anchor hidden-xs" href="#Timeline-editing" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Timeline-editing" aria-hidden="true">TOC</a></span></h2>
9119
9120 <p>Some filters support a generic <samp>enable</samp> option. For the filters
9121 supporting timeline editing, this option can be set to an expression which is
9122 evaluated before sending a frame to the filter. If the evaluation is non-zero,
9123 the filter will be enabled, otherwise the frame will be sent unchanged to the
9124 next filter in the filtergraph.
9125 </p>
9126 <p>The expression accepts the following values:
9127 </p><dl compact="compact">
9128 <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
9129 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
9130 </p>
9131 </dd>
9132 <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
9133 <dd><p>sequential number of the input frame, starting from 0
9134 </p>
9135 </dd>
9136 <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
9137 <dd><p>the position in the file of the input frame, NAN if unknown
9138 </p>
9139 </dd>
9140 <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
9141 <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
9142 <dd><p>width and height of the input frame if video
9143 </p></dd>
9144 </dl>
9145
9146 <p>Additionally, these filters support an <samp>enable</samp> command that can be used
9147 to re-define the expression.
9148 </p>
9149 <p>Like any other filtering option, the <samp>enable</samp> option follows the same
9150 rules.
9151 </p>
9152 <p>For example, to enable a blur filter (<a href="#smartblur">smartblur</a>) from 10 seconds to 3
9153 minutes, and a <a href="#curves">curves</a> filter starting at 3 seconds:
9154 </p><div class="example">
9155 <pre class="example">smartblur = enable='between(t,10,3*60)',
9156 curves    = enable='gte(t,3)' : preset=cross_process
9157 </pre></div>
9158
9159
9160 <a name="Audio-Filters"></a>
9161 <h2 class="chapter">25 Audio Filters<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Filters" aria-hidden="true">TOC</a></span></h2>
9162
9163 <p>When you configure your FFmpeg build, you can disable any of the
9164 existing filters using <code>--disable-filters</code>.
9165 The configure output will show the audio filters included in your
9166 build.
9167 </p>
9168 <p>Below is a description of the currently available audio filters.
9169 </p>
9170 <a name="adelay"></a>
9171 <h3 class="section">25.1 adelay<span class="pull-right"><a class="anchor hidden-xs" href="#adelay" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adelay" aria-hidden="true">TOC</a></span></h3>
9172
9173 <p>Delay one or more audio channels.
9174 </p>
9175 <p>Samples in delayed channel are filled with silence.
9176 </p>
9177 <p>The filter accepts the following option:
9178 </p>
9179 <dl compact="compact">
9180 <dt><samp>delays</samp></dt>
9181 <dd><p>Set list of delays in milliseconds for each channel separated by &rsquo;|&rsquo;.
9182 At least one delay greater than 0 should be provided.
9183 Unused delays will be silently ignored. If number of given delays is
9184 smaller than number of channels all remaining channels will not be delayed.
9185 </p></dd>
9186 </dl>
9187
9188 <a name="Examples-12"></a>
9189 <h4 class="subsection">25.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-12" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-12" aria-hidden="true">TOC</a></span></h4>
9190
9191 <ul>
9192 <li> Delay first channel by 1.5 seconds, the third channel by 0.5 seconds and leave
9193 the second channel (and any other channels that may be present) unchanged.
9194 <div class="example">
9195 <pre class="example">adelay=1500|0|500
9196 </pre></div>
9197 </li></ul>
9198
9199 <a name="aecho"></a>
9200 <h3 class="section">25.2 aecho<span class="pull-right"><a class="anchor hidden-xs" href="#aecho" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aecho" aria-hidden="true">TOC</a></span></h3>
9201
9202 <p>Apply echoing to the input audio.
9203 </p>
9204 <p>Echoes are reflected sound and can occur naturally amongst mountains
9205 (and sometimes large buildings) when talking or shouting; digital echo
9206 effects emulate this behaviour and are often used to help fill out the
9207 sound of a single instrument or vocal. The time difference between the
9208 original signal and the reflection is the <code>delay</code>, and the
9209 loudness of the reflected signal is the <code>decay</code>.
9210 Multiple echoes can have different delays and decays.
9211 </p>
9212 <p>A description of the accepted parameters follows.
9213 </p>
9214 <dl compact="compact">
9215 <dt><samp>in_gain</samp></dt>
9216 <dd><p>Set input gain of reflected signal. Default is <code>0.6</code>.
9217 </p>
9218 </dd>
9219 <dt><samp>out_gain</samp></dt>
9220 <dd><p>Set output gain of reflected signal. Default is <code>0.3</code>.
9221 </p>
9222 </dd>
9223 <dt><samp>delays</samp></dt>
9224 <dd><p>Set list of time intervals in milliseconds between original signal and reflections
9225 separated by &rsquo;|&rsquo;. Allowed range for each <code>delay</code> is <code>(0 - 90000.0]</code>.
9226 Default is <code>1000</code>.
9227 </p>
9228 </dd>
9229 <dt><samp>decays</samp></dt>
9230 <dd><p>Set list of loudnesses of reflected signals separated by &rsquo;|&rsquo;.
9231 Allowed range for each <code>decay</code> is <code>(0 - 1.0]</code>.
9232 Default is <code>0.5</code>.
9233 </p></dd>
9234 </dl>
9235
9236 <a name="Examples-13"></a>
9237 <h4 class="subsection">25.2.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-13" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-13" aria-hidden="true">TOC</a></span></h4>
9238
9239 <ul>
9240 <li> Make it sound as if there are twice as many instruments as are actually playing:
9241 <div class="example">
9242 <pre class="example">aecho=0.8:0.88:60:0.4
9243 </pre></div>
9244
9245 </li><li> If delay is very short, then it sound like a (metallic) robot playing music:
9246 <div class="example">
9247 <pre class="example">aecho=0.8:0.88:6:0.4
9248 </pre></div>
9249
9250 </li><li> A longer delay will sound like an open air concert in the mountains:
9251 <div class="example">
9252 <pre class="example">aecho=0.8:0.9:1000:0.3
9253 </pre></div>
9254
9255 </li><li> Same as above but with one more mountain:
9256 <div class="example">
9257 <pre class="example">aecho=0.8:0.9:1000|1800:0.3|0.25
9258 </pre></div>
9259 </li></ul>
9260
9261 <a name="aeval"></a>
9262 <h3 class="section">25.3 aeval<span class="pull-right"><a class="anchor hidden-xs" href="#aeval" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aeval" aria-hidden="true">TOC</a></span></h3>
9263
9264 <p>Modify an audio signal according to the specified expressions.
9265 </p>
9266 <p>This filter accepts one or more expressions (one for each channel),
9267 which are evaluated and used to modify a corresponding audio signal.
9268 </p>
9269 <p>It accepts the following parameters:
9270 </p>
9271 <dl compact="compact">
9272 <dt><samp>exprs</samp></dt>
9273 <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. If
9274 the number of input channels is greater than the number of
9275 expressions, the last specified expression is used for the remaining
9276 output channels.
9277 </p>
9278 </dd>
9279 <dt><samp>channel_layout, c</samp></dt>
9280 <dd><p>Set output channel layout. If not specified, the channel layout is
9281 specified by the number of expressions. If set to &lsquo;<samp>same</samp>&rsquo;, it will
9282 use by default the same input channel layout.
9283 </p></dd>
9284 </dl>
9285
9286 <p>Each expression in <var>exprs</var> can contain the following constants and functions:
9287 </p>
9288 <dl compact="compact">
9289 <dt><samp>ch</samp></dt>
9290 <dd><p>channel number of the current expression
9291 </p>
9292 </dd>
9293 <dt><samp>n</samp></dt>
9294 <dd><p>number of the evaluated sample, starting from 0
9295 </p>
9296 </dd>
9297 <dt><samp>s</samp></dt>
9298 <dd><p>sample rate
9299 </p>
9300 </dd>
9301 <dt><samp>t</samp></dt>
9302 <dd><p>time of the evaluated sample expressed in seconds
9303 </p>
9304 </dd>
9305 <dt><samp>nb_in_channels</samp></dt>
9306 <dt><samp>nb_out_channels</samp></dt>
9307 <dd><p>input and output number of channels
9308 </p>
9309 </dd>
9310 <dt><samp>val(CH)</samp></dt>
9311 <dd><p>the value of input channel with number <var>CH</var>
9312 </p></dd>
9313 </dl>
9314
9315 <p>Note: this filter is slow. For faster processing you should use a
9316 dedicated filter.
9317 </p>
9318 <a name="Examples-14"></a>
9319 <h4 class="subsection">25.3.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-14" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-14" aria-hidden="true">TOC</a></span></h4>
9320
9321 <ul>
9322 <li> Half volume:
9323 <div class="example">
9324 <pre class="example">aeval=val(ch)/2:c=same
9325 </pre></div>
9326
9327 </li><li> Invert phase of the second channel:
9328 <div class="example">
9329 <pre class="example">aeval=val(0)|-val(1)
9330 </pre></div>
9331 </li></ul>
9332
9333 <a name="afade"></a>
9334 <h3 class="section">25.4 afade<span class="pull-right"><a class="anchor hidden-xs" href="#afade" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afade" aria-hidden="true">TOC</a></span></h3>
9335
9336 <p>Apply fade-in/out effect to input audio.
9337 </p>
9338 <p>A description of the accepted parameters follows.
9339 </p>
9340 <dl compact="compact">
9341 <dt><samp>type, t</samp></dt>
9342 <dd><p>Specify the effect type, can be either <code>in</code> for fade-in, or
9343 <code>out</code> for a fade-out effect. Default is <code>in</code>.
9344 </p>
9345 </dd>
9346 <dt><samp>start_sample, ss</samp></dt>
9347 <dd><p>Specify the number of the start sample for starting to apply the fade
9348 effect. Default is 0.
9349 </p>
9350 </dd>
9351 <dt><samp>nb_samples, ns</samp></dt>
9352 <dd><p>Specify the number of samples for which the fade effect has to last. At
9353 the end of the fade-in effect the output audio will have the same
9354 volume as the input audio, at the end of the fade-out transition
9355 the output audio will be silence. Default is 44100.
9356 </p>
9357 </dd>
9358 <dt><samp>start_time, st</samp></dt>
9359 <dd><p>Specify the start time of the fade effect. Default is 0.
9360 The value must be specified as a time duration; see
9361 <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
9362 for the accepted syntax.
9363 If set this option is used instead of <var>start_sample</var>.
9364 </p>
9365 </dd>
9366 <dt><samp>duration, d</samp></dt>
9367 <dd><p>Specify the duration of the fade effect. See
9368 <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
9369 for the accepted syntax.
9370 At the end of the fade-in effect the output audio will have the same
9371 volume as the input audio, at the end of the fade-out transition
9372 the output audio will be silence.
9373 By default the duration is determined by <var>nb_samples</var>.
9374 If set this option is used instead of <var>nb_samples</var>.
9375 </p>
9376 </dd>
9377 <dt><samp>curve</samp></dt>
9378 <dd><p>Set curve for fade transition.
9379 </p>
9380 <p>It accepts the following values:
9381 </p><dl compact="compact">
9382 <dt><samp>tri</samp></dt>
9383 <dd><p>select triangular, linear slope (default)
9384 </p></dd>
9385 <dt><samp>qsin</samp></dt>
9386 <dd><p>select quarter of sine wave
9387 </p></dd>
9388 <dt><samp>hsin</samp></dt>
9389 <dd><p>select half of sine wave
9390 </p></dd>
9391 <dt><samp>esin</samp></dt>
9392 <dd><p>select exponential sine wave
9393 </p></dd>
9394 <dt><samp>log</samp></dt>
9395 <dd><p>select logarithmic
9396 </p></dd>
9397 <dt><samp>par</samp></dt>
9398 <dd><p>select inverted parabola
9399 </p></dd>
9400 <dt><samp>qua</samp></dt>
9401 <dd><p>select quadratic
9402 </p></dd>
9403 <dt><samp>cub</samp></dt>
9404 <dd><p>select cubic
9405 </p></dd>
9406 <dt><samp>squ</samp></dt>
9407 <dd><p>select square root
9408 </p></dd>
9409 <dt><samp>cbr</samp></dt>
9410 <dd><p>select cubic root
9411 </p></dd>
9412 </dl>
9413 </dd>
9414 </dl>
9415
9416 <a name="Examples-15"></a>
9417 <h4 class="subsection">25.4.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-15" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-15" aria-hidden="true">TOC</a></span></h4>
9418
9419 <ul>
9420 <li> Fade in first 15 seconds of audio:
9421 <div class="example">
9422 <pre class="example">afade=t=in:ss=0:d=15
9423 </pre></div>
9424
9425 </li><li> Fade out last 25 seconds of a 900 seconds audio:
9426 <div class="example">
9427 <pre class="example">afade=t=out:st=875:d=25
9428 </pre></div>
9429 </li></ul>
9430
9431 <a name="aformat"></a><a name="aformat-1"></a>
9432 <h3 class="section">25.5 aformat<span class="pull-right"><a class="anchor hidden-xs" href="#aformat-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aformat-1" aria-hidden="true">TOC</a></span></h3>
9433
9434 <p>Set output format constraints for the input audio. The framework will
9435 negotiate the most appropriate format to minimize conversions.
9436 </p>
9437 <p>It accepts the following parameters:
9438 </p><dl compact="compact">
9439 <dt><samp>sample_fmts</samp></dt>
9440 <dd><p>A &rsquo;|&rsquo;-separated list of requested sample formats.
9441 </p>
9442 </dd>
9443 <dt><samp>sample_rates</samp></dt>
9444 <dd><p>A &rsquo;|&rsquo;-separated list of requested sample rates.
9445 </p>
9446 </dd>
9447 <dt><samp>channel_layouts</samp></dt>
9448 <dd><p>A &rsquo;|&rsquo;-separated list of requested channel layouts.
9449 </p>
9450 <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual</a>
9451 for the required syntax.
9452 </p></dd>
9453 </dl>
9454
9455 <p>If a parameter is omitted, all values are allowed.
9456 </p>
9457 <p>Force the output to either unsigned 8-bit or signed 16-bit stereo
9458 </p><div class="example">
9459 <pre class="example">aformat=sample_fmts=u8|s16:channel_layouts=stereo
9460 </pre></div>
9461
9462 <a name="allpass"></a>
9463 <h3 class="section">25.6 allpass<span class="pull-right"><a class="anchor hidden-xs" href="#allpass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-allpass" aria-hidden="true">TOC</a></span></h3>
9464
9465 <p>Apply a two-pole all-pass filter with central frequency (in Hz)
9466 <var>frequency</var>, and filter-width <var>width</var>.
9467 An all-pass filter changes the audio&rsquo;s frequency to phase relationship
9468 without changing its frequency to amplitude relationship.
9469 </p>
9470 <p>The filter accepts the following options:
9471 </p>
9472 <dl compact="compact">
9473 <dt><samp>frequency, f</samp></dt>
9474 <dd><p>Set frequency in Hz.
9475 </p>
9476 </dd>
9477 <dt><samp>width_type</samp></dt>
9478 <dd><p>Set method to specify band-width of filter.
9479 </p><dl compact="compact">
9480 <dt><samp>h</samp></dt>
9481 <dd><p>Hz
9482 </p></dd>
9483 <dt><samp>q</samp></dt>
9484 <dd><p>Q-Factor
9485 </p></dd>
9486 <dt><samp>o</samp></dt>
9487 <dd><p>octave
9488 </p></dd>
9489 <dt><samp>s</samp></dt>
9490 <dd><p>slope
9491 </p></dd>
9492 </dl>
9493
9494 </dd>
9495 <dt><samp>width, w</samp></dt>
9496 <dd><p>Specify the band-width of a filter in width_type units.
9497 </p></dd>
9498 </dl>
9499
9500 <a name="amerge"></a>
9501 <h3 class="section">25.7 amerge<span class="pull-right"><a class="anchor hidden-xs" href="#amerge" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amerge" aria-hidden="true">TOC</a></span></h3>
9502
9503 <p>Merge two or more audio streams into a single multi-channel stream.
9504 </p>
9505 <p>The filter accepts the following options:
9506 </p>
9507 <dl compact="compact">
9508 <dt><samp>inputs</samp></dt>
9509 <dd><p>Set the number of inputs. Default is 2.
9510 </p>
9511 </dd>
9512 </dl>
9513
9514 <p>If the channel layouts of the inputs are disjoint, and therefore compatible,
9515 the channel layout of the output will be set accordingly and the channels
9516 will be reordered as necessary. If the channel layouts of the inputs are not
9517 disjoint, the output will have all the channels of the first input then all
9518 the channels of the second input, in that order, and the channel layout of
9519 the output will be the default value corresponding to the total number of
9520 channels.
9521 </p>
9522 <p>For example, if the first input is in 2.1 (FL+FR+LF) and the second input
9523 is FC+BL+BR, then the output will be in 5.1, with the channels in the
9524 following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the
9525 first input, b1 is the first channel of the second input).
9526 </p>
9527 <p>On the other hand, if both input are in stereo, the output channels will be
9528 in the default order: a1, a2, b1, b2, and the channel layout will be
9529 arbitrarily set to 4.0, which may or may not be the expected value.
9530 </p>
9531 <p>All inputs must have the same sample rate, and format.
9532 </p>
9533 <p>If inputs do not have the same duration, the output will stop with the
9534 shortest.
9535 </p>
9536 <a name="Examples-16"></a>
9537 <h4 class="subsection">25.7.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-16" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-16" aria-hidden="true">TOC</a></span></h4>
9538
9539 <ul>
9540 <li> Merge two mono files into a stereo stream:
9541 <div class="example">
9542 <pre class="example">amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
9543 </pre></div>
9544
9545 </li><li> Multiple merges assuming 1 video stream and 6 audio streams in <samp>input.mkv</samp>:
9546 <div class="example">
9547 <pre class="example">ffmpeg -i input.mkv -filter_complex &quot;[0:1][0:2][0:3][0:4][0:5][0:6] amerge=inputs=6&quot; -c:a pcm_s16le output.mkv
9548 </pre></div>
9549 </li></ul>
9550
9551 <a name="amix"></a>
9552 <h3 class="section">25.8 amix<span class="pull-right"><a class="anchor hidden-xs" href="#amix" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amix" aria-hidden="true">TOC</a></span></h3>
9553
9554 <p>Mixes multiple audio inputs into a single output.
9555 </p>
9556 <p>Note that this filter only supports float samples (the <var>amerge</var>
9557 and <var>pan</var> audio filters support many formats). If the <var>amix</var>
9558 input has integer samples then <a href="#aresample">aresample</a> will be automatically
9559 inserted to perform the conversion to float samples.
9560 </p>
9561 <p>For example
9562 </p><div class="example">
9563 <pre class="example">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
9564 </pre></div>
9565 <p>will mix 3 input audio streams to a single output with the same duration as the
9566 first input and a dropout transition time of 3 seconds.
9567 </p>
9568 <p>It accepts the following parameters:
9569 </p><dl compact="compact">
9570 <dt><samp>inputs</samp></dt>
9571 <dd><p>The number of inputs. If unspecified, it defaults to 2.
9572 </p>
9573 </dd>
9574 <dt><samp>duration</samp></dt>
9575 <dd><p>How to determine the end-of-stream.
9576 </p><dl compact="compact">
9577 <dt><samp>longest</samp></dt>
9578 <dd><p>The duration of the longest input. (default)
9579 </p>
9580 </dd>
9581 <dt><samp>shortest</samp></dt>
9582 <dd><p>The duration of the shortest input.
9583 </p>
9584 </dd>
9585 <dt><samp>first</samp></dt>
9586 <dd><p>The duration of the first input.
9587 </p>
9588 </dd>
9589 </dl>
9590
9591 </dd>
9592 <dt><samp>dropout_transition</samp></dt>
9593 <dd><p>The transition time, in seconds, for volume renormalization when an input
9594 stream ends. The default value is 2 seconds.
9595 </p>
9596 </dd>
9597 </dl>
9598
9599 <a name="anull"></a>
9600 <h3 class="section">25.9 anull<span class="pull-right"><a class="anchor hidden-xs" href="#anull" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anull" aria-hidden="true">TOC</a></span></h3>
9601
9602 <p>Pass the audio source unchanged to the output.
9603 </p>
9604 <a name="apad"></a>
9605 <h3 class="section">25.10 apad<span class="pull-right"><a class="anchor hidden-xs" href="#apad" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-apad" aria-hidden="true">TOC</a></span></h3>
9606
9607 <p>Pad the end of an audio stream with silence.
9608 </p>
9609 <p>This can be used together with <code>ffmpeg</code> <samp>-shortest</samp> to
9610 extend audio streams to the same length as the video stream.
9611 </p>
9612 <p>A description of the accepted options follows.
9613 </p>
9614 <dl compact="compact">
9615 <dt><samp>packet_size</samp></dt>
9616 <dd><p>Set silence packet size. Default value is 4096.
9617 </p>
9618 </dd>
9619 <dt><samp>pad_len</samp></dt>
9620 <dd><p>Set the number of samples of silence to add to the end. After the
9621 value is reached, the stream is terminated. This option is mutually
9622 exclusive with <samp>whole_len</samp>.
9623 </p>
9624 </dd>
9625 <dt><samp>whole_len</samp></dt>
9626 <dd><p>Set the minimum total number of samples in the output audio stream. If
9627 the value is longer than the input audio length, silence is added to
9628 the end, until the value is reached. This option is mutually exclusive
9629 with <samp>pad_len</samp>.
9630 </p></dd>
9631 </dl>
9632
9633 <p>If neither the <samp>pad_len</samp> nor the <samp>whole_len</samp> option is
9634 set, the filter will add silence to the end of the input stream
9635 indefinitely.
9636 </p>
9637 <a name="Examples-17"></a>
9638 <h4 class="subsection">25.10.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-17" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-17" aria-hidden="true">TOC</a></span></h4>
9639
9640 <ul>
9641 <li> Add 1024 samples of silence to the end of the input:
9642 <div class="example">
9643 <pre class="example">apad=pad_len=1024
9644 </pre></div>
9645
9646 </li><li> Make sure the audio output will contain at least 10000 samples, pad
9647 the input with silence if required:
9648 <div class="example">
9649 <pre class="example">apad=whole_len=10000
9650 </pre></div>
9651
9652 </li><li> Use <code>ffmpeg</code> to pad the audio input with silence, so that the
9653 video stream will always result the shortest and will be converted
9654 until the end in the output file when using the <samp>shortest</samp>
9655 option:
9656 <div class="example">
9657 <pre class="example">ffmpeg -i VIDEO -i AUDIO -filter_complex &quot;[1:0]apad&quot; -shortest OUTPUT
9658 </pre></div>
9659 </li></ul>
9660
9661 <a name="aphaser"></a>
9662 <h3 class="section">25.11 aphaser<span class="pull-right"><a class="anchor hidden-xs" href="#aphaser" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aphaser" aria-hidden="true">TOC</a></span></h3>
9663 <p>Add a phasing effect to the input audio.
9664 </p>
9665 <p>A phaser filter creates series of peaks and troughs in the frequency spectrum.
9666 The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect.
9667 </p>
9668 <p>A description of the accepted parameters follows.
9669 </p>
9670 <dl compact="compact">
9671 <dt><samp>in_gain</samp></dt>
9672 <dd><p>Set input gain. Default is 0.4.
9673 </p>
9674 </dd>
9675 <dt><samp>out_gain</samp></dt>
9676 <dd><p>Set output gain. Default is 0.74
9677 </p>
9678 </dd>
9679 <dt><samp>delay</samp></dt>
9680 <dd><p>Set delay in milliseconds. Default is 3.0.
9681 </p>
9682 </dd>
9683 <dt><samp>decay</samp></dt>
9684 <dd><p>Set decay. Default is 0.4.
9685 </p>
9686 </dd>
9687 <dt><samp>speed</samp></dt>
9688 <dd><p>Set modulation speed in Hz. Default is 0.5.
9689 </p>
9690 </dd>
9691 <dt><samp>type</samp></dt>
9692 <dd><p>Set modulation type. Default is triangular.
9693 </p>
9694 <p>It accepts the following values:
9695 </p><dl compact="compact">
9696 <dt>&lsquo;<samp>triangular, t</samp>&rsquo;</dt>
9697 <dt>&lsquo;<samp>sinusoidal, s</samp>&rsquo;</dt>
9698 </dl>
9699 </dd>
9700 </dl>
9701
9702 <a name="aresample"></a><a name="aresample-1"></a>
9703 <h3 class="section">25.12 aresample<span class="pull-right"><a class="anchor hidden-xs" href="#aresample-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aresample-1" aria-hidden="true">TOC</a></span></h3>
9704
9705 <p>Resample the input audio to the specified parameters, using the
9706 libswresample library. If none are specified then the filter will
9707 automatically convert between its input and output.
9708 </p>
9709 <p>This filter is also able to stretch/squeeze the audio data to make it match
9710 the timestamps or to inject silence / cut out audio to make it match the
9711 timestamps, do a combination of both or do neither.
9712 </p>
9713 <p>The filter accepts the syntax
9714 [<var>sample_rate</var>:]<var>resampler_options</var>, where <var>sample_rate</var>
9715 expresses a sample rate and <var>resampler_options</var> is a list of
9716 <var>key</var>=<var>value</var> pairs, separated by &quot;:&quot;. See the
9717 ffmpeg-resampler manual for the complete list of supported options.
9718 </p>
9719 <a name="Examples-18"></a>
9720 <h4 class="subsection">25.12.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-18" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-18" aria-hidden="true">TOC</a></span></h4>
9721
9722 <ul>
9723 <li> Resample the input audio to 44100Hz:
9724 <div class="example">
9725 <pre class="example">aresample=44100
9726 </pre></div>
9727
9728 </li><li> Stretch/squeeze samples to the given timestamps, with a maximum of 1000
9729 samples per second compensation:
9730 <div class="example">
9731 <pre class="example">aresample=async=1000
9732 </pre></div>
9733 </li></ul>
9734
9735 <a name="asetnsamples"></a>
9736 <h3 class="section">25.13 asetnsamples<span class="pull-right"><a class="anchor hidden-xs" href="#asetnsamples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asetnsamples" aria-hidden="true">TOC</a></span></h3>
9737
9738 <p>Set the number of samples per each output audio frame.
9739 </p>
9740 <p>The last output packet may contain a different number of samples, as
9741 the filter will flush all the remaining samples when the input audio
9742 signal its end.
9743 </p>
9744 <p>The filter accepts the following options:
9745 </p>
9746 <dl compact="compact">
9747 <dt><samp>nb_out_samples, n</samp></dt>
9748 <dd><p>Set the number of frames per each output audio frame. The number is
9749 intended as the number of samples <em>per each channel</em>.
9750 Default value is 1024.
9751 </p>
9752 </dd>
9753 <dt><samp>pad, p</samp></dt>
9754 <dd><p>If set to 1, the filter will pad the last audio frame with zeroes, so
9755 that the last frame will contain the same number of samples as the
9756 previous ones. Default value is 1.
9757 </p></dd>
9758 </dl>
9759
9760 <p>For example, to set the number of per-frame samples to 1234 and
9761 disable padding for the last frame, use:
9762 </p><div class="example">
9763 <pre class="example">asetnsamples=n=1234:p=0
9764 </pre></div>
9765
9766 <a name="asetrate"></a>
9767 <h3 class="section">25.14 asetrate<span class="pull-right"><a class="anchor hidden-xs" href="#asetrate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asetrate" aria-hidden="true">TOC</a></span></h3>
9768
9769 <p>Set the sample rate without altering the PCM data.
9770 This will result in a change of speed and pitch.
9771 </p>
9772 <p>The filter accepts the following options:
9773 </p>
9774 <dl compact="compact">
9775 <dt><samp>sample_rate, r</samp></dt>
9776 <dd><p>Set the output sample rate. Default is 44100 Hz.
9777 </p></dd>
9778 </dl>
9779
9780 <a name="ashowinfo"></a>
9781 <h3 class="section">25.15 ashowinfo<span class="pull-right"><a class="anchor hidden-xs" href="#ashowinfo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ashowinfo" aria-hidden="true">TOC</a></span></h3>
9782
9783 <p>Show a line containing various information for each input audio frame.
9784 The input audio is not modified.
9785 </p>
9786 <p>The shown line contains a sequence of key/value pairs of the form
9787 <var>key</var>:<var>value</var>.
9788 </p>
9789 <p>The following values are shown in the output:
9790 </p>
9791 <dl compact="compact">
9792 <dt><samp>n</samp></dt>
9793 <dd><p>The (sequential) number of the input frame, starting from 0.
9794 </p>
9795 </dd>
9796 <dt><samp>pts</samp></dt>
9797 <dd><p>The presentation timestamp of the input frame, in time base units; the time base
9798 depends on the filter input pad, and is usually 1/<var>sample_rate</var>.
9799 </p>
9800 </dd>
9801 <dt><samp>pts_time</samp></dt>
9802 <dd><p>The presentation timestamp of the input frame in seconds.
9803 </p>
9804 </dd>
9805 <dt><samp>pos</samp></dt>
9806 <dd><p>position of the frame in the input stream, -1 if this information in
9807 unavailable and/or meaningless (for example in case of synthetic audio)
9808 </p>
9809 </dd>
9810 <dt><samp>fmt</samp></dt>
9811 <dd><p>The sample format.
9812 </p>
9813 </dd>
9814 <dt><samp>chlayout</samp></dt>
9815 <dd><p>The channel layout.
9816 </p>
9817 </dd>
9818 <dt><samp>rate</samp></dt>
9819 <dd><p>The sample rate for the audio frame.
9820 </p>
9821 </dd>
9822 <dt><samp>nb_samples</samp></dt>
9823 <dd><p>The number of samples (per channel) in the frame.
9824 </p>
9825 </dd>
9826 <dt><samp>checksum</samp></dt>
9827 <dd><p>The Adler-32 checksum (printed in hexadecimal) of the audio data. For planar
9828 audio, the data is treated as if all the planes were concatenated.
9829 </p>
9830 </dd>
9831 <dt><samp>plane_checksums</samp></dt>
9832 <dd><p>A list of Adler-32 checksums for each data plane.
9833 </p></dd>
9834 </dl>
9835
9836 <a name="astats"></a><a name="astats-1"></a>
9837 <h3 class="section">25.16 astats<span class="pull-right"><a class="anchor hidden-xs" href="#astats-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-astats-1" aria-hidden="true">TOC</a></span></h3>
9838
9839 <p>Display time domain statistical information about the audio channels.
9840 Statistics are calculated and displayed for each audio channel and,
9841 where applicable, an overall figure is also given.
9842 </p>
9843 <p>It accepts the following option:
9844 </p><dl compact="compact">
9845 <dt><samp>length</samp></dt>
9846 <dd><p>Short window length in seconds, used for peak and trough RMS measurement.
9847 Default is <code>0.05</code> (50 milliseconds). Allowed range is <code>[0.1 - 10]</code>.
9848 </p></dd>
9849 </dl>
9850
9851 <p>A description of each shown parameter follows:
9852 </p>
9853 <dl compact="compact">
9854 <dt><samp>DC offset</samp></dt>
9855 <dd><p>Mean amplitude displacement from zero.
9856 </p>
9857 </dd>
9858 <dt><samp>Min level</samp></dt>
9859 <dd><p>Minimal sample level.
9860 </p>
9861 </dd>
9862 <dt><samp>Max level</samp></dt>
9863 <dd><p>Maximal sample level.
9864 </p>
9865 </dd>
9866 <dt><samp>Peak level dB</samp></dt>
9867 <dt><samp>RMS level dB</samp></dt>
9868 <dd><p>Standard peak and RMS level measured in dBFS.
9869 </p>
9870 </dd>
9871 <dt><samp>RMS peak dB</samp></dt>
9872 <dt><samp>RMS trough dB</samp></dt>
9873 <dd><p>Peak and trough values for RMS level measured over a short window.
9874 </p>
9875 </dd>
9876 <dt><samp>Crest factor</samp></dt>
9877 <dd><p>Standard ratio of peak to RMS level (note: not in dB).
9878 </p>
9879 </dd>
9880 <dt><samp>Flat factor</samp></dt>
9881 <dd><p>Flatness (i.e. consecutive samples with the same value) of the signal at its peak levels
9882 (i.e. either <var>Min level</var> or <var>Max level</var>).
9883 </p>
9884 </dd>
9885 <dt><samp>Peak count</samp></dt>
9886 <dd><p>Number of occasions (not the number of samples) that the signal attained either
9887 <var>Min level</var> or <var>Max level</var>.
9888 </p></dd>
9889 </dl>
9890
9891 <a name="astreamsync"></a>
9892 <h3 class="section">25.17 astreamsync<span class="pull-right"><a class="anchor hidden-xs" href="#astreamsync" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-astreamsync" aria-hidden="true">TOC</a></span></h3>
9893
9894 <p>Forward two audio streams and control the order the buffers are forwarded.
9895 </p>
9896 <p>The filter accepts the following options:
9897 </p>
9898 <dl compact="compact">
9899 <dt><samp>expr, e</samp></dt>
9900 <dd><p>Set the expression deciding which stream should be
9901 forwarded next: if the result is negative, the first stream is forwarded; if
9902 the result is positive or zero, the second stream is forwarded. It can use
9903 the following variables:
9904 </p>
9905 <dl compact="compact">
9906 <dt><var>b1 b2</var></dt>
9907 <dd><p>number of buffers forwarded so far on each stream
9908 </p></dd>
9909 <dt><var>s1 s2</var></dt>
9910 <dd><p>number of samples forwarded so far on each stream
9911 </p></dd>
9912 <dt><var>t1 t2</var></dt>
9913 <dd><p>current timestamp of each stream
9914 </p></dd>
9915 </dl>
9916
9917 <p>The default value is <code>t1-t2</code>, which means to always forward the stream
9918 that has a smaller timestamp.
9919 </p></dd>
9920 </dl>
9921
9922 <a name="Examples-19"></a>
9923 <h4 class="subsection">25.17.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-19" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-19" aria-hidden="true">TOC</a></span></h4>
9924
9925 <p>Stress-test <code>amerge</code> by randomly sending buffers on the wrong
9926 input, while avoiding too much of a desynchronization:
9927 </p><div class="example">
9928 <pre class="example">amovie=file.ogg [a] ; amovie=file.mp3 [b] ;
9929 [a] [b] astreamsync=(2*random(1))-1+tanh(5*(t1-t2)) [a2] [b2] ;
9930 [a2] [b2] amerge
9931 </pre></div>
9932
9933 <a name="asyncts"></a>
9934 <h3 class="section">25.18 asyncts<span class="pull-right"><a class="anchor hidden-xs" href="#asyncts" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asyncts" aria-hidden="true">TOC</a></span></h3>
9935
9936 <p>Synchronize audio data with timestamps by squeezing/stretching it and/or
9937 dropping samples/adding silence when needed.
9938 </p>
9939 <p>This filter is not built by default, please use <a href="#aresample">aresample</a> to do squeezing/stretching.
9940 </p>
9941 <p>It accepts the following parameters:
9942 </p><dl compact="compact">
9943 <dt><samp>compensate</samp></dt>
9944 <dd><p>Enable stretching/squeezing the data to make it match the timestamps. Disabled
9945 by default. When disabled, time gaps are covered with silence.
9946 </p>
9947 </dd>
9948 <dt><samp>min_delta</samp></dt>
9949 <dd><p>The minimum difference between timestamps and audio data (in seconds) to trigger
9950 adding/dropping samples. The default value is 0.1. If you get an imperfect
9951 sync with this filter, try setting this parameter to 0.
9952 </p>
9953 </dd>
9954 <dt><samp>max_comp</samp></dt>
9955 <dd><p>The maximum compensation in samples per second. Only relevant with compensate=1.
9956 The default value is 500.
9957 </p>
9958 </dd>
9959 <dt><samp>first_pts</samp></dt>
9960 <dd><p>Assume that the first PTS should be this value. The time base is 1 / sample
9961 rate. This allows for padding/trimming at the start of the stream. By default,
9962 no assumption is made about the first frame&rsquo;s expected PTS, so no padding or
9963 trimming is done. For example, this could be set to 0 to pad the beginning with
9964 silence if an audio stream starts after the video stream or to trim any samples
9965 with a negative PTS due to encoder delay.
9966 </p>
9967 </dd>
9968 </dl>
9969
9970 <a name="atempo"></a>
9971 <h3 class="section">25.19 atempo<span class="pull-right"><a class="anchor hidden-xs" href="#atempo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-atempo" aria-hidden="true">TOC</a></span></h3>
9972
9973 <p>Adjust audio tempo.
9974 </p>
9975 <p>The filter accepts exactly one parameter, the audio tempo. If not
9976 specified then the filter will assume nominal 1.0 tempo. Tempo must
9977 be in the [0.5, 2.0] range.
9978 </p>
9979 <a name="Examples-20"></a>
9980 <h4 class="subsection">25.19.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-20" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-20" aria-hidden="true">TOC</a></span></h4>
9981
9982 <ul>
9983 <li> Slow down audio to 80% tempo:
9984 <div class="example">
9985 <pre class="example">atempo=0.8
9986 </pre></div>
9987
9988 </li><li> To speed up audio to 125% tempo:
9989 <div class="example">
9990 <pre class="example">atempo=1.25
9991 </pre></div>
9992 </li></ul>
9993
9994 <a name="atrim"></a>
9995 <h3 class="section">25.20 atrim<span class="pull-right"><a class="anchor hidden-xs" href="#atrim" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-atrim" aria-hidden="true">TOC</a></span></h3>
9996
9997 <p>Trim the input so that the output contains one continuous subpart of the input.
9998 </p>
9999 <p>It accepts the following parameters:
10000 </p><dl compact="compact">
10001 <dt><samp>start</samp></dt>
10002 <dd><p>Timestamp (in seconds) of the start of the section to keep. I.e. the audio
10003 sample with the timestamp <var>start</var> will be the first sample in the output.
10004 </p>
10005 </dd>
10006 <dt><samp>end</samp></dt>
10007 <dd><p>Specify time of the first audio sample that will be dropped, i.e. the
10008 audio sample immediately preceding the one with the timestamp <var>end</var> will be
10009 the last sample in the output.
10010 </p>
10011 </dd>
10012 <dt><samp>start_pts</samp></dt>
10013 <dd><p>Same as <var>start</var>, except this option sets the start timestamp in samples
10014 instead of seconds.
10015 </p>
10016 </dd>
10017 <dt><samp>end_pts</samp></dt>
10018 <dd><p>Same as <var>end</var>, except this option sets the end timestamp in samples instead
10019 of seconds.
10020 </p>
10021 </dd>
10022 <dt><samp>duration</samp></dt>
10023 <dd><p>The maximum duration of the output in seconds.
10024 </p>
10025 </dd>
10026 <dt><samp>start_sample</samp></dt>
10027 <dd><p>The number of the first sample that should be output.
10028 </p>
10029 </dd>
10030 <dt><samp>end_sample</samp></dt>
10031 <dd><p>The number of the first sample that should be dropped.
10032 </p></dd>
10033 </dl>
10034
10035 <p><samp>start</samp>, <samp>end</samp>, and <samp>duration</samp> are expressed as time
10036 duration specifications; see
10037 <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
10038 </p>
10039 <p>Note that the first two sets of the start/end options and the <samp>duration</samp>
10040 option look at the frame timestamp, while the _sample options simply count the
10041 samples that pass through the filter. So start/end_pts and start/end_sample will
10042 give different results when the timestamps are wrong, inexact or do not start at
10043 zero. Also note that this filter does not modify the timestamps. If you wish
10044 to have the output timestamps start at zero, insert the asetpts filter after the
10045 atrim filter.
10046 </p>
10047 <p>If multiple start or end options are set, this filter tries to be greedy and
10048 keep all samples that match at least one of the specified constraints. To keep
10049 only the part that matches all the constraints at once, chain multiple atrim
10050 filters.
10051 </p>
10052 <p>The defaults are such that all the input is kept. So it is possible to set e.g.
10053 just the end values to keep everything before the specified time.
10054 </p>
10055 <p>Examples:
10056 </p><ul>
10057 <li> Drop everything except the second minute of input:
10058 <div class="example">
10059 <pre class="example">ffmpeg -i INPUT -af atrim=60:120
10060 </pre></div>
10061
10062 </li><li> Keep only the first 1000 samples:
10063 <div class="example">
10064 <pre class="example">ffmpeg -i INPUT -af atrim=end_sample=1000
10065 </pre></div>
10066
10067 </li></ul>
10068
10069 <a name="bandpass"></a>
10070 <h3 class="section">25.21 bandpass<span class="pull-right"><a class="anchor hidden-xs" href="#bandpass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bandpass" aria-hidden="true">TOC</a></span></h3>
10071
10072 <p>Apply a two-pole Butterworth band-pass filter with central
10073 frequency <var>frequency</var>, and (3dB-point) band-width width.
10074 The <var>csg</var> option selects a constant skirt gain (peak gain = Q)
10075 instead of the default: constant 0dB peak gain.
10076 The filter roll off at 6dB per octave (20dB per decade).
10077 </p>
10078 <p>The filter accepts the following options:
10079 </p>
10080 <dl compact="compact">
10081 <dt><samp>frequency, f</samp></dt>
10082 <dd><p>Set the filter&rsquo;s central frequency. Default is <code>3000</code>.
10083 </p>
10084 </dd>
10085 <dt><samp>csg</samp></dt>
10086 <dd><p>Constant skirt gain if set to 1. Defaults to 0.
10087 </p>
10088 </dd>
10089 <dt><samp>width_type</samp></dt>
10090 <dd><p>Set method to specify band-width of filter.
10091 </p><dl compact="compact">
10092 <dt><samp>h</samp></dt>
10093 <dd><p>Hz
10094 </p></dd>
10095 <dt><samp>q</samp></dt>
10096 <dd><p>Q-Factor
10097 </p></dd>
10098 <dt><samp>o</samp></dt>
10099 <dd><p>octave
10100 </p></dd>
10101 <dt><samp>s</samp></dt>
10102 <dd><p>slope
10103 </p></dd>
10104 </dl>
10105
10106 </dd>
10107 <dt><samp>width, w</samp></dt>
10108 <dd><p>Specify the band-width of a filter in width_type units.
10109 </p></dd>
10110 </dl>
10111
10112 <a name="bandreject"></a>
10113 <h3 class="section">25.22 bandreject<span class="pull-right"><a class="anchor hidden-xs" href="#bandreject" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bandreject" aria-hidden="true">TOC</a></span></h3>
10114
10115 <p>Apply a two-pole Butterworth band-reject filter with central
10116 frequency <var>frequency</var>, and (3dB-point) band-width <var>width</var>.
10117 The filter roll off at 6dB per octave (20dB per decade).
10118 </p>
10119 <p>The filter accepts the following options:
10120 </p>
10121 <dl compact="compact">
10122 <dt><samp>frequency, f</samp></dt>
10123 <dd><p>Set the filter&rsquo;s central frequency. Default is <code>3000</code>.
10124 </p>
10125 </dd>
10126 <dt><samp>width_type</samp></dt>
10127 <dd><p>Set method to specify band-width of filter.
10128 </p><dl compact="compact">
10129 <dt><samp>h</samp></dt>
10130 <dd><p>Hz
10131 </p></dd>
10132 <dt><samp>q</samp></dt>
10133 <dd><p>Q-Factor
10134 </p></dd>
10135 <dt><samp>o</samp></dt>
10136 <dd><p>octave
10137 </p></dd>
10138 <dt><samp>s</samp></dt>
10139 <dd><p>slope
10140 </p></dd>
10141 </dl>
10142
10143 </dd>
10144 <dt><samp>width, w</samp></dt>
10145 <dd><p>Specify the band-width of a filter in width_type units.
10146 </p></dd>
10147 </dl>
10148
10149 <a name="bass"></a>
10150 <h3 class="section">25.23 bass<span class="pull-right"><a class="anchor hidden-xs" href="#bass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bass" aria-hidden="true">TOC</a></span></h3>
10151
10152 <p>Boost or cut the bass (lower) frequencies of the audio using a two-pole
10153 shelving filter with a response similar to that of a standard
10154 hi-fi&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
10155 </p>
10156 <p>The filter accepts the following options:
10157 </p>
10158 <dl compact="compact">
10159 <dt><samp>gain, g</samp></dt>
10160 <dd><p>Give the gain at 0 Hz. Its useful range is about -20
10161 (for a large cut) to +20 (for a large boost).
10162 Beware of clipping when using a positive gain.
10163 </p>
10164 </dd>
10165 <dt><samp>frequency, f</samp></dt>
10166 <dd><p>Set the filter&rsquo;s central frequency and so can be used
10167 to extend or reduce the frequency range to be boosted or cut.
10168 The default value is <code>100</code> Hz.
10169 </p>
10170 </dd>
10171 <dt><samp>width_type</samp></dt>
10172 <dd><p>Set method to specify band-width of filter.
10173 </p><dl compact="compact">
10174 <dt><samp>h</samp></dt>
10175 <dd><p>Hz
10176 </p></dd>
10177 <dt><samp>q</samp></dt>
10178 <dd><p>Q-Factor
10179 </p></dd>
10180 <dt><samp>o</samp></dt>
10181 <dd><p>octave
10182 </p></dd>
10183 <dt><samp>s</samp></dt>
10184 <dd><p>slope
10185 </p></dd>
10186 </dl>
10187
10188 </dd>
10189 <dt><samp>width, w</samp></dt>
10190 <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
10191 </p></dd>
10192 </dl>
10193
10194 <a name="biquad"></a>
10195 <h3 class="section">25.24 biquad<span class="pull-right"><a class="anchor hidden-xs" href="#biquad" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-biquad" aria-hidden="true">TOC</a></span></h3>
10196
10197 <p>Apply a biquad IIR filter with the given coefficients.
10198 Where <var>b0</var>, <var>b1</var>, <var>b2</var> and <var>a0</var>, <var>a1</var>, <var>a2</var>
10199 are the numerator and denominator coefficients respectively.
10200 </p>
10201 <a name="bs2b"></a>
10202 <h3 class="section">25.25 bs2b<span class="pull-right"><a class="anchor hidden-xs" href="#bs2b" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bs2b" aria-hidden="true">TOC</a></span></h3>
10203 <p>Bauer stereo to binaural transformation, which improves headphone listening of
10204 stereo audio records.
10205 </p>
10206 <p>It accepts the following parameters:
10207 </p><dl compact="compact">
10208 <dt><samp>profile</samp></dt>
10209 <dd><p>Pre-defined crossfeed level.
10210 </p><dl compact="compact">
10211 <dt><samp>default</samp></dt>
10212 <dd><p>Default level (fcut=700, feed=50).
10213 </p>
10214 </dd>
10215 <dt><samp>cmoy</samp></dt>
10216 <dd><p>Chu Moy circuit (fcut=700, feed=60).
10217 </p>
10218 </dd>
10219 <dt><samp>jmeier</samp></dt>
10220 <dd><p>Jan Meier circuit (fcut=650, feed=95).
10221 </p>
10222 </dd>
10223 </dl>
10224
10225 </dd>
10226 <dt><samp>fcut</samp></dt>
10227 <dd><p>Cut frequency (in Hz).
10228 </p>
10229 </dd>
10230 <dt><samp>feed</samp></dt>
10231 <dd><p>Feed level (in Hz).
10232 </p>
10233 </dd>
10234 </dl>
10235
10236 <a name="channelmap"></a>
10237 <h3 class="section">25.26 channelmap<span class="pull-right"><a class="anchor hidden-xs" href="#channelmap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-channelmap" aria-hidden="true">TOC</a></span></h3>
10238
10239 <p>Remap input channels to new locations.
10240 </p>
10241 <p>It accepts the following parameters:
10242 </p><dl compact="compact">
10243 <dt><samp>channel_layout</samp></dt>
10244 <dd><p>The channel layout of the output stream.
10245 </p>
10246 </dd>
10247 <dt><samp>map</samp></dt>
10248 <dd><p>Map channels from input to output. The argument is a &rsquo;|&rsquo;-separated list of
10249 mappings, each in the <code><var>in_channel</var>-<var>out_channel</var></code> or
10250 <var>in_channel</var> form. <var>in_channel</var> can be either the name of the input
10251 channel (e.g. FL for front left) or its index in the input channel layout.
10252 <var>out_channel</var> is the name of the output channel or its index in the output
10253 channel layout. If <var>out_channel</var> is not given then it is implicitly an
10254 index, starting with zero and increasing by one for each mapping.
10255 </p></dd>
10256 </dl>
10257
10258 <p>If no mapping is present, the filter will implicitly map input channels to
10259 output channels, preserving indices.
10260 </p>
10261 <p>For example, assuming a 5.1+downmix input MOV file,
10262 </p><div class="example">
10263 <pre class="example">ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
10264 </pre></div>
10265 <p>will create an output WAV file tagged as stereo from the downmix channels of
10266 the input.
10267 </p>
10268 <p>To fix a 5.1 WAV improperly encoded in AAC&rsquo;s native channel order
10269 </p><div class="example">
10270 <pre class="example">ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:channel_layout=5.1' out.wav
10271 </pre></div>
10272
10273 <a name="channelsplit"></a>
10274 <h3 class="section">25.27 channelsplit<span class="pull-right"><a class="anchor hidden-xs" href="#channelsplit" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-channelsplit" aria-hidden="true">TOC</a></span></h3>
10275
10276 <p>Split each channel from an input audio stream into a separate output stream.
10277 </p>
10278 <p>It accepts the following parameters:
10279 </p><dl compact="compact">
10280 <dt><samp>channel_layout</samp></dt>
10281 <dd><p>The channel layout of the input stream. The default is &quot;stereo&quot;.
10282 </p></dd>
10283 </dl>
10284
10285 <p>For example, assuming a stereo input MP3 file,
10286 </p><div class="example">
10287 <pre class="example">ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
10288 </pre></div>
10289 <p>will create an output Matroska file with two audio streams, one containing only
10290 the left channel and the other the right channel.
10291 </p>
10292 <p>Split a 5.1 WAV file into per-channel files:
10293 </p><div class="example">
10294 <pre class="example">ffmpeg -i in.wav -filter_complex
10295 'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
10296 -map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
10297 front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
10298 side_right.wav
10299 </pre></div>
10300
10301 <a name="chorus"></a>
10302 <h3 class="section">25.28 chorus<span class="pull-right"><a class="anchor hidden-xs" href="#chorus" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chorus" aria-hidden="true">TOC</a></span></h3>
10303 <p>Add a chorus effect to the audio.
10304 </p>
10305 <p>Can make a single vocal sound like a chorus, but can also be applied to instrumentation.
10306 </p>
10307 <p>Chorus resembles an echo effect with a short delay, but whereas with echo the delay is
10308 constant, with chorus, it is varied using using sinusoidal or triangular modulation.
10309 The modulation depth defines the range the modulated delay is played before or after
10310 the delay. Hence the delayed sound will sound slower or faster, that is the delayed
10311 sound tuned around the original one, like in a chorus where some vocals are slightly
10312 off key.
10313 </p>
10314 <p>It accepts the following parameters:
10315 </p><dl compact="compact">
10316 <dt><samp>in_gain</samp></dt>
10317 <dd><p>Set input gain. Default is 0.4.
10318 </p>
10319 </dd>
10320 <dt><samp>out_gain</samp></dt>
10321 <dd><p>Set output gain. Default is 0.4.
10322 </p>
10323 </dd>
10324 <dt><samp>delays</samp></dt>
10325 <dd><p>Set delays. A typical delay is around 40ms to 60ms.
10326 </p>
10327 </dd>
10328 <dt><samp>decays</samp></dt>
10329 <dd><p>Set decays.
10330 </p>
10331 </dd>
10332 <dt><samp>speeds</samp></dt>
10333 <dd><p>Set speeds.
10334 </p>
10335 </dd>
10336 <dt><samp>depths</samp></dt>
10337 <dd><p>Set depths.
10338 </p></dd>
10339 </dl>
10340
10341 <a name="Examples-21"></a>
10342 <h4 class="subsection">25.28.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-21" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-21" aria-hidden="true">TOC</a></span></h4>
10343
10344 <ul>
10345 <li> A single delay:
10346 <div class="example">
10347 <pre class="example">chorus=0.7:0.9:55:0.4:0.25:2
10348 </pre></div>
10349
10350 </li><li> Two delays:
10351 <div class="example">
10352 <pre class="example">chorus=0.6:0.9:50|60:0.4|0.32:0.25|0.4:2|1.3
10353 </pre></div>
10354
10355 </li><li> Fuller sounding chorus with three delays:
10356 <div class="example">
10357 <pre class="example">chorus=0.5:0.9:50|60|40:0.4|0.32|0.3:0.25|0.4|0.3:2|2.3|1.3
10358 </pre></div>
10359 </li></ul>
10360
10361 <a name="compand"></a>
10362 <h3 class="section">25.29 compand<span class="pull-right"><a class="anchor hidden-xs" href="#compand" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-compand" aria-hidden="true">TOC</a></span></h3>
10363 <p>Compress or expand the audio&rsquo;s dynamic range.
10364 </p>
10365 <p>It accepts the following parameters:
10366 </p>
10367 <dl compact="compact">
10368 <dt><samp>attacks</samp></dt>
10369 <dt><samp>decays</samp></dt>
10370 <dd><p>A list of times in seconds for each channel over which the instantaneous level
10371 of the input signal is averaged to determine its volume. <var>attacks</var> refers to
10372 increase of volume and <var>decays</var> refers to decrease of volume. For most
10373 situations, the attack time (response to the audio getting louder) should be
10374 shorter than the decay time, because the human ear is more sensitive to sudden
10375 loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and
10376 a typical value for decay is 0.8 seconds.
10377 </p>
10378 </dd>
10379 <dt><samp>points</samp></dt>
10380 <dd><p>A list of points for the transfer function, specified in dB relative to the
10381 maximum possible signal amplitude. Each key points list must be defined using
10382 the following syntax: <code>x0/y0|x1/y1|x2/y2|....</code> or
10383 <code>x0/y0 x1/y1 x2/y2 ....</code>
10384 </p>
10385 <p>The input values must be in strictly increasing order but the transfer function
10386 does not have to be monotonically rising. The point <code>0/0</code> is assumed but
10387 may be overridden (by <code>0/out-dBn</code>). Typical values for the transfer
10388 function are <code>-70/-70|-60/-20</code>.
10389 </p>
10390 </dd>
10391 <dt><samp>soft-knee</samp></dt>
10392 <dd><p>Set the curve radius in dB for all joints. It defaults to 0.01.
10393 </p>
10394 </dd>
10395 <dt><samp>gain</samp></dt>
10396 <dd><p>Set the additional gain in dB to be applied at all points on the transfer
10397 function. This allows for easy adjustment of the overall gain.
10398 It defaults to 0.
10399 </p>
10400 </dd>
10401 <dt><samp>volume</samp></dt>
10402 <dd><p>Set an initial volume, in dB, to be assumed for each channel when filtering
10403 starts. This permits the user to supply a nominal level initially, so that, for
10404 example, a very large gain is not applied to initial signal levels before the
10405 companding has begun to operate. A typical value for audio which is initially
10406 quiet is -90 dB. It defaults to 0.
10407 </p>
10408 </dd>
10409 <dt><samp>delay</samp></dt>
10410 <dd><p>Set a delay, in seconds. The input audio is analyzed immediately, but audio is
10411 delayed before being fed to the volume adjuster. Specifying a delay
10412 approximately equal to the attack/decay times allows the filter to effectively
10413 operate in predictive rather than reactive mode. It defaults to 0.
10414 </p>
10415 </dd>
10416 </dl>
10417
10418 <a name="Examples-22"></a>
10419 <h4 class="subsection">25.29.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-22" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-22" aria-hidden="true">TOC</a></span></h4>
10420
10421 <ul>
10422 <li> Make music with both quiet and loud passages suitable for listening to in a
10423 noisy environment:
10424 <div class="example">
10425 <pre class="example">compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:0.2
10426 </pre></div>
10427
10428 </li><li> A noise gate for when the noise is at a lower level than the signal:
10429 <div class="example">
10430 <pre class="example">compand=.1|.1:.2|.2:-900/-900|-50.1/-900|-50/-50:.01:0:-90:.1
10431 </pre></div>
10432
10433 </li><li> Here is another noise gate, this time for when the noise is at a higher level
10434 than the signal (making it, in some ways, similar to squelch):
10435 <div class="example">
10436 <pre class="example">compand=.1|.1:.1|.1:-45.1/-45.1|-45/-900|0/-900:.01:45:-90:.1
10437 </pre></div>
10438 </li></ul>
10439
10440 <a name="dcshift"></a>
10441 <h3 class="section">25.30 dcshift<span class="pull-right"><a class="anchor hidden-xs" href="#dcshift" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dcshift" aria-hidden="true">TOC</a></span></h3>
10442 <p>Apply a DC shift to the audio.
10443 </p>
10444 <p>This can be useful to remove a DC offset (caused perhaps by a hardware problem
10445 in the recording chain) from the audio. The effect of a DC offset is reduced
10446 headroom and hence volume. The <a href="#astats">astats</a> filter can be used to determine if
10447 a signal has a DC offset.
10448 </p>
10449 <dl compact="compact">
10450 <dt><samp>shift</samp></dt>
10451 <dd><p>Set the DC shift, allowed range is [-1, 1]. It indicates the amount to shift
10452 the audio.
10453 </p>
10454 </dd>
10455 <dt><samp>limitergain</samp></dt>
10456 <dd><p>Optional. It should have a value much less than 1 (e.g. 0.05 or 0.02) and is
10457 used to prevent clipping.
10458 </p></dd>
10459 </dl>
10460
10461 <a name="earwax"></a>
10462 <h3 class="section">25.31 earwax<span class="pull-right"><a class="anchor hidden-xs" href="#earwax" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-earwax" aria-hidden="true">TOC</a></span></h3>
10463
10464 <p>Make audio easier to listen to on headphones.
10465 </p>
10466 <p>This filter adds &lsquo;cues&rsquo; to 44.1kHz stereo (i.e. audio CD format) audio
10467 so that when listened to on headphones the stereo image is moved from
10468 inside your head (standard for headphones) to outside and in front of
10469 the listener (standard for speakers).
10470 </p>
10471 <p>Ported from SoX.
10472 </p>
10473 <a name="equalizer"></a>
10474 <h3 class="section">25.32 equalizer<span class="pull-right"><a class="anchor hidden-xs" href="#equalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-equalizer" aria-hidden="true">TOC</a></span></h3>
10475
10476 <p>Apply a two-pole peaking equalisation (EQ) filter. With this
10477 filter, the signal-level at and around a selected frequency can
10478 be increased or decreased, whilst (unlike bandpass and bandreject
10479 filters) that at all other frequencies is unchanged.
10480 </p>
10481 <p>In order to produce complex equalisation curves, this filter can
10482 be given several times, each with a different central frequency.
10483 </p>
10484 <p>The filter accepts the following options:
10485 </p>
10486 <dl compact="compact">
10487 <dt><samp>frequency, f</samp></dt>
10488 <dd><p>Set the filter&rsquo;s central frequency in Hz.
10489 </p>
10490 </dd>
10491 <dt><samp>width_type</samp></dt>
10492 <dd><p>Set method to specify band-width of filter.
10493 </p><dl compact="compact">
10494 <dt><samp>h</samp></dt>
10495 <dd><p>Hz
10496 </p></dd>
10497 <dt><samp>q</samp></dt>
10498 <dd><p>Q-Factor
10499 </p></dd>
10500 <dt><samp>o</samp></dt>
10501 <dd><p>octave
10502 </p></dd>
10503 <dt><samp>s</samp></dt>
10504 <dd><p>slope
10505 </p></dd>
10506 </dl>
10507
10508 </dd>
10509 <dt><samp>width, w</samp></dt>
10510 <dd><p>Specify the band-width of a filter in width_type units.
10511 </p>
10512 </dd>
10513 <dt><samp>gain, g</samp></dt>
10514 <dd><p>Set the required gain or attenuation in dB.
10515 Beware of clipping when using a positive gain.
10516 </p></dd>
10517 </dl>
10518
10519 <a name="Examples-23"></a>
10520 <h4 class="subsection">25.32.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-23" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-23" aria-hidden="true">TOC</a></span></h4>
10521 <ul>
10522 <li> Attenuate 10 dB at 1000 Hz, with a bandwidth of 200 Hz:
10523 <div class="example">
10524 <pre class="example">equalizer=f=1000:width_type=h:width=200:g=-10
10525 </pre></div>
10526
10527 </li><li> Apply 2 dB gain at 1000 Hz with Q 1 and attenuate 5 dB at 100 Hz with Q 2:
10528 <div class="example">
10529 <pre class="example">equalizer=f=1000:width_type=q:width=1:g=2,equalizer=f=100:width_type=q:width=2:g=-5
10530 </pre></div>
10531 </li></ul>
10532
10533 <a name="flanger"></a>
10534 <h3 class="section">25.33 flanger<span class="pull-right"><a class="anchor hidden-xs" href="#flanger" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flanger" aria-hidden="true">TOC</a></span></h3>
10535 <p>Apply a flanging effect to the audio.
10536 </p>
10537 <p>The filter accepts the following options:
10538 </p>
10539 <dl compact="compact">
10540 <dt><samp>delay</samp></dt>
10541 <dd><p>Set base delay in milliseconds. Range from 0 to 30. Default value is 0.
10542 </p>
10543 </dd>
10544 <dt><samp>depth</samp></dt>
10545 <dd><p>Set added swep delay in milliseconds. Range from 0 to 10. Default value is 2.
10546 </p>
10547 </dd>
10548 <dt><samp>regen</samp></dt>
10549 <dd><p>Set percentage regeneration (delayed signal feedback). Range from -95 to 95.
10550 Default value is 0.
10551 </p>
10552 </dd>
10553 <dt><samp>width</samp></dt>
10554 <dd><p>Set percentage of delayed signal mixed with original. Range from 0 to 100.
10555 Default value is 71.
10556 </p>
10557 </dd>
10558 <dt><samp>speed</samp></dt>
10559 <dd><p>Set sweeps per second (Hz). Range from 0.1 to 10. Default value is 0.5.
10560 </p>
10561 </dd>
10562 <dt><samp>shape</samp></dt>
10563 <dd><p>Set swept wave shape, can be <var>triangular</var> or <var>sinusoidal</var>.
10564 Default value is <var>sinusoidal</var>.
10565 </p>
10566 </dd>
10567 <dt><samp>phase</samp></dt>
10568 <dd><p>Set swept wave percentage-shift for multi channel. Range from 0 to 100.
10569 Default value is 25.
10570 </p>
10571 </dd>
10572 <dt><samp>interp</samp></dt>
10573 <dd><p>Set delay-line interpolation, <var>linear</var> or <var>quadratic</var>.
10574 Default is <var>linear</var>.
10575 </p></dd>
10576 </dl>
10577
10578 <a name="highpass"></a>
10579 <h3 class="section">25.34 highpass<span class="pull-right"><a class="anchor hidden-xs" href="#highpass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-highpass" aria-hidden="true">TOC</a></span></h3>
10580
10581 <p>Apply a high-pass filter with 3dB point frequency.
10582 The filter can be either single-pole, or double-pole (the default).
10583 The filter roll off at 6dB per pole per octave (20dB per pole per decade).
10584 </p>
10585 <p>The filter accepts the following options:
10586 </p>
10587 <dl compact="compact">
10588 <dt><samp>frequency, f</samp></dt>
10589 <dd><p>Set frequency in Hz. Default is 3000.
10590 </p>
10591 </dd>
10592 <dt><samp>poles, p</samp></dt>
10593 <dd><p>Set number of poles. Default is 2.
10594 </p>
10595 </dd>
10596 <dt><samp>width_type</samp></dt>
10597 <dd><p>Set method to specify band-width of filter.
10598 </p><dl compact="compact">
10599 <dt><samp>h</samp></dt>
10600 <dd><p>Hz
10601 </p></dd>
10602 <dt><samp>q</samp></dt>
10603 <dd><p>Q-Factor
10604 </p></dd>
10605 <dt><samp>o</samp></dt>
10606 <dd><p>octave
10607 </p></dd>
10608 <dt><samp>s</samp></dt>
10609 <dd><p>slope
10610 </p></dd>
10611 </dl>
10612
10613 </dd>
10614 <dt><samp>width, w</samp></dt>
10615 <dd><p>Specify the band-width of a filter in width_type units.
10616 Applies only to double-pole filter.
10617 The default is 0.707q and gives a Butterworth response.
10618 </p></dd>
10619 </dl>
10620
10621 <a name="join"></a>
10622 <h3 class="section">25.35 join<span class="pull-right"><a class="anchor hidden-xs" href="#join" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-join" aria-hidden="true">TOC</a></span></h3>
10623
10624 <p>Join multiple input streams into one multi-channel stream.
10625 </p>
10626 <p>It accepts the following parameters:
10627 </p><dl compact="compact">
10628 <dt><samp>inputs</samp></dt>
10629 <dd><p>The number of input streams. It defaults to 2.
10630 </p>
10631 </dd>
10632 <dt><samp>channel_layout</samp></dt>
10633 <dd><p>The desired output channel layout. It defaults to stereo.
10634 </p>
10635 </dd>
10636 <dt><samp>map</samp></dt>
10637 <dd><p>Map channels from inputs to output. The argument is a &rsquo;|&rsquo;-separated list of
10638 mappings, each in the <code><var>input_idx</var>.<var>in_channel</var>-<var>out_channel</var></code>
10639 form. <var>input_idx</var> is the 0-based index of the input stream. <var>in_channel</var>
10640 can be either the name of the input channel (e.g. FL for front left) or its
10641 index in the specified input stream. <var>out_channel</var> is the name of the output
10642 channel.
10643 </p></dd>
10644 </dl>
10645
10646 <p>The filter will attempt to guess the mappings when they are not specified
10647 explicitly. It does so by first trying to find an unused matching input channel
10648 and if that fails it picks the first unused input channel.
10649 </p>
10650 <p>Join 3 inputs (with properly set channel layouts):
10651 </p><div class="example">
10652 <pre class="example">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
10653 </pre></div>
10654
10655 <p>Build a 5.1 output from 6 single-channel streams:
10656 </p><div class="example">
10657 <pre class="example">ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
10658 'join=inputs=6:channel_layout=5.1:map=0.0-FL|1.0-FR|2.0-FC|3.0-SL|4.0-SR|5.0-LFE'
10659 out
10660 </pre></div>
10661
10662 <a name="ladspa"></a>
10663 <h3 class="section">25.36 ladspa<span class="pull-right"><a class="anchor hidden-xs" href="#ladspa" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ladspa" aria-hidden="true">TOC</a></span></h3>
10664
10665 <p>Load a LADSPA (Linux Audio Developer&rsquo;s Simple Plugin API) plugin.
10666 </p>
10667 <p>To enable compilation of this filter you need to configure FFmpeg with
10668 <code>--enable-ladspa</code>.
10669 </p>
10670 <dl compact="compact">
10671 <dt><samp>file, f</samp></dt>
10672 <dd><p>Specifies the name of LADSPA plugin library to load. If the environment
10673 variable <code>LADSPA_PATH</code> is defined, the LADSPA plugin is searched in
10674 each one of the directories specified by the colon separated list in
10675 <code>LADSPA_PATH</code>, otherwise in the standard LADSPA paths, which are in
10676 this order: <samp>HOME/.ladspa/lib/</samp>, <samp>/usr/local/lib/ladspa/</samp>,
10677 <samp>/usr/lib/ladspa/</samp>.
10678 </p>
10679 </dd>
10680 <dt><samp>plugin, p</samp></dt>
10681 <dd><p>Specifies the plugin within the library. Some libraries contain only
10682 one plugin, but others contain many of them. If this is not set filter
10683 will list all available plugins within the specified library.
10684 </p>
10685 </dd>
10686 <dt><samp>controls, c</samp></dt>
10687 <dd><p>Set the &rsquo;|&rsquo; separated list of controls which are zero or more floating point
10688 values that determine the behavior of the loaded plugin (for example delay,
10689 threshold or gain).
10690 Controls need to be defined using the following syntax:
10691 c0=<var>value0</var>|c1=<var>value1</var>|c2=<var>value2</var>|..., where
10692 <var>valuei</var> is the value set on the <var>i</var>-th control.
10693 If <samp>controls</samp> is set to <code>help</code>, all available controls and
10694 their valid ranges are printed.
10695 </p>
10696 </dd>
10697 <dt><samp>sample_rate, s</samp></dt>
10698 <dd><p>Specify the sample rate, default to 44100. Only used if plugin have
10699 zero inputs.
10700 </p>
10701 </dd>
10702 <dt><samp>nb_samples, n</samp></dt>
10703 <dd><p>Set the number of samples per channel per each output frame, default
10704 is 1024. Only used if plugin have zero inputs.
10705 </p>
10706 </dd>
10707 <dt><samp>duration, d</samp></dt>
10708 <dd><p>Set the minimum duration of the sourced audio. See
10709 <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
10710 for the accepted syntax.
10711 Note that the resulting duration may be greater than the specified duration,
10712 as the generated audio is always cut at the end of a complete frame.
10713 If not specified, or the expressed duration is negative, the audio is
10714 supposed to be generated forever.
10715 Only used if plugin have zero inputs.
10716 </p>
10717 </dd>
10718 </dl>
10719
10720 <a name="Examples-24"></a>
10721 <h4 class="subsection">25.36.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-24" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-24" aria-hidden="true">TOC</a></span></h4>
10722
10723 <ul>
10724 <li> List all available plugins within amp (LADSPA example plugin) library:
10725 <div class="example">
10726 <pre class="example">ladspa=file=amp
10727 </pre></div>
10728
10729 </li><li> List all available controls and their valid ranges for <code>vcf_notch</code>
10730 plugin from <code>VCF</code> library:
10731 <div class="example">
10732 <pre class="example">ladspa=f=vcf:p=vcf_notch:c=help
10733 </pre></div>
10734
10735 </li><li> Simulate low quality audio equipment using <code>Computer Music Toolkit</code> (CMT)
10736 plugin library:
10737 <div class="example">
10738 <pre class="example">ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12
10739 </pre></div>
10740
10741 </li><li> Add reverberation to the audio using TAP-plugins
10742 (Tom&rsquo;s Audio Processing plugins):
10743 <div class="example">
10744 <pre class="example">ladspa=file=tap_reverb:tap_reverb
10745 </pre></div>
10746
10747 </li><li> Generate white noise, with 0.2 amplitude:
10748 <div class="example">
10749 <pre class="example">ladspa=file=cmt:noise_source_white:c=c0=.2
10750 </pre></div>
10751
10752 </li><li> Generate 20 bpm clicks using plugin <code>C* Click - Metronome</code> from the
10753 <code>C* Audio Plugin Suite</code> (CAPS) library:
10754 <div class="example">
10755 <pre class="example">ladspa=file=caps:Click:c=c1=20'
10756 </pre></div>
10757
10758 </li><li> Apply <code>C* Eq10X2 - Stereo 10-band equaliser</code> effect:
10759 <div class="example">
10760 <pre class="example">ladspa=caps:Eq10X2:c=c0=-48|c9=-24|c3=12|c4=2
10761 </pre></div>
10762 </li></ul>
10763
10764 <a name="Commands"></a>
10765 <h4 class="subsection">25.36.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands" aria-hidden="true">TOC</a></span></h4>
10766
10767 <p>This filter supports the following commands:
10768 </p><dl compact="compact">
10769 <dt><samp>cN</samp></dt>
10770 <dd><p>Modify the <var>N</var>-th control value.
10771 </p>
10772 <p>If the specified value is not valid, it is ignored and prior one is kept.
10773 </p></dd>
10774 </dl>
10775
10776 <a name="lowpass"></a>
10777 <h3 class="section">25.37 lowpass<span class="pull-right"><a class="anchor hidden-xs" href="#lowpass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lowpass" aria-hidden="true">TOC</a></span></h3>
10778
10779 <p>Apply a low-pass filter with 3dB point frequency.
10780 The filter can be either single-pole or double-pole (the default).
10781 The filter roll off at 6dB per pole per octave (20dB per pole per decade).
10782 </p>
10783 <p>The filter accepts the following options:
10784 </p>
10785 <dl compact="compact">
10786 <dt><samp>frequency, f</samp></dt>
10787 <dd><p>Set frequency in Hz. Default is 500.
10788 </p>
10789 </dd>
10790 <dt><samp>poles, p</samp></dt>
10791 <dd><p>Set number of poles. Default is 2.
10792 </p>
10793 </dd>
10794 <dt><samp>width_type</samp></dt>
10795 <dd><p>Set method to specify band-width of filter.
10796 </p><dl compact="compact">
10797 <dt><samp>h</samp></dt>
10798 <dd><p>Hz
10799 </p></dd>
10800 <dt><samp>q</samp></dt>
10801 <dd><p>Q-Factor
10802 </p></dd>
10803 <dt><samp>o</samp></dt>
10804 <dd><p>octave
10805 </p></dd>
10806 <dt><samp>s</samp></dt>
10807 <dd><p>slope
10808 </p></dd>
10809 </dl>
10810
10811 </dd>
10812 <dt><samp>width, w</samp></dt>
10813 <dd><p>Specify the band-width of a filter in width_type units.
10814 Applies only to double-pole filter.
10815 The default is 0.707q and gives a Butterworth response.
10816 </p></dd>
10817 </dl>
10818
10819 <a name="pan"></a>
10820 <h3 class="section">25.38 pan<span class="pull-right"><a class="anchor hidden-xs" href="#pan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pan" aria-hidden="true">TOC</a></span></h3>
10821
10822 <p>Mix channels with specific gain levels. The filter accepts the output
10823 channel layout followed by a set of channels definitions.
10824 </p>
10825 <p>This filter is also designed to efficiently remap the channels of an audio
10826 stream.
10827 </p>
10828 <p>The filter accepts parameters of the form:
10829 &quot;<var>l</var>|<var>outdef</var>|<var>outdef</var>|...&quot;
10830 </p>
10831 <dl compact="compact">
10832 <dt><samp>l</samp></dt>
10833 <dd><p>output channel layout or number of channels
10834 </p>
10835 </dd>
10836 <dt><samp>outdef</samp></dt>
10837 <dd><p>output channel specification, of the form:
10838 &quot;<var>out_name</var>=[<var>gain</var>*]<var>in_name</var>[+[<var>gain</var>*]<var>in_name</var>...]&quot;
10839 </p>
10840 </dd>
10841 <dt><samp>out_name</samp></dt>
10842 <dd><p>output channel to define, either a channel name (FL, FR, etc.) or a channel
10843 number (c0, c1, etc.)
10844 </p>
10845 </dd>
10846 <dt><samp>gain</samp></dt>
10847 <dd><p>multiplicative coefficient for the channel, 1 leaving the volume unchanged
10848 </p>
10849 </dd>
10850 <dt><samp>in_name</samp></dt>
10851 <dd><p>input channel to use, see out_name for details; it is not possible to mix
10852 named and numbered input channels
10853 </p></dd>
10854 </dl>
10855
10856 <p>If the &lsquo;=&rsquo; in a channel specification is replaced by &lsquo;&lt;&rsquo;, then the gains for
10857 that specification will be renormalized so that the total is 1, thus
10858 avoiding clipping noise.
10859 </p>
10860 <a name="Mixing-examples"></a>
10861 <h4 class="subsection">25.38.1 Mixing examples<span class="pull-right"><a class="anchor hidden-xs" href="#Mixing-examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Mixing-examples" aria-hidden="true">TOC</a></span></h4>
10862
10863 <p>For example, if you want to down-mix from stereo to mono, but with a bigger
10864 factor for the left channel:
10865 </p><div class="example">
10866 <pre class="example">pan=1c|c0=0.9*c0+0.1*c1
10867 </pre></div>
10868
10869 <p>A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
10870 7-channels surround:
10871 </p><div class="example">
10872 <pre class="example">pan=stereo| FL &lt; FL + 0.5*FC + 0.6*BL + 0.6*SL | FR &lt; FR + 0.5*FC + 0.6*BR + 0.6*SR
10873 </pre></div>
10874
10875 <p>Note that <code>ffmpeg</code> integrates a default down-mix (and up-mix) system
10876 that should be preferred (see &quot;-ac&quot; option) unless you have very specific
10877 needs.
10878 </p>
10879 <a name="Remapping-examples"></a>
10880 <h4 class="subsection">25.38.2 Remapping examples<span class="pull-right"><a class="anchor hidden-xs" href="#Remapping-examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Remapping-examples" aria-hidden="true">TOC</a></span></h4>
10881
10882 <p>The channel remapping will be effective if, and only if:
10883 </p>
10884 <ul>
10885 <li> gain coefficients are zeroes or ones,
10886 </li><li> only one input per channel output,
10887 </li></ul>
10888
10889 <p>If all these conditions are satisfied, the filter will notify the user (&quot;Pure
10890 channel mapping detected&quot;), and use an optimized and lossless method to do the
10891 remapping.
10892 </p>
10893 <p>For example, if you have a 5.1 source and want a stereo audio stream by
10894 dropping the extra channels:
10895 </p><div class="example">
10896 <pre class="example">pan=&quot;stereo| c0=FL | c1=FR&quot;
10897 </pre></div>
10898
10899 <p>Given the same source, you can also switch front left and front right channels
10900 and keep the input channel layout:
10901 </p><div class="example">
10902 <pre class="example">pan=&quot;5.1| c0=c1 | c1=c0 | c2=c2 | c3=c3 | c4=c4 | c5=c5&quot;
10903 </pre></div>
10904
10905 <p>If the input is a stereo audio stream, you can mute the front left channel (and
10906 still keep the stereo channel layout) with:
10907 </p><div class="example">
10908 <pre class="example">pan=&quot;stereo|c1=c1&quot;
10909 </pre></div>
10910
10911 <p>Still with a stereo audio stream input, you can copy the right channel in both
10912 front left and right:
10913 </p><div class="example">
10914 <pre class="example">pan=&quot;stereo| c0=FR | c1=FR&quot;
10915 </pre></div>
10916
10917 <a name="replaygain"></a>
10918 <h3 class="section">25.39 replaygain<span class="pull-right"><a class="anchor hidden-xs" href="#replaygain" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-replaygain" aria-hidden="true">TOC</a></span></h3>
10919
10920 <p>ReplayGain scanner filter. This filter takes an audio stream as an input and
10921 outputs it unchanged.
10922 At end of filtering it displays <code>track_gain</code> and <code>track_peak</code>.
10923 </p>
10924 <a name="resample"></a>
10925 <h3 class="section">25.40 resample<span class="pull-right"><a class="anchor hidden-xs" href="#resample" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-resample" aria-hidden="true">TOC</a></span></h3>
10926
10927 <p>Convert the audio sample format, sample rate and channel layout. It is
10928 not meant to be used directly.
10929 </p>
10930 <a name="silencedetect"></a>
10931 <h3 class="section">25.41 silencedetect<span class="pull-right"><a class="anchor hidden-xs" href="#silencedetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-silencedetect" aria-hidden="true">TOC</a></span></h3>
10932
10933 <p>Detect silence in an audio stream.
10934 </p>
10935 <p>This filter logs a message when it detects that the input audio volume is less
10936 or equal to a noise tolerance value for a duration greater or equal to the
10937 minimum detected noise duration.
10938 </p>
10939 <p>The printed times and duration are expressed in seconds.
10940 </p>
10941 <p>The filter accepts the following options:
10942 </p>
10943 <dl compact="compact">
10944 <dt><samp>duration, d</samp></dt>
10945 <dd><p>Set silence duration until notification (default is 2 seconds).
10946 </p>
10947 </dd>
10948 <dt><samp>noise, n</samp></dt>
10949 <dd><p>Set noise tolerance. Can be specified in dB (in case &quot;dB&quot; is appended to the
10950 specified value) or amplitude ratio. Default is -60dB, or 0.001.
10951 </p></dd>
10952 </dl>
10953
10954 <a name="Examples-25"></a>
10955 <h4 class="subsection">25.41.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-25" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-25" aria-hidden="true">TOC</a></span></h4>
10956
10957 <ul>
10958 <li> Detect 5 seconds of silence with -50dB noise tolerance:
10959 <div class="example">
10960 <pre class="example">silencedetect=n=-50dB:d=5
10961 </pre></div>
10962
10963 </li><li> Complete example with <code>ffmpeg</code> to detect silence with 0.0001 noise
10964 tolerance in <samp>silence.mp3</samp>:
10965 <div class="example">
10966 <pre class="example">ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
10967 </pre></div>
10968 </li></ul>
10969
10970 <a name="silenceremove"></a>
10971 <h3 class="section">25.42 silenceremove<span class="pull-right"><a class="anchor hidden-xs" href="#silenceremove" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-silenceremove" aria-hidden="true">TOC</a></span></h3>
10972
10973 <p>Remove silence from the beginning, middle or end of the audio.
10974 </p>
10975 <p>The filter accepts the following options:
10976 </p>
10977 <dl compact="compact">
10978 <dt><samp>start_periods</samp></dt>
10979 <dd><p>This value is used to indicate if audio should be trimmed at beginning of
10980 the audio. A value of zero indicates no silence should be trimmed from the
10981 beginning. When specifying a non-zero value, it trims audio up until it
10982 finds non-silence. Normally, when trimming silence from beginning of audio
10983 the <var>start_periods</var> will be <code>1</code> but it can be increased to higher
10984 values to trim all audio up to specific count of non-silence periods.
10985 Default value is <code>0</code>.
10986 </p>
10987 </dd>
10988 <dt><samp>start_duration</samp></dt>
10989 <dd><p>Specify the amount of time that non-silence must be detected before it stops
10990 trimming audio. By increasing the duration, bursts of noises can be treated
10991 as silence and trimmed off. Default value is <code>0</code>.
10992 </p>
10993 </dd>
10994 <dt><samp>start_threshold</samp></dt>
10995 <dd><p>This indicates what sample value should be treated as silence. For digital
10996 audio, a value of <code>0</code> may be fine but for audio recorded from analog,
10997 you may wish to increase the value to account for background noise.
10998 Can be specified in dB (in case &quot;dB&quot; is appended to the specified value)
10999 or amplitude ratio. Default value is <code>0</code>.
11000 </p>
11001 </dd>
11002 <dt><samp>stop_periods</samp></dt>
11003 <dd><p>Set the count for trimming silence from the end of audio.
11004 To remove silence from the middle of a file, specify a <var>stop_periods</var>
11005 that is negative. This value is then treated as a positive value and is
11006 used to indicate the effect should restart processing as specified by
11007 <var>start_periods</var>, making it suitable for removing periods of silence
11008 in the middle of the audio.
11009 Default value is <code>0</code>.
11010 </p>
11011 </dd>
11012 <dt><samp>stop_duration</samp></dt>
11013 <dd><p>Specify a duration of silence that must exist before audio is not copied any
11014 more. By specifying a higher duration, silence that is wanted can be left in
11015 the audio.
11016 Default value is <code>0</code>.
11017 </p>
11018 </dd>
11019 <dt><samp>stop_threshold</samp></dt>
11020 <dd><p>This is the same as <samp>start_threshold</samp> but for trimming silence from
11021 the end of audio.
11022 Can be specified in dB (in case &quot;dB&quot; is appended to the specified value)
11023 or amplitude ratio. Default value is <code>0</code>.
11024 </p>
11025 </dd>
11026 <dt><samp>leave_silence</samp></dt>
11027 <dd><p>This indicate that <var>stop_duration</var> length of audio should be left intact
11028 at the beginning of each period of silence.
11029 For example, if you want to remove long pauses between words but do not want
11030 to remove the pauses completely. Default value is <code>0</code>.
11031 </p>
11032 </dd>
11033 </dl>
11034
11035 <a name="Examples-26"></a>
11036 <h4 class="subsection">25.42.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-26" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-26" aria-hidden="true">TOC</a></span></h4>
11037
11038 <ul>
11039 <li> The following example shows how this filter can be used to start a recording
11040 that does not contain the delay at the start which usually occurs between
11041 pressing the record button and the start of the performance:
11042 <div class="example">
11043 <pre class="example">silenceremove=1:5:0.02
11044 </pre></div>
11045 </li></ul>
11046
11047 <a name="treble"></a>
11048 <h3 class="section">25.43 treble<span class="pull-right"><a class="anchor hidden-xs" href="#treble" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-treble" aria-hidden="true">TOC</a></span></h3>
11049
11050 <p>Boost or cut treble (upper) frequencies of the audio using a two-pole
11051 shelving filter with a response similar to that of a standard
11052 hi-fi&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
11053 </p>
11054 <p>The filter accepts the following options:
11055 </p>
11056 <dl compact="compact">
11057 <dt><samp>gain, g</samp></dt>
11058 <dd><p>Give the gain at whichever is the lower of ~22 kHz and the
11059 Nyquist frequency. Its useful range is about -20 (for a large cut)
11060 to +20 (for a large boost). Beware of clipping when using a positive gain.
11061 </p>
11062 </dd>
11063 <dt><samp>frequency, f</samp></dt>
11064 <dd><p>Set the filter&rsquo;s central frequency and so can be used
11065 to extend or reduce the frequency range to be boosted or cut.
11066 The default value is <code>3000</code> Hz.
11067 </p>
11068 </dd>
11069 <dt><samp>width_type</samp></dt>
11070 <dd><p>Set method to specify band-width of filter.
11071 </p><dl compact="compact">
11072 <dt><samp>h</samp></dt>
11073 <dd><p>Hz
11074 </p></dd>
11075 <dt><samp>q</samp></dt>
11076 <dd><p>Q-Factor
11077 </p></dd>
11078 <dt><samp>o</samp></dt>
11079 <dd><p>octave
11080 </p></dd>
11081 <dt><samp>s</samp></dt>
11082 <dd><p>slope
11083 </p></dd>
11084 </dl>
11085
11086 </dd>
11087 <dt><samp>width, w</samp></dt>
11088 <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
11089 </p></dd>
11090 </dl>
11091
11092 <a name="volume"></a>
11093 <h3 class="section">25.44 volume<span class="pull-right"><a class="anchor hidden-xs" href="#volume" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-volume" aria-hidden="true">TOC</a></span></h3>
11094
11095 <p>Adjust the input audio volume.
11096 </p>
11097 <p>It accepts the following parameters:
11098 </p><dl compact="compact">
11099 <dt><samp>volume</samp></dt>
11100 <dd><p>Set audio volume expression.
11101 </p>
11102 <p>Output values are clipped to the maximum value.
11103 </p>
11104 <p>The output audio volume is given by the relation:
11105 </p><div class="example">
11106 <pre class="example"><var>output_volume</var> = <var>volume</var> * <var>input_volume</var>
11107 </pre></div>
11108
11109 <p>The default value for <var>volume</var> is &quot;1.0&quot;.
11110 </p>
11111 </dd>
11112 <dt><samp>precision</samp></dt>
11113 <dd><p>This parameter represents the mathematical precision.
11114 </p>
11115 <p>It determines which input sample formats will be allowed, which affects the
11116 precision of the volume scaling.
11117 </p>
11118 <dl compact="compact">
11119 <dt><samp>fixed</samp></dt>
11120 <dd><p>8-bit fixed-point; this limits input sample format to U8, S16, and S32.
11121 </p></dd>
11122 <dt><samp>float</samp></dt>
11123 <dd><p>32-bit floating-point; this limits input sample format to FLT. (default)
11124 </p></dd>
11125 <dt><samp>double</samp></dt>
11126 <dd><p>64-bit floating-point; this limits input sample format to DBL.
11127 </p></dd>
11128 </dl>
11129
11130 </dd>
11131 <dt><samp>replaygain</samp></dt>
11132 <dd><p>Choose the behaviour on encountering ReplayGain side data in input frames.
11133 </p>
11134 <dl compact="compact">
11135 <dt><samp>drop</samp></dt>
11136 <dd><p>Remove ReplayGain side data, ignoring its contents (the default).
11137 </p>
11138 </dd>
11139 <dt><samp>ignore</samp></dt>
11140 <dd><p>Ignore ReplayGain side data, but leave it in the frame.
11141 </p>
11142 </dd>
11143 <dt><samp>track</samp></dt>
11144 <dd><p>Prefer the track gain, if present.
11145 </p>
11146 </dd>
11147 <dt><samp>album</samp></dt>
11148 <dd><p>Prefer the album gain, if present.
11149 </p></dd>
11150 </dl>
11151
11152 </dd>
11153 <dt><samp>replaygain_preamp</samp></dt>
11154 <dd><p>Pre-amplification gain in dB to apply to the selected replaygain gain.
11155 </p>
11156 <p>Default value for <var>replaygain_preamp</var> is 0.0.
11157 </p>
11158 </dd>
11159 <dt><samp>eval</samp></dt>
11160 <dd><p>Set when the volume expression is evaluated.
11161 </p>
11162 <p>It accepts the following values:
11163 </p><dl compact="compact">
11164 <dt>&lsquo;<samp>once</samp>&rsquo;</dt>
11165 <dd><p>only evaluate expression once during the filter initialization, or
11166 when the &lsquo;<samp>volume</samp>&rsquo; command is sent
11167 </p>
11168 </dd>
11169 <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
11170 <dd><p>evaluate expression for each incoming frame
11171 </p></dd>
11172 </dl>
11173
11174 <p>Default value is &lsquo;<samp>once</samp>&rsquo;.
11175 </p></dd>
11176 </dl>
11177
11178 <p>The volume expression can contain the following parameters.
11179 </p>
11180 <dl compact="compact">
11181 <dt><samp>n</samp></dt>
11182 <dd><p>frame number (starting at zero)
11183 </p></dd>
11184 <dt><samp>nb_channels</samp></dt>
11185 <dd><p>number of channels
11186 </p></dd>
11187 <dt><samp>nb_consumed_samples</samp></dt>
11188 <dd><p>number of samples consumed by the filter
11189 </p></dd>
11190 <dt><samp>nb_samples</samp></dt>
11191 <dd><p>number of samples in the current frame
11192 </p></dd>
11193 <dt><samp>pos</samp></dt>
11194 <dd><p>original frame position in the file
11195 </p></dd>
11196 <dt><samp>pts</samp></dt>
11197 <dd><p>frame PTS
11198 </p></dd>
11199 <dt><samp>sample_rate</samp></dt>
11200 <dd><p>sample rate
11201 </p></dd>
11202 <dt><samp>startpts</samp></dt>
11203 <dd><p>PTS at start of stream
11204 </p></dd>
11205 <dt><samp>startt</samp></dt>
11206 <dd><p>time at start of stream
11207 </p></dd>
11208 <dt><samp>t</samp></dt>
11209 <dd><p>frame time
11210 </p></dd>
11211 <dt><samp>tb</samp></dt>
11212 <dd><p>timestamp timebase
11213 </p></dd>
11214 <dt><samp>volume</samp></dt>
11215 <dd><p>last set volume value
11216 </p></dd>
11217 </dl>
11218
11219 <p>Note that when <samp>eval</samp> is set to &lsquo;<samp>once</samp>&rsquo; only the
11220 <var>sample_rate</var> and <var>tb</var> variables are available, all other
11221 variables will evaluate to NAN.
11222 </p>
11223 <a name="Commands-1"></a>
11224 <h4 class="subsection">25.44.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-1" aria-hidden="true">TOC</a></span></h4>
11225
11226 <p>This filter supports the following commands:
11227 </p><dl compact="compact">
11228 <dt><samp>volume</samp></dt>
11229 <dd><p>Modify the volume expression.
11230 The command accepts the same syntax of the corresponding option.
11231 </p>
11232 <p>If the specified expression is not valid, it is kept at its current
11233 value.
11234 </p></dd>
11235 <dt><samp>replaygain_noclip</samp></dt>
11236 <dd><p>Prevent clipping by limiting the gain applied.
11237 </p>
11238 <p>Default value for <var>replaygain_noclip</var> is 1.
11239 </p>
11240 </dd>
11241 </dl>
11242
11243 <a name="Examples-27"></a>
11244 <h4 class="subsection">25.44.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-27" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-27" aria-hidden="true">TOC</a></span></h4>
11245
11246 <ul>
11247 <li> Halve the input audio volume:
11248 <div class="example">
11249 <pre class="example">volume=volume=0.5
11250 volume=volume=1/2
11251 volume=volume=-6.0206dB
11252 </pre></div>
11253
11254 <p>In all the above example the named key for <samp>volume</samp> can be
11255 omitted, for example like in:
11256 </p><div class="example">
11257 <pre class="example">volume=0.5
11258 </pre></div>
11259
11260 </li><li> Increase input audio power by 6 decibels using fixed-point precision:
11261 <div class="example">
11262 <pre class="example">volume=volume=6dB:precision=fixed
11263 </pre></div>
11264
11265 </li><li> Fade volume after time 10 with an annihilation period of 5 seconds:
11266 <div class="example">
11267 <pre class="example">volume='if(lt(t,10),1,max(1-(t-10)/5,0))':eval=frame
11268 </pre></div>
11269 </li></ul>
11270
11271 <a name="volumedetect"></a>
11272 <h3 class="section">25.45 volumedetect<span class="pull-right"><a class="anchor hidden-xs" href="#volumedetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-volumedetect" aria-hidden="true">TOC</a></span></h3>
11273
11274 <p>Detect the volume of the input video.
11275 </p>
11276 <p>The filter has no parameters. The input is not modified. Statistics about
11277 the volume will be printed in the log when the input stream end is reached.
11278 </p>
11279 <p>In particular it will show the mean volume (root mean square), maximum
11280 volume (on a per-sample basis), and the beginning of a histogram of the
11281 registered volume values (from the maximum value to a cumulated 1/1000 of
11282 the samples).
11283 </p>
11284 <p>All volumes are in decibels relative to the maximum PCM value.
11285 </p>
11286 <a name="Examples-28"></a>
11287 <h4 class="subsection">25.45.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-28" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-28" aria-hidden="true">TOC</a></span></h4>
11288
11289 <p>Here is an excerpt of the output:
11290 </p><div class="example">
11291 <pre class="example">[Parsed_volumedetect_0 &nbsp;0xa23120] mean_volume: -27 dB
11292 [Parsed_volumedetect_0 &nbsp;0xa23120] max_volume: -4 dB
11293 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_4db: 6
11294 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_5db: 62
11295 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_6db: 286
11296 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_7db: 1042
11297 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_8db: 2551
11298 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_9db: 4609
11299 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_10db: 8409
11300 </pre></div>
11301
11302 <p>It means that:
11303 </p><ul>
11304 <li> The mean square energy is approximately -27 dB, or 10^-2.7.
11305 </li><li> The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB.
11306 </li><li> There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc.
11307 </li></ul>
11308
11309 <p>In other words, raising the volume by +4 dB does not cause any clipping,
11310 raising it by +5 dB causes clipping for 6 samples, etc.
11311 </p>
11312
11313 <a name="Audio-Sources"></a>
11314 <h2 class="chapter">26 Audio Sources<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Sources" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Sources" aria-hidden="true">TOC</a></span></h2>
11315
11316 <p>Below is a description of the currently available audio sources.
11317 </p>
11318 <a name="abuffer"></a>
11319 <h3 class="section">26.1 abuffer<span class="pull-right"><a class="anchor hidden-xs" href="#abuffer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-abuffer" aria-hidden="true">TOC</a></span></h3>
11320
11321 <p>Buffer audio frames, and make them available to the filter chain.
11322 </p>
11323 <p>This source is mainly intended for a programmatic use, in particular
11324 through the interface defined in <samp>libavfilter/asrc_abuffer.h</samp>.
11325 </p>
11326 <p>It accepts the following parameters:
11327 </p><dl compact="compact">
11328 <dt><samp>time_base</samp></dt>
11329 <dd><p>The timebase which will be used for timestamps of submitted frames. It must be
11330 either a floating-point number or in <var>numerator</var>/<var>denominator</var> form.
11331 </p>
11332 </dd>
11333 <dt><samp>sample_rate</samp></dt>
11334 <dd><p>The sample rate of the incoming audio buffers.
11335 </p>
11336 </dd>
11337 <dt><samp>sample_fmt</samp></dt>
11338 <dd><p>The sample format of the incoming audio buffers.
11339 Either a sample format name or its corresponding integer representation from
11340 the enum AVSampleFormat in <samp>libavutil/samplefmt.h</samp>
11341 </p>
11342 </dd>
11343 <dt><samp>channel_layout</samp></dt>
11344 <dd><p>The channel layout of the incoming audio buffers.
11345 Either a channel layout name from channel_layout_map in
11346 <samp>libavutil/channel_layout.c</samp> or its corresponding integer representation
11347 from the AV_CH_LAYOUT_* macros in <samp>libavutil/channel_layout.h</samp>
11348 </p>
11349 </dd>
11350 <dt><samp>channels</samp></dt>
11351 <dd><p>The number of channels of the incoming audio buffers.
11352 If both <var>channels</var> and <var>channel_layout</var> are specified, then they
11353 must be consistent.
11354 </p>
11355 </dd>
11356 </dl>
11357
11358 <a name="Examples-29"></a>
11359 <h4 class="subsection">26.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-29" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-29" aria-hidden="true">TOC</a></span></h4>
11360
11361 <div class="example">
11362 <pre class="example">abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
11363 </pre></div>
11364
11365 <p>will instruct the source to accept planar 16bit signed stereo at 44100Hz.
11366 Since the sample format with name &quot;s16p&quot; corresponds to the number
11367 6 and the &quot;stereo&quot; channel layout corresponds to the value 0x3, this is
11368 equivalent to:
11369 </p><div class="example">
11370 <pre class="example">abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
11371 </pre></div>
11372
11373 <a name="aevalsrc"></a>
11374 <h3 class="section">26.2 aevalsrc<span class="pull-right"><a class="anchor hidden-xs" href="#aevalsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aevalsrc" aria-hidden="true">TOC</a></span></h3>
11375
11376 <p>Generate an audio signal specified by an expression.
11377 </p>
11378 <p>This source accepts in input one or more expressions (one for each
11379 channel), which are evaluated and used to generate a corresponding
11380 audio signal.
11381 </p>
11382 <p>This source accepts the following options:
11383 </p>
11384 <dl compact="compact">
11385 <dt><samp>exprs</samp></dt>
11386 <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. In case the
11387 <samp>channel_layout</samp> option is not specified, the selected channel layout
11388 depends on the number of provided expressions. Otherwise the last
11389 specified expression is applied to the remaining output channels.
11390 </p>
11391 </dd>
11392 <dt><samp>channel_layout, c</samp></dt>
11393 <dd><p>Set the channel layout. The number of channels in the specified layout
11394 must be equal to the number of specified expressions.
11395 </p>
11396 </dd>
11397 <dt><samp>duration, d</samp></dt>
11398 <dd><p>Set the minimum duration of the sourced audio. See
11399 <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
11400 for the accepted syntax.
11401 Note that the resulting duration may be greater than the specified
11402 duration, as the generated audio is always cut at the end of a
11403 complete frame.
11404 </p>
11405 <p>If not specified, or the expressed duration is negative, the audio is
11406 supposed to be generated forever.
11407 </p>
11408 </dd>
11409 <dt><samp>nb_samples, n</samp></dt>
11410 <dd><p>Set the number of samples per channel per each output frame,
11411 default to 1024.
11412 </p>
11413 </dd>
11414 <dt><samp>sample_rate, s</samp></dt>
11415 <dd><p>Specify the sample rate, default to 44100.
11416 </p></dd>
11417 </dl>
11418
11419 <p>Each expression in <var>exprs</var> can contain the following constants:
11420 </p>
11421 <dl compact="compact">
11422 <dt><samp>n</samp></dt>
11423 <dd><p>number of the evaluated sample, starting from 0
11424 </p>
11425 </dd>
11426 <dt><samp>t</samp></dt>
11427 <dd><p>time of the evaluated sample expressed in seconds, starting from 0
11428 </p>
11429 </dd>
11430 <dt><samp>s</samp></dt>
11431 <dd><p>sample rate
11432 </p>
11433 </dd>
11434 </dl>
11435
11436 <a name="Examples-30"></a>
11437 <h4 class="subsection">26.2.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-30" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-30" aria-hidden="true">TOC</a></span></h4>
11438
11439 <ul>
11440 <li> Generate silence:
11441 <div class="example">
11442 <pre class="example">aevalsrc=0
11443 </pre></div>
11444
11445 </li><li> Generate a sin signal with frequency of 440 Hz, set sample rate to
11446 8000 Hz:
11447 <div class="example">
11448 <pre class="example">aevalsrc=&quot;sin(440*2*PI*t):s=8000&quot;
11449 </pre></div>
11450
11451 </li><li> Generate a two channels signal, specify the channel layout (Front
11452 Center + Back Center) explicitly:
11453 <div class="example">
11454 <pre class="example">aevalsrc=&quot;sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC&quot;
11455 </pre></div>
11456
11457 </li><li> Generate white noise:
11458 <div class="example">
11459 <pre class="example">aevalsrc=&quot;-2+random(0)&quot;
11460 </pre></div>
11461
11462 </li><li> Generate an amplitude modulated signal:
11463 <div class="example">
11464 <pre class="example">aevalsrc=&quot;sin(10*2*PI*t)*sin(880*2*PI*t)&quot;
11465 </pre></div>
11466
11467 </li><li> Generate 2.5 Hz binaural beats on a 360 Hz carrier:
11468 <div class="example">
11469 <pre class="example">aevalsrc=&quot;0.1*sin(2*PI*(360-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)&quot;
11470 </pre></div>
11471
11472 </li></ul>
11473
11474 <a name="anullsrc"></a>
11475 <h3 class="section">26.3 anullsrc<span class="pull-right"><a class="anchor hidden-xs" href="#anullsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anullsrc" aria-hidden="true">TOC</a></span></h3>
11476
11477 <p>The null audio source, return unprocessed audio frames. It is mainly useful
11478 as a template and to be employed in analysis / debugging tools, or as
11479 the source for filters which ignore the input data (for example the sox
11480 synth filter).
11481 </p>
11482 <p>This source accepts the following options:
11483 </p>
11484 <dl compact="compact">
11485 <dt><samp>channel_layout, cl</samp></dt>
11486 <dd>
11487 <p>Specifies the channel layout, and can be either an integer or a string
11488 representing a channel layout. The default value of <var>channel_layout</var>
11489 is &quot;stereo&quot;.
11490 </p>
11491 <p>Check the channel_layout_map definition in
11492 <samp>libavutil/channel_layout.c</samp> for the mapping between strings and
11493 channel layout values.
11494 </p>
11495 </dd>
11496 <dt><samp>sample_rate, r</samp></dt>
11497 <dd><p>Specifies the sample rate, and defaults to 44100.
11498 </p>
11499 </dd>
11500 <dt><samp>nb_samples, n</samp></dt>
11501 <dd><p>Set the number of samples per requested frames.
11502 </p>
11503 </dd>
11504 </dl>
11505
11506 <a name="Examples-31"></a>
11507 <h4 class="subsection">26.3.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-31" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-31" aria-hidden="true">TOC</a></span></h4>
11508
11509 <ul>
11510 <li> Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO.
11511 <div class="example">
11512 <pre class="example">anullsrc=r=48000:cl=4
11513 </pre></div>
11514
11515 </li><li> Do the same operation with a more obvious syntax:
11516 <div class="example">
11517 <pre class="example">anullsrc=r=48000:cl=mono
11518 </pre></div>
11519 </li></ul>
11520
11521 <p>All the parameters need to be explicitly defined.
11522 </p>
11523 <a name="flite"></a>
11524 <h3 class="section">26.4 flite<span class="pull-right"><a class="anchor hidden-xs" href="#flite" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flite" aria-hidden="true">TOC</a></span></h3>
11525
11526 <p>Synthesize a voice utterance using the libflite library.
11527 </p>
11528 <p>To enable compilation of this filter you need to configure FFmpeg with
11529 <code>--enable-libflite</code>.
11530 </p>
11531 <p>Note that the flite library is not thread-safe.
11532 </p>
11533 <p>The filter accepts the following options:
11534 </p>
11535 <dl compact="compact">
11536 <dt><samp>list_voices</samp></dt>
11537 <dd><p>If set to 1, list the names of the available voices and exit
11538 immediately. Default value is 0.
11539 </p>
11540 </dd>
11541 <dt><samp>nb_samples, n</samp></dt>
11542 <dd><p>Set the maximum number of samples per frame. Default value is 512.
11543 </p>
11544 </dd>
11545 <dt><samp>textfile</samp></dt>
11546 <dd><p>Set the filename containing the text to speak.
11547 </p>
11548 </dd>
11549 <dt><samp>text</samp></dt>
11550 <dd><p>Set the text to speak.
11551 </p>
11552 </dd>
11553 <dt><samp>voice, v</samp></dt>
11554 <dd><p>Set the voice to use for the speech synthesis. Default value is
11555 <code>kal</code>. See also the <var>list_voices</var> option.
11556 </p></dd>
11557 </dl>
11558
11559 <a name="Examples-32"></a>
11560 <h4 class="subsection">26.4.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-32" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-32" aria-hidden="true">TOC</a></span></h4>
11561
11562 <ul>
11563 <li> Read from file <samp>speech.txt</samp>, and synthesize the text using the
11564 standard flite voice:
11565 <div class="example">
11566 <pre class="example">flite=textfile=speech.txt
11567 </pre></div>
11568
11569 </li><li> Read the specified text selecting the <code>slt</code> voice:
11570 <div class="example">
11571 <pre class="example">flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
11572 </pre></div>
11573
11574 </li><li> Input text to ffmpeg:
11575 <div class="example">
11576 <pre class="example">ffmpeg -f lavfi -i flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
11577 </pre></div>
11578
11579 </li><li> Make <samp>ffplay</samp> speak the specified text, using <code>flite</code> and
11580 the <code>lavfi</code> device:
11581 <div class="example">
11582 <pre class="example">ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.'
11583 </pre></div>
11584 </li></ul>
11585
11586 <p>For more information about libflite, check:
11587 <a href="http://www.speech.cs.cmu.edu/flite/">http://www.speech.cs.cmu.edu/flite/</a>
11588 </p>
11589 <a name="sine"></a>
11590 <h3 class="section">26.5 sine<span class="pull-right"><a class="anchor hidden-xs" href="#sine" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sine" aria-hidden="true">TOC</a></span></h3>
11591
11592 <p>Generate an audio signal made of a sine wave with amplitude 1/8.
11593 </p>
11594 <p>The audio signal is bit-exact.
11595 </p>
11596 <p>The filter accepts the following options:
11597 </p>
11598 <dl compact="compact">
11599 <dt><samp>frequency, f</samp></dt>
11600 <dd><p>Set the carrier frequency. Default is 440 Hz.
11601 </p>
11602 </dd>
11603 <dt><samp>beep_factor, b</samp></dt>
11604 <dd><p>Enable a periodic beep every second with frequency <var>beep_factor</var> times
11605 the carrier frequency. Default is 0, meaning the beep is disabled.
11606 </p>
11607 </dd>
11608 <dt><samp>sample_rate, r</samp></dt>
11609 <dd><p>Specify the sample rate, default is 44100.
11610 </p>
11611 </dd>
11612 <dt><samp>duration, d</samp></dt>
11613 <dd><p>Specify the duration of the generated audio stream.
11614 </p>
11615 </dd>
11616 <dt><samp>samples_per_frame</samp></dt>
11617 <dd><p>Set the number of samples per output frame, default is 1024.
11618 </p></dd>
11619 </dl>
11620
11621 <a name="Examples-33"></a>
11622 <h4 class="subsection">26.5.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-33" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-33" aria-hidden="true">TOC</a></span></h4>
11623
11624 <ul>
11625 <li> Generate a simple 440 Hz sine wave:
11626 <div class="example">
11627 <pre class="example">sine
11628 </pre></div>
11629
11630 </li><li> Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds:
11631 <div class="example">
11632 <pre class="example">sine=220:4:d=5
11633 sine=f=220:b=4:d=5
11634 sine=frequency=220:beep_factor=4:duration=5
11635 </pre></div>
11636
11637 </li></ul>
11638
11639
11640 <a name="Audio-Sinks"></a>
11641 <h2 class="chapter">27 Audio Sinks<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Sinks" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Sinks" aria-hidden="true">TOC</a></span></h2>
11642
11643 <p>Below is a description of the currently available audio sinks.
11644 </p>
11645 <a name="abuffersink"></a>
11646 <h3 class="section">27.1 abuffersink<span class="pull-right"><a class="anchor hidden-xs" href="#abuffersink" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-abuffersink" aria-hidden="true">TOC</a></span></h3>
11647
11648 <p>Buffer audio frames, and make them available to the end of filter chain.
11649 </p>
11650 <p>This sink is mainly intended for programmatic use, in particular
11651 through the interface defined in <samp>libavfilter/buffersink.h</samp>
11652 or the options system.
11653 </p>
11654 <p>It accepts a pointer to an AVABufferSinkContext structure, which
11655 defines the incoming buffers&rsquo; formats, to be passed as the opaque
11656 parameter to <code>avfilter_init_filter</code> for initialization.
11657 </p><a name="anullsink"></a>
11658 <h3 class="section">27.2 anullsink<span class="pull-right"><a class="anchor hidden-xs" href="#anullsink" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anullsink" aria-hidden="true">TOC</a></span></h3>
11659
11660 <p>Null audio sink; do absolutely nothing with the input audio. It is
11661 mainly useful as a template and for use in analysis / debugging
11662 tools.
11663 </p>
11664
11665 <a name="Video-Filters"></a>
11666 <h2 class="chapter">28 Video Filters<span class="pull-right"><a class="anchor hidden-xs" href="#Video-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-Filters" aria-hidden="true">TOC</a></span></h2>
11667
11668 <p>When you configure your FFmpeg build, you can disable any of the
11669 existing filters using <code>--disable-filters</code>.
11670 The configure output will show the video filters included in your
11671 build.
11672 </p>
11673 <p>Below is a description of the currently available video filters.
11674 </p>
11675 <a name="alphaextract"></a>
11676 <h3 class="section">28.1 alphaextract<span class="pull-right"><a class="anchor hidden-xs" href="#alphaextract" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-alphaextract" aria-hidden="true">TOC</a></span></h3>
11677
11678 <p>Extract the alpha component from the input as a grayscale video. This
11679 is especially useful with the <var>alphamerge</var> filter.
11680 </p>
11681 <a name="alphamerge"></a>
11682 <h3 class="section">28.2 alphamerge<span class="pull-right"><a class="anchor hidden-xs" href="#alphamerge" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-alphamerge" aria-hidden="true">TOC</a></span></h3>
11683
11684 <p>Add or replace the alpha component of the primary input with the
11685 grayscale value of a second input. This is intended for use with
11686 <var>alphaextract</var> to allow the transmission or storage of frame
11687 sequences that have alpha in a format that doesn&rsquo;t support an alpha
11688 channel.
11689 </p>
11690 <p>For example, to reconstruct full frames from a normal YUV-encoded video
11691 and a separate video created with <var>alphaextract</var>, you might use:
11692 </p><div class="example">
11693 <pre class="example">movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
11694 </pre></div>
11695
11696 <p>Since this filter is designed for reconstruction, it operates on frame
11697 sequences without considering timestamps, and terminates when either
11698 input reaches end of stream. This will cause problems if your encoding
11699 pipeline drops frames. If you&rsquo;re trying to apply an image as an
11700 overlay to a video stream, consider the <var>overlay</var> filter instead.
11701 </p>
11702 <a name="ass"></a>
11703 <h3 class="section">28.3 ass<span class="pull-right"><a class="anchor hidden-xs" href="#ass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ass" aria-hidden="true">TOC</a></span></h3>
11704
11705 <p>Same as the <a href="#subtitles">subtitles</a> filter, except that it doesn&rsquo;t require libavcodec
11706 and libavformat to work. On the other hand, it is limited to ASS (Advanced
11707 Substation Alpha) subtitles files.
11708 </p>
11709 <p>This filter accepts the following option in addition to the common options from
11710 the <a href="#subtitles">subtitles</a> filter:
11711 </p>
11712 <dl compact="compact">
11713 <dt><samp>shaping</samp></dt>
11714 <dd><p>Set the shaping engine
11715 </p>
11716 <p>Available values are:
11717 </p><dl compact="compact">
11718 <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
11719 <dd><p>The default libass shaping engine, which is the best available.
11720 </p></dd>
11721 <dt>&lsquo;<samp>simple</samp>&rsquo;</dt>
11722 <dd><p>Fast, font-agnostic shaper that can do only substitutions
11723 </p></dd>
11724 <dt>&lsquo;<samp>complex</samp>&rsquo;</dt>
11725 <dd><p>Slower shaper using OpenType for substitutions and positioning
11726 </p></dd>
11727 </dl>
11728
11729 <p>The default is <code>auto</code>.
11730 </p></dd>
11731 </dl>
11732
11733 <a name="bbox"></a>
11734 <h3 class="section">28.4 bbox<span class="pull-right"><a class="anchor hidden-xs" href="#bbox" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bbox" aria-hidden="true">TOC</a></span></h3>
11735
11736 <p>Compute the bounding box for the non-black pixels in the input frame
11737 luminance plane.
11738 </p>
11739 <p>This filter computes the bounding box containing all the pixels with a
11740 luminance value greater than the minimum allowed value.
11741 The parameters describing the bounding box are printed on the filter
11742 log.
11743 </p>
11744 <p>The filter accepts the following option:
11745 </p>
11746 <dl compact="compact">
11747 <dt><samp>min_val</samp></dt>
11748 <dd><p>Set the minimal luminance value. Default is <code>16</code>.
11749 </p></dd>
11750 </dl>
11751
11752 <a name="blackdetect"></a>
11753 <h3 class="section">28.5 blackdetect<span class="pull-right"><a class="anchor hidden-xs" href="#blackdetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-blackdetect" aria-hidden="true">TOC</a></span></h3>
11754
11755 <p>Detect video intervals that are (almost) completely black. Can be
11756 useful to detect chapter transitions, commercials, or invalid
11757 recordings. Output lines contains the time for the start, end and
11758 duration of the detected black interval expressed in seconds.
11759 </p>
11760 <p>In order to display the output lines, you need to set the loglevel at
11761 least to the AV_LOG_INFO value.
11762 </p>
11763 <p>The filter accepts the following options:
11764 </p>
11765 <dl compact="compact">
11766 <dt><samp>black_min_duration, d</samp></dt>
11767 <dd><p>Set the minimum detected black duration expressed in seconds. It must
11768 be a non-negative floating point number.
11769 </p>
11770 <p>Default value is 2.0.
11771 </p>
11772 </dd>
11773 <dt><samp>picture_black_ratio_th, pic_th</samp></dt>
11774 <dd><p>Set the threshold for considering a picture &quot;black&quot;.
11775 Express the minimum value for the ratio:
11776 </p><div class="example">
11777 <pre class="example"><var>nb_black_pixels</var> / <var>nb_pixels</var>
11778 </pre></div>
11779
11780 <p>for which a picture is considered black.
11781 Default value is 0.98.
11782 </p>
11783 </dd>
11784 <dt><samp>pixel_black_th, pix_th</samp></dt>
11785 <dd><p>Set the threshold for considering a pixel &quot;black&quot;.
11786 </p>
11787 <p>The threshold expresses the maximum pixel luminance value for which a
11788 pixel is considered &quot;black&quot;. The provided value is scaled according to
11789 the following equation:
11790 </p><div class="example">
11791 <pre class="example"><var>absolute_threshold</var> = <var>luminance_minimum_value</var> + <var>pixel_black_th</var> * <var>luminance_range_size</var>
11792 </pre></div>
11793
11794 <p><var>luminance_range_size</var> and <var>luminance_minimum_value</var> depend on
11795 the input video format, the range is [0-255] for YUV full-range
11796 formats and [16-235] for YUV non full-range formats.
11797 </p>
11798 <p>Default value is 0.10.
11799 </p></dd>
11800 </dl>
11801
11802 <p>The following example sets the maximum pixel threshold to the minimum
11803 value, and detects only black intervals of 2 or more seconds:
11804 </p><div class="example">
11805 <pre class="example">blackdetect=d=2:pix_th=0.00
11806 </pre></div>
11807
11808 <a name="blackframe"></a>
11809 <h3 class="section">28.6 blackframe<span class="pull-right"><a class="anchor hidden-xs" href="#blackframe" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-blackframe" aria-hidden="true">TOC</a></span></h3>
11810
11811 <p>Detect frames that are (almost) completely black. Can be useful to
11812 detect chapter transitions or commercials. Output lines consist of
11813 the frame number of the detected frame, the percentage of blackness,
11814 the position in the file if known or -1 and the timestamp in seconds.
11815 </p>
11816 <p>In order to display the output lines, you need to set the loglevel at
11817 least to the AV_LOG_INFO value.
11818 </p>
11819 <p>It accepts the following parameters:
11820 </p>
11821 <dl compact="compact">
11822 <dt><samp>amount</samp></dt>
11823 <dd><p>The percentage of the pixels that have to be below the threshold; it defaults to
11824 <code>98</code>.
11825 </p>
11826 </dd>
11827 <dt><samp>threshold, thresh</samp></dt>
11828 <dd><p>The threshold below which a pixel value is considered black; it defaults to
11829 <code>32</code>.
11830 </p>
11831 </dd>
11832 </dl>
11833
11834 <a name="blend_002c-tblend"></a>
11835 <h3 class="section">28.7 blend, tblend<span class="pull-right"><a class="anchor hidden-xs" href="#blend_002c-tblend" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-blend_002c-tblend" aria-hidden="true">TOC</a></span></h3>
11836
11837 <p>Blend two video frames into each other.
11838 </p>
11839 <p>The <code>blend</code> filter takes two input streams and outputs one
11840 stream, the first input is the &quot;top&quot; layer and second input is
11841 &quot;bottom&quot; layer.  Output terminates when shortest input terminates.
11842 </p>
11843 <p>The <code>tblend</code> (time blend) filter takes two consecutive frames
11844 from one single stream, and outputs the result obtained by blending
11845 the new frame on top of the old frame.
11846 </p>
11847 <p>A description of the accepted options follows.
11848 </p>
11849 <dl compact="compact">
11850 <dt><samp>c0_mode</samp></dt>
11851 <dt><samp>c1_mode</samp></dt>
11852 <dt><samp>c2_mode</samp></dt>
11853 <dt><samp>c3_mode</samp></dt>
11854 <dt><samp>all_mode</samp></dt>
11855 <dd><p>Set blend mode for specific pixel component or all pixel components in case
11856 of <var>all_mode</var>. Default value is <code>normal</code>.
11857 </p>
11858 <p>Available values for component modes are:
11859 </p><dl compact="compact">
11860 <dt>&lsquo;<samp>addition</samp>&rsquo;</dt>
11861 <dt>&lsquo;<samp>and</samp>&rsquo;</dt>
11862 <dt>&lsquo;<samp>average</samp>&rsquo;</dt>
11863 <dt>&lsquo;<samp>burn</samp>&rsquo;</dt>
11864 <dt>&lsquo;<samp>darken</samp>&rsquo;</dt>
11865 <dt>&lsquo;<samp>difference</samp>&rsquo;</dt>
11866 <dt>&lsquo;<samp>difference128</samp>&rsquo;</dt>
11867 <dt>&lsquo;<samp>divide</samp>&rsquo;</dt>
11868 <dt>&lsquo;<samp>dodge</samp>&rsquo;</dt>
11869 <dt>&lsquo;<samp>exclusion</samp>&rsquo;</dt>
11870 <dt>&lsquo;<samp>glow</samp>&rsquo;</dt>
11871 <dt>&lsquo;<samp>hardlight</samp>&rsquo;</dt>
11872 <dt>&lsquo;<samp>hardmix</samp>&rsquo;</dt>
11873 <dt>&lsquo;<samp>lighten</samp>&rsquo;</dt>
11874 <dt>&lsquo;<samp>linearlight</samp>&rsquo;</dt>
11875 <dt>&lsquo;<samp>multiply</samp>&rsquo;</dt>
11876 <dt>&lsquo;<samp>negation</samp>&rsquo;</dt>
11877 <dt>&lsquo;<samp>normal</samp>&rsquo;</dt>
11878 <dt>&lsquo;<samp>or</samp>&rsquo;</dt>
11879 <dt>&lsquo;<samp>overlay</samp>&rsquo;</dt>
11880 <dt>&lsquo;<samp>phoenix</samp>&rsquo;</dt>
11881 <dt>&lsquo;<samp>pinlight</samp>&rsquo;</dt>
11882 <dt>&lsquo;<samp>reflect</samp>&rsquo;</dt>
11883 <dt>&lsquo;<samp>screen</samp>&rsquo;</dt>
11884 <dt>&lsquo;<samp>softlight</samp>&rsquo;</dt>
11885 <dt>&lsquo;<samp>subtract</samp>&rsquo;</dt>
11886 <dt>&lsquo;<samp>vividlight</samp>&rsquo;</dt>
11887 <dt>&lsquo;<samp>xor</samp>&rsquo;</dt>
11888 </dl>
11889
11890 </dd>
11891 <dt><samp>c0_opacity</samp></dt>
11892 <dt><samp>c1_opacity</samp></dt>
11893 <dt><samp>c2_opacity</samp></dt>
11894 <dt><samp>c3_opacity</samp></dt>
11895 <dt><samp>all_opacity</samp></dt>
11896 <dd><p>Set blend opacity for specific pixel component or all pixel components in case
11897 of <var>all_opacity</var>. Only used in combination with pixel component blend modes.
11898 </p>
11899 </dd>
11900 <dt><samp>c0_expr</samp></dt>
11901 <dt><samp>c1_expr</samp></dt>
11902 <dt><samp>c2_expr</samp></dt>
11903 <dt><samp>c3_expr</samp></dt>
11904 <dt><samp>all_expr</samp></dt>
11905 <dd><p>Set blend expression for specific pixel component or all pixel components in case
11906 of <var>all_expr</var>. Note that related mode options will be ignored if those are set.
11907 </p>
11908 <p>The expressions can use the following variables:
11909 </p>
11910 <dl compact="compact">
11911 <dt><samp>N</samp></dt>
11912 <dd><p>The sequential number of the filtered frame, starting from <code>0</code>.
11913 </p>
11914 </dd>
11915 <dt><samp>X</samp></dt>
11916 <dt><samp>Y</samp></dt>
11917 <dd><p>the coordinates of the current sample
11918 </p>
11919 </dd>
11920 <dt><samp>W</samp></dt>
11921 <dt><samp>H</samp></dt>
11922 <dd><p>the width and height of currently filtered plane
11923 </p>
11924 </dd>
11925 <dt><samp>SW</samp></dt>
11926 <dt><samp>SH</samp></dt>
11927 <dd><p>Width and height scale depending on the currently filtered plane. It is the
11928 ratio between the corresponding luma plane number of pixels and the current
11929 plane ones. E.g. for YUV4:2:0 the values are <code>1,1</code> for the luma plane, and
11930 <code>0.5,0.5</code> for chroma planes.
11931 </p>
11932 </dd>
11933 <dt><samp>T</samp></dt>
11934 <dd><p>Time of the current frame, expressed in seconds.
11935 </p>
11936 </dd>
11937 <dt><samp>TOP, A</samp></dt>
11938 <dd><p>Value of pixel component at current location for first video frame (top layer).
11939 </p>
11940 </dd>
11941 <dt><samp>BOTTOM, B</samp></dt>
11942 <dd><p>Value of pixel component at current location for second video frame (bottom layer).
11943 </p></dd>
11944 </dl>
11945
11946 </dd>
11947 <dt><samp>shortest</samp></dt>
11948 <dd><p>Force termination when the shortest input terminates. Default is
11949 <code>0</code>. This option is only defined for the <code>blend</code> filter.
11950 </p>
11951 </dd>
11952 <dt><samp>repeatlast</samp></dt>
11953 <dd><p>Continue applying the last bottom frame after the end of the stream. A value of
11954 <code>0</code> disable the filter after the last frame of the bottom layer is reached.
11955 Default is <code>1</code>. This option is only defined for the <code>blend</code> filter.
11956 </p></dd>
11957 </dl>
11958
11959 <a name="Examples-34"></a>
11960 <h4 class="subsection">28.7.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-34" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-34" aria-hidden="true">TOC</a></span></h4>
11961
11962 <ul>
11963 <li> Apply transition from bottom layer to top layer in first 10 seconds:
11964 <div class="example">
11965 <pre class="example">blend=all_expr='A*(if(gte(T,10),1,T/10))+B*(1-(if(gte(T,10),1,T/10)))'
11966 </pre></div>
11967
11968 </li><li> Apply 1x1 checkerboard effect:
11969 <div class="example">
11970 <pre class="example">blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
11971 </pre></div>
11972
11973 </li><li> Apply uncover left effect:
11974 <div class="example">
11975 <pre class="example">blend=all_expr='if(gte(N*SW+X,W),A,B)'
11976 </pre></div>
11977
11978 </li><li> Apply uncover down effect:
11979 <div class="example">
11980 <pre class="example">blend=all_expr='if(gte(Y-N*SH,0),A,B)'
11981 </pre></div>
11982
11983 </li><li> Apply uncover up-left effect:
11984 <div class="example">
11985 <pre class="example">blend=all_expr='if(gte(T*SH*40+Y,H)*gte((T*40*SW+X)*W/H,W),A,B)'
11986 </pre></div>
11987
11988 </li><li> Display differences between the current and the previous frame:
11989 <div class="example">
11990 <pre class="example">tblend=all_mode=difference128
11991 </pre></div>
11992 </li></ul>
11993
11994 <a name="boxblur"></a>
11995 <h3 class="section">28.8 boxblur<span class="pull-right"><a class="anchor hidden-xs" href="#boxblur" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-boxblur" aria-hidden="true">TOC</a></span></h3>
11996
11997 <p>Apply a boxblur algorithm to the input video.
11998 </p>
11999 <p>It accepts the following parameters:
12000 </p>
12001 <dl compact="compact">
12002 <dt><samp>luma_radius, lr</samp></dt>
12003 <dt><samp>luma_power, lp</samp></dt>
12004 <dt><samp>chroma_radius, cr</samp></dt>
12005 <dt><samp>chroma_power, cp</samp></dt>
12006 <dt><samp>alpha_radius, ar</samp></dt>
12007 <dt><samp>alpha_power, ap</samp></dt>
12008 </dl>
12009
12010 <p>A description of the accepted options follows.
12011 </p>
12012 <dl compact="compact">
12013 <dt><samp>luma_radius, lr</samp></dt>
12014 <dt><samp>chroma_radius, cr</samp></dt>
12015 <dt><samp>alpha_radius, ar</samp></dt>
12016 <dd><p>Set an expression for the box radius in pixels used for blurring the
12017 corresponding input plane.
12018 </p>
12019 <p>The radius value must be a non-negative number, and must not be
12020 greater than the value of the expression <code>min(w,h)/2</code> for the
12021 luma and alpha planes, and of <code>min(cw,ch)/2</code> for the chroma
12022 planes.
12023 </p>
12024 <p>Default value for <samp>luma_radius</samp> is &quot;2&quot;. If not specified,
12025 <samp>chroma_radius</samp> and <samp>alpha_radius</samp> default to the
12026 corresponding value set for <samp>luma_radius</samp>.
12027 </p>
12028 <p>The expressions can contain the following constants:
12029 </p><dl compact="compact">
12030 <dt><samp>w</samp></dt>
12031 <dt><samp>h</samp></dt>
12032 <dd><p>The input width and height in pixels.
12033 </p>
12034 </dd>
12035 <dt><samp>cw</samp></dt>
12036 <dt><samp>ch</samp></dt>
12037 <dd><p>The input chroma image width and height in pixels.
12038 </p>
12039 </dd>
12040 <dt><samp>hsub</samp></dt>
12041 <dt><samp>vsub</samp></dt>
12042 <dd><p>The horizontal and vertical chroma subsample values. For example, for the
12043 pixel format &quot;yuv422p&quot;, <var>hsub</var> is 2 and <var>vsub</var> is 1.
12044 </p></dd>
12045 </dl>
12046
12047 </dd>
12048 <dt><samp>luma_power, lp</samp></dt>
12049 <dt><samp>chroma_power, cp</samp></dt>
12050 <dt><samp>alpha_power, ap</samp></dt>
12051 <dd><p>Specify how many times the boxblur filter is applied to the
12052 corresponding plane.
12053 </p>
12054 <p>Default value for <samp>luma_power</samp> is 2. If not specified,
12055 <samp>chroma_power</samp> and <samp>alpha_power</samp> default to the
12056 corresponding value set for <samp>luma_power</samp>.
12057 </p>
12058 <p>A value of 0 will disable the effect.
12059 </p></dd>
12060 </dl>
12061
12062 <a name="Examples-35"></a>
12063 <h4 class="subsection">28.8.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-35" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-35" aria-hidden="true">TOC</a></span></h4>
12064
12065 <ul>
12066 <li> Apply a boxblur filter with the luma, chroma, and alpha radii
12067 set to 2:
12068 <div class="example">
12069 <pre class="example">boxblur=luma_radius=2:luma_power=1
12070 boxblur=2:1
12071 </pre></div>
12072
12073 </li><li> Set the luma radius to 2, and alpha and chroma radius to 0:
12074 <div class="example">
12075 <pre class="example">boxblur=2:1:cr=0:ar=0
12076 </pre></div>
12077
12078 </li><li> Set the luma and chroma radii to a fraction of the video dimension:
12079 <div class="example">
12080 <pre class="example">boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1
12081 </pre></div>
12082 </li></ul>
12083
12084 <a name="codecview"></a>
12085 <h3 class="section">28.9 codecview<span class="pull-right"><a class="anchor hidden-xs" href="#codecview" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-codecview" aria-hidden="true">TOC</a></span></h3>
12086
12087 <p>Visualize information exported by some codecs.
12088 </p>
12089 <p>Some codecs can export information through frames using side-data or other
12090 means. For example, some MPEG based codecs export motion vectors through the
12091 <var>export_mvs</var> flag in the codec <samp>flags2</samp> option.
12092 </p>
12093 <p>The filter accepts the following option:
12094 </p>
12095 <dl compact="compact">
12096 <dt><samp>mv</samp></dt>
12097 <dd><p>Set motion vectors to visualize.
12098 </p>
12099 <p>Available flags for <var>mv</var> are:
12100 </p>
12101 <dl compact="compact">
12102 <dt>&lsquo;<samp>pf</samp>&rsquo;</dt>
12103 <dd><p>forward predicted MVs of P-frames
12104 </p></dd>
12105 <dt>&lsquo;<samp>bf</samp>&rsquo;</dt>
12106 <dd><p>forward predicted MVs of B-frames
12107 </p></dd>
12108 <dt>&lsquo;<samp>bb</samp>&rsquo;</dt>
12109 <dd><p>backward predicted MVs of B-frames
12110 </p></dd>
12111 </dl>
12112 </dd>
12113 </dl>
12114
12115 <a name="Examples-36"></a>
12116 <h4 class="subsection">28.9.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-36" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-36" aria-hidden="true">TOC</a></span></h4>
12117
12118 <ul>
12119 <li> Visualizes multi-directionals MVs from P and B-Frames using <code>ffplay</code>:
12120 <div class="example">
12121 <pre class="example">ffplay -flags2 +export_mvs input.mpg -vf codecview=mv=pf+bf+bb
12122 </pre></div>
12123 </li></ul>
12124
12125 <a name="colorbalance"></a>
12126 <h3 class="section">28.10 colorbalance<span class="pull-right"><a class="anchor hidden-xs" href="#colorbalance" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorbalance" aria-hidden="true">TOC</a></span></h3>
12127 <p>Modify intensity of primary colors (red, green and blue) of input frames.
12128 </p>
12129 <p>The filter allows an input frame to be adjusted in the shadows, midtones or highlights
12130 regions for the red-cyan, green-magenta or blue-yellow balance.
12131 </p>
12132 <p>A positive adjustment value shifts the balance towards the primary color, a negative
12133 value towards the complementary color.
12134 </p>
12135 <p>The filter accepts the following options:
12136 </p>
12137 <dl compact="compact">
12138 <dt><samp>rs</samp></dt>
12139 <dt><samp>gs</samp></dt>
12140 <dt><samp>bs</samp></dt>
12141 <dd><p>Adjust red, green and blue shadows (darkest pixels).
12142 </p>
12143 </dd>
12144 <dt><samp>rm</samp></dt>
12145 <dt><samp>gm</samp></dt>
12146 <dt><samp>bm</samp></dt>
12147 <dd><p>Adjust red, green and blue midtones (medium pixels).
12148 </p>
12149 </dd>
12150 <dt><samp>rh</samp></dt>
12151 <dt><samp>gh</samp></dt>
12152 <dt><samp>bh</samp></dt>
12153 <dd><p>Adjust red, green and blue highlights (brightest pixels).
12154 </p>
12155 <p>Allowed ranges for options are <code>[-1.0, 1.0]</code>. Defaults are <code>0</code>.
12156 </p></dd>
12157 </dl>
12158
12159 <a name="Examples-37"></a>
12160 <h4 class="subsection">28.10.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-37" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-37" aria-hidden="true">TOC</a></span></h4>
12161
12162 <ul>
12163 <li> Add red color cast to shadows:
12164 <div class="example">
12165 <pre class="example">colorbalance=rs=.3
12166 </pre></div>
12167 </li></ul>
12168
12169 <a name="colorlevels"></a>
12170 <h3 class="section">28.11 colorlevels<span class="pull-right"><a class="anchor hidden-xs" href="#colorlevels" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorlevels" aria-hidden="true">TOC</a></span></h3>
12171
12172 <p>Adjust video input frames using levels.
12173 </p>
12174 <p>The filter accepts the following options:
12175 </p>
12176 <dl compact="compact">
12177 <dt><samp>rimin</samp></dt>
12178 <dt><samp>gimin</samp></dt>
12179 <dt><samp>bimin</samp></dt>
12180 <dt><samp>aimin</samp></dt>
12181 <dd><p>Adjust red, green, blue and alpha input black point.
12182 Allowed ranges for options are <code>[-1.0, 1.0]</code>. Defaults are <code>0</code>.
12183 </p>
12184 </dd>
12185 <dt><samp>rimax</samp></dt>
12186 <dt><samp>gimax</samp></dt>
12187 <dt><samp>bimax</samp></dt>
12188 <dt><samp>aimax</samp></dt>
12189 <dd><p>Adjust red, green, blue and alpha input white point.
12190 Allowed ranges for options are <code>[-1.0, 1.0]</code>. Defaults are <code>1</code>.
12191 </p>
12192 <p>Input levels are used to lighten highlights (bright tones), darken shadows
12193 (dark tones), change the balance of bright and dark tones.
12194 </p>
12195 </dd>
12196 <dt><samp>romin</samp></dt>
12197 <dt><samp>gomin</samp></dt>
12198 <dt><samp>bomin</samp></dt>
12199 <dt><samp>aomin</samp></dt>
12200 <dd><p>Adjust red, green, blue and alpha output black point.
12201 Allowed ranges for options are <code>[0, 1.0]</code>. Defaults are <code>0</code>.
12202 </p>
12203 </dd>
12204 <dt><samp>romax</samp></dt>
12205 <dt><samp>gomax</samp></dt>
12206 <dt><samp>bomax</samp></dt>
12207 <dt><samp>aomax</samp></dt>
12208 <dd><p>Adjust red, green, blue and alpha output white point.
12209 Allowed ranges for options are <code>[0, 1.0]</code>. Defaults are <code>1</code>.
12210 </p>
12211 <p>Output levels allows manual selection of a constrained output level range.
12212 </p></dd>
12213 </dl>
12214
12215 <a name="Examples-38"></a>
12216 <h4 class="subsection">28.11.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-38" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-38" aria-hidden="true">TOC</a></span></h4>
12217
12218 <ul>
12219 <li> Make video output darker:
12220 <div class="example">
12221 <pre class="example">colorlevels=rimin=0.058:gimin=0.058:bimin=0.058
12222 </pre></div>
12223
12224 </li><li> Increase contrast:
12225 <div class="example">
12226 <pre class="example">colorlevels=rimin=0.039:gimin=0.039:bimin=0.039:rimax=0.96:gimax=0.96:bimax=0.96
12227 </pre></div>
12228
12229 </li><li> Make video output lighter:
12230 <div class="example">
12231 <pre class="example">colorlevels=rimax=0.902:gimax=0.902:bimax=0.902
12232 </pre></div>
12233
12234 </li><li> Increase brightness:
12235 <div class="example">
12236 <pre class="example">colorlevels=romin=0.5:gomin=0.5:bomin=0.5
12237 </pre></div>
12238 </li></ul>
12239
12240 <a name="colorchannelmixer"></a>
12241 <h3 class="section">28.12 colorchannelmixer<span class="pull-right"><a class="anchor hidden-xs" href="#colorchannelmixer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorchannelmixer" aria-hidden="true">TOC</a></span></h3>
12242
12243 <p>Adjust video input frames by re-mixing color channels.
12244 </p>
12245 <p>This filter modifies a color channel by adding the values associated to
12246 the other channels of the same pixels. For example if the value to
12247 modify is red, the output value will be:
12248 </p><div class="example">
12249 <pre class="example"><var>red</var>=<var>red</var>*<var>rr</var> + <var>blue</var>*<var>rb</var> + <var>green</var>*<var>rg</var> + <var>alpha</var>*<var>ra</var>
12250 </pre></div>
12251
12252 <p>The filter accepts the following options:
12253 </p>
12254 <dl compact="compact">
12255 <dt><samp>rr</samp></dt>
12256 <dt><samp>rg</samp></dt>
12257 <dt><samp>rb</samp></dt>
12258 <dt><samp>ra</samp></dt>
12259 <dd><p>Adjust contribution of input red, green, blue and alpha channels for output red channel.
12260 Default is <code>1</code> for <var>rr</var>, and <code>0</code> for <var>rg</var>, <var>rb</var> and <var>ra</var>.
12261 </p>
12262 </dd>
12263 <dt><samp>gr</samp></dt>
12264 <dt><samp>gg</samp></dt>
12265 <dt><samp>gb</samp></dt>
12266 <dt><samp>ga</samp></dt>
12267 <dd><p>Adjust contribution of input red, green, blue and alpha channels for output green channel.
12268 Default is <code>1</code> for <var>gg</var>, and <code>0</code> for <var>gr</var>, <var>gb</var> and <var>ga</var>.
12269 </p>
12270 </dd>
12271 <dt><samp>br</samp></dt>
12272 <dt><samp>bg</samp></dt>
12273 <dt><samp>bb</samp></dt>
12274 <dt><samp>ba</samp></dt>
12275 <dd><p>Adjust contribution of input red, green, blue and alpha channels for output blue channel.
12276 Default is <code>1</code> for <var>bb</var>, and <code>0</code> for <var>br</var>, <var>bg</var> and <var>ba</var>.
12277 </p>
12278 </dd>
12279 <dt><samp>ar</samp></dt>
12280 <dt><samp>ag</samp></dt>
12281 <dt><samp>ab</samp></dt>
12282 <dt><samp>aa</samp></dt>
12283 <dd><p>Adjust contribution of input red, green, blue and alpha channels for output alpha channel.
12284 Default is <code>1</code> for <var>aa</var>, and <code>0</code> for <var>ar</var>, <var>ag</var> and <var>ab</var>.
12285 </p>
12286 <p>Allowed ranges for options are <code>[-2.0, 2.0]</code>.
12287 </p></dd>
12288 </dl>
12289
12290 <a name="Examples-39"></a>
12291 <h4 class="subsection">28.12.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-39" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-39" aria-hidden="true">TOC</a></span></h4>
12292
12293 <ul>
12294 <li> Convert source to grayscale:
12295 <div class="example">
12296 <pre class="example">colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
12297 </pre></div>
12298 </li><li> Simulate sepia tones:
12299 <div class="example">
12300 <pre class="example">colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131
12301 </pre></div>
12302 </li></ul>
12303
12304 <a name="colormatrix"></a>
12305 <h3 class="section">28.13 colormatrix<span class="pull-right"><a class="anchor hidden-xs" href="#colormatrix" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colormatrix" aria-hidden="true">TOC</a></span></h3>
12306
12307 <p>Convert color matrix.
12308 </p>
12309 <p>The filter accepts the following options:
12310 </p>
12311 <dl compact="compact">
12312 <dt><samp>src</samp></dt>
12313 <dt><samp>dst</samp></dt>
12314 <dd><p>Specify the source and destination color matrix. Both values must be
12315 specified.
12316 </p>
12317 <p>The accepted values are:
12318 </p><dl compact="compact">
12319 <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
12320 <dd><p>BT.709
12321 </p>
12322 </dd>
12323 <dt>&lsquo;<samp>bt601</samp>&rsquo;</dt>
12324 <dd><p>BT.601
12325 </p>
12326 </dd>
12327 <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
12328 <dd><p>SMPTE-240M
12329 </p>
12330 </dd>
12331 <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
12332 <dd><p>FCC
12333 </p></dd>
12334 </dl>
12335 </dd>
12336 </dl>
12337
12338 <p>For example to convert from BT.601 to SMPTE-240M, use the command:
12339 </p><div class="example">
12340 <pre class="example">colormatrix=bt601:smpte240m
12341 </pre></div>
12342
12343 <a name="copy"></a>
12344 <h3 class="section">28.14 copy<span class="pull-right"><a class="anchor hidden-xs" href="#copy" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-copy" aria-hidden="true">TOC</a></span></h3>
12345
12346 <p>Copy the input source unchanged to the output. This is mainly useful for
12347 testing purposes.
12348 </p>
12349 <a name="crop"></a>
12350 <h3 class="section">28.15 crop<span class="pull-right"><a class="anchor hidden-xs" href="#crop" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-crop" aria-hidden="true">TOC</a></span></h3>
12351
12352 <p>Crop the input video to given dimensions.
12353 </p>
12354 <p>It accepts the following parameters:
12355 </p>
12356 <dl compact="compact">
12357 <dt><samp>w, out_w</samp></dt>
12358 <dd><p>The width of the output video. It defaults to <code>iw</code>.
12359 This expression is evaluated only once during the filter
12360 configuration.
12361 </p>
12362 </dd>
12363 <dt><samp>h, out_h</samp></dt>
12364 <dd><p>The height of the output video. It defaults to <code>ih</code>.
12365 This expression is evaluated only once during the filter
12366 configuration.
12367 </p>
12368 </dd>
12369 <dt><samp>x</samp></dt>
12370 <dd><p>The horizontal position, in the input video, of the left edge of the output
12371 video. It defaults to <code>(in_w-out_w)/2</code>.
12372 This expression is evaluated per-frame.
12373 </p>
12374 </dd>
12375 <dt><samp>y</samp></dt>
12376 <dd><p>The vertical position, in the input video, of the top edge of the output video.
12377 It defaults to <code>(in_h-out_h)/2</code>.
12378 This expression is evaluated per-frame.
12379 </p>
12380 </dd>
12381 <dt><samp>keep_aspect</samp></dt>
12382 <dd><p>If set to 1 will force the output display aspect ratio
12383 to be the same of the input, by changing the output sample aspect
12384 ratio. It defaults to 0.
12385 </p></dd>
12386 </dl>
12387
12388 <p>The <var>out_w</var>, <var>out_h</var>, <var>x</var>, <var>y</var> parameters are
12389 expressions containing the following constants:
12390 </p>
12391 <dl compact="compact">
12392 <dt><samp>x</samp></dt>
12393 <dt><samp>y</samp></dt>
12394 <dd><p>The computed values for <var>x</var> and <var>y</var>. They are evaluated for
12395 each new frame.
12396 </p>
12397 </dd>
12398 <dt><samp>in_w</samp></dt>
12399 <dt><samp>in_h</samp></dt>
12400 <dd><p>The input width and height.
12401 </p>
12402 </dd>
12403 <dt><samp>iw</samp></dt>
12404 <dt><samp>ih</samp></dt>
12405 <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
12406 </p>
12407 </dd>
12408 <dt><samp>out_w</samp></dt>
12409 <dt><samp>out_h</samp></dt>
12410 <dd><p>The output (cropped) width and height.
12411 </p>
12412 </dd>
12413 <dt><samp>ow</samp></dt>
12414 <dt><samp>oh</samp></dt>
12415 <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>.
12416 </p>
12417 </dd>
12418 <dt><samp>a</samp></dt>
12419 <dd><p>same as <var>iw</var> / <var>ih</var>
12420 </p>
12421 </dd>
12422 <dt><samp>sar</samp></dt>
12423 <dd><p>input sample aspect ratio
12424 </p>
12425 </dd>
12426 <dt><samp>dar</samp></dt>
12427 <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
12428 </p>
12429 </dd>
12430 <dt><samp>hsub</samp></dt>
12431 <dt><samp>vsub</samp></dt>
12432 <dd><p>horizontal and vertical chroma subsample values. For example for the
12433 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
12434 </p>
12435 </dd>
12436 <dt><samp>n</samp></dt>
12437 <dd><p>The number of the input frame, starting from 0.
12438 </p>
12439 </dd>
12440 <dt><samp>pos</samp></dt>
12441 <dd><p>the position in the file of the input frame, NAN if unknown
12442 </p>
12443 </dd>
12444 <dt><samp>t</samp></dt>
12445 <dd><p>The timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
12446 </p>
12447 </dd>
12448 </dl>
12449
12450 <p>The expression for <var>out_w</var> may depend on the value of <var>out_h</var>,
12451 and the expression for <var>out_h</var> may depend on <var>out_w</var>, but they
12452 cannot depend on <var>x</var> and <var>y</var>, as <var>x</var> and <var>y</var> are
12453 evaluated after <var>out_w</var> and <var>out_h</var>.
12454 </p>
12455 <p>The <var>x</var> and <var>y</var> parameters specify the expressions for the
12456 position of the top-left corner of the output (non-cropped) area. They
12457 are evaluated for each frame. If the evaluated value is not valid, it
12458 is approximated to the nearest valid value.
12459 </p>
12460 <p>The expression for <var>x</var> may depend on <var>y</var>, and the expression
12461 for <var>y</var> may depend on <var>x</var>.
12462 </p>
12463 <a name="Examples-40"></a>
12464 <h4 class="subsection">28.15.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-40" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-40" aria-hidden="true">TOC</a></span></h4>
12465
12466 <ul>
12467 <li> Crop area with size 100x100 at position (12,34).
12468 <div class="example">
12469 <pre class="example">crop=100:100:12:34
12470 </pre></div>
12471
12472 <p>Using named options, the example above becomes:
12473 </p><div class="example">
12474 <pre class="example">crop=w=100:h=100:x=12:y=34
12475 </pre></div>
12476
12477 </li><li> Crop the central input area with size 100x100:
12478 <div class="example">
12479 <pre class="example">crop=100:100
12480 </pre></div>
12481
12482 </li><li> Crop the central input area with size 2/3 of the input video:
12483 <div class="example">
12484 <pre class="example">crop=2/3*in_w:2/3*in_h
12485 </pre></div>
12486
12487 </li><li> Crop the input video central square:
12488 <div class="example">
12489 <pre class="example">crop=out_w=in_h
12490 crop=in_h
12491 </pre></div>
12492
12493 </li><li> Delimit the rectangle with the top-left corner placed at position
12494 100:100 and the right-bottom corner corresponding to the right-bottom
12495 corner of the input image.
12496 <div class="example">
12497 <pre class="example">crop=in_w-100:in_h-100:100:100
12498 </pre></div>
12499
12500 </li><li> Crop 10 pixels from the left and right borders, and 20 pixels from
12501 the top and bottom borders
12502 <div class="example">
12503 <pre class="example">crop=in_w-2*10:in_h-2*20
12504 </pre></div>
12505
12506 </li><li> Keep only the bottom right quarter of the input image:
12507 <div class="example">
12508 <pre class="example">crop=in_w/2:in_h/2:in_w/2:in_h/2
12509 </pre></div>
12510
12511 </li><li> Crop height for getting Greek harmony:
12512 <div class="example">
12513 <pre class="example">crop=in_w:1/PHI*in_w
12514 </pre></div>
12515
12516 </li><li> Apply trembling effect:
12517 <div class="example">
12518 <pre class="example">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)
12519 </pre></div>
12520
12521 </li><li> Apply erratic camera effect depending on timestamp:
12522 <div class="example">
12523 <pre class="example">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;
12524 </pre></div>
12525
12526 </li><li> Set x depending on the value of y:
12527 <div class="example">
12528 <pre class="example">crop=in_w/2:in_h/2:y:10+10*sin(n/10)
12529 </pre></div>
12530 </li></ul>
12531
12532 <a name="cropdetect"></a>
12533 <h3 class="section">28.16 cropdetect<span class="pull-right"><a class="anchor hidden-xs" href="#cropdetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cropdetect" aria-hidden="true">TOC</a></span></h3>
12534
12535 <p>Auto-detect the crop size.
12536 </p>
12537 <p>It calculates the necessary cropping parameters and prints the
12538 recommended parameters via the logging system. The detected dimensions
12539 correspond to the non-black area of the input video.
12540 </p>
12541 <p>It accepts the following parameters:
12542 </p>
12543 <dl compact="compact">
12544 <dt><samp>limit</samp></dt>
12545 <dd><p>Set higher black value threshold, which can be optionally specified
12546 from nothing (0) to everything (255 for 8bit based formats). An intensity
12547 value greater to the set value is considered non-black. It defaults to 24.
12548 You can also specify a value between 0.0 and 1.0 which will be scaled depending
12549 on the bitdepth of the pixel format.
12550 </p>
12551 </dd>
12552 <dt><samp>round</samp></dt>
12553 <dd><p>The value which the width/height should be divisible by. It defaults to
12554 16. The offset is automatically adjusted to center the video. Use 2 to
12555 get only even dimensions (needed for 4:2:2 video). 16 is best when
12556 encoding to most video codecs.
12557 </p>
12558 </dd>
12559 <dt><samp>reset_count, reset</samp></dt>
12560 <dd><p>Set the counter that determines after how many frames cropdetect will
12561 reset the previously detected largest video area and start over to
12562 detect the current optimal crop area. Default value is 0.
12563 </p>
12564 <p>This can be useful when channel logos distort the video area. 0
12565 indicates &rsquo;never reset&rsquo;, and returns the largest area encountered during
12566 playback.
12567 </p></dd>
12568 </dl>
12569
12570 <a name="curves"></a><a name="curves-1"></a>
12571 <h3 class="section">28.17 curves<span class="pull-right"><a class="anchor hidden-xs" href="#curves-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-curves-1" aria-hidden="true">TOC</a></span></h3>
12572
12573 <p>Apply color adjustments using curves.
12574 </p>
12575 <p>This filter is similar to the Adobe Photoshop and GIMP curves tools. Each
12576 component (red, green and blue) has its values defined by <var>N</var> key points
12577 tied from each other using a smooth curve. The x-axis represents the pixel
12578 values from the input frame, and the y-axis the new pixel values to be set for
12579 the output frame.
12580 </p>
12581 <p>By default, a component curve is defined by the two points <var>(0;0)</var> and
12582 <var>(1;1)</var>. This creates a straight line where each original pixel value is
12583 &quot;adjusted&quot; to its own value, which means no change to the image.
12584 </p>
12585 <p>The filter allows you to redefine these two points and add some more. A new
12586 curve (using a natural cubic spline interpolation) will be define to pass
12587 smoothly through all these new coordinates. The new defined points needs to be
12588 strictly increasing over the x-axis, and their <var>x</var> and <var>y</var> values must
12589 be in the <var>[0;1]</var> interval.  If the computed curves happened to go outside
12590 the vector spaces, the values will be clipped accordingly.
12591 </p>
12592 <p>If there is no key point defined in <code>x=0</code>, the filter will automatically
12593 insert a <var>(0;0)</var> point. In the same way, if there is no key point defined
12594 in <code>x=1</code>, the filter will automatically insert a <var>(1;1)</var> point.
12595 </p>
12596 <p>The filter accepts the following options:
12597 </p>
12598 <dl compact="compact">
12599 <dt><samp>preset</samp></dt>
12600 <dd><p>Select one of the available color presets. This option can be used in addition
12601 to the <samp>r</samp>, <samp>g</samp>, <samp>b</samp> parameters; in this case, the later
12602 options takes priority on the preset values.
12603 Available presets are:
12604 </p><dl compact="compact">
12605 <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
12606 <dt>&lsquo;<samp>color_negative</samp>&rsquo;</dt>
12607 <dt>&lsquo;<samp>cross_process</samp>&rsquo;</dt>
12608 <dt>&lsquo;<samp>darker</samp>&rsquo;</dt>
12609 <dt>&lsquo;<samp>increase_contrast</samp>&rsquo;</dt>
12610 <dt>&lsquo;<samp>lighter</samp>&rsquo;</dt>
12611 <dt>&lsquo;<samp>linear_contrast</samp>&rsquo;</dt>
12612 <dt>&lsquo;<samp>medium_contrast</samp>&rsquo;</dt>
12613 <dt>&lsquo;<samp>negative</samp>&rsquo;</dt>
12614 <dt>&lsquo;<samp>strong_contrast</samp>&rsquo;</dt>
12615 <dt>&lsquo;<samp>vintage</samp>&rsquo;</dt>
12616 </dl>
12617 <p>Default is <code>none</code>.
12618 </p></dd>
12619 <dt><samp>master, m</samp></dt>
12620 <dd><p>Set the master key points. These points will define a second pass mapping. It
12621 is sometimes called a &quot;luminance&quot; or &quot;value&quot; mapping. It can be used with
12622 <samp>r</samp>, <samp>g</samp>, <samp>b</samp> or <samp>all</samp> since it acts like a
12623 post-processing LUT.
12624 </p></dd>
12625 <dt><samp>red, r</samp></dt>
12626 <dd><p>Set the key points for the red component.
12627 </p></dd>
12628 <dt><samp>green, g</samp></dt>
12629 <dd><p>Set the key points for the green component.
12630 </p></dd>
12631 <dt><samp>blue, b</samp></dt>
12632 <dd><p>Set the key points for the blue component.
12633 </p></dd>
12634 <dt><samp>all</samp></dt>
12635 <dd><p>Set the key points for all components (not including master).
12636 Can be used in addition to the other key points component
12637 options. In this case, the unset component(s) will fallback on this
12638 <samp>all</samp> setting.
12639 </p></dd>
12640 <dt><samp>psfile</samp></dt>
12641 <dd><p>Specify a Photoshop curves file (<code>.asv</code>) to import the settings from.
12642 </p></dd>
12643 </dl>
12644
12645 <p>To avoid some filtergraph syntax conflicts, each key points list need to be
12646 defined using the following syntax: <code>x0/y0 x1/y1 x2/y2 ...</code>.
12647 </p>
12648 <a name="Examples-41"></a>
12649 <h4 class="subsection">28.17.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-41" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-41" aria-hidden="true">TOC</a></span></h4>
12650
12651 <ul>
12652 <li> Increase slightly the middle level of blue:
12653 <div class="example">
12654 <pre class="example">curves=blue='0.5/0.58'
12655 </pre></div>
12656
12657 </li><li> Vintage effect:
12658 <div class="example">
12659 <pre class="example">curves=r='0/0.11 .42/.51 1/0.95':g='0.50/0.48':b='0/0.22 .49/.44 1/0.8'
12660 </pre></div>
12661 <p>Here we obtain the following coordinates for each components:
12662 </p><dl compact="compact">
12663 <dt><var>red</var></dt>
12664 <dd><p><code>(0;0.11) (0.42;0.51) (1;0.95)</code>
12665 </p></dd>
12666 <dt><var>green</var></dt>
12667 <dd><p><code>(0;0) (0.50;0.48) (1;1)</code>
12668 </p></dd>
12669 <dt><var>blue</var></dt>
12670 <dd><p><code>(0;0.22) (0.49;0.44) (1;0.80)</code>
12671 </p></dd>
12672 </dl>
12673
12674 </li><li> The previous example can also be achieved with the associated built-in preset:
12675 <div class="example">
12676 <pre class="example">curves=preset=vintage
12677 </pre></div>
12678
12679 </li><li> Or simply:
12680 <div class="example">
12681 <pre class="example">curves=vintage
12682 </pre></div>
12683
12684 </li><li> Use a Photoshop preset and redefine the points of the green component:
12685 <div class="example">
12686 <pre class="example">curves=psfile='MyCurvesPresets/purple.asv':green='0.45/0.53'
12687 </pre></div>
12688 </li></ul>
12689
12690 <a name="dctdnoiz"></a>
12691 <h3 class="section">28.18 dctdnoiz<span class="pull-right"><a class="anchor hidden-xs" href="#dctdnoiz" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dctdnoiz" aria-hidden="true">TOC</a></span></h3>
12692
12693 <p>Denoise frames using 2D DCT (frequency domain filtering).
12694 </p>
12695 <p>This filter is not designed for real time.
12696 </p>
12697 <p>The filter accepts the following options:
12698 </p>
12699 <dl compact="compact">
12700 <dt><samp>sigma, s</samp></dt>
12701 <dd><p>Set the noise sigma constant.
12702 </p>
12703 <p>This <var>sigma</var> defines a hard threshold of <code>3 * sigma</code>; every DCT
12704 coefficient (absolute value) below this threshold with be dropped.
12705 </p>
12706 <p>If you need a more advanced filtering, see <samp>expr</samp>.
12707 </p>
12708 <p>Default is <code>0</code>.
12709 </p>
12710 </dd>
12711 <dt><samp>overlap</samp></dt>
12712 <dd><p>Set number overlapping pixels for each block. Since the filter can be slow, you
12713 may want to reduce this value, at the cost of a less effective filter and the
12714 risk of various artefacts.
12715 </p>
12716 <p>If the overlapping value doesn&rsquo;t permit processing the whole input width or
12717 height, a warning will be displayed and according borders won&rsquo;t be denoised.
12718 </p>
12719 <p>Default value is <var>blocksize</var>-1, which is the best possible setting.
12720 </p>
12721 </dd>
12722 <dt><samp>expr, e</samp></dt>
12723 <dd><p>Set the coefficient factor expression.
12724 </p>
12725 <p>For each coefficient of a DCT block, this expression will be evaluated as a
12726 multiplier value for the coefficient.
12727 </p>
12728 <p>If this is option is set, the <samp>sigma</samp> option will be ignored.
12729 </p>
12730 <p>The absolute value of the coefficient can be accessed through the <var>c</var>
12731 variable.
12732 </p>
12733 </dd>
12734 <dt><samp>n</samp></dt>
12735 <dd><p>Set the <var>blocksize</var> using the number of bits. <code>1&lt;&lt;<var>n</var></code> defines the
12736 <var>blocksize</var>, which is the width and height of the processed blocks.
12737 </p>
12738 <p>The default value is <var>3</var> (8x8) and can be raised to <var>4</var> for a
12739 <var>blocksize</var> of 16x16. Note that changing this setting has huge consequences
12740 on the speed processing. Also, a larger block size does not necessarily means a
12741 better de-noising.
12742 </p></dd>
12743 </dl>
12744
12745 <a name="Examples-42"></a>
12746 <h4 class="subsection">28.18.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-42" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-42" aria-hidden="true">TOC</a></span></h4>
12747
12748 <p>Apply a denoise with a <samp>sigma</samp> of <code>4.5</code>:
12749 </p><div class="example">
12750 <pre class="example">dctdnoiz=4.5
12751 </pre></div>
12752
12753 <p>The same operation can be achieved using the expression system:
12754 </p><div class="example">
12755 <pre class="example">dctdnoiz=e='gte(c, 4.5*3)'
12756 </pre></div>
12757
12758 <p>Violent denoise using a block size of <code>16x16</code>:
12759 </p><div class="example">
12760 <pre class="example">dctdnoiz=15:n=4
12761 </pre></div>
12762
12763 <a name="decimate"></a><a name="decimate-1"></a>
12764 <h3 class="section">28.19 decimate<span class="pull-right"><a class="anchor hidden-xs" href="#decimate-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-decimate-1" aria-hidden="true">TOC</a></span></h3>
12765
12766 <p>Drop duplicated frames at regular intervals.
12767 </p>
12768 <p>The filter accepts the following options:
12769 </p>
12770 <dl compact="compact">
12771 <dt><samp>cycle</samp></dt>
12772 <dd><p>Set the number of frames from which one will be dropped. Setting this to
12773 <var>N</var> means one frame in every batch of <var>N</var> frames will be dropped.
12774 Default is <code>5</code>.
12775 </p>
12776 </dd>
12777 <dt><samp>dupthresh</samp></dt>
12778 <dd><p>Set the threshold for duplicate detection. If the difference metric for a frame
12779 is less than or equal to this value, then it is declared as duplicate. Default
12780 is <code>1.1</code>
12781 </p>
12782 </dd>
12783 <dt><samp>scthresh</samp></dt>
12784 <dd><p>Set scene change threshold. Default is <code>15</code>.
12785 </p>
12786 </dd>
12787 <dt><samp>blockx</samp></dt>
12788 <dt><samp>blocky</samp></dt>
12789 <dd><p>Set the size of the x and y-axis blocks used during metric calculations.
12790 Larger blocks give better noise suppression, but also give worse detection of
12791 small movements. Must be a power of two. Default is <code>32</code>.
12792 </p>
12793 </dd>
12794 <dt><samp>ppsrc</samp></dt>
12795 <dd><p>Mark main input as a pre-processed input and activate clean source input
12796 stream. This allows the input to be pre-processed with various filters to help
12797 the metrics calculation while keeping the frame selection lossless. When set to
12798 <code>1</code>, the first stream is for the pre-processed input, and the second
12799 stream is the clean source from where the kept frames are chosen. Default is
12800 <code>0</code>.
12801 </p>
12802 </dd>
12803 <dt><samp>chroma</samp></dt>
12804 <dd><p>Set whether or not chroma is considered in the metric calculations. Default is
12805 <code>1</code>.
12806 </p></dd>
12807 </dl>
12808
12809 <a name="dejudder"></a>
12810 <h3 class="section">28.20 dejudder<span class="pull-right"><a class="anchor hidden-xs" href="#dejudder" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dejudder" aria-hidden="true">TOC</a></span></h3>
12811
12812 <p>Remove judder produced by partially interlaced telecined content.
12813 </p>
12814 <p>Judder can be introduced, for instance, by <a href="#pullup">pullup</a> filter. If the original
12815 source was partially telecined content then the output of <code>pullup,dejudder</code>
12816 will have a variable frame rate. May change the recorded frame rate of the
12817 container. Aside from that change, this filter will not affect constant frame
12818 rate video.
12819 </p>
12820 <p>The option available in this filter is:
12821 </p><dl compact="compact">
12822 <dt><samp>cycle</samp></dt>
12823 <dd><p>Specify the length of the window over which the judder repeats.
12824 </p>
12825 <p>Accepts any integer greater than 1. Useful values are:
12826 </p><dl compact="compact">
12827 <dt>&lsquo;<samp>4</samp>&rsquo;</dt>
12828 <dd><p>If the original was telecined from 24 to 30 fps (Film to NTSC).
12829 </p>
12830 </dd>
12831 <dt>&lsquo;<samp>5</samp>&rsquo;</dt>
12832 <dd><p>If the original was telecined from 25 to 30 fps (PAL to NTSC).
12833 </p>
12834 </dd>
12835 <dt>&lsquo;<samp>20</samp>&rsquo;</dt>
12836 <dd><p>If a mixture of the two.
12837 </p></dd>
12838 </dl>
12839
12840 <p>The default is &lsquo;<samp>4</samp>&rsquo;.
12841 </p></dd>
12842 </dl>
12843
12844 <a name="delogo"></a>
12845 <h3 class="section">28.21 delogo<span class="pull-right"><a class="anchor hidden-xs" href="#delogo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-delogo" aria-hidden="true">TOC</a></span></h3>
12846
12847 <p>Suppress a TV station logo by a simple interpolation of the surrounding
12848 pixels. Just set a rectangle covering the logo and watch it disappear
12849 (and sometimes something even uglier appear - your mileage may vary).
12850 </p>
12851 <p>It accepts the following parameters:
12852 </p><dl compact="compact">
12853 <dt><samp>x</samp></dt>
12854 <dt><samp>y</samp></dt>
12855 <dd><p>Specify the top left corner coordinates of the logo. They must be
12856 specified.
12857 </p>
12858 </dd>
12859 <dt><samp>w</samp></dt>
12860 <dt><samp>h</samp></dt>
12861 <dd><p>Specify the width and height of the logo to clear. They must be
12862 specified.
12863 </p>
12864 </dd>
12865 <dt><samp>band, t</samp></dt>
12866 <dd><p>Specify the thickness of the fuzzy edge of the rectangle (added to
12867 <var>w</var> and <var>h</var>). The default value is 4.
12868 </p>
12869 </dd>
12870 <dt><samp>show</samp></dt>
12871 <dd><p>When set to 1, a green rectangle is drawn on the screen to simplify
12872 finding the right <var>x</var>, <var>y</var>, <var>w</var>, and <var>h</var> parameters.
12873 The default value is 0.
12874 </p>
12875 <p>The rectangle is drawn on the outermost pixels which will be (partly)
12876 replaced with interpolated values. The values of the next pixels
12877 immediately outside this rectangle in each direction will be used to
12878 compute the interpolated pixel values inside the rectangle.
12879 </p>
12880 </dd>
12881 </dl>
12882
12883 <a name="Examples-43"></a>
12884 <h4 class="subsection">28.21.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-43" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-43" aria-hidden="true">TOC</a></span></h4>
12885
12886 <ul>
12887 <li> Set a rectangle covering the area with top left corner coordinates 0,0
12888 and size 100x77, and a band of size 10:
12889 <div class="example">
12890 <pre class="example">delogo=x=0:y=0:w=100:h=77:band=10
12891 </pre></div>
12892
12893 </li></ul>
12894
12895 <a name="deshake"></a>
12896 <h3 class="section">28.22 deshake<span class="pull-right"><a class="anchor hidden-xs" href="#deshake" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deshake" aria-hidden="true">TOC</a></span></h3>
12897
12898 <p>Attempt to fix small changes in horizontal and/or vertical shift. This
12899 filter helps remove camera shake from hand-holding a camera, bumping a
12900 tripod, moving on a vehicle, etc.
12901 </p>
12902 <p>The filter accepts the following options:
12903 </p>
12904 <dl compact="compact">
12905 <dt><samp>x</samp></dt>
12906 <dt><samp>y</samp></dt>
12907 <dt><samp>w</samp></dt>
12908 <dt><samp>h</samp></dt>
12909 <dd><p>Specify a rectangular area where to limit the search for motion
12910 vectors.
12911 If desired the search for motion vectors can be limited to a
12912 rectangular area of the frame defined by its top left corner, width
12913 and height. These parameters have the same meaning as the drawbox
12914 filter which can be used to visualise the position of the bounding
12915 box.
12916 </p>
12917 <p>This is useful when simultaneous movement of subjects within the frame
12918 might be confused for camera motion by the motion vector search.
12919 </p>
12920 <p>If any or all of <var>x</var>, <var>y</var>, <var>w</var> and <var>h</var> are set to -1
12921 then the full frame is used. This allows later options to be set
12922 without specifying the bounding box for the motion vector search.
12923 </p>
12924 <p>Default - search the whole frame.
12925 </p>
12926 </dd>
12927 <dt><samp>rx</samp></dt>
12928 <dt><samp>ry</samp></dt>
12929 <dd><p>Specify the maximum extent of movement in x and y directions in the
12930 range 0-64 pixels. Default 16.
12931 </p>
12932 </dd>
12933 <dt><samp>edge</samp></dt>
12934 <dd><p>Specify how to generate pixels to fill blanks at the edge of the
12935 frame. Available values are:
12936 </p><dl compact="compact">
12937 <dt>&lsquo;<samp>blank, 0</samp>&rsquo;</dt>
12938 <dd><p>Fill zeroes at blank locations
12939 </p></dd>
12940 <dt>&lsquo;<samp>original, 1</samp>&rsquo;</dt>
12941 <dd><p>Original image at blank locations
12942 </p></dd>
12943 <dt>&lsquo;<samp>clamp, 2</samp>&rsquo;</dt>
12944 <dd><p>Extruded edge value at blank locations
12945 </p></dd>
12946 <dt>&lsquo;<samp>mirror, 3</samp>&rsquo;</dt>
12947 <dd><p>Mirrored edge at blank locations
12948 </p></dd>
12949 </dl>
12950 <p>Default value is &lsquo;<samp>mirror</samp>&rsquo;.
12951 </p>
12952 </dd>
12953 <dt><samp>blocksize</samp></dt>
12954 <dd><p>Specify the blocksize to use for motion search. Range 4-128 pixels,
12955 default 8.
12956 </p>
12957 </dd>
12958 <dt><samp>contrast</samp></dt>
12959 <dd><p>Specify the contrast threshold for blocks. Only blocks with more than
12960 the specified contrast (difference between darkest and lightest
12961 pixels) will be considered. Range 1-255, default 125.
12962 </p>
12963 </dd>
12964 <dt><samp>search</samp></dt>
12965 <dd><p>Specify the search strategy. Available values are:
12966 </p><dl compact="compact">
12967 <dt>&lsquo;<samp>exhaustive, 0</samp>&rsquo;</dt>
12968 <dd><p>Set exhaustive search
12969 </p></dd>
12970 <dt>&lsquo;<samp>less, 1</samp>&rsquo;</dt>
12971 <dd><p>Set less exhaustive search.
12972 </p></dd>
12973 </dl>
12974 <p>Default value is &lsquo;<samp>exhaustive</samp>&rsquo;.
12975 </p>
12976 </dd>
12977 <dt><samp>filename</samp></dt>
12978 <dd><p>If set then a detailed log of the motion search is written to the
12979 specified file.
12980 </p>
12981 </dd>
12982 <dt><samp>opencl</samp></dt>
12983 <dd><p>If set to 1, specify using OpenCL capabilities, only available if
12984 FFmpeg was configured with <code>--enable-opencl</code>. Default value is 0.
12985 </p>
12986 </dd>
12987 </dl>
12988
12989 <a name="detelecine"></a>
12990 <h3 class="section">28.23 detelecine<span class="pull-right"><a class="anchor hidden-xs" href="#detelecine" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-detelecine" aria-hidden="true">TOC</a></span></h3>
12991
12992 <p>Apply an exact inverse of the telecine operation. It requires a predefined
12993 pattern specified using the pattern option which must be the same as that passed
12994 to the telecine filter.
12995 </p>
12996 <p>This filter accepts the following options:
12997 </p>
12998 <dl compact="compact">
12999 <dt><samp>first_field</samp></dt>
13000 <dd><dl compact="compact">
13001 <dt>&lsquo;<samp>top, t</samp>&rsquo;</dt>
13002 <dd><p>top field first
13003 </p></dd>
13004 <dt>&lsquo;<samp>bottom, b</samp>&rsquo;</dt>
13005 <dd><p>bottom field first
13006 The default value is <code>top</code>.
13007 </p></dd>
13008 </dl>
13009
13010 </dd>
13011 <dt><samp>pattern</samp></dt>
13012 <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
13013 The default value is <code>23</code>.
13014 </p>
13015 </dd>
13016 <dt><samp>start_frame</samp></dt>
13017 <dd><p>A number representing position of the first frame with respect to the telecine
13018 pattern. This is to be used if the stream is cut. The default value is <code>0</code>.
13019 </p></dd>
13020 </dl>
13021
13022 <a name="drawbox"></a>
13023 <h3 class="section">28.24 drawbox<span class="pull-right"><a class="anchor hidden-xs" href="#drawbox" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drawbox" aria-hidden="true">TOC</a></span></h3>
13024
13025 <p>Draw a colored box on the input image.
13026 </p>
13027 <p>It accepts the following parameters:
13028 </p>
13029 <dl compact="compact">
13030 <dt><samp>x</samp></dt>
13031 <dt><samp>y</samp></dt>
13032 <dd><p>The expressions which specify the top left corner coordinates of the box. It defaults to 0.
13033 </p>
13034 </dd>
13035 <dt><samp>width, w</samp></dt>
13036 <dt><samp>height, h</samp></dt>
13037 <dd><p>The expressions which specify the width and height of the box; if 0 they are interpreted as
13038 the input width and height. It defaults to 0.
13039 </p>
13040 </dd>
13041 <dt><samp>color, c</samp></dt>
13042 <dd><p>Specify the color of the box to write. For the general syntax of this option,
13043 check the &quot;Color&quot; section in the ffmpeg-utils manual. If the special
13044 value <code>invert</code> is used, the box edge color is the same as the
13045 video with inverted luma.
13046 </p>
13047 </dd>
13048 <dt><samp>thickness, t</samp></dt>
13049 <dd><p>The expression which sets the thickness of the box edge. Default value is <code>3</code>.
13050 </p>
13051 <p>See below for the list of accepted constants.
13052 </p></dd>
13053 </dl>
13054
13055 <p>The parameters for <var>x</var>, <var>y</var>, <var>w</var> and <var>h</var> and <var>t</var> are expressions containing the
13056 following constants:
13057 </p>
13058 <dl compact="compact">
13059 <dt><samp>dar</samp></dt>
13060 <dd><p>The input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>.
13061 </p>
13062 </dd>
13063 <dt><samp>hsub</samp></dt>
13064 <dt><samp>vsub</samp></dt>
13065 <dd><p>horizontal and vertical chroma subsample values. For example for the
13066 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
13067 </p>
13068 </dd>
13069 <dt><samp>in_h, ih</samp></dt>
13070 <dt><samp>in_w, iw</samp></dt>
13071 <dd><p>The input width and height.
13072 </p>
13073 </dd>
13074 <dt><samp>sar</samp></dt>
13075 <dd><p>The input sample aspect ratio.
13076 </p>
13077 </dd>
13078 <dt><samp>x</samp></dt>
13079 <dt><samp>y</samp></dt>
13080 <dd><p>The x and y offset coordinates where the box is drawn.
13081 </p>
13082 </dd>
13083 <dt><samp>w</samp></dt>
13084 <dt><samp>h</samp></dt>
13085 <dd><p>The width and height of the drawn box.
13086 </p>
13087 </dd>
13088 <dt><samp>t</samp></dt>
13089 <dd><p>The thickness of the drawn box.
13090 </p>
13091 <p>These constants allow the <var>x</var>, <var>y</var>, <var>w</var>, <var>h</var> and <var>t</var> expressions to refer to
13092 each other, so you may for example specify <code>y=x/dar</code> or <code>h=w/dar</code>.
13093 </p>
13094 </dd>
13095 </dl>
13096
13097 <a name="Examples-44"></a>
13098 <h4 class="subsection">28.24.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-44" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-44" aria-hidden="true">TOC</a></span></h4>
13099
13100 <ul>
13101 <li> Draw a black box around the edge of the input image:
13102 <div class="example">
13103 <pre class="example">drawbox
13104 </pre></div>
13105
13106 </li><li> Draw a box with color red and an opacity of 50%:
13107 <div class="example">
13108 <pre class="example">drawbox=10:20:200:60:red@0.5
13109 </pre></div>
13110
13111 <p>The previous example can be specified as:
13112 </p><div class="example">
13113 <pre class="example">drawbox=x=10:y=20:w=200:h=60:color=red@0.5
13114 </pre></div>
13115
13116 </li><li> Fill the box with pink color:
13117 <div class="example">
13118 <pre class="example">drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=max
13119 </pre></div>
13120
13121 </li><li> Draw a 2-pixel red 2.40:1 mask:
13122 <div class="example">
13123 <pre class="example">drawbox=x=-t:y=0.5*(ih-iw/2.4)-t:w=iw+t*2:h=iw/2.4+t*2:t=2:c=red
13124 </pre></div>
13125 </li></ul>
13126
13127 <a name="drawgrid"></a>
13128 <h3 class="section">28.25 drawgrid<span class="pull-right"><a class="anchor hidden-xs" href="#drawgrid" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drawgrid" aria-hidden="true">TOC</a></span></h3>
13129
13130 <p>Draw a grid on the input image.
13131 </p>
13132 <p>It accepts the following parameters:
13133 </p>
13134 <dl compact="compact">
13135 <dt><samp>x</samp></dt>
13136 <dt><samp>y</samp></dt>
13137 <dd><p>The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0.
13138 </p>
13139 </dd>
13140 <dt><samp>width, w</samp></dt>
13141 <dt><samp>height, h</samp></dt>
13142 <dd><p>The expressions which specify the width and height of the grid cell, if 0 they are interpreted as the
13143 input width and height, respectively, minus <code>thickness</code>, so image gets
13144 framed. Default to 0.
13145 </p>
13146 </dd>
13147 <dt><samp>color, c</samp></dt>
13148 <dd><p>Specify the color of the grid. For the general syntax of this option,
13149 check the &quot;Color&quot; section in the ffmpeg-utils manual. If the special
13150 value <code>invert</code> is used, the grid color is the same as the
13151 video with inverted luma.
13152 </p>
13153 </dd>
13154 <dt><samp>thickness, t</samp></dt>
13155 <dd><p>The expression which sets the thickness of the grid line. Default value is <code>1</code>.
13156 </p>
13157 <p>See below for the list of accepted constants.
13158 </p></dd>
13159 </dl>
13160
13161 <p>The parameters for <var>x</var>, <var>y</var>, <var>w</var> and <var>h</var> and <var>t</var> are expressions containing the
13162 following constants:
13163 </p>
13164 <dl compact="compact">
13165 <dt><samp>dar</samp></dt>
13166 <dd><p>The input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>.
13167 </p>
13168 </dd>
13169 <dt><samp>hsub</samp></dt>
13170 <dt><samp>vsub</samp></dt>
13171 <dd><p>horizontal and vertical chroma subsample values. For example for the
13172 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
13173 </p>
13174 </dd>
13175 <dt><samp>in_h, ih</samp></dt>
13176 <dt><samp>in_w, iw</samp></dt>
13177 <dd><p>The input grid cell width and height.
13178 </p>
13179 </dd>
13180 <dt><samp>sar</samp></dt>
13181 <dd><p>The input sample aspect ratio.
13182 </p>
13183 </dd>
13184 <dt><samp>x</samp></dt>
13185 <dt><samp>y</samp></dt>
13186 <dd><p>The x and y coordinates of some point of grid intersection (meant to configure offset).
13187 </p>
13188 </dd>
13189 <dt><samp>w</samp></dt>
13190 <dt><samp>h</samp></dt>
13191 <dd><p>The width and height of the drawn cell.
13192 </p>
13193 </dd>
13194 <dt><samp>t</samp></dt>
13195 <dd><p>The thickness of the drawn cell.
13196 </p>
13197 <p>These constants allow the <var>x</var>, <var>y</var>, <var>w</var>, <var>h</var> and <var>t</var> expressions to refer to
13198 each other, so you may for example specify <code>y=x/dar</code> or <code>h=w/dar</code>.
13199 </p>
13200 </dd>
13201 </dl>
13202
13203 <a name="Examples-45"></a>
13204 <h4 class="subsection">28.25.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-45" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-45" aria-hidden="true">TOC</a></span></h4>
13205
13206 <ul>
13207 <li> Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an opacity of 50%:
13208 <div class="example">
13209 <pre class="example">drawgrid=width=100:height=100:thickness=2:color=red@0.5
13210 </pre></div>
13211
13212 </li><li> Draw a white 3x3 grid with an opacity of 50%:
13213 <div class="example">
13214 <pre class="example">drawgrid=w=iw/3:h=ih/3:t=2:c=white@0.5
13215 </pre></div>
13216 </li></ul>
13217
13218 <a name="drawtext"></a><a name="drawtext-1"></a>
13219 <h3 class="section">28.26 drawtext<span class="pull-right"><a class="anchor hidden-xs" href="#drawtext-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drawtext-1" aria-hidden="true">TOC</a></span></h3>
13220
13221 <p>Draw a text string or text from a specified file on top of a video, using the
13222 libfreetype library.
13223 </p>
13224 <p>To enable compilation of this filter, you need to configure FFmpeg with
13225 <code>--enable-libfreetype</code>.
13226 To enable default font fallback and the <var>font</var> option you need to
13227 configure FFmpeg with <code>--enable-libfontconfig</code>.
13228 To enable the <var>text_shaping</var> option, you need to configure FFmpeg with
13229 <code>--enable-libfribidi</code>.
13230 </p>
13231 <a name="Syntax-2"></a>
13232 <h4 class="subsection">28.26.1 Syntax<span class="pull-right"><a class="anchor hidden-xs" href="#Syntax-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Syntax-2" aria-hidden="true">TOC</a></span></h4>
13233
13234 <p>It accepts the following parameters:
13235 </p>
13236 <dl compact="compact">
13237 <dt><samp>box</samp></dt>
13238 <dd><p>Used to draw a box around text using the background color.
13239 The value must be either 1 (enable) or 0 (disable).
13240 The default value of <var>box</var> is 0.
13241 </p>
13242 </dd>
13243 <dt><samp>boxborderw</samp></dt>
13244 <dd><p>Set the width of the border to be drawn around the box using <var>boxcolor</var>.
13245 The default value of <var>boxborderw</var> is 0.
13246 </p>
13247 </dd>
13248 <dt><samp>boxcolor</samp></dt>
13249 <dd><p>The color to be used for drawing box around text. For the syntax of this
13250 option, check the &quot;Color&quot; section in the ffmpeg-utils manual.
13251 </p>
13252 <p>The default value of <var>boxcolor</var> is &quot;white&quot;.
13253 </p>
13254 </dd>
13255 <dt><samp>borderw</samp></dt>
13256 <dd><p>Set the width of the border to be drawn around the text using <var>bordercolor</var>.
13257 The default value of <var>borderw</var> is 0.
13258 </p>
13259 </dd>
13260 <dt><samp>bordercolor</samp></dt>
13261 <dd><p>Set the color to be used for drawing border around text. For the syntax of this
13262 option, check the &quot;Color&quot; section in the ffmpeg-utils manual.
13263 </p>
13264 <p>The default value of <var>bordercolor</var> is &quot;black&quot;.
13265 </p>
13266 </dd>
13267 <dt><samp>expansion</samp></dt>
13268 <dd><p>Select how the <var>text</var> is expanded. Can be either <code>none</code>,
13269 <code>strftime</code> (deprecated) or
13270 <code>normal</code> (default). See the <a href="#drawtext_005fexpansion">Text expansion</a> section
13271 below for details.
13272 </p>
13273 </dd>
13274 <dt><samp>fix_bounds</samp></dt>
13275 <dd><p>If true, check and fix text coords to avoid clipping.
13276 </p>
13277 </dd>
13278 <dt><samp>fontcolor</samp></dt>
13279 <dd><p>The color to be used for drawing fonts. For the syntax of this option, check
13280 the &quot;Color&quot; section in the ffmpeg-utils manual.
13281 </p>
13282 <p>The default value of <var>fontcolor</var> is &quot;black&quot;.
13283 </p>
13284 </dd>
13285 <dt><samp>fontcolor_expr</samp></dt>
13286 <dd><p>String which is expanded the same way as <var>text</var> to obtain dynamic
13287 <var>fontcolor</var> value. By default this option has empty value and is not
13288 processed. When this option is set, it overrides <var>fontcolor</var> option.
13289 </p>
13290 </dd>
13291 <dt><samp>font</samp></dt>
13292 <dd><p>The font family to be used for drawing text. By default Sans.
13293 </p>
13294 </dd>
13295 <dt><samp>fontfile</samp></dt>
13296 <dd><p>The font file to be used for drawing text. The path must be included.
13297 This parameter is mandatory if the fontconfig support is disabled.
13298 </p>
13299 </dd>
13300 <dt><samp>draw</samp></dt>
13301 <dd><p>This option does not exist, please see the timeline system
13302 </p>
13303 </dd>
13304 <dt><samp>alpha</samp></dt>
13305 <dd><p>Draw the text applying alpha blending. The value can
13306 be either a number between 0.0 and 1.0
13307 The expression accepts the same variables <var>x, y</var> do.
13308 The default value is 1.
13309 Please see fontcolor_expr
13310 </p>
13311 </dd>
13312 <dt><samp>fontsize</samp></dt>
13313 <dd><p>The font size to be used for drawing text.
13314 The default value of <var>fontsize</var> is 16.
13315 </p>
13316 </dd>
13317 <dt><samp>text_shaping</samp></dt>
13318 <dd><p>If set to 1, attempt to shape the text (for example, reverse the order of
13319 right-to-left text and join Arabic characters) before drawing it.
13320 Otherwise, just draw the text exactly as given.
13321 By default 1 (if supported).
13322 </p>
13323 </dd>
13324 <dt><samp>ft_load_flags</samp></dt>
13325 <dd><p>The flags to be used for loading the fonts.
13326 </p>
13327 <p>The flags map the corresponding flags supported by libfreetype, and are
13328 a combination of the following values:
13329 </p><dl compact="compact">
13330 <dt><var>default</var></dt>
13331 <dt><var>no_scale</var></dt>
13332 <dt><var>no_hinting</var></dt>
13333 <dt><var>render</var></dt>
13334 <dt><var>no_bitmap</var></dt>
13335 <dt><var>vertical_layout</var></dt>
13336 <dt><var>force_autohint</var></dt>
13337 <dt><var>crop_bitmap</var></dt>
13338 <dt><var>pedantic</var></dt>
13339 <dt><var>ignore_global_advance_width</var></dt>
13340 <dt><var>no_recurse</var></dt>
13341 <dt><var>ignore_transform</var></dt>
13342 <dt><var>monochrome</var></dt>
13343 <dt><var>linear_design</var></dt>
13344 <dt><var>no_autohint</var></dt>
13345 </dl>
13346
13347 <p>Default value is &quot;default&quot;.
13348 </p>
13349 <p>For more information consult the documentation for the FT_LOAD_*
13350 libfreetype flags.
13351 </p>
13352 </dd>
13353 <dt><samp>shadowcolor</samp></dt>
13354 <dd><p>The color to be used for drawing a shadow behind the drawn text. For the
13355 syntax of this option, check the &quot;Color&quot; section in the ffmpeg-utils manual.
13356 </p>
13357 <p>The default value of <var>shadowcolor</var> is &quot;black&quot;.
13358 </p>
13359 </dd>
13360 <dt><samp>shadowx</samp></dt>
13361 <dt><samp>shadowy</samp></dt>
13362 <dd><p>The x and y offsets for the text shadow position with respect to the
13363 position of the text. They can be either positive or negative
13364 values. The default value for both is &quot;0&quot;.
13365 </p>
13366 </dd>
13367 <dt><samp>start_number</samp></dt>
13368 <dd><p>The starting frame number for the n/frame_num variable. The default value
13369 is &quot;0&quot;.
13370 </p>
13371 </dd>
13372 <dt><samp>tabsize</samp></dt>
13373 <dd><p>The size in number of spaces to use for rendering the tab.
13374 Default value is 4.
13375 </p>
13376 </dd>
13377 <dt><samp>timecode</samp></dt>
13378 <dd><p>Set the initial timecode representation in &quot;hh:mm:ss[:;.]ff&quot;
13379 format. It can be used with or without text parameter. <var>timecode_rate</var>
13380 option must be specified.
13381 </p>
13382 </dd>
13383 <dt><samp>timecode_rate, rate, r</samp></dt>
13384 <dd><p>Set the timecode frame rate (timecode only).
13385 </p>
13386 </dd>
13387 <dt><samp>text</samp></dt>
13388 <dd><p>The text string to be drawn. The text must be a sequence of UTF-8
13389 encoded characters.
13390 This parameter is mandatory if no file is specified with the parameter
13391 <var>textfile</var>.
13392 </p>
13393 </dd>
13394 <dt><samp>textfile</samp></dt>
13395 <dd><p>A text file containing text to be drawn. The text must be a sequence
13396 of UTF-8 encoded characters.
13397 </p>
13398 <p>This parameter is mandatory if no text string is specified with the
13399 parameter <var>text</var>.
13400 </p>
13401 <p>If both <var>text</var> and <var>textfile</var> are specified, an error is thrown.
13402 </p>
13403 </dd>
13404 <dt><samp>reload</samp></dt>
13405 <dd><p>If set to 1, the <var>textfile</var> will be reloaded before each frame.
13406 Be sure to update it atomically, or it may be read partially, or even fail.
13407 </p>
13408 </dd>
13409 <dt><samp>x</samp></dt>
13410 <dt><samp>y</samp></dt>
13411 <dd><p>The expressions which specify the offsets where text will be drawn
13412 within the video frame. They are relative to the top/left border of the
13413 output image.
13414 </p>
13415 <p>The default value of <var>x</var> and <var>y</var> is &quot;0&quot;.
13416 </p>
13417 <p>See below for the list of accepted constants and functions.
13418 </p></dd>
13419 </dl>
13420
13421 <p>The parameters for <var>x</var> and <var>y</var> are expressions containing the
13422 following constants and functions:
13423 </p>
13424 <dl compact="compact">
13425 <dt><samp>dar</samp></dt>
13426 <dd><p>input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>
13427 </p>
13428 </dd>
13429 <dt><samp>hsub</samp></dt>
13430 <dt><samp>vsub</samp></dt>
13431 <dd><p>horizontal and vertical chroma subsample values. For example for the
13432 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
13433 </p>
13434 </dd>
13435 <dt><samp>line_h, lh</samp></dt>
13436 <dd><p>the height of each text line
13437 </p>
13438 </dd>
13439 <dt><samp>main_h, h, H</samp></dt>
13440 <dd><p>the input height
13441 </p>
13442 </dd>
13443 <dt><samp>main_w, w, W</samp></dt>
13444 <dd><p>the input width
13445 </p>
13446 </dd>
13447 <dt><samp>max_glyph_a, ascent</samp></dt>
13448 <dd><p>the maximum distance from the baseline to the highest/upper grid
13449 coordinate used to place a glyph outline point, for all the rendered
13450 glyphs.
13451 It is a positive value, due to the grid&rsquo;s orientation with the Y axis
13452 upwards.
13453 </p>
13454 </dd>
13455 <dt><samp>max_glyph_d, descent</samp></dt>
13456 <dd><p>the maximum distance from the baseline to the lowest grid coordinate
13457 used to place a glyph outline point, for all the rendered glyphs.
13458 This is a negative value, due to the grid&rsquo;s orientation, with the Y axis
13459 upwards.
13460 </p>
13461 </dd>
13462 <dt><samp>max_glyph_h</samp></dt>
13463 <dd><p>maximum glyph height, that is the maximum height for all the glyphs
13464 contained in the rendered text, it is equivalent to <var>ascent</var> -
13465 <var>descent</var>.
13466 </p>
13467 </dd>
13468 <dt><samp>max_glyph_w</samp></dt>
13469 <dd><p>maximum glyph width, that is the maximum width for all the glyphs
13470 contained in the rendered text
13471 </p>
13472 </dd>
13473 <dt><samp>n</samp></dt>
13474 <dd><p>the number of input frame, starting from 0
13475 </p>
13476 </dd>
13477 <dt><samp>rand(min, max)</samp></dt>
13478 <dd><p>return a random number included between <var>min</var> and <var>max</var>
13479 </p>
13480 </dd>
13481 <dt><samp>sar</samp></dt>
13482 <dd><p>The input sample aspect ratio.
13483 </p>
13484 </dd>
13485 <dt><samp>t</samp></dt>
13486 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
13487 </p>
13488 </dd>
13489 <dt><samp>text_h, th</samp></dt>
13490 <dd><p>the height of the rendered text
13491 </p>
13492 </dd>
13493 <dt><samp>text_w, tw</samp></dt>
13494 <dd><p>the width of the rendered text
13495 </p>
13496 </dd>
13497 <dt><samp>x</samp></dt>
13498 <dt><samp>y</samp></dt>
13499 <dd><p>the x and y offset coordinates where the text is drawn.
13500 </p>
13501 <p>These parameters allow the <var>x</var> and <var>y</var> expressions to refer
13502 each other, so you can for example specify <code>y=x/dar</code>.
13503 </p></dd>
13504 </dl>
13505
13506 <a name="drawtext_005fexpansion"></a><a name="Text-expansion"></a>
13507 <h4 class="subsection">28.26.2 Text expansion<span class="pull-right"><a class="anchor hidden-xs" href="#Text-expansion" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Text-expansion" aria-hidden="true">TOC</a></span></h4>
13508
13509 <p>If <samp>expansion</samp> is set to <code>strftime</code>,
13510 the filter recognizes strftime() sequences in the provided text and
13511 expands them accordingly. Check the documentation of strftime(). This
13512 feature is deprecated.
13513 </p>
13514 <p>If <samp>expansion</samp> is set to <code>none</code>, the text is printed verbatim.
13515 </p>
13516 <p>If <samp>expansion</samp> is set to <code>normal</code> (which is the default),
13517 the following expansion mechanism is used.
13518 </p>
13519 <p>The backslash character &lsquo;<samp>\</samp>&rsquo;, followed by any character, always expands to
13520 the second character.
13521 </p>
13522 <p>Sequence of the form <code>%{...}</code> are expanded. The text between the
13523 braces is a function name, possibly followed by arguments separated by &rsquo;:&rsquo;.
13524 If the arguments contain special characters or delimiters (&rsquo;:&rsquo; or &rsquo;}&rsquo;),
13525 they should be escaped.
13526 </p>
13527 <p>Note that they probably must also be escaped as the value for the
13528 <samp>text</samp> option in the filter argument string and as the filter
13529 argument in the filtergraph description, and possibly also for the shell,
13530 that makes up to four levels of escaping; using a text file avoids these
13531 problems.
13532 </p>
13533 <p>The following functions are available:
13534 </p>
13535 <dl compact="compact">
13536 <dt><code>expr, e</code></dt>
13537 <dd><p>The expression evaluation result.
13538 </p>
13539 <p>It must take one argument specifying the expression to be evaluated,
13540 which accepts the same constants and functions as the <var>x</var> and
13541 <var>y</var> values. Note that not all constants should be used, for
13542 example the text size is not known when evaluating the expression, so
13543 the constants <var>text_w</var> and <var>text_h</var> will have an undefined
13544 value.
13545 </p>
13546 </dd>
13547 <dt><code>expr_int_format, eif</code></dt>
13548 <dd><p>Evaluate the expression&rsquo;s value and output as formatted integer.
13549 </p>
13550 <p>The first argument is the expression to be evaluated, just as for the <var>expr</var> function.
13551 The second argument specifies the output format. Allowed values are &lsquo;<samp>x</samp>&rsquo;,
13552 &lsquo;<samp>X</samp>&rsquo;, &lsquo;<samp>d</samp>&rsquo; and &lsquo;<samp>u</samp>&rsquo;. They are treated exactly as in the
13553 <code>printf</code> function.
13554 The third parameter is optional and sets the number of positions taken by the output.
13555 It can be used to add padding with zeros from the left.
13556 </p>
13557 </dd>
13558 <dt><code>gmtime</code></dt>
13559 <dd><p>The time at which the filter is running, expressed in UTC.
13560 It can accept an argument: a strftime() format string.
13561 </p>
13562 </dd>
13563 <dt><code>localtime</code></dt>
13564 <dd><p>The time at which the filter is running, expressed in the local time zone.
13565 It can accept an argument: a strftime() format string.
13566 </p>
13567 </dd>
13568 <dt><code>metadata</code></dt>
13569 <dd><p>Frame metadata. It must take one argument specifying metadata key.
13570 </p>
13571 </dd>
13572 <dt><code>n, frame_num</code></dt>
13573 <dd><p>The frame number, starting from 0.
13574 </p>
13575 </dd>
13576 <dt><code>pict_type</code></dt>
13577 <dd><p>A 1 character description of the current picture type.
13578 </p>
13579 </dd>
13580 <dt><code>pts</code></dt>
13581 <dd><p>The timestamp of the current frame.
13582 It can take up to two arguments.
13583 </p>
13584 <p>The first argument is the format of the timestamp; it defaults to <code>flt</code>
13585 for seconds as a decimal number with microsecond accuracy; <code>hms</code> stands
13586 for a formatted <var>[-]HH:MM:SS.mmm</var> timestamp with millisecond accuracy.
13587 </p>
13588 <p>The second argument is an offset added to the timestamp.
13589 </p>
13590 </dd>
13591 </dl>
13592
13593 <a name="Examples-46"></a>
13594 <h4 class="subsection">28.26.3 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-46" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-46" aria-hidden="true">TOC</a></span></h4>
13595
13596 <ul>
13597 <li> Draw &quot;Test Text&quot; with font FreeSerif, using the default values for the
13598 optional parameters.
13599
13600 <div class="example">
13601 <pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'&quot;
13602 </pre></div>
13603
13604 </li><li> Draw &rsquo;Test Text&rsquo; with font FreeSerif of size 24 at position x=100
13605 and y=50 (counting from the top-left corner of the screen), text is
13606 yellow with a red box around it. Both the text and the box have an
13607 opacity of 20%.
13608
13609 <div class="example">
13610 <pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
13611           x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2&quot;
13612 </pre></div>
13613
13614 <p>Note that the double quotes are not necessary if spaces are not used
13615 within the parameter list.
13616 </p>
13617 </li><li> Show the text at the center of the video frame:
13618 <div class="example">
13619 <pre class="example">drawtext=&quot;fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h-line_h)/2&quot;
13620 </pre></div>
13621
13622 </li><li> Show a text line sliding from right to left in the last row of the video
13623 frame. The file <samp>LONG_LINE</samp> is assumed to contain a single line
13624 with no newlines.
13625 <div class="example">
13626 <pre class="example">drawtext=&quot;fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t&quot;
13627 </pre></div>
13628
13629 </li><li> Show the content of file <samp>CREDITS</samp> off the bottom of the frame and scroll up.
13630 <div class="example">
13631 <pre class="example">drawtext=&quot;fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t&quot;
13632 </pre></div>
13633
13634 </li><li> Draw a single green letter &quot;g&quot;, at the center of the input video.
13635 The glyph baseline is placed at half screen height.
13636 <div class="example">
13637 <pre class="example">drawtext=&quot;fontsize=60:fontfile=FreeSerif.ttf:fontcolor=green:text=g:x=(w-max_glyph_w)/2:y=h/2-ascent&quot;
13638 </pre></div>
13639
13640 </li><li> Show text for 1 second every 3 seconds:
13641 <div class="example">
13642 <pre class="example">drawtext=&quot;fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:enable=lt(mod(t\,3)\,1):text='blink'&quot;
13643 </pre></div>
13644
13645 </li><li> Use fontconfig to set the font. Note that the colons need to be escaped.
13646 <div class="example">
13647 <pre class="example">drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg'
13648 </pre></div>
13649
13650 </li><li> Print the date of a real-time encoding (see strftime(3)):
13651 <div class="example">
13652 <pre class="example">drawtext='fontfile=FreeSans.ttf:text=%{localtime\:%a %b %d %Y}'
13653 </pre></div>
13654
13655 </li><li> Show text fading in and out (appearing/disappearing):
13656 <div class="example">
13657 <pre class="example">#!/bin/sh
13658 DS=1.0 # display start
13659 DE=10.0 # display end
13660 FID=1.5 # fade in duration
13661 FOD=5 # fade out duration
13662 ffplay -f lavfi &quot;color,drawtext=text=TEST:fontsize=50:fontfile=FreeSerif.ttf:fontcolor_expr=ff0000%{eif\\\\: clip(255*(1*between(t\\, $DS + $FID\\, $DE - $FOD) + ((t - $DS)/$FID)*between(t\\, $DS\\, $DS + $FID) + (-(t - $DE)/$FOD)*between(t\\, $DE - $FOD\\, $DE) )\\, 0\\, 255) \\\\: x\\\\: 2 }&quot;
13663 </pre></div>
13664
13665 </li></ul>
13666
13667 <p>For more information about libfreetype, check:
13668 <a href="http://www.freetype.org/">http://www.freetype.org/</a>.
13669 </p>
13670 <p>For more information about fontconfig, check:
13671 <a href="http://freedesktop.org/software/fontconfig/fontconfig-user.html">http://freedesktop.org/software/fontconfig/fontconfig-user.html</a>.
13672 </p>
13673 <p>For more information about libfribidi, check:
13674 <a href="http://fribidi.org/">http://fribidi.org/</a>.
13675 </p>
13676 <a name="edgedetect"></a>
13677 <h3 class="section">28.27 edgedetect<span class="pull-right"><a class="anchor hidden-xs" href="#edgedetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-edgedetect" aria-hidden="true">TOC</a></span></h3>
13678
13679 <p>Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
13680 </p>
13681 <p>The filter accepts the following options:
13682 </p>
13683 <dl compact="compact">
13684 <dt><samp>low</samp></dt>
13685 <dt><samp>high</samp></dt>
13686 <dd><p>Set low and high threshold values used by the Canny thresholding
13687 algorithm.
13688 </p>
13689 <p>The high threshold selects the &quot;strong&quot; edge pixels, which are then
13690 connected through 8-connectivity with the &quot;weak&quot; edge pixels selected
13691 by the low threshold.
13692 </p>
13693 <p><var>low</var> and <var>high</var> threshold values must be chosen in the range
13694 [0,1], and <var>low</var> should be lesser or equal to <var>high</var>.
13695 </p>
13696 <p>Default value for <var>low</var> is <code>20/255</code>, and default value for <var>high</var>
13697 is <code>50/255</code>.
13698 </p>
13699 </dd>
13700 <dt><samp>mode</samp></dt>
13701 <dd><p>Define the drawing mode.
13702 </p>
13703 <dl compact="compact">
13704 <dt>&lsquo;<samp>wires</samp>&rsquo;</dt>
13705 <dd><p>Draw white/gray wires on black background.
13706 </p>
13707 </dd>
13708 <dt>&lsquo;<samp>colormix</samp>&rsquo;</dt>
13709 <dd><p>Mix the colors to create a paint/cartoon effect.
13710 </p></dd>
13711 </dl>
13712
13713 <p>Default value is <var>wires</var>.
13714 </p></dd>
13715 </dl>
13716
13717 <a name="Examples-47"></a>
13718 <h4 class="subsection">28.27.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-47" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-47" aria-hidden="true">TOC</a></span></h4>
13719
13720 <ul>
13721 <li> Standard edge detection with custom values for the hysteresis thresholding:
13722 <div class="example">
13723 <pre class="example">edgedetect=low=0.1:high=0.4
13724 </pre></div>
13725
13726 </li><li> Painting effect without thresholding:
13727 <div class="example">
13728 <pre class="example">edgedetect=mode=colormix:high=0
13729 </pre></div>
13730 </li></ul>
13731
13732 <a name="eq"></a>
13733 <h3 class="section">28.28 eq<span class="pull-right"><a class="anchor hidden-xs" href="#eq" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-eq" aria-hidden="true">TOC</a></span></h3>
13734 <p>Set brightness, contrast, saturation and approximate gamma adjustment.
13735 </p>
13736 <p>The filter accepts the following options:
13737 </p>
13738 <dl compact="compact">
13739 <dt><samp>contrast</samp></dt>
13740 <dd><p>Set the contrast expression. The value must be a float value in range
13741 <code>-2.0</code> to <code>2.0</code>. The default value is &quot;0&quot;.
13742 </p>
13743 </dd>
13744 <dt><samp>brightness</samp></dt>
13745 <dd><p>Set the brightness expression. The value must be a float value in
13746 range <code>-1.0</code> to <code>1.0</code>. The default value is &quot;0&quot;.
13747 </p>
13748 </dd>
13749 <dt><samp>saturation</samp></dt>
13750 <dd><p>Set the saturation expression. The value must be a float in
13751 range <code>0.0</code> to <code>3.0</code>. The default value is &quot;1&quot;.
13752 </p>
13753 </dd>
13754 <dt><samp>gamma</samp></dt>
13755 <dd><p>Set the gamma expression. The value must be a float in range
13756 <code>0.1</code> to <code>10.0</code>.  The default value is &quot;1&quot;.
13757 </p>
13758 </dd>
13759 <dt><samp>gamma_r</samp></dt>
13760 <dd><p>Set the gamma expression for red. The value must be a float in
13761 range <code>0.1</code> to <code>10.0</code>. The default value is &quot;1&quot;.
13762 </p>
13763 </dd>
13764 <dt><samp>gamma_g</samp></dt>
13765 <dd><p>Set the gamma expression for green. The value must be a float in range
13766 <code>0.1</code> to <code>10.0</code>. The default value is &quot;1&quot;.
13767 </p>
13768 </dd>
13769 <dt><samp>gamma_b</samp></dt>
13770 <dd><p>Set the gamma expression for blue. The value must be a float in range
13771 <code>0.1</code> to <code>10.0</code>. The default value is &quot;1&quot;.
13772 </p>
13773 </dd>
13774 <dt><samp>gamma_weight</samp></dt>
13775 <dd><p>Set the gamma weight expression. It can be used to reduce the effect
13776 of a high gamma value on bright image areas, e.g. keep them from
13777 getting overamplified and just plain white. The value must be a float
13778 in range <code>0.0</code> to <code>1.0</code>. A value of <code>0.0</code> turns the
13779 gamma correction all the way down while <code>1.0</code> leaves it at its
13780 full strength. Default is &quot;1&quot;.
13781 </p>
13782 </dd>
13783 <dt><samp>eval</samp></dt>
13784 <dd><p>Set when the expressions for brightness, contrast, saturation and
13785 gamma expressions are evaluated.
13786 </p>
13787 <p>It accepts the following values:
13788 </p><dl compact="compact">
13789 <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
13790 <dd><p>only evaluate expressions once during the filter initialization or
13791 when a command is processed
13792 </p>
13793 </dd>
13794 <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
13795 <dd><p>evaluate expressions for each incoming frame
13796 </p></dd>
13797 </dl>
13798
13799 <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
13800 </p></dd>
13801 </dl>
13802
13803 <p>The expressions accept the following parameters:
13804 </p><dl compact="compact">
13805 <dt><samp>n</samp></dt>
13806 <dd><p>frame count of the input frame starting from 0
13807 </p>
13808 </dd>
13809 <dt><samp>pos</samp></dt>
13810 <dd><p>byte position of the corresponding packet in the input file, NAN if
13811 unspecified
13812 </p>
13813 </dd>
13814 <dt><samp>r</samp></dt>
13815 <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
13816 </p>
13817 </dd>
13818 <dt><samp>t</samp></dt>
13819 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
13820 </p></dd>
13821 </dl>
13822
13823 <a name="Commands-2"></a>
13824 <h4 class="subsection">28.28.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-2" aria-hidden="true">TOC</a></span></h4>
13825 <p>The filter supports the following commands:
13826 </p>
13827 <dl compact="compact">
13828 <dt><samp>contrast</samp></dt>
13829 <dd><p>Set the contrast expression.
13830 </p>
13831 </dd>
13832 <dt><samp>brightness</samp></dt>
13833 <dd><p>Set the brightness expression.
13834 </p>
13835 </dd>
13836 <dt><samp>saturation</samp></dt>
13837 <dd><p>Set the saturation expression.
13838 </p>
13839 </dd>
13840 <dt><samp>gamma</samp></dt>
13841 <dd><p>Set the gamma expression.
13842 </p>
13843 </dd>
13844 <dt><samp>gamma_r</samp></dt>
13845 <dd><p>Set the gamma_r expression.
13846 </p>
13847 </dd>
13848 <dt><samp>gamma_g</samp></dt>
13849 <dd><p>Set gamma_g expression.
13850 </p>
13851 </dd>
13852 <dt><samp>gamma_b</samp></dt>
13853 <dd><p>Set gamma_b expression.
13854 </p>
13855 </dd>
13856 <dt><samp>gamma_weight</samp></dt>
13857 <dd><p>Set gamma_weight expression.
13858 </p>
13859 <p>The command accepts the same syntax of the corresponding option.
13860 </p>
13861 <p>If the specified expression is not valid, it is kept at its current
13862 value.
13863 </p>
13864 </dd>
13865 </dl>
13866
13867 <a name="extractplanes"></a>
13868 <h3 class="section">28.29 extractplanes<span class="pull-right"><a class="anchor hidden-xs" href="#extractplanes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-extractplanes" aria-hidden="true">TOC</a></span></h3>
13869
13870 <p>Extract color channel components from input video stream into
13871 separate grayscale video streams.
13872 </p>
13873 <p>The filter accepts the following option:
13874 </p>
13875 <dl compact="compact">
13876 <dt><samp>planes</samp></dt>
13877 <dd><p>Set plane(s) to extract.
13878 </p>
13879 <p>Available values for planes are:
13880 </p><dl compact="compact">
13881 <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
13882 <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
13883 <dt>&lsquo;<samp>v</samp>&rsquo;</dt>
13884 <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
13885 <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
13886 <dt>&lsquo;<samp>g</samp>&rsquo;</dt>
13887 <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
13888 </dl>
13889
13890 <p>Choosing planes not available in the input will result in an error.
13891 That means you cannot select <code>r</code>, <code>g</code>, <code>b</code> planes
13892 with <code>y</code>, <code>u</code>, <code>v</code> planes at same time.
13893 </p></dd>
13894 </dl>
13895
13896 <a name="Examples-48"></a>
13897 <h4 class="subsection">28.29.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-48" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-48" aria-hidden="true">TOC</a></span></h4>
13898
13899 <ul>
13900 <li> Extract luma, u and v color channel component from input video frame
13901 into 3 grayscale outputs:
13902 <div class="example">
13903 <pre class="example">ffmpeg -i video.avi -filter_complex 'extractplanes=y+u+v[y][u][v]' -map '[y]' y.avi -map '[u]' u.avi -map '[v]' v.avi
13904 </pre></div>
13905 </li></ul>
13906
13907 <a name="elbg"></a>
13908 <h3 class="section">28.30 elbg<span class="pull-right"><a class="anchor hidden-xs" href="#elbg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-elbg" aria-hidden="true">TOC</a></span></h3>
13909
13910 <p>Apply a posterize effect using the ELBG (Enhanced LBG) algorithm.
13911 </p>
13912 <p>For each input image, the filter will compute the optimal mapping from
13913 the input to the output given the codebook length, that is the number
13914 of distinct output colors.
13915 </p>
13916 <p>This filter accepts the following options.
13917 </p>
13918 <dl compact="compact">
13919 <dt><samp>codebook_length, l</samp></dt>
13920 <dd><p>Set codebook length. The value must be a positive integer, and
13921 represents the number of distinct output colors. Default value is 256.
13922 </p>
13923 </dd>
13924 <dt><samp>nb_steps, n</samp></dt>
13925 <dd><p>Set the maximum number of iterations to apply for computing the optimal
13926 mapping. The higher the value the better the result and the higher the
13927 computation time. Default value is 1.
13928 </p>
13929 </dd>
13930 <dt><samp>seed, s</samp></dt>
13931 <dd><p>Set a random seed, must be an integer included between 0 and
13932 UINT32_MAX. If not specified, or if explicitly set to -1, the filter
13933 will try to use a good random seed on a best effort basis.
13934 </p></dd>
13935 </dl>
13936
13937 <a name="fade"></a>
13938 <h3 class="section">28.31 fade<span class="pull-right"><a class="anchor hidden-xs" href="#fade" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fade" aria-hidden="true">TOC</a></span></h3>
13939
13940 <p>Apply a fade-in/out effect to the input video.
13941 </p>
13942 <p>It accepts the following parameters:
13943 </p>
13944 <dl compact="compact">
13945 <dt><samp>type, t</samp></dt>
13946 <dd><p>The effect type can be either &quot;in&quot; for a fade-in, or &quot;out&quot; for a fade-out
13947 effect.
13948 Default is <code>in</code>.
13949 </p>
13950 </dd>
13951 <dt><samp>start_frame, s</samp></dt>
13952 <dd><p>Specify the number of the frame to start applying the fade
13953 effect at. Default is 0.
13954 </p>
13955 </dd>
13956 <dt><samp>nb_frames, n</samp></dt>
13957 <dd><p>The number of frames that the fade effect lasts. At the end of the
13958 fade-in effect, the output video will have the same intensity as the input video.
13959 At the end of the fade-out transition, the output video will be filled with the
13960 selected <samp>color</samp>.
13961 Default is 25.
13962 </p>
13963 </dd>
13964 <dt><samp>alpha</samp></dt>
13965 <dd><p>If set to 1, fade only alpha channel, if one exists on the input.
13966 Default value is 0.
13967 </p>
13968 </dd>
13969 <dt><samp>start_time, st</samp></dt>
13970 <dd><p>Specify the timestamp (in seconds) of the frame to start to apply the fade
13971 effect. If both start_frame and start_time are specified, the fade will start at
13972 whichever comes last.  Default is 0.
13973 </p>
13974 </dd>
13975 <dt><samp>duration, d</samp></dt>
13976 <dd><p>The number of seconds for which the fade effect has to last. At the end of the
13977 fade-in effect the output video will have the same intensity as the input video,
13978 at the end of the fade-out transition the output video will be filled with the
13979 selected <samp>color</samp>.
13980 If both duration and nb_frames are specified, duration is used. Default is 0
13981 (nb_frames is used by default).
13982 </p>
13983 </dd>
13984 <dt><samp>color, c</samp></dt>
13985 <dd><p>Specify the color of the fade. Default is &quot;black&quot;.
13986 </p></dd>
13987 </dl>
13988
13989 <a name="Examples-49"></a>
13990 <h4 class="subsection">28.31.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-49" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-49" aria-hidden="true">TOC</a></span></h4>
13991
13992 <ul>
13993 <li> Fade in the first 30 frames of video:
13994 <div class="example">
13995 <pre class="example">fade=in:0:30
13996 </pre></div>
13997
13998 <p>The command above is equivalent to:
13999 </p><div class="example">
14000 <pre class="example">fade=t=in:s=0:n=30
14001 </pre></div>
14002
14003 </li><li> Fade out the last 45 frames of a 200-frame video:
14004 <div class="example">
14005 <pre class="example">fade=out:155:45
14006 fade=type=out:start_frame=155:nb_frames=45
14007 </pre></div>
14008
14009 </li><li> Fade in the first 25 frames and fade out the last 25 frames of a 1000-frame video:
14010 <div class="example">
14011 <pre class="example">fade=in:0:25, fade=out:975:25
14012 </pre></div>
14013
14014 </li><li> Make the first 5 frames yellow, then fade in from frame 5-24:
14015 <div class="example">
14016 <pre class="example">fade=in:5:20:color=yellow
14017 </pre></div>
14018
14019 </li><li> Fade in alpha over first 25 frames of video:
14020 <div class="example">
14021 <pre class="example">fade=in:0:25:alpha=1
14022 </pre></div>
14023
14024 </li><li> Make the first 5.5 seconds black, then fade in for 0.5 seconds:
14025 <div class="example">
14026 <pre class="example">fade=t=in:st=5.5:d=0.5
14027 </pre></div>
14028
14029 </li></ul>
14030
14031 <a name="fftfilt"></a>
14032 <h3 class="section">28.32 fftfilt<span class="pull-right"><a class="anchor hidden-xs" href="#fftfilt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fftfilt" aria-hidden="true">TOC</a></span></h3>
14033 <p>Apply arbitrary expressions to samples in frequency domain
14034 </p>
14035 <dl compact="compact">
14036 <dt><samp>dc_Y</samp></dt>
14037 <dd><p>Adjust the dc value (gain) of the luma plane of the image. The filter
14038 accepts an integer value in range <code>0</code> to <code>1000</code>. The default
14039 value is set to <code>0</code>.
14040 </p>
14041 </dd>
14042 <dt><samp>dc_U</samp></dt>
14043 <dd><p>Adjust the dc value (gain) of the 1st chroma plane of the image. The
14044 filter accepts an integer value in range <code>0</code> to <code>1000</code>. The
14045 default value is set to <code>0</code>.
14046 </p>
14047 </dd>
14048 <dt><samp>dc_V</samp></dt>
14049 <dd><p>Adjust the dc value (gain) of the 2nd chroma plane of the image. The
14050 filter accepts an integer value in range <code>0</code> to <code>1000</code>. The
14051 default value is set to <code>0</code>.
14052 </p>
14053 </dd>
14054 <dt><samp>weight_Y</samp></dt>
14055 <dd><p>Set the frequency domain weight expression for the luma plane.
14056 </p>
14057 </dd>
14058 <dt><samp>weight_U</samp></dt>
14059 <dd><p>Set the frequency domain weight expression for the 1st chroma plane.
14060 </p>
14061 </dd>
14062 <dt><samp>weight_V</samp></dt>
14063 <dd><p>Set the frequency domain weight expression for the 2nd chroma plane.
14064 </p>
14065 <p>The filter accepts the following variables:
14066 </p></dd>
14067 <dt><samp>X</samp></dt>
14068 <dt><samp>Y</samp></dt>
14069 <dd><p>The coordinates of the current sample.
14070 </p>
14071 </dd>
14072 <dt><samp>W</samp></dt>
14073 <dt><samp>H</samp></dt>
14074 <dd><p>The width and height of the image.
14075 </p></dd>
14076 </dl>
14077
14078 <a name="Examples-50"></a>
14079 <h4 class="subsection">28.32.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-50" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-50" aria-hidden="true">TOC</a></span></h4>
14080
14081 <ul>
14082 <li> High-pass:
14083 <div class="example">
14084 <pre class="example">fftfilt=dc_Y=128:weight_Y='squish(1-(Y+X)/100)'
14085 </pre></div>
14086
14087 </li><li> Low-pass:
14088 <div class="example">
14089 <pre class="example">fftfilt=dc_Y=0:weight_Y='squish((Y+X)/100-1)'
14090 </pre></div>
14091
14092 </li><li> Sharpen:
14093 <div class="example">
14094 <pre class="example">fftfilt=dc_Y=0:weight_Y='1+squish(1-(Y+X)/100)'
14095 </pre></div>
14096
14097 </li></ul>
14098
14099 <a name="field"></a>
14100 <h3 class="section">28.33 field<span class="pull-right"><a class="anchor hidden-xs" href="#field" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-field" aria-hidden="true">TOC</a></span></h3>
14101
14102 <p>Extract a single field from an interlaced image using stride
14103 arithmetic to avoid wasting CPU time. The output frames are marked as
14104 non-interlaced.
14105 </p>
14106 <p>The filter accepts the following options:
14107 </p>
14108 <dl compact="compact">
14109 <dt><samp>type</samp></dt>
14110 <dd><p>Specify whether to extract the top (if the value is <code>0</code> or
14111 <code>top</code>) or the bottom field (if the value is <code>1</code> or
14112 <code>bottom</code>).
14113 </p></dd>
14114 </dl>
14115
14116 <a name="fieldmatch"></a>
14117 <h3 class="section">28.34 fieldmatch<span class="pull-right"><a class="anchor hidden-xs" href="#fieldmatch" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fieldmatch" aria-hidden="true">TOC</a></span></h3>
14118
14119 <p>Field matching filter for inverse telecine. It is meant to reconstruct the
14120 progressive frames from a telecined stream. The filter does not drop duplicated
14121 frames, so to achieve a complete inverse telecine <code>fieldmatch</code> needs to be
14122 followed by a decimation filter such as <a href="#decimate">decimate</a> in the filtergraph.
14123 </p>
14124 <p>The separation of the field matching and the decimation is notably motivated by
14125 the possibility of inserting a de-interlacing filter fallback between the two.
14126 If the source has mixed telecined and real interlaced content,
14127 <code>fieldmatch</code> will not be able to match fields for the interlaced parts.
14128 But these remaining combed frames will be marked as interlaced, and thus can be
14129 de-interlaced by a later filter such as <a href="#yadif">yadif</a> before decimation.
14130 </p>
14131 <p>In addition to the various configuration options, <code>fieldmatch</code> can take an
14132 optional second stream, activated through the <samp>ppsrc</samp> option. If
14133 enabled, the frames reconstruction will be based on the fields and frames from
14134 this second stream. This allows the first input to be pre-processed in order to
14135 help the various algorithms of the filter, while keeping the output lossless
14136 (assuming the fields are matched properly). Typically, a field-aware denoiser,
14137 or brightness/contrast adjustments can help.
14138 </p>
14139 <p>Note that this filter uses the same algorithms as TIVTC/TFM (AviSynth project)
14140 and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from
14141 which <code>fieldmatch</code> is based on. While the semantic and usage are very
14142 close, some behaviour and options names can differ.
14143 </p>
14144 <p>The <a href="#decimate">decimate</a> filter currently only works for constant frame rate input.
14145 Do not use <code>fieldmatch</code> and <a href="#decimate">decimate</a> if your input has mixed
14146 telecined and progressive content with changing framerate.
14147 </p>
14148 <p>The filter accepts the following options:
14149 </p>
14150 <dl compact="compact">
14151 <dt><samp>order</samp></dt>
14152 <dd><p>Specify the assumed field order of the input stream. Available values are:
14153 </p>
14154 <dl compact="compact">
14155 <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
14156 <dd><p>Auto detect parity (use FFmpeg&rsquo;s internal parity value).
14157 </p></dd>
14158 <dt>&lsquo;<samp>bff</samp>&rsquo;</dt>
14159 <dd><p>Assume bottom field first.
14160 </p></dd>
14161 <dt>&lsquo;<samp>tff</samp>&rsquo;</dt>
14162 <dd><p>Assume top field first.
14163 </p></dd>
14164 </dl>
14165
14166 <p>Note that it is sometimes recommended not to trust the parity announced by the
14167 stream.
14168 </p>
14169 <p>Default value is <var>auto</var>.
14170 </p>
14171 </dd>
14172 <dt><samp>mode</samp></dt>
14173 <dd><p>Set the matching mode or strategy to use. <samp>pc</samp> mode is the safest in the
14174 sense that it won&rsquo;t risk creating jerkiness due to duplicate frames when
14175 possible, but if there are bad edits or blended fields it will end up
14176 outputting combed frames when a good match might actually exist. On the other
14177 hand, <samp>pcn_ub</samp> mode is the most risky in terms of creating jerkiness,
14178 but will almost always find a good frame if there is one. The other values are
14179 all somewhere in between <samp>pc</samp> and <samp>pcn_ub</samp> in terms of risking
14180 jerkiness and creating duplicate frames versus finding good matches in sections
14181 with bad edits, orphaned fields, blended fields, etc.
14182 </p>
14183 <p>More details about p/c/n/u/b are available in <a href="#p_002fc_002fn_002fu_002fb-meaning">p/c/n/u/b meaning</a> section.
14184 </p>
14185 <p>Available values are:
14186 </p>
14187 <dl compact="compact">
14188 <dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
14189 <dd><p>2-way matching (p/c)
14190 </p></dd>
14191 <dt>&lsquo;<samp>pc_n</samp>&rsquo;</dt>
14192 <dd><p>2-way matching, and trying 3rd match if still combed (p/c + n)
14193 </p></dd>
14194 <dt>&lsquo;<samp>pc_u</samp>&rsquo;</dt>
14195 <dd><p>2-way matching, and trying 3rd match (same order) if still combed (p/c + u)
14196 </p></dd>
14197 <dt>&lsquo;<samp>pc_n_ub</samp>&rsquo;</dt>
14198 <dd><p>2-way matching, trying 3rd match if still combed, and trying 4th/5th matches if
14199 still combed (p/c + n + u/b)
14200 </p></dd>
14201 <dt>&lsquo;<samp>pcn</samp>&rsquo;</dt>
14202 <dd><p>3-way matching (p/c/n)
14203 </p></dd>
14204 <dt>&lsquo;<samp>pcn_ub</samp>&rsquo;</dt>
14205 <dd><p>3-way matching, and trying 4th/5th matches if all 3 of the original matches are
14206 detected as combed (p/c/n + u/b)
14207 </p></dd>
14208 </dl>
14209
14210 <p>The parenthesis at the end indicate the matches that would be used for that
14211 mode assuming <samp>order</samp>=<var>tff</var> (and <samp>field</samp> on <var>auto</var> or
14212 <var>top</var>).
14213 </p>
14214 <p>In terms of speed <samp>pc</samp> mode is by far the fastest and <samp>pcn_ub</samp> is
14215 the slowest.
14216 </p>
14217 <p>Default value is <var>pc_n</var>.
14218 </p>
14219 </dd>
14220 <dt><samp>ppsrc</samp></dt>
14221 <dd><p>Mark the main input stream as a pre-processed input, and enable the secondary
14222 input stream as the clean source to pick the fields from. See the filter
14223 introduction for more details. It is similar to the <samp>clip2</samp> feature from
14224 VFM/TFM.
14225 </p>
14226 <p>Default value is <code>0</code> (disabled).
14227 </p>
14228 </dd>
14229 <dt><samp>field</samp></dt>
14230 <dd><p>Set the field to match from. It is recommended to set this to the same value as
14231 <samp>order</samp> unless you experience matching failures with that setting. In
14232 certain circumstances changing the field that is used to match from can have a
14233 large impact on matching performance. Available values are:
14234 </p>
14235 <dl compact="compact">
14236 <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
14237 <dd><p>Automatic (same value as <samp>order</samp>).
14238 </p></dd>
14239 <dt>&lsquo;<samp>bottom</samp>&rsquo;</dt>
14240 <dd><p>Match from the bottom field.
14241 </p></dd>
14242 <dt>&lsquo;<samp>top</samp>&rsquo;</dt>
14243 <dd><p>Match from the top field.
14244 </p></dd>
14245 </dl>
14246
14247 <p>Default value is <var>auto</var>.
14248 </p>
14249 </dd>
14250 <dt><samp>mchroma</samp></dt>
14251 <dd><p>Set whether or not chroma is included during the match comparisons. In most
14252 cases it is recommended to leave this enabled. You should set this to <code>0</code>
14253 only if your clip has bad chroma problems such as heavy rainbowing or other
14254 artifacts. Setting this to <code>0</code> could also be used to speed things up at
14255 the cost of some accuracy.
14256 </p>
14257 <p>Default value is <code>1</code>.
14258 </p>
14259 </dd>
14260 <dt><samp>y0</samp></dt>
14261 <dt><samp>y1</samp></dt>
14262 <dd><p>These define an exclusion band which excludes the lines between <samp>y0</samp> and
14263 <samp>y1</samp> from being included in the field matching decision. An exclusion
14264 band can be used to ignore subtitles, a logo, or other things that may
14265 interfere with the matching. <samp>y0</samp> sets the starting scan line and
14266 <samp>y1</samp> sets the ending line; all lines in between <samp>y0</samp> and
14267 <samp>y1</samp> (including <samp>y0</samp> and <samp>y1</samp>) will be ignored. Setting
14268 <samp>y0</samp> and <samp>y1</samp> to the same value will disable the feature.
14269 <samp>y0</samp> and <samp>y1</samp> defaults to <code>0</code>.
14270 </p>
14271 </dd>
14272 <dt><samp>scthresh</samp></dt>
14273 <dd><p>Set the scene change detection threshold as a percentage of maximum change on
14274 the luma plane. Good values are in the <code>[8.0, 14.0]</code> range. Scene change
14275 detection is only relevant in case <samp>combmatch</samp>=<var>sc</var>.  The range for
14276 <samp>scthresh</samp> is <code>[0.0, 100.0]</code>.
14277 </p>
14278 <p>Default value is <code>12.0</code>.
14279 </p>
14280 </dd>
14281 <dt><samp>combmatch</samp></dt>
14282 <dd><p>When <samp>combatch</samp> is not <var>none</var>, <code>fieldmatch</code> will take into
14283 account the combed scores of matches when deciding what match to use as the
14284 final match. Available values are:
14285 </p>
14286 <dl compact="compact">
14287 <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
14288 <dd><p>No final matching based on combed scores.
14289 </p></dd>
14290 <dt>&lsquo;<samp>sc</samp>&rsquo;</dt>
14291 <dd><p>Combed scores are only used when a scene change is detected.
14292 </p></dd>
14293 <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
14294 <dd><p>Use combed scores all the time.
14295 </p></dd>
14296 </dl>
14297
14298 <p>Default is <var>sc</var>.
14299 </p>
14300 </dd>
14301 <dt><samp>combdbg</samp></dt>
14302 <dd><p>Force <code>fieldmatch</code> to calculate the combed metrics for certain matches and
14303 print them. This setting is known as <samp>micout</samp> in TFM/VFM vocabulary.
14304 Available values are:
14305 </p>
14306 <dl compact="compact">
14307 <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
14308 <dd><p>No forced calculation.
14309 </p></dd>
14310 <dt>&lsquo;<samp>pcn</samp>&rsquo;</dt>
14311 <dd><p>Force p/c/n calculations.
14312 </p></dd>
14313 <dt>&lsquo;<samp>pcnub</samp>&rsquo;</dt>
14314 <dd><p>Force p/c/n/u/b calculations.
14315 </p></dd>
14316 </dl>
14317
14318 <p>Default value is <var>none</var>.
14319 </p>
14320 </dd>
14321 <dt><samp>cthresh</samp></dt>
14322 <dd><p>This is the area combing threshold used for combed frame detection. This
14323 essentially controls how &quot;strong&quot; or &quot;visible&quot; combing must be to be detected.
14324 Larger values mean combing must be more visible and smaller values mean combing
14325 can be less visible or strong and still be detected. Valid settings are from
14326 <code>-1</code> (every pixel will be detected as combed) to <code>255</code> (no pixel will
14327 be detected as combed). This is basically a pixel difference value. A good
14328 range is <code>[8, 12]</code>.
14329 </p>
14330 <p>Default value is <code>9</code>.
14331 </p>
14332 </dd>
14333 <dt><samp>chroma</samp></dt>
14334 <dd><p>Sets whether or not chroma is considered in the combed frame decision.  Only
14335 disable this if your source has chroma problems (rainbowing, etc.) that are
14336 causing problems for the combed frame detection with chroma enabled. Actually,
14337 using <samp>chroma</samp>=<var>0</var> is usually more reliable, except for the case
14338 where there is chroma only combing in the source.
14339 </p>
14340 <p>Default value is <code>0</code>.
14341 </p>
14342 </dd>
14343 <dt><samp>blockx</samp></dt>
14344 <dt><samp>blocky</samp></dt>
14345 <dd><p>Respectively set the x-axis and y-axis size of the window used during combed
14346 frame detection. This has to do with the size of the area in which
14347 <samp>combpel</samp> pixels are required to be detected as combed for a frame to be
14348 declared combed. See the <samp>combpel</samp> parameter description for more info.
14349 Possible values are any number that is a power of 2 starting at 4 and going up
14350 to 512.
14351 </p>
14352 <p>Default value is <code>16</code>.
14353 </p>
14354 </dd>
14355 <dt><samp>combpel</samp></dt>
14356 <dd><p>The number of combed pixels inside any of the <samp>blocky</samp> by
14357 <samp>blockx</samp> size blocks on the frame for the frame to be detected as
14358 combed. While <samp>cthresh</samp> controls how &quot;visible&quot; the combing must be, this
14359 setting controls &quot;how much&quot; combing there must be in any localized area (a
14360 window defined by the <samp>blockx</samp> and <samp>blocky</samp> settings) on the
14361 frame. Minimum value is <code>0</code> and maximum is <code>blocky x blockx</code> (at
14362 which point no frames will ever be detected as combed). This setting is known
14363 as <samp>MI</samp> in TFM/VFM vocabulary.
14364 </p>
14365 <p>Default value is <code>80</code>.
14366 </p></dd>
14367 </dl>
14368
14369 <a name="p_002fc_002fn_002fu_002fb-meaning"></a><a name="p_002fc_002fn_002fu_002fb-meaning-1"></a>
14370 <h4 class="subsection">28.34.1 p/c/n/u/b meaning<span class="pull-right"><a class="anchor hidden-xs" href="#p_002fc_002fn_002fu_002fb-meaning-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-p_002fc_002fn_002fu_002fb-meaning-1" aria-hidden="true">TOC</a></span></h4>
14371
14372 <a name="p_002fc_002fn"></a>
14373 <h4 class="subsubsection">28.34.1.1 p/c/n<span class="pull-right"><a class="anchor hidden-xs" href="#p_002fc_002fn" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-p_002fc_002fn" aria-hidden="true">TOC</a></span></h4>
14374
14375 <p>We assume the following telecined stream:
14376 </p>
14377 <div class="example">
14378 <pre class="example">Top fields:     1 2 2 3 4
14379 Bottom fields:  1 2 3 4 4
14380 </pre></div>
14381
14382 <p>The numbers correspond to the progressive frame the fields relate to. Here, the
14383 first two frames are progressive, the 3rd and 4th are combed, and so on.
14384 </p>
14385 <p>When <code>fieldmatch</code> is configured to run a matching from bottom
14386 (<samp>field</samp>=<var>bottom</var>) this is how this input stream get transformed:
14387 </p>
14388 <div class="example">
14389 <pre class="example">Input stream:
14390                 T     1 2 2 3 4
14391                 B     1 2 3 4 4   &lt;-- matching reference
14392
14393 Matches:              c c n n c
14394
14395 Output stream:
14396                 T     1 2 3 4 4
14397                 B     1 2 3 4 4
14398 </pre></div>
14399
14400 <p>As a result of the field matching, we can see that some frames get duplicated.
14401 To perform a complete inverse telecine, you need to rely on a decimation filter
14402 after this operation. See for instance the <a href="#decimate">decimate</a> filter.
14403 </p>
14404 <p>The same operation now matching from top fields (<samp>field</samp>=<var>top</var>)
14405 looks like this:
14406 </p>
14407 <div class="example">
14408 <pre class="example">Input stream:
14409                 T     1 2 2 3 4   &lt;-- matching reference
14410                 B     1 2 3 4 4
14411
14412 Matches:              c c p p c
14413
14414 Output stream:
14415                 T     1 2 2 3 4
14416                 B     1 2 2 3 4
14417 </pre></div>
14418
14419 <p>In these examples, we can see what <var>p</var>, <var>c</var> and <var>n</var> mean;
14420 basically, they refer to the frame and field of the opposite parity:
14421 </p>
14422 <ul>
14423 <li> <var>p</var> matches the field of the opposite parity in the previous frame
14424 </li><li> <var>c</var> matches the field of the opposite parity in the current frame
14425 </li><li> <var>n</var> matches the field of the opposite parity in the next frame
14426 </li></ul>
14427
14428 <a name="u_002fb"></a>
14429 <h4 class="subsubsection">28.34.1.2 u/b<span class="pull-right"><a class="anchor hidden-xs" href="#u_002fb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-u_002fb" aria-hidden="true">TOC</a></span></h4>
14430
14431 <p>The <var>u</var> and <var>b</var> matching are a bit special in the sense that they match
14432 from the opposite parity flag. In the following examples, we assume that we are
14433 currently matching the 2nd frame (Top:2, bottom:2). According to the match, a
14434 &rsquo;x&rsquo; is placed above and below each matched fields.
14435 </p>
14436 <p>With bottom matching (<samp>field</samp>=<var>bottom</var>):
14437 </p><div class="example">
14438 <pre class="example">Match:           c         p           n          b          u
14439
14440                  x       x               x        x          x
14441   Top          1 2 2     1 2 2       1 2 2      1 2 2      1 2 2
14442   Bottom       1 2 3     1 2 3       1 2 3      1 2 3      1 2 3
14443                  x         x           x        x              x
14444
14445 Output frames:
14446                  2          1          2          2          2
14447                  2          2          2          1          3
14448 </pre></div>
14449
14450 <p>With top matching (<samp>field</samp>=<var>top</var>):
14451 </p><div class="example">
14452 <pre class="example">Match:           c         p           n          b          u
14453
14454                  x         x           x        x              x
14455   Top          1 2 2     1 2 2       1 2 2      1 2 2      1 2 2
14456   Bottom       1 2 3     1 2 3       1 2 3      1 2 3      1 2 3
14457                  x       x               x        x          x
14458
14459 Output frames:
14460                  2          2          2          1          2
14461                  2          1          3          2          2
14462 </pre></div>
14463
14464 <a name="Examples-51"></a>
14465 <h4 class="subsection">28.34.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-51" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-51" aria-hidden="true">TOC</a></span></h4>
14466
14467 <p>Simple IVTC of a top field first telecined stream:
14468 </p><div class="example">
14469 <pre class="example">fieldmatch=order=tff:combmatch=none, decimate
14470 </pre></div>
14471
14472 <p>Advanced IVTC, with fallback on <a href="#yadif">yadif</a> for still combed frames:
14473 </p><div class="example">
14474 <pre class="example">fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
14475 </pre></div>
14476
14477 <a name="fieldorder"></a>
14478 <h3 class="section">28.35 fieldorder<span class="pull-right"><a class="anchor hidden-xs" href="#fieldorder" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fieldorder" aria-hidden="true">TOC</a></span></h3>
14479
14480 <p>Transform the field order of the input video.
14481 </p>
14482 <p>It accepts the following parameters:
14483 </p>
14484 <dl compact="compact">
14485 <dt><samp>order</samp></dt>
14486 <dd><p>The output field order. Valid values are <var>tff</var> for top field first or <var>bff</var>
14487 for bottom field first.
14488 </p></dd>
14489 </dl>
14490
14491 <p>The default value is &lsquo;<samp>tff</samp>&rsquo;.
14492 </p>
14493 <p>The transformation is done by shifting the picture content up or down
14494 by one line, and filling the remaining line with appropriate picture content.
14495 This method is consistent with most broadcast field order converters.
14496 </p>
14497 <p>If the input video is not flagged as being interlaced, or it is already
14498 flagged as being of the required output field order, then this filter does
14499 not alter the incoming video.
14500 </p>
14501 <p>It is very useful when converting to or from PAL DV material,
14502 which is bottom field first.
14503 </p>
14504 <p>For example:
14505 </p><div class="example">
14506 <pre class="example">ffmpeg -i in.vob -vf &quot;fieldorder=bff&quot; out.dv
14507 </pre></div>
14508
14509 <a name="fifo"></a>
14510 <h3 class="section">28.36 fifo<span class="pull-right"><a class="anchor hidden-xs" href="#fifo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fifo" aria-hidden="true">TOC</a></span></h3>
14511
14512 <p>Buffer input images and send them when they are requested.
14513 </p>
14514 <p>It is mainly useful when auto-inserted by the libavfilter
14515 framework.
14516 </p>
14517 <p>It does not take parameters.
14518 </p>
14519 <a name="find_005frect"></a>
14520 <h3 class="section">28.37 find_rect<span class="pull-right"><a class="anchor hidden-xs" href="#find_005frect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-find_005frect" aria-hidden="true">TOC</a></span></h3>
14521
14522 <p>Find a rectangular object
14523 </p>
14524 <p>It accepts the following options:
14525 </p>
14526 <dl compact="compact">
14527 <dt><samp>object</samp></dt>
14528 <dd><p>Filepath of the object image, needs to be in gray8.
14529 </p>
14530 </dd>
14531 <dt><samp>threshold</samp></dt>
14532 <dd><p>Detection threshold, default is 0.5.
14533 </p>
14534 </dd>
14535 <dt><samp>mipmaps</samp></dt>
14536 <dd><p>Number of mipmaps, default is 3.
14537 </p>
14538 </dd>
14539 <dt><samp>xmin, ymin, xmax, ymax</samp></dt>
14540 <dd><p>Specifies the rectangle in which to search.
14541 </p></dd>
14542 </dl>
14543
14544 <a name="Examples-52"></a>
14545 <h4 class="subsection">28.37.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-52" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-52" aria-hidden="true">TOC</a></span></h4>
14546
14547 <ul>
14548 <li> Generate a representative palette of a given video using <code>ffmpeg</code>:
14549 <div class="example">
14550 <pre class="example">ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
14551 </pre></div>
14552 </li></ul>
14553
14554 <a name="cover_005frect"></a>
14555 <h3 class="section">28.38 cover_rect<span class="pull-right"><a class="anchor hidden-xs" href="#cover_005frect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cover_005frect" aria-hidden="true">TOC</a></span></h3>
14556
14557 <p>Cover a rectangular object
14558 </p>
14559 <p>It accepts the following options:
14560 </p>
14561 <dl compact="compact">
14562 <dt><samp>cover</samp></dt>
14563 <dd><p>Filepath of the optional cover image, needs to be in yuv420.
14564 </p>
14565 </dd>
14566 <dt><samp>mode</samp></dt>
14567 <dd><p>Set covering mode.
14568 </p>
14569 <p>It accepts the following values:
14570 </p><dl compact="compact">
14571 <dt>&lsquo;<samp>cover</samp>&rsquo;</dt>
14572 <dd><p>cover it by the supplied image
14573 </p></dd>
14574 <dt>&lsquo;<samp>blur</samp>&rsquo;</dt>
14575 <dd><p>cover it by interpolating the surrounding pixels
14576 </p></dd>
14577 </dl>
14578
14579 <p>Default value is <var>blur</var>.
14580 </p></dd>
14581 </dl>
14582
14583 <a name="Examples-53"></a>
14584 <h4 class="subsection">28.38.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-53" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-53" aria-hidden="true">TOC</a></span></h4>
14585
14586 <ul>
14587 <li> Generate a representative palette of a given video using <code>ffmpeg</code>:
14588 <div class="example">
14589 <pre class="example">ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
14590 </pre></div>
14591 </li></ul>
14592
14593 <a name="format"></a><a name="format-1"></a>
14594 <h3 class="section">28.39 format<span class="pull-right"><a class="anchor hidden-xs" href="#format-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-format-1" aria-hidden="true">TOC</a></span></h3>
14595
14596 <p>Convert the input video to one of the specified pixel formats.
14597 Libavfilter will try to pick one that is suitable as input to
14598 the next filter.
14599 </p>
14600 <p>It accepts the following parameters:
14601 </p><dl compact="compact">
14602 <dt><samp>pix_fmts</samp></dt>
14603 <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, such as
14604 &quot;pix_fmts=yuv420p|monow|rgb24&quot;.
14605 </p>
14606 </dd>
14607 </dl>
14608
14609 <a name="Examples-54"></a>
14610 <h4 class="subsection">28.39.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-54" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-54" aria-hidden="true">TOC</a></span></h4>
14611
14612 <ul>
14613 <li> Convert the input video to the <var>yuv420p</var> format
14614 <div class="example">
14615 <pre class="example">format=pix_fmts=yuv420p
14616 </pre></div>
14617
14618 <p>Convert the input video to any of the formats in the list
14619 </p><div class="example">
14620 <pre class="example">format=pix_fmts=yuv420p|yuv444p|yuv410p
14621 </pre></div>
14622 </li></ul>
14623
14624 <a name="fps"></a><a name="fps-1"></a>
14625 <h3 class="section">28.40 fps<span class="pull-right"><a class="anchor hidden-xs" href="#fps-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fps-1" aria-hidden="true">TOC</a></span></h3>
14626
14627 <p>Convert the video to specified constant frame rate by duplicating or dropping
14628 frames as necessary.
14629 </p>
14630 <p>It accepts the following parameters:
14631 </p><dl compact="compact">
14632 <dt><samp>fps</samp></dt>
14633 <dd><p>The desired output frame rate. The default is <code>25</code>.
14634 </p>
14635 </dd>
14636 <dt><samp>round</samp></dt>
14637 <dd><p>Rounding method.
14638 </p>
14639 <p>Possible values are:
14640 </p><dl compact="compact">
14641 <dt><samp>zero</samp></dt>
14642 <dd><p>zero round towards 0
14643 </p></dd>
14644 <dt><samp>inf</samp></dt>
14645 <dd><p>round away from 0
14646 </p></dd>
14647 <dt><samp>down</samp></dt>
14648 <dd><p>round towards -infinity
14649 </p></dd>
14650 <dt><samp>up</samp></dt>
14651 <dd><p>round towards +infinity
14652 </p></dd>
14653 <dt><samp>near</samp></dt>
14654 <dd><p>round to nearest
14655 </p></dd>
14656 </dl>
14657 <p>The default is <code>near</code>.
14658 </p>
14659 </dd>
14660 <dt><samp>start_time</samp></dt>
14661 <dd><p>Assume the first PTS should be the given value, in seconds. This allows for
14662 padding/trimming at the start of stream. By default, no assumption is made
14663 about the first frame&rsquo;s expected PTS, so no padding or trimming is done.
14664 For example, this could be set to 0 to pad the beginning with duplicates of
14665 the first frame if a video stream starts after the audio stream or to trim any
14666 frames with a negative PTS.
14667 </p>
14668 </dd>
14669 </dl>
14670
14671 <p>Alternatively, the options can be specified as a flat string:
14672 <var>fps</var>[:<var>round</var>].
14673 </p>
14674 <p>See also the <a href="#setpts">setpts</a> filter.
14675 </p>
14676 <a name="Examples-55"></a>
14677 <h4 class="subsection">28.40.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-55" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-55" aria-hidden="true">TOC</a></span></h4>
14678
14679 <ul>
14680 <li> A typical usage in order to set the fps to 25:
14681 <div class="example">
14682 <pre class="example">fps=fps=25
14683 </pre></div>
14684
14685 </li><li> Sets the fps to 24, using abbreviation and rounding method to round to nearest:
14686 <div class="example">
14687 <pre class="example">fps=fps=film:round=near
14688 </pre></div>
14689 </li></ul>
14690
14691 <a name="framepack"></a>
14692 <h3 class="section">28.41 framepack<span class="pull-right"><a class="anchor hidden-xs" href="#framepack" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-framepack" aria-hidden="true">TOC</a></span></h3>
14693
14694 <p>Pack two different video streams into a stereoscopic video, setting proper
14695 metadata on supported codecs. The two views should have the same size and
14696 framerate and processing will stop when the shorter video ends. Please note
14697 that you may conveniently adjust view properties with the <a href="#scale">scale</a> and
14698 <a href="#fps">fps</a> filters.
14699 </p>
14700 <p>It accepts the following parameters:
14701 </p><dl compact="compact">
14702 <dt><samp>format</samp></dt>
14703 <dd><p>The desired packing format. Supported values are:
14704 </p>
14705 <dl compact="compact">
14706 <dt><samp>sbs</samp></dt>
14707 <dd><p>The views are next to each other (default).
14708 </p>
14709 </dd>
14710 <dt><samp>tab</samp></dt>
14711 <dd><p>The views are on top of each other.
14712 </p>
14713 </dd>
14714 <dt><samp>lines</samp></dt>
14715 <dd><p>The views are packed by line.
14716 </p>
14717 </dd>
14718 <dt><samp>columns</samp></dt>
14719 <dd><p>The views are packed by column.
14720 </p>
14721 </dd>
14722 <dt><samp>frameseq</samp></dt>
14723 <dd><p>The views are temporally interleaved.
14724 </p>
14725 </dd>
14726 </dl>
14727
14728 </dd>
14729 </dl>
14730
14731 <p>Some examples:
14732 </p>
14733 <div class="example">
14734 <pre class="example"># Convert left and right views into a frame-sequential video
14735 ffmpeg -i LEFT -i RIGHT -filter_complex framepack=frameseq OUTPUT
14736
14737 # Convert views into a side-by-side video with the same output resolution as the input
14738 ffmpeg -i LEFT -i RIGHT -filter_complex [0:v]scale=w=iw/2[left],[1:v]scale=w=iw/2[right],[left][right]framepack=sbs OUTPUT
14739 </pre></div>
14740
14741 <a name="framestep"></a>
14742 <h3 class="section">28.42 framestep<span class="pull-right"><a class="anchor hidden-xs" href="#framestep" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-framestep" aria-hidden="true">TOC</a></span></h3>
14743
14744 <p>Select one frame every N-th frame.
14745 </p>
14746 <p>This filter accepts the following option:
14747 </p><dl compact="compact">
14748 <dt><samp>step</samp></dt>
14749 <dd><p>Select frame after every <code>step</code> frames.
14750 Allowed values are positive integers higher than 0. Default value is <code>1</code>.
14751 </p></dd>
14752 </dl>
14753
14754 <a name="frei0r"></a><a name="frei0r-1"></a>
14755 <h3 class="section">28.43 frei0r<span class="pull-right"><a class="anchor hidden-xs" href="#frei0r-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-frei0r-1" aria-hidden="true">TOC</a></span></h3>
14756
14757 <p>Apply a frei0r effect to the input video.
14758 </p>
14759 <p>To enable the compilation of this filter, you need to install the frei0r
14760 header and configure FFmpeg with <code>--enable-frei0r</code>.
14761 </p>
14762 <p>It accepts the following parameters:
14763 </p>
14764 <dl compact="compact">
14765 <dt><samp>filter_name</samp></dt>
14766 <dd><p>The name of the frei0r effect to load. If the environment variable
14767 <code>FREI0R_PATH</code> is defined, the frei0r effect is searched for in each of the
14768 directories specified by the colon-separated list in <code>FREIOR_PATH</code>.
14769 Otherwise, the standard frei0r paths are searched, in this order:
14770 <samp>HOME/.frei0r-1/lib/</samp>, <samp>/usr/local/lib/frei0r-1/</samp>,
14771 <samp>/usr/lib/frei0r-1/</samp>.
14772 </p>
14773 </dd>
14774 <dt><samp>filter_params</samp></dt>
14775 <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r effect.
14776 </p>
14777 </dd>
14778 </dl>
14779
14780 <p>A frei0r effect parameter can be a boolean (its value is either
14781 &quot;y&quot; or &quot;n&quot;), a double, a color (specified as
14782 <var>R</var>/<var>G</var>/<var>B</var>, where <var>R</var>, <var>G</var>, and <var>B</var> are floating point
14783 numbers between 0.0 and 1.0, inclusive) or by a color description specified in the &quot;Color&quot;
14784 section in the ffmpeg-utils manual), a position (specified as <var>X</var>/<var>Y</var>, where
14785 <var>X</var> and <var>Y</var> are floating point numbers) and/or a string.
14786 </p>
14787 <p>The number and types of parameters depend on the loaded effect. If an
14788 effect parameter is not specified, the default value is set.
14789 </p>
14790 <a name="Examples-56"></a>
14791 <h4 class="subsection">28.43.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-56" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-56" aria-hidden="true">TOC</a></span></h4>
14792
14793 <ul>
14794 <li> Apply the distort0r effect, setting the first two double parameters:
14795 <div class="example">
14796 <pre class="example">frei0r=filter_name=distort0r:filter_params=0.5|0.01
14797 </pre></div>
14798
14799 </li><li> Apply the colordistance effect, taking a color as the first parameter:
14800 <div class="example">
14801 <pre class="example">frei0r=colordistance:0.2/0.3/0.4
14802 frei0r=colordistance:violet
14803 frei0r=colordistance:0x112233
14804 </pre></div>
14805
14806 </li><li> Apply the perspective effect, specifying the top left and top right image
14807 positions:
14808 <div class="example">
14809 <pre class="example">frei0r=perspective:0.2/0.2|0.8/0.2
14810 </pre></div>
14811 </li></ul>
14812
14813 <p>For more information, see
14814 <a href="http://frei0r.dyne.org">http://frei0r.dyne.org</a>
14815 </p>
14816 <a name="fspp"></a>
14817 <h3 class="section">28.44 fspp<span class="pull-right"><a class="anchor hidden-xs" href="#fspp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fspp" aria-hidden="true">TOC</a></span></h3>
14818
14819 <p>Apply fast and simple postprocessing. It is a faster version of <a href="#spp">spp</a>.
14820 </p>
14821 <p>It splits (I)DCT into horizontal/vertical passes. Unlike the simple post-
14822 processing filter, one of them is performed once per block, not per pixel.
14823 This allows for much higher speed.
14824 </p>
14825 <p>The filter accepts the following options:
14826 </p>
14827 <dl compact="compact">
14828 <dt><samp>quality</samp></dt>
14829 <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
14830 an integer in the range 4-5. Default value is <code>4</code>.
14831 </p>
14832 </dd>
14833 <dt><samp>qp</samp></dt>
14834 <dd><p>Force a constant quantization parameter. It accepts an integer in range 0-63.
14835 If not set, the filter will use the QP from the video stream (if available).
14836 </p>
14837 </dd>
14838 <dt><samp>strength</samp></dt>
14839 <dd><p>Set filter strength. It accepts an integer in range -15 to 32. Lower values mean
14840 more details but also more artifacts, while higher values make the image smoother
14841 but also blurrier. Default value is <code>0</code> âˆ’ PSNR optimal.
14842 </p>
14843 </dd>
14844 <dt><samp>use_bframe_qp</samp></dt>
14845 <dd><p>Enable the use of the QP from the B-Frames if set to <code>1</code>. Using this
14846 option may cause flicker since the B-Frames have often larger QP. Default is
14847 <code>0</code> (not enabled).
14848 </p>
14849 </dd>
14850 </dl>
14851
14852 <a name="geq"></a>
14853 <h3 class="section">28.45 geq<span class="pull-right"><a class="anchor hidden-xs" href="#geq" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-geq" aria-hidden="true">TOC</a></span></h3>
14854
14855 <p>The filter accepts the following options:
14856 </p>
14857 <dl compact="compact">
14858 <dt><samp>lum_expr, lum</samp></dt>
14859 <dd><p>Set the luminance expression.
14860 </p></dd>
14861 <dt><samp>cb_expr, cb</samp></dt>
14862 <dd><p>Set the chrominance blue expression.
14863 </p></dd>
14864 <dt><samp>cr_expr, cr</samp></dt>
14865 <dd><p>Set the chrominance red expression.
14866 </p></dd>
14867 <dt><samp>alpha_expr, a</samp></dt>
14868 <dd><p>Set the alpha expression.
14869 </p></dd>
14870 <dt><samp>red_expr, r</samp></dt>
14871 <dd><p>Set the red expression.
14872 </p></dd>
14873 <dt><samp>green_expr, g</samp></dt>
14874 <dd><p>Set the green expression.
14875 </p></dd>
14876 <dt><samp>blue_expr, b</samp></dt>
14877 <dd><p>Set the blue expression.
14878 </p></dd>
14879 </dl>
14880
14881 <p>The colorspace is selected according to the specified options. If one
14882 of the <samp>lum_expr</samp>, <samp>cb_expr</samp>, or <samp>cr_expr</samp>
14883 options is specified, the filter will automatically select a YCbCr
14884 colorspace. If one of the <samp>red_expr</samp>, <samp>green_expr</samp>, or
14885 <samp>blue_expr</samp> options is specified, it will select an RGB
14886 colorspace.
14887 </p>
14888 <p>If one of the chrominance expression is not defined, it falls back on the other
14889 one. If no alpha expression is specified it will evaluate to opaque value.
14890 If none of chrominance expressions are specified, they will evaluate
14891 to the luminance expression.
14892 </p>
14893 <p>The expressions can use the following variables and functions:
14894 </p>
14895 <dl compact="compact">
14896 <dt><samp>N</samp></dt>
14897 <dd><p>The sequential number of the filtered frame, starting from <code>0</code>.
14898 </p>
14899 </dd>
14900 <dt><samp>X</samp></dt>
14901 <dt><samp>Y</samp></dt>
14902 <dd><p>The coordinates of the current sample.
14903 </p>
14904 </dd>
14905 <dt><samp>W</samp></dt>
14906 <dt><samp>H</samp></dt>
14907 <dd><p>The width and height of the image.
14908 </p>
14909 </dd>
14910 <dt><samp>SW</samp></dt>
14911 <dt><samp>SH</samp></dt>
14912 <dd><p>Width and height scale depending on the currently filtered plane. It is the
14913 ratio between the corresponding luma plane number of pixels and the current
14914 plane ones. E.g. for YUV4:2:0 the values are <code>1,1</code> for the luma plane, and
14915 <code>0.5,0.5</code> for chroma planes.
14916 </p>
14917 </dd>
14918 <dt><samp>T</samp></dt>
14919 <dd><p>Time of the current frame, expressed in seconds.
14920 </p>
14921 </dd>
14922 <dt><samp>p(x, y)</samp></dt>
14923 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the current
14924 plane.
14925 </p>
14926 </dd>
14927 <dt><samp>lum(x, y)</samp></dt>
14928 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the luminance
14929 plane.
14930 </p>
14931 </dd>
14932 <dt><samp>cb(x, y)</samp></dt>
14933 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
14934 blue-difference chroma plane. Return 0 if there is no such plane.
14935 </p>
14936 </dd>
14937 <dt><samp>cr(x, y)</samp></dt>
14938 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
14939 red-difference chroma plane. Return 0 if there is no such plane.
14940 </p>
14941 </dd>
14942 <dt><samp>r(x, y)</samp></dt>
14943 <dt><samp>g(x, y)</samp></dt>
14944 <dt><samp>b(x, y)</samp></dt>
14945 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
14946 red/green/blue component. Return 0 if there is no such component.
14947 </p>
14948 </dd>
14949 <dt><samp>alpha(x, y)</samp></dt>
14950 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the alpha
14951 plane. Return 0 if there is no such plane.
14952 </p></dd>
14953 </dl>
14954
14955 <p>For functions, if <var>x</var> and <var>y</var> are outside the area, the value will be
14956 automatically clipped to the closer edge.
14957 </p>
14958 <a name="Examples-57"></a>
14959 <h4 class="subsection">28.45.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-57" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-57" aria-hidden="true">TOC</a></span></h4>
14960
14961 <ul>
14962 <li> Flip the image horizontally:
14963 <div class="example">
14964 <pre class="example">geq=p(W-X\,Y)
14965 </pre></div>
14966
14967 </li><li> Generate a bidimensional sine wave, with angle <code>PI/3</code> and a
14968 wavelength of 100 pixels:
14969 <div class="example">
14970 <pre class="example">geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X-50*T) + sin(PI/3)*Y)):128:128
14971 </pre></div>
14972
14973 </li><li> Generate a fancy enigmatic moving light:
14974 <div class="example">
14975 <pre class="example">nullsrc=s=256x256,geq=random(1)/hypot(X-cos(N*0.07)*W/2-W/2\,Y-sin(N*0.09)*H/2-H/2)^2*1000000*sin(N*0.02):128:128
14976 </pre></div>
14977
14978 </li><li> Generate a quick emboss effect:
14979 <div class="example">
14980 <pre class="example">format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'
14981 </pre></div>
14982
14983 </li><li> Modify RGB components depending on pixel position:
14984 <div class="example">
14985 <pre class="example">geq=r='X/W*r(X,Y)':g='(1-X/W)*g(X,Y)':b='(H-Y)/H*b(X,Y)'
14986 </pre></div>
14987
14988 </li><li> Create a radial gradient that is the same size as the input (also see
14989 the <a href="#vignette">vignette</a> filter):
14990 <div class="example">
14991 <pre class="example">geq=lum=255*gauss((X/W-0.5)*3)*gauss((Y/H-0.5)*3)/gauss(0)/gauss(0),format=gray
14992 </pre></div>
14993
14994 </li><li> Create a linear gradient to use as a mask for another filter, then
14995 compose with <a href="#overlay">overlay</a>. In this example the video will gradually
14996 become more blurry from the top to the bottom of the y-axis as defined
14997 by the linear gradient:
14998 <div class="example">
14999 <pre class="example">ffmpeg -i input.mp4 -filter_complex &quot;geq=lum=255*(Y/H),format=gray[grad];[0:v]boxblur=4[blur];[blur][grad]alphamerge[alpha];[0:v][alpha]overlay&quot; output.mp4
15000 </pre></div>
15001 </li></ul>
15002
15003 <a name="gradfun"></a>
15004 <h3 class="section">28.46 gradfun<span class="pull-right"><a class="anchor hidden-xs" href="#gradfun" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gradfun" aria-hidden="true">TOC</a></span></h3>
15005
15006 <p>Fix the banding artifacts that are sometimes introduced into nearly flat
15007 regions by truncation to 8bit color depth.
15008 Interpolate the gradients that should go where the bands are, and
15009 dither them.
15010 </p>
15011 <p>It is designed for playback only.  Do not use it prior to
15012 lossy compression, because compression tends to lose the dither and
15013 bring back the bands.
15014 </p>
15015 <p>It accepts the following parameters:
15016 </p>
15017 <dl compact="compact">
15018 <dt><samp>strength</samp></dt>
15019 <dd><p>The maximum amount by which the filter will change any one pixel. This is also
15020 the threshold for detecting nearly flat regions. Acceptable values range from
15021 .51 to 64; the default value is 1.2. Out-of-range values will be clipped to the
15022 valid range.
15023 </p>
15024 </dd>
15025 <dt><samp>radius</samp></dt>
15026 <dd><p>The neighborhood to fit the gradient to. A larger radius makes for smoother
15027 gradients, but also prevents the filter from modifying the pixels near detailed
15028 regions. Acceptable values are 8-32; the default value is 16. Out-of-range
15029 values will be clipped to the valid range.
15030 </p>
15031 </dd>
15032 </dl>
15033
15034 <p>Alternatively, the options can be specified as a flat string:
15035 <var>strength</var>[:<var>radius</var>]
15036 </p>
15037 <a name="Examples-58"></a>
15038 <h4 class="subsection">28.46.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-58" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-58" aria-hidden="true">TOC</a></span></h4>
15039
15040 <ul>
15041 <li> Apply the filter with a <code>3.5</code> strength and radius of <code>8</code>:
15042 <div class="example">
15043 <pre class="example">gradfun=3.5:8
15044 </pre></div>
15045
15046 </li><li> Specify radius, omitting the strength (which will fall-back to the default
15047 value):
15048 <div class="example">
15049 <pre class="example">gradfun=radius=8
15050 </pre></div>
15051
15052 </li></ul>
15053
15054 <a name="haldclut"></a><a name="haldclut-1"></a>
15055 <h3 class="section">28.47 haldclut<span class="pull-right"><a class="anchor hidden-xs" href="#haldclut-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-haldclut-1" aria-hidden="true">TOC</a></span></h3>
15056
15057 <p>Apply a Hald CLUT to a video stream.
15058 </p>
15059 <p>First input is the video stream to process, and second one is the Hald CLUT.
15060 The Hald CLUT input can be a simple picture or a complete video stream.
15061 </p>
15062 <p>The filter accepts the following options:
15063 </p>
15064 <dl compact="compact">
15065 <dt><samp>shortest</samp></dt>
15066 <dd><p>Force termination when the shortest input terminates. Default is <code>0</code>.
15067 </p></dd>
15068 <dt><samp>repeatlast</samp></dt>
15069 <dd><p>Continue applying the last CLUT after the end of the stream. A value of
15070 <code>0</code> disable the filter after the last frame of the CLUT is reached.
15071 Default is <code>1</code>.
15072 </p></dd>
15073 </dl>
15074
15075 <p><code>haldclut</code> also has the same interpolation options as <a href="#lut3d">lut3d</a> (both
15076 filters share the same internals).
15077 </p>
15078 <p>More information about the Hald CLUT can be found on Eskil Steenberg&rsquo;s website
15079 (Hald CLUT author) at <a href="http://www.quelsolaar.com/technology/clut.html">http://www.quelsolaar.com/technology/clut.html</a>.
15080 </p>
15081 <a name="Workflow-examples"></a>
15082 <h4 class="subsection">28.47.1 Workflow examples<span class="pull-right"><a class="anchor hidden-xs" href="#Workflow-examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Workflow-examples" aria-hidden="true">TOC</a></span></h4>
15083
15084 <a name="Hald-CLUT-video-stream"></a>
15085 <h4 class="subsubsection">28.47.1.1 Hald CLUT video stream<span class="pull-right"><a class="anchor hidden-xs" href="#Hald-CLUT-video-stream" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Hald-CLUT-video-stream" aria-hidden="true">TOC</a></span></h4>
15086
15087 <p>Generate an identity Hald CLUT stream altered with various effects:
15088 </p><div class="example">
15089 <pre class="example">ffmpeg -f lavfi -i <a href="#haldclutsrc">haldclutsrc</a>=8 -vf &quot;hue=H=2*PI*t:s=sin(2*PI*t)+1, curves=cross_process&quot; -t 10 -c:v ffv1 clut.nut
15090 </pre></div>
15091
15092 <p>Note: make sure you use a lossless codec.
15093 </p>
15094 <p>Then use it with <code>haldclut</code> to apply it on some random stream:
15095 </p><div class="example">
15096 <pre class="example">ffmpeg -f lavfi -i mandelbrot -i clut.nut -filter_complex '[0][1] haldclut' -t 20 mandelclut.mkv
15097 </pre></div>
15098
15099 <p>The Hald CLUT will be applied to the 10 first seconds (duration of
15100 <samp>clut.nut</samp>), then the latest picture of that CLUT stream will be applied
15101 to the remaining frames of the <code>mandelbrot</code> stream.
15102 </p>
15103 <a name="Hald-CLUT-with-preview"></a>
15104 <h4 class="subsubsection">28.47.1.2 Hald CLUT with preview<span class="pull-right"><a class="anchor hidden-xs" href="#Hald-CLUT-with-preview" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Hald-CLUT-with-preview" aria-hidden="true">TOC</a></span></h4>
15105
15106 <p>A Hald CLUT is supposed to be a squared image of <code>Level*Level*Level</code> by
15107 <code>Level*Level*Level</code> pixels. For a given Hald CLUT, FFmpeg will select the
15108 biggest possible square starting at the top left of the picture. The remaining
15109 padding pixels (bottom or right) will be ignored. This area can be used to add
15110 a preview of the Hald CLUT.
15111 </p>
15112 <p>Typically, the following generated Hald CLUT will be supported by the
15113 <code>haldclut</code> filter:
15114 </p>
15115 <div class="example">
15116 <pre class="example">ffmpeg -f lavfi -i <a href="#haldclutsrc">haldclutsrc</a>=8 -vf &quot;
15117    pad=iw+320 [padded_clut];
15118    smptebars=s=320x256, split [a][b];
15119    [padded_clut][a] overlay=W-320:h, curves=color_negative [main];
15120    [main][b] overlay=W-320&quot; -frames:v 1 clut.png
15121 </pre></div>
15122
15123 <p>It contains the original and a preview of the effect of the CLUT: SMPTE color
15124 bars are displayed on the right-top, and below the same color bars processed by
15125 the color changes.
15126 </p>
15127 <p>Then, the effect of this Hald CLUT can be visualized with:
15128 </p><div class="example">
15129 <pre class="example">ffplay input.mkv -vf &quot;movie=clut.png, [in] haldclut&quot;
15130 </pre></div>
15131
15132 <a name="hflip"></a>
15133 <h3 class="section">28.48 hflip<span class="pull-right"><a class="anchor hidden-xs" href="#hflip" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hflip" aria-hidden="true">TOC</a></span></h3>
15134
15135 <p>Flip the input video horizontally.
15136 </p>
15137 <p>For example, to horizontally flip the input video with <code>ffmpeg</code>:
15138 </p><div class="example">
15139 <pre class="example">ffmpeg -i in.avi -vf &quot;hflip&quot; out.avi
15140 </pre></div>
15141
15142 <a name="histeq"></a>
15143 <h3 class="section">28.49 histeq<span class="pull-right"><a class="anchor hidden-xs" href="#histeq" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-histeq" aria-hidden="true">TOC</a></span></h3>
15144 <p>This filter applies a global color histogram equalization on a
15145 per-frame basis.
15146 </p>
15147 <p>It can be used to correct video that has a compressed range of pixel
15148 intensities.  The filter redistributes the pixel intensities to
15149 equalize their distribution across the intensity range. It may be
15150 viewed as an &quot;automatically adjusting contrast filter&quot;. This filter is
15151 useful only for correcting degraded or poorly captured source
15152 video.
15153 </p>
15154 <p>The filter accepts the following options:
15155 </p>
15156 <dl compact="compact">
15157 <dt><samp>strength</samp></dt>
15158 <dd><p>Determine the amount of equalization to be applied.  As the strength
15159 is reduced, the distribution of pixel intensities more-and-more
15160 approaches that of the input frame. The value must be a float number
15161 in the range [0,1] and defaults to 0.200.
15162 </p>
15163 </dd>
15164 <dt><samp>intensity</samp></dt>
15165 <dd><p>Set the maximum intensity that can generated and scale the output
15166 values appropriately.  The strength should be set as desired and then
15167 the intensity can be limited if needed to avoid washing-out. The value
15168 must be a float number in the range [0,1] and defaults to 0.210.
15169 </p>
15170 </dd>
15171 <dt><samp>antibanding</samp></dt>
15172 <dd><p>Set the antibanding level. If enabled the filter will randomly vary
15173 the luminance of output pixels by a small amount to avoid banding of
15174 the histogram. Possible values are <code>none</code>, <code>weak</code> or
15175 <code>strong</code>. It defaults to <code>none</code>.
15176 </p></dd>
15177 </dl>
15178
15179 <a name="histogram"></a>
15180 <h3 class="section">28.50 histogram<span class="pull-right"><a class="anchor hidden-xs" href="#histogram" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-histogram" aria-hidden="true">TOC</a></span></h3>
15181
15182 <p>Compute and draw a color distribution histogram for the input video.
15183 </p>
15184 <p>The computed histogram is a representation of the color component
15185 distribution in an image.
15186 </p>
15187 <p>The filter accepts the following options:
15188 </p>
15189 <dl compact="compact">
15190 <dt><samp>mode</samp></dt>
15191 <dd><p>Set histogram mode.
15192 </p>
15193 <p>It accepts the following values:
15194 </p><dl compact="compact">
15195 <dt>&lsquo;<samp>levels</samp>&rsquo;</dt>
15196 <dd><p>Standard histogram that displays the color components distribution in an
15197 image. Displays color graph for each color component. Shows distribution of
15198 the Y, U, V, A or R, G, B components, depending on input format, in the
15199 current frame. Below each graph a color component scale meter is shown.
15200 </p>
15201 </dd>
15202 <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
15203 <dd><p>Displays chroma values (U/V color placement) in a two dimensional
15204 graph (which is called a vectorscope). The brighter a pixel in the
15205 vectorscope, the more pixels of the input frame correspond to that pixel
15206 (i.e., more pixels have this chroma value). The V component is displayed on
15207 the horizontal (X) axis, with the leftmost side being V = 0 and the rightmost
15208 side being V = 255. The U component is displayed on the vertical (Y) axis,
15209 with the top representing U = 0 and the bottom representing U = 255.
15210 </p>
15211 <p>The position of a white pixel in the graph corresponds to the chroma value of
15212 a pixel of the input clip. The graph can therefore be used to read the hue
15213 (color flavor) and the saturation (the dominance of the hue in the color). As
15214 the hue of a color changes, it moves around the square. At the center of the
15215 square the saturation is zero, which means that the corresponding pixel has no
15216 color. If the amount of a specific color is increased (while leaving the other
15217 colors unchanged) the saturation increases, and the indicator moves towards
15218 the edge of the square.
15219 </p>
15220 </dd>
15221 <dt>&lsquo;<samp>color2</samp>&rsquo;</dt>
15222 <dd><p>Chroma values in vectorscope, similar as <code>color</code> but actual chroma values
15223 are displayed.
15224 </p>
15225 </dd>
15226 <dt>&lsquo;<samp>waveform</samp>&rsquo;</dt>
15227 <dd><p>Per row/column color component graph. In row mode, the graph on the left side
15228 represents color component value 0 and the right side represents value = 255.
15229 In column mode, the top side represents color component value = 0 and bottom
15230 side represents value = 255.
15231 </p></dd>
15232 </dl>
15233 <p>Default value is <code>levels</code>.
15234 </p>
15235 </dd>
15236 <dt><samp>level_height</samp></dt>
15237 <dd><p>Set height of level in <code>levels</code>. Default value is <code>200</code>.
15238 Allowed range is [50, 2048].
15239 </p>
15240 </dd>
15241 <dt><samp>scale_height</samp></dt>
15242 <dd><p>Set height of color scale in <code>levels</code>. Default value is <code>12</code>.
15243 Allowed range is [0, 40].
15244 </p>
15245 </dd>
15246 <dt><samp>step</samp></dt>
15247 <dd><p>Set step for <code>waveform</code> mode. Smaller values are useful to find out how
15248 many values of the same luminance are distributed across input rows/columns.
15249 Default value is <code>10</code>. Allowed range is [1, 255].
15250 </p>
15251 </dd>
15252 <dt><samp>waveform_mode</samp></dt>
15253 <dd><p>Set mode for <code>waveform</code>. Can be either <code>row</code>, or <code>column</code>.
15254 Default is <code>row</code>.
15255 </p>
15256 </dd>
15257 <dt><samp>waveform_mirror</samp></dt>
15258 <dd><p>Set mirroring mode for <code>waveform</code>. <code>0</code> means unmirrored, <code>1</code>
15259 means mirrored. In mirrored mode, higher values will be represented on the left
15260 side for <code>row</code> mode and at the top for <code>column</code> mode. Default is
15261 <code>0</code> (unmirrored).
15262 </p>
15263 </dd>
15264 <dt><samp>display_mode</samp></dt>
15265 <dd><p>Set display mode for <code>waveform</code> and <code>levels</code>.
15266 It accepts the following values:
15267 </p><dl compact="compact">
15268 <dt>&lsquo;<samp>parade</samp>&rsquo;</dt>
15269 <dd><p>Display separate graph for the color components side by side in
15270 <code>row</code> waveform mode or one below the other in <code>column</code> waveform mode
15271 for <code>waveform</code> histogram mode. For <code>levels</code> histogram mode,
15272 per color component graphs are placed below each other.
15273 </p>
15274 <p>Using this display mode in <code>waveform</code> histogram mode makes it easy to
15275 spot color casts in the highlights and shadows of an image, by comparing the
15276 contours of the top and the bottom graphs of each waveform. Since whites,
15277 grays, and blacks are characterized by exactly equal amounts of red, green,
15278 and blue, neutral areas of the picture should display three waveforms of
15279 roughly equal width/height. If not, the correction is easy to perform by
15280 making level adjustments the three waveforms.
15281 </p>
15282 </dd>
15283 <dt>&lsquo;<samp>overlay</samp>&rsquo;</dt>
15284 <dd><p>Presents information identical to that in the <code>parade</code>, except
15285 that the graphs representing color components are superimposed directly
15286 over one another.
15287 </p>
15288 <p>This display mode in <code>waveform</code> histogram mode makes it easier to spot
15289 relative differences or similarities in overlapping areas of the color
15290 components that are supposed to be identical, such as neutral whites, grays,
15291 or blacks.
15292 </p></dd>
15293 </dl>
15294 <p>Default is <code>parade</code>.
15295 </p>
15296 </dd>
15297 <dt><samp>levels_mode</samp></dt>
15298 <dd><p>Set mode for <code>levels</code>. Can be either <code>linear</code>, or <code>logarithmic</code>.
15299 Default is <code>linear</code>.
15300 </p></dd>
15301 </dl>
15302
15303 <a name="Examples-59"></a>
15304 <h4 class="subsection">28.50.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-59" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-59" aria-hidden="true">TOC</a></span></h4>
15305
15306 <ul>
15307 <li> Calculate and draw histogram:
15308 <div class="example">
15309 <pre class="example">ffplay -i input -vf histogram
15310 </pre></div>
15311
15312 </li></ul>
15313
15314 <a name="hqdn3d"></a><a name="hqdn3d-1"></a>
15315 <h3 class="section">28.51 hqdn3d<span class="pull-right"><a class="anchor hidden-xs" href="#hqdn3d-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hqdn3d-1" aria-hidden="true">TOC</a></span></h3>
15316
15317 <p>This is a high precision/quality 3d denoise filter. It aims to reduce
15318 image noise, producing smooth images and making still images really
15319 still. It should enhance compressibility.
15320 </p>
15321 <p>It accepts the following optional parameters:
15322 </p>
15323 <dl compact="compact">
15324 <dt><samp>luma_spatial</samp></dt>
15325 <dd><p>A non-negative floating point number which specifies spatial luma strength.
15326 It defaults to 4.0.
15327 </p>
15328 </dd>
15329 <dt><samp>chroma_spatial</samp></dt>
15330 <dd><p>A non-negative floating point number which specifies spatial chroma strength.
15331 It defaults to 3.0*<var>luma_spatial</var>/4.0.
15332 </p>
15333 </dd>
15334 <dt><samp>luma_tmp</samp></dt>
15335 <dd><p>A floating point number which specifies luma temporal strength. It defaults to
15336 6.0*<var>luma_spatial</var>/4.0.
15337 </p>
15338 </dd>
15339 <dt><samp>chroma_tmp</samp></dt>
15340 <dd><p>A floating point number which specifies chroma temporal strength. It defaults to
15341 <var>luma_tmp</var>*<var>chroma_spatial</var>/<var>luma_spatial</var>.
15342 </p></dd>
15343 </dl>
15344
15345 <a name="hqx"></a>
15346 <h3 class="section">28.52 hqx<span class="pull-right"><a class="anchor hidden-xs" href="#hqx" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hqx" aria-hidden="true">TOC</a></span></h3>
15347
15348 <p>Apply a high-quality magnification filter designed for pixel art. This filter
15349 was originally created by Maxim Stepin.
15350 </p>
15351 <p>It accepts the following option:
15352 </p>
15353 <dl compact="compact">
15354 <dt><samp>n</samp></dt>
15355 <dd><p>Set the scaling dimension: <code>2</code> for <code>hq2x</code>, <code>3</code> for
15356 <code>hq3x</code> and <code>4</code> for <code>hq4x</code>.
15357 Default is <code>3</code>.
15358 </p></dd>
15359 </dl>
15360
15361 <a name="hue"></a>
15362 <h3 class="section">28.53 hue<span class="pull-right"><a class="anchor hidden-xs" href="#hue" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hue" aria-hidden="true">TOC</a></span></h3>
15363
15364 <p>Modify the hue and/or the saturation of the input.
15365 </p>
15366 <p>It accepts the following parameters:
15367 </p>
15368 <dl compact="compact">
15369 <dt><samp>h</samp></dt>
15370 <dd><p>Specify the hue angle as a number of degrees. It accepts an expression,
15371 and defaults to &quot;0&quot;.
15372 </p>
15373 </dd>
15374 <dt><samp>s</samp></dt>
15375 <dd><p>Specify the saturation in the [-10,10] range. It accepts an expression and
15376 defaults to &quot;1&quot;.
15377 </p>
15378 </dd>
15379 <dt><samp>H</samp></dt>
15380 <dd><p>Specify the hue angle as a number of radians. It accepts an
15381 expression, and defaults to &quot;0&quot;.
15382 </p>
15383 </dd>
15384 <dt><samp>b</samp></dt>
15385 <dd><p>Specify the brightness in the [-10,10] range. It accepts an expression and
15386 defaults to &quot;0&quot;.
15387 </p></dd>
15388 </dl>
15389
15390 <p><samp>h</samp> and <samp>H</samp> are mutually exclusive, and can&rsquo;t be
15391 specified at the same time.
15392 </p>
15393 <p>The <samp>b</samp>, <samp>h</samp>, <samp>H</samp> and <samp>s</samp> option values are
15394 expressions containing the following constants:
15395 </p>
15396 <dl compact="compact">
15397 <dt><samp>n</samp></dt>
15398 <dd><p>frame count of the input frame starting from 0
15399 </p>
15400 </dd>
15401 <dt><samp>pts</samp></dt>
15402 <dd><p>presentation timestamp of the input frame expressed in time base units
15403 </p>
15404 </dd>
15405 <dt><samp>r</samp></dt>
15406 <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
15407 </p>
15408 </dd>
15409 <dt><samp>t</samp></dt>
15410 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
15411 </p>
15412 </dd>
15413 <dt><samp>tb</samp></dt>
15414 <dd><p>time base of the input video
15415 </p></dd>
15416 </dl>
15417
15418 <a name="Examples-60"></a>
15419 <h4 class="subsection">28.53.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-60" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-60" aria-hidden="true">TOC</a></span></h4>
15420
15421 <ul>
15422 <li> Set the hue to 90 degrees and the saturation to 1.0:
15423 <div class="example">
15424 <pre class="example">hue=h=90:s=1
15425 </pre></div>
15426
15427 </li><li> Same command but expressing the hue in radians:
15428 <div class="example">
15429 <pre class="example">hue=H=PI/2:s=1
15430 </pre></div>
15431
15432 </li><li> Rotate hue and make the saturation swing between 0
15433 and 2 over a period of 1 second:
15434 <div class="example">
15435 <pre class="example">hue=&quot;H=2*PI*t: s=sin(2*PI*t)+1&quot;
15436 </pre></div>
15437
15438 </li><li> Apply a 3 seconds saturation fade-in effect starting at 0:
15439 <div class="example">
15440 <pre class="example">hue=&quot;s=min(t/3\,1)&quot;
15441 </pre></div>
15442
15443 <p>The general fade-in expression can be written as:
15444 </p><div class="example">
15445 <pre class="example">hue=&quot;s=min(0\, max((t-START)/DURATION\, 1))&quot;
15446 </pre></div>
15447
15448 </li><li> Apply a 3 seconds saturation fade-out effect starting at 5 seconds:
15449 <div class="example">
15450 <pre class="example">hue=&quot;s=max(0\, min(1\, (8-t)/3))&quot;
15451 </pre></div>
15452
15453 <p>The general fade-out expression can be written as:
15454 </p><div class="example">
15455 <pre class="example">hue=&quot;s=max(0\, min(1\, (START+DURATION-t)/DURATION))&quot;
15456 </pre></div>
15457
15458 </li></ul>
15459
15460 <a name="Commands-3"></a>
15461 <h4 class="subsection">28.53.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-3" aria-hidden="true">TOC</a></span></h4>
15462
15463 <p>This filter supports the following commands:
15464 </p><dl compact="compact">
15465 <dt><samp>b</samp></dt>
15466 <dt><samp>s</samp></dt>
15467 <dt><samp>h</samp></dt>
15468 <dt><samp>H</samp></dt>
15469 <dd><p>Modify the hue and/or the saturation and/or brightness of the input video.
15470 The command accepts the same syntax of the corresponding option.
15471 </p>
15472 <p>If the specified expression is not valid, it is kept at its current
15473 value.
15474 </p></dd>
15475 </dl>
15476
15477 <a name="idet"></a>
15478 <h3 class="section">28.54 idet<span class="pull-right"><a class="anchor hidden-xs" href="#idet" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-idet" aria-hidden="true">TOC</a></span></h3>
15479
15480 <p>Detect video interlacing type.
15481 </p>
15482 <p>This filter tries to detect if the input frames as interlaced, progressive,
15483 top or bottom field first. It will also try and detect fields that are
15484 repeated between adjacent frames (a sign of telecine).
15485 </p>
15486 <p>Single frame detection considers only immediately adjacent frames when classifying each frame.
15487 Multiple frame detection incorporates the classification history of previous frames.
15488 </p>
15489 <p>The filter will log these metadata values:
15490 </p>
15491 <dl compact="compact">
15492 <dt><samp>single.current_frame</samp></dt>
15493 <dd><p>Detected type of current frame using single-frame detection. One of:
15494 &ldquo;tff&rdquo; (top field first), &ldquo;bff&rdquo; (bottom field first),
15495 &ldquo;progressive&rdquo;, or &ldquo;undetermined&rdquo;
15496 </p>
15497 </dd>
15498 <dt><samp>single.tff</samp></dt>
15499 <dd><p>Cumulative number of frames detected as top field first using single-frame detection.
15500 </p>
15501 </dd>
15502 <dt><samp>multiple.tff</samp></dt>
15503 <dd><p>Cumulative number of frames detected as top field first using multiple-frame detection.
15504 </p>
15505 </dd>
15506 <dt><samp>single.bff</samp></dt>
15507 <dd><p>Cumulative number of frames detected as bottom field first using single-frame detection.
15508 </p>
15509 </dd>
15510 <dt><samp>multiple.current_frame</samp></dt>
15511 <dd><p>Detected type of current frame using multiple-frame detection. One of:
15512 &ldquo;tff&rdquo; (top field first), &ldquo;bff&rdquo; (bottom field first),
15513 &ldquo;progressive&rdquo;, or &ldquo;undetermined&rdquo;
15514 </p>
15515 </dd>
15516 <dt><samp>multiple.bff</samp></dt>
15517 <dd><p>Cumulative number of frames detected as bottom field first using multiple-frame detection.
15518 </p>
15519 </dd>
15520 <dt><samp>single.progressive</samp></dt>
15521 <dd><p>Cumulative number of frames detected as progressive using single-frame detection.
15522 </p>
15523 </dd>
15524 <dt><samp>multiple.progressive</samp></dt>
15525 <dd><p>Cumulative number of frames detected as progressive using multiple-frame detection.
15526 </p>
15527 </dd>
15528 <dt><samp>single.undetermined</samp></dt>
15529 <dd><p>Cumulative number of frames that could not be classified using single-frame detection.
15530 </p>
15531 </dd>
15532 <dt><samp>multiple.undetermined</samp></dt>
15533 <dd><p>Cumulative number of frames that could not be classified using multiple-frame detection.
15534 </p>
15535 </dd>
15536 <dt><samp>repeated.current_frame</samp></dt>
15537 <dd><p>Which field in the current frame is repeated from the last. One of &ldquo;neither&rdquo;, &ldquo;top&rdquo;, or &ldquo;bottom&rdquo;.
15538 </p>
15539 </dd>
15540 <dt><samp>repeated.neither</samp></dt>
15541 <dd><p>Cumulative number of frames with no repeated field.
15542 </p>
15543 </dd>
15544 <dt><samp>repeated.top</samp></dt>
15545 <dd><p>Cumulative number of frames with the top field repeated from the previous frame&rsquo;s top field.
15546 </p>
15547 </dd>
15548 <dt><samp>repeated.bottom</samp></dt>
15549 <dd><p>Cumulative number of frames with the bottom field repeated from the previous frame&rsquo;s bottom field.
15550 </p></dd>
15551 </dl>
15552
15553 <p>The filter accepts the following options:
15554 </p>
15555 <dl compact="compact">
15556 <dt><samp>intl_thres</samp></dt>
15557 <dd><p>Set interlacing threshold.
15558 </p></dd>
15559 <dt><samp>prog_thres</samp></dt>
15560 <dd><p>Set progressive threshold.
15561 </p></dd>
15562 <dt><samp>repeat_thres</samp></dt>
15563 <dd><p>Threshold for repeated field detection.
15564 </p></dd>
15565 <dt><samp>half_life</samp></dt>
15566 <dd><p>Number of frames after which a given frame&rsquo;s contribution to the
15567 statistics is halved (i.e., it contributes only 0.5 to it&rsquo;s
15568 classification). The default of 0 means that all frames seen are given
15569 full weight of 1.0 forever.
15570 </p></dd>
15571 <dt><samp>analyze_interlaced_flag</samp></dt>
15572 <dd><p>When this is not 0 then idet will use the specified number of frames to determine
15573 if the interlaced flag is accurate, it will not count undetermined frames.
15574 If the flag is found to be accurate it will be used without any further
15575 computations, if it is found to be inaccurate it will be cleared without any
15576 further computations. This allows inserting the idet filter as a low computational
15577 method to clean up the interlaced flag
15578 </p></dd>
15579 </dl>
15580
15581 <a name="il"></a>
15582 <h3 class="section">28.55 il<span class="pull-right"><a class="anchor hidden-xs" href="#il" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-il" aria-hidden="true">TOC</a></span></h3>
15583
15584 <p>Deinterleave or interleave fields.
15585 </p>
15586 <p>This filter allows one to process interlaced images fields without
15587 deinterlacing them. Deinterleaving splits the input frame into 2
15588 fields (so called half pictures). Odd lines are moved to the top
15589 half of the output image, even lines to the bottom half.
15590 You can process (filter) them independently and then re-interleave them.
15591 </p>
15592 <p>The filter accepts the following options:
15593 </p>
15594 <dl compact="compact">
15595 <dt><samp>luma_mode, l</samp></dt>
15596 <dt><samp>chroma_mode, c</samp></dt>
15597 <dt><samp>alpha_mode, a</samp></dt>
15598 <dd><p>Available values for <var>luma_mode</var>, <var>chroma_mode</var> and
15599 <var>alpha_mode</var> are:
15600 </p>
15601 <dl compact="compact">
15602 <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
15603 <dd><p>Do nothing.
15604 </p>
15605 </dd>
15606 <dt>&lsquo;<samp>deinterleave, d</samp>&rsquo;</dt>
15607 <dd><p>Deinterleave fields, placing one above the other.
15608 </p>
15609 </dd>
15610 <dt>&lsquo;<samp>interleave, i</samp>&rsquo;</dt>
15611 <dd><p>Interleave fields. Reverse the effect of deinterleaving.
15612 </p></dd>
15613 </dl>
15614 <p>Default value is <code>none</code>.
15615 </p>
15616 </dd>
15617 <dt><samp>luma_swap, ls</samp></dt>
15618 <dt><samp>chroma_swap, cs</samp></dt>
15619 <dt><samp>alpha_swap, as</samp></dt>
15620 <dd><p>Swap luma/chroma/alpha fields. Exchange even &amp; odd lines. Default value is <code>0</code>.
15621 </p></dd>
15622 </dl>
15623
15624 <a name="interlace"></a>
15625 <h3 class="section">28.56 interlace<span class="pull-right"><a class="anchor hidden-xs" href="#interlace" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-interlace" aria-hidden="true">TOC</a></span></h3>
15626
15627 <p>Simple interlacing filter from progressive contents. This interleaves upper (or
15628 lower) lines from odd frames with lower (or upper) lines from even frames,
15629 halving the frame rate and preserving image height.
15630 </p>
15631 <div class="example">
15632 <pre class="example">   Original        Original             New Frame
15633    Frame 'j'      Frame 'j+1'             (tff)
15634   ==========      ===========       ==================
15635     Line 0  --------------------&gt;    Frame 'j' Line 0
15636     Line 1          Line 1  ----&gt;   Frame 'j+1' Line 1
15637     Line 2 ---------------------&gt;    Frame 'j' Line 2
15638     Line 3          Line 3  ----&gt;   Frame 'j+1' Line 3
15639      ...             ...                   ...
15640 New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on
15641 </pre></div>
15642
15643 <p>It accepts the following optional parameters:
15644 </p>
15645 <dl compact="compact">
15646 <dt><samp>scan</samp></dt>
15647 <dd><p>This determines whether the interlaced frame is taken from the even
15648 (tff - default) or odd (bff) lines of the progressive frame.
15649 </p>
15650 </dd>
15651 <dt><samp>lowpass</samp></dt>
15652 <dd><p>Enable (default) or disable the vertical lowpass filter to avoid twitter
15653 interlacing and reduce moire patterns.
15654 </p></dd>
15655 </dl>
15656
15657 <a name="kerndeint"></a>
15658 <h3 class="section">28.57 kerndeint<span class="pull-right"><a class="anchor hidden-xs" href="#kerndeint" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-kerndeint" aria-hidden="true">TOC</a></span></h3>
15659
15660 <p>Deinterlace input video by applying Donald Graft&rsquo;s adaptive kernel
15661 deinterling. Work on interlaced parts of a video to produce
15662 progressive frames.
15663 </p>
15664 <p>The description of the accepted parameters follows.
15665 </p>
15666 <dl compact="compact">
15667 <dt><samp>thresh</samp></dt>
15668 <dd><p>Set the threshold which affects the filter&rsquo;s tolerance when
15669 determining if a pixel line must be processed. It must be an integer
15670 in the range [0,255] and defaults to 10. A value of 0 will result in
15671 applying the process on every pixels.
15672 </p>
15673 </dd>
15674 <dt><samp>map</samp></dt>
15675 <dd><p>Paint pixels exceeding the threshold value to white if set to 1.
15676 Default is 0.
15677 </p>
15678 </dd>
15679 <dt><samp>order</samp></dt>
15680 <dd><p>Set the fields order. Swap fields if set to 1, leave fields alone if
15681 0. Default is 0.
15682 </p>
15683 </dd>
15684 <dt><samp>sharp</samp></dt>
15685 <dd><p>Enable additional sharpening if set to 1. Default is 0.
15686 </p>
15687 </dd>
15688 <dt><samp>twoway</samp></dt>
15689 <dd><p>Enable twoway sharpening if set to 1. Default is 0.
15690 </p></dd>
15691 </dl>
15692
15693 <a name="Examples-61"></a>
15694 <h4 class="subsection">28.57.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-61" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-61" aria-hidden="true">TOC</a></span></h4>
15695
15696 <ul>
15697 <li> Apply default values:
15698 <div class="example">
15699 <pre class="example">kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
15700 </pre></div>
15701
15702 </li><li> Enable additional sharpening:
15703 <div class="example">
15704 <pre class="example">kerndeint=sharp=1
15705 </pre></div>
15706
15707 </li><li> Paint processed pixels in white:
15708 <div class="example">
15709 <pre class="example">kerndeint=map=1
15710 </pre></div>
15711 </li></ul>
15712
15713 <a name="lenscorrection"></a>
15714 <h3 class="section">28.58 lenscorrection<span class="pull-right"><a class="anchor hidden-xs" href="#lenscorrection" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lenscorrection" aria-hidden="true">TOC</a></span></h3>
15715
15716 <p>Correct radial lens distortion
15717 </p>
15718 <p>This filter can be used to correct for radial distortion as can result from the use
15719 of wide angle lenses, and thereby re-rectify the image. To find the right parameters
15720 one can use tools available for example as part of opencv or simply trial-and-error.
15721 To use opencv use the calibration sample (under samples/cpp) from the opencv sources
15722 and extract the k1 and k2 coefficients from the resulting matrix.
15723 </p>
15724 <p>Note that effectively the same filter is available in the open-source tools Krita and
15725 Digikam from the KDE project.
15726 </p>
15727 <p>In contrast to the <a href="#vignette">vignette</a> filter, which can also be used to compensate lens errors,
15728 this filter corrects the distortion of the image, whereas <a href="#vignette">vignette</a> corrects the
15729 brightness distribution, so you may want to use both filters together in certain
15730 cases, though you will have to take care of ordering, i.e. whether vignetting should
15731 be applied before or after lens correction.
15732 </p>
15733 <a name="Options-17"></a>
15734 <h4 class="subsection">28.58.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-17" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-17" aria-hidden="true">TOC</a></span></h4>
15735
15736 <p>The filter accepts the following options:
15737 </p>
15738 <dl compact="compact">
15739 <dt><samp>cx</samp></dt>
15740 <dd><p>Relative x-coordinate of the focal point of the image, and thereby the center of the
15741 distortion. This value has a range [0,1] and is expressed as fractions of the image
15742 width.
15743 </p></dd>
15744 <dt><samp>cy</samp></dt>
15745 <dd><p>Relative y-coordinate of the focal point of the image, and thereby the center of the
15746 distortion. This value has a range [0,1] and is expressed as fractions of the image
15747 height.
15748 </p></dd>
15749 <dt><samp>k1</samp></dt>
15750 <dd><p>Coefficient of the quadratic correction term. 0.5 means no correction.
15751 </p></dd>
15752 <dt><samp>k2</samp></dt>
15753 <dd><p>Coefficient of the double quadratic correction term. 0.5 means no correction.
15754 </p></dd>
15755 </dl>
15756
15757 <p>The formula that generates the correction is:
15758 </p>
15759 <p><var>r_src</var> = <var>r_tgt</var> * (1 + <var>k1</var> * (<var>r_tgt</var> / <var>r_0</var>)^2 + <var>k2</var> * (<var>r_tgt</var> / <var>r_0</var>)^4)
15760 </p>
15761 <p>where <var>r_0</var> is halve of the image diagonal and <var>r_src</var> and <var>r_tgt</var> are the
15762 distances from the focal point in the source and target images, respectively.
15763 </p>
15764 <a name="lut3d"></a><a name="lut3d-1"></a>
15765 <h3 class="section">28.59 lut3d<span class="pull-right"><a class="anchor hidden-xs" href="#lut3d-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lut3d-1" aria-hidden="true">TOC</a></span></h3>
15766
15767 <p>Apply a 3D LUT to an input video.
15768 </p>
15769 <p>The filter accepts the following options:
15770 </p>
15771 <dl compact="compact">
15772 <dt><samp>file</samp></dt>
15773 <dd><p>Set the 3D LUT file name.
15774 </p>
15775 <p>Currently supported formats:
15776 </p><dl compact="compact">
15777 <dt>&lsquo;<samp>3dl</samp>&rsquo;</dt>
15778 <dd><p>AfterEffects
15779 </p></dd>
15780 <dt>&lsquo;<samp>cube</samp>&rsquo;</dt>
15781 <dd><p>Iridas
15782 </p></dd>
15783 <dt>&lsquo;<samp>dat</samp>&rsquo;</dt>
15784 <dd><p>DaVinci
15785 </p></dd>
15786 <dt>&lsquo;<samp>m3d</samp>&rsquo;</dt>
15787 <dd><p>Pandora
15788 </p></dd>
15789 </dl>
15790 </dd>
15791 <dt><samp>interp</samp></dt>
15792 <dd><p>Select interpolation mode.
15793 </p>
15794 <p>Available values are:
15795 </p>
15796 <dl compact="compact">
15797 <dt>&lsquo;<samp>nearest</samp>&rsquo;</dt>
15798 <dd><p>Use values from the nearest defined point.
15799 </p></dd>
15800 <dt>&lsquo;<samp>trilinear</samp>&rsquo;</dt>
15801 <dd><p>Interpolate values using the 8 points defining a cube.
15802 </p></dd>
15803 <dt>&lsquo;<samp>tetrahedral</samp>&rsquo;</dt>
15804 <dd><p>Interpolate values using a tetrahedron.
15805 </p></dd>
15806 </dl>
15807 </dd>
15808 </dl>
15809
15810 <a name="lut_002c-lutrgb_002c-lutyuv"></a>
15811 <h3 class="section">28.60 lut, lutrgb, lutyuv<span class="pull-right"><a class="anchor hidden-xs" href="#lut_002c-lutrgb_002c-lutyuv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lut_002c-lutrgb_002c-lutyuv" aria-hidden="true">TOC</a></span></h3>
15812
15813 <p>Compute a look-up table for binding each pixel component input value
15814 to an output value, and apply it to the input video.
15815 </p>
15816 <p><var>lutyuv</var> applies a lookup table to a YUV input video, <var>lutrgb</var>
15817 to an RGB input video.
15818 </p>
15819 <p>These filters accept the following parameters:
15820 </p><dl compact="compact">
15821 <dt><samp>c0</samp></dt>
15822 <dd><p>set first pixel component expression
15823 </p></dd>
15824 <dt><samp>c1</samp></dt>
15825 <dd><p>set second pixel component expression
15826 </p></dd>
15827 <dt><samp>c2</samp></dt>
15828 <dd><p>set third pixel component expression
15829 </p></dd>
15830 <dt><samp>c3</samp></dt>
15831 <dd><p>set fourth pixel component expression, corresponds to the alpha component
15832 </p>
15833 </dd>
15834 <dt><samp>r</samp></dt>
15835 <dd><p>set red component expression
15836 </p></dd>
15837 <dt><samp>g</samp></dt>
15838 <dd><p>set green component expression
15839 </p></dd>
15840 <dt><samp>b</samp></dt>
15841 <dd><p>set blue component expression
15842 </p></dd>
15843 <dt><samp>a</samp></dt>
15844 <dd><p>alpha component expression
15845 </p>
15846 </dd>
15847 <dt><samp>y</samp></dt>
15848 <dd><p>set Y/luminance component expression
15849 </p></dd>
15850 <dt><samp>u</samp></dt>
15851 <dd><p>set U/Cb component expression
15852 </p></dd>
15853 <dt><samp>v</samp></dt>
15854 <dd><p>set V/Cr component expression
15855 </p></dd>
15856 </dl>
15857
15858 <p>Each of them specifies the expression to use for computing the lookup table for
15859 the corresponding pixel component values.
15860 </p>
15861 <p>The exact component associated to each of the <var>c*</var> options depends on the
15862 format in input.
15863 </p>
15864 <p>The <var>lut</var> filter requires either YUV or RGB pixel formats in input,
15865 <var>lutrgb</var> requires RGB pixel formats in input, and <var>lutyuv</var> requires YUV.
15866 </p>
15867 <p>The expressions can contain the following constants and functions:
15868 </p>
15869 <dl compact="compact">
15870 <dt><samp>w</samp></dt>
15871 <dt><samp>h</samp></dt>
15872 <dd><p>The input width and height.
15873 </p>
15874 </dd>
15875 <dt><samp>val</samp></dt>
15876 <dd><p>The input value for the pixel component.
15877 </p>
15878 </dd>
15879 <dt><samp>clipval</samp></dt>
15880 <dd><p>The input value, clipped to the <var>minval</var>-<var>maxval</var> range.
15881 </p>
15882 </dd>
15883 <dt><samp>maxval</samp></dt>
15884 <dd><p>The maximum value for the pixel component.
15885 </p>
15886 </dd>
15887 <dt><samp>minval</samp></dt>
15888 <dd><p>The minimum value for the pixel component.
15889 </p>
15890 </dd>
15891 <dt><samp>negval</samp></dt>
15892 <dd><p>The negated value for the pixel component value, clipped to the
15893 <var>minval</var>-<var>maxval</var> range; it corresponds to the expression
15894 &quot;maxval-clipval+minval&quot;.
15895 </p>
15896 </dd>
15897 <dt><samp>clip(val)</samp></dt>
15898 <dd><p>The computed value in <var>val</var>, clipped to the
15899 <var>minval</var>-<var>maxval</var> range.
15900 </p>
15901 </dd>
15902 <dt><samp>gammaval(gamma)</samp></dt>
15903 <dd><p>The computed gamma correction value of the pixel component value,
15904 clipped to the <var>minval</var>-<var>maxval</var> range. It corresponds to the
15905 expression
15906 &quot;pow((clipval-minval)/(maxval-minval)\,<var>gamma</var>)*(maxval-minval)+minval&quot;
15907 </p>
15908 </dd>
15909 </dl>
15910
15911 <p>All expressions default to &quot;val&quot;.
15912 </p>
15913 <a name="Examples-62"></a>
15914 <h4 class="subsection">28.60.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-62" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-62" aria-hidden="true">TOC</a></span></h4>
15915
15916 <ul>
15917 <li> Negate input video:
15918 <div class="example">
15919 <pre class="example">lutrgb=&quot;r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val&quot;
15920 lutyuv=&quot;y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val&quot;
15921 </pre></div>
15922
15923 <p>The above is the same as:
15924 </p><div class="example">
15925 <pre class="example">lutrgb=&quot;r=negval:g=negval:b=negval&quot;
15926 lutyuv=&quot;y=negval:u=negval:v=negval&quot;
15927 </pre></div>
15928
15929 </li><li> Negate luminance:
15930 <div class="example">
15931 <pre class="example">lutyuv=y=negval
15932 </pre></div>
15933
15934 </li><li> Remove chroma components, turning the video into a graytone image:
15935 <div class="example">
15936 <pre class="example">lutyuv=&quot;u=128:v=128&quot;
15937 </pre></div>
15938
15939 </li><li> Apply a luma burning effect:
15940 <div class="example">
15941 <pre class="example">lutyuv=&quot;y=2*val&quot;
15942 </pre></div>
15943
15944 </li><li> Remove green and blue components:
15945 <div class="example">
15946 <pre class="example">lutrgb=&quot;g=0:b=0&quot;
15947 </pre></div>
15948
15949 </li><li> Set a constant alpha channel value on input:
15950 <div class="example">
15951 <pre class="example">format=rgba,lutrgb=a=&quot;maxval-minval/2&quot;
15952 </pre></div>
15953
15954 </li><li> Correct luminance gamma by a factor of 0.5:
15955 <div class="example">
15956 <pre class="example">lutyuv=y=gammaval(0.5)
15957 </pre></div>
15958
15959 </li><li> Discard least significant bits of luma:
15960 <div class="example">
15961 <pre class="example">lutyuv=y='bitand(val, 128+64+32)'
15962 </pre></div>
15963 </li></ul>
15964
15965 <a name="mergeplanes"></a>
15966 <h3 class="section">28.61 mergeplanes<span class="pull-right"><a class="anchor hidden-xs" href="#mergeplanes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mergeplanes" aria-hidden="true">TOC</a></span></h3>
15967
15968 <p>Merge color channel components from several video streams.
15969 </p>
15970 <p>The filter accepts up to 4 input streams, and merge selected input
15971 planes to the output video.
15972 </p>
15973 <p>This filter accepts the following options:
15974 </p><dl compact="compact">
15975 <dt><samp>mapping</samp></dt>
15976 <dd><p>Set input to output plane mapping. Default is <code>0</code>.
15977 </p>
15978 <p>The mappings is specified as a bitmap. It should be specified as a
15979 hexadecimal number in the form 0xAa[Bb[Cc[Dd]]]. &rsquo;Aa&rsquo; describes the
15980 mapping for the first plane of the output stream. &rsquo;A&rsquo; sets the number of
15981 the input stream to use (from 0 to 3), and &rsquo;a&rsquo; the plane number of the
15982 corresponding input to use (from 0 to 3). The rest of the mappings is
15983 similar, &rsquo;Bb&rsquo; describes the mapping for the output stream second
15984 plane, &rsquo;Cc&rsquo; describes the mapping for the output stream third plane and
15985 &rsquo;Dd&rsquo; describes the mapping for the output stream fourth plane.
15986 </p>
15987 </dd>
15988 <dt><samp>format</samp></dt>
15989 <dd><p>Set output pixel format. Default is <code>yuva444p</code>.
15990 </p></dd>
15991 </dl>
15992
15993 <a name="Examples-63"></a>
15994 <h4 class="subsection">28.61.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-63" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-63" aria-hidden="true">TOC</a></span></h4>
15995
15996 <ul>
15997 <li> Merge three gray video streams of same width and height into single video stream:
15998 <div class="example">
15999 <pre class="example">[a0][a1][a2]mergeplanes=0x001020:yuv444p
16000 </pre></div>
16001
16002 </li><li> Merge 1st yuv444p stream and 2nd gray video stream into yuva444p video stream:
16003 <div class="example">
16004 <pre class="example">[a0][a1]mergeplanes=0x00010210:yuva444p
16005 </pre></div>
16006
16007 </li><li> Swap Y and A plane in yuva444p stream:
16008 <div class="example">
16009 <pre class="example">format=yuva444p,mergeplanes=0x03010200:yuva444p
16010 </pre></div>
16011
16012 </li><li> Swap U and V plane in yuv420p stream:
16013 <div class="example">
16014 <pre class="example">format=yuv420p,mergeplanes=0x000201:yuv420p
16015 </pre></div>
16016
16017 </li><li> Cast a rgb24 clip to yuv444p:
16018 <div class="example">
16019 <pre class="example">format=rgb24,mergeplanes=0x000102:yuv444p
16020 </pre></div>
16021 </li></ul>
16022
16023 <a name="mcdeint"></a>
16024 <h3 class="section">28.62 mcdeint<span class="pull-right"><a class="anchor hidden-xs" href="#mcdeint" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mcdeint" aria-hidden="true">TOC</a></span></h3>
16025
16026 <p>Apply motion-compensation deinterlacing.
16027 </p>
16028 <p>It needs one field per frame as input and must thus be used together
16029 with yadif=1/3 or equivalent.
16030 </p>
16031 <p>This filter accepts the following options:
16032 </p><dl compact="compact">
16033 <dt><samp>mode</samp></dt>
16034 <dd><p>Set the deinterlacing mode.
16035 </p>
16036 <p>It accepts one of the following values:
16037 </p><dl compact="compact">
16038 <dt>&lsquo;<samp>fast</samp>&rsquo;</dt>
16039 <dt>&lsquo;<samp>medium</samp>&rsquo;</dt>
16040 <dt>&lsquo;<samp>slow</samp>&rsquo;</dt>
16041 <dd><p>use iterative motion estimation
16042 </p></dd>
16043 <dt>&lsquo;<samp>extra_slow</samp>&rsquo;</dt>
16044 <dd><p>like &lsquo;<samp>slow</samp>&rsquo;, but use multiple reference frames.
16045 </p></dd>
16046 </dl>
16047 <p>Default value is &lsquo;<samp>fast</samp>&rsquo;.
16048 </p>
16049 </dd>
16050 <dt><samp>parity</samp></dt>
16051 <dd><p>Set the picture field parity assumed for the input video. It must be
16052 one of the following values:
16053 </p>
16054 <dl compact="compact">
16055 <dt>&lsquo;<samp>0, tff</samp>&rsquo;</dt>
16056 <dd><p>assume top field first
16057 </p></dd>
16058 <dt>&lsquo;<samp>1, bff</samp>&rsquo;</dt>
16059 <dd><p>assume bottom field first
16060 </p></dd>
16061 </dl>
16062
16063 <p>Default value is &lsquo;<samp>bff</samp>&rsquo;.
16064 </p>
16065 </dd>
16066 <dt><samp>qp</samp></dt>
16067 <dd><p>Set per-block quantization parameter (QP) used by the internal
16068 encoder.
16069 </p>
16070 <p>Higher values should result in a smoother motion vector field but less
16071 optimal individual vectors. Default value is 1.
16072 </p></dd>
16073 </dl>
16074
16075 <a name="mpdecimate"></a>
16076 <h3 class="section">28.63 mpdecimate<span class="pull-right"><a class="anchor hidden-xs" href="#mpdecimate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpdecimate" aria-hidden="true">TOC</a></span></h3>
16077
16078 <p>Drop frames that do not differ greatly from the previous frame in
16079 order to reduce frame rate.
16080 </p>
16081 <p>The main use of this filter is for very-low-bitrate encoding
16082 (e.g. streaming over dialup modem), but it could in theory be used for
16083 fixing movies that were inverse-telecined incorrectly.
16084 </p>
16085 <p>A description of the accepted options follows.
16086 </p>
16087 <dl compact="compact">
16088 <dt><samp>max</samp></dt>
16089 <dd><p>Set the maximum number of consecutive frames which can be dropped (if
16090 positive), or the minimum interval between dropped frames (if
16091 negative). If the value is 0, the frame is dropped unregarding the
16092 number of previous sequentially dropped frames.
16093 </p>
16094 <p>Default value is 0.
16095 </p>
16096 </dd>
16097 <dt><samp>hi</samp></dt>
16098 <dt><samp>lo</samp></dt>
16099 <dt><samp>frac</samp></dt>
16100 <dd><p>Set the dropping threshold values.
16101 </p>
16102 <p>Values for <samp>hi</samp> and <samp>lo</samp> are for 8x8 pixel blocks and
16103 represent actual pixel value differences, so a threshold of 64
16104 corresponds to 1 unit of difference for each pixel, or the same spread
16105 out differently over the block.
16106 </p>
16107 <p>A frame is a candidate for dropping if no 8x8 blocks differ by more
16108 than a threshold of <samp>hi</samp>, and if no more than <samp>frac</samp> blocks (1
16109 meaning the whole image) differ by more than a threshold of <samp>lo</samp>.
16110 </p>
16111 <p>Default value for <samp>hi</samp> is 64*12, default value for <samp>lo</samp> is
16112 64*5, and default value for <samp>frac</samp> is 0.33.
16113 </p></dd>
16114 </dl>
16115
16116
16117 <a name="negate"></a>
16118 <h3 class="section">28.64 negate<span class="pull-right"><a class="anchor hidden-xs" href="#negate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-negate" aria-hidden="true">TOC</a></span></h3>
16119
16120 <p>Negate input video.
16121 </p>
16122 <p>It accepts an integer in input; if non-zero it negates the
16123 alpha component (if available). The default value in input is 0.
16124 </p>
16125 <a name="noformat"></a>
16126 <h3 class="section">28.65 noformat<span class="pull-right"><a class="anchor hidden-xs" href="#noformat" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-noformat" aria-hidden="true">TOC</a></span></h3>
16127
16128 <p>Force libavfilter not to use any of the specified pixel formats for the
16129 input to the next filter.
16130 </p>
16131 <p>It accepts the following parameters:
16132 </p><dl compact="compact">
16133 <dt><samp>pix_fmts</samp></dt>
16134 <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, such as
16135 apix_fmts=yuv420p|monow|rgb24&quot;.
16136 </p>
16137 </dd>
16138 </dl>
16139
16140 <a name="Examples-64"></a>
16141 <h4 class="subsection">28.65.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-64" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-64" aria-hidden="true">TOC</a></span></h4>
16142
16143 <ul>
16144 <li> Force libavfilter to use a format different from <var>yuv420p</var> for the
16145 input to the vflip filter:
16146 <div class="example">
16147 <pre class="example">noformat=pix_fmts=yuv420p,vflip
16148 </pre></div>
16149
16150 </li><li> Convert the input video to any of the formats not contained in the list:
16151 <div class="example">
16152 <pre class="example">noformat=yuv420p|yuv444p|yuv410p
16153 </pre></div>
16154 </li></ul>
16155
16156 <a name="noise-1"></a>
16157 <h3 class="section">28.66 noise<span class="pull-right"><a class="anchor hidden-xs" href="#noise-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-noise-1" aria-hidden="true">TOC</a></span></h3>
16158
16159 <p>Add noise on video input frame.
16160 </p>
16161 <p>The filter accepts the following options:
16162 </p>
16163 <dl compact="compact">
16164 <dt><samp>all_seed</samp></dt>
16165 <dt><samp>c0_seed</samp></dt>
16166 <dt><samp>c1_seed</samp></dt>
16167 <dt><samp>c2_seed</samp></dt>
16168 <dt><samp>c3_seed</samp></dt>
16169 <dd><p>Set noise seed for specific pixel component or all pixel components in case
16170 of <var>all_seed</var>. Default value is <code>123457</code>.
16171 </p>
16172 </dd>
16173 <dt><samp>all_strength, alls</samp></dt>
16174 <dt><samp>c0_strength, c0s</samp></dt>
16175 <dt><samp>c1_strength, c1s</samp></dt>
16176 <dt><samp>c2_strength, c2s</samp></dt>
16177 <dt><samp>c3_strength, c3s</samp></dt>
16178 <dd><p>Set noise strength for specific pixel component or all pixel components in case
16179 <var>all_strength</var>. Default value is <code>0</code>. Allowed range is [0, 100].
16180 </p>
16181 </dd>
16182 <dt><samp>all_flags, allf</samp></dt>
16183 <dt><samp>c0_flags, c0f</samp></dt>
16184 <dt><samp>c1_flags, c1f</samp></dt>
16185 <dt><samp>c2_flags, c2f</samp></dt>
16186 <dt><samp>c3_flags, c3f</samp></dt>
16187 <dd><p>Set pixel component flags or set flags for all components if <var>all_flags</var>.
16188 Available values for component flags are:
16189 </p><dl compact="compact">
16190 <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
16191 <dd><p>averaged temporal noise (smoother)
16192 </p></dd>
16193 <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
16194 <dd><p>mix random noise with a (semi)regular pattern
16195 </p></dd>
16196 <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
16197 <dd><p>temporal noise (noise pattern changes between frames)
16198 </p></dd>
16199 <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
16200 <dd><p>uniform noise (gaussian otherwise)
16201 </p></dd>
16202 </dl>
16203 </dd>
16204 </dl>
16205
16206 <a name="Examples-65"></a>
16207 <h4 class="subsection">28.66.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-65" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-65" aria-hidden="true">TOC</a></span></h4>
16208
16209 <p>Add temporal and uniform noise to input video:
16210 </p><div class="example">
16211 <pre class="example">noise=alls=20:allf=t+u
16212 </pre></div>
16213
16214 <a name="null"></a>
16215 <h3 class="section">28.67 null<span class="pull-right"><a class="anchor hidden-xs" href="#null" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-null" aria-hidden="true">TOC</a></span></h3>
16216
16217 <p>Pass the video source unchanged to the output.
16218 </p>
16219 <a name="ocv"></a>
16220 <h3 class="section">28.68 ocv<span class="pull-right"><a class="anchor hidden-xs" href="#ocv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ocv" aria-hidden="true">TOC</a></span></h3>
16221
16222 <p>Apply a video transform using libopencv.
16223 </p>
16224 <p>To enable this filter, install the libopencv library and headers and
16225 configure FFmpeg with <code>--enable-libopencv</code>.
16226 </p>
16227 <p>It accepts the following parameters:
16228 </p>
16229 <dl compact="compact">
16230 <dt><samp>filter_name</samp></dt>
16231 <dd><p>The name of the libopencv filter to apply.
16232 </p>
16233 </dd>
16234 <dt><samp>filter_params</samp></dt>
16235 <dd><p>The parameters to pass to the libopencv filter. If not specified, the default
16236 values are assumed.
16237 </p>
16238 </dd>
16239 </dl>
16240
16241 <p>Refer to the official libopencv documentation for more precise
16242 information:
16243 <a href="http://docs.opencv.org/master/modules/imgproc/doc/filtering.html">http://docs.opencv.org/master/modules/imgproc/doc/filtering.html</a>
16244 </p>
16245 <p>Several libopencv filters are supported; see the following subsections.
16246 </p>
16247 <a name="dilate"></a><a name="dilate-1"></a>
16248 <h4 class="subsection">28.68.1 dilate<span class="pull-right"><a class="anchor hidden-xs" href="#dilate-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dilate-1" aria-hidden="true">TOC</a></span></h4>
16249
16250 <p>Dilate an image by using a specific structuring element.
16251 It corresponds to the libopencv function <code>cvDilate</code>.
16252 </p>
16253 <p>It accepts the parameters: <var>struct_el</var>|<var>nb_iterations</var>.
16254 </p>
16255 <p><var>struct_el</var> represents a structuring element, and has the syntax:
16256 <var>cols</var>x<var>rows</var>+<var>anchor_x</var>x<var>anchor_y</var>/<var>shape</var>
16257 </p>
16258 <p><var>cols</var> and <var>rows</var> represent the number of columns and rows of
16259 the structuring element, <var>anchor_x</var> and <var>anchor_y</var> the anchor
16260 point, and <var>shape</var> the shape for the structuring element. <var>shape</var>
16261 must be &quot;rect&quot;, &quot;cross&quot;, &quot;ellipse&quot;, or &quot;custom&quot;.
16262 </p>
16263 <p>If the value for <var>shape</var> is &quot;custom&quot;, it must be followed by a
16264 string of the form &quot;=<var>filename</var>&quot;. The file with name
16265 <var>filename</var> is assumed to represent a binary image, with each
16266 printable character corresponding to a bright pixel. When a custom
16267 <var>shape</var> is used, <var>cols</var> and <var>rows</var> are ignored, the number
16268 or columns and rows of the read file are assumed instead.
16269 </p>
16270 <p>The default value for <var>struct_el</var> is &quot;3x3+0x0/rect&quot;.
16271 </p>
16272 <p><var>nb_iterations</var> specifies the number of times the transform is
16273 applied to the image, and defaults to 1.
16274 </p>
16275 <p>Some examples:
16276 </p><div class="example">
16277 <pre class="example"># Use the default values
16278 ocv=dilate
16279
16280 # Dilate using a structuring element with a 5x5 cross, iterating two times
16281 ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
16282
16283 # Read the shape from the file diamond.shape, iterating two times.
16284 # The file diamond.shape may contain a pattern of characters like this
16285 #   *
16286 #  ***
16287 # *****
16288 #  ***
16289 #   *
16290 # The specified columns and rows are ignored
16291 # but the anchor point coordinates are not
16292 ocv=dilate:0x0+2x2/custom=diamond.shape|2
16293 </pre></div>
16294
16295 <a name="erode"></a>
16296 <h4 class="subsection">28.68.2 erode<span class="pull-right"><a class="anchor hidden-xs" href="#erode" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-erode" aria-hidden="true">TOC</a></span></h4>
16297
16298 <p>Erode an image by using a specific structuring element.
16299 It corresponds to the libopencv function <code>cvErode</code>.
16300 </p>
16301 <p>It accepts the parameters: <var>struct_el</var>:<var>nb_iterations</var>,
16302 with the same syntax and semantics as the <a href="#dilate">dilate</a> filter.
16303 </p>
16304 <a name="smooth"></a>
16305 <h4 class="subsection">28.68.3 smooth<span class="pull-right"><a class="anchor hidden-xs" href="#smooth" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-smooth" aria-hidden="true">TOC</a></span></h4>
16306
16307 <p>Smooth the input video.
16308 </p>
16309 <p>The filter takes the following parameters:
16310 <var>type</var>|<var>param1</var>|<var>param2</var>|<var>param3</var>|<var>param4</var>.
16311 </p>
16312 <p><var>type</var> is the type of smooth filter to apply, and must be one of
16313 the following values: &quot;blur&quot;, &quot;blur_no_scale&quot;, &quot;median&quot;, &quot;gaussian&quot;,
16314 or &quot;bilateral&quot;. The default value is &quot;gaussian&quot;.
16315 </p>
16316 <p>The meaning of <var>param1</var>, <var>param2</var>, <var>param3</var>, and <var>param4</var>
16317 depend on the smooth type. <var>param1</var> and
16318 <var>param2</var> accept integer positive values or 0. <var>param3</var> and
16319 <var>param4</var> accept floating point values.
16320 </p>
16321 <p>The default value for <var>param1</var> is 3. The default value for the
16322 other parameters is 0.
16323 </p>
16324 <p>These parameters correspond to the parameters assigned to the
16325 libopencv function <code>cvSmooth</code>.
16326 </p>
16327 <a name="overlay"></a><a name="overlay-1"></a>
16328 <h3 class="section">28.69 overlay<span class="pull-right"><a class="anchor hidden-xs" href="#overlay-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-overlay-1" aria-hidden="true">TOC</a></span></h3>
16329
16330 <p>Overlay one video on top of another.
16331 </p>
16332 <p>It takes two inputs and has one output. The first input is the &quot;main&quot;
16333 video on which the second input is overlaid.
16334 </p>
16335 <p>It accepts the following parameters:
16336 </p>
16337 <p>A description of the accepted options follows.
16338 </p>
16339 <dl compact="compact">
16340 <dt><samp>x</samp></dt>
16341 <dt><samp>y</samp></dt>
16342 <dd><p>Set the expression for the x and y coordinates of the overlaid video
16343 on the main video. Default value is &quot;0&quot; for both expressions. In case
16344 the expression is invalid, it is set to a huge value (meaning that the
16345 overlay will not be displayed within the output visible area).
16346 </p>
16347 </dd>
16348 <dt><samp>eof_action</samp></dt>
16349 <dd><p>The action to take when EOF is encountered on the secondary input; it accepts
16350 one of the following values:
16351 </p>
16352 <dl compact="compact">
16353 <dt><samp>repeat</samp></dt>
16354 <dd><p>Repeat the last frame (the default).
16355 </p></dd>
16356 <dt><samp>endall</samp></dt>
16357 <dd><p>End both streams.
16358 </p></dd>
16359 <dt><samp>pass</samp></dt>
16360 <dd><p>Pass the main input through.
16361 </p></dd>
16362 </dl>
16363
16364 </dd>
16365 <dt><samp>eval</samp></dt>
16366 <dd><p>Set when the expressions for <samp>x</samp>, and <samp>y</samp> are evaluated.
16367 </p>
16368 <p>It accepts the following values:
16369 </p><dl compact="compact">
16370 <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
16371 <dd><p>only evaluate expressions once during the filter initialization or
16372 when a command is processed
16373 </p>
16374 </dd>
16375 <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
16376 <dd><p>evaluate expressions for each incoming frame
16377 </p></dd>
16378 </dl>
16379
16380 <p>Default value is &lsquo;<samp>frame</samp>&rsquo;.
16381 </p>
16382 </dd>
16383 <dt><samp>shortest</samp></dt>
16384 <dd><p>If set to 1, force the output to terminate when the shortest input
16385 terminates. Default value is 0.
16386 </p>
16387 </dd>
16388 <dt><samp>format</samp></dt>
16389 <dd><p>Set the format for the output video.
16390 </p>
16391 <p>It accepts the following values:
16392 </p><dl compact="compact">
16393 <dt>&lsquo;<samp>yuv420</samp>&rsquo;</dt>
16394 <dd><p>force YUV420 output
16395 </p>
16396 </dd>
16397 <dt>&lsquo;<samp>yuv422</samp>&rsquo;</dt>
16398 <dd><p>force YUV422 output
16399 </p>
16400 </dd>
16401 <dt>&lsquo;<samp>yuv444</samp>&rsquo;</dt>
16402 <dd><p>force YUV444 output
16403 </p>
16404 </dd>
16405 <dt>&lsquo;<samp>rgb</samp>&rsquo;</dt>
16406 <dd><p>force RGB output
16407 </p></dd>
16408 </dl>
16409
16410 <p>Default value is &lsquo;<samp>yuv420</samp>&rsquo;.
16411 </p>
16412 </dd>
16413 <dt><samp>rgb <em>(deprecated)</em></samp></dt>
16414 <dd><p>If set to 1, force the filter to accept inputs in the RGB
16415 color space. Default value is 0. This option is deprecated, use
16416 <samp>format</samp> instead.
16417 </p>
16418 </dd>
16419 <dt><samp>repeatlast</samp></dt>
16420 <dd><p>If set to 1, force the filter to draw the last overlay frame over the
16421 main input until the end of the stream. A value of 0 disables this
16422 behavior. Default value is 1.
16423 </p></dd>
16424 </dl>
16425
16426 <p>The <samp>x</samp>, and <samp>y</samp> expressions can contain the following
16427 parameters.
16428 </p>
16429 <dl compact="compact">
16430 <dt><samp>main_w, W</samp></dt>
16431 <dt><samp>main_h, H</samp></dt>
16432 <dd><p>The main input width and height.
16433 </p>
16434 </dd>
16435 <dt><samp>overlay_w, w</samp></dt>
16436 <dt><samp>overlay_h, h</samp></dt>
16437 <dd><p>The overlay input width and height.
16438 </p>
16439 </dd>
16440 <dt><samp>x</samp></dt>
16441 <dt><samp>y</samp></dt>
16442 <dd><p>The computed values for <var>x</var> and <var>y</var>. They are evaluated for
16443 each new frame.
16444 </p>
16445 </dd>
16446 <dt><samp>hsub</samp></dt>
16447 <dt><samp>vsub</samp></dt>
16448 <dd><p>horizontal and vertical chroma subsample values of the output
16449 format. For example for the pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and
16450 <var>vsub</var> is 1.
16451 </p>
16452 </dd>
16453 <dt><samp>n</samp></dt>
16454 <dd><p>the number of input frame, starting from 0
16455 </p>
16456 </dd>
16457 <dt><samp>pos</samp></dt>
16458 <dd><p>the position in the file of the input frame, NAN if unknown
16459 </p>
16460 </dd>
16461 <dt><samp>t</samp></dt>
16462 <dd><p>The timestamp, expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
16463 </p>
16464 </dd>
16465 </dl>
16466
16467 <p>Note that the <var>n</var>, <var>pos</var>, <var>t</var> variables are available only
16468 when evaluation is done <em>per frame</em>, and will evaluate to NAN
16469 when <samp>eval</samp> is set to &lsquo;<samp>init</samp>&rsquo;.
16470 </p>
16471 <p>Be aware that frames are taken from each input video in timestamp
16472 order, hence, if their initial timestamps differ, it is a good idea
16473 to pass the two inputs through a <var>setpts=PTS-STARTPTS</var> filter to
16474 have them begin in the same zero timestamp, as the example for
16475 the <var>movie</var> filter does.
16476 </p>
16477 <p>You can chain together more overlays but you should test the
16478 efficiency of such approach.
16479 </p>
16480 <a name="Commands-4"></a>
16481 <h4 class="subsection">28.69.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-4" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-4" aria-hidden="true">TOC</a></span></h4>
16482
16483 <p>This filter supports the following commands:
16484 </p><dl compact="compact">
16485 <dt><samp>x</samp></dt>
16486 <dt><samp>y</samp></dt>
16487 <dd><p>Modify the x and y of the overlay input.
16488 The command accepts the same syntax of the corresponding option.
16489 </p>
16490 <p>If the specified expression is not valid, it is kept at its current
16491 value.
16492 </p></dd>
16493 </dl>
16494
16495 <a name="Examples-66"></a>
16496 <h4 class="subsection">28.69.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-66" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-66" aria-hidden="true">TOC</a></span></h4>
16497
16498 <ul>
16499 <li> Draw the overlay at 10 pixels from the bottom right corner of the main
16500 video:
16501 <div class="example">
16502 <pre class="example">overlay=main_w-overlay_w-10:main_h-overlay_h-10
16503 </pre></div>
16504
16505 <p>Using named options the example above becomes:
16506 </p><div class="example">
16507 <pre class="example">overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10
16508 </pre></div>
16509
16510 </li><li> Insert a transparent PNG logo in the bottom left corner of the input,
16511 using the <code>ffmpeg</code> tool with the <code>-filter_complex</code> option:
16512 <div class="example">
16513 <pre class="example">ffmpeg -i input -i logo -filter_complex 'overlay=10:main_h-overlay_h-10' output
16514 </pre></div>
16515
16516 </li><li> Insert 2 different transparent PNG logos (second logo on bottom
16517 right corner) using the <code>ffmpeg</code> tool:
16518 <div class="example">
16519 <pre class="example">ffmpeg -i input -i logo1 -i logo2 -filter_complex 'overlay=x=10:y=H-h-10,overlay=x=W-w-10:y=H-h-10' output
16520 </pre></div>
16521
16522 </li><li> Add a transparent color layer on top of the main video; <code>WxH</code>
16523 must specify the size of the main input to the overlay filter:
16524 <div class="example">
16525 <pre class="example">color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
16526 </pre></div>
16527
16528 </li><li> Play an original video and a filtered version (here with the deshake
16529 filter) side by side using the <code>ffplay</code> tool:
16530 <div class="example">
16531 <pre class="example">ffplay input.avi -vf 'split[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w'
16532 </pre></div>
16533
16534 <p>The above command is the same as:
16535 </p><div class="example">
16536 <pre class="example">ffplay input.avi -vf 'split[b], pad=iw*2[src], [b]deshake, [src]overlay=w'
16537 </pre></div>
16538
16539 </li><li> Make a sliding overlay appearing from the left to the right top part of the
16540 screen starting since time 2:
16541 <div class="example">
16542 <pre class="example">overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
16543 </pre></div>
16544
16545 </li><li> Compose output by putting two input videos side to side:
16546 <div class="example">
16547 <pre class="example">ffmpeg -i left.avi -i right.avi -filter_complex &quot;
16548 nullsrc=size=200x100 [background];
16549 [0:v] setpts=PTS-STARTPTS, scale=100x100 [left];
16550 [1:v] setpts=PTS-STARTPTS, scale=100x100 [right];
16551 [background][left]       overlay=shortest=1       [background+left];
16552 [background+left][right] overlay=shortest=1:x=100 [left+right]
16553 &quot;
16554 </pre></div>
16555
16556 </li><li> Mask 10-20 seconds of a video by applying the delogo filter to a section
16557 <div class="example">
16558 <pre class="example">ffmpeg -i test.avi -codec:v:0 wmv2 -ar 11025 -b:v 9000k
16559 -vf '[in]split[split_main][split_delogo];[split_delogo]trim=start=360:end=371,delogo=0:0:640:480[delogoed];[split_main][delogoed]overlay=eof_action=pass[out]'
16560 masked.avi
16561 </pre></div>
16562
16563 </li><li> Chain several overlays in cascade:
16564 <div class="example">
16565 <pre class="example">nullsrc=s=200x200 [bg];
16566 testsrc=s=100x100, split=4 [in0][in1][in2][in3];
16567 [in0] lutrgb=r=0, [bg]   overlay=0:0     [mid0];
16568 [in1] lutrgb=g=0, [mid0] overlay=100:0   [mid1];
16569 [in2] lutrgb=b=0, [mid1] overlay=0:100   [mid2];
16570 [in3] null,       [mid2] overlay=100:100 [out0]
16571 </pre></div>
16572
16573 </li></ul>
16574
16575 <a name="owdenoise"></a>
16576 <h3 class="section">28.70 owdenoise<span class="pull-right"><a class="anchor hidden-xs" href="#owdenoise" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-owdenoise" aria-hidden="true">TOC</a></span></h3>
16577
16578 <p>Apply Overcomplete Wavelet denoiser.
16579 </p>
16580 <p>The filter accepts the following options:
16581 </p>
16582 <dl compact="compact">
16583 <dt><samp>depth</samp></dt>
16584 <dd><p>Set depth.
16585 </p>
16586 <p>Larger depth values will denoise lower frequency components more, but
16587 slow down filtering.
16588 </p>
16589 <p>Must be an int in the range 8-16, default is <code>8</code>.
16590 </p>
16591 </dd>
16592 <dt><samp>luma_strength, ls</samp></dt>
16593 <dd><p>Set luma strength.
16594 </p>
16595 <p>Must be a double value in the range 0-1000, default is <code>1.0</code>.
16596 </p>
16597 </dd>
16598 <dt><samp>chroma_strength, cs</samp></dt>
16599 <dd><p>Set chroma strength.
16600 </p>
16601 <p>Must be a double value in the range 0-1000, default is <code>1.0</code>.
16602 </p></dd>
16603 </dl>
16604
16605 <a name="pad"></a>
16606 <h3 class="section">28.71 pad<span class="pull-right"><a class="anchor hidden-xs" href="#pad" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pad" aria-hidden="true">TOC</a></span></h3>
16607
16608 <p>Add paddings to the input image, and place the original input at the
16609 provided <var>x</var>, <var>y</var> coordinates.
16610 </p>
16611 <p>It accepts the following parameters:
16612 </p>
16613 <dl compact="compact">
16614 <dt><samp>width, w</samp></dt>
16615 <dt><samp>height, h</samp></dt>
16616 <dd><p>Specify an expression for the size of the output image with the
16617 paddings added. If the value for <var>width</var> or <var>height</var> is 0, the
16618 corresponding input size is used for the output.
16619 </p>
16620 <p>The <var>width</var> expression can reference the value set by the
16621 <var>height</var> expression, and vice versa.
16622 </p>
16623 <p>The default value of <var>width</var> and <var>height</var> is 0.
16624 </p>
16625 </dd>
16626 <dt><samp>x</samp></dt>
16627 <dt><samp>y</samp></dt>
16628 <dd><p>Specify the offsets to place the input image at within the padded area,
16629 with respect to the top/left border of the output image.
16630 </p>
16631 <p>The <var>x</var> expression can reference the value set by the <var>y</var>
16632 expression, and vice versa.
16633 </p>
16634 <p>The default value of <var>x</var> and <var>y</var> is 0.
16635 </p>
16636 </dd>
16637 <dt><samp>color</samp></dt>
16638 <dd><p>Specify the color of the padded area. For the syntax of this option,
16639 check the &quot;Color&quot; section in the ffmpeg-utils manual.
16640 </p>
16641 <p>The default value of <var>color</var> is &quot;black&quot;.
16642 </p></dd>
16643 </dl>
16644
16645 <p>The value for the <var>width</var>, <var>height</var>, <var>x</var>, and <var>y</var>
16646 options are expressions containing the following constants:
16647 </p>
16648 <dl compact="compact">
16649 <dt><samp>in_w</samp></dt>
16650 <dt><samp>in_h</samp></dt>
16651 <dd><p>The input video width and height.
16652 </p>
16653 </dd>
16654 <dt><samp>iw</samp></dt>
16655 <dt><samp>ih</samp></dt>
16656 <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
16657 </p>
16658 </dd>
16659 <dt><samp>out_w</samp></dt>
16660 <dt><samp>out_h</samp></dt>
16661 <dd><p>The output width and height (the size of the padded area), as
16662 specified by the <var>width</var> and <var>height</var> expressions.
16663 </p>
16664 </dd>
16665 <dt><samp>ow</samp></dt>
16666 <dt><samp>oh</samp></dt>
16667 <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>.
16668 </p>
16669 </dd>
16670 <dt><samp>x</samp></dt>
16671 <dt><samp>y</samp></dt>
16672 <dd><p>The x and y offsets as specified by the <var>x</var> and <var>y</var>
16673 expressions, or NAN if not yet specified.
16674 </p>
16675 </dd>
16676 <dt><samp>a</samp></dt>
16677 <dd><p>same as <var>iw</var> / <var>ih</var>
16678 </p>
16679 </dd>
16680 <dt><samp>sar</samp></dt>
16681 <dd><p>input sample aspect ratio
16682 </p>
16683 </dd>
16684 <dt><samp>dar</samp></dt>
16685 <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
16686 </p>
16687 </dd>
16688 <dt><samp>hsub</samp></dt>
16689 <dt><samp>vsub</samp></dt>
16690 <dd><p>The horizontal and vertical chroma subsample values. For example for the
16691 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
16692 </p></dd>
16693 </dl>
16694
16695 <a name="Examples-67"></a>
16696 <h4 class="subsection">28.71.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-67" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-67" aria-hidden="true">TOC</a></span></h4>
16697
16698 <ul>
16699 <li> Add paddings with the color &quot;violet&quot; to the input video. The output video
16700 size is 640x480, and the top-left corner of the input video is placed at
16701 column 0, row 40
16702 <div class="example">
16703 <pre class="example">pad=640:480:0:40:violet
16704 </pre></div>
16705
16706 <p>The example above is equivalent to the following command:
16707 </p><div class="example">
16708 <pre class="example">pad=width=640:height=480:x=0:y=40:color=violet
16709 </pre></div>
16710
16711 </li><li> Pad the input to get an output with dimensions increased by 3/2,
16712 and put the input video at the center of the padded area:
16713 <div class="example">
16714 <pre class="example">pad=&quot;3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2&quot;
16715 </pre></div>
16716
16717 </li><li> Pad the input to get a squared output with size equal to the maximum
16718 value between the input width and height, and put the input video at
16719 the center of the padded area:
16720 <div class="example">
16721 <pre class="example">pad=&quot;max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2&quot;
16722 </pre></div>
16723
16724 </li><li> Pad the input to get a final w/h ratio of 16:9:
16725 <div class="example">
16726 <pre class="example">pad=&quot;ih*16/9:ih:(ow-iw)/2:(oh-ih)/2&quot;
16727 </pre></div>
16728
16729 </li><li> In case of anamorphic video, in order to set the output display aspect
16730 correctly, it is necessary to use <var>sar</var> in the expression,
16731 according to the relation:
16732 <div class="example">
16733 <pre class="example">(ih * X / ih) * sar = output_dar
16734 X = output_dar / sar
16735 </pre></div>
16736
16737 <p>Thus the previous example needs to be modified to:
16738 </p><div class="example">
16739 <pre class="example">pad=&quot;ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2&quot;
16740 </pre></div>
16741
16742 </li><li> Double the output size and put the input video in the bottom-right
16743 corner of the output padded area:
16744 <div class="example">
16745 <pre class="example">pad=&quot;2*iw:2*ih:ow-iw:oh-ih&quot;
16746 </pre></div>
16747 </li></ul>
16748
16749 <a name="palettegen"></a><a name="palettegen-1"></a>
16750 <h3 class="section">28.72 palettegen<span class="pull-right"><a class="anchor hidden-xs" href="#palettegen-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-palettegen-1" aria-hidden="true">TOC</a></span></h3>
16751
16752 <p>Generate one palette for a whole video stream.
16753 </p>
16754 <p>It accepts the following options:
16755 </p>
16756 <dl compact="compact">
16757 <dt><samp>max_colors</samp></dt>
16758 <dd><p>Set the maximum number of colors to quantize in the palette.
16759 Note: the palette will still contain 256 colors; the unused palette entries
16760 will be black.
16761 </p>
16762 </dd>
16763 <dt><samp>reserve_transparent</samp></dt>
16764 <dd><p>Create a palette of 255 colors maximum and reserve the last one for
16765 transparency. Reserving the transparency color is useful for GIF optimization.
16766 If not set, the maximum of colors in the palette will be 256. You probably want
16767 to disable this option for a standalone image.
16768 Set by default.
16769 </p>
16770 </dd>
16771 <dt><samp>stats_mode</samp></dt>
16772 <dd><p>Set statistics mode.
16773 </p>
16774 <p>It accepts the following values:
16775 </p><dl compact="compact">
16776 <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
16777 <dd><p>Compute full frame histograms.
16778 </p></dd>
16779 <dt>&lsquo;<samp>diff</samp>&rsquo;</dt>
16780 <dd><p>Compute histograms only for the part that differs from previous frame. This
16781 might be relevant to give more importance to the moving part of your input if
16782 the background is static.
16783 </p></dd>
16784 </dl>
16785
16786 <p>Default value is <var>full</var>.
16787 </p></dd>
16788 </dl>
16789
16790 <p>The filter also exports the frame metadata <code>lavfi.color_quant_ratio</code>
16791 (<code>nb_color_in / nb_color_out</code>) which you can use to evaluate the degree of
16792 color quantization of the palette. This information is also visible at
16793 <var>info</var> logging level.
16794 </p>
16795 <a name="Examples-68"></a>
16796 <h4 class="subsection">28.72.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-68" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-68" aria-hidden="true">TOC</a></span></h4>
16797
16798 <ul>
16799 <li> Generate a representative palette of a given video using <code>ffmpeg</code>:
16800 <div class="example">
16801 <pre class="example">ffmpeg -i input.mkv -vf palettegen palette.png
16802 </pre></div>
16803 </li></ul>
16804
16805 <a name="paletteuse"></a>
16806 <h3 class="section">28.73 paletteuse<span class="pull-right"><a class="anchor hidden-xs" href="#paletteuse" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-paletteuse" aria-hidden="true">TOC</a></span></h3>
16807
16808 <p>Use a palette to downsample an input video stream.
16809 </p>
16810 <p>The filter takes two inputs: one video stream and a palette. The palette must
16811 be a 256 pixels image.
16812 </p>
16813 <p>It accepts the following options:
16814 </p>
16815 <dl compact="compact">
16816 <dt><samp>dither</samp></dt>
16817 <dd><p>Select dithering mode. Available algorithms are:
16818 </p><dl compact="compact">
16819 <dt>&lsquo;<samp>bayer</samp>&rsquo;</dt>
16820 <dd><p>Ordered 8x8 bayer dithering (deterministic)
16821 </p></dd>
16822 <dt>&lsquo;<samp>heckbert</samp>&rsquo;</dt>
16823 <dd><p>Dithering as defined by Paul Heckbert in 1982 (simple error diffusion).
16824 Note: this dithering is sometimes considered &quot;wrong&quot; and is included as a
16825 reference.
16826 </p></dd>
16827 <dt>&lsquo;<samp>floyd_steinberg</samp>&rsquo;</dt>
16828 <dd><p>Floyd and Steingberg dithering (error diffusion)
16829 </p></dd>
16830 <dt>&lsquo;<samp>sierra2</samp>&rsquo;</dt>
16831 <dd><p>Frankie Sierra dithering v2 (error diffusion)
16832 </p></dd>
16833 <dt>&lsquo;<samp>sierra2_4a</samp>&rsquo;</dt>
16834 <dd><p>Frankie Sierra dithering v2 &quot;Lite&quot; (error diffusion)
16835 </p></dd>
16836 </dl>
16837
16838 <p>Default is <var>sierra2_4a</var>.
16839 </p>
16840 </dd>
16841 <dt><samp>bayer_scale</samp></dt>
16842 <dd><p>When <var>bayer</var> dithering is selected, this option defines the scale of the
16843 pattern (how much the crosshatch pattern is visible). A low value means more
16844 visible pattern for less banding, and higher value means less visible pattern
16845 at the cost of more banding.
16846 </p>
16847 <p>The option must be an integer value in the range [0,5]. Default is <var>2</var>.
16848 </p>
16849 </dd>
16850 <dt><samp>diff_mode</samp></dt>
16851 <dd><p>If set, define the zone to process
16852 </p>
16853 <dl compact="compact">
16854 <dt>&lsquo;<samp>rectangle</samp>&rsquo;</dt>
16855 <dd><p>Only the changing rectangle will be reprocessed. This is similar to GIF
16856 cropping/offsetting compression mechanism. This option can be useful for speed
16857 if only a part of the image is changing, and has use cases such as limiting the
16858 scope of the error diffusal <samp>dither</samp> to the rectangle that bounds the
16859 moving scene (it leads to more deterministic output if the scene doesn&rsquo;t change
16860 much, and as a result less moving noise and better GIF compression).
16861 </p></dd>
16862 </dl>
16863
16864 <p>Default is <var>none</var>.
16865 </p></dd>
16866 </dl>
16867
16868 <a name="Examples-69"></a>
16869 <h4 class="subsection">28.73.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-69" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-69" aria-hidden="true">TOC</a></span></h4>
16870
16871 <ul>
16872 <li> Use a palette (generated for example with <a href="#palettegen">palettegen</a>) to encode a GIF
16873 using <code>ffmpeg</code>:
16874 <div class="example">
16875 <pre class="example">ffmpeg -i input.mkv -i palette.png -lavfi paletteuse output.gif
16876 </pre></div>
16877 </li></ul>
16878
16879 <a name="perspective"></a>
16880 <h3 class="section">28.74 perspective<span class="pull-right"><a class="anchor hidden-xs" href="#perspective" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-perspective" aria-hidden="true">TOC</a></span></h3>
16881
16882 <p>Correct perspective of video not recorded perpendicular to the screen.
16883 </p>
16884 <p>A description of the accepted parameters follows.
16885 </p>
16886 <dl compact="compact">
16887 <dt><samp>x0</samp></dt>
16888 <dt><samp>y0</samp></dt>
16889 <dt><samp>x1</samp></dt>
16890 <dt><samp>y1</samp></dt>
16891 <dt><samp>x2</samp></dt>
16892 <dt><samp>y2</samp></dt>
16893 <dt><samp>x3</samp></dt>
16894 <dt><samp>y3</samp></dt>
16895 <dd><p>Set coordinates expression for top left, top right, bottom left and bottom right corners.
16896 Default values are <code>0:0:W:0:0:H:W:H</code> with which perspective will remain unchanged.
16897 If the <code>sense</code> option is set to <code>source</code>, then the specified points will be sent
16898 to the corners of the destination. If the <code>sense</code> option is set to <code>destination</code>,
16899 then the corners of the source will be sent to the specified coordinates.
16900 </p>
16901 <p>The expressions can use the following variables:
16902 </p>
16903 <dl compact="compact">
16904 <dt><samp>W</samp></dt>
16905 <dt><samp>H</samp></dt>
16906 <dd><p>the width and height of video frame.
16907 </p></dd>
16908 </dl>
16909
16910 </dd>
16911 <dt><samp>interpolation</samp></dt>
16912 <dd><p>Set interpolation for perspective correction.
16913 </p>
16914 <p>It accepts the following values:
16915 </p><dl compact="compact">
16916 <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
16917 <dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
16918 </dl>
16919
16920 <p>Default value is &lsquo;<samp>linear</samp>&rsquo;.
16921 </p>
16922 </dd>
16923 <dt><samp>sense</samp></dt>
16924 <dd><p>Set interpretation of coordinate options.
16925 </p>
16926 <p>It accepts the following values:
16927 </p><dl compact="compact">
16928 <dt>&lsquo;<samp>0, source</samp>&rsquo;</dt>
16929 <dd>
16930 <p>Send point in the source specified by the given coordinates to
16931 the corners of the destination.
16932 </p>
16933 </dd>
16934 <dt>&lsquo;<samp>1, destination</samp>&rsquo;</dt>
16935 <dd>
16936 <p>Send the corners of the source to the point in the destination specified
16937 by the given coordinates.
16938 </p>
16939 <p>Default value is &lsquo;<samp>source</samp>&rsquo;.
16940 </p></dd>
16941 </dl>
16942 </dd>
16943 </dl>
16944
16945 <a name="phase"></a>
16946 <h3 class="section">28.75 phase<span class="pull-right"><a class="anchor hidden-xs" href="#phase" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-phase" aria-hidden="true">TOC</a></span></h3>
16947
16948 <p>Delay interlaced video by one field time so that the field order changes.
16949 </p>
16950 <p>The intended use is to fix PAL movies that have been captured with the
16951 opposite field order to the film-to-video transfer.
16952 </p>
16953 <p>A description of the accepted parameters follows.
16954 </p>
16955 <dl compact="compact">
16956 <dt><samp>mode</samp></dt>
16957 <dd><p>Set phase mode.
16958 </p>
16959 <p>It accepts the following values:
16960 </p><dl compact="compact">
16961 <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
16962 <dd><p>Capture field order top-first, transfer bottom-first.
16963 Filter will delay the bottom field.
16964 </p>
16965 </dd>
16966 <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
16967 <dd><p>Capture field order bottom-first, transfer top-first.
16968 Filter will delay the top field.
16969 </p>
16970 </dd>
16971 <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
16972 <dd><p>Capture and transfer with the same field order. This mode only exists
16973 for the documentation of the other options to refer to, but if you
16974 actually select it, the filter will faithfully do nothing.
16975 </p>
16976 </dd>
16977 <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
16978 <dd><p>Capture field order determined automatically by field flags, transfer
16979 opposite.
16980 Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>b</samp>&rsquo; modes on a frame by frame
16981 basis using field flags. If no field information is available,
16982 then this works just like &lsquo;<samp>u</samp>&rsquo;.
16983 </p>
16984 </dd>
16985 <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
16986 <dd><p>Capture unknown or varying, transfer opposite.
16987 Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>b</samp>&rsquo; on a frame by frame basis by
16988 analyzing the images and selecting the alternative that produces best
16989 match between the fields.
16990 </p>
16991 </dd>
16992 <dt>&lsquo;<samp>T</samp>&rsquo;</dt>
16993 <dd><p>Capture top-first, transfer unknown or varying.
16994 Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis.
16995 </p>
16996 </dd>
16997 <dt>&lsquo;<samp>B</samp>&rsquo;</dt>
16998 <dd><p>Capture bottom-first, transfer unknown or varying.
16999 Filter selects among &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis.
17000 </p>
17001 </dd>
17002 <dt>&lsquo;<samp>A</samp>&rsquo;</dt>
17003 <dd><p>Capture determined by field flags, transfer unknown or varying.
17004 Filter selects among &lsquo;<samp>t</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using field flags and
17005 image analysis. If no field information is available, then this works just
17006 like &lsquo;<samp>U</samp>&rsquo;. This is the default mode.
17007 </p>
17008 </dd>
17009 <dt>&lsquo;<samp>U</samp>&rsquo;</dt>
17010 <dd><p>Both capture and transfer unknown or varying.
17011 Filter selects among &lsquo;<samp>t</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis only.
17012 </p></dd>
17013 </dl>
17014 </dd>
17015 </dl>
17016
17017 <a name="pixdesctest"></a>
17018 <h3 class="section">28.76 pixdesctest<span class="pull-right"><a class="anchor hidden-xs" href="#pixdesctest" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pixdesctest" aria-hidden="true">TOC</a></span></h3>
17019
17020 <p>Pixel format descriptor test filter, mainly useful for internal
17021 testing. The output video should be equal to the input video.
17022 </p>
17023 <p>For example:
17024 </p><div class="example">
17025 <pre class="example">format=monow, pixdesctest
17026 </pre></div>
17027
17028 <p>can be used to test the monowhite pixel format descriptor definition.
17029 </p>
17030 <a name="pp"></a>
17031 <h3 class="section">28.77 pp<span class="pull-right"><a class="anchor hidden-xs" href="#pp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pp" aria-hidden="true">TOC</a></span></h3>
17032
17033 <p>Enable the specified chain of postprocessing subfilters using libpostproc. This
17034 library should be automatically selected with a GPL build (<code>--enable-gpl</code>).
17035 Subfilters must be separated by &rsquo;/&rsquo; and can be disabled by prepending a &rsquo;-&rsquo;.
17036 Each subfilter and some options have a short and a long name that can be used
17037 interchangeably, i.e. dr/dering are the same.
17038 </p>
17039 <p>The filters accept the following options:
17040 </p>
17041 <dl compact="compact">
17042 <dt><samp>subfilters</samp></dt>
17043 <dd><p>Set postprocessing subfilters string.
17044 </p></dd>
17045 </dl>
17046
17047 <p>All subfilters share common options to determine their scope:
17048 </p>
17049 <dl compact="compact">
17050 <dt><samp>a/autoq</samp></dt>
17051 <dd><p>Honor the quality commands for this subfilter.
17052 </p>
17053 </dd>
17054 <dt><samp>c/chrom</samp></dt>
17055 <dd><p>Do chrominance filtering, too (default).
17056 </p>
17057 </dd>
17058 <dt><samp>y/nochrom</samp></dt>
17059 <dd><p>Do luminance filtering only (no chrominance).
17060 </p>
17061 </dd>
17062 <dt><samp>n/noluma</samp></dt>
17063 <dd><p>Do chrominance filtering only (no luminance).
17064 </p></dd>
17065 </dl>
17066
17067 <p>These options can be appended after the subfilter name, separated by a &rsquo;|&rsquo;.
17068 </p>
17069 <p>Available subfilters are:
17070 </p>
17071 <dl compact="compact">
17072 <dt><samp>hb/hdeblock[|difference[|flatness]]</samp></dt>
17073 <dd><p>Horizontal deblocking filter
17074 </p><dl compact="compact">
17075 <dt><samp>difference</samp></dt>
17076 <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
17077 </p></dd>
17078 <dt><samp>flatness</samp></dt>
17079 <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
17080 </p></dd>
17081 </dl>
17082
17083 </dd>
17084 <dt><samp>vb/vdeblock[|difference[|flatness]]</samp></dt>
17085 <dd><p>Vertical deblocking filter
17086 </p><dl compact="compact">
17087 <dt><samp>difference</samp></dt>
17088 <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
17089 </p></dd>
17090 <dt><samp>flatness</samp></dt>
17091 <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
17092 </p></dd>
17093 </dl>
17094
17095 </dd>
17096 <dt><samp>ha/hadeblock[|difference[|flatness]]</samp></dt>
17097 <dd><p>Accurate horizontal deblocking filter
17098 </p><dl compact="compact">
17099 <dt><samp>difference</samp></dt>
17100 <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
17101 </p></dd>
17102 <dt><samp>flatness</samp></dt>
17103 <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
17104 </p></dd>
17105 </dl>
17106
17107 </dd>
17108 <dt><samp>va/vadeblock[|difference[|flatness]]</samp></dt>
17109 <dd><p>Accurate vertical deblocking filter
17110 </p><dl compact="compact">
17111 <dt><samp>difference</samp></dt>
17112 <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
17113 </p></dd>
17114 <dt><samp>flatness</samp></dt>
17115 <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
17116 </p></dd>
17117 </dl>
17118 </dd>
17119 </dl>
17120
17121 <p>The horizontal and vertical deblocking filters share the difference and
17122 flatness values so you cannot set different horizontal and vertical
17123 thresholds.
17124 </p>
17125 <dl compact="compact">
17126 <dt><samp>h1/x1hdeblock</samp></dt>
17127 <dd><p>Experimental horizontal deblocking filter
17128 </p>
17129 </dd>
17130 <dt><samp>v1/x1vdeblock</samp></dt>
17131 <dd><p>Experimental vertical deblocking filter
17132 </p>
17133 </dd>
17134 <dt><samp>dr/dering</samp></dt>
17135 <dd><p>Deringing filter
17136 </p>
17137 </dd>
17138 <dt><samp>tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer</samp></dt>
17139 <dd><dl compact="compact">
17140 <dt><samp>threshold1</samp></dt>
17141 <dd><p>larger -&gt; stronger filtering
17142 </p></dd>
17143 <dt><samp>threshold2</samp></dt>
17144 <dd><p>larger -&gt; stronger filtering
17145 </p></dd>
17146 <dt><samp>threshold3</samp></dt>
17147 <dd><p>larger -&gt; stronger filtering
17148 </p></dd>
17149 </dl>
17150
17151 </dd>
17152 <dt><samp>al/autolevels[:f/fullyrange], automatic brightness / contrast correction</samp></dt>
17153 <dd><dl compact="compact">
17154 <dt><samp>f/fullyrange</samp></dt>
17155 <dd><p>Stretch luminance to <code>0-255</code>.
17156 </p></dd>
17157 </dl>
17158
17159 </dd>
17160 <dt><samp>lb/linblenddeint</samp></dt>
17161 <dd><p>Linear blend deinterlacing filter that deinterlaces the given block by
17162 filtering all lines with a <code>(1 2 1)</code> filter.
17163 </p>
17164 </dd>
17165 <dt><samp>li/linipoldeint</samp></dt>
17166 <dd><p>Linear interpolating deinterlacing filter that deinterlaces the given block by
17167 linearly interpolating every second line.
17168 </p>
17169 </dd>
17170 <dt><samp>ci/cubicipoldeint</samp></dt>
17171 <dd><p>Cubic interpolating deinterlacing filter deinterlaces the given block by
17172 cubically interpolating every second line.
17173 </p>
17174 </dd>
17175 <dt><samp>md/mediandeint</samp></dt>
17176 <dd><p>Median deinterlacing filter that deinterlaces the given block by applying a
17177 median filter to every second line.
17178 </p>
17179 </dd>
17180 <dt><samp>fd/ffmpegdeint</samp></dt>
17181 <dd><p>FFmpeg deinterlacing filter that deinterlaces the given block by filtering every
17182 second line with a <code>(-1 4 2 4 -1)</code> filter.
17183 </p>
17184 </dd>
17185 <dt><samp>l5/lowpass5</samp></dt>
17186 <dd><p>Vertically applied FIR lowpass deinterlacing filter that deinterlaces the given
17187 block by filtering all lines with a <code>(-1 2 6 2 -1)</code> filter.
17188 </p>
17189 </dd>
17190 <dt><samp>fq/forceQuant[|quantizer]</samp></dt>
17191 <dd><p>Overrides the quantizer table from the input with the constant quantizer you
17192 specify.
17193 </p><dl compact="compact">
17194 <dt><samp>quantizer</samp></dt>
17195 <dd><p>Quantizer to use
17196 </p></dd>
17197 </dl>
17198
17199 </dd>
17200 <dt><samp>de/default</samp></dt>
17201 <dd><p>Default pp filter combination (<code>hb|a,vb|a,dr|a</code>)
17202 </p>
17203 </dd>
17204 <dt><samp>fa/fast</samp></dt>
17205 <dd><p>Fast pp filter combination (<code>h1|a,v1|a,dr|a</code>)
17206 </p>
17207 </dd>
17208 <dt><samp>ac</samp></dt>
17209 <dd><p>High quality pp filter combination (<code>ha|a|128|7,va|a,dr|a</code>)
17210 </p></dd>
17211 </dl>
17212
17213 <a name="Examples-70"></a>
17214 <h4 class="subsection">28.77.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-70" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-70" aria-hidden="true">TOC</a></span></h4>
17215
17216 <ul>
17217 <li> Apply horizontal and vertical deblocking, deringing and automatic
17218 brightness/contrast:
17219 <div class="example">
17220 <pre class="example">pp=hb/vb/dr/al
17221 </pre></div>
17222
17223 </li><li> Apply default filters without brightness/contrast correction:
17224 <div class="example">
17225 <pre class="example">pp=de/-al
17226 </pre></div>
17227
17228 </li><li> Apply default filters and temporal denoiser:
17229 <div class="example">
17230 <pre class="example">pp=default/tmpnoise|1|2|3
17231 </pre></div>
17232
17233 </li><li> Apply deblocking on luminance only, and switch vertical deblocking on or off
17234 automatically depending on available CPU time:
17235 <div class="example">
17236 <pre class="example">pp=hb|y/vb|a
17237 </pre></div>
17238 </li></ul>
17239
17240 <a name="pp7"></a>
17241 <h3 class="section">28.78 pp7<span class="pull-right"><a class="anchor hidden-xs" href="#pp7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pp7" aria-hidden="true">TOC</a></span></h3>
17242 <p>Apply Postprocessing filter 7. It is variant of the <a href="#spp">spp</a> filter,
17243 similar to spp = 6 with 7 point DCT, where only the center sample is
17244 used after IDCT.
17245 </p>
17246 <p>The filter accepts the following options:
17247 </p>
17248 <dl compact="compact">
17249 <dt><samp>qp</samp></dt>
17250 <dd><p>Force a constant quantization parameter. It accepts an integer in range
17251 0 to 63. If not set, the filter will use the QP from the video stream
17252 (if available).
17253 </p>
17254 </dd>
17255 <dt><samp>mode</samp></dt>
17256 <dd><p>Set thresholding mode. Available modes are:
17257 </p>
17258 <dl compact="compact">
17259 <dt>&lsquo;<samp>hard</samp>&rsquo;</dt>
17260 <dd><p>Set hard thresholding.
17261 </p></dd>
17262 <dt>&lsquo;<samp>soft</samp>&rsquo;</dt>
17263 <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
17264 </p></dd>
17265 <dt>&lsquo;<samp>medium</samp>&rsquo;</dt>
17266 <dd><p>Set medium thresholding (good results, default).
17267 </p></dd>
17268 </dl>
17269 </dd>
17270 </dl>
17271
17272 <a name="psnr"></a>
17273 <h3 class="section">28.79 psnr<span class="pull-right"><a class="anchor hidden-xs" href="#psnr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-psnr" aria-hidden="true">TOC</a></span></h3>
17274
17275 <p>Obtain the average, maximum and minimum PSNR (Peak Signal to Noise
17276 Ratio) between two input videos.
17277 </p>
17278 <p>This filter takes in input two input videos, the first input is
17279 considered the &quot;main&quot; source and is passed unchanged to the
17280 output. The second input is used as a &quot;reference&quot; video for computing
17281 the PSNR.
17282 </p>
17283 <p>Both video inputs must have the same resolution and pixel format for
17284 this filter to work correctly. Also it assumes that both inputs
17285 have the same number of frames, which are compared one by one.
17286 </p>
17287 <p>The obtained average PSNR is printed through the logging system.
17288 </p>
17289 <p>The filter stores the accumulated MSE (mean squared error) of each
17290 frame, and at the end of the processing it is averaged across all frames
17291 equally, and the following formula is applied to obtain the PSNR:
17292 </p>
17293 <div class="example">
17294 <pre class="example">PSNR = 10*log10(MAX^2/MSE)
17295 </pre></div>
17296
17297 <p>Where MAX is the average of the maximum values of each component of the
17298 image.
17299 </p>
17300 <p>The description of the accepted parameters follows.
17301 </p>
17302 <dl compact="compact">
17303 <dt><samp>stats_file, f</samp></dt>
17304 <dd><p>If specified the filter will use the named file to save the PSNR of
17305 each individual frame.
17306 </p></dd>
17307 </dl>
17308
17309 <p>The file printed if <var>stats_file</var> is selected, contains a sequence of
17310 key/value pairs of the form <var>key</var>:<var>value</var> for each compared
17311 couple of frames.
17312 </p>
17313 <p>A description of each shown parameter follows:
17314 </p>
17315 <dl compact="compact">
17316 <dt><samp>n</samp></dt>
17317 <dd><p>sequential number of the input frame, starting from 1
17318 </p>
17319 </dd>
17320 <dt><samp>mse_avg</samp></dt>
17321 <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
17322 frames, averaged over all the image components.
17323 </p>
17324 </dd>
17325 <dt><samp>mse_y, mse_u, mse_v, mse_r, mse_g, mse_g, mse_a</samp></dt>
17326 <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
17327 frames for the component specified by the suffix.
17328 </p>
17329 </dd>
17330 <dt><samp>psnr_y, psnr_u, psnr_v, psnr_r, psnr_g, psnr_b, psnr_a</samp></dt>
17331 <dd><p>Peak Signal to Noise ratio of the compared frames for the component
17332 specified by the suffix.
17333 </p></dd>
17334 </dl>
17335
17336 <p>For example:
17337 </p><div class="example">
17338 <pre class="example">movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
17339 [main][ref] psnr=&quot;stats_file=stats.log&quot; [out]
17340 </pre></div>
17341
17342 <p>On this example the input file being processed is compared with the
17343 reference file <samp>ref_movie.mpg</samp>. The PSNR of each individual frame
17344 is stored in <samp>stats.log</samp>.
17345 </p>
17346 <a name="pullup"></a><a name="pullup-1"></a>
17347 <h3 class="section">28.80 pullup<span class="pull-right"><a class="anchor hidden-xs" href="#pullup-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pullup-1" aria-hidden="true">TOC</a></span></h3>
17348
17349 <p>Pulldown reversal (inverse telecine) filter, capable of handling mixed
17350 hard-telecine, 24000/1001 fps progressive, and 30000/1001 fps progressive
17351 content.
17352 </p>
17353 <p>The pullup filter is designed to take advantage of future context in making
17354 its decisions. This filter is stateless in the sense that it does not lock
17355 onto a pattern to follow, but it instead looks forward to the following
17356 fields in order to identify matches and rebuild progressive frames.
17357 </p>
17358 <p>To produce content with an even framerate, insert the fps filter after
17359 pullup, use <code>fps=24000/1001</code> if the input frame rate is 29.97fps,
17360 <code>fps=24</code> for 30fps and the (rare) telecined 25fps input.
17361 </p>
17362 <p>The filter accepts the following options:
17363 </p>
17364 <dl compact="compact">
17365 <dt><samp>jl</samp></dt>
17366 <dt><samp>jr</samp></dt>
17367 <dt><samp>jt</samp></dt>
17368 <dt><samp>jb</samp></dt>
17369 <dd><p>These options set the amount of &quot;junk&quot; to ignore at the left, right, top, and
17370 bottom of the image, respectively. Left and right are in units of 8 pixels,
17371 while top and bottom are in units of 2 lines.
17372 The default is 8 pixels on each side.
17373 </p>
17374 </dd>
17375 <dt><samp>sb</samp></dt>
17376 <dd><p>Set the strict breaks. Setting this option to 1 will reduce the chances of
17377 filter generating an occasional mismatched frame, but it may also cause an
17378 excessive number of frames to be dropped during high motion sequences.
17379 Conversely, setting it to -1 will make filter match fields more easily.
17380 This may help processing of video where there is slight blurring between
17381 the fields, but may also cause there to be interlaced frames in the output.
17382 Default value is <code>0</code>.
17383 </p>
17384 </dd>
17385 <dt><samp>mp</samp></dt>
17386 <dd><p>Set the metric plane to use. It accepts the following values:
17387 </p><dl compact="compact">
17388 <dt>&lsquo;<samp>l</samp>&rsquo;</dt>
17389 <dd><p>Use luma plane.
17390 </p>
17391 </dd>
17392 <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
17393 <dd><p>Use chroma blue plane.
17394 </p>
17395 </dd>
17396 <dt>&lsquo;<samp>v</samp>&rsquo;</dt>
17397 <dd><p>Use chroma red plane.
17398 </p></dd>
17399 </dl>
17400
17401 <p>This option may be set to use chroma plane instead of the default luma plane
17402 for doing filter&rsquo;s computations. This may improve accuracy on very clean
17403 source material, but more likely will decrease accuracy, especially if there
17404 is chroma noise (rainbow effect) or any grayscale video.
17405 The main purpose of setting <samp>mp</samp> to a chroma plane is to reduce CPU
17406 load and make pullup usable in realtime on slow machines.
17407 </p></dd>
17408 </dl>
17409
17410 <p>For best results (without duplicated frames in the output file) it is
17411 necessary to change the output frame rate. For example, to inverse
17412 telecine NTSC input:
17413 </p><div class="example">
17414 <pre class="example">ffmpeg -i input -vf pullup -r 24000/1001 ...
17415 </pre></div>
17416
17417 <a name="qp"></a>
17418 <h3 class="section">28.81 qp<span class="pull-right"><a class="anchor hidden-xs" href="#qp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-qp" aria-hidden="true">TOC</a></span></h3>
17419
17420 <p>Change video quantization parameters (QP).
17421 </p>
17422 <p>The filter accepts the following option:
17423 </p>
17424 <dl compact="compact">
17425 <dt><samp>qp</samp></dt>
17426 <dd><p>Set expression for quantization parameter.
17427 </p></dd>
17428 </dl>
17429
17430 <p>The expression is evaluated through the eval API and can contain, among others,
17431 the following constants:
17432 </p>
17433 <dl compact="compact">
17434 <dt><var>known</var></dt>
17435 <dd><p>1 if index is not 129, 0 otherwise.
17436 </p>
17437 </dd>
17438 <dt><var>qp</var></dt>
17439 <dd><p>Sequentional index starting from -129 to 128.
17440 </p></dd>
17441 </dl>
17442
17443 <a name="Examples-71"></a>
17444 <h4 class="subsection">28.81.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-71" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-71" aria-hidden="true">TOC</a></span></h4>
17445
17446 <ul>
17447 <li> Some equation like:
17448 <div class="example">
17449 <pre class="example">qp=2+2*sin(PI*qp)
17450 </pre></div>
17451 </li></ul>
17452
17453 <a name="removelogo"></a>
17454 <h3 class="section">28.82 removelogo<span class="pull-right"><a class="anchor hidden-xs" href="#removelogo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-removelogo" aria-hidden="true">TOC</a></span></h3>
17455
17456 <p>Suppress a TV station logo, using an image file to determine which
17457 pixels comprise the logo. It works by filling in the pixels that
17458 comprise the logo with neighboring pixels.
17459 </p>
17460 <p>The filter accepts the following options:
17461 </p>
17462 <dl compact="compact">
17463 <dt><samp>filename, f</samp></dt>
17464 <dd><p>Set the filter bitmap file, which can be any image format supported by
17465 libavformat. The width and height of the image file must match those of the
17466 video stream being processed.
17467 </p></dd>
17468 </dl>
17469
17470 <p>Pixels in the provided bitmap image with a value of zero are not
17471 considered part of the logo, non-zero pixels are considered part of
17472 the logo. If you use white (255) for the logo and black (0) for the
17473 rest, you will be safe. For making the filter bitmap, it is
17474 recommended to take a screen capture of a black frame with the logo
17475 visible, and then using a threshold filter followed by the erode
17476 filter once or twice.
17477 </p>
17478 <p>If needed, little splotches can be fixed manually. Remember that if
17479 logo pixels are not covered, the filter quality will be much
17480 reduced. Marking too many pixels as part of the logo does not hurt as
17481 much, but it will increase the amount of blurring needed to cover over
17482 the image and will destroy more information than necessary, and extra
17483 pixels will slow things down on a large logo.
17484 </p>
17485 <a name="repeatfields"></a>
17486 <h3 class="section">28.83 repeatfields<span class="pull-right"><a class="anchor hidden-xs" href="#repeatfields" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-repeatfields" aria-hidden="true">TOC</a></span></h3>
17487
17488 <p>This filter uses the repeat_field flag from the Video ES headers and hard repeats
17489 fields based on its value.
17490 </p>
17491 <a name="rotate"></a>
17492 <h3 class="section">28.84 rotate<span class="pull-right"><a class="anchor hidden-xs" href="#rotate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rotate" aria-hidden="true">TOC</a></span></h3>
17493
17494 <p>Rotate video by an arbitrary angle expressed in radians.
17495 </p>
17496 <p>The filter accepts the following options:
17497 </p>
17498 <p>A description of the optional parameters follows.
17499 </p><dl compact="compact">
17500 <dt><samp>angle, a</samp></dt>
17501 <dd><p>Set an expression for the angle by which to rotate the input video
17502 clockwise, expressed as a number of radians. A negative value will
17503 result in a counter-clockwise rotation. By default it is set to &quot;0&quot;.
17504 </p>
17505 <p>This expression is evaluated for each frame.
17506 </p>
17507 </dd>
17508 <dt><samp>out_w, ow</samp></dt>
17509 <dd><p>Set the output width expression, default value is &quot;iw&quot;.
17510 This expression is evaluated just once during configuration.
17511 </p>
17512 </dd>
17513 <dt><samp>out_h, oh</samp></dt>
17514 <dd><p>Set the output height expression, default value is &quot;ih&quot;.
17515 This expression is evaluated just once during configuration.
17516 </p>
17517 </dd>
17518 <dt><samp>bilinear</samp></dt>
17519 <dd><p>Enable bilinear interpolation if set to 1, a value of 0 disables
17520 it. Default value is 1.
17521 </p>
17522 </dd>
17523 <dt><samp>fillcolor, c</samp></dt>
17524 <dd><p>Set the color used to fill the output area not covered by the rotated
17525 image. For the general syntax of this option, check the &quot;Color&quot; section in the
17526 ffmpeg-utils manual. If the special value &quot;none&quot; is selected then no
17527 background is printed (useful for example if the background is never shown).
17528 </p>
17529 <p>Default value is &quot;black&quot;.
17530 </p></dd>
17531 </dl>
17532
17533 <p>The expressions for the angle and the output size can contain the
17534 following constants and functions:
17535 </p>
17536 <dl compact="compact">
17537 <dt><samp>n</samp></dt>
17538 <dd><p>sequential number of the input frame, starting from 0. It is always NAN
17539 before the first frame is filtered.
17540 </p>
17541 </dd>
17542 <dt><samp>t</samp></dt>
17543 <dd><p>time in seconds of the input frame, it is set to 0 when the filter is
17544 configured. It is always NAN before the first frame is filtered.
17545 </p>
17546 </dd>
17547 <dt><samp>hsub</samp></dt>
17548 <dt><samp>vsub</samp></dt>
17549 <dd><p>horizontal and vertical chroma subsample values. For example for the
17550 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
17551 </p>
17552 </dd>
17553 <dt><samp>in_w, iw</samp></dt>
17554 <dt><samp>in_h, ih</samp></dt>
17555 <dd><p>the input video width and height
17556 </p>
17557 </dd>
17558 <dt><samp>out_w, ow</samp></dt>
17559 <dt><samp>out_h, oh</samp></dt>
17560 <dd><p>the output width and height, that is the size of the padded area as
17561 specified by the <var>width</var> and <var>height</var> expressions
17562 </p>
17563 </dd>
17564 <dt><samp>rotw(a)</samp></dt>
17565 <dt><samp>roth(a)</samp></dt>
17566 <dd><p>the minimal width/height required for completely containing the input
17567 video rotated by <var>a</var> radians.
17568 </p>
17569 <p>These are only available when computing the <samp>out_w</samp> and
17570 <samp>out_h</samp> expressions.
17571 </p></dd>
17572 </dl>
17573
17574 <a name="Examples-72"></a>
17575 <h4 class="subsection">28.84.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-72" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-72" aria-hidden="true">TOC</a></span></h4>
17576
17577 <ul>
17578 <li> Rotate the input by PI/6 radians clockwise:
17579 <div class="example">
17580 <pre class="example">rotate=PI/6
17581 </pre></div>
17582
17583 </li><li> Rotate the input by PI/6 radians counter-clockwise:
17584 <div class="example">
17585 <pre class="example">rotate=-PI/6
17586 </pre></div>
17587
17588 </li><li> Rotate the input by 45 degrees clockwise:
17589 <div class="example">
17590 <pre class="example">rotate=45*PI/180
17591 </pre></div>
17592
17593 </li><li> Apply a constant rotation with period T, starting from an angle of PI/3:
17594 <div class="example">
17595 <pre class="example">rotate=PI/3+2*PI*t/T
17596 </pre></div>
17597
17598 </li><li> Make the input video rotation oscillating with a period of T
17599 seconds and an amplitude of A radians:
17600 <div class="example">
17601 <pre class="example">rotate=A*sin(2*PI/T*t)
17602 </pre></div>
17603
17604 </li><li> Rotate the video, output size is chosen so that the whole rotating
17605 input video is always completely contained in the output:
17606 <div class="example">
17607 <pre class="example">rotate='2*PI*t:ow=hypot(iw,ih):oh=ow'
17608 </pre></div>
17609
17610 </li><li> Rotate the video, reduce the output size so that no background is ever
17611 shown:
17612 <div class="example">
17613 <pre class="example">rotate=2*PI*t:ow='min(iw,ih)/sqrt(2)':oh=ow:c=none
17614 </pre></div>
17615 </li></ul>
17616
17617 <a name="Commands-5"></a>
17618 <h4 class="subsection">28.84.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-5" aria-hidden="true">TOC</a></span></h4>
17619
17620 <p>The filter supports the following commands:
17621 </p>
17622 <dl compact="compact">
17623 <dt><samp>a, angle</samp></dt>
17624 <dd><p>Set the angle expression.
17625 The command accepts the same syntax of the corresponding option.
17626 </p>
17627 <p>If the specified expression is not valid, it is kept at its current
17628 value.
17629 </p></dd>
17630 </dl>
17631
17632 <a name="sab"></a>
17633 <h3 class="section">28.85 sab<span class="pull-right"><a class="anchor hidden-xs" href="#sab" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sab" aria-hidden="true">TOC</a></span></h3>
17634
17635 <p>Apply Shape Adaptive Blur.
17636 </p>
17637 <p>The filter accepts the following options:
17638 </p>
17639 <dl compact="compact">
17640 <dt><samp>luma_radius, lr</samp></dt>
17641 <dd><p>Set luma blur filter strength, must be a value in range 0.1-4.0, default
17642 value is 1.0. A greater value will result in a more blurred image, and
17643 in slower processing.
17644 </p>
17645 </dd>
17646 <dt><samp>luma_pre_filter_radius, lpfr</samp></dt>
17647 <dd><p>Set luma pre-filter radius, must be a value in the 0.1-2.0 range, default
17648 value is 1.0.
17649 </p>
17650 </dd>
17651 <dt><samp>luma_strength, ls</samp></dt>
17652 <dd><p>Set luma maximum difference between pixels to still be considered, must
17653 be a value in the 0.1-100.0 range, default value is 1.0.
17654 </p>
17655 </dd>
17656 <dt><samp>chroma_radius, cr</samp></dt>
17657 <dd><p>Set chroma blur filter strength, must be a value in range 0.1-4.0. A
17658 greater value will result in a more blurred image, and in slower
17659 processing.
17660 </p>
17661 </dd>
17662 <dt><samp>chroma_pre_filter_radius, cpfr</samp></dt>
17663 <dd><p>Set chroma pre-filter radius, must be a value in the 0.1-2.0 range.
17664 </p>
17665 </dd>
17666 <dt><samp>chroma_strength, cs</samp></dt>
17667 <dd><p>Set chroma maximum difference between pixels to still be considered,
17668 must be a value in the 0.1-100.0 range.
17669 </p></dd>
17670 </dl>
17671
17672 <p>Each chroma option value, if not explicitly specified, is set to the
17673 corresponding luma option value.
17674 </p>
17675 <a name="scale"></a><a name="scale-1"></a>
17676 <h3 class="section">28.86 scale<span class="pull-right"><a class="anchor hidden-xs" href="#scale-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scale-1" aria-hidden="true">TOC</a></span></h3>
17677
17678 <p>Scale (resize) the input video, using the libswscale library.
17679 </p>
17680 <p>The scale filter forces the output display aspect ratio to be the same
17681 of the input, by changing the output sample aspect ratio.
17682 </p>
17683 <p>If the input image format is different from the format requested by
17684 the next filter, the scale filter will convert the input to the
17685 requested format.
17686 </p>
17687 <a name="Options-18"></a>
17688 <h4 class="subsection">28.86.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-18" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-18" aria-hidden="true">TOC</a></span></h4>
17689 <p>The filter accepts the following options, or any of the options
17690 supported by the libswscale scaler.
17691 </p>
17692 <p>See <a href="ffmpeg-scaler.html#scaler_005foptions">(ffmpeg-scaler)the ffmpeg-scaler manual</a> for
17693 the complete list of scaler options.
17694 </p>
17695 <dl compact="compact">
17696 <dt><samp>width, w</samp></dt>
17697 <dt><samp>height, h</samp></dt>
17698 <dd><p>Set the output video dimension expression. Default value is the input
17699 dimension.
17700 </p>
17701 <p>If the value is 0, the input width is used for the output.
17702 </p>
17703 <p>If one of the values is -1, the scale filter will use a value that
17704 maintains the aspect ratio of the input image, calculated from the
17705 other specified dimension. If both of them are -1, the input size is
17706 used
17707 </p>
17708 <p>If one of the values is -n with n &gt; 1, the scale filter will also use a value
17709 that maintains the aspect ratio of the input image, calculated from the other
17710 specified dimension. After that it will, however, make sure that the calculated
17711 dimension is divisible by n and adjust the value if necessary.
17712 </p>
17713 <p>See below for the list of accepted constants for use in the dimension
17714 expression.
17715 </p>
17716 </dd>
17717 <dt><samp>interl</samp></dt>
17718 <dd><p>Set the interlacing mode. It accepts the following values:
17719 </p>
17720 <dl compact="compact">
17721 <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
17722 <dd><p>Force interlaced aware scaling.
17723 </p>
17724 </dd>
17725 <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
17726 <dd><p>Do not apply interlaced scaling.
17727 </p>
17728 </dd>
17729 <dt>&lsquo;<samp>-1</samp>&rsquo;</dt>
17730 <dd><p>Select interlaced aware scaling depending on whether the source frames
17731 are flagged as interlaced or not.
17732 </p></dd>
17733 </dl>
17734
17735 <p>Default value is &lsquo;<samp>0</samp>&rsquo;.
17736 </p>
17737 </dd>
17738 <dt><samp>flags</samp></dt>
17739 <dd><p>Set libswscale scaling flags. See
17740 <a href="ffmpeg-scaler.html#sws_005fflags">(ffmpeg-scaler)the ffmpeg-scaler manual</a> for the
17741 complete list of values. If not explicitly specified the filter applies
17742 the default flags.
17743 </p>
17744 </dd>
17745 <dt><samp>size, s</samp></dt>
17746 <dd><p>Set the video size. For the syntax of this option, check the
17747 <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
17748 </p>
17749 </dd>
17750 <dt><samp>in_color_matrix</samp></dt>
17751 <dt><samp>out_color_matrix</samp></dt>
17752 <dd><p>Set in/output YCbCr color space type.
17753 </p>
17754 <p>This allows the autodetected value to be overridden as well as allows forcing
17755 a specific value used for the output and encoder.
17756 </p>
17757 <p>If not specified, the color space type depends on the pixel format.
17758 </p>
17759 <p>Possible values:
17760 </p>
17761 <dl compact="compact">
17762 <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
17763 <dd><p>Choose automatically.
17764 </p>
17765 </dd>
17766 <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
17767 <dd><p>Format conforming to International Telecommunication Union (ITU)
17768 Recommendation BT.709.
17769 </p>
17770 </dd>
17771 <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
17772 <dd><p>Set color space conforming to the United States Federal Communications
17773 Commission (FCC) Code of Federal Regulations (CFR) Title 47 (2003) 73.682 (a).
17774 </p>
17775 </dd>
17776 <dt>&lsquo;<samp>bt601</samp>&rsquo;</dt>
17777 <dd><p>Set color space conforming to:
17778 </p>
17779 <ul>
17780 <li> ITU Radiocommunication Sector (ITU-R) Recommendation BT.601
17781
17782 </li><li> ITU-R Rec. BT.470-6 (1998) Systems B, B1, and G
17783
17784 </li><li> Society of Motion Picture and Television Engineers (SMPTE) ST 170:2004
17785
17786 </li></ul>
17787
17788 </dd>
17789 <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
17790 <dd><p>Set color space conforming to SMPTE ST 240:1999.
17791 </p></dd>
17792 </dl>
17793
17794 </dd>
17795 <dt><samp>in_range</samp></dt>
17796 <dt><samp>out_range</samp></dt>
17797 <dd><p>Set in/output YCbCr sample range.
17798 </p>
17799 <p>This allows the autodetected value to be overridden as well as allows forcing
17800 a specific value used for the output and encoder. If not specified, the
17801 range depends on the pixel format. Possible values:
17802 </p>
17803 <dl compact="compact">
17804 <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
17805 <dd><p>Choose automatically.
17806 </p>
17807 </dd>
17808 <dt>&lsquo;<samp>jpeg/full/pc</samp>&rsquo;</dt>
17809 <dd><p>Set full range (0-255 in case of 8-bit luma).
17810 </p>
17811 </dd>
17812 <dt>&lsquo;<samp>mpeg/tv</samp>&rsquo;</dt>
17813 <dd><p>Set &quot;MPEG&quot; range (16-235 in case of 8-bit luma).
17814 </p></dd>
17815 </dl>
17816
17817 </dd>
17818 <dt><samp>force_original_aspect_ratio</samp></dt>
17819 <dd><p>Enable decreasing or increasing output video width or height if necessary to
17820 keep the original aspect ratio. Possible values:
17821 </p>
17822 <dl compact="compact">
17823 <dt>&lsquo;<samp>disable</samp>&rsquo;</dt>
17824 <dd><p>Scale the video as specified and disable this feature.
17825 </p>
17826 </dd>
17827 <dt>&lsquo;<samp>decrease</samp>&rsquo;</dt>
17828 <dd><p>The output video dimensions will automatically be decreased if needed.
17829 </p>
17830 </dd>
17831 <dt>&lsquo;<samp>increase</samp>&rsquo;</dt>
17832 <dd><p>The output video dimensions will automatically be increased if needed.
17833 </p>
17834 </dd>
17835 </dl>
17836
17837 <p>One useful instance of this option is that when you know a specific device&rsquo;s
17838 maximum allowed resolution, you can use this to limit the output video to
17839 that, while retaining the aspect ratio. For example, device A allows
17840 1280x720 playback, and your video is 1920x800. Using this option (set it to
17841 decrease) and specifying 1280x720 to the command line makes the output
17842 1280x533.
17843 </p>
17844 <p>Please note that this is a different thing than specifying -1 for <samp>w</samp>
17845 or <samp>h</samp>, you still need to specify the output resolution for this option
17846 to work.
17847 </p>
17848 </dd>
17849 </dl>
17850
17851 <p>The values of the <samp>w</samp> and <samp>h</samp> options are expressions
17852 containing the following constants:
17853 </p>
17854 <dl compact="compact">
17855 <dt><var>in_w</var></dt>
17856 <dt><var>in_h</var></dt>
17857 <dd><p>The input width and height
17858 </p>
17859 </dd>
17860 <dt><var>iw</var></dt>
17861 <dt><var>ih</var></dt>
17862 <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
17863 </p>
17864 </dd>
17865 <dt><var>out_w</var></dt>
17866 <dt><var>out_h</var></dt>
17867 <dd><p>The output (scaled) width and height
17868 </p>
17869 </dd>
17870 <dt><var>ow</var></dt>
17871 <dt><var>oh</var></dt>
17872 <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>
17873 </p>
17874 </dd>
17875 <dt><var>a</var></dt>
17876 <dd><p>The same as <var>iw</var> / <var>ih</var>
17877 </p>
17878 </dd>
17879 <dt><var>sar</var></dt>
17880 <dd><p>input sample aspect ratio
17881 </p>
17882 </dd>
17883 <dt><var>dar</var></dt>
17884 <dd><p>The input display aspect ratio. Calculated from <code>(iw / ih) * sar</code>.
17885 </p>
17886 </dd>
17887 <dt><var>hsub</var></dt>
17888 <dt><var>vsub</var></dt>
17889 <dd><p>horizontal and vertical input chroma subsample values. For example for the
17890 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
17891 </p>
17892 </dd>
17893 <dt><var>ohsub</var></dt>
17894 <dt><var>ovsub</var></dt>
17895 <dd><p>horizontal and vertical output chroma subsample values. For example for the
17896 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
17897 </p></dd>
17898 </dl>
17899
17900 <a name="Examples-73"></a>
17901 <h4 class="subsection">28.86.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-73" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-73" aria-hidden="true">TOC</a></span></h4>
17902
17903 <ul>
17904 <li> Scale the input video to a size of 200x100
17905 <div class="example">
17906 <pre class="example">scale=w=200:h=100
17907 </pre></div>
17908
17909 <p>This is equivalent to:
17910 </p><div class="example">
17911 <pre class="example">scale=200:100
17912 </pre></div>
17913
17914 <p>or:
17915 </p><div class="example">
17916 <pre class="example">scale=200x100
17917 </pre></div>
17918
17919 </li><li> Specify a size abbreviation for the output size:
17920 <div class="example">
17921 <pre class="example">scale=qcif
17922 </pre></div>
17923
17924 <p>which can also be written as:
17925 </p><div class="example">
17926 <pre class="example">scale=size=qcif
17927 </pre></div>
17928
17929 </li><li> Scale the input to 2x:
17930 <div class="example">
17931 <pre class="example">scale=w=2*iw:h=2*ih
17932 </pre></div>
17933
17934 </li><li> The above is the same as:
17935 <div class="example">
17936 <pre class="example">scale=2*in_w:2*in_h
17937 </pre></div>
17938
17939 </li><li> Scale the input to 2x with forced interlaced scaling:
17940 <div class="example">
17941 <pre class="example">scale=2*iw:2*ih:interl=1
17942 </pre></div>
17943
17944 </li><li> Scale the input to half size:
17945 <div class="example">
17946 <pre class="example">scale=w=iw/2:h=ih/2
17947 </pre></div>
17948
17949 </li><li> Increase the width, and set the height to the same size:
17950 <div class="example">
17951 <pre class="example">scale=3/2*iw:ow
17952 </pre></div>
17953
17954 </li><li> Seek Greek harmony:
17955 <div class="example">
17956 <pre class="example">scale=iw:1/PHI*iw
17957 scale=ih*PHI:ih
17958 </pre></div>
17959
17960 </li><li> Increase the height, and set the width to 3/2 of the height:
17961 <div class="example">
17962 <pre class="example">scale=w=3/2*oh:h=3/5*ih
17963 </pre></div>
17964
17965 </li><li> Increase the size, making the size a multiple of the chroma
17966 subsample values:
17967 <div class="example">
17968 <pre class="example">scale=&quot;trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub&quot;
17969 </pre></div>
17970
17971 </li><li> Increase the width to a maximum of 500 pixels,
17972 keeping the same aspect ratio as the input:
17973 <div class="example">
17974 <pre class="example">scale=w='min(500\, iw*3/2):h=-1'
17975 </pre></div>
17976 </li></ul>
17977
17978 <a name="separatefields"></a>
17979 <h3 class="section">28.87 separatefields<span class="pull-right"><a class="anchor hidden-xs" href="#separatefields" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-separatefields" aria-hidden="true">TOC</a></span></h3>
17980
17981 <p>The <code>separatefields</code> takes a frame-based video input and splits
17982 each frame into its components fields, producing a new half height clip
17983 with twice the frame rate and twice the frame count.
17984 </p>
17985 <p>This filter use field-dominance information in frame to decide which
17986 of each pair of fields to place first in the output.
17987 If it gets it wrong use <a href="#setfield">setfield</a> filter before <code>separatefields</code> filter.
17988 </p>
17989 <a name="setdar_002c-setsar"></a>
17990 <h3 class="section">28.88 setdar, setsar<span class="pull-right"><a class="anchor hidden-xs" href="#setdar_002c-setsar" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setdar_002c-setsar" aria-hidden="true">TOC</a></span></h3>
17991
17992 <p>The <code>setdar</code> filter sets the Display Aspect Ratio for the filter
17993 output video.
17994 </p>
17995 <p>This is done by changing the specified Sample (aka Pixel) Aspect
17996 Ratio, according to the following equation:
17997 </p><div class="example">
17998 <pre class="example"><var>DAR</var> = <var>HORIZONTAL_RESOLUTION</var> / <var>VERTICAL_RESOLUTION</var> * <var>SAR</var>
17999 </pre></div>
18000
18001 <p>Keep in mind that the <code>setdar</code> filter does not modify the pixel
18002 dimensions of the video frame. Also, the display aspect ratio set by
18003 this filter may be changed by later filters in the filterchain,
18004 e.g. in case of scaling or if another &quot;setdar&quot; or a &quot;setsar&quot; filter is
18005 applied.
18006 </p>
18007 <p>The <code>setsar</code> filter sets the Sample (aka Pixel) Aspect Ratio for
18008 the filter output video.
18009 </p>
18010 <p>Note that as a consequence of the application of this filter, the
18011 output display aspect ratio will change according to the equation
18012 above.
18013 </p>
18014 <p>Keep in mind that the sample aspect ratio set by the <code>setsar</code>
18015 filter may be changed by later filters in the filterchain, e.g. if
18016 another &quot;setsar&quot; or a &quot;setdar&quot; filter is applied.
18017 </p>
18018 <p>It accepts the following parameters:
18019 </p>
18020 <dl compact="compact">
18021 <dt><samp>r, ratio, dar (<code>setdar</code> only), sar (<code>setsar</code> only)</samp></dt>
18022 <dd><p>Set the aspect ratio used by the filter.
18023 </p>
18024 <p>The parameter can be a floating point number string, an expression, or
18025 a string of the form <var>num</var>:<var>den</var>, where <var>num</var> and
18026 <var>den</var> are the numerator and denominator of the aspect ratio. If
18027 the parameter is not specified, it is assumed the value &quot;0&quot;.
18028 In case the form &quot;<var>num</var>:<var>den</var>&quot; is used, the <code>:</code> character
18029 should be escaped.
18030 </p>
18031 </dd>
18032 <dt><samp>max</samp></dt>
18033 <dd><p>Set the maximum integer value to use for expressing numerator and
18034 denominator when reducing the expressed aspect ratio to a rational.
18035 Default value is <code>100</code>.
18036 </p>
18037 </dd>
18038 </dl>
18039
18040 <p>The parameter <var>sar</var> is an expression containing
18041 the following constants:
18042 </p>
18043 <dl compact="compact">
18044 <dt><samp>E, PI, PHI</samp></dt>
18045 <dd><p>These are approximated values for the mathematical constants e
18046 (Euler&rsquo;s number), pi (Greek pi), and phi (the golden ratio).
18047 </p>
18048 </dd>
18049 <dt><samp>w, h</samp></dt>
18050 <dd><p>The input width and height.
18051 </p>
18052 </dd>
18053 <dt><samp>a</samp></dt>
18054 <dd><p>These are the same as <var>w</var> / <var>h</var>.
18055 </p>
18056 </dd>
18057 <dt><samp>sar</samp></dt>
18058 <dd><p>The input sample aspect ratio.
18059 </p>
18060 </dd>
18061 <dt><samp>dar</samp></dt>
18062 <dd><p>The input display aspect ratio. It is the same as
18063 (<var>w</var> / <var>h</var>) * <var>sar</var>.
18064 </p>
18065 </dd>
18066 <dt><samp>hsub, vsub</samp></dt>
18067 <dd><p>Horizontal and vertical chroma subsample values. For example, for the
18068 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
18069 </p></dd>
18070 </dl>
18071
18072 <a name="Examples-74"></a>
18073 <h4 class="subsection">28.88.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-74" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-74" aria-hidden="true">TOC</a></span></h4>
18074
18075 <ul>
18076 <li> To change the display aspect ratio to 16:9, specify one of the following:
18077 <div class="example">
18078 <pre class="example">setdar=dar=1.77777
18079 setdar=dar=16/9
18080 setdar=dar=1.77777
18081 </pre></div>
18082
18083 </li><li> To change the sample aspect ratio to 10:11, specify:
18084 <div class="example">
18085 <pre class="example">setsar=sar=10/11
18086 </pre></div>
18087
18088 </li><li> To set a display aspect ratio of 16:9, and specify a maximum integer value of
18089 1000 in the aspect ratio reduction, use the command:
18090 <div class="example">
18091 <pre class="example">setdar=ratio=16/9:max=1000
18092 </pre></div>
18093
18094 </li></ul>
18095
18096 <a name="setfield"></a><a name="setfield-1"></a>
18097 <h3 class="section">28.89 setfield<span class="pull-right"><a class="anchor hidden-xs" href="#setfield-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setfield-1" aria-hidden="true">TOC</a></span></h3>
18098
18099 <p>Force field for the output video frame.
18100 </p>
18101 <p>The <code>setfield</code> filter marks the interlace type field for the
18102 output frames. It does not change the input frame, but only sets the
18103 corresponding property, which affects how the frame is treated by
18104 following filters (e.g. <code>fieldorder</code> or <code>yadif</code>).
18105 </p>
18106 <p>The filter accepts the following options:
18107 </p>
18108 <dl compact="compact">
18109 <dt><samp>mode</samp></dt>
18110 <dd><p>Available values are:
18111 </p>
18112 <dl compact="compact">
18113 <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
18114 <dd><p>Keep the same field property.
18115 </p>
18116 </dd>
18117 <dt>&lsquo;<samp>bff</samp>&rsquo;</dt>
18118 <dd><p>Mark the frame as bottom-field-first.
18119 </p>
18120 </dd>
18121 <dt>&lsquo;<samp>tff</samp>&rsquo;</dt>
18122 <dd><p>Mark the frame as top-field-first.
18123 </p>
18124 </dd>
18125 <dt>&lsquo;<samp>prog</samp>&rsquo;</dt>
18126 <dd><p>Mark the frame as progressive.
18127 </p></dd>
18128 </dl>
18129 </dd>
18130 </dl>
18131
18132 <a name="showinfo"></a>
18133 <h3 class="section">28.90 showinfo<span class="pull-right"><a class="anchor hidden-xs" href="#showinfo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showinfo" aria-hidden="true">TOC</a></span></h3>
18134
18135 <p>Show a line containing various information for each input video frame.
18136 The input video is not modified.
18137 </p>
18138 <p>The shown line contains a sequence of key/value pairs of the form
18139 <var>key</var>:<var>value</var>.
18140 </p>
18141 <p>The following values are shown in the output:
18142 </p>
18143 <dl compact="compact">
18144 <dt><samp>n</samp></dt>
18145 <dd><p>The (sequential) number of the input frame, starting from 0.
18146 </p>
18147 </dd>
18148 <dt><samp>pts</samp></dt>
18149 <dd><p>The Presentation TimeStamp of the input frame, expressed as a number of
18150 time base units. The time base unit depends on the filter input pad.
18151 </p>
18152 </dd>
18153 <dt><samp>pts_time</samp></dt>
18154 <dd><p>The Presentation TimeStamp of the input frame, expressed as a number of
18155 seconds.
18156 </p>
18157 </dd>
18158 <dt><samp>pos</samp></dt>
18159 <dd><p>The position of the frame in the input stream, or -1 if this information is
18160 unavailable and/or meaningless (for example in case of synthetic video).
18161 </p>
18162 </dd>
18163 <dt><samp>fmt</samp></dt>
18164 <dd><p>The pixel format name.
18165 </p>
18166 </dd>
18167 <dt><samp>sar</samp></dt>
18168 <dd><p>The sample aspect ratio of the input frame, expressed in the form
18169 <var>num</var>/<var>den</var>.
18170 </p>
18171 </dd>
18172 <dt><samp>s</samp></dt>
18173 <dd><p>The size of the input frame. For the syntax of this option, check the
18174 <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
18175 </p>
18176 </dd>
18177 <dt><samp>i</samp></dt>
18178 <dd><p>The type of interlaced mode (&quot;P&quot; for &quot;progressive&quot;, &quot;T&quot; for top field first, &quot;B&quot;
18179 for bottom field first).
18180 </p>
18181 </dd>
18182 <dt><samp>iskey</samp></dt>
18183 <dd><p>This is 1 if the frame is a key frame, 0 otherwise.
18184 </p>
18185 </dd>
18186 <dt><samp>type</samp></dt>
18187 <dd><p>The picture type of the input frame (&quot;I&quot; for an I-frame, &quot;P&quot; for a
18188 P-frame, &quot;B&quot; for a B-frame, or &quot;?&quot; for an unknown type).
18189 Also refer to the documentation of the <code>AVPictureType</code> enum and of
18190 the <code>av_get_picture_type_char</code> function defined in
18191 <samp>libavutil/avutil.h</samp>.
18192 </p>
18193 </dd>
18194 <dt><samp>checksum</samp></dt>
18195 <dd><p>The Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame.
18196 </p>
18197 </dd>
18198 <dt><samp>plane_checksum</samp></dt>
18199 <dd><p>The Adler-32 checksum (printed in hexadecimal) of each plane of the input frame,
18200 expressed in the form &quot;[<var>c0</var> <var>c1</var> <var>c2</var> <var>c3</var>]&quot;.
18201 </p></dd>
18202 </dl>
18203
18204 <a name="showpalette"></a>
18205 <h3 class="section">28.91 showpalette<span class="pull-right"><a class="anchor hidden-xs" href="#showpalette" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showpalette" aria-hidden="true">TOC</a></span></h3>
18206
18207 <p>Displays the 256 colors palette of each frame. This filter is only relevant for
18208 <var>pal8</var> pixel format frames.
18209 </p>
18210 <p>It accepts the following option:
18211 </p>
18212 <dl compact="compact">
18213 <dt><samp>s</samp></dt>
18214 <dd><p>Set the size of the box used to represent one palette color entry. Default is
18215 <code>30</code> (for a <code>30x30</code> pixel box).
18216 </p></dd>
18217 </dl>
18218
18219 <a name="shuffleplanes"></a>
18220 <h3 class="section">28.92 shuffleplanes<span class="pull-right"><a class="anchor hidden-xs" href="#shuffleplanes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-shuffleplanes" aria-hidden="true">TOC</a></span></h3>
18221
18222 <p>Reorder and/or duplicate video planes.
18223 </p>
18224 <p>It accepts the following parameters:
18225 </p>
18226 <dl compact="compact">
18227 <dt><samp>map0</samp></dt>
18228 <dd><p>The index of the input plane to be used as the first output plane.
18229 </p>
18230 </dd>
18231 <dt><samp>map1</samp></dt>
18232 <dd><p>The index of the input plane to be used as the second output plane.
18233 </p>
18234 </dd>
18235 <dt><samp>map2</samp></dt>
18236 <dd><p>The index of the input plane to be used as the third output plane.
18237 </p>
18238 </dd>
18239 <dt><samp>map3</samp></dt>
18240 <dd><p>The index of the input plane to be used as the fourth output plane.
18241 </p>
18242 </dd>
18243 </dl>
18244
18245 <p>The first plane has the index 0. The default is to keep the input unchanged.
18246 </p>
18247 <p>Swap the second and third planes of the input:
18248 </p><div class="example">
18249 <pre class="example">ffmpeg -i INPUT -vf shuffleplanes=0:2:1:3 OUTPUT
18250 </pre></div>
18251
18252 <a name="signalstats"></a>
18253 <h3 class="section">28.93 signalstats<span class="pull-right"><a class="anchor hidden-xs" href="#signalstats" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-signalstats" aria-hidden="true">TOC</a></span></h3>
18254 <p>Evaluate various visual metrics that assist in determining issues associated
18255 with the digitization of analog video media.
18256 </p>
18257 <p>By default the filter will log these metadata values:
18258 </p>
18259 <dl compact="compact">
18260 <dt><samp>YMIN</samp></dt>
18261 <dd><p>Display the minimal Y value contained within the input frame. Expressed in
18262 range of [0-255].
18263 </p>
18264 </dd>
18265 <dt><samp>YLOW</samp></dt>
18266 <dd><p>Display the Y value at the 10% percentile within the input frame. Expressed in
18267 range of [0-255].
18268 </p>
18269 </dd>
18270 <dt><samp>YAVG</samp></dt>
18271 <dd><p>Display the average Y value within the input frame. Expressed in range of
18272 [0-255].
18273 </p>
18274 </dd>
18275 <dt><samp>YHIGH</samp></dt>
18276 <dd><p>Display the Y value at the 90% percentile within the input frame. Expressed in
18277 range of [0-255].
18278 </p>
18279 </dd>
18280 <dt><samp>YMAX</samp></dt>
18281 <dd><p>Display the maximum Y value contained within the input frame. Expressed in
18282 range of [0-255].
18283 </p>
18284 </dd>
18285 <dt><samp>UMIN</samp></dt>
18286 <dd><p>Display the minimal U value contained within the input frame. Expressed in
18287 range of [0-255].
18288 </p>
18289 </dd>
18290 <dt><samp>ULOW</samp></dt>
18291 <dd><p>Display the U value at the 10% percentile within the input frame. Expressed in
18292 range of [0-255].
18293 </p>
18294 </dd>
18295 <dt><samp>UAVG</samp></dt>
18296 <dd><p>Display the average U value within the input frame. Expressed in range of
18297 [0-255].
18298 </p>
18299 </dd>
18300 <dt><samp>UHIGH</samp></dt>
18301 <dd><p>Display the U value at the 90% percentile within the input frame. Expressed in
18302 range of [0-255].
18303 </p>
18304 </dd>
18305 <dt><samp>UMAX</samp></dt>
18306 <dd><p>Display the maximum U value contained within the input frame. Expressed in
18307 range of [0-255].
18308 </p>
18309 </dd>
18310 <dt><samp>VMIN</samp></dt>
18311 <dd><p>Display the minimal V value contained within the input frame. Expressed in
18312 range of [0-255].
18313 </p>
18314 </dd>
18315 <dt><samp>VLOW</samp></dt>
18316 <dd><p>Display the V value at the 10% percentile within the input frame. Expressed in
18317 range of [0-255].
18318 </p>
18319 </dd>
18320 <dt><samp>VAVG</samp></dt>
18321 <dd><p>Display the average V value within the input frame. Expressed in range of
18322 [0-255].
18323 </p>
18324 </dd>
18325 <dt><samp>VHIGH</samp></dt>
18326 <dd><p>Display the V value at the 90% percentile within the input frame. Expressed in
18327 range of [0-255].
18328 </p>
18329 </dd>
18330 <dt><samp>VMAX</samp></dt>
18331 <dd><p>Display the maximum V value contained within the input frame. Expressed in
18332 range of [0-255].
18333 </p>
18334 </dd>
18335 <dt><samp>SATMIN</samp></dt>
18336 <dd><p>Display the minimal saturation value contained within the input frame.
18337 Expressed in range of [0-~181.02].
18338 </p>
18339 </dd>
18340 <dt><samp>SATLOW</samp></dt>
18341 <dd><p>Display the saturation value at the 10% percentile within the input frame.
18342 Expressed in range of [0-~181.02].
18343 </p>
18344 </dd>
18345 <dt><samp>SATAVG</samp></dt>
18346 <dd><p>Display the average saturation value within the input frame. Expressed in range
18347 of [0-~181.02].
18348 </p>
18349 </dd>
18350 <dt><samp>SATHIGH</samp></dt>
18351 <dd><p>Display the saturation value at the 90% percentile within the input frame.
18352 Expressed in range of [0-~181.02].
18353 </p>
18354 </dd>
18355 <dt><samp>SATMAX</samp></dt>
18356 <dd><p>Display the maximum saturation value contained within the input frame.
18357 Expressed in range of [0-~181.02].
18358 </p>
18359 </dd>
18360 <dt><samp>HUEMED</samp></dt>
18361 <dd><p>Display the median value for hue within the input frame. Expressed in range of
18362 [0-360].
18363 </p>
18364 </dd>
18365 <dt><samp>HUEAVG</samp></dt>
18366 <dd><p>Display the average value for hue within the input frame. Expressed in range of
18367 [0-360].
18368 </p>
18369 </dd>
18370 <dt><samp>YDIF</samp></dt>
18371 <dd><p>Display the average of sample value difference between all values of the Y
18372 plane in the current frame and corresponding values of the previous input frame.
18373 Expressed in range of [0-255].
18374 </p>
18375 </dd>
18376 <dt><samp>UDIF</samp></dt>
18377 <dd><p>Display the average of sample value difference between all values of the U
18378 plane in the current frame and corresponding values of the previous input frame.
18379 Expressed in range of [0-255].
18380 </p>
18381 </dd>
18382 <dt><samp>VDIF</samp></dt>
18383 <dd><p>Display the average of sample value difference between all values of the V
18384 plane in the current frame and corresponding values of the previous input frame.
18385 Expressed in range of [0-255].
18386 </p></dd>
18387 </dl>
18388
18389 <p>The filter accepts the following options:
18390 </p>
18391 <dl compact="compact">
18392 <dt><samp>stat</samp></dt>
18393 <dt><samp>out</samp></dt>
18394 <dd>
18395 <p><samp>stat</samp> specify an additional form of image analysis.
18396 <samp>out</samp> output video with the specified type of pixel highlighted.
18397 </p>
18398 <p>Both options accept the following values:
18399 </p>
18400 <dl compact="compact">
18401 <dt>&lsquo;<samp>tout</samp>&rsquo;</dt>
18402 <dd><p>Identify <var>temporal outliers</var> pixels. A <var>temporal outlier</var> is a pixel
18403 unlike the neighboring pixels of the same field. Examples of temporal outliers
18404 include the results of video dropouts, head clogs, or tape tracking issues.
18405 </p>
18406 </dd>
18407 <dt>&lsquo;<samp>vrep</samp>&rsquo;</dt>
18408 <dd><p>Identify <var>vertical line repetition</var>. Vertical line repetition includes
18409 similar rows of pixels within a frame. In born-digital video vertical line
18410 repetition is common, but this pattern is uncommon in video digitized from an
18411 analog source. When it occurs in video that results from the digitization of an
18412 analog source it can indicate concealment from a dropout compensator.
18413 </p>
18414 </dd>
18415 <dt>&lsquo;<samp>brng</samp>&rsquo;</dt>
18416 <dd><p>Identify pixels that fall outside of legal broadcast range.
18417 </p></dd>
18418 </dl>
18419
18420 </dd>
18421 <dt><samp>color, c</samp></dt>
18422 <dd><p>Set the highlight color for the <samp>out</samp> option. The default color is
18423 yellow.
18424 </p></dd>
18425 </dl>
18426
18427 <a name="Examples-75"></a>
18428 <h4 class="subsection">28.93.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-75" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-75" aria-hidden="true">TOC</a></span></h4>
18429
18430 <ul>
18431 <li> Output data of various video metrics:
18432 <div class="example">
18433 <pre class="example">ffprobe -f lavfi movie=example.mov,signalstats=&quot;stat=tout+vrep+brng&quot; -show_frames
18434 </pre></div>
18435
18436 </li><li> Output specific data about the minimum and maximum values of the Y plane per frame:
18437 <div class="example">
18438 <pre class="example">ffprobe -f lavfi movie=example.mov,signalstats -show_entries frame_tags=lavfi.signalstats.YMAX,lavfi.signalstats.YMIN
18439 </pre></div>
18440
18441 </li><li> Playback video while highlighting pixels that are outside of broadcast range in red.
18442 <div class="example">
18443 <pre class="example">ffplay example.mov -vf signalstats=&quot;out=brng:color=red&quot;
18444 </pre></div>
18445
18446 </li><li> Playback video with signalstats metadata drawn over the frame.
18447 <div class="example">
18448 <pre class="example">ffplay example.mov -vf signalstats=stat=brng+vrep+tout,drawtext=fontfile=FreeSerif.ttf:textfile=signalstat_drawtext.txt
18449 </pre></div>
18450
18451 <p>The contents of signalstat_drawtext.txt used in the command are:
18452 </p><div class="example">
18453 <pre class="example">time %{pts:hms}
18454 Y (%{metadata:lavfi.signalstats.YMIN}-%{metadata:lavfi.signalstats.YMAX})
18455 U (%{metadata:lavfi.signalstats.UMIN}-%{metadata:lavfi.signalstats.UMAX})
18456 V (%{metadata:lavfi.signalstats.VMIN}-%{metadata:lavfi.signalstats.VMAX})
18457 saturation maximum: %{metadata:lavfi.signalstats.SATMAX}
18458
18459 </pre></div>
18460 </li></ul>
18461
18462 <a name="smartblur"></a><a name="smartblur-1"></a>
18463 <h3 class="section">28.94 smartblur<span class="pull-right"><a class="anchor hidden-xs" href="#smartblur-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-smartblur-1" aria-hidden="true">TOC</a></span></h3>
18464
18465 <p>Blur the input video without impacting the outlines.
18466 </p>
18467 <p>It accepts the following options:
18468 </p>
18469 <dl compact="compact">
18470 <dt><samp>luma_radius, lr</samp></dt>
18471 <dd><p>Set the luma radius. The option value must be a float number in
18472 the range [0.1,5.0] that specifies the variance of the gaussian filter
18473 used to blur the image (slower if larger). Default value is 1.0.
18474 </p>
18475 </dd>
18476 <dt><samp>luma_strength, ls</samp></dt>
18477 <dd><p>Set the luma strength. The option value must be a float number
18478 in the range [-1.0,1.0] that configures the blurring. A value included
18479 in [0.0,1.0] will blur the image whereas a value included in
18480 [-1.0,0.0] will sharpen the image. Default value is 1.0.
18481 </p>
18482 </dd>
18483 <dt><samp>luma_threshold, lt</samp></dt>
18484 <dd><p>Set the luma threshold used as a coefficient to determine
18485 whether a pixel should be blurred or not. The option value must be an
18486 integer in the range [-30,30]. A value of 0 will filter all the image,
18487 a value included in [0,30] will filter flat areas and a value included
18488 in [-30,0] will filter edges. Default value is 0.
18489 </p>
18490 </dd>
18491 <dt><samp>chroma_radius, cr</samp></dt>
18492 <dd><p>Set the chroma radius. The option value must be a float number in
18493 the range [0.1,5.0] that specifies the variance of the gaussian filter
18494 used to blur the image (slower if larger). Default value is 1.0.
18495 </p>
18496 </dd>
18497 <dt><samp>chroma_strength, cs</samp></dt>
18498 <dd><p>Set the chroma strength. The option value must be a float number
18499 in the range [-1.0,1.0] that configures the blurring. A value included
18500 in [0.0,1.0] will blur the image whereas a value included in
18501 [-1.0,0.0] will sharpen the image. Default value is 1.0.
18502 </p>
18503 </dd>
18504 <dt><samp>chroma_threshold, ct</samp></dt>
18505 <dd><p>Set the chroma threshold used as a coefficient to determine
18506 whether a pixel should be blurred or not. The option value must be an
18507 integer in the range [-30,30]. A value of 0 will filter all the image,
18508 a value included in [0,30] will filter flat areas and a value included
18509 in [-30,0] will filter edges. Default value is 0.
18510 </p></dd>
18511 </dl>
18512
18513 <p>If a chroma option is not explicitly set, the corresponding luma value
18514 is set.
18515 </p>
18516 <a name="stereo3d"></a>
18517 <h3 class="section">28.95 stereo3d<span class="pull-right"><a class="anchor hidden-xs" href="#stereo3d" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-stereo3d" aria-hidden="true">TOC</a></span></h3>
18518
18519 <p>Convert between different stereoscopic image formats.
18520 </p>
18521 <p>The filters accept the following options:
18522 </p>
18523 <dl compact="compact">
18524 <dt><samp>in</samp></dt>
18525 <dd><p>Set stereoscopic image format of input.
18526 </p>
18527 <p>Available values for input image formats are:
18528 </p><dl compact="compact">
18529 <dt>&lsquo;<samp>sbsl</samp>&rsquo;</dt>
18530 <dd><p>side by side parallel (left eye left, right eye right)
18531 </p>
18532 </dd>
18533 <dt>&lsquo;<samp>sbsr</samp>&rsquo;</dt>
18534 <dd><p>side by side crosseye (right eye left, left eye right)
18535 </p>
18536 </dd>
18537 <dt>&lsquo;<samp>sbs2l</samp>&rsquo;</dt>
18538 <dd><p>side by side parallel with half width resolution
18539 (left eye left, right eye right)
18540 </p>
18541 </dd>
18542 <dt>&lsquo;<samp>sbs2r</samp>&rsquo;</dt>
18543 <dd><p>side by side crosseye with half width resolution
18544 (right eye left, left eye right)
18545 </p>
18546 </dd>
18547 <dt>&lsquo;<samp>abl</samp>&rsquo;</dt>
18548 <dd><p>above-below (left eye above, right eye below)
18549 </p>
18550 </dd>
18551 <dt>&lsquo;<samp>abr</samp>&rsquo;</dt>
18552 <dd><p>above-below (right eye above, left eye below)
18553 </p>
18554 </dd>
18555 <dt>&lsquo;<samp>ab2l</samp>&rsquo;</dt>
18556 <dd><p>above-below with half height resolution
18557 (left eye above, right eye below)
18558 </p>
18559 </dd>
18560 <dt>&lsquo;<samp>ab2r</samp>&rsquo;</dt>
18561 <dd><p>above-below with half height resolution
18562 (right eye above, left eye below)
18563 </p>
18564 </dd>
18565 <dt>&lsquo;<samp>al</samp>&rsquo;</dt>
18566 <dd><p>alternating frames (left eye first, right eye second)
18567 </p>
18568 </dd>
18569 <dt>&lsquo;<samp>ar</samp>&rsquo;</dt>
18570 <dd><p>alternating frames (right eye first, left eye second)
18571 </p>
18572 <p>Default value is &lsquo;<samp>sbsl</samp>&rsquo;.
18573 </p></dd>
18574 </dl>
18575
18576 </dd>
18577 <dt><samp>out</samp></dt>
18578 <dd><p>Set stereoscopic image format of output.
18579 </p>
18580 <p>Available values for output image formats are all the input formats as well as:
18581 </p><dl compact="compact">
18582 <dt>&lsquo;<samp>arbg</samp>&rsquo;</dt>
18583 <dd><p>anaglyph red/blue gray
18584 (red filter on left eye, blue filter on right eye)
18585 </p>
18586 </dd>
18587 <dt>&lsquo;<samp>argg</samp>&rsquo;</dt>
18588 <dd><p>anaglyph red/green gray
18589 (red filter on left eye, green filter on right eye)
18590 </p>
18591 </dd>
18592 <dt>&lsquo;<samp>arcg</samp>&rsquo;</dt>
18593 <dd><p>anaglyph red/cyan gray
18594 (red filter on left eye, cyan filter on right eye)
18595 </p>
18596 </dd>
18597 <dt>&lsquo;<samp>arch</samp>&rsquo;</dt>
18598 <dd><p>anaglyph red/cyan half colored
18599 (red filter on left eye, cyan filter on right eye)
18600 </p>
18601 </dd>
18602 <dt>&lsquo;<samp>arcc</samp>&rsquo;</dt>
18603 <dd><p>anaglyph red/cyan color
18604 (red filter on left eye, cyan filter on right eye)
18605 </p>
18606 </dd>
18607 <dt>&lsquo;<samp>arcd</samp>&rsquo;</dt>
18608 <dd><p>anaglyph red/cyan color optimized with the least squares projection of dubois
18609 (red filter on left eye, cyan filter on right eye)
18610 </p>
18611 </dd>
18612 <dt>&lsquo;<samp>agmg</samp>&rsquo;</dt>
18613 <dd><p>anaglyph green/magenta gray
18614 (green filter on left eye, magenta filter on right eye)
18615 </p>
18616 </dd>
18617 <dt>&lsquo;<samp>agmh</samp>&rsquo;</dt>
18618 <dd><p>anaglyph green/magenta half colored
18619 (green filter on left eye, magenta filter on right eye)
18620 </p>
18621 </dd>
18622 <dt>&lsquo;<samp>agmc</samp>&rsquo;</dt>
18623 <dd><p>anaglyph green/magenta colored
18624 (green filter on left eye, magenta filter on right eye)
18625 </p>
18626 </dd>
18627 <dt>&lsquo;<samp>agmd</samp>&rsquo;</dt>
18628 <dd><p>anaglyph green/magenta color optimized with the least squares projection of dubois
18629 (green filter on left eye, magenta filter on right eye)
18630 </p>
18631 </dd>
18632 <dt>&lsquo;<samp>aybg</samp>&rsquo;</dt>
18633 <dd><p>anaglyph yellow/blue gray
18634 (yellow filter on left eye, blue filter on right eye)
18635 </p>
18636 </dd>
18637 <dt>&lsquo;<samp>aybh</samp>&rsquo;</dt>
18638 <dd><p>anaglyph yellow/blue half colored
18639 (yellow filter on left eye, blue filter on right eye)
18640 </p>
18641 </dd>
18642 <dt>&lsquo;<samp>aybc</samp>&rsquo;</dt>
18643 <dd><p>anaglyph yellow/blue colored
18644 (yellow filter on left eye, blue filter on right eye)
18645 </p>
18646 </dd>
18647 <dt>&lsquo;<samp>aybd</samp>&rsquo;</dt>
18648 <dd><p>anaglyph yellow/blue color optimized with the least squares projection of dubois
18649 (yellow filter on left eye, blue filter on right eye)
18650 </p>
18651 </dd>
18652 <dt>&lsquo;<samp>irl</samp>&rsquo;</dt>
18653 <dd><p>interleaved rows (left eye has top row, right eye starts on next row)
18654 </p>
18655 </dd>
18656 <dt>&lsquo;<samp>irr</samp>&rsquo;</dt>
18657 <dd><p>interleaved rows (right eye has top row, left eye starts on next row)
18658 </p>
18659 </dd>
18660 <dt>&lsquo;<samp>ml</samp>&rsquo;</dt>
18661 <dd><p>mono output (left eye only)
18662 </p>
18663 </dd>
18664 <dt>&lsquo;<samp>mr</samp>&rsquo;</dt>
18665 <dd><p>mono output (right eye only)
18666 </p></dd>
18667 </dl>
18668
18669 <p>Default value is &lsquo;<samp>arcd</samp>&rsquo;.
18670 </p></dd>
18671 </dl>
18672
18673 <a name="Examples-76"></a>
18674 <h4 class="subsection">28.95.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-76" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-76" aria-hidden="true">TOC</a></span></h4>
18675
18676 <ul>
18677 <li> Convert input video from side by side parallel to anaglyph yellow/blue dubois:
18678 <div class="example">
18679 <pre class="example">stereo3d=sbsl:aybd
18680 </pre></div>
18681
18682 </li><li> Convert input video from above bellow (left eye above, right eye below) to side by side crosseye.
18683 <div class="example">
18684 <pre class="example">stereo3d=abl:sbsr
18685 </pre></div>
18686 </li></ul>
18687
18688 <a name="spp"></a><a name="spp-1"></a>
18689 <h3 class="section">28.96 spp<span class="pull-right"><a class="anchor hidden-xs" href="#spp-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-spp-1" aria-hidden="true">TOC</a></span></h3>
18690
18691 <p>Apply a simple postprocessing filter that compresses and decompresses the image
18692 at several (or - in the case of <samp>quality</samp> level <code>6</code> - all) shifts
18693 and average the results.
18694 </p>
18695 <p>The filter accepts the following options:
18696 </p>
18697 <dl compact="compact">
18698 <dt><samp>quality</samp></dt>
18699 <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
18700 an integer in the range 0-6. If set to <code>0</code>, the filter will have no
18701 effect. A value of <code>6</code> means the higher quality. For each increment of
18702 that value the speed drops by a factor of approximately 2.  Default value is
18703 <code>3</code>.
18704 </p>
18705 </dd>
18706 <dt><samp>qp</samp></dt>
18707 <dd><p>Force a constant quantization parameter. If not set, the filter will use the QP
18708 from the video stream (if available).
18709 </p>
18710 </dd>
18711 <dt><samp>mode</samp></dt>
18712 <dd><p>Set thresholding mode. Available modes are:
18713 </p>
18714 <dl compact="compact">
18715 <dt>&lsquo;<samp>hard</samp>&rsquo;</dt>
18716 <dd><p>Set hard thresholding (default).
18717 </p></dd>
18718 <dt>&lsquo;<samp>soft</samp>&rsquo;</dt>
18719 <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
18720 </p></dd>
18721 </dl>
18722
18723 </dd>
18724 <dt><samp>use_bframe_qp</samp></dt>
18725 <dd><p>Enable the use of the QP from the B-Frames if set to <code>1</code>. Using this
18726 option may cause flicker since the B-Frames have often larger QP. Default is
18727 <code>0</code> (not enabled).
18728 </p></dd>
18729 </dl>
18730
18731 <a name="subtitles"></a><a name="subtitles-1"></a>
18732 <h3 class="section">28.97 subtitles<span class="pull-right"><a class="anchor hidden-xs" href="#subtitles-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-subtitles-1" aria-hidden="true">TOC</a></span></h3>
18733
18734 <p>Draw subtitles on top of input video using the libass library.
18735 </p>
18736 <p>To enable compilation of this filter you need to configure FFmpeg with
18737 <code>--enable-libass</code>. This filter also requires a build with libavcodec and
18738 libavformat to convert the passed subtitles file to ASS (Advanced Substation
18739 Alpha) subtitles format.
18740 </p>
18741 <p>The filter accepts the following options:
18742 </p>
18743 <dl compact="compact">
18744 <dt><samp>filename, f</samp></dt>
18745 <dd><p>Set the filename of the subtitle file to read. It must be specified.
18746 </p>
18747 </dd>
18748 <dt><samp>original_size</samp></dt>
18749 <dd><p>Specify the size of the original video, the video for which the ASS file
18750 was composed. For the syntax of this option, check the
18751 <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
18752 Due to a misdesign in ASS aspect ratio arithmetic, this is necessary to
18753 correctly scale the fonts if the aspect ratio has been changed.
18754 </p>
18755 </dd>
18756 <dt><samp>charenc</samp></dt>
18757 <dd><p>Set subtitles input character encoding. <code>subtitles</code> filter only. Only
18758 useful if not UTF-8.
18759 </p>
18760 </dd>
18761 <dt><samp>stream_index, si</samp></dt>
18762 <dd><p>Set subtitles stream index. <code>subtitles</code> filter only.
18763 </p>
18764 </dd>
18765 <dt><samp>force_style</samp></dt>
18766 <dd><p>Override default style or script info parameters of the subtitles. It accepts a
18767 string containing ASS style format <code>KEY=VALUE</code> couples separated by &quot;,&quot;.
18768 </p></dd>
18769 </dl>
18770
18771 <p>If the first key is not specified, it is assumed that the first value
18772 specifies the <samp>filename</samp>.
18773 </p>
18774 <p>For example, to render the file <samp>sub.srt</samp> on top of the input
18775 video, use the command:
18776 </p><div class="example">
18777 <pre class="example">subtitles=sub.srt
18778 </pre></div>
18779
18780 <p>which is equivalent to:
18781 </p><div class="example">
18782 <pre class="example">subtitles=filename=sub.srt
18783 </pre></div>
18784
18785 <p>To render the default subtitles stream from file <samp>video.mkv</samp>, use:
18786 </p><div class="example">
18787 <pre class="example">subtitles=video.mkv
18788 </pre></div>
18789
18790 <p>To render the second subtitles stream from that file, use:
18791 </p><div class="example">
18792 <pre class="example">subtitles=video.mkv:si=1
18793 </pre></div>
18794
18795 <p>To make the subtitles stream from <samp>sub.srt</samp> appear in transparent green
18796 <code>DejaVu Serif</code>, use:
18797 </p><div class="example">
18798 <pre class="example">subtitles=sub.srt:force_style='FontName=DejaVu Serif,PrimaryColour=&amp;HAA00FF00'
18799 </pre></div>
18800
18801 <a name="super2xsai"></a>
18802 <h3 class="section">28.98 super2xsai<span class="pull-right"><a class="anchor hidden-xs" href="#super2xsai" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-super2xsai" aria-hidden="true">TOC</a></span></h3>
18803
18804 <p>Scale the input by 2x and smooth using the Super2xSaI (Scale and
18805 Interpolate) pixel art scaling algorithm.
18806 </p>
18807 <p>Useful for enlarging pixel art images without reducing sharpness.
18808 </p>
18809 <a name="swapuv"></a>
18810 <h3 class="section">28.99 swapuv<span class="pull-right"><a class="anchor hidden-xs" href="#swapuv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-swapuv" aria-hidden="true">TOC</a></span></h3>
18811 <p>Swap U &amp; V plane.
18812 </p>
18813 <a name="telecine"></a>
18814 <h3 class="section">28.100 telecine<span class="pull-right"><a class="anchor hidden-xs" href="#telecine" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-telecine" aria-hidden="true">TOC</a></span></h3>
18815
18816 <p>Apply telecine process to the video.
18817 </p>
18818 <p>This filter accepts the following options:
18819 </p>
18820 <dl compact="compact">
18821 <dt><samp>first_field</samp></dt>
18822 <dd><dl compact="compact">
18823 <dt>&lsquo;<samp>top, t</samp>&rsquo;</dt>
18824 <dd><p>top field first
18825 </p></dd>
18826 <dt>&lsquo;<samp>bottom, b</samp>&rsquo;</dt>
18827 <dd><p>bottom field first
18828 The default value is <code>top</code>.
18829 </p></dd>
18830 </dl>
18831
18832 </dd>
18833 <dt><samp>pattern</samp></dt>
18834 <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
18835 The default value is <code>23</code>.
18836 </p></dd>
18837 </dl>
18838
18839 <div class="example">
18840 <pre class="example">Some typical patterns:
18841
18842 NTSC output (30i):
18843 27.5p: 32222
18844 24p: 23 (classic)
18845 24p: 2332 (preferred)
18846 20p: 33
18847 18p: 334
18848 16p: 3444
18849
18850 PAL output (25i):
18851 27.5p: 12222
18852 24p: 222222222223 (&quot;Euro pulldown&quot;)
18853 16.67p: 33
18854 16p: 33333334
18855 </pre></div>
18856
18857 <a name="thumbnail"></a>
18858 <h3 class="section">28.101 thumbnail<span class="pull-right"><a class="anchor hidden-xs" href="#thumbnail" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-thumbnail" aria-hidden="true">TOC</a></span></h3>
18859 <p>Select the most representative frame in a given sequence of consecutive frames.
18860 </p>
18861 <p>The filter accepts the following options:
18862 </p>
18863 <dl compact="compact">
18864 <dt><samp>n</samp></dt>
18865 <dd><p>Set the frames batch size to analyze; in a set of <var>n</var> frames, the filter
18866 will pick one of them, and then handle the next batch of <var>n</var> frames until
18867 the end. Default is <code>100</code>.
18868 </p></dd>
18869 </dl>
18870
18871 <p>Since the filter keeps track of the whole frames sequence, a bigger <var>n</var>
18872 value will result in a higher memory usage, so a high value is not recommended.
18873 </p>
18874 <a name="Examples-77"></a>
18875 <h4 class="subsection">28.101.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-77" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-77" aria-hidden="true">TOC</a></span></h4>
18876
18877 <ul>
18878 <li> Extract one picture each 50 frames:
18879 <div class="example">
18880 <pre class="example">thumbnail=50
18881 </pre></div>
18882
18883 </li><li> Complete example of a thumbnail creation with <code>ffmpeg</code>:
18884 <div class="example">
18885 <pre class="example">ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
18886 </pre></div>
18887 </li></ul>
18888
18889 <a name="tile"></a>
18890 <h3 class="section">28.102 tile<span class="pull-right"><a class="anchor hidden-xs" href="#tile" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tile" aria-hidden="true">TOC</a></span></h3>
18891
18892 <p>Tile several successive frames together.
18893 </p>
18894 <p>The filter accepts the following options:
18895 </p>
18896 <dl compact="compact">
18897 <dt><samp>layout</samp></dt>
18898 <dd><p>Set the grid size (i.e. the number of lines and columns). For the syntax of
18899 this option, check the
18900 <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
18901 </p>
18902 </dd>
18903 <dt><samp>nb_frames</samp></dt>
18904 <dd><p>Set the maximum number of frames to render in the given area. It must be less
18905 than or equal to <var>w</var>x<var>h</var>. The default value is <code>0</code>, meaning all
18906 the area will be used.
18907 </p>
18908 </dd>
18909 <dt><samp>margin</samp></dt>
18910 <dd><p>Set the outer border margin in pixels.
18911 </p>
18912 </dd>
18913 <dt><samp>padding</samp></dt>
18914 <dd><p>Set the inner border thickness (i.e. the number of pixels between frames). For
18915 more advanced padding options (such as having different values for the edges),
18916 refer to the pad video filter.
18917 </p>
18918 </dd>
18919 <dt><samp>color</samp></dt>
18920 <dd><p>Specify the color of the unused area. For the syntax of this option, check the
18921 &quot;Color&quot; section in the ffmpeg-utils manual. The default value of <var>color</var>
18922 is &quot;black&quot;.
18923 </p></dd>
18924 </dl>
18925
18926 <a name="Examples-78"></a>
18927 <h4 class="subsection">28.102.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-78" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-78" aria-hidden="true">TOC</a></span></h4>
18928
18929 <ul>
18930 <li> Produce 8x8 PNG tiles of all keyframes (<samp>-skip_frame nokey</samp>) in a movie:
18931 <div class="example">
18932 <pre class="example">ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
18933 </pre></div>
18934 <p>The <samp>-vsync 0</samp> is necessary to prevent <code>ffmpeg</code> from
18935 duplicating each output frame to accommodate the originally detected frame
18936 rate.
18937 </p>
18938 </li><li> Display <code>5</code> pictures in an area of <code>3x2</code> frames,
18939 with <code>7</code> pixels between them, and <code>2</code> pixels of initial margin, using
18940 mixed flat and named options:
18941 <div class="example">
18942 <pre class="example">tile=3x2:nb_frames=5:padding=7:margin=2
18943 </pre></div>
18944 </li></ul>
18945
18946 <a name="tinterlace"></a>
18947 <h3 class="section">28.103 tinterlace<span class="pull-right"><a class="anchor hidden-xs" href="#tinterlace" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tinterlace" aria-hidden="true">TOC</a></span></h3>
18948
18949 <p>Perform various types of temporal field interlacing.
18950 </p>
18951 <p>Frames are counted starting from 1, so the first input frame is
18952 considered odd.
18953 </p>
18954 <p>The filter accepts the following options:
18955 </p>
18956 <dl compact="compact">
18957 <dt><samp>mode</samp></dt>
18958 <dd><p>Specify the mode of the interlacing. This option can also be specified
18959 as a value alone. See below for a list of values for this option.
18960 </p>
18961 <p>Available values are:
18962 </p>
18963 <dl compact="compact">
18964 <dt>&lsquo;<samp>merge, 0</samp>&rsquo;</dt>
18965 <dd><p>Move odd frames into the upper field, even into the lower field,
18966 generating a double height frame at half frame rate.
18967 </p><div class="example">
18968 <pre class="example"> ------&gt; time
18969 Input:
18970 Frame 1         Frame 2         Frame 3         Frame 4
18971
18972 11111           22222           33333           44444
18973 11111           22222           33333           44444
18974 11111           22222           33333           44444
18975 11111           22222           33333           44444
18976
18977 Output:
18978 11111                           33333
18979 22222                           44444
18980 11111                           33333
18981 22222                           44444
18982 11111                           33333
18983 22222                           44444
18984 11111                           33333
18985 22222                           44444
18986 </pre></div>
18987
18988 </dd>
18989 <dt>&lsquo;<samp>drop_odd, 1</samp>&rsquo;</dt>
18990 <dd><p>Only output even frames, odd frames are dropped, generating a frame with
18991 unchanged height at half frame rate.
18992 </p>
18993 <div class="example">
18994 <pre class="example"> ------&gt; time
18995 Input:
18996 Frame 1         Frame 2         Frame 3         Frame 4
18997
18998 11111           22222           33333           44444
18999 11111           22222           33333           44444
19000 11111           22222           33333           44444
19001 11111           22222           33333           44444
19002
19003 Output:
19004                 22222                           44444
19005                 22222                           44444
19006                 22222                           44444
19007                 22222                           44444
19008 </pre></div>
19009
19010 </dd>
19011 <dt>&lsquo;<samp>drop_even, 2</samp>&rsquo;</dt>
19012 <dd><p>Only output odd frames, even frames are dropped, generating a frame with
19013 unchanged height at half frame rate.
19014 </p>
19015 <div class="example">
19016 <pre class="example"> ------&gt; time
19017 Input:
19018 Frame 1         Frame 2         Frame 3         Frame 4
19019
19020 11111           22222           33333           44444
19021 11111           22222           33333           44444
19022 11111           22222           33333           44444
19023 11111           22222           33333           44444
19024
19025 Output:
19026 11111                           33333
19027 11111                           33333
19028 11111                           33333
19029 11111                           33333
19030 </pre></div>
19031
19032 </dd>
19033 <dt>&lsquo;<samp>pad, 3</samp>&rsquo;</dt>
19034 <dd><p>Expand each frame to full height, but pad alternate lines with black,
19035 generating a frame with double height at the same input frame rate.
19036 </p>
19037 <div class="example">
19038 <pre class="example"> ------&gt; time
19039 Input:
19040 Frame 1         Frame 2         Frame 3         Frame 4
19041
19042 11111           22222           33333           44444
19043 11111           22222           33333           44444
19044 11111           22222           33333           44444
19045 11111           22222           33333           44444
19046
19047 Output:
19048 11111           .....           33333           .....
19049 .....           22222           .....           44444
19050 11111           .....           33333           .....
19051 .....           22222           .....           44444
19052 11111           .....           33333           .....
19053 .....           22222           .....           44444
19054 11111           .....           33333           .....
19055 .....           22222           .....           44444
19056 </pre></div>
19057
19058
19059 </dd>
19060 <dt>&lsquo;<samp>interleave_top, 4</samp>&rsquo;</dt>
19061 <dd><p>Interleave the upper field from odd frames with the lower field from
19062 even frames, generating a frame with unchanged height at half frame rate.
19063 </p>
19064 <div class="example">
19065 <pre class="example"> ------&gt; time
19066 Input:
19067 Frame 1         Frame 2         Frame 3         Frame 4
19068
19069 11111&lt;-         22222           33333&lt;-         44444
19070 11111           22222&lt;-         33333           44444&lt;-
19071 11111&lt;-         22222           33333&lt;-         44444
19072 11111           22222&lt;-         33333           44444&lt;-
19073
19074 Output:
19075 11111                           33333
19076 22222                           44444
19077 11111                           33333
19078 22222                           44444
19079 </pre></div>
19080
19081
19082 </dd>
19083 <dt>&lsquo;<samp>interleave_bottom, 5</samp>&rsquo;</dt>
19084 <dd><p>Interleave the lower field from odd frames with the upper field from
19085 even frames, generating a frame with unchanged height at half frame rate.
19086 </p>
19087 <div class="example">
19088 <pre class="example"> ------&gt; time
19089 Input:
19090 Frame 1         Frame 2         Frame 3         Frame 4
19091
19092 11111           22222&lt;-         33333           44444&lt;-
19093 11111&lt;-         22222           33333&lt;-         44444
19094 11111           22222&lt;-         33333           44444&lt;-
19095 11111&lt;-         22222           33333&lt;-         44444
19096
19097 Output:
19098 22222                           44444
19099 11111                           33333
19100 22222                           44444
19101 11111                           33333
19102 </pre></div>
19103
19104
19105 </dd>
19106 <dt>&lsquo;<samp>interlacex2, 6</samp>&rsquo;</dt>
19107 <dd><p>Double frame rate with unchanged height. Frames are inserted each
19108 containing the second temporal field from the previous input frame and
19109 the first temporal field from the next input frame. This mode relies on
19110 the top_field_first flag. Useful for interlaced video displays with no
19111 field synchronisation.
19112 </p>
19113 <div class="example">
19114 <pre class="example"> ------&gt; time
19115 Input:
19116 Frame 1         Frame 2         Frame 3         Frame 4
19117
19118 11111           22222           33333           44444
19119  11111           22222           33333           44444
19120 11111           22222           33333           44444
19121  11111           22222           33333           44444
19122
19123 Output:
19124 11111   22222   22222   33333   33333   44444   44444
19125  11111   11111   22222   22222   33333   33333   44444
19126 11111   22222   22222   33333   33333   44444   44444
19127  11111   11111   22222   22222   33333   33333   44444
19128 </pre></div>
19129
19130
19131 </dd>
19132 </dl>
19133
19134 <p>Numeric values are deprecated but are accepted for backward
19135 compatibility reasons.
19136 </p>
19137 <p>Default mode is <code>merge</code>.
19138 </p>
19139 </dd>
19140 <dt><samp>flags</samp></dt>
19141 <dd><p>Specify flags influencing the filter process.
19142 </p>
19143 <p>Available value for <var>flags</var> is:
19144 </p>
19145 <dl compact="compact">
19146 <dt><samp>low_pass_filter, vlfp</samp></dt>
19147 <dd><p>Enable vertical low-pass filtering in the filter.
19148 Vertical low-pass filtering is required when creating an interlaced
19149 destination from a progressive source which contains high-frequency
19150 vertical detail. Filtering will reduce interlace &rsquo;twitter&rsquo; and Moire
19151 patterning.
19152 </p>
19153 <p>Vertical low-pass filtering can only be enabled for <samp>mode</samp>
19154 <var>interleave_top</var> and <var>interleave_bottom</var>.
19155 </p>
19156 </dd>
19157 </dl>
19158 </dd>
19159 </dl>
19160
19161 <a name="transpose"></a>
19162 <h3 class="section">28.104 transpose<span class="pull-right"><a class="anchor hidden-xs" href="#transpose" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-transpose" aria-hidden="true">TOC</a></span></h3>
19163
19164 <p>Transpose rows with columns in the input video and optionally flip it.
19165 </p>
19166 <p>It accepts the following parameters:
19167 </p>
19168 <dl compact="compact">
19169 <dt><samp>dir</samp></dt>
19170 <dd><p>Specify the transposition direction.
19171 </p>
19172 <p>Can assume the following values:
19173 </p><dl compact="compact">
19174 <dt>&lsquo;<samp>0, 4, cclock_flip</samp>&rsquo;</dt>
19175 <dd><p>Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
19176 </p><div class="example">
19177 <pre class="example">L.R     L.l
19178 . . -&gt;  . .
19179 l.r     R.r
19180 </pre></div>
19181
19182 </dd>
19183 <dt>&lsquo;<samp>1, 5, clock</samp>&rsquo;</dt>
19184 <dd><p>Rotate by 90 degrees clockwise, that is:
19185 </p><div class="example">
19186 <pre class="example">L.R     l.L
19187 . . -&gt;  . .
19188 l.r     r.R
19189 </pre></div>
19190
19191 </dd>
19192 <dt>&lsquo;<samp>2, 6, cclock</samp>&rsquo;</dt>
19193 <dd><p>Rotate by 90 degrees counterclockwise, that is:
19194 </p><div class="example">
19195 <pre class="example">L.R     R.r
19196 . . -&gt;  . .
19197 l.r     L.l
19198 </pre></div>
19199
19200 </dd>
19201 <dt>&lsquo;<samp>3, 7, clock_flip</samp>&rsquo;</dt>
19202 <dd><p>Rotate by 90 degrees clockwise and vertically flip, that is:
19203 </p><div class="example">
19204 <pre class="example">L.R     r.R
19205 . . -&gt;  . .
19206 l.r     l.L
19207 </pre></div>
19208 </dd>
19209 </dl>
19210
19211 <p>For values between 4-7, the transposition is only done if the input
19212 video geometry is portrait and not landscape. These values are
19213 deprecated, the <code>passthrough</code> option should be used instead.
19214 </p>
19215 <p>Numerical values are deprecated, and should be dropped in favor of
19216 symbolic constants.
19217 </p>
19218 </dd>
19219 <dt><samp>passthrough</samp></dt>
19220 <dd><p>Do not apply the transposition if the input geometry matches the one
19221 specified by the specified value. It accepts the following values:
19222 </p><dl compact="compact">
19223 <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
19224 <dd><p>Always apply transposition.
19225 </p></dd>
19226 <dt>&lsquo;<samp>portrait</samp>&rsquo;</dt>
19227 <dd><p>Preserve portrait geometry (when <var>height</var> &gt;= <var>width</var>).
19228 </p></dd>
19229 <dt>&lsquo;<samp>landscape</samp>&rsquo;</dt>
19230 <dd><p>Preserve landscape geometry (when <var>width</var> &gt;= <var>height</var>).
19231 </p></dd>
19232 </dl>
19233
19234 <p>Default value is <code>none</code>.
19235 </p></dd>
19236 </dl>
19237
19238 <p>For example to rotate by 90 degrees clockwise and preserve portrait
19239 layout:
19240 </p><div class="example">
19241 <pre class="example">transpose=dir=1:passthrough=portrait
19242 </pre></div>
19243
19244 <p>The command above can also be specified as:
19245 </p><div class="example">
19246 <pre class="example">transpose=1:portrait
19247 </pre></div>
19248
19249 <a name="trim"></a>
19250 <h3 class="section">28.105 trim<span class="pull-right"><a class="anchor hidden-xs" href="#trim" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-trim" aria-hidden="true">TOC</a></span></h3>
19251 <p>Trim the input so that the output contains one continuous subpart of the input.
19252 </p>
19253 <p>It accepts the following parameters:
19254 </p><dl compact="compact">
19255 <dt><samp>start</samp></dt>
19256 <dd><p>Specify the time of the start of the kept section, i.e. the frame with the
19257 timestamp <var>start</var> will be the first frame in the output.
19258 </p>
19259 </dd>
19260 <dt><samp>end</samp></dt>
19261 <dd><p>Specify the time of the first frame that will be dropped, i.e. the frame
19262 immediately preceding the one with the timestamp <var>end</var> will be the last
19263 frame in the output.
19264 </p>
19265 </dd>
19266 <dt><samp>start_pts</samp></dt>
19267 <dd><p>This is the same as <var>start</var>, except this option sets the start timestamp
19268 in timebase units instead of seconds.
19269 </p>
19270 </dd>
19271 <dt><samp>end_pts</samp></dt>
19272 <dd><p>This is the same as <var>end</var>, except this option sets the end timestamp
19273 in timebase units instead of seconds.
19274 </p>
19275 </dd>
19276 <dt><samp>duration</samp></dt>
19277 <dd><p>The maximum duration of the output in seconds.
19278 </p>
19279 </dd>
19280 <dt><samp>start_frame</samp></dt>
19281 <dd><p>The number of the first frame that should be passed to the output.
19282 </p>
19283 </dd>
19284 <dt><samp>end_frame</samp></dt>
19285 <dd><p>The number of the first frame that should be dropped.
19286 </p></dd>
19287 </dl>
19288
19289 <p><samp>start</samp>, <samp>end</samp>, and <samp>duration</samp> are expressed as time
19290 duration specifications; see
19291 <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
19292 for the accepted syntax.
19293 </p>
19294 <p>Note that the first two sets of the start/end options and the <samp>duration</samp>
19295 option look at the frame timestamp, while the _frame variants simply count the
19296 frames that pass through the filter. Also note that this filter does not modify
19297 the timestamps. If you wish for the output timestamps to start at zero, insert a
19298 setpts filter after the trim filter.
19299 </p>
19300 <p>If multiple start or end options are set, this filter tries to be greedy and
19301 keep all the frames that match at least one of the specified constraints. To keep
19302 only the part that matches all the constraints at once, chain multiple trim
19303 filters.
19304 </p>
19305 <p>The defaults are such that all the input is kept. So it is possible to set e.g.
19306 just the end values to keep everything before the specified time.
19307 </p>
19308 <p>Examples:
19309 </p><ul>
19310 <li> Drop everything except the second minute of input:
19311 <div class="example">
19312 <pre class="example">ffmpeg -i INPUT -vf trim=60:120
19313 </pre></div>
19314
19315 </li><li> Keep only the first second:
19316 <div class="example">
19317 <pre class="example">ffmpeg -i INPUT -vf trim=duration=1
19318 </pre></div>
19319
19320 </li></ul>
19321
19322
19323 <a name="unsharp"></a><a name="unsharp-1"></a>
19324 <h3 class="section">28.106 unsharp<span class="pull-right"><a class="anchor hidden-xs" href="#unsharp-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-unsharp-1" aria-hidden="true">TOC</a></span></h3>
19325
19326 <p>Sharpen or blur the input video.
19327 </p>
19328 <p>It accepts the following parameters:
19329 </p>
19330 <dl compact="compact">
19331 <dt><samp>luma_msize_x, lx</samp></dt>
19332 <dd><p>Set the luma matrix horizontal size. It must be an odd integer between
19333 3 and 63. The default value is 5.
19334 </p>
19335 </dd>
19336 <dt><samp>luma_msize_y, ly</samp></dt>
19337 <dd><p>Set the luma matrix vertical size. It must be an odd integer between 3
19338 and 63. The default value is 5.
19339 </p>
19340 </dd>
19341 <dt><samp>luma_amount, la</samp></dt>
19342 <dd><p>Set the luma effect strength. It must be a floating point number, reasonable
19343 values lay between -1.5 and 1.5.
19344 </p>
19345 <p>Negative values will blur the input video, while positive values will
19346 sharpen it, a value of zero will disable the effect.
19347 </p>
19348 <p>Default value is 1.0.
19349 </p>
19350 </dd>
19351 <dt><samp>chroma_msize_x, cx</samp></dt>
19352 <dd><p>Set the chroma matrix horizontal size. It must be an odd integer
19353 between 3 and 63. The default value is 5.
19354 </p>
19355 </dd>
19356 <dt><samp>chroma_msize_y, cy</samp></dt>
19357 <dd><p>Set the chroma matrix vertical size. It must be an odd integer
19358 between 3 and 63. The default value is 5.
19359 </p>
19360 </dd>
19361 <dt><samp>chroma_amount, ca</samp></dt>
19362 <dd><p>Set the chroma effect strength. It must be a floating point number, reasonable
19363 values lay between -1.5 and 1.5.
19364 </p>
19365 <p>Negative values will blur the input video, while positive values will
19366 sharpen it, a value of zero will disable the effect.
19367 </p>
19368 <p>Default value is 0.0.
19369 </p>
19370 </dd>
19371 <dt><samp>opencl</samp></dt>
19372 <dd><p>If set to 1, specify using OpenCL capabilities, only available if
19373 FFmpeg was configured with <code>--enable-opencl</code>. Default value is 0.
19374 </p>
19375 </dd>
19376 </dl>
19377
19378 <p>All parameters are optional and default to the equivalent of the
19379 string &rsquo;5:5:1.0:5:5:0.0&rsquo;.
19380 </p>
19381 <a name="Examples-79"></a>
19382 <h4 class="subsection">28.106.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-79" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-79" aria-hidden="true">TOC</a></span></h4>
19383
19384 <ul>
19385 <li> Apply strong luma sharpen effect:
19386 <div class="example">
19387 <pre class="example">unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
19388 </pre></div>
19389
19390 </li><li> Apply a strong blur of both luma and chroma parameters:
19391 <div class="example">
19392 <pre class="example">unsharp=7:7:-2:7:7:-2
19393 </pre></div>
19394 </li></ul>
19395
19396 <a name="uspp"></a>
19397 <h3 class="section">28.107 uspp<span class="pull-right"><a class="anchor hidden-xs" href="#uspp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-uspp" aria-hidden="true">TOC</a></span></h3>
19398
19399 <p>Apply ultra slow/simple postprocessing filter that compresses and decompresses
19400 the image at several (or - in the case of <samp>quality</samp> level <code>8</code> - all)
19401 shifts and average the results.
19402 </p>
19403 <p>The way this differs from the behavior of spp is that uspp actually encodes &amp;
19404 decodes each case with libavcodec Snow, whereas spp uses a simplified intra only 8x8
19405 DCT similar to MJPEG.
19406 </p>
19407 <p>The filter accepts the following options:
19408 </p>
19409 <dl compact="compact">
19410 <dt><samp>quality</samp></dt>
19411 <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
19412 an integer in the range 0-8. If set to <code>0</code>, the filter will have no
19413 effect. A value of <code>8</code> means the higher quality. For each increment of
19414 that value the speed drops by a factor of approximately 2.  Default value is
19415 <code>3</code>.
19416 </p>
19417 </dd>
19418 <dt><samp>qp</samp></dt>
19419 <dd><p>Force a constant quantization parameter. If not set, the filter will use the QP
19420 from the video stream (if available).
19421 </p></dd>
19422 </dl>
19423
19424 <a name="vidstabdetect"></a><a name="vidstabdetect-1"></a>
19425 <h3 class="section">28.108 vidstabdetect<span class="pull-right"><a class="anchor hidden-xs" href="#vidstabdetect-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vidstabdetect-1" aria-hidden="true">TOC</a></span></h3>
19426
19427 <p>Analyze video stabilization/deshaking. Perform pass 1 of 2, see
19428 <a href="#vidstabtransform">vidstabtransform</a> for pass 2.
19429 </p>
19430 <p>This filter generates a file with relative translation and rotation
19431 transform information about subsequent frames, which is then used by
19432 the <a href="#vidstabtransform">vidstabtransform</a> filter.
19433 </p>
19434 <p>To enable compilation of this filter you need to configure FFmpeg with
19435 <code>--enable-libvidstab</code>.
19436 </p>
19437 <p>This filter accepts the following options:
19438 </p>
19439 <dl compact="compact">
19440 <dt><samp>result</samp></dt>
19441 <dd><p>Set the path to the file used to write the transforms information.
19442 Default value is <samp>transforms.trf</samp>.
19443 </p>
19444 </dd>
19445 <dt><samp>shakiness</samp></dt>
19446 <dd><p>Set how shaky the video is and how quick the camera is. It accepts an
19447 integer in the range 1-10, a value of 1 means little shakiness, a
19448 value of 10 means strong shakiness. Default value is 5.
19449 </p>
19450 </dd>
19451 <dt><samp>accuracy</samp></dt>
19452 <dd><p>Set the accuracy of the detection process. It must be a value in the
19453 range 1-15. A value of 1 means low accuracy, a value of 15 means high
19454 accuracy. Default value is 15.
19455 </p>
19456 </dd>
19457 <dt><samp>stepsize</samp></dt>
19458 <dd><p>Set stepsize of the search process. The region around minimum is
19459 scanned with 1 pixel resolution. Default value is 6.
19460 </p>
19461 </dd>
19462 <dt><samp>mincontrast</samp></dt>
19463 <dd><p>Set minimum contrast. Below this value a local measurement field is
19464 discarded. Must be a floating point value in the range 0-1. Default
19465 value is 0.3.
19466 </p>
19467 </dd>
19468 <dt><samp>tripod</samp></dt>
19469 <dd><p>Set reference frame number for tripod mode.
19470 </p>
19471 <p>If enabled, the motion of the frames is compared to a reference frame
19472 in the filtered stream, identified by the specified number. The idea
19473 is to compensate all movements in a more-or-less static scene and keep
19474 the camera view absolutely still.
19475 </p>
19476 <p>If set to 0, it is disabled. The frames are counted starting from 1.
19477 </p>
19478 </dd>
19479 <dt><samp>show</samp></dt>
19480 <dd><p>Show fields and transforms in the resulting frames. It accepts an
19481 integer in the range 0-2. Default value is 0, which disables any
19482 visualization.
19483 </p></dd>
19484 </dl>
19485
19486 <a name="Examples-80"></a>
19487 <h4 class="subsection">28.108.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-80" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-80" aria-hidden="true">TOC</a></span></h4>
19488
19489 <ul>
19490 <li> Use default values:
19491 <div class="example">
19492 <pre class="example">vidstabdetect
19493 </pre></div>
19494
19495 </li><li> Analyze strongly shaky movie and put the results in file
19496 <samp>mytransforms.trf</samp>:
19497 <div class="example">
19498 <pre class="example">vidstabdetect=shakiness=10:accuracy=15:result=&quot;mytransforms.trf&quot;
19499 </pre></div>
19500
19501 </li><li> Visualize the result of internal transformations in the resulting
19502 video:
19503 <div class="example">
19504 <pre class="example">vidstabdetect=show=1
19505 </pre></div>
19506
19507 </li><li> Analyze a video with medium shakiness using <code>ffmpeg</code>:
19508 <div class="example">
19509 <pre class="example">ffmpeg -i input -vf vidstabdetect=shakiness=5:show=1 dummy.avi
19510 </pre></div>
19511 </li></ul>
19512
19513 <a name="vidstabtransform"></a><a name="vidstabtransform-1"></a>
19514 <h3 class="section">28.109 vidstabtransform<span class="pull-right"><a class="anchor hidden-xs" href="#vidstabtransform-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vidstabtransform-1" aria-hidden="true">TOC</a></span></h3>
19515
19516 <p>Video stabilization/deshaking: pass 2 of 2,
19517 see <a href="#vidstabdetect">vidstabdetect</a> for pass 1.
19518 </p>
19519 <p>Read a file with transform information for each frame and
19520 apply/compensate them. Together with the <a href="#vidstabdetect">vidstabdetect</a>
19521 filter this can be used to deshake videos. See also
19522 <a href="http://public.hronopik.de/vid.stab">http://public.hronopik.de/vid.stab</a>. It is important to also use
19523 the <a href="#unsharp">unsharp</a> filter, see below.
19524 </p>
19525 <p>To enable compilation of this filter you need to configure FFmpeg with
19526 <code>--enable-libvidstab</code>.
19527 </p>
19528 <a name="Options-19"></a>
19529 <h4 class="subsection">28.109.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-19" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-19" aria-hidden="true">TOC</a></span></h4>
19530
19531 <dl compact="compact">
19532 <dt><samp>input</samp></dt>
19533 <dd><p>Set path to the file used to read the transforms. Default value is
19534 <samp>transforms.trf</samp>.
19535 </p>
19536 </dd>
19537 <dt><samp>smoothing</samp></dt>
19538 <dd><p>Set the number of frames (value*2 + 1) used for lowpass filtering the
19539 camera movements. Default value is 10.
19540 </p>
19541 <p>For example a number of 10 means that 21 frames are used (10 in the
19542 past and 10 in the future) to smoothen the motion in the video. A
19543 larger value leads to a smoother video, but limits the acceleration of
19544 the camera (pan/tilt movements). 0 is a special case where a static
19545 camera is simulated.
19546 </p>
19547 </dd>
19548 <dt><samp>optalgo</samp></dt>
19549 <dd><p>Set the camera path optimization algorithm.
19550 </p>
19551 <p>Accepted values are:
19552 </p><dl compact="compact">
19553 <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
19554 <dd><p>gaussian kernel low-pass filter on camera motion (default)
19555 </p></dd>
19556 <dt>&lsquo;<samp>avg</samp>&rsquo;</dt>
19557 <dd><p>averaging on transformations
19558 </p></dd>
19559 </dl>
19560
19561 </dd>
19562 <dt><samp>maxshift</samp></dt>
19563 <dd><p>Set maximal number of pixels to translate frames. Default value is -1,
19564 meaning no limit.
19565 </p>
19566 </dd>
19567 <dt><samp>maxangle</samp></dt>
19568 <dd><p>Set maximal angle in radians (degree*PI/180) to rotate frames. Default
19569 value is -1, meaning no limit.
19570 </p>
19571 </dd>
19572 <dt><samp>crop</samp></dt>
19573 <dd><p>Specify how to deal with borders that may be visible due to movement
19574 compensation.
19575 </p>
19576 <p>Available values are:
19577 </p><dl compact="compact">
19578 <dt>&lsquo;<samp>keep</samp>&rsquo;</dt>
19579 <dd><p>keep image information from previous frame (default)
19580 </p></dd>
19581 <dt>&lsquo;<samp>black</samp>&rsquo;</dt>
19582 <dd><p>fill the border black
19583 </p></dd>
19584 </dl>
19585
19586 </dd>
19587 <dt><samp>invert</samp></dt>
19588 <dd><p>Invert transforms if set to 1. Default value is 0.
19589 </p>
19590 </dd>
19591 <dt><samp>relative</samp></dt>
19592 <dd><p>Consider transforms as relative to previous frame if set to 1,
19593 absolute if set to 0. Default value is 0.
19594 </p>
19595 </dd>
19596 <dt><samp>zoom</samp></dt>
19597 <dd><p>Set percentage to zoom. A positive value will result in a zoom-in
19598 effect, a negative value in a zoom-out effect. Default value is 0 (no
19599 zoom).
19600 </p>
19601 </dd>
19602 <dt><samp>optzoom</samp></dt>
19603 <dd><p>Set optimal zooming to avoid borders.
19604 </p>
19605 <p>Accepted values are:
19606 </p><dl compact="compact">
19607 <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
19608 <dd><p>disabled
19609 </p></dd>
19610 <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
19611 <dd><p>optimal static zoom value is determined (only very strong movements
19612 will lead to visible borders) (default)
19613 </p></dd>
19614 <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
19615 <dd><p>optimal adaptive zoom value is determined (no borders will be
19616 visible), see <samp>zoomspeed</samp>
19617 </p></dd>
19618 </dl>
19619
19620 <p>Note that the value given at zoom is added to the one calculated here.
19621 </p>
19622 </dd>
19623 <dt><samp>zoomspeed</samp></dt>
19624 <dd><p>Set percent to zoom maximally each frame (enabled when
19625 <samp>optzoom</samp> is set to 2). Range is from 0 to 5, default value is
19626 0.25.
19627 </p>
19628 </dd>
19629 <dt><samp>interpol</samp></dt>
19630 <dd><p>Specify type of interpolation.
19631 </p>
19632 <p>Available values are:
19633 </p><dl compact="compact">
19634 <dt>&lsquo;<samp>no</samp>&rsquo;</dt>
19635 <dd><p>no interpolation
19636 </p></dd>
19637 <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
19638 <dd><p>linear only horizontal
19639 </p></dd>
19640 <dt>&lsquo;<samp>bilinear</samp>&rsquo;</dt>
19641 <dd><p>linear in both directions (default)
19642 </p></dd>
19643 <dt>&lsquo;<samp>bicubic</samp>&rsquo;</dt>
19644 <dd><p>cubic in both directions (slow)
19645 </p></dd>
19646 </dl>
19647
19648 </dd>
19649 <dt><samp>tripod</samp></dt>
19650 <dd><p>Enable virtual tripod mode if set to 1, which is equivalent to
19651 <code>relative=0:smoothing=0</code>. Default value is 0.
19652 </p>
19653 <p>Use also <code>tripod</code> option of <a href="#vidstabdetect">vidstabdetect</a>.
19654 </p>
19655 </dd>
19656 <dt><samp>debug</samp></dt>
19657 <dd><p>Increase log verbosity if set to 1. Also the detected global motions
19658 are written to the temporary file <samp>global_motions.trf</samp>. Default
19659 value is 0.
19660 </p></dd>
19661 </dl>
19662
19663 <a name="Examples-81"></a>
19664 <h4 class="subsection">28.109.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-81" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-81" aria-hidden="true">TOC</a></span></h4>
19665
19666 <ul>
19667 <li> Use <code>ffmpeg</code> for a typical stabilization with default values:
19668 <div class="example">
19669 <pre class="example">ffmpeg -i inp.mpeg -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4 inp_stabilized.mpeg
19670 </pre></div>
19671
19672 <p>Note the use of the <a href="#unsharp">unsharp</a> filter which is always recommended.
19673 </p>
19674 </li><li> Zoom in a bit more and load transform data from a given file:
19675 <div class="example">
19676 <pre class="example">vidstabtransform=zoom=5:input=&quot;mytransforms.trf&quot;
19677 </pre></div>
19678
19679 </li><li> Smoothen the video even more:
19680 <div class="example">
19681 <pre class="example">vidstabtransform=smoothing=30
19682 </pre></div>
19683 </li></ul>
19684
19685 <a name="vflip"></a>
19686 <h3 class="section">28.110 vflip<span class="pull-right"><a class="anchor hidden-xs" href="#vflip" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vflip" aria-hidden="true">TOC</a></span></h3>
19687
19688 <p>Flip the input video vertically.
19689 </p>
19690 <p>For example, to vertically flip a video with <code>ffmpeg</code>:
19691 </p><div class="example">
19692 <pre class="example">ffmpeg -i in.avi -vf &quot;vflip&quot; out.avi
19693 </pre></div>
19694
19695 <a name="vignette"></a><a name="vignette-1"></a>
19696 <h3 class="section">28.111 vignette<span class="pull-right"><a class="anchor hidden-xs" href="#vignette-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vignette-1" aria-hidden="true">TOC</a></span></h3>
19697
19698 <p>Make or reverse a natural vignetting effect.
19699 </p>
19700 <p>The filter accepts the following options:
19701 </p>
19702 <dl compact="compact">
19703 <dt><samp>angle, a</samp></dt>
19704 <dd><p>Set lens angle expression as a number of radians.
19705 </p>
19706 <p>The value is clipped in the <code>[0,PI/2]</code> range.
19707 </p>
19708 <p>Default value: <code>&quot;PI/5&quot;</code>
19709 </p>
19710 </dd>
19711 <dt><samp>x0</samp></dt>
19712 <dt><samp>y0</samp></dt>
19713 <dd><p>Set center coordinates expressions. Respectively <code>&quot;w/2&quot;</code> and <code>&quot;h/2&quot;</code>
19714 by default.
19715 </p>
19716 </dd>
19717 <dt><samp>mode</samp></dt>
19718 <dd><p>Set forward/backward mode.
19719 </p>
19720 <p>Available modes are:
19721 </p><dl compact="compact">
19722 <dt>&lsquo;<samp>forward</samp>&rsquo;</dt>
19723 <dd><p>The larger the distance from the central point, the darker the image becomes.
19724 </p>
19725 </dd>
19726 <dt>&lsquo;<samp>backward</samp>&rsquo;</dt>
19727 <dd><p>The larger the distance from the central point, the brighter the image becomes.
19728 This can be used to reverse a vignette effect, though there is no automatic
19729 detection to extract the lens <samp>angle</samp> and other settings (yet). It can
19730 also be used to create a burning effect.
19731 </p></dd>
19732 </dl>
19733
19734 <p>Default value is &lsquo;<samp>forward</samp>&rsquo;.
19735 </p>
19736 </dd>
19737 <dt><samp>eval</samp></dt>
19738 <dd><p>Set evaluation mode for the expressions (<samp>angle</samp>, <samp>x0</samp>, <samp>y0</samp>).
19739 </p>
19740 <p>It accepts the following values:
19741 </p><dl compact="compact">
19742 <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
19743 <dd><p>Evaluate expressions only once during the filter initialization.
19744 </p>
19745 </dd>
19746 <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
19747 <dd><p>Evaluate expressions for each incoming frame. This is way slower than the
19748 &lsquo;<samp>init</samp>&rsquo; mode since it requires all the scalers to be re-computed, but it
19749 allows advanced dynamic expressions.
19750 </p></dd>
19751 </dl>
19752
19753 <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
19754 </p>
19755 </dd>
19756 <dt><samp>dither</samp></dt>
19757 <dd><p>Set dithering to reduce the circular banding effects. Default is <code>1</code>
19758 (enabled).
19759 </p>
19760 </dd>
19761 <dt><samp>aspect</samp></dt>
19762 <dd><p>Set vignette aspect. This setting allows one to adjust the shape of the vignette.
19763 Setting this value to the SAR of the input will make a rectangular vignetting
19764 following the dimensions of the video.
19765 </p>
19766 <p>Default is <code>1/1</code>.
19767 </p></dd>
19768 </dl>
19769
19770 <a name="Expressions"></a>
19771 <h4 class="subsection">28.111.1 Expressions<span class="pull-right"><a class="anchor hidden-xs" href="#Expressions" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Expressions" aria-hidden="true">TOC</a></span></h4>
19772
19773 <p>The <samp>alpha</samp>, <samp>x0</samp> and <samp>y0</samp> expressions can contain the
19774 following parameters.
19775 </p>
19776 <dl compact="compact">
19777 <dt><samp>w</samp></dt>
19778 <dt><samp>h</samp></dt>
19779 <dd><p>input width and height
19780 </p>
19781 </dd>
19782 <dt><samp>n</samp></dt>
19783 <dd><p>the number of input frame, starting from 0
19784 </p>
19785 </dd>
19786 <dt><samp>pts</samp></dt>
19787 <dd><p>the PTS (Presentation TimeStamp) time of the filtered video frame, expressed in
19788 <var>TB</var> units, NAN if undefined
19789 </p>
19790 </dd>
19791 <dt><samp>r</samp></dt>
19792 <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
19793 </p>
19794 </dd>
19795 <dt><samp>t</samp></dt>
19796 <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
19797 expressed in seconds, NAN if undefined
19798 </p>
19799 </dd>
19800 <dt><samp>tb</samp></dt>
19801 <dd><p>time base of the input video
19802 </p></dd>
19803 </dl>
19804
19805
19806 <a name="Examples-82"></a>
19807 <h4 class="subsection">28.111.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-82" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-82" aria-hidden="true">TOC</a></span></h4>
19808
19809 <ul>
19810 <li> Apply simple strong vignetting effect:
19811 <div class="example">
19812 <pre class="example">vignette=PI/4
19813 </pre></div>
19814
19815 </li><li> Make a flickering vignetting:
19816 <div class="example">
19817 <pre class="example">vignette='PI/4+random(1)*PI/50':eval=frame
19818 </pre></div>
19819
19820 </li></ul>
19821
19822 <a name="w3fdif"></a>
19823 <h3 class="section">28.112 w3fdif<span class="pull-right"><a class="anchor hidden-xs" href="#w3fdif" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-w3fdif" aria-hidden="true">TOC</a></span></h3>
19824
19825 <p>Deinterlace the input video (&quot;w3fdif&quot; stands for &quot;Weston 3 Field
19826 Deinterlacing Filter&quot;).
19827 </p>
19828 <p>Based on the process described by Martin Weston for BBC R&amp;D, and
19829 implemented based on the de-interlace algorithm written by Jim
19830 Easterbrook for BBC R&amp;D, the Weston 3 field deinterlacing filter
19831 uses filter coefficients calculated by BBC R&amp;D.
19832 </p>
19833 <p>There are two sets of filter coefficients, so called &quot;simple&quot;:
19834 and &quot;complex&quot;. Which set of filter coefficients is used can
19835 be set by passing an optional parameter:
19836 </p>
19837 <dl compact="compact">
19838 <dt><samp>filter</samp></dt>
19839 <dd><p>Set the interlacing filter coefficients. Accepts one of the following values:
19840 </p>
19841 <dl compact="compact">
19842 <dt>&lsquo;<samp>simple</samp>&rsquo;</dt>
19843 <dd><p>Simple filter coefficient set.
19844 </p></dd>
19845 <dt>&lsquo;<samp>complex</samp>&rsquo;</dt>
19846 <dd><p>More-complex filter coefficient set.
19847 </p></dd>
19848 </dl>
19849 <p>Default value is &lsquo;<samp>complex</samp>&rsquo;.
19850 </p>
19851 </dd>
19852 <dt><samp>deint</samp></dt>
19853 <dd><p>Specify which frames to deinterlace. Accept one of the following values:
19854 </p>
19855 <dl compact="compact">
19856 <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
19857 <dd><p>Deinterlace all frames,
19858 </p></dd>
19859 <dt>&lsquo;<samp>interlaced</samp>&rsquo;</dt>
19860 <dd><p>Only deinterlace frames marked as interlaced.
19861 </p></dd>
19862 </dl>
19863
19864 <p>Default value is &lsquo;<samp>all</samp>&rsquo;.
19865 </p></dd>
19866 </dl>
19867
19868 <a name="xbr"></a>
19869 <h3 class="section">28.113 xbr<span class="pull-right"><a class="anchor hidden-xs" href="#xbr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xbr" aria-hidden="true">TOC</a></span></h3>
19870 <p>Apply the xBR high-quality magnification filter which is designed for pixel
19871 art. It follows a set of edge-detection rules, see
19872 <a href="http://www.libretro.com/forums/viewtopic.php?f=6&amp;t=134">http://www.libretro.com/forums/viewtopic.php?f=6&amp;t=134</a>.
19873 </p>
19874 <p>It accepts the following option:
19875 </p>
19876 <dl compact="compact">
19877 <dt><samp>n</samp></dt>
19878 <dd><p>Set the scaling dimension: <code>2</code> for <code>2xBR</code>, <code>3</code> for
19879 <code>3xBR</code> and <code>4</code> for <code>4xBR</code>.
19880 Default is <code>3</code>.
19881 </p></dd>
19882 </dl>
19883
19884 <a name="yadif"></a><a name="yadif-1"></a>
19885 <h3 class="section">28.114 yadif<span class="pull-right"><a class="anchor hidden-xs" href="#yadif-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-yadif-1" aria-hidden="true">TOC</a></span></h3>
19886
19887 <p>Deinterlace the input video (&quot;yadif&quot; means &quot;yet another deinterlacing
19888 filter&quot;).
19889 </p>
19890 <p>It accepts the following parameters:
19891 </p>
19892
19893 <dl compact="compact">
19894 <dt><samp>mode</samp></dt>
19895 <dd><p>The interlacing mode to adopt. It accepts one of the following values:
19896 </p>
19897 <dl compact="compact">
19898 <dt><samp>0, send_frame</samp></dt>
19899 <dd><p>Output one frame for each frame.
19900 </p></dd>
19901 <dt><samp>1, send_field</samp></dt>
19902 <dd><p>Output one frame for each field.
19903 </p></dd>
19904 <dt><samp>2, send_frame_nospatial</samp></dt>
19905 <dd><p>Like <code>send_frame</code>, but it skips the spatial interlacing check.
19906 </p></dd>
19907 <dt><samp>3, send_field_nospatial</samp></dt>
19908 <dd><p>Like <code>send_field</code>, but it skips the spatial interlacing check.
19909 </p></dd>
19910 </dl>
19911
19912 <p>The default value is <code>send_frame</code>.
19913 </p>
19914 </dd>
19915 <dt><samp>parity</samp></dt>
19916 <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
19917 of the following values:
19918 </p>
19919 <dl compact="compact">
19920 <dt><samp>0, tff</samp></dt>
19921 <dd><p>Assume the top field is first.
19922 </p></dd>
19923 <dt><samp>1, bff</samp></dt>
19924 <dd><p>Assume the bottom field is first.
19925 </p></dd>
19926 <dt><samp>-1, auto</samp></dt>
19927 <dd><p>Enable automatic detection of field parity.
19928 </p></dd>
19929 </dl>
19930
19931 <p>The default value is <code>auto</code>.
19932 If the interlacing is unknown or the decoder does not export this information,
19933 top field first will be assumed.
19934 </p>
19935 </dd>
19936 <dt><samp>deint</samp></dt>
19937 <dd><p>Specify which frames to deinterlace. Accept one of the following
19938 values:
19939 </p>
19940 <dl compact="compact">
19941 <dt><samp>0, all</samp></dt>
19942 <dd><p>Deinterlace all frames.
19943 </p></dd>
19944 <dt><samp>1, interlaced</samp></dt>
19945 <dd><p>Only deinterlace frames marked as interlaced.
19946 </p></dd>
19947 </dl>
19948
19949 <p>The default value is <code>all</code>.
19950 </p></dd>
19951 </dl>
19952
19953 <a name="zoompan"></a>
19954 <h3 class="section">28.115 zoompan<span class="pull-right"><a class="anchor hidden-xs" href="#zoompan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-zoompan" aria-hidden="true">TOC</a></span></h3>
19955
19956 <p>Apply Zoom &amp; Pan effect.
19957 </p>
19958 <p>This filter accepts the following options:
19959 </p>
19960 <dl compact="compact">
19961 <dt><samp>zoom, z</samp></dt>
19962 <dd><p>Set the zoom expression. Default is 1.
19963 </p>
19964 </dd>
19965 <dt><samp>x</samp></dt>
19966 <dt><samp>y</samp></dt>
19967 <dd><p>Set the x and y expression. Default is 0.
19968 </p>
19969 </dd>
19970 <dt><samp>d</samp></dt>
19971 <dd><p>Set the duration expression in number of frames.
19972 This sets for how many number of frames effect will last for
19973 single input image.
19974 </p>
19975 </dd>
19976 <dt><samp>s</samp></dt>
19977 <dd><p>Set the output image size, default is &rsquo;hd720&rsquo;.
19978 </p></dd>
19979 </dl>
19980
19981 <p>Each expression can contain the following constants:
19982 </p>
19983 <dl compact="compact">
19984 <dt><samp>in_w, iw</samp></dt>
19985 <dd><p>Input width.
19986 </p>
19987 </dd>
19988 <dt><samp>in_h, ih</samp></dt>
19989 <dd><p>Input height.
19990 </p>
19991 </dd>
19992 <dt><samp>out_w, ow</samp></dt>
19993 <dd><p>Output width.
19994 </p>
19995 </dd>
19996 <dt><samp>out_h, oh</samp></dt>
19997 <dd><p>Output height.
19998 </p>
19999 </dd>
20000 <dt><samp>in</samp></dt>
20001 <dd><p>Input frame count.
20002 </p>
20003 </dd>
20004 <dt><samp>on</samp></dt>
20005 <dd><p>Output frame count.
20006 </p>
20007 </dd>
20008 <dt><samp>x</samp></dt>
20009 <dt><samp>y</samp></dt>
20010 <dd><p>Last calculated &rsquo;x&rsquo; and &rsquo;y&rsquo; position from &rsquo;x&rsquo; and &rsquo;y&rsquo; expression
20011 for current input frame.
20012 </p>
20013 </dd>
20014 <dt><samp>px</samp></dt>
20015 <dt><samp>py</samp></dt>
20016 <dd><p>&rsquo;x&rsquo; and &rsquo;y&rsquo; of last output frame of previous input frame or 0 when there was
20017 not yet such frame (first input frame).
20018 </p>
20019 </dd>
20020 <dt><samp>zoom</samp></dt>
20021 <dd><p>Last calculated zoom from &rsquo;z&rsquo; expression for current input frame.
20022 </p>
20023 </dd>
20024 <dt><samp>pzoom</samp></dt>
20025 <dd><p>Last calculated zoom of last output frame of previous input frame.
20026 </p>
20027 </dd>
20028 <dt><samp>duration</samp></dt>
20029 <dd><p>Number of output frames for current input frame. Calculated from &rsquo;d&rsquo; expression
20030 for each input frame.
20031 </p>
20032 </dd>
20033 <dt><samp>pduration</samp></dt>
20034 <dd><p>number of output frames created for previous input frame
20035 </p>
20036 </dd>
20037 <dt><samp>a</samp></dt>
20038 <dd><p>Rational number: input width / input height
20039 </p>
20040 </dd>
20041 <dt><samp>sar</samp></dt>
20042 <dd><p>sample aspect ratio
20043 </p>
20044 </dd>
20045 <dt><samp>dar</samp></dt>
20046 <dd><p>display aspect ratio
20047 </p>
20048 </dd>
20049 </dl>
20050
20051 <a name="Examples-83"></a>
20052 <h4 class="subsection">28.115.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-83" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-83" aria-hidden="true">TOC</a></span></h4>
20053
20054 <ul>
20055 <li> Zoom-in up to 1.5 and pan at same time to some spot near center of picture:
20056 <div class="example">
20057 <pre class="example">zoompan=z='min(zoom+0.0015,1.5)':d=700:x='if(gte(zoom,1.5),x,x+1/a)':y='if(gte(zoom,1.5),y,y+1)':s=640x360
20058 </pre></div>
20059 </li></ul>
20060
20061
20062 <a name="Video-Sources"></a>
20063 <h2 class="chapter">29 Video Sources<span class="pull-right"><a class="anchor hidden-xs" href="#Video-Sources" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-Sources" aria-hidden="true">TOC</a></span></h2>
20064
20065 <p>Below is a description of the currently available video sources.
20066 </p>
20067 <a name="buffer"></a>
20068 <h3 class="section">29.1 buffer<span class="pull-right"><a class="anchor hidden-xs" href="#buffer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-buffer" aria-hidden="true">TOC</a></span></h3>
20069
20070 <p>Buffer video frames, and make them available to the filter chain.
20071 </p>
20072 <p>This source is mainly intended for a programmatic use, in particular
20073 through the interface defined in <samp>libavfilter/vsrc_buffer.h</samp>.
20074 </p>
20075 <p>It accepts the following parameters:
20076 </p>
20077 <dl compact="compact">
20078 <dt><samp>video_size</samp></dt>
20079 <dd><p>Specify the size (width and height) of the buffered video frames. For the
20080 syntax of this option, check the
20081 <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
20082 </p>
20083 </dd>
20084 <dt><samp>width</samp></dt>
20085 <dd><p>The input video width.
20086 </p>
20087 </dd>
20088 <dt><samp>height</samp></dt>
20089 <dd><p>The input video height.
20090 </p>
20091 </dd>
20092 <dt><samp>pix_fmt</samp></dt>
20093 <dd><p>A string representing the pixel format of the buffered video frames.
20094 It may be a number corresponding to a pixel format, or a pixel format
20095 name.
20096 </p>
20097 </dd>
20098 <dt><samp>time_base</samp></dt>
20099 <dd><p>Specify the timebase assumed by the timestamps of the buffered frames.
20100 </p>
20101 </dd>
20102 <dt><samp>frame_rate</samp></dt>
20103 <dd><p>Specify the frame rate expected for the video stream.
20104 </p>
20105 </dd>
20106 <dt><samp>pixel_aspect, sar</samp></dt>
20107 <dd><p>The sample (pixel) aspect ratio of the input video.
20108 </p>
20109 </dd>
20110 <dt><samp>sws_param</samp></dt>
20111 <dd><p>Specify the optional parameters to be used for the scale filter which
20112 is automatically inserted when an input change is detected in the
20113 input size or format.
20114 </p></dd>
20115 </dl>
20116
20117 <p>For example:
20118 </p><div class="example">
20119 <pre class="example">buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
20120 </pre></div>
20121
20122 <p>will instruct the source to accept video frames with size 320x240 and
20123 with format &quot;yuv410p&quot;, assuming 1/24 as the timestamps timebase and
20124 square pixels (1:1 sample aspect ratio).
20125 Since the pixel format with name &quot;yuv410p&quot; corresponds to the number 6
20126 (check the enum AVPixelFormat definition in <samp>libavutil/pixfmt.h</samp>),
20127 this example corresponds to:
20128 </p><div class="example">
20129 <pre class="example">buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
20130 </pre></div>
20131
20132 <p>Alternatively, the options can be specified as a flat string, but this
20133 syntax is deprecated:
20134 </p>
20135 <p><var>width</var>:<var>height</var>:<var>pix_fmt</var>:<var>time_base.num</var>:<var>time_base.den</var>:<var>pixel_aspect.num</var>:<var>pixel_aspect.den</var>[:<var>sws_param</var>]
20136 </p>
20137 <a name="cellauto"></a>
20138 <h3 class="section">29.2 cellauto<span class="pull-right"><a class="anchor hidden-xs" href="#cellauto" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cellauto" aria-hidden="true">TOC</a></span></h3>
20139
20140 <p>Create a pattern generated by an elementary cellular automaton.
20141 </p>
20142 <p>The initial state of the cellular automaton can be defined through the
20143 <samp>filename</samp>, and <samp>pattern</samp> options. If such options are
20144 not specified an initial state is created randomly.
20145 </p>
20146 <p>At each new frame a new row in the video is filled with the result of
20147 the cellular automaton next generation. The behavior when the whole
20148 frame is filled is defined by the <samp>scroll</samp> option.
20149 </p>
20150 <p>This source accepts the following options:
20151 </p>
20152 <dl compact="compact">
20153 <dt><samp>filename, f</samp></dt>
20154 <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
20155 the specified file.
20156 In the file, each non-whitespace character is considered an alive
20157 cell, a newline will terminate the row, and further characters in the
20158 file will be ignored.
20159 </p>
20160 </dd>
20161 <dt><samp>pattern, p</samp></dt>
20162 <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
20163 the specified string.
20164 </p>
20165 <p>Each non-whitespace character in the string is considered an alive
20166 cell, a newline will terminate the row, and further characters in the
20167 string will be ignored.
20168 </p>
20169 </dd>
20170 <dt><samp>rate, r</samp></dt>
20171 <dd><p>Set the video rate, that is the number of frames generated per second.
20172 Default is 25.
20173 </p>
20174 </dd>
20175 <dt><samp>random_fill_ratio, ratio</samp></dt>
20176 <dd><p>Set the random fill ratio for the initial cellular automaton row. It
20177 is a floating point number value ranging from 0 to 1, defaults to
20178 1/PHI.
20179 </p>
20180 <p>This option is ignored when a file or a pattern is specified.
20181 </p>
20182 </dd>
20183 <dt><samp>random_seed, seed</samp></dt>
20184 <dd><p>Set the seed for filling randomly the initial row, must be an integer
20185 included between 0 and UINT32_MAX. If not specified, or if explicitly
20186 set to -1, the filter will try to use a good random seed on a best
20187 effort basis.
20188 </p>
20189 </dd>
20190 <dt><samp>rule</samp></dt>
20191 <dd><p>Set the cellular automaton rule, it is a number ranging from 0 to 255.
20192 Default value is 110.
20193 </p>
20194 </dd>
20195 <dt><samp>size, s</samp></dt>
20196 <dd><p>Set the size of the output video. For the syntax of this option, check the
20197 <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
20198 </p>
20199 <p>If <samp>filename</samp> or <samp>pattern</samp> is specified, the size is set
20200 by default to the width of the specified initial state row, and the
20201 height is set to <var>width</var> * PHI.
20202 </p>
20203 <p>If <samp>size</samp> is set, it must contain the width of the specified
20204 pattern string, and the specified pattern will be centered in the
20205 larger row.
20206 </p>
20207 <p>If a filename or a pattern string is not specified, the size value
20208 defaults to &quot;320x518&quot; (used for a randomly generated initial state).
20209 </p>
20210 </dd>
20211 <dt><samp>scroll</samp></dt>
20212 <dd><p>If set to 1, scroll the output upward when all the rows in the output
20213 have been already filled. If set to 0, the new generated row will be
20214 written over the top row just after the bottom row is filled.
20215 Defaults to 1.
20216 </p>
20217 </dd>
20218 <dt><samp>start_full, full</samp></dt>
20219 <dd><p>If set to 1, completely fill the output with generated rows before
20220 outputting the first frame.
20221 This is the default behavior, for disabling set the value to 0.
20222 </p>
20223 </dd>
20224 <dt><samp>stitch</samp></dt>
20225 <dd><p>If set to 1, stitch the left and right row edges together.
20226 This is the default behavior, for disabling set the value to 0.
20227 </p></dd>
20228 </dl>
20229
20230 <a name="Examples-84"></a>
20231 <h4 class="subsection">29.2.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-84" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-84" aria-hidden="true">TOC</a></span></h4>
20232
20233 <ul>
20234 <li> Read the initial state from <samp>pattern</samp>, and specify an output of
20235 size 200x400.
20236 <div class="example">
20237 <pre class="example">cellauto=f=pattern:s=200x400
20238 </pre></div>
20239
20240 </li><li> Generate a random initial row with a width of 200 cells, with a fill
20241 ratio of 2/3:
20242 <div class="example">
20243 <pre class="example">cellauto=ratio=2/3:s=200x200
20244 </pre></div>
20245
20246 </li><li> Create a pattern generated by rule 18 starting by a single alive cell
20247 centered on an initial row with width 100:
20248 <div class="example">
20249 <pre class="example">cellauto=p=@:s=100x400:full=0:rule=18
20250 </pre></div>
20251
20252 </li><li> Specify a more elaborated initial pattern:
20253 <div class="example">
20254 <pre class="example">cellauto=p='@@ @ @@':s=100x400:full=0:rule=18
20255 </pre></div>
20256
20257 </li></ul>
20258
20259 <a name="mandelbrot"></a>
20260 <h3 class="section">29.3 mandelbrot<span class="pull-right"><a class="anchor hidden-xs" href="#mandelbrot" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mandelbrot" aria-hidden="true">TOC</a></span></h3>
20261
20262 <p>Generate a Mandelbrot set fractal, and progressively zoom towards the
20263 point specified with <var>start_x</var> and <var>start_y</var>.
20264 </p>
20265 <p>This source accepts the following options:
20266 </p>
20267 <dl compact="compact">
20268 <dt><samp>end_pts</samp></dt>
20269 <dd><p>Set the terminal pts value. Default value is 400.
20270 </p>
20271 </dd>
20272 <dt><samp>end_scale</samp></dt>
20273 <dd><p>Set the terminal scale value.
20274 Must be a floating point value. Default value is 0.3.
20275 </p>
20276 </dd>
20277 <dt><samp>inner</samp></dt>
20278 <dd><p>Set the inner coloring mode, that is the algorithm used to draw the
20279 Mandelbrot fractal internal region.
20280 </p>
20281 <p>It shall assume one of the following values:
20282 </p><dl compact="compact">
20283 <dt><samp>black</samp></dt>
20284 <dd><p>Set black mode.
20285 </p></dd>
20286 <dt><samp>convergence</samp></dt>
20287 <dd><p>Show time until convergence.
20288 </p></dd>
20289 <dt><samp>mincol</samp></dt>
20290 <dd><p>Set color based on point closest to the origin of the iterations.
20291 </p></dd>
20292 <dt><samp>period</samp></dt>
20293 <dd><p>Set period mode.
20294 </p></dd>
20295 </dl>
20296
20297 <p>Default value is <var>mincol</var>.
20298 </p>
20299 </dd>
20300 <dt><samp>bailout</samp></dt>
20301 <dd><p>Set the bailout value. Default value is 10.0.
20302 </p>
20303 </dd>
20304 <dt><samp>maxiter</samp></dt>
20305 <dd><p>Set the maximum of iterations performed by the rendering
20306 algorithm. Default value is 7189.
20307 </p>
20308 </dd>
20309 <dt><samp>outer</samp></dt>
20310 <dd><p>Set outer coloring mode.
20311 It shall assume one of following values:
20312 </p><dl compact="compact">
20313 <dt><samp>iteration_count</samp></dt>
20314 <dd><p>Set iteration cound mode.
20315 </p></dd>
20316 <dt><samp>normalized_iteration_count</samp></dt>
20317 <dd><p>set normalized iteration count mode.
20318 </p></dd>
20319 </dl>
20320 <p>Default value is <var>normalized_iteration_count</var>.
20321 </p>
20322 </dd>
20323 <dt><samp>rate, r</samp></dt>
20324 <dd><p>Set frame rate, expressed as number of frames per second. Default
20325 value is &quot;25&quot;.
20326 </p>
20327 </dd>
20328 <dt><samp>size, s</samp></dt>
20329 <dd><p>Set frame size. For the syntax of this option, check the &quot;Video
20330 size&quot; section in the ffmpeg-utils manual. Default value is &quot;640x480&quot;.
20331 </p>
20332 </dd>
20333 <dt><samp>start_scale</samp></dt>
20334 <dd><p>Set the initial scale value. Default value is 3.0.
20335 </p>
20336 </dd>
20337 <dt><samp>start_x</samp></dt>
20338 <dd><p>Set the initial x position. Must be a floating point value between
20339 -100 and 100. Default value is -0.743643887037158704752191506114774.
20340 </p>
20341 </dd>
20342 <dt><samp>start_y</samp></dt>
20343 <dd><p>Set the initial y position. Must be a floating point value between
20344 -100 and 100. Default value is -0.131825904205311970493132056385139.
20345 </p></dd>
20346 </dl>
20347
20348 <a name="mptestsrc"></a>
20349 <h3 class="section">29.4 mptestsrc<span class="pull-right"><a class="anchor hidden-xs" href="#mptestsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mptestsrc" aria-hidden="true">TOC</a></span></h3>
20350
20351 <p>Generate various test patterns, as generated by the MPlayer test filter.
20352 </p>
20353 <p>The size of the generated video is fixed, and is 256x256.
20354 This source is useful in particular for testing encoding features.
20355 </p>
20356 <p>This source accepts the following options:
20357 </p>
20358 <dl compact="compact">
20359 <dt><samp>rate, r</samp></dt>
20360 <dd><p>Specify the frame rate of the sourced video, as the number of frames
20361 generated per second. It has to be a string in the format
20362 <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a floating point
20363 number or a valid video frame rate abbreviation. The default value is
20364 &quot;25&quot;.
20365 </p>
20366 </dd>
20367 <dt><samp>duration, d</samp></dt>
20368 <dd><p>Set the duration of the sourced video. See
20369 <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
20370 for the accepted syntax.
20371 </p>
20372 <p>If not specified, or the expressed duration is negative, the video is
20373 supposed to be generated forever.
20374 </p>
20375 </dd>
20376 <dt><samp>test, t</samp></dt>
20377 <dd>
20378 <p>Set the number or the name of the test to perform. Supported tests are:
20379 </p><dl compact="compact">
20380 <dt><samp>dc_luma</samp></dt>
20381 <dt><samp>dc_chroma</samp></dt>
20382 <dt><samp>freq_luma</samp></dt>
20383 <dt><samp>freq_chroma</samp></dt>
20384 <dt><samp>amp_luma</samp></dt>
20385 <dt><samp>amp_chroma</samp></dt>
20386 <dt><samp>cbp</samp></dt>
20387 <dt><samp>mv</samp></dt>
20388 <dt><samp>ring1</samp></dt>
20389 <dt><samp>ring2</samp></dt>
20390 <dt><samp>all</samp></dt>
20391 </dl>
20392
20393 <p>Default value is &quot;all&quot;, which will cycle through the list of all tests.
20394 </p></dd>
20395 </dl>
20396
20397 <p>Some examples:
20398 </p><div class="example">
20399 <pre class="example">mptestsrc=t=dc_luma
20400 </pre></div>
20401
20402 <p>will generate a &quot;dc_luma&quot; test pattern.
20403 </p>
20404 <a name="frei0r_005fsrc"></a>
20405 <h3 class="section">29.5 frei0r_src<span class="pull-right"><a class="anchor hidden-xs" href="#frei0r_005fsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-frei0r_005fsrc" aria-hidden="true">TOC</a></span></h3>
20406
20407 <p>Provide a frei0r source.
20408 </p>
20409 <p>To enable compilation of this filter you need to install the frei0r
20410 header and configure FFmpeg with <code>--enable-frei0r</code>.
20411 </p>
20412 <p>This source accepts the following parameters:
20413 </p>
20414 <dl compact="compact">
20415 <dt><samp>size</samp></dt>
20416 <dd><p>The size of the video to generate. For the syntax of this option, check the
20417 <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
20418 </p>
20419 </dd>
20420 <dt><samp>framerate</samp></dt>
20421 <dd><p>The framerate of the generated video. It may be a string of the form
20422 <var>num</var>/<var>den</var> or a frame rate abbreviation.
20423 </p>
20424 </dd>
20425 <dt><samp>filter_name</samp></dt>
20426 <dd><p>The name to the frei0r source to load. For more information regarding frei0r and
20427 how to set the parameters, read the <a href="#frei0r">frei0r</a> section in the video filters
20428 documentation.
20429 </p>
20430 </dd>
20431 <dt><samp>filter_params</samp></dt>
20432 <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r source.
20433 </p>
20434 </dd>
20435 </dl>
20436
20437 <p>For example, to generate a frei0r partik0l source with size 200x200
20438 and frame rate 10 which is overlaid on the overlay filter main input:
20439 </p><div class="example">
20440 <pre class="example">frei0r_src=size=200x200:framerate=10:filter_name=partik0l:filter_params=1234 [overlay]; [in][overlay] overlay
20441 </pre></div>
20442
20443 <a name="life"></a>
20444 <h3 class="section">29.6 life<span class="pull-right"><a class="anchor hidden-xs" href="#life" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-life" aria-hidden="true">TOC</a></span></h3>
20445
20446 <p>Generate a life pattern.
20447 </p>
20448 <p>This source is based on a generalization of John Conway&rsquo;s life game.
20449 </p>
20450 <p>The sourced input represents a life grid, each pixel represents a cell
20451 which can be in one of two possible states, alive or dead. Every cell
20452 interacts with its eight neighbours, which are the cells that are
20453 horizontally, vertically, or diagonally adjacent.
20454 </p>
20455 <p>At each interaction the grid evolves according to the adopted rule,
20456 which specifies the number of neighbor alive cells which will make a
20457 cell stay alive or born. The <samp>rule</samp> option allows one to specify
20458 the rule to adopt.
20459 </p>
20460 <p>This source accepts the following options:
20461 </p>
20462 <dl compact="compact">
20463 <dt><samp>filename, f</samp></dt>
20464 <dd><p>Set the file from which to read the initial grid state. In the file,
20465 each non-whitespace character is considered an alive cell, and newline
20466 is used to delimit the end of each row.
20467 </p>
20468 <p>If this option is not specified, the initial grid is generated
20469 randomly.
20470 </p>
20471 </dd>
20472 <dt><samp>rate, r</samp></dt>
20473 <dd><p>Set the video rate, that is the number of frames generated per second.
20474 Default is 25.
20475 </p>
20476 </dd>
20477 <dt><samp>random_fill_ratio, ratio</samp></dt>
20478 <dd><p>Set the random fill ratio for the initial random grid. It is a
20479 floating point number value ranging from 0 to 1, defaults to 1/PHI.
20480 It is ignored when a file is specified.
20481 </p>
20482 </dd>
20483 <dt><samp>random_seed, seed</samp></dt>
20484 <dd><p>Set the seed for filling the initial random grid, must be an integer
20485 included between 0 and UINT32_MAX. If not specified, or if explicitly
20486 set to -1, the filter will try to use a good random seed on a best
20487 effort basis.
20488 </p>
20489 </dd>
20490 <dt><samp>rule</samp></dt>
20491 <dd><p>Set the life rule.
20492 </p>
20493 <p>A rule can be specified with a code of the kind &quot;S<var>NS</var>/B<var>NB</var>&quot;,
20494 where <var>NS</var> and <var>NB</var> are sequences of numbers in the range 0-8,
20495 <var>NS</var> specifies the number of alive neighbor cells which make a
20496 live cell stay alive, and <var>NB</var> the number of alive neighbor cells
20497 which make a dead cell to become alive (i.e. to &quot;born&quot;).
20498 &quot;s&quot; and &quot;b&quot; can be used in place of &quot;S&quot; and &quot;B&quot;, respectively.
20499 </p>
20500 <p>Alternatively a rule can be specified by an 18-bits integer. The 9
20501 high order bits are used to encode the next cell state if it is alive
20502 for each number of neighbor alive cells, the low order bits specify
20503 the rule for &quot;borning&quot; new cells. Higher order bits encode for an
20504 higher number of neighbor cells.
20505 For example the number 6153 = <code>(12&lt;&lt;9)+9</code> specifies a stay alive
20506 rule of 12 and a born rule of 9, which corresponds to &quot;S23/B03&quot;.
20507 </p>
20508 <p>Default value is &quot;S23/B3&quot;, which is the original Conway&rsquo;s game of life
20509 rule, and will keep a cell alive if it has 2 or 3 neighbor alive
20510 cells, and will born a new cell if there are three alive cells around
20511 a dead cell.
20512 </p>
20513 </dd>
20514 <dt><samp>size, s</samp></dt>
20515 <dd><p>Set the size of the output video. For the syntax of this option, check the
20516 <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
20517 </p>
20518 <p>If <samp>filename</samp> is specified, the size is set by default to the
20519 same size of the input file. If <samp>size</samp> is set, it must contain
20520 the size specified in the input file, and the initial grid defined in
20521 that file is centered in the larger resulting area.
20522 </p>
20523 <p>If a filename is not specified, the size value defaults to &quot;320x240&quot;
20524 (used for a randomly generated initial grid).
20525 </p>
20526 </dd>
20527 <dt><samp>stitch</samp></dt>
20528 <dd><p>If set to 1, stitch the left and right grid edges together, and the
20529 top and bottom edges also. Defaults to 1.
20530 </p>
20531 </dd>
20532 <dt><samp>mold</samp></dt>
20533 <dd><p>Set cell mold speed. If set, a dead cell will go from <samp>death_color</samp> to
20534 <samp>mold_color</samp> with a step of <samp>mold</samp>. <samp>mold</samp> can have a
20535 value from 0 to 255.
20536 </p>
20537 </dd>
20538 <dt><samp>life_color</samp></dt>
20539 <dd><p>Set the color of living (or new born) cells.
20540 </p>
20541 </dd>
20542 <dt><samp>death_color</samp></dt>
20543 <dd><p>Set the color of dead cells. If <samp>mold</samp> is set, this is the first color
20544 used to represent a dead cell.
20545 </p>
20546 </dd>
20547 <dt><samp>mold_color</samp></dt>
20548 <dd><p>Set mold color, for definitely dead and moldy cells.
20549 </p>
20550 <p>For the syntax of these 3 color options, check the &quot;Color&quot; section in the
20551 ffmpeg-utils manual.
20552 </p></dd>
20553 </dl>
20554
20555 <a name="Examples-85"></a>
20556 <h4 class="subsection">29.6.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-85" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-85" aria-hidden="true">TOC</a></span></h4>
20557
20558 <ul>
20559 <li> Read a grid from <samp>pattern</samp>, and center it on a grid of size
20560 300x300 pixels:
20561 <div class="example">
20562 <pre class="example">life=f=pattern:s=300x300
20563 </pre></div>
20564
20565 </li><li> Generate a random grid of size 200x200, with a fill ratio of 2/3:
20566 <div class="example">
20567 <pre class="example">life=ratio=2/3:s=200x200
20568 </pre></div>
20569
20570 </li><li> Specify a custom rule for evolving a randomly generated grid:
20571 <div class="example">
20572 <pre class="example">life=rule=S14/B34
20573 </pre></div>
20574
20575 </li><li> Full example with slow death effect (mold) using <code>ffplay</code>:
20576 <div class="example">
20577 <pre class="example">ffplay -f lavfi life=s=300x200:mold=10:r=60:ratio=0.1:death_color=#C83232:life_color=#00ff00,scale=1200:800:flags=16
20578 </pre></div>
20579 </li></ul>
20580
20581 <a name="color"></a><a name="haldclutsrc"></a><a name="nullsrc"></a><a name="rgbtestsrc"></a><a name="smptebars"></a><a name="smptehdbars"></a><a name="testsrc"></a><a name="color_002c-haldclutsrc_002c-nullsrc_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc"></a>
20582 <h3 class="section">29.7 color, haldclutsrc, nullsrc, rgbtestsrc, smptebars, smptehdbars, testsrc<span class="pull-right"><a class="anchor hidden-xs" href="#color_002c-haldclutsrc_002c-nullsrc_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-color_002c-haldclutsrc_002c-nullsrc_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc" aria-hidden="true">TOC</a></span></h3>
20583
20584 <p>The <code>color</code> source provides an uniformly colored input.
20585 </p>
20586 <p>The <code>haldclutsrc</code> source provides an identity Hald CLUT. See also
20587 <a href="#haldclut">haldclut</a> filter.
20588 </p>
20589 <p>The <code>nullsrc</code> source returns unprocessed video frames. It is
20590 mainly useful to be employed in analysis / debugging tools, or as the
20591 source for filters which ignore the input data.
20592 </p>
20593 <p>The <code>rgbtestsrc</code> source generates an RGB test pattern useful for
20594 detecting RGB vs BGR issues. You should see a red, green and blue
20595 stripe from top to bottom.
20596 </p>
20597 <p>The <code>smptebars</code> source generates a color bars pattern, based on
20598 the SMPTE Engineering Guideline EG 1-1990.
20599 </p>
20600 <p>The <code>smptehdbars</code> source generates a color bars pattern, based on
20601 the SMPTE RP 219-2002.
20602 </p>
20603 <p>The <code>testsrc</code> source generates a test video pattern, showing a
20604 color pattern, a scrolling gradient and a timestamp. This is mainly
20605 intended for testing purposes.
20606 </p>
20607 <p>The sources accept the following parameters:
20608 </p>
20609 <dl compact="compact">
20610 <dt><samp>color, c</samp></dt>
20611 <dd><p>Specify the color of the source, only available in the <code>color</code>
20612 source. For the syntax of this option, check the &quot;Color&quot; section in the
20613 ffmpeg-utils manual.
20614 </p>
20615 </dd>
20616 <dt><samp>level</samp></dt>
20617 <dd><p>Specify the level of the Hald CLUT, only available in the <code>haldclutsrc</code>
20618 source. A level of <code>N</code> generates a picture of <code>N*N*N</code> by <code>N*N*N</code>
20619 pixels to be used as identity matrix for 3D lookup tables. Each component is
20620 coded on a <code>1/(N*N)</code> scale.
20621 </p>
20622 </dd>
20623 <dt><samp>size, s</samp></dt>
20624 <dd><p>Specify the size of the sourced video. For the syntax of this option, check the
20625 <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
20626 The default value is <code>320x240</code>.
20627 </p>
20628 <p>This option is not available with the <code>haldclutsrc</code> filter.
20629 </p>
20630 </dd>
20631 <dt><samp>rate, r</samp></dt>
20632 <dd><p>Specify the frame rate of the sourced video, as the number of frames
20633 generated per second. It has to be a string in the format
20634 <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a floating point
20635 number or a valid video frame rate abbreviation. The default value is
20636 &quot;25&quot;.
20637 </p>
20638 </dd>
20639 <dt><samp>sar</samp></dt>
20640 <dd><p>Set the sample aspect ratio of the sourced video.
20641 </p>
20642 </dd>
20643 <dt><samp>duration, d</samp></dt>
20644 <dd><p>Set the duration of the sourced video. See
20645 <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
20646 for the accepted syntax.
20647 </p>
20648 <p>If not specified, or the expressed duration is negative, the video is
20649 supposed to be generated forever.
20650 </p>
20651 </dd>
20652 <dt><samp>decimals, n</samp></dt>
20653 <dd><p>Set the number of decimals to show in the timestamp, only available in the
20654 <code>testsrc</code> source.
20655 </p>
20656 <p>The displayed timestamp value will correspond to the original
20657 timestamp value multiplied by the power of 10 of the specified
20658 value. Default value is 0.
20659 </p></dd>
20660 </dl>
20661
20662 <p>For example the following:
20663 </p><div class="example">
20664 <pre class="example">testsrc=duration=5.3:size=qcif:rate=10
20665 </pre></div>
20666
20667 <p>will generate a video with a duration of 5.3 seconds, with size
20668 176x144 and a frame rate of 10 frames per second.
20669 </p>
20670 <p>The following graph description will generate a red source
20671 with an opacity of 0.2, with size &quot;qcif&quot; and a frame rate of 10
20672 frames per second.
20673 </p><div class="example">
20674 <pre class="example">color=c=red@0.2:s=qcif:r=10
20675 </pre></div>
20676
20677 <p>If the input content is to be ignored, <code>nullsrc</code> can be used. The
20678 following command generates noise in the luminance plane by employing
20679 the <code>geq</code> filter:
20680 </p><div class="example">
20681 <pre class="example">nullsrc=s=256x256, geq=random(1)*255:128:128
20682 </pre></div>
20683
20684 <a name="Commands-6"></a>
20685 <h4 class="subsection">29.7.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-6" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-6" aria-hidden="true">TOC</a></span></h4>
20686
20687 <p>The <code>color</code> source supports the following commands:
20688 </p>
20689 <dl compact="compact">
20690 <dt><samp>c, color</samp></dt>
20691 <dd><p>Set the color of the created image. Accepts the same syntax of the
20692 corresponding <samp>color</samp> option.
20693 </p></dd>
20694 </dl>
20695
20696
20697 <a name="Video-Sinks"></a>
20698 <h2 class="chapter">30 Video Sinks<span class="pull-right"><a class="anchor hidden-xs" href="#Video-Sinks" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-Sinks" aria-hidden="true">TOC</a></span></h2>
20699
20700 <p>Below is a description of the currently available video sinks.
20701 </p>
20702 <a name="buffersink"></a>
20703 <h3 class="section">30.1 buffersink<span class="pull-right"><a class="anchor hidden-xs" href="#buffersink" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-buffersink" aria-hidden="true">TOC</a></span></h3>
20704
20705 <p>Buffer video frames, and make them available to the end of the filter
20706 graph.
20707 </p>
20708 <p>This sink is mainly intended for programmatic use, in particular
20709 through the interface defined in <samp>libavfilter/buffersink.h</samp>
20710 or the options system.
20711 </p>
20712 <p>It accepts a pointer to an AVBufferSinkContext structure, which
20713 defines the incoming buffers&rsquo; formats, to be passed as the opaque
20714 parameter to <code>avfilter_init_filter</code> for initialization.
20715 </p>
20716 <a name="nullsink"></a>
20717 <h3 class="section">30.2 nullsink<span class="pull-right"><a class="anchor hidden-xs" href="#nullsink" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-nullsink" aria-hidden="true">TOC</a></span></h3>
20718
20719 <p>Null video sink: do absolutely nothing with the input video. It is
20720 mainly useful as a template and for use in analysis / debugging
20721 tools.
20722 </p>
20723
20724 <a name="Multimedia-Filters"></a>
20725 <h2 class="chapter">31 Multimedia Filters<span class="pull-right"><a class="anchor hidden-xs" href="#Multimedia-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Multimedia-Filters" aria-hidden="true">TOC</a></span></h2>
20726
20727 <p>Below is a description of the currently available multimedia filters.
20728 </p>
20729 <a name="avectorscope"></a>
20730 <h3 class="section">31.1 avectorscope<span class="pull-right"><a class="anchor hidden-xs" href="#avectorscope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avectorscope" aria-hidden="true">TOC</a></span></h3>
20731
20732 <p>Convert input audio to a video output, representing the audio vector
20733 scope.
20734 </p>
20735 <p>The filter is used to measure the difference between channels of stereo
20736 audio stream. A monoaural signal, consisting of identical left and right
20737 signal, results in straight vertical line. Any stereo separation is visible
20738 as a deviation from this line, creating a Lissajous figure.
20739 If the straight (or deviation from it) but horizontal line appears this
20740 indicates that the left and right channels are out of phase.
20741 </p>
20742 <p>The filter accepts the following options:
20743 </p>
20744 <dl compact="compact">
20745 <dt><samp>mode, m</samp></dt>
20746 <dd><p>Set the vectorscope mode.
20747 </p>
20748 <p>Available values are:
20749 </p><dl compact="compact">
20750 <dt>&lsquo;<samp>lissajous</samp>&rsquo;</dt>
20751 <dd><p>Lissajous rotated by 45 degrees.
20752 </p>
20753 </dd>
20754 <dt>&lsquo;<samp>lissajous_xy</samp>&rsquo;</dt>
20755 <dd><p>Same as above but not rotated.
20756 </p></dd>
20757 </dl>
20758
20759 <p>Default value is &lsquo;<samp>lissajous</samp>&rsquo;.
20760 </p>
20761 </dd>
20762 <dt><samp>size, s</samp></dt>
20763 <dd><p>Set the video size for the output. For the syntax of this option, check the
20764 <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
20765 Default value is <code>400x400</code>.
20766 </p>
20767 </dd>
20768 <dt><samp>rate, r</samp></dt>
20769 <dd><p>Set the output frame rate. Default value is <code>25</code>.
20770 </p>
20771 </dd>
20772 <dt><samp>rc</samp></dt>
20773 <dt><samp>gc</samp></dt>
20774 <dt><samp>bc</samp></dt>
20775 <dd><p>Specify the red, green and blue contrast. Default values are <code>40</code>, <code>160</code> and <code>80</code>.
20776 Allowed range is <code>[0, 255]</code>.
20777 </p>
20778 </dd>
20779 <dt><samp>rf</samp></dt>
20780 <dt><samp>gf</samp></dt>
20781 <dt><samp>bf</samp></dt>
20782 <dd><p>Specify the red, green and blue fade. Default values are <code>15</code>, <code>10</code> and <code>5</code>.
20783 Allowed range is <code>[0, 255]</code>.
20784 </p>
20785 </dd>
20786 <dt><samp>zoom</samp></dt>
20787 <dd><p>Set the zoom factor. Default value is <code>1</code>. Allowed range is <code>[1, 10]</code>.
20788 </p></dd>
20789 </dl>
20790
20791 <a name="Examples-86"></a>
20792 <h4 class="subsection">31.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-86" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-86" aria-hidden="true">TOC</a></span></h4>
20793
20794 <ul>
20795 <li> Complete example using <code>ffplay</code>:
20796 <div class="example">
20797 <pre class="example">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
20798              [a] avectorscope=zoom=1.3:rc=2:gc=200:bc=10:rf=1:gf=8:bf=7 [out0]'
20799 </pre></div>
20800 </li></ul>
20801
20802 <a name="concat-3"></a>
20803 <h3 class="section">31.2 concat<span class="pull-right"><a class="anchor hidden-xs" href="#concat-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-concat-3" aria-hidden="true">TOC</a></span></h3>
20804
20805 <p>Concatenate audio and video streams, joining them together one after the
20806 other.
20807 </p>
20808 <p>The filter works on segments of synchronized video and audio streams. All
20809 segments must have the same number of streams of each type, and that will
20810 also be the number of streams at output.
20811 </p>
20812 <p>The filter accepts the following options:
20813 </p>
20814 <dl compact="compact">
20815 <dt><samp>n</samp></dt>
20816 <dd><p>Set the number of segments. Default is 2.
20817 </p>
20818 </dd>
20819 <dt><samp>v</samp></dt>
20820 <dd><p>Set the number of output video streams, that is also the number of video
20821 streams in each segment. Default is 1.
20822 </p>
20823 </dd>
20824 <dt><samp>a</samp></dt>
20825 <dd><p>Set the number of output audio streams, that is also the number of audio
20826 streams in each segment. Default is 0.
20827 </p>
20828 </dd>
20829 <dt><samp>unsafe</samp></dt>
20830 <dd><p>Activate unsafe mode: do not fail if segments have a different format.
20831 </p>
20832 </dd>
20833 </dl>
20834
20835 <p>The filter has <var>v</var>+<var>a</var> outputs: first <var>v</var> video outputs, then
20836 <var>a</var> audio outputs.
20837 </p>
20838 <p>There are <var>n</var>x(<var>v</var>+<var>a</var>) inputs: first the inputs for the first
20839 segment, in the same order as the outputs, then the inputs for the second
20840 segment, etc.
20841 </p>
20842 <p>Related streams do not always have exactly the same duration, for various
20843 reasons including codec frame size or sloppy authoring. For that reason,
20844 related synchronized streams (e.g. a video and its audio track) should be
20845 concatenated at once. The concat filter will use the duration of the longest
20846 stream in each segment (except the last one), and if necessary pad shorter
20847 audio streams with silence.
20848 </p>
20849 <p>For this filter to work correctly, all segments must start at timestamp 0.
20850 </p>
20851 <p>All corresponding streams must have the same parameters in all segments; the
20852 filtering system will automatically select a common pixel format for video
20853 streams, and a common sample format, sample rate and channel layout for
20854 audio streams, but other settings, such as resolution, must be converted
20855 explicitly by the user.
20856 </p>
20857 <p>Different frame rates are acceptable but will result in variable frame rate
20858 at output; be sure to configure the output file to handle it.
20859 </p>
20860 <a name="Examples-87"></a>
20861 <h4 class="subsection">31.2.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-87" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-87" aria-hidden="true">TOC</a></span></h4>
20862
20863 <ul>
20864 <li> Concatenate an opening, an episode and an ending, all in bilingual version
20865 (video in stream 0, audio in streams 1 and 2):
20866 <div class="example">
20867 <pre class="example">ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \
20868   '[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
20869    concat=n=3:v=1:a=2 [v] [a1] [a2]' \
20870   -map '[v]' -map '[a1]' -map '[a2]' output.mkv
20871 </pre></div>
20872
20873 </li><li> Concatenate two parts, handling audio and video separately, using the
20874 (a)movie sources, and adjusting the resolution:
20875 <div class="example">
20876 <pre class="example">movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
20877 movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
20878 [v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
20879 </pre></div>
20880 <p>Note that a desync will happen at the stitch if the audio and video streams
20881 do not have exactly the same duration in the first file.
20882 </p>
20883 </li></ul>
20884
20885 <a name="ebur128"></a>
20886 <h3 class="section">31.3 ebur128<span class="pull-right"><a class="anchor hidden-xs" href="#ebur128" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ebur128" aria-hidden="true">TOC</a></span></h3>
20887
20888 <p>EBU R128 scanner filter. This filter takes an audio stream as input and outputs
20889 it unchanged. By default, it logs a message at a frequency of 10Hz with the
20890 Momentary loudness (identified by <code>M</code>), Short-term loudness (<code>S</code>),
20891 Integrated loudness (<code>I</code>) and Loudness Range (<code>LRA</code>).
20892 </p>
20893 <p>The filter also has a video output (see the <var>video</var> option) with a real
20894 time graph to observe the loudness evolution. The graphic contains the logged
20895 message mentioned above, so it is not printed anymore when this option is set,
20896 unless the verbose logging is set. The main graphing area contains the
20897 short-term loudness (3 seconds of analysis), and the gauge on the right is for
20898 the momentary loudness (400 milliseconds).
20899 </p>
20900 <p>More information about the Loudness Recommendation EBU R128 on
20901 <a href="http://tech.ebu.ch/loudness">http://tech.ebu.ch/loudness</a>.
20902 </p>
20903 <p>The filter accepts the following options:
20904 </p>
20905 <dl compact="compact">
20906 <dt><samp>video</samp></dt>
20907 <dd><p>Activate the video output. The audio stream is passed unchanged whether this
20908 option is set or no. The video stream will be the first output stream if
20909 activated. Default is <code>0</code>.
20910 </p>
20911 </dd>
20912 <dt><samp>size</samp></dt>
20913 <dd><p>Set the video size. This option is for video only. For the syntax of this
20914 option, check the
20915 <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
20916 Default and minimum resolution is <code>640x480</code>.
20917 </p>
20918 </dd>
20919 <dt><samp>meter</samp></dt>
20920 <dd><p>Set the EBU scale meter. Default is <code>9</code>. Common values are <code>9</code> and
20921 <code>18</code>, respectively for EBU scale meter +9 and EBU scale meter +18. Any
20922 other integer value between this range is allowed.
20923 </p>
20924 </dd>
20925 <dt><samp>metadata</samp></dt>
20926 <dd><p>Set metadata injection. If set to <code>1</code>, the audio input will be segmented
20927 into 100ms output frames, each of them containing various loudness information
20928 in metadata.  All the metadata keys are prefixed with <code>lavfi.r128.</code>.
20929 </p>
20930 <p>Default is <code>0</code>.
20931 </p>
20932 </dd>
20933 <dt><samp>framelog</samp></dt>
20934 <dd><p>Force the frame logging level.
20935 </p>
20936 <p>Available values are:
20937 </p><dl compact="compact">
20938 <dt>&lsquo;<samp>info</samp>&rsquo;</dt>
20939 <dd><p>information logging level
20940 </p></dd>
20941 <dt>&lsquo;<samp>verbose</samp>&rsquo;</dt>
20942 <dd><p>verbose logging level
20943 </p></dd>
20944 </dl>
20945
20946 <p>By default, the logging level is set to <var>info</var>. If the <samp>video</samp> or
20947 the <samp>metadata</samp> options are set, it switches to <var>verbose</var>.
20948 </p>
20949 </dd>
20950 <dt><samp>peak</samp></dt>
20951 <dd><p>Set peak mode(s).
20952 </p>
20953 <p>Available modes can be cumulated (the option is a <code>flag</code> type). Possible
20954 values are:
20955 </p><dl compact="compact">
20956 <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
20957 <dd><p>Disable any peak mode (default).
20958 </p></dd>
20959 <dt>&lsquo;<samp>sample</samp>&rsquo;</dt>
20960 <dd><p>Enable sample-peak mode.
20961 </p>
20962 <p>Simple peak mode looking for the higher sample value. It logs a message
20963 for sample-peak (identified by <code>SPK</code>).
20964 </p></dd>
20965 <dt>&lsquo;<samp>true</samp>&rsquo;</dt>
20966 <dd><p>Enable true-peak mode.
20967 </p>
20968 <p>If enabled, the peak lookup is done on an over-sampled version of the input
20969 stream for better peak accuracy. It logs a message for true-peak.
20970 (identified by <code>TPK</code>) and true-peak per frame (identified by <code>FTPK</code>).
20971 This mode requires a build with <code>libswresample</code>.
20972 </p></dd>
20973 </dl>
20974
20975 </dd>
20976 </dl>
20977
20978 <a name="Examples-88"></a>
20979 <h4 class="subsection">31.3.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-88" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-88" aria-hidden="true">TOC</a></span></h4>
20980
20981 <ul>
20982 <li> Real-time graph using <code>ffplay</code>, with a EBU scale meter +18:
20983 <div class="example">
20984 <pre class="example">ffplay -f lavfi -i &quot;amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]&quot;
20985 </pre></div>
20986
20987 </li><li> Run an analysis with <code>ffmpeg</code>:
20988 <div class="example">
20989 <pre class="example">ffmpeg -nostats -i input.mp3 -filter_complex ebur128 -f null -
20990 </pre></div>
20991 </li></ul>
20992
20993 <a name="interleave_002c-ainterleave"></a>
20994 <h3 class="section">31.4 interleave, ainterleave<span class="pull-right"><a class="anchor hidden-xs" href="#interleave_002c-ainterleave" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-interleave_002c-ainterleave" aria-hidden="true">TOC</a></span></h3>
20995
20996 <p>Temporally interleave frames from several inputs.
20997 </p>
20998 <p><code>interleave</code> works with video inputs, <code>ainterleave</code> with audio.
20999 </p>
21000 <p>These filters read frames from several inputs and send the oldest
21001 queued frame to the output.
21002 </p>
21003 <p>Input streams must have a well defined, monotonically increasing frame
21004 timestamp values.
21005 </p>
21006 <p>In order to submit one frame to output, these filters need to enqueue
21007 at least one frame for each input, so they cannot work in case one
21008 input is not yet terminated and will not receive incoming frames.
21009 </p>
21010 <p>For example consider the case when one input is a <code>select</code> filter
21011 which always drop input frames. The <code>interleave</code> filter will keep
21012 reading from that input, but it will never be able to send new frames
21013 to output until the input will send an end-of-stream signal.
21014 </p>
21015 <p>Also, depending on inputs synchronization, the filters will drop
21016 frames in case one input receives more frames than the other ones, and
21017 the queue is already filled.
21018 </p>
21019 <p>These filters accept the following options:
21020 </p>
21021 <dl compact="compact">
21022 <dt><samp>nb_inputs, n</samp></dt>
21023 <dd><p>Set the number of different inputs, it is 2 by default.
21024 </p></dd>
21025 </dl>
21026
21027 <a name="Examples-89"></a>
21028 <h4 class="subsection">31.4.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-89" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-89" aria-hidden="true">TOC</a></span></h4>
21029
21030 <ul>
21031 <li> Interleave frames belonging to different streams using <code>ffmpeg</code>:
21032 <div class="example">
21033 <pre class="example">ffmpeg -i bambi.avi -i pr0n.mkv -filter_complex &quot;[0:v][1:v] interleave&quot; out.avi
21034 </pre></div>
21035
21036 </li><li> Add flickering blur effect:
21037 <div class="example">
21038 <pre class="example">select='if(gt(random(0), 0.2), 1, 2)':n=2 [tmp], boxblur=2:2, [tmp] interleave
21039 </pre></div>
21040 </li></ul>
21041
21042 <a name="perms_002c-aperms"></a>
21043 <h3 class="section">31.5 perms, aperms<span class="pull-right"><a class="anchor hidden-xs" href="#perms_002c-aperms" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-perms_002c-aperms" aria-hidden="true">TOC</a></span></h3>
21044
21045 <p>Set read/write permissions for the output frames.
21046 </p>
21047 <p>These filters are mainly aimed at developers to test direct path in the
21048 following filter in the filtergraph.
21049 </p>
21050 <p>The filters accept the following options:
21051 </p>
21052 <dl compact="compact">
21053 <dt><samp>mode</samp></dt>
21054 <dd><p>Select the permissions mode.
21055 </p>
21056 <p>It accepts the following values:
21057 </p><dl compact="compact">
21058 <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
21059 <dd><p>Do nothing. This is the default.
21060 </p></dd>
21061 <dt>&lsquo;<samp>ro</samp>&rsquo;</dt>
21062 <dd><p>Set all the output frames read-only.
21063 </p></dd>
21064 <dt>&lsquo;<samp>rw</samp>&rsquo;</dt>
21065 <dd><p>Set all the output frames directly writable.
21066 </p></dd>
21067 <dt>&lsquo;<samp>toggle</samp>&rsquo;</dt>
21068 <dd><p>Make the frame read-only if writable, and writable if read-only.
21069 </p></dd>
21070 <dt>&lsquo;<samp>random</samp>&rsquo;</dt>
21071 <dd><p>Set each output frame read-only or writable randomly.
21072 </p></dd>
21073 </dl>
21074
21075 </dd>
21076 <dt><samp>seed</samp></dt>
21077 <dd><p>Set the seed for the <var>random</var> mode, must be an integer included between
21078 <code>0</code> and <code>UINT32_MAX</code>. If not specified, or if explicitly set to
21079 <code>-1</code>, the filter will try to use a good random seed on a best effort
21080 basis.
21081 </p></dd>
21082 </dl>
21083
21084 <p>Note: in case of auto-inserted filter between the permission filter and the
21085 following one, the permission might not be received as expected in that
21086 following filter. Inserting a <a href="#format">format</a> or <a href="#aformat">aformat</a> filter before the
21087 perms/aperms filter can avoid this problem.
21088 </p>
21089 <a name="select_002c-aselect"></a>
21090 <h3 class="section">31.6 select, aselect<span class="pull-right"><a class="anchor hidden-xs" href="#select_002c-aselect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-select_002c-aselect" aria-hidden="true">TOC</a></span></h3>
21091
21092 <p>Select frames to pass in output.
21093 </p>
21094 <p>This filter accepts the following options:
21095 </p>
21096 <dl compact="compact">
21097 <dt><samp>expr, e</samp></dt>
21098 <dd><p>Set expression, which is evaluated for each input frame.
21099 </p>
21100 <p>If the expression is evaluated to zero, the frame is discarded.
21101 </p>
21102 <p>If the evaluation result is negative or NaN, the frame is sent to the
21103 first output; otherwise it is sent to the output with index
21104 <code>ceil(val)-1</code>, assuming that the input index starts from 0.
21105 </p>
21106 <p>For example a value of <code>1.2</code> corresponds to the output with index
21107 <code>ceil(1.2)-1 = 2-1 = 1</code>, that is the second output.
21108 </p>
21109 </dd>
21110 <dt><samp>outputs, n</samp></dt>
21111 <dd><p>Set the number of outputs. The output to which to send the selected
21112 frame is based on the result of the evaluation. Default value is 1.
21113 </p></dd>
21114 </dl>
21115
21116 <p>The expression can contain the following constants:
21117 </p>
21118 <dl compact="compact">
21119 <dt><samp>n</samp></dt>
21120 <dd><p>The (sequential) number of the filtered frame, starting from 0.
21121 </p>
21122 </dd>
21123 <dt><samp>selected_n</samp></dt>
21124 <dd><p>The (sequential) number of the selected frame, starting from 0.
21125 </p>
21126 </dd>
21127 <dt><samp>prev_selected_n</samp></dt>
21128 <dd><p>The sequential number of the last selected frame. It&rsquo;s NAN if undefined.
21129 </p>
21130 </dd>
21131 <dt><samp>TB</samp></dt>
21132 <dd><p>The timebase of the input timestamps.
21133 </p>
21134 </dd>
21135 <dt><samp>pts</samp></dt>
21136 <dd><p>The PTS (Presentation TimeStamp) of the filtered video frame,
21137 expressed in <var>TB</var> units. It&rsquo;s NAN if undefined.
21138 </p>
21139 </dd>
21140 <dt><samp>t</samp></dt>
21141 <dd><p>The PTS of the filtered video frame,
21142 expressed in seconds. It&rsquo;s NAN if undefined.
21143 </p>
21144 </dd>
21145 <dt><samp>prev_pts</samp></dt>
21146 <dd><p>The PTS of the previously filtered video frame. It&rsquo;s NAN if undefined.
21147 </p>
21148 </dd>
21149 <dt><samp>prev_selected_pts</samp></dt>
21150 <dd><p>The PTS of the last previously filtered video frame. It&rsquo;s NAN if undefined.
21151 </p>
21152 </dd>
21153 <dt><samp>prev_selected_t</samp></dt>
21154 <dd><p>The PTS of the last previously selected video frame. It&rsquo;s NAN if undefined.
21155 </p>
21156 </dd>
21157 <dt><samp>start_pts</samp></dt>
21158 <dd><p>The PTS of the first video frame in the video. It&rsquo;s NAN if undefined.
21159 </p>
21160 </dd>
21161 <dt><samp>start_t</samp></dt>
21162 <dd><p>The time of the first video frame in the video. It&rsquo;s NAN if undefined.
21163 </p>
21164 </dd>
21165 <dt><samp>pict_type <em>(video only)</em></samp></dt>
21166 <dd><p>The type of the filtered frame. It can assume one of the following
21167 values:
21168 </p><dl compact="compact">
21169 <dt><samp>I</samp></dt>
21170 <dt><samp>P</samp></dt>
21171 <dt><samp>B</samp></dt>
21172 <dt><samp>S</samp></dt>
21173 <dt><samp>SI</samp></dt>
21174 <dt><samp>SP</samp></dt>
21175 <dt><samp>BI</samp></dt>
21176 </dl>
21177
21178 </dd>
21179 <dt><samp>interlace_type <em>(video only)</em></samp></dt>
21180 <dd><p>The frame interlace type. It can assume one of the following values:
21181 </p><dl compact="compact">
21182 <dt><samp>PROGRESSIVE</samp></dt>
21183 <dd><p>The frame is progressive (not interlaced).
21184 </p></dd>
21185 <dt><samp>TOPFIRST</samp></dt>
21186 <dd><p>The frame is top-field-first.
21187 </p></dd>
21188 <dt><samp>BOTTOMFIRST</samp></dt>
21189 <dd><p>The frame is bottom-field-first.
21190 </p></dd>
21191 </dl>
21192
21193 </dd>
21194 <dt><samp>consumed_sample_n <em>(audio only)</em></samp></dt>
21195 <dd><p>the number of selected samples before the current frame
21196 </p>
21197 </dd>
21198 <dt><samp>samples_n <em>(audio only)</em></samp></dt>
21199 <dd><p>the number of samples in the current frame
21200 </p>
21201 </dd>
21202 <dt><samp>sample_rate <em>(audio only)</em></samp></dt>
21203 <dd><p>the input sample rate
21204 </p>
21205 </dd>
21206 <dt><samp>key</samp></dt>
21207 <dd><p>This is 1 if the filtered frame is a key-frame, 0 otherwise.
21208 </p>
21209 </dd>
21210 <dt><samp>pos</samp></dt>
21211 <dd><p>the position in the file of the filtered frame, -1 if the information
21212 is not available (e.g. for synthetic video)
21213 </p>
21214 </dd>
21215 <dt><samp>scene <em>(video only)</em></samp></dt>
21216 <dd><p>value between 0 and 1 to indicate a new scene; a low value reflects a low
21217 probability for the current frame to introduce a new scene, while a higher
21218 value means the current frame is more likely to be one (see the example below)
21219 </p>
21220 </dd>
21221 </dl>
21222
21223 <p>The default value of the select expression is &quot;1&quot;.
21224 </p>
21225 <a name="Examples-90"></a>
21226 <h4 class="subsection">31.6.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-90" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-90" aria-hidden="true">TOC</a></span></h4>
21227
21228 <ul>
21229 <li> Select all frames in input:
21230 <div class="example">
21231 <pre class="example">select
21232 </pre></div>
21233
21234 <p>The example above is the same as:
21235 </p><div class="example">
21236 <pre class="example">select=1
21237 </pre></div>
21238
21239 </li><li> Skip all frames:
21240 <div class="example">
21241 <pre class="example">select=0
21242 </pre></div>
21243
21244 </li><li> Select only I-frames:
21245 <div class="example">
21246 <pre class="example">select='eq(pict_type\,I)'
21247 </pre></div>
21248
21249 </li><li> Select one frame every 100:
21250 <div class="example">
21251 <pre class="example">select='not(mod(n\,100))'
21252 </pre></div>
21253
21254 </li><li> Select only frames contained in the 10-20 time interval:
21255 <div class="example">
21256 <pre class="example">select=between(t\,10\,20)
21257 </pre></div>
21258
21259 </li><li> Select only I frames contained in the 10-20 time interval:
21260 <div class="example">
21261 <pre class="example">select=between(t\,10\,20)*eq(pict_type\,I)
21262 </pre></div>
21263
21264 </li><li> Select frames with a minimum distance of 10 seconds:
21265 <div class="example">
21266 <pre class="example">select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
21267 </pre></div>
21268
21269 </li><li> Use aselect to select only audio frames with samples number &gt; 100:
21270 <div class="example">
21271 <pre class="example">aselect='gt(samples_n\,100)'
21272 </pre></div>
21273
21274 </li><li> Create a mosaic of the first scenes:
21275 <div class="example">
21276 <pre class="example">ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png
21277 </pre></div>
21278
21279 <p>Comparing <var>scene</var> against a value between 0.3 and 0.5 is generally a sane
21280 choice.
21281 </p>
21282 </li><li> Send even and odd frames to separate outputs, and compose them:
21283 <div class="example">
21284 <pre class="example">select=n=2:e='mod(n, 2)+1' [odd][even]; [odd] pad=h=2*ih [tmp]; [tmp][even] overlay=y=h
21285 </pre></div>
21286 </li></ul>
21287
21288 <a name="sendcmd_002c-asendcmd"></a>
21289 <h3 class="section">31.7 sendcmd, asendcmd<span class="pull-right"><a class="anchor hidden-xs" href="#sendcmd_002c-asendcmd" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sendcmd_002c-asendcmd" aria-hidden="true">TOC</a></span></h3>
21290
21291 <p>Send commands to filters in the filtergraph.
21292 </p>
21293 <p>These filters read commands to be sent to other filters in the
21294 filtergraph.
21295 </p>
21296 <p><code>sendcmd</code> must be inserted between two video filters,
21297 <code>asendcmd</code> must be inserted between two audio filters, but apart
21298 from that they act the same way.
21299 </p>
21300 <p>The specification of commands can be provided in the filter arguments
21301 with the <var>commands</var> option, or in a file specified by the
21302 <var>filename</var> option.
21303 </p>
21304 <p>These filters accept the following options:
21305 </p><dl compact="compact">
21306 <dt><samp>commands, c</samp></dt>
21307 <dd><p>Set the commands to be read and sent to the other filters.
21308 </p></dd>
21309 <dt><samp>filename, f</samp></dt>
21310 <dd><p>Set the filename of the commands to be read and sent to the other
21311 filters.
21312 </p></dd>
21313 </dl>
21314
21315 <a name="Commands-syntax"></a>
21316 <h4 class="subsection">31.7.1 Commands syntax<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-syntax" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-syntax" aria-hidden="true">TOC</a></span></h4>
21317
21318 <p>A commands description consists of a sequence of interval
21319 specifications, comprising a list of commands to be executed when a
21320 particular event related to that interval occurs. The occurring event
21321 is typically the current frame time entering or leaving a given time
21322 interval.
21323 </p>
21324 <p>An interval is specified by the following syntax:
21325 </p><div class="example">
21326 <pre class="example"><var>START</var>[-<var>END</var>] <var>COMMANDS</var>;
21327 </pre></div>
21328
21329 <p>The time interval is specified by the <var>START</var> and <var>END</var> times.
21330 <var>END</var> is optional and defaults to the maximum time.
21331 </p>
21332 <p>The current frame time is considered within the specified interval if
21333 it is included in the interval [<var>START</var>, <var>END</var>), that is when
21334 the time is greater or equal to <var>START</var> and is lesser than
21335 <var>END</var>.
21336 </p>
21337 <p><var>COMMANDS</var> consists of a sequence of one or more command
21338 specifications, separated by &quot;,&quot;, relating to that interval.  The
21339 syntax of a command specification is given by:
21340 </p><div class="example">
21341 <pre class="example">[<var>FLAGS</var>] <var>TARGET</var> <var>COMMAND</var> <var>ARG</var>
21342 </pre></div>
21343
21344 <p><var>FLAGS</var> is optional and specifies the type of events relating to
21345 the time interval which enable sending the specified command, and must
21346 be a non-null sequence of identifier flags separated by &quot;+&quot; or &quot;|&quot; and
21347 enclosed between &quot;[&quot; and &quot;]&quot;.
21348 </p>
21349 <p>The following flags are recognized:
21350 </p><dl compact="compact">
21351 <dt><samp>enter</samp></dt>
21352 <dd><p>The command is sent when the current frame timestamp enters the
21353 specified interval. In other words, the command is sent when the
21354 previous frame timestamp was not in the given interval, and the
21355 current is.
21356 </p>
21357 </dd>
21358 <dt><samp>leave</samp></dt>
21359 <dd><p>The command is sent when the current frame timestamp leaves the
21360 specified interval. In other words, the command is sent when the
21361 previous frame timestamp was in the given interval, and the
21362 current is not.
21363 </p></dd>
21364 </dl>
21365
21366 <p>If <var>FLAGS</var> is not specified, a default value of <code>[enter]</code> is
21367 assumed.
21368 </p>
21369 <p><var>TARGET</var> specifies the target of the command, usually the name of
21370 the filter class or a specific filter instance name.
21371 </p>
21372 <p><var>COMMAND</var> specifies the name of the command for the target filter.
21373 </p>
21374 <p><var>ARG</var> is optional and specifies the optional list of argument for
21375 the given <var>COMMAND</var>.
21376 </p>
21377 <p>Between one interval specification and another, whitespaces, or
21378 sequences of characters starting with <code>#</code> until the end of line,
21379 are ignored and can be used to annotate comments.
21380 </p>
21381 <p>A simplified BNF description of the commands specification syntax
21382 follows:
21383 </p><div class="example">
21384 <pre class="example"><var>COMMAND_FLAG</var>  ::= &quot;enter&quot; | &quot;leave&quot;
21385 <var>COMMAND_FLAGS</var> ::= <var>COMMAND_FLAG</var> [(+|&quot;|&quot;)<var>COMMAND_FLAG</var>]
21386 <var>COMMAND</var>       ::= [&quot;[&quot; <var>COMMAND_FLAGS</var> &quot;]&quot;] <var>TARGET</var> <var>COMMAND</var> [<var>ARG</var>]
21387 <var>COMMANDS</var>      ::= <var>COMMAND</var> [,<var>COMMANDS</var>]
21388 <var>INTERVAL</var>      ::= <var>START</var>[-<var>END</var>] <var>COMMANDS</var>
21389 <var>INTERVALS</var>     ::= <var>INTERVAL</var>[;<var>INTERVALS</var>]
21390 </pre></div>
21391
21392 <a name="Examples-91"></a>
21393 <h4 class="subsection">31.7.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-91" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-91" aria-hidden="true">TOC</a></span></h4>
21394
21395 <ul>
21396 <li> Specify audio tempo change at second 4:
21397 <div class="example">
21398 <pre class="example">asendcmd=c='4.0 atempo tempo 1.5',atempo
21399 </pre></div>
21400
21401 </li><li> Specify a list of drawtext and hue commands in a file.
21402 <div class="example">
21403 <pre class="example"># show text in the interval 5-10
21404 5.0-10.0 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=hello world',
21405          [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=';
21406
21407 # desaturate the image in the interval 15-20
21408 15.0-20.0 [enter] hue s 0,
21409           [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=nocolor',
21410           [leave] hue s 1,
21411           [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color';
21412
21413 # apply an exponential saturation fade-out effect, starting from time 25
21414 25 [enter] hue s exp(25-t)
21415 </pre></div>
21416
21417 <p>A filtergraph allowing to read and process the above command list
21418 stored in a file <samp>test.cmd</samp>, can be specified with:
21419 </p><div class="example">
21420 <pre class="example">sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue
21421 </pre></div>
21422 </li></ul>
21423
21424 <a name="setpts"></a><a name="setpts_002c-asetpts"></a>
21425 <h3 class="section">31.8 setpts, asetpts<span class="pull-right"><a class="anchor hidden-xs" href="#setpts_002c-asetpts" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setpts_002c-asetpts" aria-hidden="true">TOC</a></span></h3>
21426
21427 <p>Change the PTS (presentation timestamp) of the input frames.
21428 </p>
21429 <p><code>setpts</code> works on video frames, <code>asetpts</code> on audio frames.
21430 </p>
21431 <p>This filter accepts the following options:
21432 </p>
21433 <dl compact="compact">
21434 <dt><samp>expr</samp></dt>
21435 <dd><p>The expression which is evaluated for each frame to construct its timestamp.
21436 </p>
21437 </dd>
21438 </dl>
21439
21440 <p>The expression is evaluated through the eval API and can contain the following
21441 constants:
21442 </p>
21443 <dl compact="compact">
21444 <dt><samp>FRAME_RATE</samp></dt>
21445 <dd><p>frame rate, only defined for constant frame-rate video
21446 </p>
21447 </dd>
21448 <dt><samp>PTS</samp></dt>
21449 <dd><p>The presentation timestamp in input
21450 </p>
21451 </dd>
21452 <dt><samp>N</samp></dt>
21453 <dd><p>The count of the input frame for video or the number of consumed samples,
21454 not including the current frame for audio, starting from 0.
21455 </p>
21456 </dd>
21457 <dt><samp>NB_CONSUMED_SAMPLES</samp></dt>
21458 <dd><p>The number of consumed samples, not including the current frame (only
21459 audio)
21460 </p>
21461 </dd>
21462 <dt><samp>NB_SAMPLES, S</samp></dt>
21463 <dd><p>The number of samples in the current frame (only audio)
21464 </p>
21465 </dd>
21466 <dt><samp>SAMPLE_RATE, SR</samp></dt>
21467 <dd><p>The audio sample rate.
21468 </p>
21469 </dd>
21470 <dt><samp>STARTPTS</samp></dt>
21471 <dd><p>The PTS of the first frame.
21472 </p>
21473 </dd>
21474 <dt><samp>STARTT</samp></dt>
21475 <dd><p>the time in seconds of the first frame
21476 </p>
21477 </dd>
21478 <dt><samp>INTERLACED</samp></dt>
21479 <dd><p>State whether the current frame is interlaced.
21480 </p>
21481 </dd>
21482 <dt><samp>T</samp></dt>
21483 <dd><p>the time in seconds of the current frame
21484 </p>
21485 </dd>
21486 <dt><samp>POS</samp></dt>
21487 <dd><p>original position in the file of the frame, or undefined if undefined
21488 for the current frame
21489 </p>
21490 </dd>
21491 <dt><samp>PREV_INPTS</samp></dt>
21492 <dd><p>The previous input PTS.
21493 </p>
21494 </dd>
21495 <dt><samp>PREV_INT</samp></dt>
21496 <dd><p>previous input time in seconds
21497 </p>
21498 </dd>
21499 <dt><samp>PREV_OUTPTS</samp></dt>
21500 <dd><p>The previous output PTS.
21501 </p>
21502 </dd>
21503 <dt><samp>PREV_OUTT</samp></dt>
21504 <dd><p>previous output time in seconds
21505 </p>
21506 </dd>
21507 <dt><samp>RTCTIME</samp></dt>
21508 <dd><p>The wallclock (RTC) time in microseconds. This is deprecated, use time(0)
21509 instead.
21510 </p>
21511 </dd>
21512 <dt><samp>RTCSTART</samp></dt>
21513 <dd><p>The wallclock (RTC) time at the start of the movie in microseconds.
21514 </p>
21515 </dd>
21516 <dt><samp>TB</samp></dt>
21517 <dd><p>The timebase of the input timestamps.
21518 </p>
21519 </dd>
21520 </dl>
21521
21522 <a name="Examples-92"></a>
21523 <h4 class="subsection">31.8.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-92" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-92" aria-hidden="true">TOC</a></span></h4>
21524
21525 <ul>
21526 <li> Start counting PTS from zero
21527 <div class="example">
21528 <pre class="example">setpts=PTS-STARTPTS
21529 </pre></div>
21530
21531 </li><li> Apply fast motion effect:
21532 <div class="example">
21533 <pre class="example">setpts=0.5*PTS
21534 </pre></div>
21535
21536 </li><li> Apply slow motion effect:
21537 <div class="example">
21538 <pre class="example">setpts=2.0*PTS
21539 </pre></div>
21540
21541 </li><li> Set fixed rate of 25 frames per second:
21542 <div class="example">
21543 <pre class="example">setpts=N/(25*TB)
21544 </pre></div>
21545
21546 </li><li> Set fixed rate 25 fps with some jitter:
21547 <div class="example">
21548 <pre class="example">setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
21549 </pre></div>
21550
21551 </li><li> Apply an offset of 10 seconds to the input PTS:
21552 <div class="example">
21553 <pre class="example">setpts=PTS+10/TB
21554 </pre></div>
21555
21556 </li><li> Generate timestamps from a &quot;live source&quot; and rebase onto the current timebase:
21557 <div class="example">
21558 <pre class="example">setpts='(RTCTIME - RTCSTART) / (TB * 1000000)'
21559 </pre></div>
21560
21561 </li><li> Generate timestamps by counting samples:
21562 <div class="example">
21563 <pre class="example">asetpts=N/SR/TB
21564 </pre></div>
21565
21566 </li></ul>
21567
21568 <a name="settb_002c-asettb"></a>
21569 <h3 class="section">31.9 settb, asettb<span class="pull-right"><a class="anchor hidden-xs" href="#settb_002c-asettb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-settb_002c-asettb" aria-hidden="true">TOC</a></span></h3>
21570
21571 <p>Set the timebase to use for the output frames timestamps.
21572 It is mainly useful for testing timebase configuration.
21573 </p>
21574 <p>It accepts the following parameters:
21575 </p>
21576 <dl compact="compact">
21577 <dt><samp>expr, tb</samp></dt>
21578 <dd><p>The expression which is evaluated into the output timebase.
21579 </p>
21580 </dd>
21581 </dl>
21582
21583 <p>The value for <samp>tb</samp> is an arithmetic expression representing a
21584 rational. The expression can contain the constants &quot;AVTB&quot; (the default
21585 timebase), &quot;intb&quot; (the input timebase) and &quot;sr&quot; (the sample rate,
21586 audio only). Default value is &quot;intb&quot;.
21587 </p>
21588 <a name="Examples-93"></a>
21589 <h4 class="subsection">31.9.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-93" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-93" aria-hidden="true">TOC</a></span></h4>
21590
21591 <ul>
21592 <li> Set the timebase to 1/25:
21593 <div class="example">
21594 <pre class="example">settb=expr=1/25
21595 </pre></div>
21596
21597 </li><li> Set the timebase to 1/10:
21598 <div class="example">
21599 <pre class="example">settb=expr=0.1
21600 </pre></div>
21601
21602 </li><li> Set the timebase to 1001/1000:
21603 <div class="example">
21604 <pre class="example">settb=1+0.001
21605 </pre></div>
21606
21607 </li><li> Set the timebase to 2*intb:
21608 <div class="example">
21609 <pre class="example">settb=2*intb
21610 </pre></div>
21611
21612 </li><li> Set the default timebase value:
21613 <div class="example">
21614 <pre class="example">settb=AVTB
21615 </pre></div>
21616 </li></ul>
21617
21618 <a name="showcqt"></a>
21619 <h3 class="section">31.10 showcqt<span class="pull-right"><a class="anchor hidden-xs" href="#showcqt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showcqt" aria-hidden="true">TOC</a></span></h3>
21620 <p>Convert input audio to a video output representing
21621 frequency spectrum logarithmically (using constant Q transform with
21622 Brown-Puckette algorithm), with musical tone scale, from E0 to D#10 (10 octaves).
21623 </p>
21624 <p>The filter accepts the following options:
21625 </p>
21626 <dl compact="compact">
21627 <dt><samp>volume</samp></dt>
21628 <dd><p>Specify transform volume (multiplier) expression. The expression can contain
21629 variables:
21630 </p><dl compact="compact">
21631 <dt><samp>frequency, freq, f</samp></dt>
21632 <dd><p>the frequency where transform is evaluated
21633 </p></dd>
21634 <dt><samp>timeclamp, tc</samp></dt>
21635 <dd><p>value of timeclamp option
21636 </p></dd>
21637 </dl>
21638 <p>and functions:
21639 </p><dl compact="compact">
21640 <dt><samp>a_weighting(f)</samp></dt>
21641 <dd><p>A-weighting of equal loudness
21642 </p></dd>
21643 <dt><samp>b_weighting(f)</samp></dt>
21644 <dd><p>B-weighting of equal loudness
21645 </p></dd>
21646 <dt><samp>c_weighting(f)</samp></dt>
21647 <dd><p>C-weighting of equal loudness
21648 </p></dd>
21649 </dl>
21650 <p>Default value is <code>16</code>.
21651 </p>
21652 </dd>
21653 <dt><samp>tlength</samp></dt>
21654 <dd><p>Specify transform length expression. The expression can contain variables:
21655 </p><dl compact="compact">
21656 <dt><samp>frequency, freq, f</samp></dt>
21657 <dd><p>the frequency where transform is evaluated
21658 </p></dd>
21659 <dt><samp>timeclamp, tc</samp></dt>
21660 <dd><p>value of timeclamp option
21661 </p></dd>
21662 </dl>
21663 <p>Default value is <code>384/f*tc/(384/f+tc)</code>.
21664 </p>
21665 </dd>
21666 <dt><samp>timeclamp</samp></dt>
21667 <dd><p>Specify the transform timeclamp. At low frequency, there is trade-off between
21668 accuracy in time domain and frequency domain. If timeclamp is lower,
21669 event in time domain is represented more accurately (such as fast bass drum),
21670 otherwise event in frequency domain is represented more accurately
21671 (such as bass guitar). Acceptable value is [0.1, 1.0]. Default value is <code>0.17</code>.
21672 </p>
21673 </dd>
21674 <dt><samp>coeffclamp</samp></dt>
21675 <dd><p>Specify the transform coeffclamp. If coeffclamp is lower, transform is
21676 more accurate, otherwise transform is faster. Acceptable value is [0.1, 10.0].
21677 Default value is <code>1.0</code>.
21678 </p>
21679 </dd>
21680 <dt><samp>gamma</samp></dt>
21681 <dd><p>Specify gamma. Lower gamma makes the spectrum more contrast, higher gamma
21682 makes the spectrum having more range. Acceptable value is [1.0, 7.0].
21683 Default value is <code>3.0</code>.
21684 </p>
21685 </dd>
21686 <dt><samp>gamma2</samp></dt>
21687 <dd><p>Specify gamma of bargraph. Acceptable value is [1.0, 7.0].
21688 Default value is <code>1.0</code>.
21689 </p>
21690 </dd>
21691 <dt><samp>fontfile</samp></dt>
21692 <dd><p>Specify font file for use with freetype. If not specified, use embedded font.
21693 </p>
21694 </dd>
21695 <dt><samp>fontcolor</samp></dt>
21696 <dd><p>Specify font color expression. This is arithmetic expression that should return
21697 integer value 0xRRGGBB. The expression can contain variables:
21698 </p><dl compact="compact">
21699 <dt><samp>frequency, freq, f</samp></dt>
21700 <dd><p>the frequency where transform is evaluated
21701 </p></dd>
21702 <dt><samp>timeclamp, tc</samp></dt>
21703 <dd><p>value of timeclamp option
21704 </p></dd>
21705 </dl>
21706 <p>and functions:
21707 </p><dl compact="compact">
21708 <dt><samp>midi(f)</samp></dt>
21709 <dd><p>midi number of frequency f, some midi numbers: E0(16), C1(24), C2(36), A4(69)
21710 </p></dd>
21711 <dt><samp>r(x), g(x), b(x)</samp></dt>
21712 <dd><p>red, green, and blue value of intensity x
21713 </p></dd>
21714 </dl>
21715 <p>Default value is <code>st(0, (midi(f)-59.5)/12);
21716 st(1, if(between(ld(0),0,1), 0.5-0.5*cos(2*PI*ld(0)), 0));
21717 r(1-ld(1)) + b(ld(1))</code>
21718 </p>
21719 </dd>
21720 <dt><samp>fullhd</samp></dt>
21721 <dd><p>If set to 1 (the default), the video size is 1920x1080 (full HD),
21722 if set to 0, the video size is 960x540. Use this option to make CPU usage lower.
21723 </p>
21724 </dd>
21725 <dt><samp>fps</samp></dt>
21726 <dd><p>Specify video fps. Default value is <code>25</code>.
21727 </p>
21728 </dd>
21729 <dt><samp>count</samp></dt>
21730 <dd><p>Specify number of transform per frame, so there are fps*count transforms
21731 per second. Note that audio data rate must be divisible by fps*count.
21732 Default value is <code>6</code>.
21733 </p>
21734 </dd>
21735 </dl>
21736
21737 <a name="Examples-94"></a>
21738 <h4 class="subsection">31.10.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-94" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-94" aria-hidden="true">TOC</a></span></h4>
21739
21740 <ul>
21741 <li> Playing audio while showing the spectrum:
21742 <div class="example">
21743 <pre class="example">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt [out0]'
21744 </pre></div>
21745
21746 </li><li> Same as above, but with frame rate 30 fps:
21747 <div class="example">
21748 <pre class="example">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=fps=30:count=5 [out0]'
21749 </pre></div>
21750
21751 </li><li> Playing at 960x540 and lower CPU usage:
21752 <div class="example">
21753 <pre class="example">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=fullhd=0:count=3 [out0]'
21754 </pre></div>
21755
21756 </li><li> A1 and its harmonics: A1, A2, (near)E3, A3:
21757 <div class="example">
21758 <pre class="example">ffplay -f lavfi 'aevalsrc=0.1*sin(2*PI*55*t)+0.1*sin(4*PI*55*t)+0.1*sin(6*PI*55*t)+0.1*sin(8*PI*55*t),
21759                  asplit[a][out1]; [a] showcqt [out0]'
21760 </pre></div>
21761
21762 </li><li> Same as above, but with more accuracy in frequency domain (and slower):
21763 <div class="example">
21764 <pre class="example">ffplay -f lavfi 'aevalsrc=0.1*sin(2*PI*55*t)+0.1*sin(4*PI*55*t)+0.1*sin(6*PI*55*t)+0.1*sin(8*PI*55*t),
21765                  asplit[a][out1]; [a] showcqt=timeclamp=0.5 [out0]'
21766 </pre></div>
21767
21768 </li><li> B-weighting of equal loudness
21769 <div class="example">
21770 <pre class="example">volume=16*b_weighting(f)
21771 </pre></div>
21772
21773 </li><li> Lower Q factor
21774 <div class="example">
21775 <pre class="example">tlength=100/f*tc/(100/f+tc)
21776 </pre></div>
21777
21778 </li><li> Custom fontcolor, C-note is colored green, others are colored blue
21779 <div class="example">
21780 <pre class="example">fontcolor='if(mod(floor(midi(f)+0.5),12), 0x0000FF, g(1))'
21781 </pre></div>
21782
21783 </li><li> Custom gamma, now spectrum is linear to the amplitude.
21784 <div class="example">
21785 <pre class="example">gamma=2:gamma2=2
21786 </pre></div>
21787
21788 </li></ul>
21789
21790 <a name="showspectrum"></a>
21791 <h3 class="section">31.11 showspectrum<span class="pull-right"><a class="anchor hidden-xs" href="#showspectrum" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showspectrum" aria-hidden="true">TOC</a></span></h3>
21792
21793 <p>Convert input audio to a video output, representing the audio frequency
21794 spectrum.
21795 </p>
21796 <p>The filter accepts the following options:
21797 </p>
21798 <dl compact="compact">
21799 <dt><samp>size, s</samp></dt>
21800 <dd><p>Specify the video size for the output. For the syntax of this option, check the
21801 <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
21802 Default value is <code>640x512</code>.
21803 </p>
21804 </dd>
21805 <dt><samp>slide</samp></dt>
21806 <dd><p>Specify how the spectrum should slide along the window.
21807 </p>
21808 <p>It accepts the following values:
21809 </p><dl compact="compact">
21810 <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
21811 <dd><p>the samples start again on the left when they reach the right
21812 </p></dd>
21813 <dt>&lsquo;<samp>scroll</samp>&rsquo;</dt>
21814 <dd><p>the samples scroll from right to left
21815 </p></dd>
21816 <dt>&lsquo;<samp>fullframe</samp>&rsquo;</dt>
21817 <dd><p>frames are only produced when the samples reach the right
21818 </p></dd>
21819 </dl>
21820
21821 <p>Default value is <code>replace</code>.
21822 </p>
21823 </dd>
21824 <dt><samp>mode</samp></dt>
21825 <dd><p>Specify display mode.
21826 </p>
21827 <p>It accepts the following values:
21828 </p><dl compact="compact">
21829 <dt>&lsquo;<samp>combined</samp>&rsquo;</dt>
21830 <dd><p>all channels are displayed in the same row
21831 </p></dd>
21832 <dt>&lsquo;<samp>separate</samp>&rsquo;</dt>
21833 <dd><p>all channels are displayed in separate rows
21834 </p></dd>
21835 </dl>
21836
21837 <p>Default value is &lsquo;<samp>combined</samp>&rsquo;.
21838 </p>
21839 </dd>
21840 <dt><samp>color</samp></dt>
21841 <dd><p>Specify display color mode.
21842 </p>
21843 <p>It accepts the following values:
21844 </p><dl compact="compact">
21845 <dt>&lsquo;<samp>channel</samp>&rsquo;</dt>
21846 <dd><p>each channel is displayed in a separate color
21847 </p></dd>
21848 <dt>&lsquo;<samp>intensity</samp>&rsquo;</dt>
21849 <dd><p>each channel is is displayed using the same color scheme
21850 </p></dd>
21851 </dl>
21852
21853 <p>Default value is &lsquo;<samp>channel</samp>&rsquo;.
21854 </p>
21855 </dd>
21856 <dt><samp>scale</samp></dt>
21857 <dd><p>Specify scale used for calculating intensity color values.
21858 </p>
21859 <p>It accepts the following values:
21860 </p><dl compact="compact">
21861 <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
21862 <dd><p>linear
21863 </p></dd>
21864 <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
21865 <dd><p>square root, default
21866 </p></dd>
21867 <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
21868 <dd><p>cubic root
21869 </p></dd>
21870 <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
21871 <dd><p>logarithmic
21872 </p></dd>
21873 </dl>
21874
21875 <p>Default value is &lsquo;<samp>sqrt</samp>&rsquo;.
21876 </p>
21877 </dd>
21878 <dt><samp>saturation</samp></dt>
21879 <dd><p>Set saturation modifier for displayed colors. Negative values provide
21880 alternative color scheme. <code>0</code> is no saturation at all.
21881 Saturation must be in [-10.0, 10.0] range.
21882 Default value is <code>1</code>.
21883 </p>
21884 </dd>
21885 <dt><samp>win_func</samp></dt>
21886 <dd><p>Set window function.
21887 </p>
21888 <p>It accepts the following values:
21889 </p><dl compact="compact">
21890 <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
21891 <dd><p>No samples pre-processing (do not expect this to be faster)
21892 </p></dd>
21893 <dt>&lsquo;<samp>hann</samp>&rsquo;</dt>
21894 <dd><p>Hann window
21895 </p></dd>
21896 <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
21897 <dd><p>Hamming window
21898 </p></dd>
21899 <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
21900 <dd><p>Blackman window
21901 </p></dd>
21902 </dl>
21903
21904 <p>Default value is <code>hann</code>.
21905 </p></dd>
21906 </dl>
21907
21908 <p>The usage is very similar to the showwaves filter; see the examples in that
21909 section.
21910 </p>
21911 <a name="Examples-95"></a>
21912 <h4 class="subsection">31.11.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-95" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-95" aria-hidden="true">TOC</a></span></h4>
21913
21914 <ul>
21915 <li> Large window with logarithmic color scaling:
21916 <div class="example">
21917 <pre class="example">showspectrum=s=1280x480:scale=log
21918 </pre></div>
21919
21920 </li><li> Complete example for a colored and sliding spectrum per channel using <code>ffplay</code>:
21921 <div class="example">
21922 <pre class="example">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
21923              [a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]'
21924 </pre></div>
21925 </li></ul>
21926
21927 <a name="showwaves"></a>
21928 <h3 class="section">31.12 showwaves<span class="pull-right"><a class="anchor hidden-xs" href="#showwaves" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showwaves" aria-hidden="true">TOC</a></span></h3>
21929
21930 <p>Convert input audio to a video output, representing the samples waves.
21931 </p>
21932 <p>The filter accepts the following options:
21933 </p>
21934 <dl compact="compact">
21935 <dt><samp>size, s</samp></dt>
21936 <dd><p>Specify the video size for the output. For the syntax of this option, check the
21937 <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
21938 Default value is <code>600x240</code>.
21939 </p>
21940 </dd>
21941 <dt><samp>mode</samp></dt>
21942 <dd><p>Set display mode.
21943 </p>
21944 <p>Available values are:
21945 </p><dl compact="compact">
21946 <dt>&lsquo;<samp>point</samp>&rsquo;</dt>
21947 <dd><p>Draw a point for each sample.
21948 </p>
21949 </dd>
21950 <dt>&lsquo;<samp>line</samp>&rsquo;</dt>
21951 <dd><p>Draw a vertical line for each sample.
21952 </p>
21953 </dd>
21954 <dt>&lsquo;<samp>p2p</samp>&rsquo;</dt>
21955 <dd><p>Draw a point for each sample and a line between them.
21956 </p>
21957 </dd>
21958 <dt>&lsquo;<samp>cline</samp>&rsquo;</dt>
21959 <dd><p>Draw a centered vertical line for each sample.
21960 </p></dd>
21961 </dl>
21962
21963 <p>Default value is <code>point</code>.
21964 </p>
21965 </dd>
21966 <dt><samp>n</samp></dt>
21967 <dd><p>Set the number of samples which are printed on the same column. A
21968 larger value will decrease the frame rate. Must be a positive
21969 integer. This option can be set only if the value for <var>rate</var>
21970 is not explicitly specified.
21971 </p>
21972 </dd>
21973 <dt><samp>rate, r</samp></dt>
21974 <dd><p>Set the (approximate) output frame rate. This is done by setting the
21975 option <var>n</var>. Default value is &quot;25&quot;.
21976 </p>
21977 </dd>
21978 <dt><samp>split_channels</samp></dt>
21979 <dd><p>Set if channels should be drawn separately or overlap. Default value is 0.
21980 </p>
21981 </dd>
21982 </dl>
21983
21984 <a name="Examples-96"></a>
21985 <h4 class="subsection">31.12.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-96" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-96" aria-hidden="true">TOC</a></span></h4>
21986
21987 <ul>
21988 <li> Output the input file audio and the corresponding video representation
21989 at the same time:
21990 <div class="example">
21991 <pre class="example">amovie=a.mp3,asplit[out0],showwaves[out1]
21992 </pre></div>
21993
21994 </li><li> Create a synthetic signal and show it with showwaves, forcing a
21995 frame rate of 30 frames per second:
21996 <div class="example">
21997 <pre class="example">aevalsrc=sin(1*2*PI*t)*sin(880*2*PI*t):cos(2*PI*200*t),asplit[out0],showwaves=r=30[out1]
21998 </pre></div>
21999 </li></ul>
22000
22001 <a name="showwavespic"></a>
22002 <h3 class="section">31.13 showwavespic<span class="pull-right"><a class="anchor hidden-xs" href="#showwavespic" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showwavespic" aria-hidden="true">TOC</a></span></h3>
22003
22004 <p>Convert input audio to a single video frame, representing the samples waves.
22005 </p>
22006 <p>The filter accepts the following options:
22007 </p>
22008 <dl compact="compact">
22009 <dt><samp>size, s</samp></dt>
22010 <dd><p>Specify the video size for the output. For the syntax of this option, check the
22011 <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
22012 Default value is <code>600x240</code>.
22013 </p>
22014 </dd>
22015 <dt><samp>split_channels</samp></dt>
22016 <dd><p>Set if channels should be drawn separately or overlap. Default value is 0.
22017 </p></dd>
22018 </dl>
22019
22020 <a name="Examples-97"></a>
22021 <h4 class="subsection">31.13.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-97" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-97" aria-hidden="true">TOC</a></span></h4>
22022
22023 <ul>
22024 <li> Extract a channel split representation of the wave form of a whole audio track
22025 in a 1024x800 picture using <code>ffmpeg</code>:
22026 <div class="example">
22027 <pre class="example">ffmpeg -i audio.flac -lavfi showwavespic=split_channels=1:s=1024x800 waveform.png
22028 </pre></div>
22029 </li></ul>
22030
22031 <a name="split_002c-asplit"></a>
22032 <h3 class="section">31.14 split, asplit<span class="pull-right"><a class="anchor hidden-xs" href="#split_002c-asplit" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-split_002c-asplit" aria-hidden="true">TOC</a></span></h3>
22033
22034 <p>Split input into several identical outputs.
22035 </p>
22036 <p><code>asplit</code> works with audio input, <code>split</code> with video.
22037 </p>
22038 <p>The filter accepts a single parameter which specifies the number of outputs. If
22039 unspecified, it defaults to 2.
22040 </p>
22041 <a name="Examples-98"></a>
22042 <h4 class="subsection">31.14.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-98" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-98" aria-hidden="true">TOC</a></span></h4>
22043
22044 <ul>
22045 <li> Create two separate outputs from the same input:
22046 <div class="example">
22047 <pre class="example">[in] split [out0][out1]
22048 </pre></div>
22049
22050 </li><li> To create 3 or more outputs, you need to specify the number of
22051 outputs, like in:
22052 <div class="example">
22053 <pre class="example">[in] asplit=3 [out0][out1][out2]
22054 </pre></div>
22055
22056 </li><li> Create two separate outputs from the same input, one cropped and
22057 one padded:
22058 <div class="example">
22059 <pre class="example">[in] split [splitout1][splitout2];
22060 [splitout1] crop=100:100:0:0    [cropout];
22061 [splitout2] pad=200:200:100:100 [padout];
22062 </pre></div>
22063
22064 </li><li> Create 5 copies of the input audio with <code>ffmpeg</code>:
22065 <div class="example">
22066 <pre class="example">ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT
22067 </pre></div>
22068 </li></ul>
22069
22070 <a name="zmq_002c-azmq"></a>
22071 <h3 class="section">31.15 zmq, azmq<span class="pull-right"><a class="anchor hidden-xs" href="#zmq_002c-azmq" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-zmq_002c-azmq" aria-hidden="true">TOC</a></span></h3>
22072
22073 <p>Receive commands sent through a libzmq client, and forward them to
22074 filters in the filtergraph.
22075 </p>
22076 <p><code>zmq</code> and <code>azmq</code> work as a pass-through filters. <code>zmq</code>
22077 must be inserted between two video filters, <code>azmq</code> between two
22078 audio filters.
22079 </p>
22080 <p>To enable these filters you need to install the libzmq library and
22081 headers and configure FFmpeg with <code>--enable-libzmq</code>.
22082 </p>
22083 <p>For more information about libzmq see:
22084 <a href="http://www.zeromq.org/">http://www.zeromq.org/</a>
22085 </p>
22086 <p>The <code>zmq</code> and <code>azmq</code> filters work as a libzmq server, which
22087 receives messages sent through a network interface defined by the
22088 <samp>bind_address</samp> option.
22089 </p>
22090 <p>The received message must be in the form:
22091 </p><div class="example">
22092 <pre class="example"><var>TARGET</var> <var>COMMAND</var> [<var>ARG</var>]
22093 </pre></div>
22094
22095 <p><var>TARGET</var> specifies the target of the command, usually the name of
22096 the filter class or a specific filter instance name.
22097 </p>
22098 <p><var>COMMAND</var> specifies the name of the command for the target filter.
22099 </p>
22100 <p><var>ARG</var> is optional and specifies the optional argument list for the
22101 given <var>COMMAND</var>.
22102 </p>
22103 <p>Upon reception, the message is processed and the corresponding command
22104 is injected into the filtergraph. Depending on the result, the filter
22105 will send a reply to the client, adopting the format:
22106 </p><div class="example">
22107 <pre class="example"><var>ERROR_CODE</var> <var>ERROR_REASON</var>
22108 <var>MESSAGE</var>
22109 </pre></div>
22110
22111 <p><var>MESSAGE</var> is optional.
22112 </p>
22113 <a name="Examples-99"></a>
22114 <h4 class="subsection">31.15.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-99" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-99" aria-hidden="true">TOC</a></span></h4>
22115
22116 <p>Look at <samp>tools/zmqsend</samp> for an example of a zmq client which can
22117 be used to send commands processed by these filters.
22118 </p>
22119 <p>Consider the following filtergraph generated by <code>ffplay</code>
22120 </p><div class="example">
22121 <pre class="example">ffplay -dumpgraph 1 -f lavfi &quot;
22122 color=s=100x100:c=red  [l];
22123 color=s=100x100:c=blue [r];
22124 nullsrc=s=200x100, zmq [bg];
22125 [bg][l]   overlay      [bg+l];
22126 [bg+l][r] overlay=x=100 &quot;
22127 </pre></div>
22128
22129 <p>To change the color of the left side of the video, the following
22130 command can be used:
22131 </p><div class="example">
22132 <pre class="example">echo Parsed_color_0 c yellow | tools/zmqsend
22133 </pre></div>
22134
22135 <p>To change the right side:
22136 </p><div class="example">
22137 <pre class="example">echo Parsed_color_1 c pink | tools/zmqsend
22138 </pre></div>
22139
22140
22141 <a name="Multimedia-Sources"></a>
22142 <h2 class="chapter">32 Multimedia Sources<span class="pull-right"><a class="anchor hidden-xs" href="#Multimedia-Sources" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Multimedia-Sources" aria-hidden="true">TOC</a></span></h2>
22143
22144 <p>Below is a description of the currently available multimedia sources.
22145 </p>
22146 <a name="amovie"></a>
22147 <h3 class="section">32.1 amovie<span class="pull-right"><a class="anchor hidden-xs" href="#amovie" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amovie" aria-hidden="true">TOC</a></span></h3>
22148
22149 <p>This is the same as <a href="#movie">movie</a> source, except it selects an audio
22150 stream by default.
22151 </p>
22152 <a name="movie"></a><a name="movie-1"></a>
22153 <h3 class="section">32.2 movie<span class="pull-right"><a class="anchor hidden-xs" href="#movie-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-movie-1" aria-hidden="true">TOC</a></span></h3>
22154
22155 <p>Read audio and/or video stream(s) from a movie container.
22156 </p>
22157 <p>It accepts the following parameters:
22158 </p>
22159 <dl compact="compact">
22160 <dt><samp>filename</samp></dt>
22161 <dd><p>The name of the resource to read (not necessarily a file; it can also be a
22162 device or a stream accessed through some protocol).
22163 </p>
22164 </dd>
22165 <dt><samp>format_name, f</samp></dt>
22166 <dd><p>Specifies the format assumed for the movie to read, and can be either
22167 the name of a container or an input device. If not specified, the
22168 format is guessed from <var>movie_name</var> or by probing.
22169 </p>
22170 </dd>
22171 <dt><samp>seek_point, sp</samp></dt>
22172 <dd><p>Specifies the seek point in seconds. The frames will be output
22173 starting from this seek point. The parameter is evaluated with
22174 <code>av_strtod</code>, so the numerical value may be suffixed by an IS
22175 postfix. The default value is &quot;0&quot;.
22176 </p>
22177 </dd>
22178 <dt><samp>streams, s</samp></dt>
22179 <dd><p>Specifies the streams to read. Several streams can be specified,
22180 separated by &quot;+&quot;. The source will then have as many outputs, in the
22181 same order. The syntax is explained in the &ldquo;Stream specifiers&rdquo;
22182 section in the ffmpeg manual. Two special names, &quot;dv&quot; and &quot;da&quot; specify
22183 respectively the default (best suited) video and audio stream. Default
22184 is &quot;dv&quot;, or &quot;da&quot; if the filter is called as &quot;amovie&quot;.
22185 </p>
22186 </dd>
22187 <dt><samp>stream_index, si</samp></dt>
22188 <dd><p>Specifies the index of the video stream to read. If the value is -1,
22189 the most suitable video stream will be automatically selected. The default
22190 value is &quot;-1&quot;. Deprecated. If the filter is called &quot;amovie&quot;, it will select
22191 audio instead of video.
22192 </p>
22193 </dd>
22194 <dt><samp>loop</samp></dt>
22195 <dd><p>Specifies how many times to read the stream in sequence.
22196 If the value is less than 1, the stream will be read again and again.
22197 Default value is &quot;1&quot;.
22198 </p>
22199 <p>Note that when the movie is looped the source timestamps are not
22200 changed, so it will generate non monotonically increasing timestamps.
22201 </p></dd>
22202 </dl>
22203
22204 <p>It allows overlaying a second video on top of the main input of
22205 a filtergraph, as shown in this graph:
22206 </p><div class="example">
22207 <pre class="example">input -----------&gt; deltapts0 --&gt; overlay --&gt; output
22208                                     ^
22209                                     |
22210 movie --&gt; scale--&gt; deltapts1 -------+
22211 </pre></div>
22212 <a name="Examples-100"></a>
22213 <h4 class="subsection">32.2.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-100" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-100" aria-hidden="true">TOC</a></span></h4>
22214
22215 <ul>
22216 <li> Skip 3.2 seconds from the start of the AVI file in.avi, and overlay it
22217 on top of the input labelled &quot;in&quot;:
22218 <div class="example">
22219 <pre class="example">movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [over];
22220 [in] setpts=PTS-STARTPTS [main];
22221 [main][over] overlay=16:16 [out]
22222 </pre></div>
22223
22224 </li><li> Read from a video4linux2 device, and overlay it on top of the input
22225 labelled &quot;in&quot;:
22226 <div class="example">
22227 <pre class="example">movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [over];
22228 [in] setpts=PTS-STARTPTS [main];
22229 [main][over] overlay=16:16 [out]
22230 </pre></div>
22231
22232 </li><li> Read the first video stream and the audio stream with id 0x81 from
22233 dvd.vob; the video is connected to the pad named &quot;video&quot; and the audio is
22234 connected to the pad named &quot;audio&quot;:
22235 <div class="example">
22236 <pre class="example">movie=dvd.vob:s=v:0+#0x81 [video] [audio]
22237 </pre></div>
22238 </li></ul>
22239
22240
22241 <a name="See-Also"></a>
22242 <h2 class="chapter">33 See Also<span class="pull-right"><a class="anchor hidden-xs" href="#See-Also" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-See-Also" aria-hidden="true">TOC</a></span></h2>
22243
22244 <p><a href="ffplay.html">ffplay</a>,
22245 <a href="ffmpeg.html">ffmpeg</a>, <a href="ffprobe.html">ffprobe</a>, <a href="ffserver.html">ffserver</a>,
22246 <a href="ffmpeg-utils.html">ffmpeg-utils</a>,
22247 <a href="ffmpeg-scaler.html">ffmpeg-scaler</a>,
22248 <a href="ffmpeg-resampler.html">ffmpeg-resampler</a>,
22249 <a href="ffmpeg-codecs.html">ffmpeg-codecs</a>,
22250 <a href="ffmpeg-bitstream-filters.html">ffmpeg-bitstream-filters</a>,
22251 <a href="ffmpeg-formats.html">ffmpeg-formats</a>,
22252 <a href="ffmpeg-devices.html">ffmpeg-devices</a>,
22253 <a href="ffmpeg-protocols.html">ffmpeg-protocols</a>,
22254 <a href="ffmpeg-filters.html">ffmpeg-filters</a>
22255 </p>
22256
22257 <a name="Authors"></a>
22258 <h2 class="chapter">34 Authors<span class="pull-right"><a class="anchor hidden-xs" href="#Authors" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Authors" aria-hidden="true">TOC</a></span></h2>
22259
22260 <p>The FFmpeg developers.
22261 </p>
22262 <p>For details about the authorship, see the Git history of the project
22263 (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
22264 <code>git log</code> in the FFmpeg source directory, or browsing the
22265 online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
22266 </p>
22267 <p>Maintainers for the specific components are listed in the file
22268 <samp>MAINTAINERS</samp> in the source code tree.
22269 </p>
22270
22271
22272       <p style="font-size: small;">
22273         This document was generated using <a href="http://www.gnu.org/software/texinfo/"><em>makeinfo</em></a>.
22274       </p>
22275     </div>
22276   </body>
22277 </html>