]> git.sesse.net Git - casparcg/blob - dependencies/ffmpeg/doc/ffplay-all.html
Upgraded ffmpeg to newest stable
[casparcg] / dependencies / ffmpeg / doc / ffplay-all.html
1 <!DOCTYPE html>
2 <html>
3 <!-- Created on June 19, 2014 by texi2html 1.82 -->
4 <!--
5 texi2html was written by: 
6             Lionel Cons <Lionel.Cons@cern.ch> (original author)
7             Karl Berry  <karl@freefriends.org>
8             Olaf Bachmann <obachman@mathematik.uni-kl.de>
9             and many others.
10 Maintained by: Many creative people.
11 Send bugs and suggestions to <texi2html-bug@nongnu.org>
12
13 -->
14 <head>
15 <title>FFmpeg documentation : ffplay </title>
16
17 <meta name="description" content="ffplay Documentation: ">
18 <meta name="keywords" content="FFmpeg documentation : ffplay ">
19 <meta name="Generator" content="texi2html 1.82">
20 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
21 <link rel="stylesheet" type="text/css" href="default.css" />
22
23 <link rel="icon" href="favicon.png" type="image/png" />
24 </head>
25 <body>
26 <div id="container">
27 <div id="body">
28
29 <a name="SEC_Top"></a>
30 <h1 class="settitle">ffplay Documentation</h1>
31
32 <a name="SEC_Contents"></a>
33 <h1>Table of Contents</h1>
34 <div class="contents">
35
36 <ul class="toc">
37   <li><a name="toc-Synopsis" href="#Synopsis">1. Synopsis</a></li>
38   <li><a name="toc-Description" href="#Description">2. Description</a></li>
39   <li><a name="toc-Options-4" href="#Options-4">3. Options</a>
40   <ul class="toc">
41     <li><a name="toc-Stream-specifiers-1" href="#Stream-specifiers-1">3.1 Stream specifiers</a></li>
42     <li><a name="toc-Generic-options" href="#Generic-options">3.2 Generic options</a></li>
43     <li><a name="toc-AVOptions" href="#AVOptions">3.3 AVOptions</a></li>
44     <li><a name="toc-Main-options" href="#Main-options">3.4 Main options</a></li>
45     <li><a name="toc-Advanced-options" href="#Advanced-options">3.5 Advanced options</a></li>
46     <li><a name="toc-While-playing" href="#While-playing">3.6 While playing</a></li>
47   </ul></li>
48   <li><a name="toc-Syntax" href="#Syntax">4. Syntax</a>
49   <ul class="toc">
50     <li><a name="toc-Quoting-and-escaping" href="#Quoting-and-escaping">4.1 Quoting and escaping</a>
51     <ul class="toc">
52       <li><a name="toc-Examples-4" href="#Examples-4">4.1.1 Examples</a></li>
53     </ul></li>
54     <li><a name="toc-Date" href="#Date">4.2 Date</a></li>
55     <li><a name="toc-Time-duration" href="#Time-duration">4.3 Time duration</a>
56     <ul class="toc">
57       <li><a name="toc-Examples-66" href="#Examples-66">4.3.1 Examples</a></li>
58     </ul></li>
59     <li><a name="toc-Video-size" href="#Video-size">4.4 Video size</a></li>
60     <li><a name="toc-Video-rate" href="#Video-rate">4.5 Video rate</a></li>
61     <li><a name="toc-Ratio" href="#Ratio">4.6 Ratio</a></li>
62     <li><a name="toc-Color" href="#Color">4.7 Color</a></li>
63     <li><a name="toc-Channel-Layout" href="#Channel-Layout">4.8 Channel Layout</a></li>
64   </ul></li>
65   <li><a name="toc-Expression-Evaluation" href="#Expression-Evaluation">5. Expression Evaluation</a></li>
66   <li><a name="toc-OpenCL-Options" href="#OpenCL-Options">6. OpenCL Options</a></li>
67   <li><a name="toc-Codec-Options" href="#Codec-Options">7. Codec Options</a></li>
68   <li><a name="toc-Decoders" href="#Decoders">8. Decoders</a></li>
69   <li><a name="toc-Video-Decoders" href="#Video-Decoders">9. Video Decoders</a>
70   <ul class="toc">
71     <li><a name="toc-rawvideo-1" href="#rawvideo-1">9.1 rawvideo</a>
72     <ul class="toc">
73       <li><a name="toc-Options-7" href="#Options-7">9.1.1 Options</a></li>
74     </ul>
75 </li>
76   </ul></li>
77   <li><a name="toc-Audio-Decoders" href="#Audio-Decoders">10. Audio Decoders</a>
78   <ul class="toc">
79     <li><a name="toc-ac3" href="#ac3">10.1 ac3</a>
80     <ul class="toc">
81       <li><a name="toc-AC_002d3-Decoder-Options" href="#AC_002d3-Decoder-Options">10.1.1 AC-3 Decoder Options</a></li>
82     </ul></li>
83     <li><a name="toc-ffwavesynth" href="#ffwavesynth">10.2 ffwavesynth</a></li>
84     <li><a name="toc-libcelt" href="#libcelt">10.3 libcelt</a></li>
85     <li><a name="toc-libgsm" href="#libgsm">10.4 libgsm</a></li>
86     <li><a name="toc-libilbc" href="#libilbc">10.5 libilbc</a>
87     <ul class="toc">
88       <li><a name="toc-Options-11" href="#Options-11">10.5.1 Options</a></li>
89     </ul></li>
90     <li><a name="toc-libopencore_002damrnb" href="#libopencore_002damrnb">10.6 libopencore-amrnb</a></li>
91     <li><a name="toc-libopencore_002damrwb" href="#libopencore_002damrwb">10.7 libopencore-amrwb</a></li>
92     <li><a name="toc-libopus" href="#libopus">10.8 libopus</a></li>
93   </ul></li>
94   <li><a name="toc-Subtitles-Decoders" href="#Subtitles-Decoders">11. Subtitles Decoders</a>
95   <ul class="toc">
96     <li><a name="toc-dvdsub" href="#dvdsub">11.1 dvdsub</a>
97     <ul class="toc">
98       <li><a name="toc-Options-10" href="#Options-10">11.1.1 Options</a></li>
99     </ul></li>
100     <li><a name="toc-libzvbi_002dteletext" href="#libzvbi_002dteletext">11.2 libzvbi-teletext</a>
101     <ul class="toc">
102       <li><a name="toc-Options-3" href="#Options-3">11.2.1 Options</a></li>
103     </ul>
104 </li>
105   </ul></li>
106   <li><a name="toc-Bitstream-Filters" href="#Bitstream-Filters">12. Bitstream Filters</a>
107   <ul class="toc">
108     <li><a name="toc-aac_005fadtstoasc" href="#aac_005fadtstoasc">12.1 aac_adtstoasc</a></li>
109     <li><a name="toc-chomp" href="#chomp">12.2 chomp</a></li>
110     <li><a name="toc-dump_005fextra" href="#dump_005fextra">12.3 dump_extra</a></li>
111     <li><a name="toc-h264_005fmp4toannexb" href="#h264_005fmp4toannexb">12.4 h264_mp4toannexb</a></li>
112     <li><a name="toc-imx_005fdump_005fheader" href="#imx_005fdump_005fheader">12.5 imx_dump_header</a></li>
113     <li><a name="toc-mjpeg2jpeg" href="#mjpeg2jpeg">12.6 mjpeg2jpeg</a></li>
114     <li><a name="toc-mjpega_005fdump_005fheader" href="#mjpega_005fdump_005fheader">12.7 mjpega_dump_header</a></li>
115     <li><a name="toc-movsub" href="#movsub">12.8 movsub</a></li>
116     <li><a name="toc-mp3_005fheader_005fdecompress" href="#mp3_005fheader_005fdecompress">12.9 mp3_header_decompress</a></li>
117     <li><a name="toc-noise" href="#noise">12.10 noise</a></li>
118     <li><a name="toc-remove_005fextra" href="#remove_005fextra">12.11 remove_extra</a></li>
119   </ul></li>
120   <li><a name="toc-Format-Options" href="#Format-Options">13. Format Options</a>
121   <ul class="toc">
122     <li><a name="toc-Format-stream-specifiers-1" href="#Format-stream-specifiers-1">13.1 Format stream specifiers</a></li>
123   </ul></li>
124   <li><a name="toc-Demuxers" href="#Demuxers">14. Demuxers</a>
125   <ul class="toc">
126     <li><a name="toc-applehttp" href="#applehttp">14.1 applehttp</a></li>
127     <li><a name="toc-asf" href="#asf">14.2 asf</a></li>
128     <li><a name="toc-concat-1" href="#concat-1">14.3 concat</a>
129     <ul class="toc">
130       <li><a name="toc-Syntax-1" href="#Syntax-1">14.3.1 Syntax</a></li>
131       <li><a name="toc-Options-2" href="#Options-2">14.3.2 Options</a></li>
132     </ul></li>
133     <li><a name="toc-flv" href="#flv">14.4 flv</a></li>
134     <li><a name="toc-libgme" href="#libgme">14.5 libgme</a></li>
135     <li><a name="toc-libquvi" href="#libquvi">14.6 libquvi</a></li>
136     <li><a name="toc-image2" href="#image2">14.7 image2</a>
137     <ul class="toc">
138       <li><a name="toc-Examples-75" href="#Examples-75">14.7.1 Examples</a></li>
139     </ul></li>
140     <li><a name="toc-mpegts" href="#mpegts">14.8 mpegts</a></li>
141     <li><a name="toc-rawvideo" href="#rawvideo">14.9 rawvideo</a></li>
142     <li><a name="toc-sbg" href="#sbg">14.10 sbg</a></li>
143     <li><a name="toc-tedcaptions" href="#tedcaptions">14.11 tedcaptions</a></li>
144   </ul></li>
145   <li><a name="toc-Metadata" href="#Metadata">15. Metadata</a></li>
146   <li><a name="toc-Protocols" href="#Protocols">16. Protocols</a>
147   <ul class="toc">
148     <li><a name="toc-bluray" href="#bluray">16.1 bluray</a></li>
149     <li><a name="toc-cache" href="#cache">16.2 cache</a></li>
150     <li><a name="toc-concat-3" href="#concat-3">16.3 concat</a></li>
151     <li><a name="toc-crypto" href="#crypto">16.4 crypto</a></li>
152     <li><a name="toc-data" href="#data">16.5 data</a></li>
153     <li><a name="toc-file" href="#file">16.6 file</a></li>
154     <li><a name="toc-ftp" href="#ftp">16.7 ftp</a></li>
155     <li><a name="toc-gopher" href="#gopher">16.8 gopher</a></li>
156     <li><a name="toc-hls" href="#hls">16.9 hls</a></li>
157     <li><a name="toc-http" href="#http">16.10 http</a>
158     <ul class="toc">
159       <li><a name="toc-HTTP-Cookies" href="#HTTP-Cookies">16.10.1 HTTP Cookies</a></li>
160     </ul></li>
161     <li><a name="toc-mmst" href="#mmst">16.11 mmst</a></li>
162     <li><a name="toc-mmsh" href="#mmsh">16.12 mmsh</a></li>
163     <li><a name="toc-md5" href="#md5">16.13 md5</a></li>
164     <li><a name="toc-pipe" href="#pipe">16.14 pipe</a></li>
165     <li><a name="toc-rtmp" href="#rtmp">16.15 rtmp</a></li>
166     <li><a name="toc-rtmpe" href="#rtmpe">16.16 rtmpe</a></li>
167     <li><a name="toc-rtmps" href="#rtmps">16.17 rtmps</a></li>
168     <li><a name="toc-rtmpt" href="#rtmpt">16.18 rtmpt</a></li>
169     <li><a name="toc-rtmpte" href="#rtmpte">16.19 rtmpte</a></li>
170     <li><a name="toc-rtmpts" href="#rtmpts">16.20 rtmpts</a></li>
171     <li><a name="toc-libssh" href="#libssh">16.21 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.22 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></li>
173     <li><a name="toc-rtp" href="#rtp">16.23 rtp</a></li>
174     <li><a name="toc-rtsp" href="#rtsp">16.24 rtsp</a>
175     <ul class="toc">
176       <li><a name="toc-Examples-78" href="#Examples-78">16.24.1 Examples</a></li>
177     </ul></li>
178     <li><a name="toc-sap" href="#sap">16.25 sap</a>
179     <ul class="toc">
180       <li><a name="toc-Muxer" href="#Muxer">16.25.1 Muxer</a></li>
181       <li><a name="toc-Demuxer" href="#Demuxer">16.25.2 Demuxer</a></li>
182     </ul></li>
183     <li><a name="toc-sctp" href="#sctp">16.26 sctp</a></li>
184     <li><a name="toc-srtp" href="#srtp">16.27 srtp</a></li>
185     <li><a name="toc-tcp" href="#tcp">16.28 tcp</a></li>
186     <li><a name="toc-tls" href="#tls">16.29 tls</a></li>
187     <li><a name="toc-udp" href="#udp">16.30 udp</a>
188     <ul class="toc">
189       <li><a name="toc-Examples-53" href="#Examples-53">16.30.1 Examples</a></li>
190     </ul></li>
191     <li><a name="toc-unix" href="#unix">16.31 unix</a></li>
192   </ul></li>
193   <li><a name="toc-Device-Options" href="#Device-Options">17. Device Options</a></li>
194   <li><a name="toc-Input-Devices" href="#Input-Devices">18. Input Devices</a>
195   <ul class="toc">
196     <li><a name="toc-alsa" href="#alsa">18.1 alsa</a></li>
197     <li><a name="toc-bktr" href="#bktr">18.2 bktr</a></li>
198     <li><a name="toc-dshow" href="#dshow">18.3 dshow</a>
199     <ul class="toc">
200       <li><a name="toc-Options-1" href="#Options-1">18.3.1 Options</a></li>
201       <li><a name="toc-Examples-23" href="#Examples-23">18.3.2 Examples</a></li>
202     </ul></li>
203     <li><a name="toc-dv1394" href="#dv1394">18.4 dv1394</a></li>
204     <li><a name="toc-fbdev" href="#fbdev">18.5 fbdev</a></li>
205     <li><a name="toc-iec61883" href="#iec61883">18.6 iec61883</a>
206     <ul class="toc">
207       <li><a name="toc-Options-12" href="#Options-12">18.6.1 Options</a></li>
208       <li><a name="toc-Examples-26" href="#Examples-26">18.6.2 Examples</a></li>
209     </ul></li>
210     <li><a name="toc-jack" href="#jack">18.7 jack</a></li>
211     <li><a name="toc-lavfi" href="#lavfi">18.8 lavfi</a>
212     <ul class="toc">
213       <li><a name="toc-Options-13" href="#Options-13">18.8.1 Options</a></li>
214       <li><a name="toc-Examples-27" href="#Examples-27">18.8.2 Examples</a></li>
215     </ul></li>
216     <li><a name="toc-libdc1394" href="#libdc1394">18.9 libdc1394</a></li>
217     <li><a name="toc-openal" href="#openal">18.10 openal</a>
218     <ul class="toc">
219       <li><a name="toc-Options-14" href="#Options-14">18.10.1 Options</a></li>
220       <li><a name="toc-Examples-42" href="#Examples-42">18.10.2 Examples</a></li>
221     </ul></li>
222     <li><a name="toc-oss" href="#oss">18.11 oss</a></li>
223     <li><a name="toc-pulse" href="#pulse">18.12 pulse</a>
224     <ul class="toc">
225       <li><a name="toc-Options" href="#Options">18.12.1 Options</a></li>
226       <li><a name="toc-Examples-71" href="#Examples-71">18.12.2 Examples</a></li>
227     </ul></li>
228     <li><a name="toc-sndio" href="#sndio">18.13 sndio</a></li>
229     <li><a name="toc-video4linux2_002c-v4l2" href="#video4linux2_002c-v4l2">18.14 video4linux2, v4l2</a>
230     <ul class="toc">
231       <li><a name="toc-Options-9" href="#Options-9">18.14.1 Options</a></li>
232     </ul></li>
233     <li><a name="toc-vfwcap" href="#vfwcap">18.15 vfwcap</a></li>
234     <li><a name="toc-x11grab" href="#x11grab">18.16 x11grab</a>
235     <ul class="toc">
236       <li><a name="toc-Options-8" href="#Options-8">18.16.1 Options</a></li>
237     </ul>
238 </li>
239   </ul></li>
240   <li><a name="toc-Resampler-Options" href="#Resampler-Options">19. Resampler Options</a></li>
241   <li><a name="toc-Scaler-Options" href="#Scaler-Options">20. Scaler Options</a></li>
242   <li><a name="toc-Filtering-Introduction" href="#Filtering-Introduction">21. Filtering Introduction</a></li>
243   <li><a name="toc-graph2dot" href="#graph2dot">22. graph2dot</a></li>
244   <li><a name="toc-Filtergraph-description" href="#Filtergraph-description">23. Filtergraph description</a>
245   <ul class="toc">
246     <li><a name="toc-Filtergraph-syntax-1" href="#Filtergraph-syntax-1">23.1 Filtergraph syntax</a></li>
247     <li><a name="toc-Notes-on-filtergraph-escaping" href="#Notes-on-filtergraph-escaping">23.2 Notes on filtergraph escaping</a></li>
248   </ul></li>
249   <li><a name="toc-Timeline-editing" href="#Timeline-editing">24. Timeline editing</a></li>
250   <li><a name="toc-Audio-Filters" href="#Audio-Filters">25. Audio Filters</a>
251   <ul class="toc">
252     <li><a name="toc-aconvert" href="#aconvert">25.1 aconvert</a>
253     <ul class="toc">
254       <li><a name="toc-Examples-18" href="#Examples-18">25.1.1 Examples</a></li>
255     </ul></li>
256     <li><a name="toc-adelay" href="#adelay">25.2 adelay</a>
257     <ul class="toc">
258       <li><a name="toc-Examples-30" href="#Examples-30">25.2.1 Examples</a></li>
259     </ul></li>
260     <li><a name="toc-aecho" href="#aecho">25.3 aecho</a>
261     <ul class="toc">
262       <li><a name="toc-Examples-41" href="#Examples-41">25.3.1 Examples</a></li>
263     </ul></li>
264     <li><a name="toc-aeval" href="#aeval">25.4 aeval</a>
265     <ul class="toc">
266       <li><a name="toc-Examples-21" href="#Examples-21">25.4.1 Examples</a></li>
267     </ul></li>
268     <li><a name="toc-afade" href="#afade">25.5 afade</a>
269     <ul class="toc">
270       <li><a name="toc-Examples-72" href="#Examples-72">25.5.1 Examples</a></li>
271     </ul></li>
272     <li><a name="toc-aformat-1" href="#aformat-1">25.6 aformat</a></li>
273     <li><a name="toc-allpass" href="#allpass">25.7 allpass</a></li>
274     <li><a name="toc-amerge" href="#amerge">25.8 amerge</a>
275     <ul class="toc">
276       <li><a name="toc-Examples-28" href="#Examples-28">25.8.1 Examples</a></li>
277     </ul></li>
278     <li><a name="toc-amix" href="#amix">25.9 amix</a></li>
279     <li><a name="toc-anull" href="#anull">25.10 anull</a></li>
280     <li><a name="toc-apad" href="#apad">25.11 apad</a></li>
281     <li><a name="toc-aphaser" href="#aphaser">25.12 aphaser</a></li>
282     <li><a name="toc-aresample-1" href="#aresample-1">25.13 aresample</a>
283     <ul class="toc">
284       <li><a name="toc-Examples-84" href="#Examples-84">25.13.1 Examples</a></li>
285     </ul></li>
286     <li><a name="toc-asetnsamples" href="#asetnsamples">25.14 asetnsamples</a></li>
287     <li><a name="toc-asetrate" href="#asetrate">25.15 asetrate</a></li>
288     <li><a name="toc-ashowinfo" href="#ashowinfo">25.16 ashowinfo</a></li>
289     <li><a name="toc-astats" href="#astats">25.17 astats</a></li>
290     <li><a name="toc-astreamsync" href="#astreamsync">25.18 astreamsync</a>
291     <ul class="toc">
292       <li><a name="toc-Examples-35" href="#Examples-35">25.18.1 Examples</a></li>
293     </ul></li>
294     <li><a name="toc-asyncts" href="#asyncts">25.19 asyncts</a></li>
295     <li><a name="toc-atempo" href="#atempo">25.20 atempo</a>
296     <ul class="toc">
297       <li><a name="toc-Examples-57" href="#Examples-57">25.20.1 Examples</a></li>
298     </ul></li>
299     <li><a name="toc-atrim" href="#atrim">25.21 atrim</a></li>
300     <li><a name="toc-bandpass" href="#bandpass">25.22 bandpass</a></li>
301     <li><a name="toc-bandreject" href="#bandreject">25.23 bandreject</a></li>
302     <li><a name="toc-bass" href="#bass">25.24 bass</a></li>
303     <li><a name="toc-biquad" href="#biquad">25.25 biquad</a></li>
304     <li><a name="toc-channelmap" href="#channelmap">25.26 channelmap</a></li>
305     <li><a name="toc-channelsplit" href="#channelsplit">25.27 channelsplit</a></li>
306     <li><a name="toc-compand" href="#compand">25.28 compand</a>
307     <ul class="toc">
308       <li><a name="toc-Examples-37" href="#Examples-37">25.28.1 Examples</a></li>
309     </ul></li>
310     <li><a name="toc-earwax" href="#earwax">25.29 earwax</a></li>
311     <li><a name="toc-equalizer" href="#equalizer">25.30 equalizer</a>
312     <ul class="toc">
313       <li><a name="toc-Examples-69" href="#Examples-69">25.30.1 Examples</a></li>
314     </ul></li>
315     <li><a name="toc-highpass" href="#highpass">25.31 highpass</a></li>
316     <li><a name="toc-join" href="#join">25.32 join</a></li>
317     <li><a name="toc-ladspa" href="#ladspa">25.33 ladspa</a>
318     <ul class="toc">
319       <li><a name="toc-Examples-54" href="#Examples-54">25.33.1 Examples</a></li>
320       <li><a name="toc-Commands-1" href="#Commands-1">25.33.2 Commands</a></li>
321     </ul></li>
322     <li><a name="toc-lowpass" href="#lowpass">25.34 lowpass</a></li>
323     <li><a name="toc-pan" href="#pan">25.35 pan</a>
324     <ul class="toc">
325       <li><a name="toc-Mixing-examples" href="#Mixing-examples">25.35.1 Mixing examples</a></li>
326       <li><a name="toc-Remapping-examples" href="#Remapping-examples">25.35.2 Remapping examples</a></li>
327     </ul></li>
328     <li><a name="toc-replaygain" href="#replaygain">25.36 replaygain</a></li>
329     <li><a name="toc-resample" href="#resample">25.37 resample</a></li>
330     <li><a name="toc-silencedetect" href="#silencedetect">25.38 silencedetect</a>
331     <ul class="toc">
332       <li><a name="toc-Examples-14" href="#Examples-14">25.38.1 Examples</a></li>
333     </ul></li>
334     <li><a name="toc-treble" href="#treble">25.39 treble</a></li>
335     <li><a name="toc-volume" href="#volume">25.40 volume</a>
336     <ul class="toc">
337       <li><a name="toc-Commands-3" href="#Commands-3">25.40.1 Commands</a></li>
338       <li><a name="toc-Examples-51" href="#Examples-51">25.40.2 Examples</a></li>
339     </ul></li>
340     <li><a name="toc-volumedetect" href="#volumedetect">25.41 volumedetect</a>
341     <ul class="toc">
342       <li><a name="toc-Examples-63" href="#Examples-63">25.41.1 Examples</a></li>
343     </ul>
344 </li>
345   </ul></li>
346   <li><a name="toc-Audio-Sources" href="#Audio-Sources">26. Audio Sources</a>
347   <ul class="toc">
348     <li><a name="toc-abuffer" href="#abuffer">26.1 abuffer</a>
349     <ul class="toc">
350       <li><a name="toc-Examples-6" href="#Examples-6">26.1.1 Examples</a></li>
351     </ul></li>
352     <li><a name="toc-aevalsrc" href="#aevalsrc">26.2 aevalsrc</a>
353     <ul class="toc">
354       <li><a name="toc-Examples-56" href="#Examples-56">26.2.1 Examples</a></li>
355     </ul></li>
356     <li><a name="toc-anullsrc" href="#anullsrc">26.3 anullsrc</a>
357     <ul class="toc">
358       <li><a name="toc-Examples-38" href="#Examples-38">26.3.1 Examples</a></li>
359     </ul></li>
360     <li><a name="toc-flite" href="#flite">26.4 flite</a>
361     <ul class="toc">
362       <li><a name="toc-Examples-80" href="#Examples-80">26.4.1 Examples</a></li>
363     </ul></li>
364     <li><a name="toc-sine" href="#sine">26.5 sine</a>
365     <ul class="toc">
366       <li><a name="toc-Examples-50" href="#Examples-50">26.5.1 Examples</a></li>
367     </ul>
368 </li>
369   </ul></li>
370   <li><a name="toc-Audio-Sinks" href="#Audio-Sinks">27. Audio Sinks</a>
371   <ul class="toc">
372     <li><a name="toc-abuffersink" href="#abuffersink">27.1 abuffersink</a></li>
373     <li><a name="toc-anullsink" href="#anullsink">27.2 anullsink</a></li>
374   </ul></li>
375   <li><a name="toc-Video-Filters" href="#Video-Filters">28. Video Filters</a>
376   <ul class="toc">
377     <li><a name="toc-alphaextract" href="#alphaextract">28.1 alphaextract</a></li>
378     <li><a name="toc-alphamerge" href="#alphamerge">28.2 alphamerge</a></li>
379     <li><a name="toc-ass" href="#ass">28.3 ass</a></li>
380     <li><a name="toc-bbox" href="#bbox">28.4 bbox</a></li>
381     <li><a name="toc-blackdetect" href="#blackdetect">28.5 blackdetect</a></li>
382     <li><a name="toc-blackframe" href="#blackframe">28.6 blackframe</a></li>
383     <li><a name="toc-blend" href="#blend">28.7 blend</a>
384     <ul class="toc">
385       <li><a name="toc-Examples-62" href="#Examples-62">28.7.1 Examples</a></li>
386     </ul></li>
387     <li><a name="toc-boxblur" href="#boxblur">28.8 boxblur</a>
388     <ul class="toc">
389       <li><a name="toc-Examples-12" href="#Examples-12">28.8.1 Examples</a></li>
390     </ul></li>
391     <li><a name="toc-colorbalance" href="#colorbalance">28.9 colorbalance</a>
392     <ul class="toc">
393       <li><a name="toc-Examples-68" href="#Examples-68">28.9.1 Examples</a></li>
394     </ul></li>
395     <li><a name="toc-colorchannelmixer" href="#colorchannelmixer">28.10 colorchannelmixer</a>
396     <ul class="toc">
397       <li><a name="toc-Examples-33" href="#Examples-33">28.10.1 Examples</a></li>
398     </ul></li>
399     <li><a name="toc-colormatrix" href="#colormatrix">28.11 colormatrix</a></li>
400     <li><a name="toc-copy" href="#copy">28.12 copy</a></li>
401     <li><a name="toc-crop" href="#crop">28.13 crop</a>
402     <ul class="toc">
403       <li><a name="toc-Examples-64" href="#Examples-64">28.13.1 Examples</a></li>
404     </ul></li>
405     <li><a name="toc-cropdetect" href="#cropdetect">28.14 cropdetect</a></li>
406     <li><a name="toc-curves-1" href="#curves-1">28.15 curves</a>
407     <ul class="toc">
408       <li><a name="toc-Examples-77" href="#Examples-77">28.15.1 Examples</a></li>
409     </ul></li>
410     <li><a name="toc-dctdnoiz" href="#dctdnoiz">28.16 dctdnoiz</a>
411     <ul class="toc">
412       <li><a name="toc-Examples-22" href="#Examples-22">28.16.1 Examples</a></li>
413     </ul></li>
414     <li><a name="toc-decimate-1" href="#decimate-1">28.17 decimate</a></li>
415     <li><a name="toc-dejudder" href="#dejudder">28.18 dejudder</a></li>
416     <li><a name="toc-delogo" href="#delogo">28.19 delogo</a>
417     <ul class="toc">
418       <li><a name="toc-Examples-32" href="#Examples-32">28.19.1 Examples</a></li>
419     </ul></li>
420     <li><a name="toc-deshake" href="#deshake">28.20 deshake</a></li>
421     <li><a name="toc-drawbox" href="#drawbox">28.21 drawbox</a>
422     <ul class="toc">
423       <li><a name="toc-Examples-19" href="#Examples-19">28.21.1 Examples</a></li>
424     </ul></li>
425     <li><a name="toc-drawgrid" href="#drawgrid">28.22 drawgrid</a>
426     <ul class="toc">
427       <li><a name="toc-Examples-40" href="#Examples-40">28.22.1 Examples</a></li>
428     </ul></li>
429     <li><a name="toc-drawtext-1" href="#drawtext-1">28.23 drawtext</a>
430     <ul class="toc">
431       <li><a name="toc-Syntax-2" href="#Syntax-2">28.23.1 Syntax</a></li>
432       <li><a name="toc-Text-expansion" href="#Text-expansion">28.23.2 Text expansion</a></li>
433       <li><a name="toc-Examples-44" href="#Examples-44">28.23.3 Examples</a></li>
434     </ul></li>
435     <li><a name="toc-edgedetect" href="#edgedetect">28.24 edgedetect</a></li>
436     <li><a name="toc-extractplanes" href="#extractplanes">28.25 extractplanes</a>
437     <ul class="toc">
438       <li><a name="toc-Examples-43" href="#Examples-43">28.25.1 Examples</a></li>
439     </ul></li>
440     <li><a name="toc-elbg" href="#elbg">28.26 elbg</a></li>
441     <li><a name="toc-fade" href="#fade">28.27 fade</a>
442     <ul class="toc">
443       <li><a name="toc-Examples-34" href="#Examples-34">28.27.1 Examples</a></li>
444     </ul></li>
445     <li><a name="toc-field" href="#field">28.28 field</a></li>
446     <li><a name="toc-fieldmatch" href="#fieldmatch">28.29 fieldmatch</a>
447     <ul class="toc">
448       <li><a name="toc-p_002fc_002fn_002fu_002fb-meaning-1" href="#p_002fc_002fn_002fu_002fb-meaning-1">28.29.1 p/c/n/u/b meaning</a>
449       <ul class="toc">
450         <li><a name="toc-p_002fc_002fn" href="#p_002fc_002fn">28.29.1.1 p/c/n</a></li>
451         <li><a name="toc-u_002fb" href="#u_002fb">28.29.1.2 u/b</a></li>
452       </ul></li>
453       <li><a name="toc-Examples-55" href="#Examples-55">28.29.2 Examples</a></li>
454     </ul></li>
455     <li><a name="toc-fieldorder" href="#fieldorder">28.30 fieldorder</a></li>
456     <li><a name="toc-fifo" href="#fifo">28.31 fifo</a></li>
457     <li><a name="toc-format-1" href="#format-1">28.32 format</a>
458     <ul class="toc">
459       <li><a name="toc-Examples-17" href="#Examples-17">28.32.1 Examples</a></li>
460     </ul></li>
461     <li><a name="toc-fps-1" href="#fps-1">28.33 fps</a>
462     <ul class="toc">
463       <li><a name="toc-Examples-60" href="#Examples-60">28.33.1 Examples</a></li>
464     </ul></li>
465     <li><a name="toc-framepack" href="#framepack">28.34 framepack</a></li>
466     <li><a name="toc-framestep" href="#framestep">28.35 framestep</a></li>
467     <li><a name="toc-frei0r-1" href="#frei0r-1">28.36 frei0r</a>
468     <ul class="toc">
469       <li><a name="toc-Examples-1" href="#Examples-1">28.36.1 Examples</a></li>
470     </ul></li>
471     <li><a name="toc-geq" href="#geq">28.37 geq</a>
472     <ul class="toc">
473       <li><a name="toc-Examples-82" href="#Examples-82">28.37.1 Examples</a></li>
474     </ul></li>
475     <li><a name="toc-gradfun" href="#gradfun">28.38 gradfun</a>
476     <ul class="toc">
477       <li><a name="toc-Examples" href="#Examples">28.38.1 Examples</a></li>
478     </ul></li>
479     <li><a name="toc-haldclut-1" href="#haldclut-1">28.39 haldclut</a>
480     <ul class="toc">
481       <li><a name="toc-Workflow-examples" href="#Workflow-examples">28.39.1 Workflow examples</a>
482       <ul class="toc">
483         <li><a name="toc-Hald-CLUT-video-stream" href="#Hald-CLUT-video-stream">28.39.1.1 Hald CLUT video stream</a></li>
484         <li><a name="toc-Hald-CLUT-with-preview" href="#Hald-CLUT-with-preview">28.39.1.2 Hald CLUT with preview</a></li>
485       </ul>
486 </li>
487     </ul></li>
488     <li><a name="toc-hflip" href="#hflip">28.40 hflip</a></li>
489     <li><a name="toc-histeq" href="#histeq">28.41 histeq</a></li>
490     <li><a name="toc-histogram" href="#histogram">28.42 histogram</a>
491     <ul class="toc">
492       <li><a name="toc-Examples-74" href="#Examples-74">28.42.1 Examples</a></li>
493     </ul></li>
494     <li><a name="toc-hqdn3d-1" href="#hqdn3d-1">28.43 hqdn3d</a></li>
495     <li><a name="toc-hue" href="#hue">28.44 hue</a>
496     <ul class="toc">
497       <li><a name="toc-Examples-39" href="#Examples-39">28.44.1 Examples</a></li>
498       <li><a name="toc-Commands" href="#Commands">28.44.2 Commands</a></li>
499     </ul></li>
500     <li><a name="toc-idet" href="#idet">28.45 idet</a></li>
501     <li><a name="toc-il" href="#il">28.46 il</a></li>
502     <li><a name="toc-interlace" href="#interlace">28.47 interlace</a></li>
503     <li><a name="toc-kerndeint" href="#kerndeint">28.48 kerndeint</a>
504     <ul class="toc">
505       <li><a name="toc-Examples-45" href="#Examples-45">28.48.1 Examples</a></li>
506     </ul></li>
507     <li><a name="toc-lut3d-1" href="#lut3d-1">28.49 lut3d</a></li>
508     <li><a name="toc-lut_002c-lutrgb_002c-lutyuv" href="#lut_002c-lutrgb_002c-lutyuv">28.50 lut, lutrgb, lutyuv</a>
509     <ul class="toc">
510       <li><a name="toc-Examples-5" href="#Examples-5">28.50.1 Examples</a></li>
511     </ul></li>
512     <li><a name="toc-mergeplanes" href="#mergeplanes">28.51 mergeplanes</a>
513     <ul class="toc">
514       <li><a name="toc-Examples-3" href="#Examples-3">28.51.1 Examples</a></li>
515     </ul></li>
516     <li><a name="toc-mcdeint" href="#mcdeint">28.52 mcdeint</a></li>
517     <li><a name="toc-mp" href="#mp">28.53 mp</a>
518     <ul class="toc">
519       <li><a name="toc-Examples-10" href="#Examples-10">28.53.1 Examples</a></li>
520     </ul></li>
521     <li><a name="toc-mpdecimate" href="#mpdecimate">28.54 mpdecimate</a></li>
522     <li><a name="toc-negate" href="#negate">28.55 negate</a></li>
523     <li><a name="toc-noformat" href="#noformat">28.56 noformat</a>
524     <ul class="toc">
525       <li><a name="toc-Examples-65" href="#Examples-65">28.56.1 Examples</a></li>
526     </ul></li>
527     <li><a name="toc-noise-1" href="#noise-1">28.57 noise</a>
528     <ul class="toc">
529       <li><a name="toc-Examples-58" href="#Examples-58">28.57.1 Examples</a></li>
530     </ul></li>
531     <li><a name="toc-null" href="#null">28.58 null</a></li>
532     <li><a name="toc-ocv" href="#ocv">28.59 ocv</a>
533     <ul class="toc">
534       <li><a name="toc-dilate-1" href="#dilate-1">28.59.1 dilate</a></li>
535       <li><a name="toc-erode" href="#erode">28.59.2 erode</a></li>
536       <li><a name="toc-smooth" href="#smooth">28.59.3 smooth</a></li>
537     </ul></li>
538     <li><a name="toc-overlay-1" href="#overlay-1">28.60 overlay</a>
539     <ul class="toc">
540       <li><a name="toc-Commands-4" href="#Commands-4">28.60.1 Commands</a></li>
541       <li><a name="toc-Examples-15" href="#Examples-15">28.60.2 Examples</a></li>
542     </ul></li>
543     <li><a name="toc-owdenoise" href="#owdenoise">28.61 owdenoise</a></li>
544     <li><a name="toc-pad" href="#pad">28.62 pad</a>
545     <ul class="toc">
546       <li><a name="toc-Examples-52" href="#Examples-52">28.62.1 Examples</a></li>
547     </ul></li>
548     <li><a name="toc-perspective" href="#perspective">28.63 perspective</a></li>
549     <li><a name="toc-phase" href="#phase">28.64 phase</a></li>
550     <li><a name="toc-pixdesctest" href="#pixdesctest">28.65 pixdesctest</a></li>
551     <li><a name="toc-pp" href="#pp">28.66 pp</a>
552     <ul class="toc">
553       <li><a name="toc-Examples-11" href="#Examples-11">28.66.1 Examples</a></li>
554     </ul></li>
555     <li><a name="toc-psnr" href="#psnr">28.67 psnr</a></li>
556     <li><a name="toc-pullup-1" href="#pullup-1">28.68 pullup</a></li>
557     <li><a name="toc-removelogo" href="#removelogo">28.69 removelogo</a></li>
558     <li><a name="toc-rotate" href="#rotate">28.70 rotate</a>
559     <ul class="toc">
560       <li><a name="toc-Examples-79" href="#Examples-79">28.70.1 Examples</a></li>
561       <li><a name="toc-Commands-5" href="#Commands-5">28.70.2 Commands</a></li>
562     </ul></li>
563     <li><a name="toc-sab" href="#sab">28.71 sab</a></li>
564     <li><a name="toc-scale-1" href="#scale-1">28.72 scale</a>
565     <ul class="toc">
566       <li><a name="toc-Options-6" href="#Options-6">28.72.1 Options</a></li>
567       <li><a name="toc-Examples-47" href="#Examples-47">28.72.2 Examples</a></li>
568     </ul></li>
569     <li><a name="toc-separatefields" href="#separatefields">28.73 separatefields</a></li>
570     <li><a name="toc-setdar_002c-setsar" href="#setdar_002c-setsar">28.74 setdar, setsar</a>
571     <ul class="toc">
572       <li><a name="toc-Examples-76" href="#Examples-76">28.74.1 Examples</a></li>
573     </ul></li>
574     <li><a name="toc-setfield-1" href="#setfield-1">28.75 setfield</a></li>
575     <li><a name="toc-showinfo" href="#showinfo">28.76 showinfo</a></li>
576     <li><a name="toc-smartblur-1" href="#smartblur-1">28.77 smartblur</a></li>
577     <li><a name="toc-stereo3d" href="#stereo3d">28.78 stereo3d</a>
578     <ul class="toc">
579       <li><a name="toc-Examples-2" href="#Examples-2">28.78.1 Examples</a></li>
580     </ul></li>
581     <li><a name="toc-spp" href="#spp">28.79 spp</a></li>
582     <li><a name="toc-subtitles-1" href="#subtitles-1">28.80 subtitles</a></li>
583     <li><a name="toc-super2xsai" href="#super2xsai">28.81 super2xsai</a></li>
584     <li><a name="toc-swapuv" href="#swapuv">28.82 swapuv</a></li>
585     <li><a name="toc-telecine" href="#telecine">28.83 telecine</a></li>
586     <li><a name="toc-thumbnail" href="#thumbnail">28.84 thumbnail</a>
587     <ul class="toc">
588       <li><a name="toc-Examples-9" href="#Examples-9">28.84.1 Examples</a></li>
589     </ul></li>
590     <li><a name="toc-tile" href="#tile">28.85 tile</a>
591     <ul class="toc">
592       <li><a name="toc-Examples-70" href="#Examples-70">28.85.1 Examples</a></li>
593     </ul></li>
594     <li><a name="toc-tinterlace" href="#tinterlace">28.86 tinterlace</a></li>
595     <li><a name="toc-transpose" href="#transpose">28.87 transpose</a></li>
596     <li><a name="toc-trim" href="#trim">28.88 trim</a></li>
597     <li><a name="toc-unsharp" href="#unsharp">28.89 unsharp</a>
598     <ul class="toc">
599       <li><a name="toc-Examples-81" href="#Examples-81">28.89.1 Examples</a></li>
600     </ul></li>
601     <li><a name="toc-vidstabdetect-1" href="#vidstabdetect-1">28.90 vidstabdetect</a>
602     <ul class="toc">
603       <li><a name="toc-Examples-29" href="#Examples-29">28.90.1 Examples</a></li>
604     </ul></li>
605     <li><a name="toc-vidstabtransform-1" href="#vidstabtransform-1">28.91 vidstabtransform</a>
606     <ul class="toc">
607       <li><a name="toc-Options-5" href="#Options-5">28.91.1 Options</a></li>
608       <li><a name="toc-Examples-25" href="#Examples-25">28.91.2 Examples</a></li>
609     </ul></li>
610     <li><a name="toc-vflip" href="#vflip">28.92 vflip</a></li>
611     <li><a name="toc-vignette" href="#vignette">28.93 vignette</a>
612     <ul class="toc">
613       <li><a name="toc-Expressions" href="#Expressions">28.93.1 Expressions</a></li>
614       <li><a name="toc-Examples-49" href="#Examples-49">28.93.2 Examples</a></li>
615     </ul></li>
616     <li><a name="toc-w3fdif" href="#w3fdif">28.94 w3fdif</a></li>
617     <li><a name="toc-yadif-1" href="#yadif-1">28.95 yadif</a></li>
618   </ul></li>
619   <li><a name="toc-Video-Sources" href="#Video-Sources">29. Video Sources</a>
620   <ul class="toc">
621     <li><a name="toc-buffer" href="#buffer">29.1 buffer</a></li>
622     <li><a name="toc-cellauto" href="#cellauto">29.2 cellauto</a>
623     <ul class="toc">
624       <li><a name="toc-Examples-16" href="#Examples-16">29.2.1 Examples</a></li>
625     </ul></li>
626     <li><a name="toc-mandelbrot" href="#mandelbrot">29.3 mandelbrot</a></li>
627     <li><a name="toc-mptestsrc" href="#mptestsrc">29.4 mptestsrc</a></li>
628     <li><a name="toc-frei0r_005fsrc" href="#frei0r_005fsrc">29.5 frei0r_src</a></li>
629     <li><a name="toc-life" href="#life">29.6 life</a>
630     <ul class="toc">
631       <li><a name="toc-Examples-73" href="#Examples-73">29.6.1 Examples</a></li>
632     </ul></li>
633     <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>
634     <ul class="toc">
635       <li><a name="toc-Commands-2" href="#Commands-2">29.7.1 Commands</a></li>
636     </ul>
637 </li>
638   </ul></li>
639   <li><a name="toc-Video-Sinks" href="#Video-Sinks">30. Video Sinks</a>
640   <ul class="toc">
641     <li><a name="toc-buffersink" href="#buffersink">30.1 buffersink</a></li>
642     <li><a name="toc-nullsink" href="#nullsink">30.2 nullsink</a></li>
643   </ul></li>
644   <li><a name="toc-Multimedia-Filters" href="#Multimedia-Filters">31. Multimedia Filters</a>
645   <ul class="toc">
646     <li><a name="toc-avectorscope" href="#avectorscope">31.1 avectorscope</a>
647     <ul class="toc">
648       <li><a name="toc-Examples-48" href="#Examples-48">31.1.1 Examples</a></li>
649     </ul></li>
650     <li><a name="toc-concat-2" href="#concat-2">31.2 concat</a>
651     <ul class="toc">
652       <li><a name="toc-Examples-24" href="#Examples-24">31.2.1 Examples</a></li>
653     </ul></li>
654     <li><a name="toc-ebur128" href="#ebur128">31.3 ebur128</a>
655     <ul class="toc">
656       <li><a name="toc-Examples-13" href="#Examples-13">31.3.1 Examples</a></li>
657     </ul></li>
658     <li><a name="toc-interleave_002c-ainterleave" href="#interleave_002c-ainterleave">31.4 interleave, ainterleave</a>
659     <ul class="toc">
660       <li><a name="toc-Examples-7" href="#Examples-7">31.4.1 Examples</a></li>
661     </ul></li>
662     <li><a name="toc-perms_002c-aperms" href="#perms_002c-aperms">31.5 perms, aperms</a></li>
663     <li><a name="toc-select_002c-aselect" href="#select_002c-aselect">31.6 select, aselect</a>
664     <ul class="toc">
665       <li><a name="toc-Examples-20" href="#Examples-20">31.6.1 Examples</a></li>
666     </ul></li>
667     <li><a name="toc-sendcmd_002c-asendcmd" href="#sendcmd_002c-asendcmd">31.7 sendcmd, asendcmd</a>
668     <ul class="toc">
669       <li><a name="toc-Commands-syntax" href="#Commands-syntax">31.7.1 Commands syntax</a></li>
670       <li><a name="toc-Examples-36" href="#Examples-36">31.7.2 Examples</a></li>
671     </ul></li>
672     <li><a name="toc-setpts_002c-asetpts" href="#setpts_002c-asetpts">31.8 setpts, asetpts</a>
673     <ul class="toc">
674       <li><a name="toc-Examples-59" href="#Examples-59">31.8.1 Examples</a></li>
675     </ul></li>
676     <li><a name="toc-settb_002c-asettb" href="#settb_002c-asettb">31.9 settb, asettb</a>
677     <ul class="toc">
678       <li><a name="toc-Examples-8" href="#Examples-8">31.9.1 Examples</a></li>
679     </ul></li>
680     <li><a name="toc-showspectrum" href="#showspectrum">31.10 showspectrum</a>
681     <ul class="toc">
682       <li><a name="toc-Examples-67" href="#Examples-67">31.10.1 Examples</a></li>
683     </ul></li>
684     <li><a name="toc-showwaves" href="#showwaves">31.11 showwaves</a>
685     <ul class="toc">
686       <li><a name="toc-Examples-83" href="#Examples-83">31.11.1 Examples</a></li>
687     </ul></li>
688     <li><a name="toc-split_002c-asplit" href="#split_002c-asplit">31.12 split, asplit</a>
689     <ul class="toc">
690       <li><a name="toc-Examples-46" href="#Examples-46">31.12.1 Examples</a></li>
691     </ul></li>
692     <li><a name="toc-zmq_002c-azmq" href="#zmq_002c-azmq">31.13 zmq, azmq</a>
693     <ul class="toc">
694       <li><a name="toc-Examples-31" href="#Examples-31">31.13.1 Examples</a></li>
695     </ul>
696 </li>
697   </ul></li>
698   <li><a name="toc-Multimedia-Sources" href="#Multimedia-Sources">32. Multimedia Sources</a>
699   <ul class="toc">
700     <li><a name="toc-amovie" href="#amovie">32.1 amovie</a></li>
701     <li><a name="toc-movie-1" href="#movie-1">32.2 movie</a>
702     <ul class="toc">
703       <li><a name="toc-Examples-61" href="#Examples-61">32.2.1 Examples</a></li>
704     </ul>
705 </li>
706   </ul></li>
707   <li><a name="toc-See-Also" href="#See-Also">33. See Also</a></li>
708   <li><a name="toc-Authors" href="#Authors">34. Authors</a></li>
709 </ul>
710 </div>
711
712 <a name="Synopsis"></a>
713 <h1 class="chapter"><a href="ffplay-all.html#toc-Synopsis">1. Synopsis</a></h1>
714
715 <p>ffplay [<var>options</var>] [&lsquo;<tt>input_file</tt>&rsquo;]
716 </p>
717 <a name="Description"></a>
718 <h1 class="chapter"><a href="ffplay-all.html#toc-Description">2. Description</a></h1>
719
720 <p>FFplay is a very simple and portable media player using the FFmpeg
721 libraries and the SDL library. It is mostly used as a testbed for the
722 various FFmpeg APIs.
723 </p>
724 <a name="Options-4"></a>
725 <h1 class="chapter"><a href="ffplay-all.html#toc-Options-4">3. Options</a></h1>
726
727 <p>All the numerical options, if not specified otherwise, accept a string
728 representing a number as input, which may be followed by one of the SI
729 unit prefixes, for example: &rsquo;K&rsquo;, &rsquo;M&rsquo;, or &rsquo;G&rsquo;.
730 </p>
731 <p>If &rsquo;i&rsquo; is appended to the SI unit prefix, the complete prefix will be
732 interpreted as a unit prefix for binary multiplies, which are based on
733 powers of 1024 instead of powers of 1000. Appending &rsquo;B&rsquo; to the SI unit
734 prefix multiplies the value by 8. This allows using, for example:
735 &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;, &rsquo;G&rsquo; and &rsquo;B&rsquo; as number suffixes.
736 </p>
737 <p>Options which do not take arguments are boolean options, and set the
738 corresponding value to true. They can be set to false by prefixing
739 the option name with &quot;no&quot;. For example using &quot;-nofoo&quot;
740 will set the boolean option with name &quot;foo&quot; to false.
741 </p>
742 <p><a name="Stream-specifiers"></a>
743 </p><a name="Stream-specifiers-1"></a>
744 <h2 class="section"><a href="ffplay-all.html#toc-Stream-specifiers-1">3.1 Stream specifiers</a></h2>
745 <p>Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
746 are used to precisely specify which stream(s) a given option belongs to.
747 </p>
748 <p>A stream specifier is a string generally appended to the option name and
749 separated from it by a colon. E.g. <code>-codec:a:1 ac3</code> contains the
750 <code>a:1</code> stream specifier, which matches the second audio stream. Therefore, it
751 would select the ac3 codec for the second audio stream.
752 </p>
753 <p>A stream specifier can match several streams, so that the option is applied to all
754 of them. E.g. the stream specifier in <code>-b:a 128k</code> matches all audio
755 streams.
756 </p>
757 <p>An empty stream specifier matches all streams. For example, <code>-codec copy</code>
758 or <code>-codec: copy</code> would copy all the streams without reencoding.
759 </p>
760 <p>Possible forms of stream specifiers are:
761 </p><dl compact="compact">
762 <dt> &lsquo;<samp><var>stream_index</var></samp>&rsquo;</dt>
763 <dd><p>Matches the stream with this index. E.g. <code>-threads:1 4</code> would set the
764 thread count for the second stream to 4.
765 </p></dd>
766 <dt> &lsquo;<samp><var>stream_type</var>[:<var>stream_index</var>]</samp>&rsquo;</dt>
767 <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,
768 &rsquo;d&rsquo; for data, and &rsquo;t&rsquo; for attachments. If <var>stream_index</var> is given, then it matches
769 stream number <var>stream_index</var> of this type. Otherwise, it matches all
770 streams of this type.
771 </p></dd>
772 <dt> &lsquo;<samp>p:<var>program_id</var>[:<var>stream_index</var>]</samp>&rsquo;</dt>
773 <dd><p>If <var>stream_index</var> is given, then it matches the stream with number <var>stream_index</var>
774 in the program with the id <var>program_id</var>. Otherwise, it matches all streams in the
775 program.
776 </p></dd>
777 <dt> &lsquo;<samp>#<var>stream_id</var></samp>&rsquo;</dt>
778 <dd><p>Matches the stream by a format-specific ID.
779 </p></dd>
780 </dl>
781
782 <a name="Generic-options"></a>
783 <h2 class="section"><a href="ffplay-all.html#toc-Generic-options">3.2 Generic options</a></h2>
784
785 <p>These options are shared amongst the ff* tools.
786 </p>
787 <dl compact="compact">
788 <dt> &lsquo;<samp>-L</samp>&rsquo;</dt>
789 <dd><p>Show license.
790 </p>
791 </dd>
792 <dt> &lsquo;<samp>-h, -?, -help, --help [<var>arg</var>]</samp>&rsquo;</dt>
793 <dd><p>Show help. An optional parameter may be specified to print help about a specific
794 item. If no argument is specified, only basic (non advanced) tool
795 options are shown.
796 </p>
797 <p>Possible values of <var>arg</var> are:
798 </p><dl compact="compact">
799 <dt> &lsquo;<samp>long</samp>&rsquo;</dt>
800 <dd><p>Print advanced tool options in addition to the basic tool options.
801 </p>
802 </dd>
803 <dt> &lsquo;<samp>full</samp>&rsquo;</dt>
804 <dd><p>Print complete list of options, including shared and private options
805 for encoders, decoders, demuxers, muxers, filters, etc.
806 </p>
807 </dd>
808 <dt> &lsquo;<samp>decoder=<var>decoder_name</var></samp>&rsquo;</dt>
809 <dd><p>Print detailed information about the decoder named <var>decoder_name</var>. Use the
810 &lsquo;<samp>-decoders</samp>&rsquo; option to get a list of all decoders.
811 </p>
812 </dd>
813 <dt> &lsquo;<samp>encoder=<var>encoder_name</var></samp>&rsquo;</dt>
814 <dd><p>Print detailed information about the encoder named <var>encoder_name</var>. Use the
815 &lsquo;<samp>-encoders</samp>&rsquo; option to get a list of all encoders.
816 </p>
817 </dd>
818 <dt> &lsquo;<samp>demuxer=<var>demuxer_name</var></samp>&rsquo;</dt>
819 <dd><p>Print detailed information about the demuxer named <var>demuxer_name</var>. Use the
820 &lsquo;<samp>-formats</samp>&rsquo; option to get a list of all demuxers and muxers.
821 </p>
822 </dd>
823 <dt> &lsquo;<samp>muxer=<var>muxer_name</var></samp>&rsquo;</dt>
824 <dd><p>Print detailed information about the muxer named <var>muxer_name</var>. Use the
825 &lsquo;<samp>-formats</samp>&rsquo; option to get a list of all muxers and demuxers.
826 </p>
827 </dd>
828 <dt> &lsquo;<samp>filter=<var>filter_name</var></samp>&rsquo;</dt>
829 <dd><p>Print detailed information about the filter name <var>filter_name</var>. Use the
830 &lsquo;<samp>-filters</samp>&rsquo; option to get a list of all filters.
831 </p></dd>
832 </dl>
833
834 </dd>
835 <dt> &lsquo;<samp>-version</samp>&rsquo;</dt>
836 <dd><p>Show version.
837 </p>
838 </dd>
839 <dt> &lsquo;<samp>-formats</samp>&rsquo;</dt>
840 <dd><p>Show available formats.
841 </p>
842 </dd>
843 <dt> &lsquo;<samp>-codecs</samp>&rsquo;</dt>
844 <dd><p>Show all codecs known to libavcodec.
845 </p>
846 <p>Note that the term &rsquo;codec&rsquo; is used throughout this documentation as a shortcut
847 for what is more correctly called a media bitstream format.
848 </p>
849 </dd>
850 <dt> &lsquo;<samp>-decoders</samp>&rsquo;</dt>
851 <dd><p>Show available decoders.
852 </p>
853 </dd>
854 <dt> &lsquo;<samp>-encoders</samp>&rsquo;</dt>
855 <dd><p>Show all available encoders.
856 </p>
857 </dd>
858 <dt> &lsquo;<samp>-bsfs</samp>&rsquo;</dt>
859 <dd><p>Show available bitstream filters.
860 </p>
861 </dd>
862 <dt> &lsquo;<samp>-protocols</samp>&rsquo;</dt>
863 <dd><p>Show available protocols.
864 </p>
865 </dd>
866 <dt> &lsquo;<samp>-filters</samp>&rsquo;</dt>
867 <dd><p>Show available libavfilter filters.
868 </p>
869 </dd>
870 <dt> &lsquo;<samp>-pix_fmts</samp>&rsquo;</dt>
871 <dd><p>Show available pixel formats.
872 </p>
873 </dd>
874 <dt> &lsquo;<samp>-sample_fmts</samp>&rsquo;</dt>
875 <dd><p>Show available sample formats.
876 </p>
877 </dd>
878 <dt> &lsquo;<samp>-layouts</samp>&rsquo;</dt>
879 <dd><p>Show channel names and standard channel layouts.
880 </p>
881 </dd>
882 <dt> &lsquo;<samp>-colors</samp>&rsquo;</dt>
883 <dd><p>Show recognized color names.
884 </p>
885 </dd>
886 <dt> &lsquo;<samp>-loglevel [repeat+]<var>loglevel</var> | -v [repeat+]<var>loglevel</var></samp>&rsquo;</dt>
887 <dd><p>Set the logging level used by the library.
888 Adding &quot;repeat+&quot; indicates that repeated log output should not be compressed
889 to the first line and the &quot;Last message repeated n times&quot; line will be
890 omitted. &quot;repeat&quot; can also be used alone.
891 If &quot;repeat&quot; is used alone, and with no prior loglevel set, the default
892 loglevel will be used. If multiple loglevel parameters are given, using
893 &rsquo;repeat&rsquo; will not change the loglevel.
894 <var>loglevel</var> is a number or a string containing one of the following values:
895 </p><dl compact="compact">
896 <dt> &lsquo;<samp>quiet</samp>&rsquo;</dt>
897 <dd><p>Show nothing at all; be silent.
898 </p></dd>
899 <dt> &lsquo;<samp>panic</samp>&rsquo;</dt>
900 <dd><p>Only show fatal errors which could lead the process to crash, such as
901 and assert failure. This is not currently used for anything.
902 </p></dd>
903 <dt> &lsquo;<samp>fatal</samp>&rsquo;</dt>
904 <dd><p>Only show fatal errors. These are errors after which the process absolutely
905 cannot continue after.
906 </p></dd>
907 <dt> &lsquo;<samp>error</samp>&rsquo;</dt>
908 <dd><p>Show all errors, including ones which can be recovered from.
909 </p></dd>
910 <dt> &lsquo;<samp>warning</samp>&rsquo;</dt>
911 <dd><p>Show all warnings and errors. Any message related to possibly
912 incorrect or unexpected events will be shown.
913 </p></dd>
914 <dt> &lsquo;<samp>info</samp>&rsquo;</dt>
915 <dd><p>Show informative messages during processing. This is in addition to
916 warnings and errors. This is the default value.
917 </p></dd>
918 <dt> &lsquo;<samp>verbose</samp>&rsquo;</dt>
919 <dd><p>Same as <code>info</code>, except more verbose.
920 </p></dd>
921 <dt> &lsquo;<samp>debug</samp>&rsquo;</dt>
922 <dd><p>Show everything, including debugging information.
923 </p></dd>
924 </dl>
925
926 <p>By default the program logs to stderr, if coloring is supported by the
927 terminal, colors are used to mark errors and warnings. Log coloring
928 can be disabled setting the environment variable
929 <code>AV_LOG_FORCE_NOCOLOR</code> or <code>NO_COLOR</code>, or can be forced setting
930 the environment variable <code>AV_LOG_FORCE_COLOR</code>.
931 The use of the environment variable <code>NO_COLOR</code> is deprecated and
932 will be dropped in a following FFmpeg version.
933 </p>
934 </dd>
935 <dt> &lsquo;<samp>-report</samp>&rsquo;</dt>
936 <dd><p>Dump full command line and console output to a file named
937 <code><var>program</var>-<var>YYYYMMDD</var>-<var>HHMMSS</var>.log</code> in the current
938 directory.
939 This file can be useful for bug reports.
940 It also implies <code>-loglevel verbose</code>.
941 </p>
942 <p>Setting the environment variable <code>FFREPORT</code> to any value has the
943 same effect. If the value is a &rsquo;:&rsquo;-separated key=value sequence, these
944 options will affect the report; options values must be escaped if they
945 contain special characters or the options delimiter &rsquo;:&rsquo; (see the
946 &ldquo;Quoting and escaping&rdquo; section in the ffmpeg-utils manual). The
947 following option is recognized:
948 </p><dl compact="compact">
949 <dt> &lsquo;<samp>file</samp>&rsquo;</dt>
950 <dd><p>set the file name to use for the report; <code>%p</code> is expanded to the name
951 of the program, <code>%t</code> is expanded to a timestamp, <code>%%</code> is expanded
952 to a plain <code>%</code>
953 </p></dd>
954 </dl>
955
956 <p>Errors in parsing the environment variable are not fatal, and will not
957 appear in the report.
958 </p>
959 </dd>
960 <dt> &lsquo;<samp>-hide_banner</samp>&rsquo;</dt>
961 <dd><p>Suppress printing banner.
962 </p>
963 <p>All FFmpeg tools will normally show a copyright notice, build options
964 and library versions. This option can be used to suppress printing
965 this information.
966 </p>
967 </dd>
968 <dt> &lsquo;<samp>-cpuflags flags (<em>global</em>)</samp>&rsquo;</dt>
969 <dd><p>Allows setting and clearing cpu flags. This option is intended
970 for testing. Do not use it unless you know what you&rsquo;re doing.
971 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -cpuflags -sse+mmx ...
972 ffmpeg -cpuflags mmx ...
973 ffmpeg -cpuflags 0 ...
974 </pre></td></tr></table>
975 <p>Possible flags for this option are:
976 </p><dl compact="compact">
977 <dt> &lsquo;<samp>x86</samp>&rsquo;</dt>
978 <dd><dl compact="compact">
979 <dt> &lsquo;<samp>mmx</samp>&rsquo;</dt>
980 <dt> &lsquo;<samp>mmxext</samp>&rsquo;</dt>
981 <dt> &lsquo;<samp>sse</samp>&rsquo;</dt>
982 <dt> &lsquo;<samp>sse2</samp>&rsquo;</dt>
983 <dt> &lsquo;<samp>sse2slow</samp>&rsquo;</dt>
984 <dt> &lsquo;<samp>sse3</samp>&rsquo;</dt>
985 <dt> &lsquo;<samp>sse3slow</samp>&rsquo;</dt>
986 <dt> &lsquo;<samp>ssse3</samp>&rsquo;</dt>
987 <dt> &lsquo;<samp>atom</samp>&rsquo;</dt>
988 <dt> &lsquo;<samp>sse4.1</samp>&rsquo;</dt>
989 <dt> &lsquo;<samp>sse4.2</samp>&rsquo;</dt>
990 <dt> &lsquo;<samp>avx</samp>&rsquo;</dt>
991 <dt> &lsquo;<samp>xop</samp>&rsquo;</dt>
992 <dt> &lsquo;<samp>fma4</samp>&rsquo;</dt>
993 <dt> &lsquo;<samp>3dnow</samp>&rsquo;</dt>
994 <dt> &lsquo;<samp>3dnowext</samp>&rsquo;</dt>
995 <dt> &lsquo;<samp>cmov</samp>&rsquo;</dt>
996 </dl>
997 </dd>
998 <dt> &lsquo;<samp>ARM</samp>&rsquo;</dt>
999 <dd><dl compact="compact">
1000 <dt> &lsquo;<samp>armv5te</samp>&rsquo;</dt>
1001 <dt> &lsquo;<samp>armv6</samp>&rsquo;</dt>
1002 <dt> &lsquo;<samp>armv6t2</samp>&rsquo;</dt>
1003 <dt> &lsquo;<samp>vfp</samp>&rsquo;</dt>
1004 <dt> &lsquo;<samp>vfpv3</samp>&rsquo;</dt>
1005 <dt> &lsquo;<samp>neon</samp>&rsquo;</dt>
1006 </dl>
1007 </dd>
1008 <dt> &lsquo;<samp>PowerPC</samp>&rsquo;</dt>
1009 <dd><dl compact="compact">
1010 <dt> &lsquo;<samp>altivec</samp>&rsquo;</dt>
1011 </dl>
1012 </dd>
1013 <dt> &lsquo;<samp>Specific Processors</samp>&rsquo;</dt>
1014 <dd><dl compact="compact">
1015 <dt> &lsquo;<samp>pentium2</samp>&rsquo;</dt>
1016 <dt> &lsquo;<samp>pentium3</samp>&rsquo;</dt>
1017 <dt> &lsquo;<samp>pentium4</samp>&rsquo;</dt>
1018 <dt> &lsquo;<samp>k6</samp>&rsquo;</dt>
1019 <dt> &lsquo;<samp>k62</samp>&rsquo;</dt>
1020 <dt> &lsquo;<samp>athlon</samp>&rsquo;</dt>
1021 <dt> &lsquo;<samp>athlonxp</samp>&rsquo;</dt>
1022 <dt> &lsquo;<samp>k8</samp>&rsquo;</dt>
1023 </dl>
1024 </dd>
1025 </dl>
1026
1027 </dd>
1028 <dt> &lsquo;<samp>-opencl_bench</samp>&rsquo;</dt>
1029 <dd><p>Benchmark all available OpenCL devices and show the results. This option
1030 is only available when FFmpeg has been compiled with <code>--enable-opencl</code>.
1031 </p>
1032 </dd>
1033 <dt> &lsquo;<samp>-opencl_options options (<em>global</em>)</samp>&rsquo;</dt>
1034 <dd><p>Set OpenCL environment options. This option is only available when
1035 FFmpeg has been compiled with <code>--enable-opencl</code>.
1036 </p>
1037 <p><var>options</var> must be a list of <var>key</var>=<var>value</var> option pairs
1038 separated by &rsquo;:&rsquo;. See the &ldquo;OpenCL Options&rdquo; section in the
1039 ffmpeg-utils manual for the list of supported options.
1040 </p></dd>
1041 </dl>
1042
1043 <a name="AVOptions"></a>
1044 <h2 class="section"><a href="ffplay-all.html#toc-AVOptions">3.3 AVOptions</a></h2>
1045
1046 <p>These options are provided directly by the libavformat, libavdevice and
1047 libavcodec libraries. To see the list of available AVOptions, use the
1048 &lsquo;<samp>-help</samp>&rsquo; option. They are separated into two categories:
1049 </p><dl compact="compact">
1050 <dt> &lsquo;<samp>generic</samp>&rsquo;</dt>
1051 <dd><p>These options can be set for any container, codec or device. Generic options
1052 are listed under AVFormatContext options for containers/devices and under
1053 AVCodecContext options for codecs.
1054 </p></dd>
1055 <dt> &lsquo;<samp>private</samp>&rsquo;</dt>
1056 <dd><p>These options are specific to the given container, device or codec. Private
1057 options are listed under their corresponding containers/devices/codecs.
1058 </p></dd>
1059 </dl>
1060
1061 <p>For example to write an ID3v2.3 header instead of a default ID3v2.4 to
1062 an MP3 file, use the &lsquo;<samp>id3v2_version</samp>&rsquo; private option of the MP3
1063 muxer:
1064 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i input.flac -id3v2_version 3 out.mp3
1065 </pre></td></tr></table>
1066
1067 <p>All codec AVOptions are per-stream, and thus a stream specifier
1068 should be attached to them.
1069 </p>
1070 <p>Note: the &lsquo;<samp>-nooption</samp>&rsquo; syntax cannot be used for boolean
1071 AVOptions, use &lsquo;<samp>-option 0</samp>&rsquo;/&lsquo;<samp>-option 1</samp>&rsquo;.
1072 </p>
1073 <p>Note: the old undocumented way of specifying per-stream AVOptions by
1074 prepending v/a/s to the options name is now obsolete and will be
1075 removed soon.
1076 </p>
1077 <a name="Main-options"></a>
1078 <h2 class="section"><a href="ffplay-all.html#toc-Main-options">3.4 Main options</a></h2>
1079
1080 <dl compact="compact">
1081 <dt> &lsquo;<samp>-x <var>width</var></samp>&rsquo;</dt>
1082 <dd><p>Force displayed width.
1083 </p></dd>
1084 <dt> &lsquo;<samp>-y <var>height</var></samp>&rsquo;</dt>
1085 <dd><p>Force displayed height.
1086 </p></dd>
1087 <dt> &lsquo;<samp>-s <var>size</var></samp>&rsquo;</dt>
1088 <dd><p>Set frame size (WxH or abbreviation), needed for videos which do
1089 not contain a header with the frame size like raw YUV.  This option
1090 has been deprecated in favor of private options, try -video_size.
1091 </p></dd>
1092 <dt> &lsquo;<samp>-an</samp>&rsquo;</dt>
1093 <dd><p>Disable audio.
1094 </p></dd>
1095 <dt> &lsquo;<samp>-vn</samp>&rsquo;</dt>
1096 <dd><p>Disable video.
1097 </p></dd>
1098 <dt> &lsquo;<samp>-ss <var>pos</var></samp>&rsquo;</dt>
1099 <dd><p>Seek to a given position in seconds.
1100 </p></dd>
1101 <dt> &lsquo;<samp>-t <var>duration</var></samp>&rsquo;</dt>
1102 <dd><p>play &lt;duration&gt; seconds of audio/video
1103 </p></dd>
1104 <dt> &lsquo;<samp>-bytes</samp>&rsquo;</dt>
1105 <dd><p>Seek by bytes.
1106 </p></dd>
1107 <dt> &lsquo;<samp>-nodisp</samp>&rsquo;</dt>
1108 <dd><p>Disable graphical display.
1109 </p></dd>
1110 <dt> &lsquo;<samp>-f <var>fmt</var></samp>&rsquo;</dt>
1111 <dd><p>Force format.
1112 </p></dd>
1113 <dt> &lsquo;<samp>-window_title <var>title</var></samp>&rsquo;</dt>
1114 <dd><p>Set window title (default is the input filename).
1115 </p></dd>
1116 <dt> &lsquo;<samp>-loop <var>number</var></samp>&rsquo;</dt>
1117 <dd><p>Loops movie playback &lt;number&gt; times. 0 means forever.
1118 </p></dd>
1119 <dt> &lsquo;<samp>-showmode <var>mode</var></samp>&rsquo;</dt>
1120 <dd><p>Set the show mode to use.
1121 Available values for <var>mode</var> are:
1122 </p><dl compact="compact">
1123 <dt> &lsquo;<samp>0, video</samp>&rsquo;</dt>
1124 <dd><p>show video
1125 </p></dd>
1126 <dt> &lsquo;<samp>1, waves</samp>&rsquo;</dt>
1127 <dd><p>show audio waves
1128 </p></dd>
1129 <dt> &lsquo;<samp>2, rdft</samp>&rsquo;</dt>
1130 <dd><p>show audio frequency band using RDFT ((Inverse) Real Discrete Fourier Transform)
1131 </p></dd>
1132 </dl>
1133
1134 <p>Default value is &quot;video&quot;, if video is not present or cannot be played
1135 &quot;rdft&quot; is automatically selected.
1136 </p>
1137 <p>You can interactively cycle through the available show modes by
1138 pressing the key &lt;w&gt;.
1139 </p>
1140 </dd>
1141 <dt> &lsquo;<samp>-vf <var>filtergraph</var></samp>&rsquo;</dt>
1142 <dd><p>Create the filtergraph specified by <var>filtergraph</var> and use it to
1143 filter the video stream.
1144 </p>
1145 <p><var>filtergraph</var> is a description of the filtergraph to apply to
1146 the stream, and must have a single video input and a single video
1147 output. In the filtergraph, the input is associated to the label
1148 <code>in</code>, and the output to the label <code>out</code>. See the
1149 ffmpeg-filters manual for more information about the filtergraph
1150 syntax.
1151 </p>
1152 </dd>
1153 <dt> &lsquo;<samp>-af <var>filtergraph</var></samp>&rsquo;</dt>
1154 <dd><p><var>filtergraph</var> is a description of the filtergraph to apply to
1155 the input audio.
1156 Use the option &quot;-filters&quot; to show all the available filters (including
1157 sources and sinks).
1158 </p>
1159 </dd>
1160 <dt> &lsquo;<samp>-i <var>input_file</var></samp>&rsquo;</dt>
1161 <dd><p>Read <var>input_file</var>.
1162 </p></dd>
1163 </dl>
1164
1165 <a name="Advanced-options"></a>
1166 <h2 class="section"><a href="ffplay-all.html#toc-Advanced-options">3.5 Advanced options</a></h2>
1167 <dl compact="compact">
1168 <dt> &lsquo;<samp>-pix_fmt <var>format</var></samp>&rsquo;</dt>
1169 <dd><p>Set pixel format.
1170 This option has been deprecated in favor of private options, try -pixel_format.
1171 </p>
1172 </dd>
1173 <dt> &lsquo;<samp>-stats</samp>&rsquo;</dt>
1174 <dd><p>Print several playback statistics, in particular show the stream
1175 duration, the codec parameters, the current position in the stream and
1176 the audio/video synchronisation drift. It is on by default, to
1177 explicitly disable it you need to specify <code>-nostats</code>.
1178 </p>
1179 </dd>
1180 <dt> &lsquo;<samp>-bug</samp>&rsquo;</dt>
1181 <dd><p>Work around bugs.
1182 </p></dd>
1183 <dt> &lsquo;<samp>-fast</samp>&rsquo;</dt>
1184 <dd><p>Non-spec-compliant optimizations.
1185 </p></dd>
1186 <dt> &lsquo;<samp>-genpts</samp>&rsquo;</dt>
1187 <dd><p>Generate pts.
1188 </p></dd>
1189 <dt> &lsquo;<samp>-rtp_tcp</samp>&rsquo;</dt>
1190 <dd><p>Force RTP/TCP protocol usage instead of RTP/UDP. It is only meaningful
1191 if you are streaming with the RTSP protocol.
1192 </p></dd>
1193 <dt> &lsquo;<samp>-sync <var>type</var></samp>&rsquo;</dt>
1194 <dd><p>Set the master clock to audio (<code>type=audio</code>), video
1195 (<code>type=video</code>) or external (<code>type=ext</code>). Default is audio. The
1196 master clock is used to control audio-video synchronization. Most media
1197 players use audio as master clock, but in some cases (streaming or high
1198 quality broadcast) it is necessary to change that. This option is mainly
1199 used for debugging purposes.
1200 </p></dd>
1201 <dt> &lsquo;<samp>-threads <var>count</var></samp>&rsquo;</dt>
1202 <dd><p>Set the thread count.
1203 </p></dd>
1204 <dt> &lsquo;<samp>-ast <var>audio_stream_number</var></samp>&rsquo;</dt>
1205 <dd><p>Select the desired audio stream number, counting from 0. The number
1206 refers to the list of all the input audio streams. If it is greater
1207 than the number of audio streams minus one, then the last one is
1208 selected, if it is negative the audio playback is disabled.
1209 </p></dd>
1210 <dt> &lsquo;<samp>-vst <var>video_stream_number</var></samp>&rsquo;</dt>
1211 <dd><p>Select the desired video stream number, counting from 0. The number
1212 refers to the list of all the input video streams. If it is greater
1213 than the number of video streams minus one, then the last one is
1214 selected, if it is negative the video playback is disabled.
1215 </p></dd>
1216 <dt> &lsquo;<samp>-sst <var>subtitle_stream_number</var></samp>&rsquo;</dt>
1217 <dd><p>Select the desired subtitle stream number, counting from 0. The number
1218 refers to the list of all the input subtitle streams. If it is greater
1219 than the number of subtitle streams minus one, then the last one is
1220 selected, if it is negative the subtitle rendering is disabled.
1221 </p></dd>
1222 <dt> &lsquo;<samp>-autoexit</samp>&rsquo;</dt>
1223 <dd><p>Exit when video is done playing.
1224 </p></dd>
1225 <dt> &lsquo;<samp>-exitonkeydown</samp>&rsquo;</dt>
1226 <dd><p>Exit if any key is pressed.
1227 </p></dd>
1228 <dt> &lsquo;<samp>-exitonmousedown</samp>&rsquo;</dt>
1229 <dd><p>Exit if any mouse button is pressed.
1230 </p>
1231 </dd>
1232 <dt> &lsquo;<samp>-codec:<var>media_specifier</var> <var>codec_name</var></samp>&rsquo;</dt>
1233 <dd><p>Force a specific decoder implementation for the stream identified by
1234 <var>media_specifier</var>, which can assume the values <code>a</code> (audio),
1235 <code>v</code> (video), and <code>s</code> subtitle.
1236 </p>
1237 </dd>
1238 <dt> &lsquo;<samp>-acodec <var>codec_name</var></samp>&rsquo;</dt>
1239 <dd><p>Force a specific audio decoder.
1240 </p>
1241 </dd>
1242 <dt> &lsquo;<samp>-vcodec <var>codec_name</var></samp>&rsquo;</dt>
1243 <dd><p>Force a specific video decoder.
1244 </p>
1245 </dd>
1246 <dt> &lsquo;<samp>-scodec <var>codec_name</var></samp>&rsquo;</dt>
1247 <dd><p>Force a specific subtitle decoder.
1248 </p></dd>
1249 </dl>
1250
1251 <a name="While-playing"></a>
1252 <h2 class="section"><a href="ffplay-all.html#toc-While-playing">3.6 While playing</a></h2>
1253
1254 <dl compact="compact">
1255 <dt> &lt;q, ESC&gt;</dt>
1256 <dd><p>Quit.
1257 </p>
1258 </dd>
1259 <dt> &lt;f&gt;</dt>
1260 <dd><p>Toggle full screen.
1261 </p>
1262 </dd>
1263 <dt> &lt;p, SPC&gt;</dt>
1264 <dd><p>Pause.
1265 </p>
1266 </dd>
1267 <dt> &lt;a&gt;</dt>
1268 <dd><p>Cycle audio channel in the curret program.
1269 </p>
1270 </dd>
1271 <dt> &lt;v&gt;</dt>
1272 <dd><p>Cycle video channel.
1273 </p>
1274 </dd>
1275 <dt> &lt;t&gt;</dt>
1276 <dd><p>Cycle subtitle channel in the current program.
1277 </p>
1278 </dd>
1279 <dt> &lt;c&gt;</dt>
1280 <dd><p>Cycle program.
1281 </p>
1282 </dd>
1283 <dt> &lt;w&gt;</dt>
1284 <dd><p>Show audio waves.
1285 </p>
1286 </dd>
1287 <dt> &lt;s&gt;</dt>
1288 <dd><p>Step to the next frame.
1289 </p>
1290 <p>Pause if the stream is not already paused, step to the next video
1291 frame, and pause.
1292 </p>
1293 </dd>
1294 <dt> &lt;left/right&gt;</dt>
1295 <dd><p>Seek backward/forward 10 seconds.
1296 </p>
1297 </dd>
1298 <dt> &lt;down/up&gt;</dt>
1299 <dd><p>Seek backward/forward 1 minute.
1300 </p>
1301 </dd>
1302 <dt> &lt;page down/page up&gt;</dt>
1303 <dd><p>Seek to the previous/next chapter.
1304 or if there are no chapters
1305 Seek backward/forward 10 minutes.
1306 </p>
1307 </dd>
1308 <dt> &lt;mouse click&gt;</dt>
1309 <dd><p>Seek to percentage in file corresponding to fraction of width.
1310 </p>
1311 </dd>
1312 </dl>
1313
1314
1315 <a name="Syntax"></a>
1316 <h1 class="chapter"><a href="ffplay-all.html#toc-Syntax">4. Syntax</a></h1>
1317
1318 <p>This section documents the syntax and formats employed by the FFmpeg
1319 libraries and tools.
1320 </p>
1321 <p><a name="quoting_005fand_005fescaping"></a>
1322 </p><a name="Quoting-and-escaping"></a>
1323 <h2 class="section"><a href="ffplay-all.html#toc-Quoting-and-escaping">4.1 Quoting and escaping</a></h2>
1324
1325 <p>FFmpeg adopts the following quoting and escaping mechanism, unless
1326 explicitly specified. The following rules are applied:
1327 </p>
1328 <ul>
1329 <li>
1330 <code>'</code> and <code>\</code> are special characters (respectively used for
1331 quoting and escaping). In addition to them, there might be other
1332 special characters depending on the specific syntax where the escaping
1333 and quoting are employed.
1334
1335 </li><li>
1336 A special character is escaped by prefixing it with a &rsquo;\&rsquo;.
1337
1338 </li><li>
1339 All characters enclosed between &rdquo; are included literally in the
1340 parsed string. The quote character <code>'</code> itself cannot be quoted,
1341 so you may need to close the quote and escape it.
1342
1343 </li><li>
1344 Leading and trailing whitespaces, unless escaped or quoted, are
1345 removed from the parsed string.
1346 </li></ul>
1347
1348 <p>Note that you may need to add a second level of escaping when using
1349 the command line or a script, which depends on the syntax of the
1350 adopted shell language.
1351 </p>
1352 <p>The function <code>av_get_token</code> defined in
1353 &lsquo;<tt>libavutil/avstring.h</tt>&rsquo; can be used to parse a token quoted or
1354 escaped according to the rules defined above.
1355 </p>
1356 <p>The tool &lsquo;<tt>tools/ffescape</tt>&rsquo; in the FFmpeg source tree can be used
1357 to automatically quote or escape a string in a script.
1358 </p>
1359 <a name="Examples-4"></a>
1360 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-4">4.1.1 Examples</a></h3>
1361
1362 <ul>
1363 <li>
1364 Escape the string <code>Crime d'Amour</code> containing the <code>'</code> special
1365 character:
1366 <table><tr><td>&nbsp;</td><td><pre class="example">Crime d\'Amour
1367 </pre></td></tr></table>
1368
1369 </li><li>
1370 The string above contains a quote, so the <code>'</code> needs to be escaped
1371 when quoting it:
1372 <table><tr><td>&nbsp;</td><td><pre class="example">'Crime d'\''Amour'
1373 </pre></td></tr></table>
1374
1375 </li><li>
1376 Include leading or trailing whitespaces using quoting:
1377 <table><tr><td>&nbsp;</td><td><pre class="example">'  this string starts and ends with whitespaces  '
1378 </pre></td></tr></table>
1379
1380 </li><li>
1381 Escaping and quoting can be mixed together:
1382 <table><tr><td>&nbsp;</td><td><pre class="example">' The string '\'string\'' is a string '
1383 </pre></td></tr></table>
1384
1385 </li><li>
1386 To include a literal <code>\</code> you can use either escaping or quoting:
1387 <table><tr><td>&nbsp;</td><td><pre class="example">'c:\foo' can be written as c:\\foo
1388 </pre></td></tr></table>
1389 </li></ul>
1390
1391 <p><a name="date-syntax"></a>
1392 </p><a name="Date"></a>
1393 <h2 class="section"><a href="ffplay-all.html#toc-Date">4.2 Date</a></h2>
1394
1395 <p>The accepted syntax is:
1396 </p><table><tr><td>&nbsp;</td><td><pre class="example">[(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
1397 now
1398 </pre></td></tr></table>
1399
1400 <p>If the value is &quot;now&quot; it takes the current time.
1401 </p>
1402 <p>Time is local time unless Z is appended, in which case it is
1403 interpreted as UTC.
1404 If the year-month-day part is not specified it takes the current
1405 year-month-day.
1406 </p>
1407 <p><a name="time-duration-syntax"></a>
1408 </p><a name="Time-duration"></a>
1409 <h2 class="section"><a href="ffplay-all.html#toc-Time-duration">4.3 Time duration</a></h2>
1410
1411 <p>There are two accepted syntaxes for expressing time duration.
1412 </p>
1413 <table><tr><td>&nbsp;</td><td><pre class="example">[-][<var>HH</var>:]<var>MM</var>:<var>SS</var>[.<var>m</var>...]
1414 </pre></td></tr></table>
1415
1416 <p><var>HH</var> expresses the number of hours, <var>MM</var> the number of minutes
1417 for a maximum of 2 digits, and <var>SS</var> the number of seconds for a
1418 maximum of 2 digits. The <var>m</var> at the end expresses decimal value for
1419 <var>SS</var>.
1420 </p>
1421 <p><em>or</em>
1422 </p>
1423 <table><tr><td>&nbsp;</td><td><pre class="example">[-]<var>S</var>+[.<var>m</var>...]
1424 </pre></td></tr></table>
1425
1426 <p><var>S</var> expresses the number of seconds, with the optional decimal part
1427 <var>m</var>.
1428 </p>
1429 <p>In both expressions, the optional &lsquo;<samp>-</samp>&rsquo; indicates negative duration.
1430 </p>
1431 <a name="Examples-66"></a>
1432 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-66">4.3.1 Examples</a></h3>
1433
1434 <p>The following examples are all valid time duration:
1435 </p>
1436 <dl compact="compact">
1437 <dt> &lsquo;<samp>55</samp>&rsquo;</dt>
1438 <dd><p>55 seconds
1439 </p>
1440 </dd>
1441 <dt> &lsquo;<samp>12:03:45</samp>&rsquo;</dt>
1442 <dd><p>12 hours, 03 minutes and 45 seconds
1443 </p>
1444 </dd>
1445 <dt> &lsquo;<samp>23.189</samp>&rsquo;</dt>
1446 <dd><p>23.189 seconds
1447 </p></dd>
1448 </dl>
1449
1450 <p><a name="video-size-syntax"></a>
1451 </p><a name="Video-size"></a>
1452 <h2 class="section"><a href="ffplay-all.html#toc-Video-size">4.4 Video size</a></h2>
1453 <p>Specify the size of the sourced video, it may be a string of the form
1454 <var>width</var>x<var>height</var>, or the name of a size abbreviation.
1455 </p>
1456 <p>The following abbreviations are recognized:
1457 </p><dl compact="compact">
1458 <dt> &lsquo;<samp>ntsc</samp>&rsquo;</dt>
1459 <dd><p>720x480
1460 </p></dd>
1461 <dt> &lsquo;<samp>pal</samp>&rsquo;</dt>
1462 <dd><p>720x576
1463 </p></dd>
1464 <dt> &lsquo;<samp>qntsc</samp>&rsquo;</dt>
1465 <dd><p>352x240
1466 </p></dd>
1467 <dt> &lsquo;<samp>qpal</samp>&rsquo;</dt>
1468 <dd><p>352x288
1469 </p></dd>
1470 <dt> &lsquo;<samp>sntsc</samp>&rsquo;</dt>
1471 <dd><p>640x480
1472 </p></dd>
1473 <dt> &lsquo;<samp>spal</samp>&rsquo;</dt>
1474 <dd><p>768x576
1475 </p></dd>
1476 <dt> &lsquo;<samp>film</samp>&rsquo;</dt>
1477 <dd><p>352x240
1478 </p></dd>
1479 <dt> &lsquo;<samp>ntsc-film</samp>&rsquo;</dt>
1480 <dd><p>352x240
1481 </p></dd>
1482 <dt> &lsquo;<samp>sqcif</samp>&rsquo;</dt>
1483 <dd><p>128x96
1484 </p></dd>
1485 <dt> &lsquo;<samp>qcif</samp>&rsquo;</dt>
1486 <dd><p>176x144
1487 </p></dd>
1488 <dt> &lsquo;<samp>cif</samp>&rsquo;</dt>
1489 <dd><p>352x288
1490 </p></dd>
1491 <dt> &lsquo;<samp>4cif</samp>&rsquo;</dt>
1492 <dd><p>704x576
1493 </p></dd>
1494 <dt> &lsquo;<samp>16cif</samp>&rsquo;</dt>
1495 <dd><p>1408x1152
1496 </p></dd>
1497 <dt> &lsquo;<samp>qqvga</samp>&rsquo;</dt>
1498 <dd><p>160x120
1499 </p></dd>
1500 <dt> &lsquo;<samp>qvga</samp>&rsquo;</dt>
1501 <dd><p>320x240
1502 </p></dd>
1503 <dt> &lsquo;<samp>vga</samp>&rsquo;</dt>
1504 <dd><p>640x480
1505 </p></dd>
1506 <dt> &lsquo;<samp>svga</samp>&rsquo;</dt>
1507 <dd><p>800x600
1508 </p></dd>
1509 <dt> &lsquo;<samp>xga</samp>&rsquo;</dt>
1510 <dd><p>1024x768
1511 </p></dd>
1512 <dt> &lsquo;<samp>uxga</samp>&rsquo;</dt>
1513 <dd><p>1600x1200
1514 </p></dd>
1515 <dt> &lsquo;<samp>qxga</samp>&rsquo;</dt>
1516 <dd><p>2048x1536
1517 </p></dd>
1518 <dt> &lsquo;<samp>sxga</samp>&rsquo;</dt>
1519 <dd><p>1280x1024
1520 </p></dd>
1521 <dt> &lsquo;<samp>qsxga</samp>&rsquo;</dt>
1522 <dd><p>2560x2048
1523 </p></dd>
1524 <dt> &lsquo;<samp>hsxga</samp>&rsquo;</dt>
1525 <dd><p>5120x4096
1526 </p></dd>
1527 <dt> &lsquo;<samp>wvga</samp>&rsquo;</dt>
1528 <dd><p>852x480
1529 </p></dd>
1530 <dt> &lsquo;<samp>wxga</samp>&rsquo;</dt>
1531 <dd><p>1366x768
1532 </p></dd>
1533 <dt> &lsquo;<samp>wsxga</samp>&rsquo;</dt>
1534 <dd><p>1600x1024
1535 </p></dd>
1536 <dt> &lsquo;<samp>wuxga</samp>&rsquo;</dt>
1537 <dd><p>1920x1200
1538 </p></dd>
1539 <dt> &lsquo;<samp>woxga</samp>&rsquo;</dt>
1540 <dd><p>2560x1600
1541 </p></dd>
1542 <dt> &lsquo;<samp>wqsxga</samp>&rsquo;</dt>
1543 <dd><p>3200x2048
1544 </p></dd>
1545 <dt> &lsquo;<samp>wquxga</samp>&rsquo;</dt>
1546 <dd><p>3840x2400
1547 </p></dd>
1548 <dt> &lsquo;<samp>whsxga</samp>&rsquo;</dt>
1549 <dd><p>6400x4096
1550 </p></dd>
1551 <dt> &lsquo;<samp>whuxga</samp>&rsquo;</dt>
1552 <dd><p>7680x4800
1553 </p></dd>
1554 <dt> &lsquo;<samp>cga</samp>&rsquo;</dt>
1555 <dd><p>320x200
1556 </p></dd>
1557 <dt> &lsquo;<samp>ega</samp>&rsquo;</dt>
1558 <dd><p>640x350
1559 </p></dd>
1560 <dt> &lsquo;<samp>hd480</samp>&rsquo;</dt>
1561 <dd><p>852x480
1562 </p></dd>
1563 <dt> &lsquo;<samp>hd720</samp>&rsquo;</dt>
1564 <dd><p>1280x720
1565 </p></dd>
1566 <dt> &lsquo;<samp>hd1080</samp>&rsquo;</dt>
1567 <dd><p>1920x1080
1568 </p></dd>
1569 <dt> &lsquo;<samp>2k</samp>&rsquo;</dt>
1570 <dd><p>2048x1080
1571 </p></dd>
1572 <dt> &lsquo;<samp>2kflat</samp>&rsquo;</dt>
1573 <dd><p>1998x1080
1574 </p></dd>
1575 <dt> &lsquo;<samp>2kscope</samp>&rsquo;</dt>
1576 <dd><p>2048x858
1577 </p></dd>
1578 <dt> &lsquo;<samp>4k</samp>&rsquo;</dt>
1579 <dd><p>4096x2160
1580 </p></dd>
1581 <dt> &lsquo;<samp>4kflat</samp>&rsquo;</dt>
1582 <dd><p>3996x2160
1583 </p></dd>
1584 <dt> &lsquo;<samp>4kscope</samp>&rsquo;</dt>
1585 <dd><p>4096x1716
1586 </p></dd>
1587 <dt> &lsquo;<samp>nhd</samp>&rsquo;</dt>
1588 <dd><p>640x360
1589 </p></dd>
1590 <dt> &lsquo;<samp>hqvga</samp>&rsquo;</dt>
1591 <dd><p>240x160
1592 </p></dd>
1593 <dt> &lsquo;<samp>wqvga</samp>&rsquo;</dt>
1594 <dd><p>400x240
1595 </p></dd>
1596 <dt> &lsquo;<samp>fwqvga</samp>&rsquo;</dt>
1597 <dd><p>432x240
1598 </p></dd>
1599 <dt> &lsquo;<samp>hvga</samp>&rsquo;</dt>
1600 <dd><p>480x320
1601 </p></dd>
1602 <dt> &lsquo;<samp>qhd</samp>&rsquo;</dt>
1603 <dd><p>960x540
1604 </p></dd>
1605 </dl>
1606
1607 <p><a name="video-rate-syntax"></a>
1608 </p><a name="Video-rate"></a>
1609 <h2 class="section"><a href="ffplay-all.html#toc-Video-rate">4.5 Video rate</a></h2>
1610
1611 <p>Specify the frame rate of a video, expressed as the number of frames
1612 generated per second. It has to be a string in the format
1613 <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a float
1614 number or a valid video frame rate abbreviation.
1615 </p>
1616 <p>The following abbreviations are recognized:
1617 </p><dl compact="compact">
1618 <dt> &lsquo;<samp>ntsc</samp>&rsquo;</dt>
1619 <dd><p>30000/1001
1620 </p></dd>
1621 <dt> &lsquo;<samp>pal</samp>&rsquo;</dt>
1622 <dd><p>25/1
1623 </p></dd>
1624 <dt> &lsquo;<samp>qntsc</samp>&rsquo;</dt>
1625 <dd><p>30000/1001
1626 </p></dd>
1627 <dt> &lsquo;<samp>qpal</samp>&rsquo;</dt>
1628 <dd><p>25/1
1629 </p></dd>
1630 <dt> &lsquo;<samp>sntsc</samp>&rsquo;</dt>
1631 <dd><p>30000/1001
1632 </p></dd>
1633 <dt> &lsquo;<samp>spal</samp>&rsquo;</dt>
1634 <dd><p>25/1
1635 </p></dd>
1636 <dt> &lsquo;<samp>film</samp>&rsquo;</dt>
1637 <dd><p>24/1
1638 </p></dd>
1639 <dt> &lsquo;<samp>ntsc-film</samp>&rsquo;</dt>
1640 <dd><p>24000/1001
1641 </p></dd>
1642 </dl>
1643
1644 <p><a name="ratio-syntax"></a>
1645 </p><a name="Ratio"></a>
1646 <h2 class="section"><a href="ffplay-all.html#toc-Ratio">4.6 Ratio</a></h2>
1647
1648 <p>A ratio can be expressed as an expression, or in the form
1649 <var>numerator</var>:<var>denominator</var>.
1650 </p>
1651 <p>Note that a ratio with infinite (1/0) or negative value is
1652 considered valid, so you should check on the returned value if you
1653 want to exclude those values.
1654 </p>
1655 <p>The undefined value can be expressed using the &quot;0:0&quot; string.
1656 </p>
1657 <p><a name="color-syntax"></a>
1658 </p><a name="Color"></a>
1659 <h2 class="section"><a href="ffplay-all.html#toc-Color">4.7 Color</a></h2>
1660
1661 <p>It can be the name of a color as defined below (case insensitive match) or a
1662 <code>[0x|#]RRGGBB[AA]</code> sequence, possibly followed by @ and a string
1663 representing the alpha component.
1664 </p>
1665 <p>The alpha component may be a string composed by &quot;0x&quot; followed by an
1666 hexadecimal number or a decimal number between 0.0 and 1.0, which
1667 represents the opacity value (&lsquo;<samp>0x00</samp>&rsquo; or &lsquo;<samp>0.0</samp>&rsquo; means completely
1668 transparent, &lsquo;<samp>0xff</samp>&rsquo; or &lsquo;<samp>1.0</samp>&rsquo; completely opaque). If the alpha
1669 component is not specified then &lsquo;<samp>0xff</samp>&rsquo; is assumed.
1670 </p>
1671 <p>The string &lsquo;<samp>random</samp>&rsquo; will result in a random color.
1672 </p>
1673 <p>The following names of colors are recognized:
1674 </p><dl compact="compact">
1675 <dt> &lsquo;<samp>AliceBlue</samp>&rsquo;</dt>
1676 <dd><p>0xF0F8FF
1677 </p></dd>
1678 <dt> &lsquo;<samp>AntiqueWhite</samp>&rsquo;</dt>
1679 <dd><p>0xFAEBD7
1680 </p></dd>
1681 <dt> &lsquo;<samp>Aqua</samp>&rsquo;</dt>
1682 <dd><p>0x00FFFF
1683 </p></dd>
1684 <dt> &lsquo;<samp>Aquamarine</samp>&rsquo;</dt>
1685 <dd><p>0x7FFFD4
1686 </p></dd>
1687 <dt> &lsquo;<samp>Azure</samp>&rsquo;</dt>
1688 <dd><p>0xF0FFFF
1689 </p></dd>
1690 <dt> &lsquo;<samp>Beige</samp>&rsquo;</dt>
1691 <dd><p>0xF5F5DC
1692 </p></dd>
1693 <dt> &lsquo;<samp>Bisque</samp>&rsquo;</dt>
1694 <dd><p>0xFFE4C4
1695 </p></dd>
1696 <dt> &lsquo;<samp>Black</samp>&rsquo;</dt>
1697 <dd><p>0x000000
1698 </p></dd>
1699 <dt> &lsquo;<samp>BlanchedAlmond</samp>&rsquo;</dt>
1700 <dd><p>0xFFEBCD
1701 </p></dd>
1702 <dt> &lsquo;<samp>Blue</samp>&rsquo;</dt>
1703 <dd><p>0x0000FF
1704 </p></dd>
1705 <dt> &lsquo;<samp>BlueViolet</samp>&rsquo;</dt>
1706 <dd><p>0x8A2BE2
1707 </p></dd>
1708 <dt> &lsquo;<samp>Brown</samp>&rsquo;</dt>
1709 <dd><p>0xA52A2A
1710 </p></dd>
1711 <dt> &lsquo;<samp>BurlyWood</samp>&rsquo;</dt>
1712 <dd><p>0xDEB887
1713 </p></dd>
1714 <dt> &lsquo;<samp>CadetBlue</samp>&rsquo;</dt>
1715 <dd><p>0x5F9EA0
1716 </p></dd>
1717 <dt> &lsquo;<samp>Chartreuse</samp>&rsquo;</dt>
1718 <dd><p>0x7FFF00
1719 </p></dd>
1720 <dt> &lsquo;<samp>Chocolate</samp>&rsquo;</dt>
1721 <dd><p>0xD2691E
1722 </p></dd>
1723 <dt> &lsquo;<samp>Coral</samp>&rsquo;</dt>
1724 <dd><p>0xFF7F50
1725 </p></dd>
1726 <dt> &lsquo;<samp>CornflowerBlue</samp>&rsquo;</dt>
1727 <dd><p>0x6495ED
1728 </p></dd>
1729 <dt> &lsquo;<samp>Cornsilk</samp>&rsquo;</dt>
1730 <dd><p>0xFFF8DC
1731 </p></dd>
1732 <dt> &lsquo;<samp>Crimson</samp>&rsquo;</dt>
1733 <dd><p>0xDC143C
1734 </p></dd>
1735 <dt> &lsquo;<samp>Cyan</samp>&rsquo;</dt>
1736 <dd><p>0x00FFFF
1737 </p></dd>
1738 <dt> &lsquo;<samp>DarkBlue</samp>&rsquo;</dt>
1739 <dd><p>0x00008B
1740 </p></dd>
1741 <dt> &lsquo;<samp>DarkCyan</samp>&rsquo;</dt>
1742 <dd><p>0x008B8B
1743 </p></dd>
1744 <dt> &lsquo;<samp>DarkGoldenRod</samp>&rsquo;</dt>
1745 <dd><p>0xB8860B
1746 </p></dd>
1747 <dt> &lsquo;<samp>DarkGray</samp>&rsquo;</dt>
1748 <dd><p>0xA9A9A9
1749 </p></dd>
1750 <dt> &lsquo;<samp>DarkGreen</samp>&rsquo;</dt>
1751 <dd><p>0x006400
1752 </p></dd>
1753 <dt> &lsquo;<samp>DarkKhaki</samp>&rsquo;</dt>
1754 <dd><p>0xBDB76B
1755 </p></dd>
1756 <dt> &lsquo;<samp>DarkMagenta</samp>&rsquo;</dt>
1757 <dd><p>0x8B008B
1758 </p></dd>
1759 <dt> &lsquo;<samp>DarkOliveGreen</samp>&rsquo;</dt>
1760 <dd><p>0x556B2F
1761 </p></dd>
1762 <dt> &lsquo;<samp>Darkorange</samp>&rsquo;</dt>
1763 <dd><p>0xFF8C00
1764 </p></dd>
1765 <dt> &lsquo;<samp>DarkOrchid</samp>&rsquo;</dt>
1766 <dd><p>0x9932CC
1767 </p></dd>
1768 <dt> &lsquo;<samp>DarkRed</samp>&rsquo;</dt>
1769 <dd><p>0x8B0000
1770 </p></dd>
1771 <dt> &lsquo;<samp>DarkSalmon</samp>&rsquo;</dt>
1772 <dd><p>0xE9967A
1773 </p></dd>
1774 <dt> &lsquo;<samp>DarkSeaGreen</samp>&rsquo;</dt>
1775 <dd><p>0x8FBC8F
1776 </p></dd>
1777 <dt> &lsquo;<samp>DarkSlateBlue</samp>&rsquo;</dt>
1778 <dd><p>0x483D8B
1779 </p></dd>
1780 <dt> &lsquo;<samp>DarkSlateGray</samp>&rsquo;</dt>
1781 <dd><p>0x2F4F4F
1782 </p></dd>
1783 <dt> &lsquo;<samp>DarkTurquoise</samp>&rsquo;</dt>
1784 <dd><p>0x00CED1
1785 </p></dd>
1786 <dt> &lsquo;<samp>DarkViolet</samp>&rsquo;</dt>
1787 <dd><p>0x9400D3
1788 </p></dd>
1789 <dt> &lsquo;<samp>DeepPink</samp>&rsquo;</dt>
1790 <dd><p>0xFF1493
1791 </p></dd>
1792 <dt> &lsquo;<samp>DeepSkyBlue</samp>&rsquo;</dt>
1793 <dd><p>0x00BFFF
1794 </p></dd>
1795 <dt> &lsquo;<samp>DimGray</samp>&rsquo;</dt>
1796 <dd><p>0x696969
1797 </p></dd>
1798 <dt> &lsquo;<samp>DodgerBlue</samp>&rsquo;</dt>
1799 <dd><p>0x1E90FF
1800 </p></dd>
1801 <dt> &lsquo;<samp>FireBrick</samp>&rsquo;</dt>
1802 <dd><p>0xB22222
1803 </p></dd>
1804 <dt> &lsquo;<samp>FloralWhite</samp>&rsquo;</dt>
1805 <dd><p>0xFFFAF0
1806 </p></dd>
1807 <dt> &lsquo;<samp>ForestGreen</samp>&rsquo;</dt>
1808 <dd><p>0x228B22
1809 </p></dd>
1810 <dt> &lsquo;<samp>Fuchsia</samp>&rsquo;</dt>
1811 <dd><p>0xFF00FF
1812 </p></dd>
1813 <dt> &lsquo;<samp>Gainsboro</samp>&rsquo;</dt>
1814 <dd><p>0xDCDCDC
1815 </p></dd>
1816 <dt> &lsquo;<samp>GhostWhite</samp>&rsquo;</dt>
1817 <dd><p>0xF8F8FF
1818 </p></dd>
1819 <dt> &lsquo;<samp>Gold</samp>&rsquo;</dt>
1820 <dd><p>0xFFD700
1821 </p></dd>
1822 <dt> &lsquo;<samp>GoldenRod</samp>&rsquo;</dt>
1823 <dd><p>0xDAA520
1824 </p></dd>
1825 <dt> &lsquo;<samp>Gray</samp>&rsquo;</dt>
1826 <dd><p>0x808080
1827 </p></dd>
1828 <dt> &lsquo;<samp>Green</samp>&rsquo;</dt>
1829 <dd><p>0x008000
1830 </p></dd>
1831 <dt> &lsquo;<samp>GreenYellow</samp>&rsquo;</dt>
1832 <dd><p>0xADFF2F
1833 </p></dd>
1834 <dt> &lsquo;<samp>HoneyDew</samp>&rsquo;</dt>
1835 <dd><p>0xF0FFF0
1836 </p></dd>
1837 <dt> &lsquo;<samp>HotPink</samp>&rsquo;</dt>
1838 <dd><p>0xFF69B4
1839 </p></dd>
1840 <dt> &lsquo;<samp>IndianRed</samp>&rsquo;</dt>
1841 <dd><p>0xCD5C5C
1842 </p></dd>
1843 <dt> &lsquo;<samp>Indigo</samp>&rsquo;</dt>
1844 <dd><p>0x4B0082
1845 </p></dd>
1846 <dt> &lsquo;<samp>Ivory</samp>&rsquo;</dt>
1847 <dd><p>0xFFFFF0
1848 </p></dd>
1849 <dt> &lsquo;<samp>Khaki</samp>&rsquo;</dt>
1850 <dd><p>0xF0E68C
1851 </p></dd>
1852 <dt> &lsquo;<samp>Lavender</samp>&rsquo;</dt>
1853 <dd><p>0xE6E6FA
1854 </p></dd>
1855 <dt> &lsquo;<samp>LavenderBlush</samp>&rsquo;</dt>
1856 <dd><p>0xFFF0F5
1857 </p></dd>
1858 <dt> &lsquo;<samp>LawnGreen</samp>&rsquo;</dt>
1859 <dd><p>0x7CFC00
1860 </p></dd>
1861 <dt> &lsquo;<samp>LemonChiffon</samp>&rsquo;</dt>
1862 <dd><p>0xFFFACD
1863 </p></dd>
1864 <dt> &lsquo;<samp>LightBlue</samp>&rsquo;</dt>
1865 <dd><p>0xADD8E6
1866 </p></dd>
1867 <dt> &lsquo;<samp>LightCoral</samp>&rsquo;</dt>
1868 <dd><p>0xF08080
1869 </p></dd>
1870 <dt> &lsquo;<samp>LightCyan</samp>&rsquo;</dt>
1871 <dd><p>0xE0FFFF
1872 </p></dd>
1873 <dt> &lsquo;<samp>LightGoldenRodYellow</samp>&rsquo;</dt>
1874 <dd><p>0xFAFAD2
1875 </p></dd>
1876 <dt> &lsquo;<samp>LightGreen</samp>&rsquo;</dt>
1877 <dd><p>0x90EE90
1878 </p></dd>
1879 <dt> &lsquo;<samp>LightGrey</samp>&rsquo;</dt>
1880 <dd><p>0xD3D3D3
1881 </p></dd>
1882 <dt> &lsquo;<samp>LightPink</samp>&rsquo;</dt>
1883 <dd><p>0xFFB6C1
1884 </p></dd>
1885 <dt> &lsquo;<samp>LightSalmon</samp>&rsquo;</dt>
1886 <dd><p>0xFFA07A
1887 </p></dd>
1888 <dt> &lsquo;<samp>LightSeaGreen</samp>&rsquo;</dt>
1889 <dd><p>0x20B2AA
1890 </p></dd>
1891 <dt> &lsquo;<samp>LightSkyBlue</samp>&rsquo;</dt>
1892 <dd><p>0x87CEFA
1893 </p></dd>
1894 <dt> &lsquo;<samp>LightSlateGray</samp>&rsquo;</dt>
1895 <dd><p>0x778899
1896 </p></dd>
1897 <dt> &lsquo;<samp>LightSteelBlue</samp>&rsquo;</dt>
1898 <dd><p>0xB0C4DE
1899 </p></dd>
1900 <dt> &lsquo;<samp>LightYellow</samp>&rsquo;</dt>
1901 <dd><p>0xFFFFE0
1902 </p></dd>
1903 <dt> &lsquo;<samp>Lime</samp>&rsquo;</dt>
1904 <dd><p>0x00FF00
1905 </p></dd>
1906 <dt> &lsquo;<samp>LimeGreen</samp>&rsquo;</dt>
1907 <dd><p>0x32CD32
1908 </p></dd>
1909 <dt> &lsquo;<samp>Linen</samp>&rsquo;</dt>
1910 <dd><p>0xFAF0E6
1911 </p></dd>
1912 <dt> &lsquo;<samp>Magenta</samp>&rsquo;</dt>
1913 <dd><p>0xFF00FF
1914 </p></dd>
1915 <dt> &lsquo;<samp>Maroon</samp>&rsquo;</dt>
1916 <dd><p>0x800000
1917 </p></dd>
1918 <dt> &lsquo;<samp>MediumAquaMarine</samp>&rsquo;</dt>
1919 <dd><p>0x66CDAA
1920 </p></dd>
1921 <dt> &lsquo;<samp>MediumBlue</samp>&rsquo;</dt>
1922 <dd><p>0x0000CD
1923 </p></dd>
1924 <dt> &lsquo;<samp>MediumOrchid</samp>&rsquo;</dt>
1925 <dd><p>0xBA55D3
1926 </p></dd>
1927 <dt> &lsquo;<samp>MediumPurple</samp>&rsquo;</dt>
1928 <dd><p>0x9370D8
1929 </p></dd>
1930 <dt> &lsquo;<samp>MediumSeaGreen</samp>&rsquo;</dt>
1931 <dd><p>0x3CB371
1932 </p></dd>
1933 <dt> &lsquo;<samp>MediumSlateBlue</samp>&rsquo;</dt>
1934 <dd><p>0x7B68EE
1935 </p></dd>
1936 <dt> &lsquo;<samp>MediumSpringGreen</samp>&rsquo;</dt>
1937 <dd><p>0x00FA9A
1938 </p></dd>
1939 <dt> &lsquo;<samp>MediumTurquoise</samp>&rsquo;</dt>
1940 <dd><p>0x48D1CC
1941 </p></dd>
1942 <dt> &lsquo;<samp>MediumVioletRed</samp>&rsquo;</dt>
1943 <dd><p>0xC71585
1944 </p></dd>
1945 <dt> &lsquo;<samp>MidnightBlue</samp>&rsquo;</dt>
1946 <dd><p>0x191970
1947 </p></dd>
1948 <dt> &lsquo;<samp>MintCream</samp>&rsquo;</dt>
1949 <dd><p>0xF5FFFA
1950 </p></dd>
1951 <dt> &lsquo;<samp>MistyRose</samp>&rsquo;</dt>
1952 <dd><p>0xFFE4E1
1953 </p></dd>
1954 <dt> &lsquo;<samp>Moccasin</samp>&rsquo;</dt>
1955 <dd><p>0xFFE4B5
1956 </p></dd>
1957 <dt> &lsquo;<samp>NavajoWhite</samp>&rsquo;</dt>
1958 <dd><p>0xFFDEAD
1959 </p></dd>
1960 <dt> &lsquo;<samp>Navy</samp>&rsquo;</dt>
1961 <dd><p>0x000080
1962 </p></dd>
1963 <dt> &lsquo;<samp>OldLace</samp>&rsquo;</dt>
1964 <dd><p>0xFDF5E6
1965 </p></dd>
1966 <dt> &lsquo;<samp>Olive</samp>&rsquo;</dt>
1967 <dd><p>0x808000
1968 </p></dd>
1969 <dt> &lsquo;<samp>OliveDrab</samp>&rsquo;</dt>
1970 <dd><p>0x6B8E23
1971 </p></dd>
1972 <dt> &lsquo;<samp>Orange</samp>&rsquo;</dt>
1973 <dd><p>0xFFA500
1974 </p></dd>
1975 <dt> &lsquo;<samp>OrangeRed</samp>&rsquo;</dt>
1976 <dd><p>0xFF4500
1977 </p></dd>
1978 <dt> &lsquo;<samp>Orchid</samp>&rsquo;</dt>
1979 <dd><p>0xDA70D6
1980 </p></dd>
1981 <dt> &lsquo;<samp>PaleGoldenRod</samp>&rsquo;</dt>
1982 <dd><p>0xEEE8AA
1983 </p></dd>
1984 <dt> &lsquo;<samp>PaleGreen</samp>&rsquo;</dt>
1985 <dd><p>0x98FB98
1986 </p></dd>
1987 <dt> &lsquo;<samp>PaleTurquoise</samp>&rsquo;</dt>
1988 <dd><p>0xAFEEEE
1989 </p></dd>
1990 <dt> &lsquo;<samp>PaleVioletRed</samp>&rsquo;</dt>
1991 <dd><p>0xD87093
1992 </p></dd>
1993 <dt> &lsquo;<samp>PapayaWhip</samp>&rsquo;</dt>
1994 <dd><p>0xFFEFD5
1995 </p></dd>
1996 <dt> &lsquo;<samp>PeachPuff</samp>&rsquo;</dt>
1997 <dd><p>0xFFDAB9
1998 </p></dd>
1999 <dt> &lsquo;<samp>Peru</samp>&rsquo;</dt>
2000 <dd><p>0xCD853F
2001 </p></dd>
2002 <dt> &lsquo;<samp>Pink</samp>&rsquo;</dt>
2003 <dd><p>0xFFC0CB
2004 </p></dd>
2005 <dt> &lsquo;<samp>Plum</samp>&rsquo;</dt>
2006 <dd><p>0xDDA0DD
2007 </p></dd>
2008 <dt> &lsquo;<samp>PowderBlue</samp>&rsquo;</dt>
2009 <dd><p>0xB0E0E6
2010 </p></dd>
2011 <dt> &lsquo;<samp>Purple</samp>&rsquo;</dt>
2012 <dd><p>0x800080
2013 </p></dd>
2014 <dt> &lsquo;<samp>Red</samp>&rsquo;</dt>
2015 <dd><p>0xFF0000
2016 </p></dd>
2017 <dt> &lsquo;<samp>RosyBrown</samp>&rsquo;</dt>
2018 <dd><p>0xBC8F8F
2019 </p></dd>
2020 <dt> &lsquo;<samp>RoyalBlue</samp>&rsquo;</dt>
2021 <dd><p>0x4169E1
2022 </p></dd>
2023 <dt> &lsquo;<samp>SaddleBrown</samp>&rsquo;</dt>
2024 <dd><p>0x8B4513
2025 </p></dd>
2026 <dt> &lsquo;<samp>Salmon</samp>&rsquo;</dt>
2027 <dd><p>0xFA8072
2028 </p></dd>
2029 <dt> &lsquo;<samp>SandyBrown</samp>&rsquo;</dt>
2030 <dd><p>0xF4A460
2031 </p></dd>
2032 <dt> &lsquo;<samp>SeaGreen</samp>&rsquo;</dt>
2033 <dd><p>0x2E8B57
2034 </p></dd>
2035 <dt> &lsquo;<samp>SeaShell</samp>&rsquo;</dt>
2036 <dd><p>0xFFF5EE
2037 </p></dd>
2038 <dt> &lsquo;<samp>Sienna</samp>&rsquo;</dt>
2039 <dd><p>0xA0522D
2040 </p></dd>
2041 <dt> &lsquo;<samp>Silver</samp>&rsquo;</dt>
2042 <dd><p>0xC0C0C0
2043 </p></dd>
2044 <dt> &lsquo;<samp>SkyBlue</samp>&rsquo;</dt>
2045 <dd><p>0x87CEEB
2046 </p></dd>
2047 <dt> &lsquo;<samp>SlateBlue</samp>&rsquo;</dt>
2048 <dd><p>0x6A5ACD
2049 </p></dd>
2050 <dt> &lsquo;<samp>SlateGray</samp>&rsquo;</dt>
2051 <dd><p>0x708090
2052 </p></dd>
2053 <dt> &lsquo;<samp>Snow</samp>&rsquo;</dt>
2054 <dd><p>0xFFFAFA
2055 </p></dd>
2056 <dt> &lsquo;<samp>SpringGreen</samp>&rsquo;</dt>
2057 <dd><p>0x00FF7F
2058 </p></dd>
2059 <dt> &lsquo;<samp>SteelBlue</samp>&rsquo;</dt>
2060 <dd><p>0x4682B4
2061 </p></dd>
2062 <dt> &lsquo;<samp>Tan</samp>&rsquo;</dt>
2063 <dd><p>0xD2B48C
2064 </p></dd>
2065 <dt> &lsquo;<samp>Teal</samp>&rsquo;</dt>
2066 <dd><p>0x008080
2067 </p></dd>
2068 <dt> &lsquo;<samp>Thistle</samp>&rsquo;</dt>
2069 <dd><p>0xD8BFD8
2070 </p></dd>
2071 <dt> &lsquo;<samp>Tomato</samp>&rsquo;</dt>
2072 <dd><p>0xFF6347
2073 </p></dd>
2074 <dt> &lsquo;<samp>Turquoise</samp>&rsquo;</dt>
2075 <dd><p>0x40E0D0
2076 </p></dd>
2077 <dt> &lsquo;<samp>Violet</samp>&rsquo;</dt>
2078 <dd><p>0xEE82EE
2079 </p></dd>
2080 <dt> &lsquo;<samp>Wheat</samp>&rsquo;</dt>
2081 <dd><p>0xF5DEB3
2082 </p></dd>
2083 <dt> &lsquo;<samp>White</samp>&rsquo;</dt>
2084 <dd><p>0xFFFFFF
2085 </p></dd>
2086 <dt> &lsquo;<samp>WhiteSmoke</samp>&rsquo;</dt>
2087 <dd><p>0xF5F5F5
2088 </p></dd>
2089 <dt> &lsquo;<samp>Yellow</samp>&rsquo;</dt>
2090 <dd><p>0xFFFF00
2091 </p></dd>
2092 <dt> &lsquo;<samp>YellowGreen</samp>&rsquo;</dt>
2093 <dd><p>0x9ACD32
2094 </p></dd>
2095 </dl>
2096
2097 <p><a name="channel-layout-syntax"></a>
2098 </p><a name="Channel-Layout"></a>
2099 <h2 class="section"><a href="ffplay-all.html#toc-Channel-Layout">4.8 Channel Layout</a></h2>
2100
2101 <p>A channel layout specifies the spatial disposition of the channels in
2102 a multi-channel audio stream. To specify a channel layout, FFmpeg
2103 makes use of a special syntax.
2104 </p>
2105 <p>Individual channels are identified by an id, as given by the table
2106 below:
2107 </p><dl compact="compact">
2108 <dt> &lsquo;<samp>FL</samp>&rsquo;</dt>
2109 <dd><p>front left
2110 </p></dd>
2111 <dt> &lsquo;<samp>FR</samp>&rsquo;</dt>
2112 <dd><p>front right
2113 </p></dd>
2114 <dt> &lsquo;<samp>FC</samp>&rsquo;</dt>
2115 <dd><p>front center
2116 </p></dd>
2117 <dt> &lsquo;<samp>LFE</samp>&rsquo;</dt>
2118 <dd><p>low frequency
2119 </p></dd>
2120 <dt> &lsquo;<samp>BL</samp>&rsquo;</dt>
2121 <dd><p>back left
2122 </p></dd>
2123 <dt> &lsquo;<samp>BR</samp>&rsquo;</dt>
2124 <dd><p>back right
2125 </p></dd>
2126 <dt> &lsquo;<samp>FLC</samp>&rsquo;</dt>
2127 <dd><p>front left-of-center
2128 </p></dd>
2129 <dt> &lsquo;<samp>FRC</samp>&rsquo;</dt>
2130 <dd><p>front right-of-center
2131 </p></dd>
2132 <dt> &lsquo;<samp>BC</samp>&rsquo;</dt>
2133 <dd><p>back center
2134 </p></dd>
2135 <dt> &lsquo;<samp>SL</samp>&rsquo;</dt>
2136 <dd><p>side left
2137 </p></dd>
2138 <dt> &lsquo;<samp>SR</samp>&rsquo;</dt>
2139 <dd><p>side right
2140 </p></dd>
2141 <dt> &lsquo;<samp>TC</samp>&rsquo;</dt>
2142 <dd><p>top center
2143 </p></dd>
2144 <dt> &lsquo;<samp>TFL</samp>&rsquo;</dt>
2145 <dd><p>top front left
2146 </p></dd>
2147 <dt> &lsquo;<samp>TFC</samp>&rsquo;</dt>
2148 <dd><p>top front center
2149 </p></dd>
2150 <dt> &lsquo;<samp>TFR</samp>&rsquo;</dt>
2151 <dd><p>top front right
2152 </p></dd>
2153 <dt> &lsquo;<samp>TBL</samp>&rsquo;</dt>
2154 <dd><p>top back left
2155 </p></dd>
2156 <dt> &lsquo;<samp>TBC</samp>&rsquo;</dt>
2157 <dd><p>top back center
2158 </p></dd>
2159 <dt> &lsquo;<samp>TBR</samp>&rsquo;</dt>
2160 <dd><p>top back right
2161 </p></dd>
2162 <dt> &lsquo;<samp>DL</samp>&rsquo;</dt>
2163 <dd><p>downmix left
2164 </p></dd>
2165 <dt> &lsquo;<samp>DR</samp>&rsquo;</dt>
2166 <dd><p>downmix right
2167 </p></dd>
2168 <dt> &lsquo;<samp>WL</samp>&rsquo;</dt>
2169 <dd><p>wide left
2170 </p></dd>
2171 <dt> &lsquo;<samp>WR</samp>&rsquo;</dt>
2172 <dd><p>wide right
2173 </p></dd>
2174 <dt> &lsquo;<samp>SDL</samp>&rsquo;</dt>
2175 <dd><p>surround direct left
2176 </p></dd>
2177 <dt> &lsquo;<samp>SDR</samp>&rsquo;</dt>
2178 <dd><p>surround direct right
2179 </p></dd>
2180 <dt> &lsquo;<samp>LFE2</samp>&rsquo;</dt>
2181 <dd><p>low frequency 2
2182 </p></dd>
2183 </dl>
2184
2185 <p>Standard channel layout compositions can be specified by using the
2186 following identifiers:
2187 </p><dl compact="compact">
2188 <dt> &lsquo;<samp>mono</samp>&rsquo;</dt>
2189 <dd><p>FC
2190 </p></dd>
2191 <dt> &lsquo;<samp>stereo</samp>&rsquo;</dt>
2192 <dd><p>FL+FR
2193 </p></dd>
2194 <dt> &lsquo;<samp>2.1</samp>&rsquo;</dt>
2195 <dd><p>FL+FR+LFE
2196 </p></dd>
2197 <dt> &lsquo;<samp>3.0</samp>&rsquo;</dt>
2198 <dd><p>FL+FR+FC
2199 </p></dd>
2200 <dt> &lsquo;<samp>3.0(back)</samp>&rsquo;</dt>
2201 <dd><p>FL+FR+BC
2202 </p></dd>
2203 <dt> &lsquo;<samp>4.0</samp>&rsquo;</dt>
2204 <dd><p>FL+FR+FC+BC
2205 </p></dd>
2206 <dt> &lsquo;<samp>quad</samp>&rsquo;</dt>
2207 <dd><p>FL+FR+BL+BR
2208 </p></dd>
2209 <dt> &lsquo;<samp>quad(side)</samp>&rsquo;</dt>
2210 <dd><p>FL+FR+SL+SR
2211 </p></dd>
2212 <dt> &lsquo;<samp>3.1</samp>&rsquo;</dt>
2213 <dd><p>FL+FR+FC+LFE
2214 </p></dd>
2215 <dt> &lsquo;<samp>5.0</samp>&rsquo;</dt>
2216 <dd><p>FL+FR+FC+BL+BR
2217 </p></dd>
2218 <dt> &lsquo;<samp>5.0(side)</samp>&rsquo;</dt>
2219 <dd><p>FL+FR+FC+SL+SR
2220 </p></dd>
2221 <dt> &lsquo;<samp>4.1</samp>&rsquo;</dt>
2222 <dd><p>FL+FR+FC+LFE+BC
2223 </p></dd>
2224 <dt> &lsquo;<samp>5.1</samp>&rsquo;</dt>
2225 <dd><p>FL+FR+FC+LFE+BL+BR
2226 </p></dd>
2227 <dt> &lsquo;<samp>5.1(side)</samp>&rsquo;</dt>
2228 <dd><p>FL+FR+FC+LFE+SL+SR
2229 </p></dd>
2230 <dt> &lsquo;<samp>6.0</samp>&rsquo;</dt>
2231 <dd><p>FL+FR+FC+BC+SL+SR
2232 </p></dd>
2233 <dt> &lsquo;<samp>6.0(front)</samp>&rsquo;</dt>
2234 <dd><p>FL+FR+FLC+FRC+SL+SR
2235 </p></dd>
2236 <dt> &lsquo;<samp>hexagonal</samp>&rsquo;</dt>
2237 <dd><p>FL+FR+FC+BL+BR+BC
2238 </p></dd>
2239 <dt> &lsquo;<samp>6.1</samp>&rsquo;</dt>
2240 <dd><p>FL+FR+FC+LFE+BC+SL+SR
2241 </p></dd>
2242 <dt> &lsquo;<samp>6.1</samp>&rsquo;</dt>
2243 <dd><p>FL+FR+FC+LFE+BL+BR+BC
2244 </p></dd>
2245 <dt> &lsquo;<samp>6.1(front)</samp>&rsquo;</dt>
2246 <dd><p>FL+FR+LFE+FLC+FRC+SL+SR
2247 </p></dd>
2248 <dt> &lsquo;<samp>7.0</samp>&rsquo;</dt>
2249 <dd><p>FL+FR+FC+BL+BR+SL+SR
2250 </p></dd>
2251 <dt> &lsquo;<samp>7.0(front)</samp>&rsquo;</dt>
2252 <dd><p>FL+FR+FC+FLC+FRC+SL+SR
2253 </p></dd>
2254 <dt> &lsquo;<samp>7.1</samp>&rsquo;</dt>
2255 <dd><p>FL+FR+FC+LFE+BL+BR+SL+SR
2256 </p></dd>
2257 <dt> &lsquo;<samp>7.1(wide)</samp>&rsquo;</dt>
2258 <dd><p>FL+FR+FC+LFE+BL+BR+FLC+FRC
2259 </p></dd>
2260 <dt> &lsquo;<samp>7.1(wide-side)</samp>&rsquo;</dt>
2261 <dd><p>FL+FR+FC+LFE+FLC+FRC+SL+SR
2262 </p></dd>
2263 <dt> &lsquo;<samp>octagonal</samp>&rsquo;</dt>
2264 <dd><p>FL+FR+FC+BL+BR+BC+SL+SR
2265 </p></dd>
2266 <dt> &lsquo;<samp>downmix</samp>&rsquo;</dt>
2267 <dd><p>DL+DR
2268 </p></dd>
2269 </dl>
2270
2271 <p>A custom channel layout can be specified as a sequence of terms, separated by
2272 &rsquo;+&rsquo; or &rsquo;|&rsquo;. Each term can be:
2273 </p><ul>
2274 <li>
2275 the name of a standard channel layout (e.g. &lsquo;<samp>mono</samp>&rsquo;,
2276 &lsquo;<samp>stereo</samp>&rsquo;, &lsquo;<samp>4.0</samp>&rsquo;, &lsquo;<samp>quad</samp>&rsquo;, &lsquo;<samp>5.0</samp>&rsquo;, etc.)
2277
2278 </li><li>
2279 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.)
2280
2281 </li><li>
2282 a number of channels, in decimal, optionally followed by &rsquo;c&rsquo;, yielding
2283 the default channel layout for that number of channels (see the
2284 function <code>av_get_default_channel_layout</code>)
2285
2286 </li><li>
2287 a channel layout mask, in hexadecimal starting with &quot;0x&quot; (see the
2288 <code>AV_CH_*</code> macros in &lsquo;<tt>libavutil/channel_layout.h</tt>&rsquo;.
2289 </li></ul>
2290
2291 <p>Starting from libavutil version 53 the trailing character &quot;c&quot; to
2292 specify a number of channels will be required, while a channel layout
2293 mask could also be specified as a decimal number (if and only if not
2294 followed by &quot;c&quot;).
2295 </p>
2296 <p>See also the function <code>av_get_channel_layout</code> defined in
2297 &lsquo;<tt>libavutil/channel_layout.h</tt>&rsquo;.
2298 </p>
2299 <a name="Expression-Evaluation"></a>
2300 <h1 class="chapter"><a href="ffplay-all.html#toc-Expression-Evaluation">5. Expression Evaluation</a></h1>
2301
2302 <p>When evaluating an arithmetic expression, FFmpeg uses an internal
2303 formula evaluator, implemented through the &lsquo;<tt>libavutil/eval.h</tt>&rsquo;
2304 interface.
2305 </p>
2306 <p>An expression may contain unary, binary operators, constants, and
2307 functions.
2308 </p>
2309 <p>Two expressions <var>expr1</var> and <var>expr2</var> can be combined to form
2310 another expression &quot;<var>expr1</var>;<var>expr2</var>&quot;.
2311 <var>expr1</var> and <var>expr2</var> are evaluated in turn, and the new
2312 expression evaluates to the value of <var>expr2</var>.
2313 </p>
2314 <p>The following binary operators are available: <code>+</code>, <code>-</code>,
2315 <code>*</code>, <code>/</code>, <code>^</code>.
2316 </p>
2317 <p>The following unary operators are available: <code>+</code>, <code>-</code>.
2318 </p>
2319 <p>The following functions are available:
2320 </p><dl compact="compact">
2321 <dt> &lsquo;<samp>abs(x)</samp>&rsquo;</dt>
2322 <dd><p>Compute absolute value of <var>x</var>.
2323 </p>
2324 </dd>
2325 <dt> &lsquo;<samp>acos(x)</samp>&rsquo;</dt>
2326 <dd><p>Compute arccosine of <var>x</var>.
2327 </p>
2328 </dd>
2329 <dt> &lsquo;<samp>asin(x)</samp>&rsquo;</dt>
2330 <dd><p>Compute arcsine of <var>x</var>.
2331 </p>
2332 </dd>
2333 <dt> &lsquo;<samp>atan(x)</samp>&rsquo;</dt>
2334 <dd><p>Compute arctangent of <var>x</var>.
2335 </p>
2336 </dd>
2337 <dt> &lsquo;<samp>between(x, min, max)</samp>&rsquo;</dt>
2338 <dd><p>Return 1 if <var>x</var> is greater than or equal to <var>min</var> and lesser than or
2339 equal to <var>max</var>, 0 otherwise.
2340 </p>
2341 </dd>
2342 <dt> &lsquo;<samp>bitand(x, y)</samp>&rsquo;</dt>
2343 <dt> &lsquo;<samp>bitor(x, y)</samp>&rsquo;</dt>
2344 <dd><p>Compute bitwise and/or operation on <var>x</var> and <var>y</var>.
2345 </p>
2346 <p>The results of the evaluation of <var>x</var> and <var>y</var> are converted to
2347 integers before executing the bitwise operation.
2348 </p>
2349 <p>Note that both the conversion to integer and the conversion back to
2350 floating point can lose precision. Beware of unexpected results for
2351 large numbers (usually 2^53 and larger).
2352 </p>
2353 </dd>
2354 <dt> &lsquo;<samp>ceil(expr)</samp>&rsquo;</dt>
2355 <dd><p>Round the value of expression <var>expr</var> upwards to the nearest
2356 integer. For example, &quot;ceil(1.5)&quot; is &quot;2.0&quot;.
2357 </p>
2358 </dd>
2359 <dt> &lsquo;<samp>cos(x)</samp>&rsquo;</dt>
2360 <dd><p>Compute cosine of <var>x</var>.
2361 </p>
2362 </dd>
2363 <dt> &lsquo;<samp>cosh(x)</samp>&rsquo;</dt>
2364 <dd><p>Compute hyperbolic cosine of <var>x</var>.
2365 </p>
2366 </dd>
2367 <dt> &lsquo;<samp>eq(x, y)</samp>&rsquo;</dt>
2368 <dd><p>Return 1 if <var>x</var> and <var>y</var> are equivalent, 0 otherwise.
2369 </p>
2370 </dd>
2371 <dt> &lsquo;<samp>exp(x)</samp>&rsquo;</dt>
2372 <dd><p>Compute exponential of <var>x</var> (with base <code>e</code>, the Euler&rsquo;s number).
2373 </p>
2374 </dd>
2375 <dt> &lsquo;<samp>floor(expr)</samp>&rsquo;</dt>
2376 <dd><p>Round the value of expression <var>expr</var> downwards to the nearest
2377 integer. For example, &quot;floor(-1.5)&quot; is &quot;-2.0&quot;.
2378 </p>
2379 </dd>
2380 <dt> &lsquo;<samp>gauss(x)</samp>&rsquo;</dt>
2381 <dd><p>Compute Gauss function of <var>x</var>, corresponding to
2382 <code>exp(-x*x/2) / sqrt(2*PI)</code>.
2383 </p>
2384 </dd>
2385 <dt> &lsquo;<samp>gcd(x, y)</samp>&rsquo;</dt>
2386 <dd><p>Return the greatest common divisor of <var>x</var> and <var>y</var>. If both <var>x</var> and
2387 <var>y</var> are 0 or either or both are less than zero then behavior is undefined.
2388 </p>
2389 </dd>
2390 <dt> &lsquo;<samp>gt(x, y)</samp>&rsquo;</dt>
2391 <dd><p>Return 1 if <var>x</var> is greater than <var>y</var>, 0 otherwise.
2392 </p>
2393 </dd>
2394 <dt> &lsquo;<samp>gte(x, y)</samp>&rsquo;</dt>
2395 <dd><p>Return 1 if <var>x</var> is greater than or equal to <var>y</var>, 0 otherwise.
2396 </p>
2397 </dd>
2398 <dt> &lsquo;<samp>hypot(x, y)</samp>&rsquo;</dt>
2399 <dd><p>This function is similar to the C function with the same name; it returns
2400 &quot;sqrt(<var>x</var>*<var>x</var> + <var>y</var>*<var>y</var>)&quot;, the length of the hypotenuse of a
2401 right triangle with sides of length <var>x</var> and <var>y</var>, or the distance of the
2402 point (<var>x</var>, <var>y</var>) from the origin.
2403 </p>
2404 </dd>
2405 <dt> &lsquo;<samp>if(x, y)</samp>&rsquo;</dt>
2406 <dd><p>Evaluate <var>x</var>, and if the result is non-zero return the result of
2407 the evaluation of <var>y</var>, return 0 otherwise.
2408 </p>
2409 </dd>
2410 <dt> &lsquo;<samp>if(x, y, z)</samp>&rsquo;</dt>
2411 <dd><p>Evaluate <var>x</var>, and if the result is non-zero return the evaluation
2412 result of <var>y</var>, otherwise the evaluation result of <var>z</var>.
2413 </p>
2414 </dd>
2415 <dt> &lsquo;<samp>ifnot(x, y)</samp>&rsquo;</dt>
2416 <dd><p>Evaluate <var>x</var>, and if the result is zero return the result of the
2417 evaluation of <var>y</var>, return 0 otherwise.
2418 </p>
2419 </dd>
2420 <dt> &lsquo;<samp>ifnot(x, y, z)</samp>&rsquo;</dt>
2421 <dd><p>Evaluate <var>x</var>, and if the result is zero return the evaluation
2422 result of <var>y</var>, otherwise the evaluation result of <var>z</var>.
2423 </p>
2424 </dd>
2425 <dt> &lsquo;<samp>isinf(x)</samp>&rsquo;</dt>
2426 <dd><p>Return 1.0 if <var>x</var> is +/-INFINITY, 0.0 otherwise.
2427 </p>
2428 </dd>
2429 <dt> &lsquo;<samp>isnan(x)</samp>&rsquo;</dt>
2430 <dd><p>Return 1.0 if <var>x</var> is NAN, 0.0 otherwise.
2431 </p>
2432 </dd>
2433 <dt> &lsquo;<samp>ld(var)</samp>&rsquo;</dt>
2434 <dd><p>Allow to load the value of the internal variable with number
2435 <var>var</var>, which was previously stored with st(<var>var</var>, <var>expr</var>).
2436 The function returns the loaded value.
2437 </p>
2438 </dd>
2439 <dt> &lsquo;<samp>log(x)</samp>&rsquo;</dt>
2440 <dd><p>Compute natural logarithm of <var>x</var>.
2441 </p>
2442 </dd>
2443 <dt> &lsquo;<samp>lt(x, y)</samp>&rsquo;</dt>
2444 <dd><p>Return 1 if <var>x</var> is lesser than <var>y</var>, 0 otherwise.
2445 </p>
2446 </dd>
2447 <dt> &lsquo;<samp>lte(x, y)</samp>&rsquo;</dt>
2448 <dd><p>Return 1 if <var>x</var> is lesser than or equal to <var>y</var>, 0 otherwise.
2449 </p>
2450 </dd>
2451 <dt> &lsquo;<samp>max(x, y)</samp>&rsquo;</dt>
2452 <dd><p>Return the maximum between <var>x</var> and <var>y</var>.
2453 </p>
2454 </dd>
2455 <dt> &lsquo;<samp>min(x, y)</samp>&rsquo;</dt>
2456 <dd><p>Return the maximum between <var>x</var> and <var>y</var>.
2457 </p>
2458 </dd>
2459 <dt> &lsquo;<samp>mod(x, y)</samp>&rsquo;</dt>
2460 <dd><p>Compute the remainder of division of <var>x</var> by <var>y</var>.
2461 </p>
2462 </dd>
2463 <dt> &lsquo;<samp>not(expr)</samp>&rsquo;</dt>
2464 <dd><p>Return 1.0 if <var>expr</var> is zero, 0.0 otherwise.
2465 </p>
2466 </dd>
2467 <dt> &lsquo;<samp>pow(x, y)</samp>&rsquo;</dt>
2468 <dd><p>Compute the power of <var>x</var> elevated <var>y</var>, it is equivalent to
2469 &quot;(<var>x</var>)^(<var>y</var>)&quot;.
2470 </p>
2471 </dd>
2472 <dt> &lsquo;<samp>print(t)</samp>&rsquo;</dt>
2473 <dt> &lsquo;<samp>print(t, l)</samp>&rsquo;</dt>
2474 <dd><p>Print the value of expression <var>t</var> with loglevel <var>l</var>. If
2475 <var>l</var> is not specified then a default log level is used.
2476 Returns the value of the expression printed.
2477 </p>
2478 <p>Prints t with loglevel l
2479 </p>
2480 </dd>
2481 <dt> &lsquo;<samp>random(x)</samp>&rsquo;</dt>
2482 <dd><p>Return a pseudo random value between 0.0 and 1.0. <var>x</var> is the index of the
2483 internal variable which will be used to save the seed/state.
2484 </p>
2485 </dd>
2486 <dt> &lsquo;<samp>root(expr, max)</samp>&rsquo;</dt>
2487 <dd><p>Find an input value for which the function represented by <var>expr</var>
2488 with argument <var>ld(0)</var> is 0 in the interval 0..<var>max</var>.
2489 </p>
2490 <p>The expression in <var>expr</var> must denote a continuous function or the
2491 result is undefined.
2492 </p>
2493 <p><var>ld(0)</var> is used to represent the function input value, which means
2494 that the given expression will be evaluated multiple times with
2495 various input values that the expression can access through
2496 <code>ld(0)</code>. When the expression evaluates to 0 then the
2497 corresponding input value will be returned.
2498 </p>
2499 </dd>
2500 <dt> &lsquo;<samp>sin(x)</samp>&rsquo;</dt>
2501 <dd><p>Compute sine of <var>x</var>.
2502 </p>
2503 </dd>
2504 <dt> &lsquo;<samp>sinh(x)</samp>&rsquo;</dt>
2505 <dd><p>Compute hyperbolic sine of <var>x</var>.
2506 </p>
2507 </dd>
2508 <dt> &lsquo;<samp>sqrt(expr)</samp>&rsquo;</dt>
2509 <dd><p>Compute the square root of <var>expr</var>. This is equivalent to
2510 &quot;(<var>expr</var>)^.5&quot;.
2511 </p>
2512 </dd>
2513 <dt> &lsquo;<samp>squish(x)</samp>&rsquo;</dt>
2514 <dd><p>Compute expression <code>1/(1 + exp(4*x))</code>.
2515 </p>
2516 </dd>
2517 <dt> &lsquo;<samp>st(var, expr)</samp>&rsquo;</dt>
2518 <dd><p>Allow to store the value of the expression <var>expr</var> in an internal
2519 variable. <var>var</var> specifies the number of the variable where to
2520 store the value, and it is a value ranging from 0 to 9. The function
2521 returns the value stored in the internal variable.
2522 Note, Variables are currently not shared between expressions.
2523 </p>
2524 </dd>
2525 <dt> &lsquo;<samp>tan(x)</samp>&rsquo;</dt>
2526 <dd><p>Compute tangent of <var>x</var>.
2527 </p>
2528 </dd>
2529 <dt> &lsquo;<samp>tanh(x)</samp>&rsquo;</dt>
2530 <dd><p>Compute hyperbolic tangent of <var>x</var>.
2531 </p>
2532 </dd>
2533 <dt> &lsquo;<samp>taylor(expr, x)</samp>&rsquo;</dt>
2534 <dt> &lsquo;<samp>taylor(expr, x, id)</samp>&rsquo;</dt>
2535 <dd><p>Evaluate a Taylor series at <var>x</var>, given an expression representing
2536 the <code>ld(id)</code>-th derivative of a function at 0.
2537 </p>
2538 <p>When the series does not converge the result is undefined.
2539 </p>
2540 <p><var>ld(id)</var> is used to represent the derivative order in <var>expr</var>,
2541 which means that the given expression will be evaluated multiple times
2542 with various input values that the expression can access through
2543 <code>ld(id)</code>. If <var>id</var> is not specified then 0 is assumed.
2544 </p>
2545 <p>Note, when you have the derivatives at y instead of 0,
2546 <code>taylor(expr, x-y)</code> can be used.
2547 </p>
2548 </dd>
2549 <dt> &lsquo;<samp>time(0)</samp>&rsquo;</dt>
2550 <dd><p>Return the current (wallclock) time in seconds.
2551 </p>
2552 </dd>
2553 <dt> &lsquo;<samp>trunc(expr)</samp>&rsquo;</dt>
2554 <dd><p>Round the value of expression <var>expr</var> towards zero to the nearest
2555 integer. For example, &quot;trunc(-1.5)&quot; is &quot;-1.0&quot;.
2556 </p>
2557 </dd>
2558 <dt> &lsquo;<samp>while(cond, expr)</samp>&rsquo;</dt>
2559 <dd><p>Evaluate expression <var>expr</var> while the expression <var>cond</var> is
2560 non-zero, and returns the value of the last <var>expr</var> evaluation, or
2561 NAN if <var>cond</var> was always false.
2562 </p></dd>
2563 </dl>
2564
2565 <p>The following constants are available:
2566 </p><dl compact="compact">
2567 <dt> &lsquo;<samp>PI</samp>&rsquo;</dt>
2568 <dd><p>area of the unit disc, approximately 3.14
2569 </p></dd>
2570 <dt> &lsquo;<samp>E</samp>&rsquo;</dt>
2571 <dd><p>exp(1) (Euler&rsquo;s number), approximately 2.718
2572 </p></dd>
2573 <dt> &lsquo;<samp>PHI</samp>&rsquo;</dt>
2574 <dd><p>golden ratio (1+sqrt(5))/2, approximately 1.618
2575 </p></dd>
2576 </dl>
2577
2578 <p>Assuming that an expression is considered &quot;true&quot; if it has a non-zero
2579 value, note that:
2580 </p>
2581 <p><code>*</code> works like AND
2582 </p>
2583 <p><code>+</code> works like OR
2584 </p>
2585 <p>For example the construct:
2586 </p><table><tr><td>&nbsp;</td><td><pre class="example">if (A AND B) then C
2587 </pre></td></tr></table>
2588 <p>is equivalent to:
2589 </p><table><tr><td>&nbsp;</td><td><pre class="example">if(A*B, C)
2590 </pre></td></tr></table>
2591
2592 <p>In your C code, you can extend the list of unary and binary functions,
2593 and define recognized constants, so that they are available for your
2594 expressions.
2595 </p>
2596 <p>The evaluator also recognizes the International System unit prefixes.
2597 If &rsquo;i&rsquo; is appended after the prefix, binary prefixes are used, which
2598 are based on powers of 1024 instead of powers of 1000.
2599 The &rsquo;B&rsquo; postfix multiplies the value by 8, and can be appended after a
2600 unit prefix or used alone. This allows using for example &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;,
2601 &rsquo;G&rsquo; and &rsquo;B&rsquo; as number postfix.
2602 </p>
2603 <p>The list of available International System prefixes follows, with
2604 indication of the corresponding powers of 10 and of 2.
2605 </p><dl compact="compact">
2606 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
2607 <dd><p>10^-24 / 2^-80
2608 </p></dd>
2609 <dt> &lsquo;<samp>z</samp>&rsquo;</dt>
2610 <dd><p>10^-21 / 2^-70
2611 </p></dd>
2612 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
2613 <dd><p>10^-18 / 2^-60
2614 </p></dd>
2615 <dt> &lsquo;<samp>f</samp>&rsquo;</dt>
2616 <dd><p>10^-15 / 2^-50
2617 </p></dd>
2618 <dt> &lsquo;<samp>p</samp>&rsquo;</dt>
2619 <dd><p>10^-12 / 2^-40
2620 </p></dd>
2621 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
2622 <dd><p>10^-9 / 2^-30
2623 </p></dd>
2624 <dt> &lsquo;<samp>u</samp>&rsquo;</dt>
2625 <dd><p>10^-6 / 2^-20
2626 </p></dd>
2627 <dt> &lsquo;<samp>m</samp>&rsquo;</dt>
2628 <dd><p>10^-3 / 2^-10
2629 </p></dd>
2630 <dt> &lsquo;<samp>c</samp>&rsquo;</dt>
2631 <dd><p>10^-2
2632 </p></dd>
2633 <dt> &lsquo;<samp>d</samp>&rsquo;</dt>
2634 <dd><p>10^-1
2635 </p></dd>
2636 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
2637 <dd><p>10^2
2638 </p></dd>
2639 <dt> &lsquo;<samp>k</samp>&rsquo;</dt>
2640 <dd><p>10^3 / 2^10
2641 </p></dd>
2642 <dt> &lsquo;<samp>K</samp>&rsquo;</dt>
2643 <dd><p>10^3 / 2^10
2644 </p></dd>
2645 <dt> &lsquo;<samp>M</samp>&rsquo;</dt>
2646 <dd><p>10^6 / 2^20
2647 </p></dd>
2648 <dt> &lsquo;<samp>G</samp>&rsquo;</dt>
2649 <dd><p>10^9 / 2^30
2650 </p></dd>
2651 <dt> &lsquo;<samp>T</samp>&rsquo;</dt>
2652 <dd><p>10^12 / 2^40
2653 </p></dd>
2654 <dt> &lsquo;<samp>P</samp>&rsquo;</dt>
2655 <dd><p>10^15 / 2^40
2656 </p></dd>
2657 <dt> &lsquo;<samp>E</samp>&rsquo;</dt>
2658 <dd><p>10^18 / 2^50
2659 </p></dd>
2660 <dt> &lsquo;<samp>Z</samp>&rsquo;</dt>
2661 <dd><p>10^21 / 2^60
2662 </p></dd>
2663 <dt> &lsquo;<samp>Y</samp>&rsquo;</dt>
2664 <dd><p>10^24 / 2^70
2665 </p></dd>
2666 </dl>
2667
2668
2669 <a name="OpenCL-Options"></a>
2670 <h1 class="chapter"><a href="ffplay-all.html#toc-OpenCL-Options">6. OpenCL Options</a></h1>
2671
2672 <p>When FFmpeg is configured with <code>--enable-opencl</code>, it is possible
2673 to set the options for the global OpenCL context.
2674 </p>
2675 <p>The list of supported options follows:
2676 </p>
2677 <dl compact="compact">
2678 <dt> &lsquo;<samp>build_options</samp>&rsquo;</dt>
2679 <dd><p>Set build options used to compile the registered kernels.
2680 </p>
2681 <p>See reference &quot;OpenCL Specification Version: 1.2 chapter 5.6.4&quot;.
2682 </p>
2683 </dd>
2684 <dt> &lsquo;<samp>platform_idx</samp>&rsquo;</dt>
2685 <dd><p>Select the index of the platform to run OpenCL code.
2686 </p>
2687 <p>The specified index must be one of the indexes in the device list
2688 which can be obtained with <code>ffmpeg -opencl_bench</code> or <code>av_opencl_get_device_list()</code>.
2689 </p>
2690 </dd>
2691 <dt> &lsquo;<samp>device_idx</samp>&rsquo;</dt>
2692 <dd><p>Select the index of the device used to run OpenCL code.
2693 </p>
2694 <p>The specified index must be one of the indexes in the device list which
2695 can be obtained with <code>ffmpeg -opencl_bench</code> or <code>av_opencl_get_device_list()</code>.
2696 </p>
2697 </dd>
2698 </dl>
2699
2700 <p><a name="codec_002doptions"></a>
2701 </p><a name="Codec-Options"></a>
2702 <h1 class="chapter"><a href="ffplay-all.html#toc-Codec-Options">7. Codec Options</a></h1>
2703
2704 <p>libavcodec provides some generic global options, which can be set on
2705 all the encoders and decoders. In addition each codec may support
2706 so-called private options, which are specific for a given codec.
2707 </p>
2708 <p>Sometimes, a global option may only affect a specific kind of codec,
2709 and may be unsensical or ignored by another, so you need to be aware
2710 of the meaning of the specified options. Also some options are
2711 meant only for decoding or encoding.
2712 </p>
2713 <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
2714 FFmpeg tools, or by setting the value explicitly in the
2715 <code>AVCodecContext</code> options or using the &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API
2716 for programmatic use.
2717 </p>
2718 <p>The list of supported options follow:
2719 </p>
2720 <dl compact="compact">
2721 <dt> &lsquo;<samp>b <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
2722 <dd><p>Set bitrate in bits/s. Default value is 200K.
2723 </p>
2724 </dd>
2725 <dt> &lsquo;<samp>ab <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
2726 <dd><p>Set audio bitrate (in bits/s). Default value is 128K.
2727 </p>
2728 </dd>
2729 <dt> &lsquo;<samp>bt <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
2730 <dd><p>Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate
2731 tolerance specifies how far ratecontrol is willing to deviate from the
2732 target average bitrate value. This is not related to min/max
2733 bitrate. Lowering tolerance too much has an adverse effect on quality.
2734 </p>
2735 </dd>
2736 <dt> &lsquo;<samp>flags <var>flags</var> (<em>decoding/encoding,audio,video,subtitles</em>)</samp>&rsquo;</dt>
2737 <dd><p>Set generic flags.
2738 </p>
2739 <p>Possible values:
2740 </p><dl compact="compact">
2741 <dt> &lsquo;<samp>mv4</samp>&rsquo;</dt>
2742 <dd><p>Use four motion vector by macroblock (mpeg4).
2743 </p></dd>
2744 <dt> &lsquo;<samp>qpel</samp>&rsquo;</dt>
2745 <dd><p>Use 1/4 pel motion compensation.
2746 </p></dd>
2747 <dt> &lsquo;<samp>loop</samp>&rsquo;</dt>
2748 <dd><p>Use loop filter.
2749 </p></dd>
2750 <dt> &lsquo;<samp>qscale</samp>&rsquo;</dt>
2751 <dd><p>Use fixed qscale.
2752 </p></dd>
2753 <dt> &lsquo;<samp>gmc</samp>&rsquo;</dt>
2754 <dd><p>Use gmc.
2755 </p></dd>
2756 <dt> &lsquo;<samp>mv0</samp>&rsquo;</dt>
2757 <dd><p>Always try a mb with mv=&lt;0,0&gt;.
2758 </p></dd>
2759 <dt> &lsquo;<samp>input_preserved</samp>&rsquo;</dt>
2760 <dt> &lsquo;<samp>pass1</samp>&rsquo;</dt>
2761 <dd><p>Use internal 2pass ratecontrol in first pass mode.
2762 </p></dd>
2763 <dt> &lsquo;<samp>pass2</samp>&rsquo;</dt>
2764 <dd><p>Use internal 2pass ratecontrol in second pass mode.
2765 </p></dd>
2766 <dt> &lsquo;<samp>gray</samp>&rsquo;</dt>
2767 <dd><p>Only decode/encode grayscale.
2768 </p></dd>
2769 <dt> &lsquo;<samp>emu_edge</samp>&rsquo;</dt>
2770 <dd><p>Do not draw edges.
2771 </p></dd>
2772 <dt> &lsquo;<samp>psnr</samp>&rsquo;</dt>
2773 <dd><p>Set error[?] variables during encoding.
2774 </p></dd>
2775 <dt> &lsquo;<samp>truncated</samp>&rsquo;</dt>
2776 <dt> &lsquo;<samp>naq</samp>&rsquo;</dt>
2777 <dd><p>Normalize adaptive quantization.
2778 </p></dd>
2779 <dt> &lsquo;<samp>ildct</samp>&rsquo;</dt>
2780 <dd><p>Use interlaced DCT.
2781 </p></dd>
2782 <dt> &lsquo;<samp>low_delay</samp>&rsquo;</dt>
2783 <dd><p>Force low delay.
2784 </p></dd>
2785 <dt> &lsquo;<samp>global_header</samp>&rsquo;</dt>
2786 <dd><p>Place global headers in extradata instead of every keyframe.
2787 </p></dd>
2788 <dt> &lsquo;<samp>bitexact</samp>&rsquo;</dt>
2789 <dd><p>Use only bitexact stuff (except (I)DCT).
2790 </p></dd>
2791 <dt> &lsquo;<samp>aic</samp>&rsquo;</dt>
2792 <dd><p>Apply H263 advanced intra coding / mpeg4 ac prediction.
2793 </p></dd>
2794 <dt> &lsquo;<samp>cbp</samp>&rsquo;</dt>
2795 <dd><p>Deprecated, use mpegvideo private options instead.
2796 </p></dd>
2797 <dt> &lsquo;<samp>qprd</samp>&rsquo;</dt>
2798 <dd><p>Deprecated, use mpegvideo private options instead.
2799 </p></dd>
2800 <dt> &lsquo;<samp>ilme</samp>&rsquo;</dt>
2801 <dd><p>Apply interlaced motion estimation.
2802 </p></dd>
2803 <dt> &lsquo;<samp>cgop</samp>&rsquo;</dt>
2804 <dd><p>Use closed gop.
2805 </p></dd>
2806 </dl>
2807
2808 </dd>
2809 <dt> &lsquo;<samp>me_method <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
2810 <dd><p>Set motion estimation method.
2811 </p>
2812 <p>Possible values:
2813 </p><dl compact="compact">
2814 <dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
2815 <dd><p>zero motion estimation (fastest)
2816 </p></dd>
2817 <dt> &lsquo;<samp>full</samp>&rsquo;</dt>
2818 <dd><p>full motion estimation (slowest)
2819 </p></dd>
2820 <dt> &lsquo;<samp>epzs</samp>&rsquo;</dt>
2821 <dd><p>EPZS motion estimation (default)
2822 </p></dd>
2823 <dt> &lsquo;<samp>esa</samp>&rsquo;</dt>
2824 <dd><p>esa motion estimation (alias for full)
2825 </p></dd>
2826 <dt> &lsquo;<samp>tesa</samp>&rsquo;</dt>
2827 <dd><p>tesa motion estimation
2828 </p></dd>
2829 <dt> &lsquo;<samp>dia</samp>&rsquo;</dt>
2830 <dd><p>dia motion estimation (alias for epzs)
2831 </p></dd>
2832 <dt> &lsquo;<samp>log</samp>&rsquo;</dt>
2833 <dd><p>log motion estimation
2834 </p></dd>
2835 <dt> &lsquo;<samp>phods</samp>&rsquo;</dt>
2836 <dd><p>phods motion estimation
2837 </p></dd>
2838 <dt> &lsquo;<samp>x1</samp>&rsquo;</dt>
2839 <dd><p>X1 motion estimation
2840 </p></dd>
2841 <dt> &lsquo;<samp>hex</samp>&rsquo;</dt>
2842 <dd><p>hex motion estimation
2843 </p></dd>
2844 <dt> &lsquo;<samp>umh</samp>&rsquo;</dt>
2845 <dd><p>umh motion estimation
2846 </p></dd>
2847 <dt> &lsquo;<samp>iter</samp>&rsquo;</dt>
2848 <dd><p>iter motion estimation
2849 </p></dd>
2850 </dl>
2851
2852 </dd>
2853 <dt> &lsquo;<samp>extradata_size <var>integer</var></samp>&rsquo;</dt>
2854 <dd><p>Set extradata size.
2855 </p>
2856 </dd>
2857 <dt> &lsquo;<samp>time_base <var>rational number</var></samp>&rsquo;</dt>
2858 <dd><p>Set codec time base.
2859 </p>
2860 <p>It is the fundamental unit of time (in seconds) in terms of which
2861 frame timestamps are represented. For fixed-fps content, timebase
2862 should be <code>1 / frame_rate</code> and timestamp increments should be
2863 identically 1.
2864 </p>
2865 </dd>
2866 <dt> &lsquo;<samp>g <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
2867 <dd><p>Set the group of picture size. Default value is 12.
2868 </p>
2869 </dd>
2870 <dt> &lsquo;<samp>ar <var>integer</var> (<em>decoding/encoding,audio</em>)</samp>&rsquo;</dt>
2871 <dd><p>Set audio sampling rate (in Hz).
2872 </p>
2873 </dd>
2874 <dt> &lsquo;<samp>ac <var>integer</var> (<em>decoding/encoding,audio</em>)</samp>&rsquo;</dt>
2875 <dd><p>Set number of audio channels.
2876 </p>
2877 </dd>
2878 <dt> &lsquo;<samp>cutoff <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
2879 <dd><p>Set cutoff bandwidth.
2880 </p>
2881 </dd>
2882 <dt> &lsquo;<samp>frame_size <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
2883 <dd><p>Set audio frame size.
2884 </p>
2885 <p>Each submitted frame except the last must contain exactly frame_size
2886 samples per channel. May be 0 when the codec has
2887 CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not
2888 restricted. It is set by some decoders to indicate constant frame
2889 size.
2890 </p>
2891 </dd>
2892 <dt> &lsquo;<samp>frame_number <var>integer</var></samp>&rsquo;</dt>
2893 <dd><p>Set the frame number.
2894 </p>
2895 </dd>
2896 <dt> &lsquo;<samp>delay <var>integer</var></samp>&rsquo;</dt>
2897 <dt> &lsquo;<samp>qcomp <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
2898 <dd><p>Set video quantizer scale compression (VBR). It is used as a constant
2899 in the ratecontrol equation. Recommended range for default rc_eq:
2900 0.0-1.0.
2901 </p>
2902 </dd>
2903 <dt> &lsquo;<samp>qblur <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
2904 <dd><p>Set video quantizer scale blur (VBR).
2905 </p>
2906 </dd>
2907 <dt> &lsquo;<samp>qmin <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
2908 <dd><p>Set min video quantizer scale (VBR). Must be included between -1 and
2909 69, default value is 2.
2910 </p>
2911 </dd>
2912 <dt> &lsquo;<samp>qmax <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
2913 <dd><p>Set max video quantizer scale (VBR). Must be included between -1 and
2914 1024, default value is 31.
2915 </p>
2916 </dd>
2917 <dt> &lsquo;<samp>qdiff <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
2918 <dd><p>Set max difference between the quantizer scale (VBR).
2919 </p>
2920 </dd>
2921 <dt> &lsquo;<samp>bf <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
2922 <dd><p>Set max number of B frames between non-B-frames.
2923 </p>
2924 <p>Must be an integer between -1 and 16. 0 means that B-frames are
2925 disabled. If a value of -1 is used, it will choose an automatic value
2926 depending on the encoder.
2927 </p>
2928 <p>Default value is 0.
2929 </p>
2930 </dd>
2931 <dt> &lsquo;<samp>b_qfactor <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
2932 <dd><p>Set qp factor between P and B frames.
2933 </p>
2934 </dd>
2935 <dt> &lsquo;<samp>rc_strategy <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
2936 <dd><p>Set ratecontrol method.
2937 </p>
2938 </dd>
2939 <dt> &lsquo;<samp>b_strategy <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
2940 <dd><p>Set strategy to choose between I/P/B-frames.
2941 </p>
2942 </dd>
2943 <dt> &lsquo;<samp>ps <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
2944 <dd><p>Set RTP payload size in bytes.
2945 </p>
2946 </dd>
2947 <dt> &lsquo;<samp>mv_bits <var>integer</var></samp>&rsquo;</dt>
2948 <dt> &lsquo;<samp>header_bits <var>integer</var></samp>&rsquo;</dt>
2949 <dt> &lsquo;<samp>i_tex_bits <var>integer</var></samp>&rsquo;</dt>
2950 <dt> &lsquo;<samp>p_tex_bits <var>integer</var></samp>&rsquo;</dt>
2951 <dt> &lsquo;<samp>i_count <var>integer</var></samp>&rsquo;</dt>
2952 <dt> &lsquo;<samp>p_count <var>integer</var></samp>&rsquo;</dt>
2953 <dt> &lsquo;<samp>skip_count <var>integer</var></samp>&rsquo;</dt>
2954 <dt> &lsquo;<samp>misc_bits <var>integer</var></samp>&rsquo;</dt>
2955 <dt> &lsquo;<samp>frame_bits <var>integer</var></samp>&rsquo;</dt>
2956 <dt> &lsquo;<samp>codec_tag <var>integer</var></samp>&rsquo;</dt>
2957 <dt> &lsquo;<samp>bug <var>flags</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
2958 <dd><p>Workaround not auto detected encoder bugs.
2959 </p>
2960 <p>Possible values:
2961 </p><dl compact="compact">
2962 <dt> &lsquo;<samp>autodetect</samp>&rsquo;</dt>
2963 <dt> &lsquo;<samp>old_msmpeg4</samp>&rsquo;</dt>
2964 <dd><p>some old lavc generated msmpeg4v3 files (no autodetection)
2965 </p></dd>
2966 <dt> &lsquo;<samp>xvid_ilace</samp>&rsquo;</dt>
2967 <dd><p>Xvid interlacing bug (autodetected if fourcc==XVIX)
2968 </p></dd>
2969 <dt> &lsquo;<samp>ump4</samp>&rsquo;</dt>
2970 <dd><p>(autodetected if fourcc==UMP4)
2971 </p></dd>
2972 <dt> &lsquo;<samp>no_padding</samp>&rsquo;</dt>
2973 <dd><p>padding bug (autodetected)
2974 </p></dd>
2975 <dt> &lsquo;<samp>amv</samp>&rsquo;</dt>
2976 <dt> &lsquo;<samp>ac_vlc</samp>&rsquo;</dt>
2977 <dd><p>illegal vlc bug (autodetected per fourcc)
2978 </p></dd>
2979 <dt> &lsquo;<samp>qpel_chroma</samp>&rsquo;</dt>
2980 <dt> &lsquo;<samp>std_qpel</samp>&rsquo;</dt>
2981 <dd><p>old standard qpel (autodetected per fourcc/version)
2982 </p></dd>
2983 <dt> &lsquo;<samp>qpel_chroma2</samp>&rsquo;</dt>
2984 <dt> &lsquo;<samp>direct_blocksize</samp>&rsquo;</dt>
2985 <dd><p>direct-qpel-blocksize bug (autodetected per fourcc/version)
2986 </p></dd>
2987 <dt> &lsquo;<samp>edge</samp>&rsquo;</dt>
2988 <dd><p>edge padding bug (autodetected per fourcc/version)
2989 </p></dd>
2990 <dt> &lsquo;<samp>hpel_chroma</samp>&rsquo;</dt>
2991 <dt> &lsquo;<samp>dc_clip</samp>&rsquo;</dt>
2992 <dt> &lsquo;<samp>ms</samp>&rsquo;</dt>
2993 <dd><p>Workaround various bugs in microsoft broken decoders.
2994 </p></dd>
2995 <dt> &lsquo;<samp>trunc</samp>&rsquo;</dt>
2996 <dd><p>trancated frames
2997 </p></dd>
2998 </dl>
2999
3000 </dd>
3001 <dt> &lsquo;<samp>lelim <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3002 <dd><p>Set single coefficient elimination threshold for luminance (negative
3003 values also consider DC coefficient).
3004 </p>
3005 </dd>
3006 <dt> &lsquo;<samp>celim <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3007 <dd><p>Set single coefficient elimination threshold for chrominance (negative
3008 values also consider dc coefficient)
3009 </p>
3010 </dd>
3011 <dt> &lsquo;<samp>strict <var>integer</var> (<em>decoding/encoding,audio,video</em>)</samp>&rsquo;</dt>
3012 <dd><p>Specify how strictly to follow the standards.
3013 </p>
3014 <p>Possible values:
3015 </p><dl compact="compact">
3016 <dt> &lsquo;<samp>very</samp>&rsquo;</dt>
3017 <dd><p>strictly conform to a older more strict version of the spec or reference software
3018 </p></dd>
3019 <dt> &lsquo;<samp>strict</samp>&rsquo;</dt>
3020 <dd><p>strictly conform to all the things in the spec no matter what consequences
3021 </p></dd>
3022 <dt> &lsquo;<samp>normal</samp>&rsquo;</dt>
3023 <dt> &lsquo;<samp>unofficial</samp>&rsquo;</dt>
3024 <dd><p>allow unofficial extensions
3025 </p></dd>
3026 <dt> &lsquo;<samp>experimental</samp>&rsquo;</dt>
3027 <dd><p>allow non standardized experimental things, experimental
3028 (unfinished/work in progress/not well tested) decoders and encoders.
3029 Note: experimental decoders can pose a security risk, do not use this for
3030 decoding untrusted input.
3031 </p></dd>
3032 </dl>
3033
3034 </dd>
3035 <dt> &lsquo;<samp>b_qoffset <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3036 <dd><p>Set QP offset between P and B frames.
3037 </p>
3038 </dd>
3039 <dt> &lsquo;<samp>err_detect <var>flags</var> (<em>decoding,audio,video</em>)</samp>&rsquo;</dt>
3040 <dd><p>Set error detection flags.
3041 </p>
3042 <p>Possible values:
3043 </p><dl compact="compact">
3044 <dt> &lsquo;<samp>crccheck</samp>&rsquo;</dt>
3045 <dd><p>verify embedded CRCs
3046 </p></dd>
3047 <dt> &lsquo;<samp>bitstream</samp>&rsquo;</dt>
3048 <dd><p>detect bitstream specification deviations
3049 </p></dd>
3050 <dt> &lsquo;<samp>buffer</samp>&rsquo;</dt>
3051 <dd><p>detect improper bitstream length
3052 </p></dd>
3053 <dt> &lsquo;<samp>explode</samp>&rsquo;</dt>
3054 <dd><p>abort decoding on minor error detection
3055 </p></dd>
3056 <dt> &lsquo;<samp>careful</samp>&rsquo;</dt>
3057 <dd><p>consider things that violate the spec and have not been seen in the wild as errors
3058 </p></dd>
3059 <dt> &lsquo;<samp>compliant</samp>&rsquo;</dt>
3060 <dd><p>consider all spec non compliancies as errors
3061 </p></dd>
3062 <dt> &lsquo;<samp>aggressive</samp>&rsquo;</dt>
3063 <dd><p>consider things that a sane encoder should not do as an error
3064 </p></dd>
3065 </dl>
3066
3067 </dd>
3068 <dt> &lsquo;<samp>has_b_frames <var>integer</var></samp>&rsquo;</dt>
3069 <dt> &lsquo;<samp>block_align <var>integer</var></samp>&rsquo;</dt>
3070 <dt> &lsquo;<samp>mpeg_quant <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3071 <dd><p>Use MPEG quantizers instead of H.263.
3072 </p>
3073 </dd>
3074 <dt> &lsquo;<samp>qsquish <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3075 <dd><p>How to keep quantizer between qmin and qmax (0 = clip, 1 = use
3076 differentiable function).
3077 </p>
3078 </dd>
3079 <dt> &lsquo;<samp>rc_qmod_amp <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3080 <dd><p>Set experimental quantizer modulation.
3081 </p>
3082 </dd>
3083 <dt> &lsquo;<samp>rc_qmod_freq <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3084 <dd><p>Set experimental quantizer modulation.
3085 </p>
3086 </dd>
3087 <dt> &lsquo;<samp>rc_override_count <var>integer</var></samp>&rsquo;</dt>
3088 <dt> &lsquo;<samp>rc_eq <var>string</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3089 <dd><p>Set rate control equation. When computing the expression, besides the
3090 standard functions defined in the section &rsquo;Expression Evaluation&rsquo;, the
3091 following functions are available: bits2qp(bits), qp2bits(qp). Also
3092 the following constants are available: iTex pTex tex mv fCode iCount
3093 mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex
3094 avgTex.
3095 </p>
3096 </dd>
3097 <dt> &lsquo;<samp>maxrate <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
3098 <dd><p>Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
3099 </p>
3100 </dd>
3101 <dt> &lsquo;<samp>minrate <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
3102 <dd><p>Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR
3103 encode. It is of little use elsewise.
3104 </p>
3105 </dd>
3106 <dt> &lsquo;<samp>bufsize <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
3107 <dd><p>Set ratecontrol buffer size (in bits).
3108 </p>
3109 </dd>
3110 <dt> &lsquo;<samp>rc_buf_aggressivity <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3111 <dd><p>Currently useless.
3112 </p>
3113 </dd>
3114 <dt> &lsquo;<samp>i_qfactor <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3115 <dd><p>Set QP factor between P and I frames.
3116 </p>
3117 </dd>
3118 <dt> &lsquo;<samp>i_qoffset <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3119 <dd><p>Set QP offset between P and I frames.
3120 </p>
3121 </dd>
3122 <dt> &lsquo;<samp>rc_init_cplx <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3123 <dd><p>Set initial complexity for 1-pass encoding.
3124 </p>
3125 </dd>
3126 <dt> &lsquo;<samp>dct <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3127 <dd><p>Set DCT algorithm.
3128 </p>
3129 <p>Possible values:
3130 </p><dl compact="compact">
3131 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
3132 <dd><p>autoselect a good one (default)
3133 </p></dd>
3134 <dt> &lsquo;<samp>fastint</samp>&rsquo;</dt>
3135 <dd><p>fast integer
3136 </p></dd>
3137 <dt> &lsquo;<samp>int</samp>&rsquo;</dt>
3138 <dd><p>accurate integer
3139 </p></dd>
3140 <dt> &lsquo;<samp>mmx</samp>&rsquo;</dt>
3141 <dt> &lsquo;<samp>altivec</samp>&rsquo;</dt>
3142 <dt> &lsquo;<samp>faan</samp>&rsquo;</dt>
3143 <dd><p>floating point AAN DCT
3144 </p></dd>
3145 </dl>
3146
3147 </dd>
3148 <dt> &lsquo;<samp>lumi_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3149 <dd><p>Compress bright areas stronger than medium ones.
3150 </p>
3151 </dd>
3152 <dt> &lsquo;<samp>tcplx_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3153 <dd><p>Set temporal complexity masking.
3154 </p>
3155 </dd>
3156 <dt> &lsquo;<samp>scplx_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3157 <dd><p>Set spatial complexity masking.
3158 </p>
3159 </dd>
3160 <dt> &lsquo;<samp>p_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3161 <dd><p>Set inter masking.
3162 </p>
3163 </dd>
3164 <dt> &lsquo;<samp>dark_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3165 <dd><p>Compress dark areas stronger than medium ones.
3166 </p>
3167 </dd>
3168 <dt> &lsquo;<samp>idct <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
3169 <dd><p>Select IDCT implementation.
3170 </p>
3171 <p>Possible values:
3172 </p><dl compact="compact">
3173 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
3174 <dt> &lsquo;<samp>int</samp>&rsquo;</dt>
3175 <dt> &lsquo;<samp>simple</samp>&rsquo;</dt>
3176 <dt> &lsquo;<samp>simplemmx</samp>&rsquo;</dt>
3177 <dt> &lsquo;<samp>arm</samp>&rsquo;</dt>
3178 <dt> &lsquo;<samp>altivec</samp>&rsquo;</dt>
3179 <dt> &lsquo;<samp>sh4</samp>&rsquo;</dt>
3180 <dt> &lsquo;<samp>simplearm</samp>&rsquo;</dt>
3181 <dt> &lsquo;<samp>simplearmv5te</samp>&rsquo;</dt>
3182 <dt> &lsquo;<samp>simplearmv6</samp>&rsquo;</dt>
3183 <dt> &lsquo;<samp>simpleneon</samp>&rsquo;</dt>
3184 <dt> &lsquo;<samp>simplealpha</samp>&rsquo;</dt>
3185 <dt> &lsquo;<samp>ipp</samp>&rsquo;</dt>
3186 <dt> &lsquo;<samp>xvidmmx</samp>&rsquo;</dt>
3187 <dt> &lsquo;<samp>faani</samp>&rsquo;</dt>
3188 <dd><p>floating point AAN IDCT
3189 </p></dd>
3190 </dl>
3191
3192 </dd>
3193 <dt> &lsquo;<samp>slice_count <var>integer</var></samp>&rsquo;</dt>
3194 <dt> &lsquo;<samp>ec <var>flags</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
3195 <dd><p>Set error concealment strategy.
3196 </p>
3197 <p>Possible values:
3198 </p><dl compact="compact">
3199 <dt> &lsquo;<samp>guess_mvs</samp>&rsquo;</dt>
3200 <dd><p>iterative motion vector (MV) search (slow)
3201 </p></dd>
3202 <dt> &lsquo;<samp>deblock</samp>&rsquo;</dt>
3203 <dd><p>use strong deblock filter for damaged MBs
3204 </p></dd>
3205 </dl>
3206
3207 </dd>
3208 <dt> &lsquo;<samp>bits_per_coded_sample <var>integer</var></samp>&rsquo;</dt>
3209 <dt> &lsquo;<samp>pred <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3210 <dd><p>Set prediction method.
3211 </p>
3212 <p>Possible values:
3213 </p><dl compact="compact">
3214 <dt> &lsquo;<samp>left</samp>&rsquo;</dt>
3215 <dt> &lsquo;<samp>plane</samp>&rsquo;</dt>
3216 <dt> &lsquo;<samp>median</samp>&rsquo;</dt>
3217 </dl>
3218
3219 </dd>
3220 <dt> &lsquo;<samp>aspect <var>rational number</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3221 <dd><p>Set sample aspect ratio.
3222 </p>
3223 </dd>
3224 <dt> &lsquo;<samp>debug <var>flags</var> (<em>decoding/encoding,audio,video,subtitles</em>)</samp>&rsquo;</dt>
3225 <dd><p>Print specific debug info.
3226 </p>
3227 <p>Possible values:
3228 </p><dl compact="compact">
3229 <dt> &lsquo;<samp>pict</samp>&rsquo;</dt>
3230 <dd><p>picture info
3231 </p></dd>
3232 <dt> &lsquo;<samp>rc</samp>&rsquo;</dt>
3233 <dd><p>rate control
3234 </p></dd>
3235 <dt> &lsquo;<samp>bitstream</samp>&rsquo;</dt>
3236 <dt> &lsquo;<samp>mb_type</samp>&rsquo;</dt>
3237 <dd><p>macroblock (MB) type
3238 </p></dd>
3239 <dt> &lsquo;<samp>qp</samp>&rsquo;</dt>
3240 <dd><p>per-block quantization parameter (QP)
3241 </p></dd>
3242 <dt> &lsquo;<samp>mv</samp>&rsquo;</dt>
3243 <dd><p>motion vector
3244 </p></dd>
3245 <dt> &lsquo;<samp>dct_coeff</samp>&rsquo;</dt>
3246 <dt> &lsquo;<samp>skip</samp>&rsquo;</dt>
3247 <dt> &lsquo;<samp>startcode</samp>&rsquo;</dt>
3248 <dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
3249 <dt> &lsquo;<samp>er</samp>&rsquo;</dt>
3250 <dd><p>error recognition
3251 </p></dd>
3252 <dt> &lsquo;<samp>mmco</samp>&rsquo;</dt>
3253 <dd><p>memory management control operations (H.264)
3254 </p></dd>
3255 <dt> &lsquo;<samp>bugs</samp>&rsquo;</dt>
3256 <dt> &lsquo;<samp>vis_qp</samp>&rsquo;</dt>
3257 <dd><p>visualize quantization parameter (QP), lower QP are tinted greener
3258 </p></dd>
3259 <dt> &lsquo;<samp>vis_mb_type</samp>&rsquo;</dt>
3260 <dd><p>visualize block types
3261 </p></dd>
3262 <dt> &lsquo;<samp>buffers</samp>&rsquo;</dt>
3263 <dd><p>picture buffer allocations
3264 </p></dd>
3265 <dt> &lsquo;<samp>thread_ops</samp>&rsquo;</dt>
3266 <dd><p>threading operations
3267 </p></dd>
3268 </dl>
3269
3270 </dd>
3271 <dt> &lsquo;<samp>vismv <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
3272 <dd><p>Visualize motion vectors (MVs).
3273 </p>
3274 <p>Possible values:
3275 </p><dl compact="compact">
3276 <dt> &lsquo;<samp>pf</samp>&rsquo;</dt>
3277 <dd><p>forward predicted MVs of P-frames
3278 </p></dd>
3279 <dt> &lsquo;<samp>bf</samp>&rsquo;</dt>
3280 <dd><p>forward predicted MVs of B-frames
3281 </p></dd>
3282 <dt> &lsquo;<samp>bb</samp>&rsquo;</dt>
3283 <dd><p>backward predicted MVs of B-frames
3284 </p></dd>
3285 </dl>
3286
3287 </dd>
3288 <dt> &lsquo;<samp>cmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3289 <dd><p>Set full pel me compare function.
3290 </p>
3291 <p>Possible values:
3292 </p><dl compact="compact">
3293 <dt> &lsquo;<samp>sad</samp>&rsquo;</dt>
3294 <dd><p>sum of absolute differences, fast (default)
3295 </p></dd>
3296 <dt> &lsquo;<samp>sse</samp>&rsquo;</dt>
3297 <dd><p>sum of squared errors
3298 </p></dd>
3299 <dt> &lsquo;<samp>satd</samp>&rsquo;</dt>
3300 <dd><p>sum of absolute Hadamard transformed differences
3301 </p></dd>
3302 <dt> &lsquo;<samp>dct</samp>&rsquo;</dt>
3303 <dd><p>sum of absolute DCT transformed differences
3304 </p></dd>
3305 <dt> &lsquo;<samp>psnr</samp>&rsquo;</dt>
3306 <dd><p>sum of squared quantization errors (avoid, low quality)
3307 </p></dd>
3308 <dt> &lsquo;<samp>bit</samp>&rsquo;</dt>
3309 <dd><p>number of bits needed for the block
3310 </p></dd>
3311 <dt> &lsquo;<samp>rd</samp>&rsquo;</dt>
3312 <dd><p>rate distortion optimal, slow
3313 </p></dd>
3314 <dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
3315 <dd><p>0
3316 </p></dd>
3317 <dt> &lsquo;<samp>vsad</samp>&rsquo;</dt>
3318 <dd><p>sum of absolute vertical differences
3319 </p></dd>
3320 <dt> &lsquo;<samp>vsse</samp>&rsquo;</dt>
3321 <dd><p>sum of squared vertical differences
3322 </p></dd>
3323 <dt> &lsquo;<samp>nsse</samp>&rsquo;</dt>
3324 <dd><p>noise preserving sum of squared differences
3325 </p></dd>
3326 <dt> &lsquo;<samp>w53</samp>&rsquo;</dt>
3327 <dd><p>5/3 wavelet, only used in snow
3328 </p></dd>
3329 <dt> &lsquo;<samp>w97</samp>&rsquo;</dt>
3330 <dd><p>9/7 wavelet, only used in snow
3331 </p></dd>
3332 <dt> &lsquo;<samp>dctmax</samp>&rsquo;</dt>
3333 <dt> &lsquo;<samp>chroma</samp>&rsquo;</dt>
3334 </dl>
3335
3336 </dd>
3337 <dt> &lsquo;<samp>subcmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3338 <dd><p>Set sub pel me compare function.
3339 </p>
3340 <p>Possible values:
3341 </p><dl compact="compact">
3342 <dt> &lsquo;<samp>sad</samp>&rsquo;</dt>
3343 <dd><p>sum of absolute differences, fast (default)
3344 </p></dd>
3345 <dt> &lsquo;<samp>sse</samp>&rsquo;</dt>
3346 <dd><p>sum of squared errors
3347 </p></dd>
3348 <dt> &lsquo;<samp>satd</samp>&rsquo;</dt>
3349 <dd><p>sum of absolute Hadamard transformed differences
3350 </p></dd>
3351 <dt> &lsquo;<samp>dct</samp>&rsquo;</dt>
3352 <dd><p>sum of absolute DCT transformed differences
3353 </p></dd>
3354 <dt> &lsquo;<samp>psnr</samp>&rsquo;</dt>
3355 <dd><p>sum of squared quantization errors (avoid, low quality)
3356 </p></dd>
3357 <dt> &lsquo;<samp>bit</samp>&rsquo;</dt>
3358 <dd><p>number of bits needed for the block
3359 </p></dd>
3360 <dt> &lsquo;<samp>rd</samp>&rsquo;</dt>
3361 <dd><p>rate distortion optimal, slow
3362 </p></dd>
3363 <dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
3364 <dd><p>0
3365 </p></dd>
3366 <dt> &lsquo;<samp>vsad</samp>&rsquo;</dt>
3367 <dd><p>sum of absolute vertical differences
3368 </p></dd>
3369 <dt> &lsquo;<samp>vsse</samp>&rsquo;</dt>
3370 <dd><p>sum of squared vertical differences
3371 </p></dd>
3372 <dt> &lsquo;<samp>nsse</samp>&rsquo;</dt>
3373 <dd><p>noise preserving sum of squared differences
3374 </p></dd>
3375 <dt> &lsquo;<samp>w53</samp>&rsquo;</dt>
3376 <dd><p>5/3 wavelet, only used in snow
3377 </p></dd>
3378 <dt> &lsquo;<samp>w97</samp>&rsquo;</dt>
3379 <dd><p>9/7 wavelet, only used in snow
3380 </p></dd>
3381 <dt> &lsquo;<samp>dctmax</samp>&rsquo;</dt>
3382 <dt> &lsquo;<samp>chroma</samp>&rsquo;</dt>
3383 </dl>
3384
3385 </dd>
3386 <dt> &lsquo;<samp>mbcmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3387 <dd><p>Set macroblock compare function.
3388 </p>
3389 <p>Possible values:
3390 </p><dl compact="compact">
3391 <dt> &lsquo;<samp>sad</samp>&rsquo;</dt>
3392 <dd><p>sum of absolute differences, fast (default)
3393 </p></dd>
3394 <dt> &lsquo;<samp>sse</samp>&rsquo;</dt>
3395 <dd><p>sum of squared errors
3396 </p></dd>
3397 <dt> &lsquo;<samp>satd</samp>&rsquo;</dt>
3398 <dd><p>sum of absolute Hadamard transformed differences
3399 </p></dd>
3400 <dt> &lsquo;<samp>dct</samp>&rsquo;</dt>
3401 <dd><p>sum of absolute DCT transformed differences
3402 </p></dd>
3403 <dt> &lsquo;<samp>psnr</samp>&rsquo;</dt>
3404 <dd><p>sum of squared quantization errors (avoid, low quality)
3405 </p></dd>
3406 <dt> &lsquo;<samp>bit</samp>&rsquo;</dt>
3407 <dd><p>number of bits needed for the block
3408 </p></dd>
3409 <dt> &lsquo;<samp>rd</samp>&rsquo;</dt>
3410 <dd><p>rate distortion optimal, slow
3411 </p></dd>
3412 <dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
3413 <dd><p>0
3414 </p></dd>
3415 <dt> &lsquo;<samp>vsad</samp>&rsquo;</dt>
3416 <dd><p>sum of absolute vertical differences
3417 </p></dd>
3418 <dt> &lsquo;<samp>vsse</samp>&rsquo;</dt>
3419 <dd><p>sum of squared vertical differences
3420 </p></dd>
3421 <dt> &lsquo;<samp>nsse</samp>&rsquo;</dt>
3422 <dd><p>noise preserving sum of squared differences
3423 </p></dd>
3424 <dt> &lsquo;<samp>w53</samp>&rsquo;</dt>
3425 <dd><p>5/3 wavelet, only used in snow
3426 </p></dd>
3427 <dt> &lsquo;<samp>w97</samp>&rsquo;</dt>
3428 <dd><p>9/7 wavelet, only used in snow
3429 </p></dd>
3430 <dt> &lsquo;<samp>dctmax</samp>&rsquo;</dt>
3431 <dt> &lsquo;<samp>chroma</samp>&rsquo;</dt>
3432 </dl>
3433
3434 </dd>
3435 <dt> &lsquo;<samp>ildctcmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3436 <dd><p>Set interlaced dct compare function.
3437 </p>
3438 <p>Possible values:
3439 </p><dl compact="compact">
3440 <dt> &lsquo;<samp>sad</samp>&rsquo;</dt>
3441 <dd><p>sum of absolute differences, fast (default)
3442 </p></dd>
3443 <dt> &lsquo;<samp>sse</samp>&rsquo;</dt>
3444 <dd><p>sum of squared errors
3445 </p></dd>
3446 <dt> &lsquo;<samp>satd</samp>&rsquo;</dt>
3447 <dd><p>sum of absolute Hadamard transformed differences
3448 </p></dd>
3449 <dt> &lsquo;<samp>dct</samp>&rsquo;</dt>
3450 <dd><p>sum of absolute DCT transformed differences
3451 </p></dd>
3452 <dt> &lsquo;<samp>psnr</samp>&rsquo;</dt>
3453 <dd><p>sum of squared quantization errors (avoid, low quality)
3454 </p></dd>
3455 <dt> &lsquo;<samp>bit</samp>&rsquo;</dt>
3456 <dd><p>number of bits needed for the block
3457 </p></dd>
3458 <dt> &lsquo;<samp>rd</samp>&rsquo;</dt>
3459 <dd><p>rate distortion optimal, slow
3460 </p></dd>
3461 <dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
3462 <dd><p>0
3463 </p></dd>
3464 <dt> &lsquo;<samp>vsad</samp>&rsquo;</dt>
3465 <dd><p>sum of absolute vertical differences
3466 </p></dd>
3467 <dt> &lsquo;<samp>vsse</samp>&rsquo;</dt>
3468 <dd><p>sum of squared vertical differences
3469 </p></dd>
3470 <dt> &lsquo;<samp>nsse</samp>&rsquo;</dt>
3471 <dd><p>noise preserving sum of squared differences
3472 </p></dd>
3473 <dt> &lsquo;<samp>w53</samp>&rsquo;</dt>
3474 <dd><p>5/3 wavelet, only used in snow
3475 </p></dd>
3476 <dt> &lsquo;<samp>w97</samp>&rsquo;</dt>
3477 <dd><p>9/7 wavelet, only used in snow
3478 </p></dd>
3479 <dt> &lsquo;<samp>dctmax</samp>&rsquo;</dt>
3480 <dt> &lsquo;<samp>chroma</samp>&rsquo;</dt>
3481 </dl>
3482
3483 </dd>
3484 <dt> &lsquo;<samp>dia_size <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3485 <dd><p>Set diamond type &amp; size for motion estimation.
3486 </p>
3487 </dd>
3488 <dt> &lsquo;<samp>last_pred <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3489 <dd><p>Set amount of motion predictors from the previous frame.
3490 </p>
3491 </dd>
3492 <dt> &lsquo;<samp>preme <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3493 <dd><p>Set pre motion estimation.
3494 </p>
3495 </dd>
3496 <dt> &lsquo;<samp>precmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3497 <dd><p>Set pre motion estimation compare function.
3498 </p>
3499 <p>Possible values:
3500 </p><dl compact="compact">
3501 <dt> &lsquo;<samp>sad</samp>&rsquo;</dt>
3502 <dd><p>sum of absolute differences, fast (default)
3503 </p></dd>
3504 <dt> &lsquo;<samp>sse</samp>&rsquo;</dt>
3505 <dd><p>sum of squared errors
3506 </p></dd>
3507 <dt> &lsquo;<samp>satd</samp>&rsquo;</dt>
3508 <dd><p>sum of absolute Hadamard transformed differences
3509 </p></dd>
3510 <dt> &lsquo;<samp>dct</samp>&rsquo;</dt>
3511 <dd><p>sum of absolute DCT transformed differences
3512 </p></dd>
3513 <dt> &lsquo;<samp>psnr</samp>&rsquo;</dt>
3514 <dd><p>sum of squared quantization errors (avoid, low quality)
3515 </p></dd>
3516 <dt> &lsquo;<samp>bit</samp>&rsquo;</dt>
3517 <dd><p>number of bits needed for the block
3518 </p></dd>
3519 <dt> &lsquo;<samp>rd</samp>&rsquo;</dt>
3520 <dd><p>rate distortion optimal, slow
3521 </p></dd>
3522 <dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
3523 <dd><p>0
3524 </p></dd>
3525 <dt> &lsquo;<samp>vsad</samp>&rsquo;</dt>
3526 <dd><p>sum of absolute vertical differences
3527 </p></dd>
3528 <dt> &lsquo;<samp>vsse</samp>&rsquo;</dt>
3529 <dd><p>sum of squared vertical differences
3530 </p></dd>
3531 <dt> &lsquo;<samp>nsse</samp>&rsquo;</dt>
3532 <dd><p>noise preserving sum of squared differences
3533 </p></dd>
3534 <dt> &lsquo;<samp>w53</samp>&rsquo;</dt>
3535 <dd><p>5/3 wavelet, only used in snow
3536 </p></dd>
3537 <dt> &lsquo;<samp>w97</samp>&rsquo;</dt>
3538 <dd><p>9/7 wavelet, only used in snow
3539 </p></dd>
3540 <dt> &lsquo;<samp>dctmax</samp>&rsquo;</dt>
3541 <dt> &lsquo;<samp>chroma</samp>&rsquo;</dt>
3542 </dl>
3543
3544 </dd>
3545 <dt> &lsquo;<samp>pre_dia_size <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3546 <dd><p>Set diamond type &amp; size for motion estimation pre-pass.
3547 </p>
3548 </dd>
3549 <dt> &lsquo;<samp>subq <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3550 <dd><p>Set sub pel motion estimation quality.
3551 </p>
3552 </dd>
3553 <dt> &lsquo;<samp>dtg_active_format <var>integer</var></samp>&rsquo;</dt>
3554 <dt> &lsquo;<samp>me_range <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3555 <dd><p>Set limit motion vectors range (1023 for DivX player).
3556 </p>
3557 </dd>
3558 <dt> &lsquo;<samp>ibias <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3559 <dd><p>Set intra quant bias.
3560 </p>
3561 </dd>
3562 <dt> &lsquo;<samp>pbias <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3563 <dd><p>Set inter quant bias.
3564 </p>
3565 </dd>
3566 <dt> &lsquo;<samp>color_table_id <var>integer</var></samp>&rsquo;</dt>
3567 <dt> &lsquo;<samp>global_quality <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
3568 <dt> &lsquo;<samp>coder <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3569 <dd>
3570 <p>Possible values:
3571 </p><dl compact="compact">
3572 <dt> &lsquo;<samp>vlc</samp>&rsquo;</dt>
3573 <dd><p>variable length coder / huffman coder
3574 </p></dd>
3575 <dt> &lsquo;<samp>ac</samp>&rsquo;</dt>
3576 <dd><p>arithmetic coder
3577 </p></dd>
3578 <dt> &lsquo;<samp>raw</samp>&rsquo;</dt>
3579 <dd><p>raw (no encoding)
3580 </p></dd>
3581 <dt> &lsquo;<samp>rle</samp>&rsquo;</dt>
3582 <dd><p>run-length coder
3583 </p></dd>
3584 <dt> &lsquo;<samp>deflate</samp>&rsquo;</dt>
3585 <dd><p>deflate-based coder
3586 </p></dd>
3587 </dl>
3588
3589 </dd>
3590 <dt> &lsquo;<samp>context <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3591 <dd><p>Set context model.
3592 </p>
3593 </dd>
3594 <dt> &lsquo;<samp>slice_flags <var>integer</var></samp>&rsquo;</dt>
3595 <dt> &lsquo;<samp>xvmc_acceleration <var>integer</var></samp>&rsquo;</dt>
3596 <dt> &lsquo;<samp>mbd <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3597 <dd><p>Set macroblock decision algorithm (high quality mode).
3598 </p>
3599 <p>Possible values:
3600 </p><dl compact="compact">
3601 <dt> &lsquo;<samp>simple</samp>&rsquo;</dt>
3602 <dd><p>use mbcmp (default)
3603 </p></dd>
3604 <dt> &lsquo;<samp>bits</samp>&rsquo;</dt>
3605 <dd><p>use fewest bits
3606 </p></dd>
3607 <dt> &lsquo;<samp>rd</samp>&rsquo;</dt>
3608 <dd><p>use best rate distortion
3609 </p></dd>
3610 </dl>
3611
3612 </dd>
3613 <dt> &lsquo;<samp>stream_codec_tag <var>integer</var></samp>&rsquo;</dt>
3614 <dt> &lsquo;<samp>sc_threshold <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3615 <dd><p>Set scene change threshold.
3616 </p>
3617 </dd>
3618 <dt> &lsquo;<samp>lmin <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3619 <dd><p>Set min lagrange factor (VBR).
3620 </p>
3621 </dd>
3622 <dt> &lsquo;<samp>lmax <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3623 <dd><p>Set max lagrange factor (VBR).
3624 </p>
3625 </dd>
3626 <dt> &lsquo;<samp>nr <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3627 <dd><p>Set noise reduction.
3628 </p>
3629 </dd>
3630 <dt> &lsquo;<samp>rc_init_occupancy <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3631 <dd><p>Set number of bits which should be loaded into the rc buffer before
3632 decoding starts.
3633 </p>
3634 </dd>
3635 <dt> &lsquo;<samp>flags2 <var>flags</var> (<em>decoding/encoding,audio,video</em>)</samp>&rsquo;</dt>
3636 <dd>
3637 <p>Possible values:
3638 </p><dl compact="compact">
3639 <dt> &lsquo;<samp>fast</samp>&rsquo;</dt>
3640 <dd><p>Allow non spec compliant speedup tricks.
3641 </p></dd>
3642 <dt> &lsquo;<samp>sgop</samp>&rsquo;</dt>
3643 <dd><p>Deprecated, use mpegvideo private options instead.
3644 </p></dd>
3645 <dt> &lsquo;<samp>noout</samp>&rsquo;</dt>
3646 <dd><p>Skip bitstream encoding.
3647 </p></dd>
3648 <dt> &lsquo;<samp>ignorecrop</samp>&rsquo;</dt>
3649 <dd><p>Ignore cropping information from sps.
3650 </p></dd>
3651 <dt> &lsquo;<samp>local_header</samp>&rsquo;</dt>
3652 <dd><p>Place global headers at every keyframe instead of in extradata.
3653 </p></dd>
3654 <dt> &lsquo;<samp>chunks</samp>&rsquo;</dt>
3655 <dd><p>Frame data might be split into multiple chunks.
3656 </p></dd>
3657 <dt> &lsquo;<samp>showall</samp>&rsquo;</dt>
3658 <dd><p>Show all frames before the first keyframe.
3659 </p></dd>
3660 <dt> &lsquo;<samp>skiprd</samp>&rsquo;</dt>
3661 <dd><p>Deprecated, use mpegvideo private options instead.
3662 </p></dd>
3663 </dl>
3664
3665 </dd>
3666 <dt> &lsquo;<samp>error <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3667 <dt> &lsquo;<samp>qns <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3668 <dd><p>Deprecated, use mpegvideo private options instead.
3669 </p>
3670 </dd>
3671 <dt> &lsquo;<samp>threads <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
3672 <dd>
3673 <p>Possible values:
3674 </p><dl compact="compact">
3675 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
3676 <dd><p>detect a good number of threads
3677 </p></dd>
3678 </dl>
3679
3680 </dd>
3681 <dt> &lsquo;<samp>me_threshold <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3682 <dd><p>Set motion estimation threshold.
3683 </p>
3684 </dd>
3685 <dt> &lsquo;<samp>mb_threshold <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3686 <dd><p>Set macroblock threshold.
3687 </p>
3688 </dd>
3689 <dt> &lsquo;<samp>dc <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3690 <dd><p>Set intra_dc_precision.
3691 </p>
3692 </dd>
3693 <dt> &lsquo;<samp>nssew <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3694 <dd><p>Set nsse weight.
3695 </p>
3696 </dd>
3697 <dt> &lsquo;<samp>skip_top <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
3698 <dd><p>Set number of macroblock rows at the top which are skipped.
3699 </p>
3700 </dd>
3701 <dt> &lsquo;<samp>skip_bottom <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
3702 <dd><p>Set number of macroblock rows at the bottom which are skipped.
3703 </p>
3704 </dd>
3705 <dt> &lsquo;<samp>profile <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
3706 <dd>
3707 <p>Possible values:
3708 </p><dl compact="compact">
3709 <dt> &lsquo;<samp>unknown</samp>&rsquo;</dt>
3710 <dt> &lsquo;<samp>aac_main</samp>&rsquo;</dt>
3711 <dt> &lsquo;<samp>aac_low</samp>&rsquo;</dt>
3712 <dt> &lsquo;<samp>aac_ssr</samp>&rsquo;</dt>
3713 <dt> &lsquo;<samp>aac_ltp</samp>&rsquo;</dt>
3714 <dt> &lsquo;<samp>aac_he</samp>&rsquo;</dt>
3715 <dt> &lsquo;<samp>aac_he_v2</samp>&rsquo;</dt>
3716 <dt> &lsquo;<samp>aac_ld</samp>&rsquo;</dt>
3717 <dt> &lsquo;<samp>aac_eld</samp>&rsquo;</dt>
3718 <dt> &lsquo;<samp>mpeg2_aac_low</samp>&rsquo;</dt>
3719 <dt> &lsquo;<samp>mpeg2_aac_he</samp>&rsquo;</dt>
3720 <dt> &lsquo;<samp>dts</samp>&rsquo;</dt>
3721 <dt> &lsquo;<samp>dts_es</samp>&rsquo;</dt>
3722 <dt> &lsquo;<samp>dts_96_24</samp>&rsquo;</dt>
3723 <dt> &lsquo;<samp>dts_hd_hra</samp>&rsquo;</dt>
3724 <dt> &lsquo;<samp>dts_hd_ma</samp>&rsquo;</dt>
3725 </dl>
3726
3727 </dd>
3728 <dt> &lsquo;<samp>level <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
3729 <dd>
3730 <p>Possible values:
3731 </p><dl compact="compact">
3732 <dt> &lsquo;<samp>unknown</samp>&rsquo;</dt>
3733 </dl>
3734
3735 </dd>
3736 <dt> &lsquo;<samp>lowres <var>integer</var> (<em>decoding,audio,video</em>)</samp>&rsquo;</dt>
3737 <dd><p>Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
3738 </p>
3739 </dd>
3740 <dt> &lsquo;<samp>skip_threshold <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3741 <dd><p>Set frame skip threshold.
3742 </p>
3743 </dd>
3744 <dt> &lsquo;<samp>skip_factor <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3745 <dd><p>Set frame skip factor.
3746 </p>
3747 </dd>
3748 <dt> &lsquo;<samp>skip_exp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3749 <dd><p>Set frame skip exponent.
3750 Negative values behave identical to the corresponding positive ones, except
3751 that the score is normalized.
3752 Positive values exist primarly for compatibility reasons and are not so useful.
3753 </p>
3754 </dd>
3755 <dt> &lsquo;<samp>skipcmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3756 <dd><p>Set frame skip compare function.
3757 </p>
3758 <p>Possible values:
3759 </p><dl compact="compact">
3760 <dt> &lsquo;<samp>sad</samp>&rsquo;</dt>
3761 <dd><p>sum of absolute differences, fast (default)
3762 </p></dd>
3763 <dt> &lsquo;<samp>sse</samp>&rsquo;</dt>
3764 <dd><p>sum of squared errors
3765 </p></dd>
3766 <dt> &lsquo;<samp>satd</samp>&rsquo;</dt>
3767 <dd><p>sum of absolute Hadamard transformed differences
3768 </p></dd>
3769 <dt> &lsquo;<samp>dct</samp>&rsquo;</dt>
3770 <dd><p>sum of absolute DCT transformed differences
3771 </p></dd>
3772 <dt> &lsquo;<samp>psnr</samp>&rsquo;</dt>
3773 <dd><p>sum of squared quantization errors (avoid, low quality)
3774 </p></dd>
3775 <dt> &lsquo;<samp>bit</samp>&rsquo;</dt>
3776 <dd><p>number of bits needed for the block
3777 </p></dd>
3778 <dt> &lsquo;<samp>rd</samp>&rsquo;</dt>
3779 <dd><p>rate distortion optimal, slow
3780 </p></dd>
3781 <dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
3782 <dd><p>0
3783 </p></dd>
3784 <dt> &lsquo;<samp>vsad</samp>&rsquo;</dt>
3785 <dd><p>sum of absolute vertical differences
3786 </p></dd>
3787 <dt> &lsquo;<samp>vsse</samp>&rsquo;</dt>
3788 <dd><p>sum of squared vertical differences
3789 </p></dd>
3790 <dt> &lsquo;<samp>nsse</samp>&rsquo;</dt>
3791 <dd><p>noise preserving sum of squared differences
3792 </p></dd>
3793 <dt> &lsquo;<samp>w53</samp>&rsquo;</dt>
3794 <dd><p>5/3 wavelet, only used in snow
3795 </p></dd>
3796 <dt> &lsquo;<samp>w97</samp>&rsquo;</dt>
3797 <dd><p>9/7 wavelet, only used in snow
3798 </p></dd>
3799 <dt> &lsquo;<samp>dctmax</samp>&rsquo;</dt>
3800 <dt> &lsquo;<samp>chroma</samp>&rsquo;</dt>
3801 </dl>
3802
3803 </dd>
3804 <dt> &lsquo;<samp>border_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3805 <dd><p>Increase the quantizer for macroblocks close to borders.
3806 </p>
3807 </dd>
3808 <dt> &lsquo;<samp>mblmin <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3809 <dd><p>Set min macroblock lagrange factor (VBR).
3810 </p>
3811 </dd>
3812 <dt> &lsquo;<samp>mblmax <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3813 <dd><p>Set max macroblock lagrange factor (VBR).
3814 </p>
3815 </dd>
3816 <dt> &lsquo;<samp>mepc <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3817 <dd><p>Set motion estimation bitrate penalty compensation (1.0 = 256).
3818 </p>
3819 </dd>
3820 <dt> &lsquo;<samp>skip_loop_filter <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
3821 <dt> &lsquo;<samp>skip_idct        <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
3822 <dt> &lsquo;<samp>skip_frame       <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
3823 <dd>
3824 <p>Make decoder discard processing depending on the frame type selected
3825 by the option value.
3826 </p>
3827 <p>&lsquo;<samp>skip_loop_filter</samp>&rsquo; skips frame loop filtering, &lsquo;<samp>skip_idct</samp>&rsquo;
3828 skips frame IDCT/dequantization, &lsquo;<samp>skip_frame</samp>&rsquo; skips decoding.
3829 </p>
3830 <p>Possible values:
3831 </p><dl compact="compact">
3832 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
3833 <dd><p>Discard no frame.
3834 </p>
3835 </dd>
3836 <dt> &lsquo;<samp>default</samp>&rsquo;</dt>
3837 <dd><p>Discard useless frames like 0-sized frames.
3838 </p>
3839 </dd>
3840 <dt> &lsquo;<samp>noref</samp>&rsquo;</dt>
3841 <dd><p>Discard all non-reference frames.
3842 </p>
3843 </dd>
3844 <dt> &lsquo;<samp>bidir</samp>&rsquo;</dt>
3845 <dd><p>Discard all bidirectional frames.
3846 </p>
3847 </dd>
3848 <dt> &lsquo;<samp>nokey</samp>&rsquo;</dt>
3849 <dd><p>Discard all frames excepts keyframes.
3850 </p>
3851 </dd>
3852 <dt> &lsquo;<samp>all</samp>&rsquo;</dt>
3853 <dd><p>Discard all frames.
3854 </p></dd>
3855 </dl>
3856
3857 <p>Default value is &lsquo;<samp>default</samp>&rsquo;.
3858 </p>
3859 </dd>
3860 <dt> &lsquo;<samp>bidir_refine <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3861 <dd><p>Refine the two motion vectors used in bidirectional macroblocks.
3862 </p>
3863 </dd>
3864 <dt> &lsquo;<samp>brd_scale <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3865 <dd><p>Downscale frames for dynamic B-frame decision.
3866 </p>
3867 </dd>
3868 <dt> &lsquo;<samp>keyint_min <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3869 <dd><p>Set minimum interval between IDR-frames.
3870 </p>
3871 </dd>
3872 <dt> &lsquo;<samp>refs <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3873 <dd><p>Set reference frames to consider for motion compensation.
3874 </p>
3875 </dd>
3876 <dt> &lsquo;<samp>chromaoffset <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3877 <dd><p>Set chroma qp offset from luma.
3878 </p>
3879 </dd>
3880 <dt> &lsquo;<samp>trellis <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
3881 <dd><p>Set rate-distortion optimal quantization.
3882 </p>
3883 </dd>
3884 <dt> &lsquo;<samp>sc_factor <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3885 <dd><p>Set value multiplied by qscale for each frame and added to
3886 scene_change_score.
3887 </p>
3888 </dd>
3889 <dt> &lsquo;<samp>mv0_threshold <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3890 <dt> &lsquo;<samp>b_sensitivity <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3891 <dd><p>Adjust sensitivity of b_frame_strategy 1.
3892 </p>
3893 </dd>
3894 <dt> &lsquo;<samp>compression_level <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
3895 <dt> &lsquo;<samp>min_prediction_order <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
3896 <dt> &lsquo;<samp>max_prediction_order <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
3897 <dt> &lsquo;<samp>timecode_frame_start <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3898 <dd><p>Set GOP timecode frame start number, in non drop frame format.
3899 </p>
3900 </dd>
3901 <dt> &lsquo;<samp>request_channels <var>integer</var> (<em>decoding,audio</em>)</samp>&rsquo;</dt>
3902 <dd><p>Set desired number of audio channels.
3903 </p>
3904 </dd>
3905 <dt> &lsquo;<samp>bits_per_raw_sample <var>integer</var></samp>&rsquo;</dt>
3906 <dt> &lsquo;<samp>channel_layout <var>integer</var> (<em>decoding/encoding,audio</em>)</samp>&rsquo;</dt>
3907 <dd>
3908 <p>Possible values:
3909 </p></dd>
3910 <dt> &lsquo;<samp>request_channel_layout <var>integer</var> (<em>decoding,audio</em>)</samp>&rsquo;</dt>
3911 <dd>
3912 <p>Possible values:
3913 </p></dd>
3914 <dt> &lsquo;<samp>rc_max_vbv_use <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3915 <dt> &lsquo;<samp>rc_min_vbv_use <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3916 <dt> &lsquo;<samp>ticks_per_frame <var>integer</var> (<em>decoding/encoding,audio,video</em>)</samp>&rsquo;</dt>
3917 <dt> &lsquo;<samp>color_primaries <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
3918 <dt> &lsquo;<samp>color_trc <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
3919 <dt> &lsquo;<samp>colorspace <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
3920 <dt> &lsquo;<samp>color_range <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
3921 <dt> &lsquo;<samp>chroma_sample_location <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
3922 <dt> &lsquo;<samp>log_level_offset <var>integer</var></samp>&rsquo;</dt>
3923 <dd><p>Set the log level offset.
3924 </p>
3925 </dd>
3926 <dt> &lsquo;<samp>slices <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3927 <dd><p>Number of slices, used in parallelized encoding.
3928 </p>
3929 </dd>
3930 <dt> &lsquo;<samp>thread_type <var>flags</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
3931 <dd><p>Select multithreading type.
3932 </p>
3933 <p>Possible values:
3934 </p><dl compact="compact">
3935 <dt> &lsquo;<samp>slice</samp>&rsquo;</dt>
3936 <dt> &lsquo;<samp>frame</samp>&rsquo;</dt>
3937 </dl>
3938 </dd>
3939 <dt> &lsquo;<samp>audio_service_type <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
3940 <dd><p>Set audio service type.
3941 </p>
3942 <p>Possible values:
3943 </p><dl compact="compact">
3944 <dt> &lsquo;<samp>ma</samp>&rsquo;</dt>
3945 <dd><p>Main Audio Service
3946 </p></dd>
3947 <dt> &lsquo;<samp>ef</samp>&rsquo;</dt>
3948 <dd><p>Effects
3949 </p></dd>
3950 <dt> &lsquo;<samp>vi</samp>&rsquo;</dt>
3951 <dd><p>Visually Impaired
3952 </p></dd>
3953 <dt> &lsquo;<samp>hi</samp>&rsquo;</dt>
3954 <dd><p>Hearing Impaired
3955 </p></dd>
3956 <dt> &lsquo;<samp>di</samp>&rsquo;</dt>
3957 <dd><p>Dialogue
3958 </p></dd>
3959 <dt> &lsquo;<samp>co</samp>&rsquo;</dt>
3960 <dd><p>Commentary
3961 </p></dd>
3962 <dt> &lsquo;<samp>em</samp>&rsquo;</dt>
3963 <dd><p>Emergency
3964 </p></dd>
3965 <dt> &lsquo;<samp>vo</samp>&rsquo;</dt>
3966 <dd><p>Voice Over
3967 </p></dd>
3968 <dt> &lsquo;<samp>ka</samp>&rsquo;</dt>
3969 <dd><p>Karaoke
3970 </p></dd>
3971 </dl>
3972
3973 </dd>
3974 <dt> &lsquo;<samp>request_sample_fmt <var>sample_fmt</var> (<em>decoding,audio</em>)</samp>&rsquo;</dt>
3975 <dd><p>Set sample format audio decoders should prefer. Default value is
3976 <code>none</code>.
3977 </p>
3978 </dd>
3979 <dt> &lsquo;<samp>pkt_timebase <var>rational number</var></samp>&rsquo;</dt>
3980 <dt> &lsquo;<samp>sub_charenc <var>encoding</var> (<em>decoding,subtitles</em>)</samp>&rsquo;</dt>
3981 <dd><p>Set the input subtitles character encoding.
3982 </p>
3983 </dd>
3984 <dt> &lsquo;<samp>field_order  <var>field_order</var> (<em>video</em>)</samp>&rsquo;</dt>
3985 <dd><p>Set/override the field order of the video.
3986 Possible values:
3987 </p><dl compact="compact">
3988 <dt> &lsquo;<samp>progressive</samp>&rsquo;</dt>
3989 <dd><p>Progressive video
3990 </p></dd>
3991 <dt> &lsquo;<samp>tt</samp>&rsquo;</dt>
3992 <dd><p>Interlaced video, top field coded and displayed first
3993 </p></dd>
3994 <dt> &lsquo;<samp>bb</samp>&rsquo;</dt>
3995 <dd><p>Interlaced video, bottom field coded and displayed first
3996 </p></dd>
3997 <dt> &lsquo;<samp>tb</samp>&rsquo;</dt>
3998 <dd><p>Interlaced video, top coded first, bottom displayed first
3999 </p></dd>
4000 <dt> &lsquo;<samp>bt</samp>&rsquo;</dt>
4001 <dd><p>Interlaced video, bottom coded first, top displayed first
4002 </p></dd>
4003 </dl>
4004
4005 </dd>
4006 <dt> &lsquo;<samp>skip_alpha <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
4007 <dd><p>Set to 1 to disable processing alpha (transparency). This works like the
4008 &lsquo;<samp>gray</samp>&rsquo; flag in the &lsquo;<samp>flags</samp>&rsquo; option which skips chroma information
4009 instead of alpha. Default is 0.
4010 </p></dd>
4011 </dl>
4012
4013
4014 <a name="Decoders"></a>
4015 <h1 class="chapter"><a href="ffplay-all.html#toc-Decoders">8. Decoders</a></h1>
4016
4017 <p>Decoders are configured elements in FFmpeg which allow the decoding of
4018 multimedia streams.
4019 </p>
4020 <p>When you configure your FFmpeg build, all the supported native decoders
4021 are enabled by default. Decoders requiring an external library must be enabled
4022 manually via the corresponding <code>--enable-lib</code> option. You can list all
4023 available decoders using the configure option <code>--list-decoders</code>.
4024 </p>
4025 <p>You can disable all the decoders with the configure option
4026 <code>--disable-decoders</code> and selectively enable / disable single decoders
4027 with the options <code>--enable-decoder=<var>DECODER</var></code> /
4028 <code>--disable-decoder=<var>DECODER</var></code>.
4029 </p>
4030 <p>The option <code>-decoders</code> of the ff* tools will display the list of
4031 enabled decoders.
4032 </p>
4033
4034 <a name="Video-Decoders"></a>
4035 <h1 class="chapter"><a href="ffplay-all.html#toc-Video-Decoders">9. Video Decoders</a></h1>
4036
4037 <p>A description of some of the currently available video decoders
4038 follows.
4039 </p>
4040 <a name="rawvideo-1"></a>
4041 <h2 class="section"><a href="ffplay-all.html#toc-rawvideo-1">9.1 rawvideo</a></h2>
4042
4043 <p>Raw video decoder.
4044 </p>
4045 <p>This decoder decodes rawvideo streams.
4046 </p>
4047 <a name="Options-7"></a>
4048 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-7">9.1.1 Options</a></h3>
4049
4050 <dl compact="compact">
4051 <dt> &lsquo;<samp>top <var>top_field_first</var></samp>&rsquo;</dt>
4052 <dd><p>Specify the assumed field type of the input video.
4053 </p><dl compact="compact">
4054 <dt> &lsquo;<samp>-1</samp>&rsquo;</dt>
4055 <dd><p>the video is assumed to be progressive (default)
4056 </p></dd>
4057 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
4058 <dd><p>bottom-field-first is assumed
4059 </p></dd>
4060 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
4061 <dd><p>top-field-first is assumed
4062 </p></dd>
4063 </dl>
4064
4065 </dd>
4066 </dl>
4067
4068
4069 <a name="Audio-Decoders"></a>
4070 <h1 class="chapter"><a href="ffplay-all.html#toc-Audio-Decoders">10. Audio Decoders</a></h1>
4071
4072 <p>A description of some of the currently available audio decoders
4073 follows.
4074 </p>
4075 <a name="ac3"></a>
4076 <h2 class="section"><a href="ffplay-all.html#toc-ac3">10.1 ac3</a></h2>
4077
4078 <p>AC-3 audio decoder.
4079 </p>
4080 <p>This decoder implements part of ATSC A/52:2010 and ETSI TS 102 366, as well as
4081 the undocumented RealAudio 3 (a.k.a. dnet).
4082 </p>
4083 <a name="AC_002d3-Decoder-Options"></a>
4084 <h3 class="subsection"><a href="ffplay-all.html#toc-AC_002d3-Decoder-Options">10.1.1 AC-3 Decoder Options</a></h3>
4085
4086 <dl compact="compact">
4087 <dt> &lsquo;<samp>-drc_scale <var>value</var></samp>&rsquo;</dt>
4088 <dd><p>Dynamic Range Scale Factor. The factor to apply to dynamic range values
4089 from the AC-3 stream. This factor is applied exponentially.
4090 There are 3 notable scale factor ranges:
4091 </p><dl compact="compact">
4092 <dt> &lsquo;<samp>drc_scale == 0</samp>&rsquo;</dt>
4093 <dd><p>DRC disabled. Produces full range audio.
4094 </p></dd>
4095 <dt> &lsquo;<samp>0 &lt; drc_scale &lt;= 1</samp>&rsquo;</dt>
4096 <dd><p>DRC enabled.  Applies a fraction of the stream DRC value.
4097 Audio reproduction is between full range and full compression.
4098 </p></dd>
4099 <dt> &lsquo;<samp>drc_scale &gt; 1</samp>&rsquo;</dt>
4100 <dd><p>DRC enabled. Applies drc_scale asymmetrically.
4101 Loud sounds are fully compressed.  Soft sounds are enhanced.
4102 </p></dd>
4103 </dl>
4104
4105 </dd>
4106 </dl>
4107
4108 <a name="ffwavesynth"></a>
4109 <h2 class="section"><a href="ffplay-all.html#toc-ffwavesynth">10.2 ffwavesynth</a></h2>
4110
4111 <p>Internal wave synthetizer.
4112 </p>
4113 <p>This decoder generates wave patterns according to predefined sequences. Its
4114 use is purely internal and the format of the data it accepts is not publicly
4115 documented.
4116 </p>
4117 <a name="libcelt"></a>
4118 <h2 class="section"><a href="ffplay-all.html#toc-libcelt">10.3 libcelt</a></h2>
4119
4120 <p>libcelt decoder wrapper.
4121 </p>
4122 <p>libcelt allows libavcodec to decode the Xiph CELT ultra-low delay audio codec.
4123 Requires the presence of the libcelt headers and library during configuration.
4124 You need to explicitly configure the build with <code>--enable-libcelt</code>.
4125 </p>
4126 <a name="libgsm"></a>
4127 <h2 class="section"><a href="ffplay-all.html#toc-libgsm">10.4 libgsm</a></h2>
4128
4129 <p>libgsm decoder wrapper.
4130 </p>
4131 <p>libgsm allows libavcodec to decode the GSM full rate audio codec. Requires
4132 the presence of the libgsm headers and library during configuration. You need
4133 to explicitly configure the build with <code>--enable-libgsm</code>.
4134 </p>
4135 <p>This decoder supports both the ordinary GSM and the Microsoft variant.
4136 </p>
4137 <a name="libilbc"></a>
4138 <h2 class="section"><a href="ffplay-all.html#toc-libilbc">10.5 libilbc</a></h2>
4139
4140 <p>libilbc decoder wrapper.
4141 </p>
4142 <p>libilbc allows libavcodec to decode the Internet Low Bitrate Codec (iLBC)
4143 audio codec. Requires the presence of the libilbc headers and library during
4144 configuration. You need to explicitly configure the build with
4145 <code>--enable-libilbc</code>.
4146 </p>
4147 <a name="Options-11"></a>
4148 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-11">10.5.1 Options</a></h3>
4149
4150 <p>The following option is supported by the libilbc wrapper.
4151 </p>
4152 <dl compact="compact">
4153 <dt> &lsquo;<samp>enhance</samp>&rsquo;</dt>
4154 <dd>
4155 <p>Enable the enhancement of the decoded audio when set to 1. The default
4156 value is 0 (disabled).
4157 </p>
4158 </dd>
4159 </dl>
4160
4161 <a name="libopencore_002damrnb"></a>
4162 <h2 class="section"><a href="ffplay-all.html#toc-libopencore_002damrnb">10.6 libopencore-amrnb</a></h2>
4163
4164 <p>libopencore-amrnb decoder wrapper.
4165 </p>
4166 <p>libopencore-amrnb allows libavcodec to decode the Adaptive Multi-Rate
4167 Narrowband audio codec. Using it requires the presence of the
4168 libopencore-amrnb headers and library during configuration. You need to
4169 explicitly configure the build with <code>--enable-libopencore-amrnb</code>.
4170 </p>
4171 <p>An FFmpeg native decoder for AMR-NB exists, so users can decode AMR-NB
4172 without this library.
4173 </p>
4174 <a name="libopencore_002damrwb"></a>
4175 <h2 class="section"><a href="ffplay-all.html#toc-libopencore_002damrwb">10.7 libopencore-amrwb</a></h2>
4176
4177 <p>libopencore-amrwb decoder wrapper.
4178 </p>
4179 <p>libopencore-amrwb allows libavcodec to decode the Adaptive Multi-Rate
4180 Wideband audio codec. Using it requires the presence of the
4181 libopencore-amrwb headers and library during configuration. You need to
4182 explicitly configure the build with <code>--enable-libopencore-amrwb</code>.
4183 </p>
4184 <p>An FFmpeg native decoder for AMR-WB exists, so users can decode AMR-WB
4185 without this library.
4186 </p>
4187 <a name="libopus"></a>
4188 <h2 class="section"><a href="ffplay-all.html#toc-libopus">10.8 libopus</a></h2>
4189
4190 <p>libopus decoder wrapper.
4191 </p>
4192 <p>libopus allows libavcodec to decode the Opus Interactive Audio Codec.
4193 Requires the presence of the libopus headers and library during
4194 configuration. You need to explicitly configure the build with
4195 <code>--enable-libopus</code>.
4196 </p>
4197
4198 <a name="Subtitles-Decoders"></a>
4199 <h1 class="chapter"><a href="ffplay-all.html#toc-Subtitles-Decoders">11. Subtitles Decoders</a></h1>
4200
4201 <a name="dvdsub"></a>
4202 <h2 class="section"><a href="ffplay-all.html#toc-dvdsub">11.1 dvdsub</a></h2>
4203
4204 <p>This codec decodes the bitmap subtitles used in DVDs; the same subtitles can
4205 also be found in VobSub file pairs and in some Matroska files.
4206 </p>
4207 <a name="Options-10"></a>
4208 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-10">11.1.1 Options</a></h3>
4209
4210 <dl compact="compact">
4211 <dt> &lsquo;<samp>palette</samp>&rsquo;</dt>
4212 <dd><p>Specify the global palette used by the bitmaps. When stored in VobSub, the
4213 palette is normally specified in the index file; in Matroska, the palette is
4214 stored in the codec extra-data in the same format as in VobSub. In DVDs, the
4215 palette is stored in the IFO file, and therefore not available when reading
4216 from dumped VOB files.
4217 </p>
4218 <p>The format for this option is a string containing 16 24-bits hexadecimal
4219 numbers (without 0x prefix) separated by comas, for example <code>0d00ee,
4220 ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
4221 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b</code>.
4222 </p></dd>
4223 </dl>
4224
4225 <a name="libzvbi_002dteletext"></a>
4226 <h2 class="section"><a href="ffplay-all.html#toc-libzvbi_002dteletext">11.2 libzvbi-teletext</a></h2>
4227
4228 <p>Libzvbi allows libavcodec to decode DVB teletext pages and DVB teletext
4229 subtitles. Requires the presence of the libzvbi headers and library during
4230 configuration. You need to explicitly configure the build with
4231 <code>--enable-libzvbi</code>.
4232 </p>
4233 <a name="Options-3"></a>
4234 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-3">11.2.1 Options</a></h3>
4235
4236 <dl compact="compact">
4237 <dt> &lsquo;<samp>txt_page</samp>&rsquo;</dt>
4238 <dd><p>List of teletext page numbers to decode. You may use the special * string to
4239 match all pages. Pages that do not match the specified list are dropped.
4240 Default value is *.
4241 </p></dd>
4242 <dt> &lsquo;<samp>txt_chop_top</samp>&rsquo;</dt>
4243 <dd><p>Discards the top teletext line. Default value is 1.
4244 </p></dd>
4245 <dt> &lsquo;<samp>txt_format</samp>&rsquo;</dt>
4246 <dd><p>Specifies the format of the decoded subtitles. The teletext decoder is capable
4247 of decoding the teletext pages to bitmaps or to simple text, you should use
4248 &quot;bitmap&quot; for teletext pages, because certain graphics and colors cannot be
4249 expressed in simple text. You might use &quot;text&quot; for teletext based subtitles if
4250 your application can handle simple text based subtitles. Default value is
4251 bitmap.
4252 </p></dd>
4253 <dt> &lsquo;<samp>txt_left</samp>&rsquo;</dt>
4254 <dd><p>X offset of generated bitmaps, default is 0.
4255 </p></dd>
4256 <dt> &lsquo;<samp>txt_top</samp>&rsquo;</dt>
4257 <dd><p>Y offset of generated bitmaps, default is 0.
4258 </p></dd>
4259 <dt> &lsquo;<samp>txt_chop_spaces</samp>&rsquo;</dt>
4260 <dd><p>Chops leading and trailing spaces and removes empty lines from the generated
4261 text. This option is useful for teletext based subtitles where empty spaces may
4262 be present at the start or at the end of the lines or empty lines may be
4263 present between the subtitle lines because of double-sized teletext charactes.
4264 Default value is 1.
4265 </p></dd>
4266 <dt> &lsquo;<samp>txt_duration</samp>&rsquo;</dt>
4267 <dd><p>Sets the display duration of the decoded teletext pages or subtitles in
4268 miliseconds. Default value is 30000 which is 30 seconds.
4269 </p></dd>
4270 <dt> &lsquo;<samp>txt_transparent</samp>&rsquo;</dt>
4271 <dd><p>Force transparent background of the generated teletext bitmaps. Default value
4272 is 0 which means an opaque (black) background.
4273 </p></dd>
4274 </dl>
4275
4276 <a name="Bitstream-Filters"></a>
4277 <h1 class="chapter"><a href="ffplay-all.html#toc-Bitstream-Filters">12. Bitstream Filters</a></h1>
4278
4279 <p>When you configure your FFmpeg build, all the supported bitstream
4280 filters are enabled by default. You can list all available ones using
4281 the configure option <code>--list-bsfs</code>.
4282 </p>
4283 <p>You can disable all the bitstream filters using the configure option
4284 <code>--disable-bsfs</code>, and selectively enable any bitstream filter using
4285 the option <code>--enable-bsf=BSF</code>, or you can disable a particular
4286 bitstream filter using the option <code>--disable-bsf=BSF</code>.
4287 </p>
4288 <p>The option <code>-bsfs</code> of the ff* tools will display the list of
4289 all the supported bitstream filters included in your build.
4290 </p>
4291 <p>Below is a description of the currently available bitstream filters.
4292 </p>
4293 <a name="aac_005fadtstoasc"></a>
4294 <h2 class="section"><a href="ffplay-all.html#toc-aac_005fadtstoasc">12.1 aac_adtstoasc</a></h2>
4295
4296 <p>Convert MPEG-2/4 AAC ADTS to MPEG-4 Audio Specific Configuration
4297 bitstream filter.
4298 </p>
4299 <p>This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4
4300 ADTS header and removes the ADTS header.
4301 </p>
4302 <p>This is required for example when copying an AAC stream from a raw
4303 ADTS AAC container to a FLV or a MOV/MP4 file.
4304 </p>
4305 <a name="chomp"></a>
4306 <h2 class="section"><a href="ffplay-all.html#toc-chomp">12.2 chomp</a></h2>
4307
4308 <p>Remove zero padding at the end of a packet.
4309 </p>
4310 <a name="dump_005fextra"></a>
4311 <h2 class="section"><a href="ffplay-all.html#toc-dump_005fextra">12.3 dump_extra</a></h2>
4312
4313 <p>Add extradata to the beginning of the filtered packets.
4314 </p>
4315 <p>The additional argument specifies which packets should be filtered.
4316 It accepts the values:
4317 </p><dl compact="compact">
4318 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
4319 <dd><p>add extradata to all key packets, but only if <var>local_header</var> is
4320 set in the &lsquo;<samp>flags2</samp>&rsquo; codec context field
4321 </p>
4322 </dd>
4323 <dt> &lsquo;<samp>k</samp>&rsquo;</dt>
4324 <dd><p>add extradata to all key packets
4325 </p>
4326 </dd>
4327 <dt> &lsquo;<samp>e</samp>&rsquo;</dt>
4328 <dd><p>add extradata to all packets
4329 </p></dd>
4330 </dl>
4331
4332 <p>If not specified it is assumed &lsquo;<samp>k</samp>&rsquo;.
4333 </p>
4334 <p>For example the following <code>ffmpeg</code> command forces a global
4335 header (thus disabling individual packet headers) in the H.264 packets
4336 generated by the <code>libx264</code> encoder, but corrects them by adding
4337 the header stored in extradata to the key packets:
4338 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts
4339 </pre></td></tr></table>
4340
4341 <a name="h264_005fmp4toannexb"></a>
4342 <h2 class="section"><a href="ffplay-all.html#toc-h264_005fmp4toannexb">12.4 h264_mp4toannexb</a></h2>
4343
4344 <p>Convert an H.264 bitstream from length prefixed mode to start code
4345 prefixed mode (as defined in the Annex B of the ITU-T H.264
4346 specification).
4347 </p>
4348 <p>This is required by some streaming formats, typically the MPEG-2
4349 transport stream format (&quot;mpegts&quot;).
4350 </p>
4351 <p>For example to remux an MP4 file containing an H.264 stream to mpegts
4352 format with <code>ffmpeg</code>, you can use the command:
4353 </p>
4354 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
4355 </pre></td></tr></table>
4356
4357 <a name="imx_005fdump_005fheader"></a>
4358 <h2 class="section"><a href="ffplay-all.html#toc-imx_005fdump_005fheader">12.5 imx_dump_header</a></h2>
4359
4360 <a name="mjpeg2jpeg"></a>
4361 <h2 class="section"><a href="ffplay-all.html#toc-mjpeg2jpeg">12.6 mjpeg2jpeg</a></h2>
4362
4363 <p>Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
4364 </p>
4365 <p>MJPEG is a video codec wherein each video frame is essentially a
4366 JPEG image. The individual frames can be extracted without loss,
4367 e.g. by
4368 </p>
4369 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
4370 </pre></td></tr></table>
4371
4372 <p>Unfortunately, these chunks are incomplete JPEG images, because
4373 they lack the DHT segment required for decoding. Quoting from
4374 <a href="http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml">http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml</a>:
4375 </p>
4376 <p>Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
4377 commented that &quot;MJPEG, or at least the MJPEG in AVIs having the
4378 MJPG fourcc, is restricted JPEG with a fixed &ndash; and *omitted* &ndash;
4379 Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2,
4380 and it must use basic Huffman encoding, not arithmetic or
4381 progressive. . . . You can indeed extract the MJPEG frames and
4382 decode them with a regular JPEG decoder, but you have to prepend
4383 the DHT segment to them, or else the decoder won&rsquo;t have any idea
4384 how to decompress the data. The exact table necessary is given in
4385 the OpenDML spec.&quot;
4386 </p>
4387 <p>This bitstream filter patches the header of frames extracted from an MJPEG
4388 stream (carrying the AVI1 header ID and lacking a DHT segment) to
4389 produce fully qualified JPEG images.
4390 </p>
4391 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
4392 exiftran -i -9 frame*.jpg
4393 ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
4394 </pre></td></tr></table>
4395
4396 <a name="mjpega_005fdump_005fheader"></a>
4397 <h2 class="section"><a href="ffplay-all.html#toc-mjpega_005fdump_005fheader">12.7 mjpega_dump_header</a></h2>
4398
4399 <a name="movsub"></a>
4400 <h2 class="section"><a href="ffplay-all.html#toc-movsub">12.8 movsub</a></h2>
4401
4402 <a name="mp3_005fheader_005fdecompress"></a>
4403 <h2 class="section"><a href="ffplay-all.html#toc-mp3_005fheader_005fdecompress">12.9 mp3_header_decompress</a></h2>
4404
4405 <a name="noise"></a>
4406 <h2 class="section"><a href="ffplay-all.html#toc-noise">12.10 noise</a></h2>
4407
4408 <a name="remove_005fextra"></a>
4409 <h2 class="section"><a href="ffplay-all.html#toc-remove_005fextra">12.11 remove_extra</a></h2>
4410
4411 <a name="Format-Options"></a>
4412 <h1 class="chapter"><a href="ffplay-all.html#toc-Format-Options">13. Format Options</a></h1>
4413
4414 <p>The libavformat library provides some generic global options, which
4415 can be set on all the muxers and demuxers. In addition each muxer or
4416 demuxer may support so-called private options, which are specific for
4417 that component.
4418 </p>
4419 <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
4420 FFmpeg tools, or by setting the value explicitly in the
4421 <code>AVFormatContext</code> options or using the &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API
4422 for programmatic use.
4423 </p>
4424 <p>The list of supported options follows:
4425 </p>
4426 <dl compact="compact">
4427 <dt> &lsquo;<samp>avioflags <var>flags</var> (<em>input/output</em>)</samp>&rsquo;</dt>
4428 <dd><p>Possible values:
4429 </p><dl compact="compact">
4430 <dt> &lsquo;<samp>direct</samp>&rsquo;</dt>
4431 <dd><p>Reduce buffering.
4432 </p></dd>
4433 </dl>
4434
4435 </dd>
4436 <dt> &lsquo;<samp>probesize <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
4437 <dd><p>Set probing size in bytes, i.e. the size of the data to analyze to get
4438 stream information. A higher value will allow to detect more
4439 information in case it is dispersed into the stream, but will increase
4440 latency. Must be an integer not lesser than 32. It is 5000000 by default.
4441 </p>
4442 </dd>
4443 <dt> &lsquo;<samp>packetsize <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
4444 <dd><p>Set packet size.
4445 </p>
4446 </dd>
4447 <dt> &lsquo;<samp>fflags <var>flags</var> (<em>input/output</em>)</samp>&rsquo;</dt>
4448 <dd><p>Set format flags.
4449 </p>
4450 <p>Possible values:
4451 </p><dl compact="compact">
4452 <dt> &lsquo;<samp>ignidx</samp>&rsquo;</dt>
4453 <dd><p>Ignore index.
4454 </p></dd>
4455 <dt> &lsquo;<samp>genpts</samp>&rsquo;</dt>
4456 <dd><p>Generate PTS.
4457 </p></dd>
4458 <dt> &lsquo;<samp>nofillin</samp>&rsquo;</dt>
4459 <dd><p>Do not fill in missing values that can be exactly calculated.
4460 </p></dd>
4461 <dt> &lsquo;<samp>noparse</samp>&rsquo;</dt>
4462 <dd><p>Disable AVParsers, this needs <code>+nofillin</code> too.
4463 </p></dd>
4464 <dt> &lsquo;<samp>igndts</samp>&rsquo;</dt>
4465 <dd><p>Ignore DTS.
4466 </p></dd>
4467 <dt> &lsquo;<samp>discardcorrupt</samp>&rsquo;</dt>
4468 <dd><p>Discard corrupted frames.
4469 </p></dd>
4470 <dt> &lsquo;<samp>sortdts</samp>&rsquo;</dt>
4471 <dd><p>Try to interleave output packets by DTS.
4472 </p></dd>
4473 <dt> &lsquo;<samp>keepside</samp>&rsquo;</dt>
4474 <dd><p>Do not merge side data.
4475 </p></dd>
4476 <dt> &lsquo;<samp>latm</samp>&rsquo;</dt>
4477 <dd><p>Enable RTP MP4A-LATM payload.
4478 </p></dd>
4479 <dt> &lsquo;<samp>nobuffer</samp>&rsquo;</dt>
4480 <dd><p>Reduce the latency introduced by optional buffering
4481 </p></dd>
4482 </dl>
4483
4484 </dd>
4485 <dt> &lsquo;<samp>seek2any <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
4486 <dd><p>Allow seeking to non-keyframes on demuxer level when supported if set to 1.
4487 Default is 0.
4488 </p>
4489 </dd>
4490 <dt> &lsquo;<samp>analyzeduration <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
4491 <dd><p>Specify how many microseconds are analyzed to probe the input. A
4492 higher value will allow to detect more accurate information, but will
4493 increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
4494 </p>
4495 </dd>
4496 <dt> &lsquo;<samp>cryptokey <var>hexadecimal string</var> (<em>input</em>)</samp>&rsquo;</dt>
4497 <dd><p>Set decryption key.
4498 </p>
4499 </dd>
4500 <dt> &lsquo;<samp>indexmem <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
4501 <dd><p>Set max memory used for timestamp index (per stream).
4502 </p>
4503 </dd>
4504 <dt> &lsquo;<samp>rtbufsize <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
4505 <dd><p>Set max memory used for buffering real-time frames.
4506 </p>
4507 </dd>
4508 <dt> &lsquo;<samp>fdebug <var>flags</var> (<em>input/output</em>)</samp>&rsquo;</dt>
4509 <dd><p>Print specific debug info.
4510 </p>
4511 <p>Possible values:
4512 </p><dl compact="compact">
4513 <dt> &lsquo;<samp>ts</samp>&rsquo;</dt>
4514 </dl>
4515
4516 </dd>
4517 <dt> &lsquo;<samp>max_delay <var>integer</var> (<em>input/output</em>)</samp>&rsquo;</dt>
4518 <dd><p>Set maximum muxing or demuxing delay in microseconds.
4519 </p>
4520 </dd>
4521 <dt> &lsquo;<samp>fpsprobesize <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
4522 <dd><p>Set number of frames used to probe fps.
4523 </p>
4524 </dd>
4525 <dt> &lsquo;<samp>audio_preload <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
4526 <dd><p>Set microseconds by which audio packets should be interleaved earlier.
4527 </p>
4528 </dd>
4529 <dt> &lsquo;<samp>chunk_duration <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
4530 <dd><p>Set microseconds for each chunk.
4531 </p>
4532 </dd>
4533 <dt> &lsquo;<samp>chunk_size <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
4534 <dd><p>Set size in bytes for each chunk.
4535 </p>
4536 </dd>
4537 <dt> &lsquo;<samp>err_detect, f_err_detect <var>flags</var> (<em>input</em>)</samp>&rsquo;</dt>
4538 <dd><p>Set error detection flags. <code>f_err_detect</code> is deprecated and
4539 should be used only via the <code>ffmpeg</code> tool.
4540 </p>
4541 <p>Possible values:
4542 </p><dl compact="compact">
4543 <dt> &lsquo;<samp>crccheck</samp>&rsquo;</dt>
4544 <dd><p>Verify embedded CRCs.
4545 </p></dd>
4546 <dt> &lsquo;<samp>bitstream</samp>&rsquo;</dt>
4547 <dd><p>Detect bitstream specification deviations.
4548 </p></dd>
4549 <dt> &lsquo;<samp>buffer</samp>&rsquo;</dt>
4550 <dd><p>Detect improper bitstream length.
4551 </p></dd>
4552 <dt> &lsquo;<samp>explode</samp>&rsquo;</dt>
4553 <dd><p>Abort decoding on minor error detection.
4554 </p></dd>
4555 <dt> &lsquo;<samp>careful</samp>&rsquo;</dt>
4556 <dd><p>Consider things that violate the spec and have not been seen in the
4557 wild as errors.
4558 </p></dd>
4559 <dt> &lsquo;<samp>compliant</samp>&rsquo;</dt>
4560 <dd><p>Consider all spec non compliancies as errors.
4561 </p></dd>
4562 <dt> &lsquo;<samp>aggressive</samp>&rsquo;</dt>
4563 <dd><p>Consider things that a sane encoder should not do as an error.
4564 </p></dd>
4565 </dl>
4566
4567 </dd>
4568 <dt> &lsquo;<samp>use_wallclock_as_timestamps <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
4569 <dd><p>Use wallclock as timestamps.
4570 </p>
4571 </dd>
4572 <dt> &lsquo;<samp>avoid_negative_ts <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
4573 <dd>
4574 <p>Possible values:
4575 </p><dl compact="compact">
4576 <dt> &lsquo;<samp>make_non_negative</samp>&rsquo;</dt>
4577 <dd><p>Shift timestamps to make them non-negative.
4578 Also note that this affects only leading negative timestamps, and not
4579 non-monotonic negative timestamps.
4580 </p></dd>
4581 <dt> &lsquo;<samp>make_zero</samp>&rsquo;</dt>
4582 <dd><p>Shift timestamps so that the first timestamp is 0.
4583 </p></dd>
4584 <dt> &lsquo;<samp>auto (default)</samp>&rsquo;</dt>
4585 <dd><p>Enables shifting when required by the target format.
4586 </p></dd>
4587 <dt> &lsquo;<samp>disabled</samp>&rsquo;</dt>
4588 <dd><p>Disables shifting of timestamp.
4589 </p></dd>
4590 </dl>
4591
4592 <p>When shifting is enabled, all output timestamps are shifted by the
4593 same amount. Audio, video, and subtitles desynching and relative
4594 timestamp differences are preserved compared to how they would have
4595 been without shifting.
4596 </p>
4597 </dd>
4598 <dt> &lsquo;<samp>skip_initial_bytes <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
4599 <dd><p>Set number of bytes to skip before reading header and frames if set to 1.
4600 Default is 0.
4601 </p>
4602 </dd>
4603 <dt> &lsquo;<samp>correct_ts_overflow <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
4604 <dd><p>Correct single timestamp overflows if set to 1. Default is 1.
4605 </p>
4606 </dd>
4607 <dt> &lsquo;<samp>flush_packets <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
4608 <dd><p>Flush the underlying I/O stream after each packet. Default 1 enables it, and
4609 has the effect of reducing the latency; 0 disables it and may slightly
4610 increase performance in some cases.
4611 </p>
4612 </dd>
4613 <dt> &lsquo;<samp>output_ts_offset <var>offset</var> (<em>output</em>)</samp>&rsquo;</dt>
4614 <dd><p>Set the output time offset.
4615 </p>
4616 <p><var>offset</var> must be a time duration specification,
4617 see <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)time duration syntax</a>.
4618 </p>
4619 <p>The offset is added by the muxer to the output timestamps.
4620 </p>
4621 <p>Specifying a positive offset means that the corresponding streams are
4622 delayed bt the time duration specified in <var>offset</var>. Default value
4623 is <code>0</code> (meaning that no offset is applied).
4624 </p></dd>
4625 </dl>
4626
4627
4628 <p><a name="Format-stream-specifiers"></a>
4629 </p><a name="Format-stream-specifiers-1"></a>
4630 <h2 class="section"><a href="ffplay-all.html#toc-Format-stream-specifiers-1">13.1 Format stream specifiers</a></h2>
4631
4632 <p>Format stream specifiers allow selection of one or more streams that
4633 match specific properties.
4634 </p>
4635 <p>Possible forms of stream specifiers are:
4636 </p><dl compact="compact">
4637 <dt> &lsquo;<samp><var>stream_index</var></samp>&rsquo;</dt>
4638 <dd><p>Matches the stream with this index.
4639 </p>
4640 </dd>
4641 <dt> &lsquo;<samp><var>stream_type</var>[:<var>stream_index</var>]</samp>&rsquo;</dt>
4642 <dd><p><var>stream_type</var> is one of following: &rsquo;v&rsquo; for video, &rsquo;a&rsquo; for audio,
4643 &rsquo;s&rsquo; for subtitle, &rsquo;d&rsquo; for data, and &rsquo;t&rsquo; for attachments. If
4644 <var>stream_index</var> is given, then it matches the stream number
4645 <var>stream_index</var> of this type. Otherwise, it matches all streams of
4646 this type.
4647 </p>
4648 </dd>
4649 <dt> &lsquo;<samp>p:<var>program_id</var>[:<var>stream_index</var>]</samp>&rsquo;</dt>
4650 <dd><p>If <var>stream_index</var> is given, then it matches the stream with number
4651 <var>stream_index</var> in the program with the id
4652 <var>program_id</var>. Otherwise, it matches all streams in the program.
4653 </p>
4654 </dd>
4655 <dt> &lsquo;<samp>#<var>stream_id</var></samp>&rsquo;</dt>
4656 <dd><p>Matches the stream by a format-specific ID.
4657 </p></dd>
4658 </dl>
4659
4660 <p>The exact semantics of stream specifiers is defined by the
4661 <code>avformat_match_stream_specifier()</code> function declared in the
4662 &lsquo;<tt>libavformat/avformat.h</tt>&rsquo; header.
4663 </p>
4664 <a name="Demuxers"></a>
4665 <h1 class="chapter"><a href="ffplay-all.html#toc-Demuxers">14. Demuxers</a></h1>
4666
4667 <p>Demuxers are configured elements in FFmpeg that can read the
4668 multimedia streams from a particular type of file.
4669 </p>
4670 <p>When you configure your FFmpeg build, all the supported demuxers
4671 are enabled by default. You can list all available ones using the
4672 configure option <code>--list-demuxers</code>.
4673 </p>
4674 <p>You can disable all the demuxers using the configure option
4675 <code>--disable-demuxers</code>, and selectively enable a single demuxer with
4676 the option <code>--enable-demuxer=<var>DEMUXER</var></code>, or disable it
4677 with the option <code>--disable-demuxer=<var>DEMUXER</var></code>.
4678 </p>
4679 <p>The option <code>-formats</code> of the ff* tools will display the list of
4680 enabled demuxers.
4681 </p>
4682 <p>The description of some of the currently available demuxers follows.
4683 </p>
4684 <a name="applehttp"></a>
4685 <h2 class="section"><a href="ffplay-all.html#toc-applehttp">14.1 applehttp</a></h2>
4686
4687 <p>Apple HTTP Live Streaming demuxer.
4688 </p>
4689 <p>This demuxer presents all AVStreams from all variant streams.
4690 The id field is set to the bitrate variant index number. By setting
4691 the discard flags on AVStreams (by pressing &rsquo;a&rsquo; or &rsquo;v&rsquo; in ffplay),
4692 the caller can decide which variant streams to actually receive.
4693 The total bitrate of the variant that the stream belongs to is
4694 available in a metadata key named &quot;variant_bitrate&quot;.
4695 </p>
4696 <a name="asf"></a>
4697 <h2 class="section"><a href="ffplay-all.html#toc-asf">14.2 asf</a></h2>
4698
4699 <p>Advanced Systems Format demuxer.
4700 </p>
4701 <p>This demuxer is used to demux ASF files and MMS network streams.
4702 </p>
4703 <dl compact="compact">
4704 <dt> &lsquo;<samp>-no_resync_search <var>bool</var></samp>&rsquo;</dt>
4705 <dd><p>Do not try to resynchronize by looking for a certain optional start code.
4706 </p></dd>
4707 </dl>
4708
4709 <p><a name="concat"></a>
4710 </p><a name="concat-1"></a>
4711 <h2 class="section"><a href="ffplay-all.html#toc-concat-1">14.3 concat</a></h2>
4712
4713 <p>Virtual concatenation script demuxer.
4714 </p>
4715 <p>This demuxer reads a list of files and other directives from a text file and
4716 demuxes them one after the other, as if all their packet had been muxed
4717 together.
4718 </p>
4719 <p>The timestamps in the files are adjusted so that the first file starts at 0
4720 and each next file starts where the previous one finishes. Note that it is
4721 done globally and may cause gaps if all streams do not have exactly the same
4722 length.
4723 </p>
4724 <p>All files must have the same streams (same codecs, same time base, etc.).
4725 </p>
4726 <p>The duration of each file is used to adjust the timestamps of the next file:
4727 if the duration is incorrect (because it was computed using the bit-rate or
4728 because the file is truncated, for example), it can cause artifacts. The
4729 <code>duration</code> directive can be used to override the duration stored in
4730 each file.
4731 </p>
4732 <a name="Syntax-1"></a>
4733 <h3 class="subsection"><a href="ffplay-all.html#toc-Syntax-1">14.3.1 Syntax</a></h3>
4734
4735 <p>The script is a text file in extended-ASCII, with one directive per line.
4736 Empty lines, leading spaces and lines starting with &rsquo;#&rsquo; are ignored. The
4737 following directive is recognized:
4738 </p>
4739 <dl compact="compact">
4740 <dt> &lsquo;<samp><code>file <var>path</var></code></samp>&rsquo;</dt>
4741 <dd><p>Path to a file to read; special characters and spaces must be escaped with
4742 backslash or single quotes.
4743 </p>
4744 <p>All subsequent directives apply to that file.
4745 </p>
4746 </dd>
4747 <dt> &lsquo;<samp><code>ffconcat version 1.0</code></samp>&rsquo;</dt>
4748 <dd><p>Identify the script type and version. It also sets the &lsquo;<samp>safe</samp>&rsquo; option
4749 to 1 if it was to its default -1.
4750 </p>
4751 <p>To make FFmpeg recognize the format automatically, this directive must
4752 appears exactly as is (no extra space or byte-order-mark) on the very first
4753 line of the script.
4754 </p>
4755 </dd>
4756 <dt> &lsquo;<samp><code>duration <var>dur</var></code></samp>&rsquo;</dt>
4757 <dd><p>Duration of the file. This information can be specified from the file;
4758 specifying it here may be more efficient or help if the information from the
4759 file is not available or accurate.
4760 </p>
4761 <p>If the duration is set for all files, then it is possible to seek in the
4762 whole concatenated video.
4763 </p>
4764 </dd>
4765 </dl>
4766
4767 <a name="Options-2"></a>
4768 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-2">14.3.2 Options</a></h3>
4769
4770 <p>This demuxer accepts the following option:
4771 </p>
4772 <dl compact="compact">
4773 <dt> &lsquo;<samp>safe</samp>&rsquo;</dt>
4774 <dd><p>If set to 1, reject unsafe file paths. A file path is considered safe if it
4775 does not contain a protocol specification and is relative and all components
4776 only contain characters from the portable character set (letters, digits,
4777 period, underscore and hyphen) and have no period at the beginning of a
4778 component.
4779 </p>
4780 <p>If set to 0, any file name is accepted.
4781 </p>
4782 <p>The default is -1, it is equivalent to 1 if the format was automatically
4783 probed and 0 otherwise.
4784 </p>
4785 </dd>
4786 </dl>
4787
4788 <a name="flv"></a>
4789 <h2 class="section"><a href="ffplay-all.html#toc-flv">14.4 flv</a></h2>
4790
4791 <p>Adobe Flash Video Format demuxer.
4792 </p>
4793 <p>This demuxer is used to demux FLV files and RTMP network streams.
4794 </p>
4795 <dl compact="compact">
4796 <dt> &lsquo;<samp>-flv_metadata <var>bool</var></samp>&rsquo;</dt>
4797 <dd><p>Allocate the streams according to the onMetaData array content.
4798 </p></dd>
4799 </dl>
4800
4801 <a name="libgme"></a>
4802 <h2 class="section"><a href="ffplay-all.html#toc-libgme">14.5 libgme</a></h2>
4803
4804 <p>The Game Music Emu library is a collection of video game music file emulators.
4805 </p>
4806 <p>See <a href="http://code.google.com/p/game-music-emu/">http://code.google.com/p/game-music-emu/</a> for more information.
4807 </p>
4808 <p>Some files have multiple tracks. The demuxer will pick the first track by
4809 default. The &lsquo;<samp>track_index</samp>&rsquo; option can be used to select a different
4810 track. Track indexes start at 0. The demuxer exports the number of tracks as
4811 <var>tracks</var> meta data entry.
4812 </p>
4813 <p>For very large files, the &lsquo;<samp>max_size</samp>&rsquo; option may have to be adjusted.
4814 </p>
4815 <a name="libquvi"></a>
4816 <h2 class="section"><a href="ffplay-all.html#toc-libquvi">14.6 libquvi</a></h2>
4817
4818 <p>Play media from Internet services using the quvi project.
4819 </p>
4820 <p>The demuxer accepts a &lsquo;<samp>format</samp>&rsquo; option to request a specific quality. It
4821 is by default set to <var>best</var>.
4822 </p>
4823 <p>See <a href="http://quvi.sourceforge.net/">http://quvi.sourceforge.net/</a> for more information.
4824 </p>
4825 <p>FFmpeg needs to be built with <code>--enable-libquvi</code> for this demuxer to be
4826 enabled.
4827 </p>
4828 <a name="image2"></a>
4829 <h2 class="section"><a href="ffplay-all.html#toc-image2">14.7 image2</a></h2>
4830
4831 <p>Image file demuxer.
4832 </p>
4833 <p>This demuxer reads from a list of image files specified by a pattern.
4834 The syntax and meaning of the pattern is specified by the
4835 option <var>pattern_type</var>.
4836 </p>
4837 <p>The pattern may contain a suffix which is used to automatically
4838 determine the format of the images contained in the files.
4839 </p>
4840 <p>The size, the pixel format, and the format of each image must be the
4841 same for all the files in the sequence.
4842 </p>
4843 <p>This demuxer accepts the following options:
4844 </p><dl compact="compact">
4845 <dt> &lsquo;<samp>framerate</samp>&rsquo;</dt>
4846 <dd><p>Set the frame rate for the video stream. It defaults to 25.
4847 </p></dd>
4848 <dt> &lsquo;<samp>loop</samp>&rsquo;</dt>
4849 <dd><p>If set to 1, loop over the input. Default value is 0.
4850 </p></dd>
4851 <dt> &lsquo;<samp>pattern_type</samp>&rsquo;</dt>
4852 <dd><p>Select the pattern type used to interpret the provided filename.
4853 </p>
4854 <p><var>pattern_type</var> accepts one of the following values.
4855 </p><dl compact="compact">
4856 <dt> &lsquo;<samp>sequence</samp>&rsquo;</dt>
4857 <dd><p>Select a sequence pattern type, used to specify a sequence of files
4858 indexed by sequential numbers.
4859 </p>
4860 <p>A sequence pattern may contain the string &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, which
4861 specifies the position of the characters representing a sequential
4862 number in each filename matched by the pattern. If the form
4863 &quot;%d0<var>N</var>d&quot; is used, the string representing the number in each
4864 filename is 0-padded and <var>N</var> is the total number of 0-padded
4865 digits representing the number. The literal character &rsquo;%&rsquo; can be
4866 specified in the pattern with the string &quot;%%&quot;.
4867 </p>
4868 <p>If the sequence pattern contains &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, the first filename of
4869 the file list specified by the pattern must contain a number
4870 inclusively contained between <var>start_number</var> and
4871 <var>start_number</var>+<var>start_number_range</var>-1, and all the following
4872 numbers must be sequential.
4873 </p>
4874 <p>For example the pattern &quot;img-%03d.bmp&quot; will match a sequence of
4875 filenames of the form &lsquo;<tt>img-001.bmp</tt>&rsquo;, &lsquo;<tt>img-002.bmp</tt>&rsquo;, ...,
4876 &lsquo;<tt>img-010.bmp</tt>&rsquo;, etc.; the pattern &quot;i%%m%%g-%d.jpg&quot; will match a
4877 sequence of filenames of the form &lsquo;<tt>i%m%g-1.jpg</tt>&rsquo;,
4878 &lsquo;<tt>i%m%g-2.jpg</tt>&rsquo;, ..., &lsquo;<tt>i%m%g-10.jpg</tt>&rsquo;, etc.
4879 </p>
4880 <p>Note that the pattern must not necessarily contain &quot;%d&quot; or
4881 &quot;%0<var>N</var>d&quot;, for example to convert a single image file
4882 &lsquo;<tt>img.jpeg</tt>&rsquo; you can employ the command:
4883 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i img.jpeg img.png
4884 </pre></td></tr></table>
4885
4886 </dd>
4887 <dt> &lsquo;<samp>glob</samp>&rsquo;</dt>
4888 <dd><p>Select a glob wildcard pattern type.
4889 </p>
4890 <p>The pattern is interpreted like a <code>glob()</code> pattern. This is only
4891 selectable if libavformat was compiled with globbing support.
4892 </p>
4893 </dd>
4894 <dt> &lsquo;<samp>glob_sequence <em>(deprecated, will be removed)</em></samp>&rsquo;</dt>
4895 <dd><p>Select a mixed glob wildcard/sequence pattern.
4896 </p>
4897 <p>If your version of libavformat was compiled with globbing support, and
4898 the provided pattern contains at least one glob meta character among
4899 <code>%*?[]{}</code> that is preceded by an unescaped &quot;%&quot;, the pattern is
4900 interpreted like a <code>glob()</code> pattern, otherwise it is interpreted
4901 like a sequence pattern.
4902 </p>
4903 <p>All glob special characters <code>%*?[]{}</code> must be prefixed
4904 with &quot;%&quot;. To escape a literal &quot;%&quot; you shall use &quot;%%&quot;.
4905 </p>
4906 <p>For example the pattern <code>foo-%*.jpeg</code> will match all the
4907 filenames prefixed by &quot;foo-&quot; and terminating with &quot;.jpeg&quot;, and
4908 <code>foo-%?%?%?.jpeg</code> will match all the filenames prefixed with
4909 &quot;foo-&quot;, followed by a sequence of three characters, and terminating
4910 with &quot;.jpeg&quot;.
4911 </p>
4912 <p>This pattern type is deprecated in favor of <var>glob</var> and
4913 <var>sequence</var>.
4914 </p></dd>
4915 </dl>
4916
4917 <p>Default value is <var>glob_sequence</var>.
4918 </p></dd>
4919 <dt> &lsquo;<samp>pixel_format</samp>&rsquo;</dt>
4920 <dd><p>Set the pixel format of the images to read. If not specified the pixel
4921 format is guessed from the first image file in the sequence.
4922 </p></dd>
4923 <dt> &lsquo;<samp>start_number</samp>&rsquo;</dt>
4924 <dd><p>Set the index of the file matched by the image file pattern to start
4925 to read from. Default value is 0.
4926 </p></dd>
4927 <dt> &lsquo;<samp>start_number_range</samp>&rsquo;</dt>
4928 <dd><p>Set the index interval range to check when looking for the first image
4929 file in the sequence, starting from <var>start_number</var>. Default value
4930 is 5.
4931 </p></dd>
4932 <dt> &lsquo;<samp>ts_from_file</samp>&rsquo;</dt>
4933 <dd><p>If set to 1, will set frame timestamp to modification time of image file. Note
4934 that monotonity of timestamps is not provided: images go in the same order as
4935 without this option. Default value is 0.
4936 </p></dd>
4937 <dt> &lsquo;<samp>video_size</samp>&rsquo;</dt>
4938 <dd><p>Set the video size of the images to read. If not specified the video
4939 size is guessed from the first image file in the sequence.
4940 </p></dd>
4941 </dl>
4942
4943 <a name="Examples-75"></a>
4944 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-75">14.7.1 Examples</a></h3>
4945
4946 <ul>
4947 <li>
4948 Use <code>ffmpeg</code> for creating a video from the images in the file
4949 sequence &lsquo;<tt>img-001.jpeg</tt>&rsquo;, &lsquo;<tt>img-002.jpeg</tt>&rsquo;, ..., assuming an
4950 input frame rate of 10 frames per second:
4951 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
4952 </pre></td></tr></table>
4953
4954 </li><li>
4955 As above, but start by reading from a file with index 100 in the sequence:
4956 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
4957 </pre></td></tr></table>
4958
4959 </li><li>
4960 Read images matching the &quot;*.png&quot; glob pattern , that is all the files
4961 terminating with the &quot;.png&quot; suffix:
4962 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -framerate 10 -pattern_type glob -i &quot;*.png&quot; out.mkv
4963 </pre></td></tr></table>
4964 </li></ul>
4965
4966 <a name="mpegts"></a>
4967 <h2 class="section"><a href="ffplay-all.html#toc-mpegts">14.8 mpegts</a></h2>
4968
4969 <p>MPEG-2 transport stream demuxer.
4970 </p>
4971 <dl compact="compact">
4972 <dt> &lsquo;<samp>fix_teletext_pts</samp>&rsquo;</dt>
4973 <dd><p>Overrides teletext packet PTS and DTS values with the timestamps calculated
4974 from the PCR of the first program which the teletext stream is part of and is
4975 not discarded. Default value is 1, set this option to 0 if you want your
4976 teletext packet PTS and DTS values untouched.
4977 </p></dd>
4978 </dl>
4979
4980 <a name="rawvideo"></a>
4981 <h2 class="section"><a href="ffplay-all.html#toc-rawvideo">14.9 rawvideo</a></h2>
4982
4983 <p>Raw video demuxer.
4984 </p>
4985 <p>This demuxer allows one to read raw video data. Since there is no header
4986 specifying the assumed video parameters, the user must specify them
4987 in order to be able to decode the data correctly.
4988 </p>
4989 <p>This demuxer accepts the following options:
4990 </p><dl compact="compact">
4991 <dt> &lsquo;<samp>framerate</samp>&rsquo;</dt>
4992 <dd><p>Set input video frame rate. Default value is 25.
4993 </p>
4994 </dd>
4995 <dt> &lsquo;<samp>pixel_format</samp>&rsquo;</dt>
4996 <dd><p>Set the input video pixel format. Default value is <code>yuv420p</code>.
4997 </p>
4998 </dd>
4999 <dt> &lsquo;<samp>video_size</samp>&rsquo;</dt>
5000 <dd><p>Set the input video size. This value must be specified explicitly.
5001 </p></dd>
5002 </dl>
5003
5004 <p>For example to read a rawvideo file &lsquo;<tt>input.raw</tt>&rsquo; with
5005 <code>ffplay</code>, assuming a pixel format of <code>rgb24</code>, a video
5006 size of <code>320x240</code>, and a frame rate of 10 images per second, use
5007 the command:
5008 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
5009 </pre></td></tr></table>
5010
5011 <a name="sbg"></a>
5012 <h2 class="section"><a href="ffplay-all.html#toc-sbg">14.10 sbg</a></h2>
5013
5014 <p>SBaGen script demuxer.
5015 </p>
5016 <p>This demuxer reads the script language used by SBaGen
5017 <a href="http://uazu.net/sbagen/">http://uazu.net/sbagen/</a> to generate binaural beats sessions. A SBG
5018 script looks like that:
5019 </p><table><tr><td>&nbsp;</td><td><pre class="example">-SE
5020 a: 300-2.5/3 440+4.5/0
5021 b: 300-2.5/0 440+4.5/3
5022 off: -
5023 NOW      == a
5024 +0:07:00 == b
5025 +0:14:00 == a
5026 +0:21:00 == b
5027 +0:30:00    off
5028 </pre></td></tr></table>
5029
5030 <p>A SBG script can mix absolute and relative timestamps. If the script uses
5031 either only absolute timestamps (including the script start time) or only
5032 relative ones, then its layout is fixed, and the conversion is
5033 straightforward. On the other hand, if the script mixes both kind of
5034 timestamps, then the <var>NOW</var> reference for relative timestamps will be
5035 taken from the current time of day at the time the script is read, and the
5036 script layout will be frozen according to that reference. That means that if
5037 the script is directly played, the actual times will match the absolute
5038 timestamps up to the sound controller&rsquo;s clock accuracy, but if the user
5039 somehow pauses the playback or seeks, all times will be shifted accordingly.
5040 </p>
5041 <a name="tedcaptions"></a>
5042 <h2 class="section"><a href="ffplay-all.html#toc-tedcaptions">14.11 tedcaptions</a></h2>
5043
5044 <p>JSON captions used for <a href="http://www.ted.com/">TED Talks</a>.
5045 </p>
5046 <p>TED does not provide links to the captions, but they can be guessed from the
5047 page. The file &lsquo;<tt>tools/bookmarklets.html</tt>&rsquo; from the FFmpeg source tree
5048 contains a bookmarklet to expose them.
5049 </p>
5050 <p>This demuxer accepts the following option:
5051 </p><dl compact="compact">
5052 <dt> &lsquo;<samp>start_time</samp>&rsquo;</dt>
5053 <dd><p>Set the start time of the TED talk, in milliseconds. The default is 15000
5054 (15s). It is used to sync the captions with the downloadable videos, because
5055 they include a 15s intro.
5056 </p></dd>
5057 </dl>
5058
5059 <p>Example: convert the captions to a format most players understand:
5060 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
5061 </pre></td></tr></table>
5062
5063 <a name="Metadata"></a>
5064 <h1 class="chapter"><a href="ffplay-all.html#toc-Metadata">15. Metadata</a></h1>
5065
5066 <p>FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded
5067 INI-like text file and then load it back using the metadata muxer/demuxer.
5068 </p>
5069 <p>The file format is as follows:
5070 </p><ol>
5071 <li>
5072 A file consists of a header and a number of metadata tags divided into sections,
5073 each on its own line.
5074
5075 </li><li>
5076 The header is a &rsquo;;FFMETADATA&rsquo; string, followed by a version number (now 1).
5077
5078 </li><li>
5079 Metadata tags are of the form &rsquo;key=value&rsquo;
5080
5081 </li><li>
5082 Immediately after header follows global metadata
5083
5084 </li><li>
5085 After global metadata there may be sections with per-stream/per-chapter
5086 metadata.
5087
5088 </li><li>
5089 A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
5090 brackets (&rsquo;[&rsquo;, &rsquo;]&rsquo;) and ends with next section or end of file.
5091
5092 </li><li>
5093 At the beginning of a chapter section there may be an optional timebase to be
5094 used for start/end values. It must be in form &rsquo;TIMEBASE=num/den&rsquo;, where num and
5095 den are integers. If the timebase is missing then start/end times are assumed to
5096 be in milliseconds.
5097 Next a chapter section must contain chapter start and end times in form
5098 &rsquo;START=num&rsquo;, &rsquo;END=num&rsquo;, where num is a positive integer.
5099
5100 </li><li>
5101 Empty lines and lines starting with &rsquo;;&rsquo; or &rsquo;#&rsquo; are ignored.
5102
5103 </li><li>
5104 Metadata keys or values containing special characters (&rsquo;=&rsquo;, &rsquo;;&rsquo;, &rsquo;#&rsquo;, &rsquo;\&rsquo; and a
5105 newline) must be escaped with a backslash &rsquo;\&rsquo;.
5106
5107 </li><li>
5108 Note that whitespace in metadata (e.g. foo = bar) is considered to be a part of
5109 the tag (in the example above key is &rsquo;foo &rsquo;, value is &rsquo; bar&rsquo;).
5110 </li></ol>
5111
5112 <p>A ffmetadata file might look like this:
5113 </p><table><tr><td>&nbsp;</td><td><pre class="example">;FFMETADATA1
5114 title=bike\\shed
5115 ;this is a comment
5116 artist=FFmpeg troll team
5117
5118 [CHAPTER]
5119 TIMEBASE=1/1000
5120 START=0
5121 #chapter ends at 0:01:00
5122 END=60000
5123 title=chapter \#1
5124 [STREAM]
5125 title=multi\
5126 line
5127 </pre></td></tr></table>
5128
5129 <p>By using the ffmetadata muxer and demuxer it is possible to extract
5130 metadata from an input file to an ffmetadata file, and then transcode
5131 the file into an output file with the edited ffmetadata file.
5132 </p>
5133 <p>Extracting an ffmetadata file with &lsquo;<tt>ffmpeg</tt>&rsquo; goes as follows:
5134 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
5135 </pre></td></tr></table>
5136
5137 <p>Reinserting edited metadata information from the FFMETADATAFILE file can
5138 be done as:
5139 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
5140 </pre></td></tr></table>
5141
5142 <a name="Protocols"></a>
5143 <h1 class="chapter"><a href="ffplay-all.html#toc-Protocols">16. Protocols</a></h1>
5144
5145 <p>Protocols are configured elements in FFmpeg that enable access to
5146 resources that require specific protocols.
5147 </p>
5148 <p>When you configure your FFmpeg build, all the supported protocols are
5149 enabled by default. You can list all available ones using the
5150 configure option &quot;&ndash;list-protocols&quot;.
5151 </p>
5152 <p>You can disable all the protocols using the configure option
5153 &quot;&ndash;disable-protocols&quot;, and selectively enable a protocol using the
5154 option &quot;&ndash;enable-protocol=<var>PROTOCOL</var>&quot;, or you can disable a
5155 particular protocol using the option
5156 &quot;&ndash;disable-protocol=<var>PROTOCOL</var>&quot;.
5157 </p>
5158 <p>The option &quot;-protocols&quot; of the ff* tools will display the list of
5159 supported protocols.
5160 </p>
5161 <p>A description of the currently available protocols follows.
5162 </p>
5163 <a name="bluray"></a>
5164 <h2 class="section"><a href="ffplay-all.html#toc-bluray">16.1 bluray</a></h2>
5165
5166 <p>Read BluRay playlist.
5167 </p>
5168 <p>The accepted options are:
5169 </p><dl compact="compact">
5170 <dt> &lsquo;<samp>angle</samp>&rsquo;</dt>
5171 <dd><p>BluRay angle
5172 </p>
5173 </dd>
5174 <dt> &lsquo;<samp>chapter</samp>&rsquo;</dt>
5175 <dd><p>Start chapter (1...N)
5176 </p>
5177 </dd>
5178 <dt> &lsquo;<samp>playlist</samp>&rsquo;</dt>
5179 <dd><p>Playlist to read (BDMV/PLAYLIST/?????.mpls)
5180 </p>
5181 </dd>
5182 </dl>
5183
5184 <p>Examples:
5185 </p>
5186 <p>Read longest playlist from BluRay mounted to /mnt/bluray:
5187 </p><table><tr><td>&nbsp;</td><td><pre class="example">bluray:/mnt/bluray
5188 </pre></td></tr></table>
5189
5190 <p>Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2:
5191 </p><table><tr><td>&nbsp;</td><td><pre class="example">-playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
5192 </pre></td></tr></table>
5193
5194 <a name="cache"></a>
5195 <h2 class="section"><a href="ffplay-all.html#toc-cache">16.2 cache</a></h2>
5196
5197 <p>Caching wrapper for input stream.
5198 </p>
5199 <p>Cache the input stream to temporary file. It brings seeking capability to live streams.
5200 </p>
5201 <table><tr><td>&nbsp;</td><td><pre class="example">cache:<var>URL</var>
5202 </pre></td></tr></table>
5203
5204 <a name="concat-3"></a>
5205 <h2 class="section"><a href="ffplay-all.html#toc-concat-3">16.3 concat</a></h2>
5206
5207 <p>Physical concatenation protocol.
5208 </p>
5209 <p>Allow to read and seek from many resource in sequence as if they were
5210 a unique resource.
5211 </p>
5212 <p>A URL accepted by this protocol has the syntax:
5213 </p><table><tr><td>&nbsp;</td><td><pre class="example">concat:<var>URL1</var>|<var>URL2</var>|...|<var>URLN</var>
5214 </pre></td></tr></table>
5215
5216 <p>where <var>URL1</var>, <var>URL2</var>, ..., <var>URLN</var> are the urls of the
5217 resource to be concatenated, each one possibly specifying a distinct
5218 protocol.
5219 </p>
5220 <p>For example to read a sequence of files &lsquo;<tt>split1.mpeg</tt>&rsquo;,
5221 &lsquo;<tt>split2.mpeg</tt>&rsquo;, &lsquo;<tt>split3.mpeg</tt>&rsquo; with <code>ffplay</code> use the
5222 command:
5223 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
5224 </pre></td></tr></table>
5225
5226 <p>Note that you may need to escape the character &quot;|&quot; which is special for
5227 many shells.
5228 </p>
5229 <a name="crypto"></a>
5230 <h2 class="section"><a href="ffplay-all.html#toc-crypto">16.4 crypto</a></h2>
5231
5232 <p>AES-encrypted stream reading protocol.
5233 </p>
5234 <p>The accepted options are:
5235 </p><dl compact="compact">
5236 <dt> &lsquo;<samp>key</samp>&rsquo;</dt>
5237 <dd><p>Set the AES decryption key binary block from given hexadecimal representation.
5238 </p>
5239 </dd>
5240 <dt> &lsquo;<samp>iv</samp>&rsquo;</dt>
5241 <dd><p>Set the AES decryption initialization vector binary block from given hexadecimal representation.
5242 </p></dd>
5243 </dl>
5244
5245 <p>Accepted URL formats:
5246 </p><table><tr><td>&nbsp;</td><td><pre class="example">crypto:<var>URL</var>
5247 crypto+<var>URL</var>
5248 </pre></td></tr></table>
5249
5250 <a name="data"></a>
5251 <h2 class="section"><a href="ffplay-all.html#toc-data">16.5 data</a></h2>
5252
5253 <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>.
5254 </p>
5255 <p>For example, to convert a GIF file given inline with <code>ffmpeg</code>:
5256 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i &quot;data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=&quot; smiley.png
5257 </pre></td></tr></table>
5258
5259 <a name="file"></a>
5260 <h2 class="section"><a href="ffplay-all.html#toc-file">16.6 file</a></h2>
5261
5262 <p>File access protocol.
5263 </p>
5264 <p>Allow to read from or write to a file.
5265 </p>
5266 <p>A file URL can have the form:
5267 </p><table><tr><td>&nbsp;</td><td><pre class="example">file:<var>filename</var>
5268 </pre></td></tr></table>
5269
5270 <p>where <var>filename</var> is the path of the file to read.
5271 </p>
5272 <p>An URL that does not have a protocol prefix will be assumed to be a
5273 file URL. Depending on the build, an URL that looks like a Windows
5274 path with the drive letter at the beginning will also be assumed to be
5275 a file URL (usually not the case in builds for unix-like systems).
5276 </p>
5277 <p>For example to read from a file &lsquo;<tt>input.mpeg</tt>&rsquo; with <code>ffmpeg</code>
5278 use the command:
5279 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i file:input.mpeg output.mpeg
5280 </pre></td></tr></table>
5281
5282 <p>This protocol accepts the following options:
5283 </p>
5284 <dl compact="compact">
5285 <dt> &lsquo;<samp>truncate</samp>&rsquo;</dt>
5286 <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
5287 truncating. Default value is 1.
5288 </p>
5289 </dd>
5290 <dt> &lsquo;<samp>blocksize</samp>&rsquo;</dt>
5291 <dd><p>Set I/O operation maximum block size, in bytes. Default value is
5292 <code>INT_MAX</code>, which results in not limiting the requested block size.
5293 Setting this value reasonably low improves user termination request reaction
5294 time, which is valuable for files on slow medium.
5295 </p></dd>
5296 </dl>
5297
5298 <a name="ftp"></a>
5299 <h2 class="section"><a href="ffplay-all.html#toc-ftp">16.7 ftp</a></h2>
5300
5301 <p>FTP (File Transfer Protocol).
5302 </p>
5303 <p>Allow to read from or write to remote resources using FTP protocol.
5304 </p>
5305 <p>Following syntax is required.
5306 </p><table><tr><td>&nbsp;</td><td><pre class="example">ftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
5307 </pre></td></tr></table>
5308
5309 <p>This protocol accepts the following options.
5310 </p>
5311 <dl compact="compact">
5312 <dt> &lsquo;<samp>timeout</samp>&rsquo;</dt>
5313 <dd><p>Set timeout of socket I/O operations used by the underlying low level
5314 operation. By default it is set to -1, which means that the timeout is
5315 not specified.
5316 </p>
5317 </dd>
5318 <dt> &lsquo;<samp>ftp-anonymous-password</samp>&rsquo;</dt>
5319 <dd><p>Password used when login as anonymous user. Typically an e-mail address
5320 should be used.
5321 </p>
5322 </dd>
5323 <dt> &lsquo;<samp>ftp-write-seekable</samp>&rsquo;</dt>
5324 <dd><p>Control seekability of connection during encoding. If set to 1 the
5325 resource is supposed to be seekable, if set to 0 it is assumed not
5326 to be seekable. Default value is 0.
5327 </p></dd>
5328 </dl>
5329
5330 <p>NOTE: Protocol can be used as output, but it is recommended to not do
5331 it, unless special care is taken (tests, customized server configuration
5332 etc.). Different FTP servers behave in different way during seek
5333 operation. ff* tools may produce incomplete content due to server limitations.
5334 </p>
5335 <a name="gopher"></a>
5336 <h2 class="section"><a href="ffplay-all.html#toc-gopher">16.8 gopher</a></h2>
5337
5338 <p>Gopher protocol.
5339 </p>
5340 <a name="hls"></a>
5341 <h2 class="section"><a href="ffplay-all.html#toc-hls">16.9 hls</a></h2>
5342
5343 <p>Read Apple HTTP Live Streaming compliant segmented stream as
5344 a uniform one. The M3U8 playlists describing the segments can be
5345 remote HTTP resources or local files, accessed using the standard
5346 file protocol.
5347 The nested protocol is declared by specifying
5348 &quot;+<var>proto</var>&quot; after the hls URI scheme name, where <var>proto</var>
5349 is either &quot;file&quot; or &quot;http&quot;.
5350 </p>
5351 <table><tr><td>&nbsp;</td><td><pre class="example">hls+http://host/path/to/remote/resource.m3u8
5352 hls+file://path/to/local/resource.m3u8
5353 </pre></td></tr></table>
5354
5355 <p>Using this protocol is discouraged - the hls demuxer should work
5356 just as well (if not, please report the issues) and is more complete.
5357 To use the hls demuxer instead, simply use the direct URLs to the
5358 m3u8 files.
5359 </p>
5360 <a name="http"></a>
5361 <h2 class="section"><a href="ffplay-all.html#toc-http">16.10 http</a></h2>
5362
5363 <p>HTTP (Hyper Text Transfer Protocol).
5364 </p>
5365 <p>This protocol accepts the following options:
5366 </p>
5367 <dl compact="compact">
5368 <dt> &lsquo;<samp>seekable</samp>&rsquo;</dt>
5369 <dd><p>Control seekability of connection. If set to 1 the resource is
5370 supposed to be seekable, if set to 0 it is assumed not to be seekable,
5371 if set to -1 it will try to autodetect if it is seekable. Default
5372 value is -1.
5373 </p>
5374 </dd>
5375 <dt> &lsquo;<samp>chunked_post</samp>&rsquo;</dt>
5376 <dd><p>If set to 1 use chunked Transfer-Encoding for posts, default is 1.
5377 </p>
5378 </dd>
5379 <dt> &lsquo;<samp>content_type</samp>&rsquo;</dt>
5380 <dd><p>Set a specific content type for the POST messages.
5381 </p>
5382 </dd>
5383 <dt> &lsquo;<samp>headers</samp>&rsquo;</dt>
5384 <dd><p>Set custom HTTP headers, can override built in default headers. The
5385 value must be a string encoding the headers.
5386 </p>
5387 </dd>
5388 <dt> &lsquo;<samp>multiple_requests</samp>&rsquo;</dt>
5389 <dd><p>Use persistent connections if set to 1, default is 0.
5390 </p>
5391 </dd>
5392 <dt> &lsquo;<samp>post_data</samp>&rsquo;</dt>
5393 <dd><p>Set custom HTTP post data.
5394 </p>
5395 </dd>
5396 <dt> &lsquo;<samp>user-agent</samp>&rsquo;</dt>
5397 <dt> &lsquo;<samp>user_agent</samp>&rsquo;</dt>
5398 <dd><p>Override the User-Agent header. If not specified the protocol will use a
5399 string describing the libavformat build. (&quot;Lavf/&lt;version&gt;&quot;)
5400 </p>
5401 </dd>
5402 <dt> &lsquo;<samp>timeout</samp>&rsquo;</dt>
5403 <dd><p>Set timeout of socket I/O operations used by the underlying low level
5404 operation. By default it is set to -1, which means that the timeout is
5405 not specified.
5406 </p>
5407 </dd>
5408 <dt> &lsquo;<samp>mime_type</samp>&rsquo;</dt>
5409 <dd><p>Export the MIME type.
5410 </p>
5411 </dd>
5412 <dt> &lsquo;<samp>icy</samp>&rsquo;</dt>
5413 <dd><p>If set to 1 request ICY (SHOUTcast) metadata from the server. If the server
5414 supports this, the metadata has to be retrieved by the application by reading
5415 the &lsquo;<samp>icy_metadata_headers</samp>&rsquo; and &lsquo;<samp>icy_metadata_packet</samp>&rsquo; options.
5416 The default is 0.
5417 </p>
5418 </dd>
5419 <dt> &lsquo;<samp>icy_metadata_headers</samp>&rsquo;</dt>
5420 <dd><p>If the server supports ICY metadata, this contains the ICY-specific HTTP reply
5421 headers, separated by newline characters.
5422 </p>
5423 </dd>
5424 <dt> &lsquo;<samp>icy_metadata_packet</samp>&rsquo;</dt>
5425 <dd><p>If the server supports ICY metadata, and &lsquo;<samp>icy</samp>&rsquo; was set to 1, this
5426 contains the last non-empty metadata packet sent by the server. It should be
5427 polled in regular intervals by applications interested in mid-stream metadata
5428 updates.
5429 </p>
5430 </dd>
5431 <dt> &lsquo;<samp>cookies</samp>&rsquo;</dt>
5432 <dd><p>Set the cookies to be sent in future requests. The format of each cookie is the
5433 same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
5434 delimited by a newline character.
5435 </p>
5436 </dd>
5437 <dt> &lsquo;<samp>offset</samp>&rsquo;</dt>
5438 <dd><p>Set initial byte offset.
5439 </p>
5440 </dd>
5441 <dt> &lsquo;<samp>end_offset</samp>&rsquo;</dt>
5442 <dd><p>Try to limit the request to bytes preceding this offset.
5443 </p></dd>
5444 </dl>
5445
5446 <a name="HTTP-Cookies"></a>
5447 <h3 class="subsection"><a href="ffplay-all.html#toc-HTTP-Cookies">16.10.1 HTTP Cookies</a></h3>
5448
5449 <p>Some HTTP requests will be denied unless cookie values are passed in with the
5450 request. The &lsquo;<samp>cookies</samp>&rsquo; option allows these cookies to be specified. At
5451 the very least, each cookie must specify a value along with a path and domain.
5452 HTTP requests that match both the domain and path will automatically include the
5453 cookie value in the HTTP Cookie header field. Multiple cookies can be delimited
5454 by a newline.
5455 </p>
5456 <p>The required syntax to play a stream specifying a cookie is:
5457 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay -cookies &quot;nlqptid=nltid=tsn; path=/; domain=somedomain.com;&quot; http://somedomain.com/somestream.m3u8
5458 </pre></td></tr></table>
5459
5460 <a name="mmst"></a>
5461 <h2 class="section"><a href="ffplay-all.html#toc-mmst">16.11 mmst</a></h2>
5462
5463 <p>MMS (Microsoft Media Server) protocol over TCP.
5464 </p>
5465 <a name="mmsh"></a>
5466 <h2 class="section"><a href="ffplay-all.html#toc-mmsh">16.12 mmsh</a></h2>
5467
5468 <p>MMS (Microsoft Media Server) protocol over HTTP.
5469 </p>
5470 <p>The required syntax is:
5471 </p><table><tr><td>&nbsp;</td><td><pre class="example">mmsh://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
5472 </pre></td></tr></table>
5473
5474 <a name="md5"></a>
5475 <h2 class="section"><a href="ffplay-all.html#toc-md5">16.13 md5</a></h2>
5476
5477 <p>MD5 output protocol.
5478 </p>
5479 <p>Computes the MD5 hash of the data to be written, and on close writes
5480 this to the designated output or stdout if none is specified. It can
5481 be used to test muxers without writing an actual file.
5482 </p>
5483 <p>Some examples follow.
5484 </p><table><tr><td>&nbsp;</td><td><pre class="example"># Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
5485 ffmpeg -i input.flv -f avi -y md5:output.avi.md5
5486
5487 # Write the MD5 hash of the encoded AVI file to stdout.
5488 ffmpeg -i input.flv -f avi -y md5:
5489 </pre></td></tr></table>
5490
5491 <p>Note that some formats (typically MOV) require the output protocol to
5492 be seekable, so they will fail with the MD5 output protocol.
5493 </p>
5494 <a name="pipe"></a>
5495 <h2 class="section"><a href="ffplay-all.html#toc-pipe">16.14 pipe</a></h2>
5496
5497 <p>UNIX pipe access protocol.
5498 </p>
5499 <p>Allow to read and write from UNIX pipes.
5500 </p>
5501 <p>The accepted syntax is:
5502 </p><table><tr><td>&nbsp;</td><td><pre class="example">pipe:[<var>number</var>]
5503 </pre></td></tr></table>
5504
5505 <p><var>number</var> is the number corresponding to the file descriptor of the
5506 pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr).  If <var>number</var>
5507 is not specified, by default the stdout file descriptor will be used
5508 for writing, stdin for reading.
5509 </p>
5510 <p>For example to read from stdin with <code>ffmpeg</code>:
5511 </p><table><tr><td>&nbsp;</td><td><pre class="example">cat test.wav | ffmpeg -i pipe:0
5512 # ...this is the same as...
5513 cat test.wav | ffmpeg -i pipe:
5514 </pre></td></tr></table>
5515
5516 <p>For writing to stdout with <code>ffmpeg</code>:
5517 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i test.wav -f avi pipe:1 | cat &gt; test.avi
5518 # ...this is the same as...
5519 ffmpeg -i test.wav -f avi pipe: | cat &gt; test.avi
5520 </pre></td></tr></table>
5521
5522 <p>This protocol accepts the following options:
5523 </p>
5524 <dl compact="compact">
5525 <dt> &lsquo;<samp>blocksize</samp>&rsquo;</dt>
5526 <dd><p>Set I/O operation maximum block size, in bytes. Default value is
5527 <code>INT_MAX</code>, which results in not limiting the requested block size.
5528 Setting this value reasonably low improves user termination request reaction
5529 time, which is valuable if data transmission is slow.
5530 </p></dd>
5531 </dl>
5532
5533 <p>Note that some formats (typically MOV), require the output protocol to
5534 be seekable, so they will fail with the pipe output protocol.
5535 </p>
5536 <a name="rtmp"></a>
5537 <h2 class="section"><a href="ffplay-all.html#toc-rtmp">16.15 rtmp</a></h2>
5538
5539 <p>Real-Time Messaging Protocol.
5540 </p>
5541 <p>The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
5542 content across a TCP/IP network.
5543 </p>
5544 <p>The required syntax is:
5545 </p><table><tr><td>&nbsp;</td><td><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>]
5546 </pre></td></tr></table>
5547
5548 <p>The accepted parameters are:
5549 </p><dl compact="compact">
5550 <dt> &lsquo;<samp>username</samp>&rsquo;</dt>
5551 <dd><p>An optional username (mostly for publishing).
5552 </p>
5553 </dd>
5554 <dt> &lsquo;<samp>password</samp>&rsquo;</dt>
5555 <dd><p>An optional password (mostly for publishing).
5556 </p>
5557 </dd>
5558 <dt> &lsquo;<samp>server</samp>&rsquo;</dt>
5559 <dd><p>The address of the RTMP server.
5560 </p>
5561 </dd>
5562 <dt> &lsquo;<samp>port</samp>&rsquo;</dt>
5563 <dd><p>The number of the TCP port to use (by default is 1935).
5564 </p>
5565 </dd>
5566 <dt> &lsquo;<samp>app</samp>&rsquo;</dt>
5567 <dd><p>It is the name of the application to access. It usually corresponds to
5568 the path where the application is installed on the RTMP server
5569 (e.g. &lsquo;<tt>/ondemand/</tt>&rsquo;, &lsquo;<tt>/flash/live/</tt>&rsquo;, etc.). You can override
5570 the value parsed from the URI through the <code>rtmp_app</code> option, too.
5571 </p>
5572 </dd>
5573 <dt> &lsquo;<samp>playpath</samp>&rsquo;</dt>
5574 <dd><p>It is the path or name of the resource to play with reference to the
5575 application specified in <var>app</var>, may be prefixed by &quot;mp4:&quot;. You
5576 can override the value parsed from the URI through the <code>rtmp_playpath</code>
5577 option, too.
5578 </p>
5579 </dd>
5580 <dt> &lsquo;<samp>listen</samp>&rsquo;</dt>
5581 <dd><p>Act as a server, listening for an incoming connection.
5582 </p>
5583 </dd>
5584 <dt> &lsquo;<samp>timeout</samp>&rsquo;</dt>
5585 <dd><p>Maximum time to wait for the incoming connection. Implies listen.
5586 </p></dd>
5587 </dl>
5588
5589 <p>Additionally, the following parameters can be set via command line options
5590 (or in code via <code>AVOption</code>s):
5591 </p><dl compact="compact">
5592 <dt> &lsquo;<samp>rtmp_app</samp>&rsquo;</dt>
5593 <dd><p>Name of application to connect on the RTMP server. This option
5594 overrides the parameter specified in the URI.
5595 </p>
5596 </dd>
5597 <dt> &lsquo;<samp>rtmp_buffer</samp>&rsquo;</dt>
5598 <dd><p>Set the client buffer time in milliseconds. The default is 3000.
5599 </p>
5600 </dd>
5601 <dt> &lsquo;<samp>rtmp_conn</samp>&rsquo;</dt>
5602 <dd><p>Extra arbitrary AMF connection parameters, parsed from a string,
5603 e.g. like <code>B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0</code>.
5604 Each value is prefixed by a single character denoting the type,
5605 B for Boolean, N for number, S for string, O for object, or Z for null,
5606 followed by a colon. For Booleans the data must be either 0 or 1 for
5607 FALSE or TRUE, respectively.  Likewise for Objects the data must be 0 or
5608 1 to end or begin an object, respectively. Data items in subobjects may
5609 be named, by prefixing the type with &rsquo;N&rsquo; and specifying the name before
5610 the value (i.e. <code>NB:myFlag:1</code>). This option may be used multiple
5611 times to construct arbitrary AMF sequences.
5612 </p>
5613 </dd>
5614 <dt> &lsquo;<samp>rtmp_flashver</samp>&rsquo;</dt>
5615 <dd><p>Version of the Flash plugin used to run the SWF player. The default
5616 is LNX 9,0,124,2. (When publishing, the default is FMLE/3.0 (compatible;
5617 &lt;libavformat version&gt;).)
5618 </p>
5619 </dd>
5620 <dt> &lsquo;<samp>rtmp_flush_interval</samp>&rsquo;</dt>
5621 <dd><p>Number of packets flushed in the same request (RTMPT only). The default
5622 is 10.
5623 </p>
5624 </dd>
5625 <dt> &lsquo;<samp>rtmp_live</samp>&rsquo;</dt>
5626 <dd><p>Specify that the media is a live stream. No resuming or seeking in
5627 live streams is possible. The default value is <code>any</code>, which means the
5628 subscriber first tries to play the live stream specified in the
5629 playpath. If a live stream of that name is not found, it plays the
5630 recorded stream. The other possible values are <code>live</code> and
5631 <code>recorded</code>.
5632 </p>
5633 </dd>
5634 <dt> &lsquo;<samp>rtmp_pageurl</samp>&rsquo;</dt>
5635 <dd><p>URL of the web page in which the media was embedded. By default no
5636 value will be sent.
5637 </p>
5638 </dd>
5639 <dt> &lsquo;<samp>rtmp_playpath</samp>&rsquo;</dt>
5640 <dd><p>Stream identifier to play or to publish. This option overrides the
5641 parameter specified in the URI.
5642 </p>
5643 </dd>
5644 <dt> &lsquo;<samp>rtmp_subscribe</samp>&rsquo;</dt>
5645 <dd><p>Name of live stream to subscribe to. By default no value will be sent.
5646 It is only sent if the option is specified or if rtmp_live
5647 is set to live.
5648 </p>
5649 </dd>
5650 <dt> &lsquo;<samp>rtmp_swfhash</samp>&rsquo;</dt>
5651 <dd><p>SHA256 hash of the decompressed SWF file (32 bytes).
5652 </p>
5653 </dd>
5654 <dt> &lsquo;<samp>rtmp_swfsize</samp>&rsquo;</dt>
5655 <dd><p>Size of the decompressed SWF file, required for SWFVerification.
5656 </p>
5657 </dd>
5658 <dt> &lsquo;<samp>rtmp_swfurl</samp>&rsquo;</dt>
5659 <dd><p>URL of the SWF player for the media. By default no value will be sent.
5660 </p>
5661 </dd>
5662 <dt> &lsquo;<samp>rtmp_swfverify</samp>&rsquo;</dt>
5663 <dd><p>URL to player swf file, compute hash/size automatically.
5664 </p>
5665 </dd>
5666 <dt> &lsquo;<samp>rtmp_tcurl</samp>&rsquo;</dt>
5667 <dd><p>URL of the target stream. Defaults to proto://host[:port]/app.
5668 </p>
5669 </dd>
5670 </dl>
5671
5672 <p>For example to read with <code>ffplay</code> a multimedia resource named
5673 &quot;sample&quot; from the application &quot;vod&quot; from an RTMP server &quot;myserver&quot;:
5674 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay rtmp://myserver/vod/sample
5675 </pre></td></tr></table>
5676
5677 <p>To publish to a password protected server, passing the playpath and
5678 app names separately:
5679 </p><table><tr><td>&nbsp;</td><td><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/
5680 </pre></td></tr></table>
5681
5682 <a name="rtmpe"></a>
5683 <h2 class="section"><a href="ffplay-all.html#toc-rtmpe">16.16 rtmpe</a></h2>
5684
5685 <p>Encrypted Real-Time Messaging Protocol.
5686 </p>
5687 <p>The Encrypted Real-Time Messaging Protocol (RTMPE) is used for
5688 streaming multimedia content within standard cryptographic primitives,
5689 consisting of Diffie-Hellman key exchange and HMACSHA256, generating
5690 a pair of RC4 keys.
5691 </p>
5692 <a name="rtmps"></a>
5693 <h2 class="section"><a href="ffplay-all.html#toc-rtmps">16.17 rtmps</a></h2>
5694
5695 <p>Real-Time Messaging Protocol over a secure SSL connection.
5696 </p>
5697 <p>The Real-Time Messaging Protocol (RTMPS) is used for streaming
5698 multimedia content across an encrypted connection.
5699 </p>
5700 <a name="rtmpt"></a>
5701 <h2 class="section"><a href="ffplay-all.html#toc-rtmpt">16.18 rtmpt</a></h2>
5702
5703 <p>Real-Time Messaging Protocol tunneled through HTTP.
5704 </p>
5705 <p>The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used
5706 for streaming multimedia content within HTTP requests to traverse
5707 firewalls.
5708 </p>
5709 <a name="rtmpte"></a>
5710 <h2 class="section"><a href="ffplay-all.html#toc-rtmpte">16.19 rtmpte</a></h2>
5711
5712 <p>Encrypted Real-Time Messaging Protocol tunneled through HTTP.
5713 </p>
5714 <p>The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE)
5715 is used for streaming multimedia content within HTTP requests to traverse
5716 firewalls.
5717 </p>
5718 <a name="rtmpts"></a>
5719 <h2 class="section"><a href="ffplay-all.html#toc-rtmpts">16.20 rtmpts</a></h2>
5720
5721 <p>Real-Time Messaging Protocol tunneled through HTTPS.
5722 </p>
5723 <p>The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used
5724 for streaming multimedia content within HTTPS requests to traverse
5725 firewalls.
5726 </p>
5727 <a name="libssh"></a>
5728 <h2 class="section"><a href="ffplay-all.html#toc-libssh">16.21 libssh</a></h2>
5729
5730 <p>Secure File Transfer Protocol via libssh
5731 </p>
5732 <p>Allow to read from or write to remote resources using SFTP protocol.
5733 </p>
5734 <p>Following syntax is required.
5735 </p>
5736 <table><tr><td>&nbsp;</td><td><pre class="example">sftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
5737 </pre></td></tr></table>
5738
5739 <p>This protocol accepts the following options.
5740 </p>
5741 <dl compact="compact">
5742 <dt> &lsquo;<samp>timeout</samp>&rsquo;</dt>
5743 <dd><p>Set timeout of socket I/O operations used by the underlying low level
5744 operation. By default it is set to -1, which means that the timeout
5745 is not specified.
5746 </p>
5747 </dd>
5748 <dt> &lsquo;<samp>truncate</samp>&rsquo;</dt>
5749 <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
5750 truncating. Default value is 1.
5751 </p>
5752 </dd>
5753 <dt> &lsquo;<samp>private_key</samp>&rsquo;</dt>
5754 <dd><p>Specify the path of the file containing private key to use during authorization.
5755 By default libssh searches for keys in the &lsquo;<tt>~/.ssh/</tt>&rsquo; directory.
5756 </p>
5757 </dd>
5758 </dl>
5759
5760 <p>Example: Play a file stored on remote server.
5761 </p>
5762 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay sftp://user:password@server_address:22/home/user/resource.mpeg
5763 </pre></td></tr></table>
5764
5765 <a name="librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte"></a>
5766 <h2 class="section"><a href="ffplay-all.html#toc-librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">16.22 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></h2>
5767
5768 <p>Real-Time Messaging Protocol and its variants supported through
5769 librtmp.
5770 </p>
5771 <p>Requires the presence of the librtmp headers and library during
5772 configuration. You need to explicitly configure the build with
5773 &quot;&ndash;enable-librtmp&quot;. If enabled this will replace the native RTMP
5774 protocol.
5775 </p>
5776 <p>This protocol provides most client functions and a few server
5777 functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
5778 encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
5779 variants of these encrypted types (RTMPTE, RTMPTS).
5780 </p>
5781 <p>The required syntax is:
5782 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>rtmp_proto</var>://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>] <var>options</var>
5783 </pre></td></tr></table>
5784
5785 <p>where <var>rtmp_proto</var> is one of the strings &quot;rtmp&quot;, &quot;rtmpt&quot;, &quot;rtmpe&quot;,
5786 &quot;rtmps&quot;, &quot;rtmpte&quot;, &quot;rtmpts&quot; corresponding to each RTMP variant, and
5787 <var>server</var>, <var>port</var>, <var>app</var> and <var>playpath</var> have the same
5788 meaning as specified for the RTMP native protocol.
5789 <var>options</var> contains a list of space-separated options of the form
5790 <var>key</var>=<var>val</var>.
5791 </p>
5792 <p>See the librtmp manual page (man 3 librtmp) for more information.
5793 </p>
5794 <p>For example, to stream a file in real-time to an RTMP server using
5795 <code>ffmpeg</code>:
5796 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
5797 </pre></td></tr></table>
5798
5799 <p>To play the same stream using <code>ffplay</code>:
5800 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay &quot;rtmp://myserver/live/mystream live=1&quot;
5801 </pre></td></tr></table>
5802
5803 <a name="rtp"></a>
5804 <h2 class="section"><a href="ffplay-all.html#toc-rtp">16.23 rtp</a></h2>
5805
5806 <p>Real-time Transport Protocol.
5807 </p>
5808 <p>The required syntax for an RTP URL is:
5809 rtp://<var>hostname</var>[:<var>port</var>][?<var>option</var>=<var>val</var>...]
5810 </p>
5811 <p><var>port</var> specifies the RTP port to use.
5812 </p>
5813 <p>The following URL options are supported:
5814 </p>
5815 <dl compact="compact">
5816 <dt> &lsquo;<samp>ttl=<var>n</var></samp>&rsquo;</dt>
5817 <dd><p>Set the TTL (Time-To-Live) value (for multicast only).
5818 </p>
5819 </dd>
5820 <dt> &lsquo;<samp>rtcpport=<var>n</var></samp>&rsquo;</dt>
5821 <dd><p>Set the remote RTCP port to <var>n</var>.
5822 </p>
5823 </dd>
5824 <dt> &lsquo;<samp>localrtpport=<var>n</var></samp>&rsquo;</dt>
5825 <dd><p>Set the local RTP port to <var>n</var>.
5826 </p>
5827 </dd>
5828 <dt> &lsquo;<samp>localrtcpport=<var>n</var>'</samp>&rsquo;</dt>
5829 <dd><p>Set the local RTCP port to <var>n</var>.
5830 </p>
5831 </dd>
5832 <dt> &lsquo;<samp>pkt_size=<var>n</var></samp>&rsquo;</dt>
5833 <dd><p>Set max packet size (in bytes) to <var>n</var>.
5834 </p>
5835 </dd>
5836 <dt> &lsquo;<samp>connect=0|1</samp>&rsquo;</dt>
5837 <dd><p>Do a <code>connect()</code> on the UDP socket (if set to 1) or not (if set
5838 to 0).
5839 </p>
5840 </dd>
5841 <dt> &lsquo;<samp>sources=<var>ip</var>[,<var>ip</var>]</samp>&rsquo;</dt>
5842 <dd><p>List allowed source IP addresses.
5843 </p>
5844 </dd>
5845 <dt> &lsquo;<samp>block=<var>ip</var>[,<var>ip</var>]</samp>&rsquo;</dt>
5846 <dd><p>List disallowed (blocked) source IP addresses.
5847 </p>
5848 </dd>
5849 <dt> &lsquo;<samp>write_to_source=0|1</samp>&rsquo;</dt>
5850 <dd><p>Send packets to the source address of the latest received packet (if
5851 set to 1) or to a default remote address (if set to 0).
5852 </p>
5853 </dd>
5854 <dt> &lsquo;<samp>localport=<var>n</var></samp>&rsquo;</dt>
5855 <dd><p>Set the local RTP port to <var>n</var>.
5856 </p>
5857 <p>This is a deprecated option. Instead, &lsquo;<samp>localrtpport</samp>&rsquo; should be
5858 used.
5859 </p>
5860 </dd>
5861 </dl>
5862
5863 <p>Important notes:
5864 </p>
5865 <ol>
5866 <li>
5867 If &lsquo;<samp>rtcpport</samp>&rsquo; is not set the RTCP port will be set to the RTP
5868 port value plus 1.
5869
5870 </li><li>
5871 If &lsquo;<samp>localrtpport</samp>&rsquo; (the local RTP port) is not set any available
5872 port will be used for the local RTP and RTCP ports.
5873
5874 </li><li>
5875 If &lsquo;<samp>localrtcpport</samp>&rsquo; (the local RTCP port) is not set it will be
5876 set to the the local RTP port value plus 1.
5877 </li></ol>
5878
5879 <a name="rtsp"></a>
5880 <h2 class="section"><a href="ffplay-all.html#toc-rtsp">16.24 rtsp</a></h2>
5881
5882 <p>Real-Time Streaming Protocol.
5883 </p>
5884 <p>RTSP is not technically a protocol handler in libavformat, it is a demuxer
5885 and muxer. The demuxer supports both normal RTSP (with data transferred
5886 over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
5887 data transferred over RDT).
5888 </p>
5889 <p>The muxer can be used to send a stream using RTSP ANNOUNCE to a server
5890 supporting it (currently Darwin Streaming Server and Mischa Spiegelmock&rsquo;s
5891 <a href="http://github.com/revmischa/rtsp-server">RTSP server</a>).
5892 </p>
5893 <p>The required syntax for a RTSP url is:
5894 </p><table><tr><td>&nbsp;</td><td><pre class="example">rtsp://<var>hostname</var>[:<var>port</var>]/<var>path</var>
5895 </pre></td></tr></table>
5896
5897 <p>Options can be set on the <code>ffmpeg</code>/<code>ffplay</code> command
5898 line, or set in code via <code>AVOption</code>s or in
5899 <code>avformat_open_input</code>.
5900 </p>
5901 <p>The following options are supported.
5902 </p>
5903 <dl compact="compact">
5904 <dt> &lsquo;<samp>initial_pause</samp>&rsquo;</dt>
5905 <dd><p>Do not start playing the stream immediately if set to 1. Default value
5906 is 0.
5907 </p>
5908 </dd>
5909 <dt> &lsquo;<samp>rtsp_transport</samp>&rsquo;</dt>
5910 <dd><p>Set RTSP trasport protocols.
5911 </p>
5912 <p>It accepts the following values:
5913 </p><dl compact="compact">
5914 <dt> &lsquo;<samp>udp</samp>&rsquo;</dt>
5915 <dd><p>Use UDP as lower transport protocol.
5916 </p>
5917 </dd>
5918 <dt> &lsquo;<samp>tcp</samp>&rsquo;</dt>
5919 <dd><p>Use TCP (interleaving within the RTSP control channel) as lower
5920 transport protocol.
5921 </p>
5922 </dd>
5923 <dt> &lsquo;<samp>udp_multicast</samp>&rsquo;</dt>
5924 <dd><p>Use UDP multicast as lower transport protocol.
5925 </p>
5926 </dd>
5927 <dt> &lsquo;<samp>http</samp>&rsquo;</dt>
5928 <dd><p>Use HTTP tunneling as lower transport protocol, which is useful for
5929 passing proxies.
5930 </p></dd>
5931 </dl>
5932
5933 <p>Multiple lower transport protocols may be specified, in that case they are
5934 tried one at a time (if the setup of one fails, the next one is tried).
5935 For the muxer, only the &lsquo;<samp>tcp</samp>&rsquo; and &lsquo;<samp>udp</samp>&rsquo; options are supported.
5936 </p>
5937 </dd>
5938 <dt> &lsquo;<samp>rtsp_flags</samp>&rsquo;</dt>
5939 <dd><p>Set RTSP flags.
5940 </p>
5941 <p>The following values are accepted:
5942 </p><dl compact="compact">
5943 <dt> &lsquo;<samp>filter_src</samp>&rsquo;</dt>
5944 <dd><p>Accept packets only from negotiated peer address and port.
5945 </p></dd>
5946 <dt> &lsquo;<samp>listen</samp>&rsquo;</dt>
5947 <dd><p>Act as a server, listening for an incoming connection.
5948 </p></dd>
5949 </dl>
5950
5951 <p>Default value is &lsquo;<samp>none</samp>&rsquo;.
5952 </p>
5953 </dd>
5954 <dt> &lsquo;<samp>allowed_media_types</samp>&rsquo;</dt>
5955 <dd><p>Set media types to accept from the server.
5956 </p>
5957 <p>The following flags are accepted:
5958 </p><dl compact="compact">
5959 <dt> &lsquo;<samp>video</samp>&rsquo;</dt>
5960 <dt> &lsquo;<samp>audio</samp>&rsquo;</dt>
5961 <dt> &lsquo;<samp>data</samp>&rsquo;</dt>
5962 </dl>
5963
5964 <p>By default it accepts all media types.
5965 </p>
5966 </dd>
5967 <dt> &lsquo;<samp>min_port</samp>&rsquo;</dt>
5968 <dd><p>Set minimum local UDP port. Default value is 5000.
5969 </p>
5970 </dd>
5971 <dt> &lsquo;<samp>max_port</samp>&rsquo;</dt>
5972 <dd><p>Set maximum local UDP port. Default value is 65000.
5973 </p>
5974 </dd>
5975 <dt> &lsquo;<samp>timeout</samp>&rsquo;</dt>
5976 <dd><p>Set maximum timeout (in seconds) to wait for incoming connections.
5977 </p>
5978 <p>A value of -1 mean infinite (default). This option implies the
5979 &lsquo;<samp>rtsp_flags</samp>&rsquo; set to &lsquo;<samp>listen</samp>&rsquo;.
5980 </p>
5981 </dd>
5982 <dt> &lsquo;<samp>reorder_queue_size</samp>&rsquo;</dt>
5983 <dd><p>Set number of packets to buffer for handling of reordered packets.
5984 </p>
5985 </dd>
5986 <dt> &lsquo;<samp>stimeout</samp>&rsquo;</dt>
5987 <dd><p>Set socket TCP I/O timeout in micro seconds.
5988 </p>
5989 </dd>
5990 <dt> &lsquo;<samp>user-agent</samp>&rsquo;</dt>
5991 <dd><p>Override User-Agent header. If not specified, it default to the
5992 libavformat identifier string.
5993 </p></dd>
5994 </dl>
5995
5996 <p>When receiving data over UDP, the demuxer tries to reorder received packets
5997 (since they may arrive out of order, or packets may get lost totally). This
5998 can be disabled by setting the maximum demuxing delay to zero (via
5999 the <code>max_delay</code> field of AVFormatContext).
6000 </p>
6001 <p>When watching multi-bitrate Real-RTSP streams with <code>ffplay</code>, the
6002 streams to display can be chosen with <code>-vst</code> <var>n</var> and
6003 <code>-ast</code> <var>n</var> for video and audio respectively, and can be switched
6004 on the fly by pressing <code>v</code> and <code>a</code>.
6005 </p>
6006 <a name="Examples-78"></a>
6007 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-78">16.24.1 Examples</a></h3>
6008
6009 <p>The following examples all make use of the <code>ffplay</code> and
6010 <code>ffmpeg</code> tools.
6011 </p>
6012 <ul>
6013 <li>
6014 Watch a stream over UDP, with a max reordering delay of 0.5 seconds:
6015 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
6016 </pre></td></tr></table>
6017
6018 </li><li>
6019 Watch a stream tunneled over HTTP:
6020 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -rtsp_transport http rtsp://server/video.mp4
6021 </pre></td></tr></table>
6022
6023 </li><li>
6024 Send a stream in realtime to a RTSP server, for others to watch:
6025 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
6026 </pre></td></tr></table>
6027
6028 </li><li>
6029 Receive a stream in realtime:
6030 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp <var>output</var>
6031 </pre></td></tr></table>
6032 </li></ul>
6033
6034 <a name="sap"></a>
6035 <h2 class="section"><a href="ffplay-all.html#toc-sap">16.25 sap</a></h2>
6036
6037 <p>Session Announcement Protocol (RFC 2974). This is not technically a
6038 protocol handler in libavformat, it is a muxer and demuxer.
6039 It is used for signalling of RTP streams, by announcing the SDP for the
6040 streams regularly on a separate port.
6041 </p>
6042 <a name="Muxer"></a>
6043 <h3 class="subsection"><a href="ffplay-all.html#toc-Muxer">16.25.1 Muxer</a></h3>
6044
6045 <p>The syntax for a SAP url given to the muxer is:
6046 </p><table><tr><td>&nbsp;</td><td><pre class="example">sap://<var>destination</var>[:<var>port</var>][?<var>options</var>]
6047 </pre></td></tr></table>
6048
6049 <p>The RTP packets are sent to <var>destination</var> on port <var>port</var>,
6050 or to port 5004 if no port is specified.
6051 <var>options</var> is a <code>&amp;</code>-separated list. The following options
6052 are supported:
6053 </p>
6054 <dl compact="compact">
6055 <dt> &lsquo;<samp>announce_addr=<var>address</var></samp>&rsquo;</dt>
6056 <dd><p>Specify the destination IP address for sending the announcements to.
6057 If omitted, the announcements are sent to the commonly used SAP
6058 announcement multicast address 224.2.127.254 (sap.mcast.net), or
6059 ff0e::2:7ffe if <var>destination</var> is an IPv6 address.
6060 </p>
6061 </dd>
6062 <dt> &lsquo;<samp>announce_port=<var>port</var></samp>&rsquo;</dt>
6063 <dd><p>Specify the port to send the announcements on, defaults to
6064 9875 if not specified.
6065 </p>
6066 </dd>
6067 <dt> &lsquo;<samp>ttl=<var>ttl</var></samp>&rsquo;</dt>
6068 <dd><p>Specify the time to live value for the announcements and RTP packets,
6069 defaults to 255.
6070 </p>
6071 </dd>
6072 <dt> &lsquo;<samp>same_port=<var>0|1</var></samp>&rsquo;</dt>
6073 <dd><p>If set to 1, send all RTP streams on the same port pair. If zero (the
6074 default), all streams are sent on unique ports, with each stream on a
6075 port 2 numbers higher than the previous.
6076 VLC/Live555 requires this to be set to 1, to be able to receive the stream.
6077 The RTP stack in libavformat for receiving requires all streams to be sent
6078 on unique ports.
6079 </p></dd>
6080 </dl>
6081
6082 <p>Example command lines follow.
6083 </p>
6084 <p>To broadcast a stream on the local subnet, for watching in VLC:
6085 </p>
6086 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255?same_port=1
6087 </pre></td></tr></table>
6088
6089 <p>Similarly, for watching in <code>ffplay</code>:
6090 </p>
6091 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255
6092 </pre></td></tr></table>
6093
6094 <p>And for watching in <code>ffplay</code>, over IPv6:
6095 </p>
6096 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://[ff0e::1:2:3:4]
6097 </pre></td></tr></table>
6098
6099 <a name="Demuxer"></a>
6100 <h3 class="subsection"><a href="ffplay-all.html#toc-Demuxer">16.25.2 Demuxer</a></h3>
6101
6102 <p>The syntax for a SAP url given to the demuxer is:
6103 </p><table><tr><td>&nbsp;</td><td><pre class="example">sap://[<var>address</var>][:<var>port</var>]
6104 </pre></td></tr></table>
6105
6106 <p><var>address</var> is the multicast address to listen for announcements on,
6107 if omitted, the default 224.2.127.254 (sap.mcast.net) is used. <var>port</var>
6108 is the port that is listened on, 9875 if omitted.
6109 </p>
6110 <p>The demuxers listens for announcements on the given address and port.
6111 Once an announcement is received, it tries to receive that particular stream.
6112 </p>
6113 <p>Example command lines follow.
6114 </p>
6115 <p>To play back the first stream announced on the normal SAP multicast address:
6116 </p>
6117 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay sap://
6118 </pre></td></tr></table>
6119
6120 <p>To play back the first stream announced on one the default IPv6 SAP multicast address:
6121 </p>
6122 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay sap://[ff0e::2:7ffe]
6123 </pre></td></tr></table>
6124
6125 <a name="sctp"></a>
6126 <h2 class="section"><a href="ffplay-all.html#toc-sctp">16.26 sctp</a></h2>
6127
6128 <p>Stream Control Transmission Protocol.
6129 </p>
6130 <p>The accepted URL syntax is:
6131 </p><table><tr><td>&nbsp;</td><td><pre class="example">sctp://<var>host</var>:<var>port</var>[?<var>options</var>]
6132 </pre></td></tr></table>
6133
6134 <p>The protocol accepts the following options:
6135 </p><dl compact="compact">
6136 <dt> &lsquo;<samp>listen</samp>&rsquo;</dt>
6137 <dd><p>If set to any value, listen for an incoming connection. Outgoing connection is done by default.
6138 </p>
6139 </dd>
6140 <dt> &lsquo;<samp>max_streams</samp>&rsquo;</dt>
6141 <dd><p>Set the maximum number of streams. By default no limit is set.
6142 </p></dd>
6143 </dl>
6144
6145 <a name="srtp"></a>
6146 <h2 class="section"><a href="ffplay-all.html#toc-srtp">16.27 srtp</a></h2>
6147
6148 <p>Secure Real-time Transport Protocol.
6149 </p>
6150 <p>The accepted options are:
6151 </p><dl compact="compact">
6152 <dt> &lsquo;<samp>srtp_in_suite</samp>&rsquo;</dt>
6153 <dt> &lsquo;<samp>srtp_out_suite</samp>&rsquo;</dt>
6154 <dd><p>Select input and output encoding suites.
6155 </p>
6156 <p>Supported values:
6157 </p><dl compact="compact">
6158 <dt> &lsquo;<samp>AES_CM_128_HMAC_SHA1_80</samp>&rsquo;</dt>
6159 <dt> &lsquo;<samp>SRTP_AES128_CM_HMAC_SHA1_80</samp>&rsquo;</dt>
6160 <dt> &lsquo;<samp>AES_CM_128_HMAC_SHA1_32</samp>&rsquo;</dt>
6161 <dt> &lsquo;<samp>SRTP_AES128_CM_HMAC_SHA1_32</samp>&rsquo;</dt>
6162 </dl>
6163
6164 </dd>
6165 <dt> &lsquo;<samp>srtp_in_params</samp>&rsquo;</dt>
6166 <dt> &lsquo;<samp>srtp_out_params</samp>&rsquo;</dt>
6167 <dd><p>Set input and output encoding parameters, which are expressed by a
6168 base64-encoded representation of a binary block. The first 16 bytes of
6169 this binary block are used as master key, the following 14 bytes are
6170 used as master salt.
6171 </p></dd>
6172 </dl>
6173
6174 <a name="tcp"></a>
6175 <h2 class="section"><a href="ffplay-all.html#toc-tcp">16.28 tcp</a></h2>
6176
6177 <p>Transmission Control Protocol.
6178 </p>
6179 <p>The required syntax for a TCP url is:
6180 </p><table><tr><td>&nbsp;</td><td><pre class="example">tcp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
6181 </pre></td></tr></table>
6182
6183 <p><var>options</var> contains a list of &amp;-separated options of the form
6184 <var>key</var>=<var>val</var>.
6185 </p>
6186 <p>The list of supported options follows.
6187 </p>
6188 <dl compact="compact">
6189 <dt> &lsquo;<samp>listen=<var>1|0</var></samp>&rsquo;</dt>
6190 <dd><p>Listen for an incoming connection. Default value is 0.
6191 </p>
6192 </dd>
6193 <dt> &lsquo;<samp>timeout=<var>microseconds</var></samp>&rsquo;</dt>
6194 <dd><p>Set raise error timeout, expressed in microseconds.
6195 </p>
6196 <p>This option is only relevant in read mode: if no data arrived in more
6197 than this time interval, raise error.
6198 </p>
6199 </dd>
6200 <dt> &lsquo;<samp>listen_timeout=<var>microseconds</var></samp>&rsquo;</dt>
6201 <dd><p>Set listen timeout, expressed in microseconds.
6202 </p></dd>
6203 </dl>
6204
6205 <p>The following example shows how to setup a listening TCP connection
6206 with <code>ffmpeg</code>, which is then accessed with <code>ffplay</code>:
6207 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> tcp://<var>hostname</var>:<var>port</var>?listen
6208 ffplay tcp://<var>hostname</var>:<var>port</var>
6209 </pre></td></tr></table>
6210
6211 <a name="tls"></a>
6212 <h2 class="section"><a href="ffplay-all.html#toc-tls">16.29 tls</a></h2>
6213
6214 <p>Transport Layer Security (TLS) / Secure Sockets Layer (SSL)
6215 </p>
6216 <p>The required syntax for a TLS/SSL url is:
6217 </p><table><tr><td>&nbsp;</td><td><pre class="example">tls://<var>hostname</var>:<var>port</var>[?<var>options</var>]
6218 </pre></td></tr></table>
6219
6220 <p>The following parameters can be set via command line options
6221 (or in code via <code>AVOption</code>s):
6222 </p>
6223 <dl compact="compact">
6224 <dt> &lsquo;<samp>ca_file, cafile=<var>filename</var></samp>&rsquo;</dt>
6225 <dd><p>A file containing certificate authority (CA) root certificates to treat
6226 as trusted. If the linked TLS library contains a default this might not
6227 need to be specified for verification to work, but not all libraries and
6228 setups have defaults built in.
6229 The file must be in OpenSSL PEM format.
6230 </p>
6231 </dd>
6232 <dt> &lsquo;<samp>tls_verify=<var>1|0</var></samp>&rsquo;</dt>
6233 <dd><p>If enabled, try to verify the peer that we are communicating with.
6234 Note, if using OpenSSL, this currently only makes sure that the
6235 peer certificate is signed by one of the root certificates in the CA
6236 database, but it does not validate that the certificate actually
6237 matches the host name we are trying to connect to. (With GnuTLS,
6238 the host name is validated as well.)
6239 </p>
6240 <p>This is disabled by default since it requires a CA database to be
6241 provided by the caller in many cases.
6242 </p>
6243 </dd>
6244 <dt> &lsquo;<samp>cert_file, cert=<var>filename</var></samp>&rsquo;</dt>
6245 <dd><p>A file containing a certificate to use in the handshake with the peer.
6246 (When operating as server, in listen mode, this is more often required
6247 by the peer, while client certificates only are mandated in certain
6248 setups.)
6249 </p>
6250 </dd>
6251 <dt> &lsquo;<samp>key_file, key=<var>filename</var></samp>&rsquo;</dt>
6252 <dd><p>A file containing the private key for the certificate.
6253 </p>
6254 </dd>
6255 <dt> &lsquo;<samp>listen=<var>1|0</var></samp>&rsquo;</dt>
6256 <dd><p>If enabled, listen for connections on the provided port, and assume
6257 the server role in the handshake instead of the client role.
6258 </p>
6259 </dd>
6260 </dl>
6261
6262 <p>Example command lines:
6263 </p>
6264 <p>To create a TLS/SSL server that serves an input stream.
6265 </p>
6266 <table><tr><td>&nbsp;</td><td><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>
6267 </pre></td></tr></table>
6268
6269 <p>To play back a stream from the TLS/SSL server using <code>ffplay</code>:
6270 </p>
6271 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay tls://<var>hostname</var>:<var>port</var>
6272 </pre></td></tr></table>
6273
6274 <a name="udp"></a>
6275 <h2 class="section"><a href="ffplay-all.html#toc-udp">16.30 udp</a></h2>
6276
6277 <p>User Datagram Protocol.
6278 </p>
6279 <p>The required syntax for an UDP URL is:
6280 </p><table><tr><td>&nbsp;</td><td><pre class="example">udp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
6281 </pre></td></tr></table>
6282
6283 <p><var>options</var> contains a list of &amp;-separated options of the form <var>key</var>=<var>val</var>.
6284 </p>
6285 <p>In case threading is enabled on the system, a circular buffer is used
6286 to store the incoming data, which allows one to reduce loss of data due to
6287 UDP socket buffer overruns. The <var>fifo_size</var> and
6288 <var>overrun_nonfatal</var> options are related to this buffer.
6289 </p>
6290 <p>The list of supported options follows.
6291 </p>
6292 <dl compact="compact">
6293 <dt> &lsquo;<samp>buffer_size=<var>size</var></samp>&rsquo;</dt>
6294 <dd><p>Set the UDP socket buffer size in bytes. This is used both for the
6295 receiving and the sending buffer size.
6296 </p>
6297 </dd>
6298 <dt> &lsquo;<samp>localport=<var>port</var></samp>&rsquo;</dt>
6299 <dd><p>Override the local UDP port to bind with.
6300 </p>
6301 </dd>
6302 <dt> &lsquo;<samp>localaddr=<var>addr</var></samp>&rsquo;</dt>
6303 <dd><p>Choose the local IP address. This is useful e.g. if sending multicast
6304 and the host has multiple interfaces, where the user can choose
6305 which interface to send on by specifying the IP address of that interface.
6306 </p>
6307 </dd>
6308 <dt> &lsquo;<samp>pkt_size=<var>size</var></samp>&rsquo;</dt>
6309 <dd><p>Set the size in bytes of UDP packets.
6310 </p>
6311 </dd>
6312 <dt> &lsquo;<samp>reuse=<var>1|0</var></samp>&rsquo;</dt>
6313 <dd><p>Explicitly allow or disallow reusing UDP sockets.
6314 </p>
6315 </dd>
6316 <dt> &lsquo;<samp>ttl=<var>ttl</var></samp>&rsquo;</dt>
6317 <dd><p>Set the time to live value (for multicast only).
6318 </p>
6319 </dd>
6320 <dt> &lsquo;<samp>connect=<var>1|0</var></samp>&rsquo;</dt>
6321 <dd><p>Initialize the UDP socket with <code>connect()</code>. In this case, the
6322 destination address can&rsquo;t be changed with ff_udp_set_remote_url later.
6323 If the destination address isn&rsquo;t known at the start, this option can
6324 be specified in ff_udp_set_remote_url, too.
6325 This allows finding out the source address for the packets with getsockname,
6326 and makes writes return with AVERROR(ECONNREFUSED) if &quot;destination
6327 unreachable&quot; is received.
6328 For receiving, this gives the benefit of only receiving packets from
6329 the specified peer address/port.
6330 </p>
6331 </dd>
6332 <dt> &lsquo;<samp>sources=<var>address</var>[,<var>address</var>]</samp>&rsquo;</dt>
6333 <dd><p>Only receive packets sent to the multicast group from one of the
6334 specified sender IP addresses.
6335 </p>
6336 </dd>
6337 <dt> &lsquo;<samp>block=<var>address</var>[,<var>address</var>]</samp>&rsquo;</dt>
6338 <dd><p>Ignore packets sent to the multicast group from the specified
6339 sender IP addresses.
6340 </p>
6341 </dd>
6342 <dt> &lsquo;<samp>fifo_size=<var>units</var></samp>&rsquo;</dt>
6343 <dd><p>Set the UDP receiving circular buffer size, expressed as a number of
6344 packets with size of 188 bytes. If not specified defaults to 7*4096.
6345 </p>
6346 </dd>
6347 <dt> &lsquo;<samp>overrun_nonfatal=<var>1|0</var></samp>&rsquo;</dt>
6348 <dd><p>Survive in case of UDP receiving circular buffer overrun. Default
6349 value is 0.
6350 </p>
6351 </dd>
6352 <dt> &lsquo;<samp>timeout=<var>microseconds</var></samp>&rsquo;</dt>
6353 <dd><p>Set raise error timeout, expressed in microseconds.
6354 </p>
6355 <p>This option is only relevant in read mode: if no data arrived in more
6356 than this time interval, raise error.
6357 </p></dd>
6358 </dl>
6359
6360 <a name="Examples-53"></a>
6361 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-53">16.30.1 Examples</a></h3>
6362
6363 <ul>
6364 <li>
6365 Use <code>ffmpeg</code> to stream over UDP to a remote endpoint:
6366 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> udp://<var>hostname</var>:<var>port</var>
6367 </pre></td></tr></table>
6368
6369 </li><li>
6370 Use <code>ffmpeg</code> to stream in mpegts format over UDP using 188
6371 sized UDP packets, using a large input buffer:
6372 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i <var>input</var> -f mpegts udp://<var>hostname</var>:<var>port</var>?pkt_size=188&amp;buffer_size=65535
6373 </pre></td></tr></table>
6374
6375 </li><li>
6376 Use <code>ffmpeg</code> to receive over UDP from a remote endpoint:
6377 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i udp://[<var>multicast-address</var>]:<var>port</var> ...
6378 </pre></td></tr></table>
6379 </li></ul>
6380
6381 <a name="unix"></a>
6382 <h2 class="section"><a href="ffplay-all.html#toc-unix">16.31 unix</a></h2>
6383
6384 <p>Unix local socket
6385 </p>
6386 <p>The required syntax for a Unix socket URL is:
6387 </p>
6388 <table><tr><td>&nbsp;</td><td><pre class="example">unix://<var>filepath</var>
6389 </pre></td></tr></table>
6390
6391 <p>The following parameters can be set via command line options
6392 (or in code via <code>AVOption</code>s):
6393 </p>
6394 <dl compact="compact">
6395 <dt> &lsquo;<samp>timeout</samp>&rsquo;</dt>
6396 <dd><p>Timeout in ms.
6397 </p></dd>
6398 <dt> &lsquo;<samp>listen</samp>&rsquo;</dt>
6399 <dd><p>Create the Unix socket in listening mode.
6400 </p></dd>
6401 </dl>
6402
6403 <a name="Device-Options"></a>
6404 <h1 class="chapter"><a href="ffplay-all.html#toc-Device-Options">17. Device Options</a></h1>
6405
6406 <p>The libavdevice library provides the same interface as
6407 libavformat. Namely, an input device is considered like a demuxer, and
6408 an output device like a muxer, and the interface and generic device
6409 options are the same provided by libavformat (see the ffmpeg-formats
6410 manual).
6411 </p>
6412 <p>In addition each input or output device may support so-called private
6413 options, which are specific for that component.
6414 </p>
6415 <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
6416 FFmpeg tools, or by setting the value explicitly in the device
6417 <code>AVFormatContext</code> options or using the &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API
6418 for programmatic use.
6419 </p>
6420
6421 <a name="Input-Devices"></a>
6422 <h1 class="chapter"><a href="ffplay-all.html#toc-Input-Devices">18. Input Devices</a></h1>
6423
6424 <p>Input devices are configured elements in FFmpeg which allow to access
6425 the data coming from a multimedia device attached to your system.
6426 </p>
6427 <p>When you configure your FFmpeg build, all the supported input devices
6428 are enabled by default. You can list all available ones using the
6429 configure option &quot;&ndash;list-indevs&quot;.
6430 </p>
6431 <p>You can disable all the input devices using the configure option
6432 &quot;&ndash;disable-indevs&quot;, and selectively enable an input device using the
6433 option &quot;&ndash;enable-indev=<var>INDEV</var>&quot;, or you can disable a particular
6434 input device using the option &quot;&ndash;disable-indev=<var>INDEV</var>&quot;.
6435 </p>
6436 <p>The option &quot;-formats&quot; of the ff* tools will display the list of
6437 supported input devices (amongst the demuxers).
6438 </p>
6439 <p>A description of the currently available input devices follows.
6440 </p>
6441 <a name="alsa"></a>
6442 <h2 class="section"><a href="ffplay-all.html#toc-alsa">18.1 alsa</a></h2>
6443
6444 <p>ALSA (Advanced Linux Sound Architecture) input device.
6445 </p>
6446 <p>To enable this input device during configuration you need libasound
6447 installed on your system.
6448 </p>
6449 <p>This device allows capturing from an ALSA device. The name of the
6450 device to capture has to be an ALSA card identifier.
6451 </p>
6452 <p>An ALSA identifier has the syntax:
6453 </p><table><tr><td>&nbsp;</td><td><pre class="example">hw:<var>CARD</var>[,<var>DEV</var>[,<var>SUBDEV</var>]]
6454 </pre></td></tr></table>
6455
6456 <p>where the <var>DEV</var> and <var>SUBDEV</var> components are optional.
6457 </p>
6458 <p>The three arguments (in order: <var>CARD</var>,<var>DEV</var>,<var>SUBDEV</var>)
6459 specify card number or identifier, device number and subdevice number
6460 (-1 means any).
6461 </p>
6462 <p>To see the list of cards currently recognized by your system check the
6463 files &lsquo;<tt>/proc/asound/cards</tt>&rsquo; and &lsquo;<tt>/proc/asound/devices</tt>&rsquo;.
6464 </p>
6465 <p>For example to capture with <code>ffmpeg</code> from an ALSA device with
6466 card id 0, you may run the command:
6467 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f alsa -i hw:0 alsaout.wav
6468 </pre></td></tr></table>
6469
6470 <p>For more information see:
6471 <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>
6472 </p>
6473 <a name="bktr"></a>
6474 <h2 class="section"><a href="ffplay-all.html#toc-bktr">18.2 bktr</a></h2>
6475
6476 <p>BSD video input device.
6477 </p>
6478 <a name="dshow"></a>
6479 <h2 class="section"><a href="ffplay-all.html#toc-dshow">18.3 dshow</a></h2>
6480
6481 <p>Windows DirectShow input device.
6482 </p>
6483 <p>DirectShow support is enabled when FFmpeg is built with the mingw-w64 project.
6484 Currently only audio and video devices are supported.
6485 </p>
6486 <p>Multiple devices may be opened as separate inputs, but they may also be
6487 opened on the same input, which should improve synchronism between them.
6488 </p>
6489 <p>The input name should be in the format:
6490 </p>
6491 <table><tr><td>&nbsp;</td><td><pre class="example"><var>TYPE</var>=<var>NAME</var>[:<var>TYPE</var>=<var>NAME</var>]
6492 </pre></td></tr></table>
6493
6494 <p>where <var>TYPE</var> can be either <var>audio</var> or <var>video</var>,
6495 and <var>NAME</var> is the device&rsquo;s name.
6496 </p>
6497 <a name="Options-1"></a>
6498 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-1">18.3.1 Options</a></h3>
6499
6500 <p>If no options are specified, the device&rsquo;s defaults are used.
6501 If the device does not support the requested options, it will
6502 fail to open.
6503 </p>
6504 <dl compact="compact">
6505 <dt> &lsquo;<samp>video_size</samp>&rsquo;</dt>
6506 <dd><p>Set the video size in the captured video.
6507 </p>
6508 </dd>
6509 <dt> &lsquo;<samp>framerate</samp>&rsquo;</dt>
6510 <dd><p>Set the frame rate in the captured video.
6511 </p>
6512 </dd>
6513 <dt> &lsquo;<samp>sample_rate</samp>&rsquo;</dt>
6514 <dd><p>Set the sample rate (in Hz) of the captured audio.
6515 </p>
6516 </dd>
6517 <dt> &lsquo;<samp>sample_size</samp>&rsquo;</dt>
6518 <dd><p>Set the sample size (in bits) of the captured audio.
6519 </p>
6520 </dd>
6521 <dt> &lsquo;<samp>channels</samp>&rsquo;</dt>
6522 <dd><p>Set the number of channels in the captured audio.
6523 </p>
6524 </dd>
6525 <dt> &lsquo;<samp>list_devices</samp>&rsquo;</dt>
6526 <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of devices and exit.
6527 </p>
6528 </dd>
6529 <dt> &lsquo;<samp>list_options</samp>&rsquo;</dt>
6530 <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of selected device&rsquo;s options
6531 and exit.
6532 </p>
6533 </dd>
6534 <dt> &lsquo;<samp>video_device_number</samp>&rsquo;</dt>
6535 <dd><p>Set video device number for devices with same name (starts at 0,
6536 defaults to 0).
6537 </p>
6538 </dd>
6539 <dt> &lsquo;<samp>audio_device_number</samp>&rsquo;</dt>
6540 <dd><p>Set audio device number for devices with same name (starts at 0,
6541 defaults to 0).
6542 </p>
6543 </dd>
6544 <dt> &lsquo;<samp>pixel_format</samp>&rsquo;</dt>
6545 <dd><p>Select pixel format to be used by DirectShow. This may only be set when
6546 the video codec is not set or set to rawvideo.
6547 </p>
6548 </dd>
6549 <dt> &lsquo;<samp>audio_buffer_size</samp>&rsquo;</dt>
6550 <dd><p>Set audio device buffer size in milliseconds (which can directly
6551 impact latency, depending on the device).
6552 Defaults to using the audio device&rsquo;s
6553 default buffer size (typically some multiple of 500ms).
6554 Setting this value too low can degrade performance.
6555 See also
6556 <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>
6557 </p>
6558 </dd>
6559 </dl>
6560
6561 <a name="Examples-23"></a>
6562 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-23">18.3.2 Examples</a></h3>
6563
6564 <ul>
6565 <li>
6566 Print the list of DirectShow supported devices and exit:
6567 <table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -list_devices true -f dshow -i dummy
6568 </pre></td></tr></table>
6569
6570 </li><li>
6571 Open video device <var>Camera</var>:
6572 <table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -f dshow -i video=&quot;Camera&quot;
6573 </pre></td></tr></table>
6574
6575 </li><li>
6576 Open second video device with name <var>Camera</var>:
6577 <table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -f dshow -video_device_number 1 -i video=&quot;Camera&quot;
6578 </pre></td></tr></table>
6579
6580 </li><li>
6581 Open video device <var>Camera</var> and audio device <var>Microphone</var>:
6582 <table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -f dshow -i video=&quot;Camera&quot;:audio=&quot;Microphone&quot;
6583 </pre></td></tr></table>
6584
6585 </li><li>
6586 Print the list of supported options in selected device and exit:
6587 <table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -list_options true -f dshow -i video=&quot;Camera&quot;
6588 </pre></td></tr></table>
6589
6590 </li></ul>
6591
6592 <a name="dv1394"></a>
6593 <h2 class="section"><a href="ffplay-all.html#toc-dv1394">18.4 dv1394</a></h2>
6594
6595 <p>Linux DV 1394 input device.
6596 </p>
6597 <a name="fbdev"></a>
6598 <h2 class="section"><a href="ffplay-all.html#toc-fbdev">18.5 fbdev</a></h2>
6599
6600 <p>Linux framebuffer input device.
6601 </p>
6602 <p>The Linux framebuffer is a graphic hardware-independent abstraction
6603 layer to show graphics on a computer monitor, typically on the
6604 console. It is accessed through a file device node, usually
6605 &lsquo;<tt>/dev/fb0</tt>&rsquo;.
6606 </p>
6607 <p>For more detailed information read the file
6608 Documentation/fb/framebuffer.txt included in the Linux source tree.
6609 </p>
6610 <p>To record from the framebuffer device &lsquo;<tt>/dev/fb0</tt>&rsquo; with
6611 <code>ffmpeg</code>:
6612 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
6613 </pre></td></tr></table>
6614
6615 <p>You can take a single screenshot image with the command:
6616 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f fbdev -frames:v 1 -r 1 -i /dev/fb0 screenshot.jpeg
6617 </pre></td></tr></table>
6618
6619 <p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
6620 </p>
6621 <a name="iec61883"></a>
6622 <h2 class="section"><a href="ffplay-all.html#toc-iec61883">18.6 iec61883</a></h2>
6623
6624 <p>FireWire DV/HDV input device using libiec61883.
6625 </p>
6626 <p>To enable this input device, you need libiec61883, libraw1394 and
6627 libavc1394 installed on your system. Use the configure option
6628 <code>--enable-libiec61883</code> to compile with the device enabled.
6629 </p>
6630 <p>The iec61883 capture device supports capturing from a video device
6631 connected via IEEE1394 (FireWire), using libiec61883 and the new Linux
6632 FireWire stack (juju). This is the default DV/HDV input method in Linux
6633 Kernel 2.6.37 and later, since the old FireWire stack was removed.
6634 </p>
6635 <p>Specify the FireWire port to be used as input file, or &quot;auto&quot;
6636 to choose the first port connected.
6637 </p>
6638 <a name="Options-12"></a>
6639 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-12">18.6.1 Options</a></h3>
6640
6641 <dl compact="compact">
6642 <dt> &lsquo;<samp>dvtype</samp>&rsquo;</dt>
6643 <dd><p>Override autodetection of DV/HDV. This should only be used if auto
6644 detection does not work, or if usage of a different device type
6645 should be prohibited. Treating a DV device as HDV (or vice versa) will
6646 not work and result in undefined behavior.
6647 The values &lsquo;<samp>auto</samp>&rsquo;, &lsquo;<samp>dv</samp>&rsquo; and &lsquo;<samp>hdv</samp>&rsquo; are supported.
6648 </p>
6649 </dd>
6650 <dt> &lsquo;<samp>dvbuffer</samp>&rsquo;</dt>
6651 <dd><p>Set maxiumum size of buffer for incoming data, in frames. For DV, this
6652 is an exact value. For HDV, it is not frame exact, since HDV does
6653 not have a fixed frame size.
6654 </p>
6655 </dd>
6656 <dt> &lsquo;<samp>dvguid</samp>&rsquo;</dt>
6657 <dd><p>Select the capture device by specifying it&rsquo;s GUID. Capturing will only
6658 be performed from the specified device and fails if no device with the
6659 given GUID is found. This is useful to select the input if multiple
6660 devices are connected at the same time.
6661 Look at /sys/bus/firewire/devices to find out the GUIDs.
6662 </p>
6663 </dd>
6664 </dl>
6665
6666 <a name="Examples-26"></a>
6667 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-26">18.6.2 Examples</a></h3>
6668
6669 <ul>
6670 <li>
6671 Grab and show the input of a FireWire DV/HDV device.
6672 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f iec61883 -i auto
6673 </pre></td></tr></table>
6674
6675 </li><li>
6676 Grab and record the input of a FireWire DV/HDV device,
6677 using a packet buffer of 100000 packets if the source is HDV.
6678 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f iec61883 -i auto -hdvbuffer 100000 out.mpg
6679 </pre></td></tr></table>
6680
6681 </li></ul>
6682
6683 <a name="jack"></a>
6684 <h2 class="section"><a href="ffplay-all.html#toc-jack">18.7 jack</a></h2>
6685
6686 <p>JACK input device.
6687 </p>
6688 <p>To enable this input device during configuration you need libjack
6689 installed on your system.
6690 </p>
6691 <p>A JACK input device creates one or more JACK writable clients, one for
6692 each audio channel, with name <var>client_name</var>:input_<var>N</var>, where
6693 <var>client_name</var> is the name provided by the application, and <var>N</var>
6694 is a number which identifies the channel.
6695 Each writable client will send the acquired data to the FFmpeg input
6696 device.
6697 </p>
6698 <p>Once you have created one or more JACK readable clients, you need to
6699 connect them to one or more JACK writable clients.
6700 </p>
6701 <p>To connect or disconnect JACK clients you can use the <code>jack_connect</code>
6702 and <code>jack_disconnect</code> programs, or do it through a graphical interface,
6703 for example with <code>qjackctl</code>.
6704 </p>
6705 <p>To list the JACK clients and their properties you can invoke the command
6706 <code>jack_lsp</code>.
6707 </p>
6708 <p>Follows an example which shows how to capture a JACK readable client
6709 with <code>ffmpeg</code>.
6710 </p><table><tr><td>&nbsp;</td><td><pre class="example"># Create a JACK writable client with name &quot;ffmpeg&quot;.
6711 $ ffmpeg -f jack -i ffmpeg -y out.wav
6712
6713 # Start the sample jack_metro readable client.
6714 $ jack_metro -b 120 -d 0.2 -f 4000
6715
6716 # List the current JACK clients.
6717 $ jack_lsp -c
6718 system:capture_1
6719 system:capture_2
6720 system:playback_1
6721 system:playback_2
6722 ffmpeg:input_1
6723 metro:120_bpm
6724
6725 # Connect metro to the ffmpeg writable client.
6726 $ jack_connect metro:120_bpm ffmpeg:input_1
6727 </pre></td></tr></table>
6728
6729 <p>For more information read:
6730 <a href="http://jackaudio.org/">http://jackaudio.org/</a>
6731 </p>
6732 <a name="lavfi"></a>
6733 <h2 class="section"><a href="ffplay-all.html#toc-lavfi">18.8 lavfi</a></h2>
6734
6735 <p>Libavfilter input virtual device.
6736 </p>
6737 <p>This input device reads data from the open output pads of a libavfilter
6738 filtergraph.
6739 </p>
6740 <p>For each filtergraph open output, the input device will create a
6741 corresponding stream which is mapped to the generated output. Currently
6742 only video data is supported. The filtergraph is specified through the
6743 option &lsquo;<samp>graph</samp>&rsquo;.
6744 </p>
6745 <a name="Options-13"></a>
6746 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-13">18.8.1 Options</a></h3>
6747
6748 <dl compact="compact">
6749 <dt> &lsquo;<samp>graph</samp>&rsquo;</dt>
6750 <dd><p>Specify the filtergraph to use as input. Each video open output must be
6751 labelled by a unique string of the form &quot;out<var>N</var>&quot;, where <var>N</var> is a
6752 number starting from 0 corresponding to the mapped input stream
6753 generated by the device.
6754 The first unlabelled output is automatically assigned to the &quot;out0&quot;
6755 label, but all the others need to be specified explicitly.
6756 </p>
6757 <p>If not specified defaults to the filename specified for the input
6758 device.
6759 </p>
6760 </dd>
6761 <dt> &lsquo;<samp>graph_file</samp>&rsquo;</dt>
6762 <dd><p>Set the filename of the filtergraph to be read and sent to the other
6763 filters. Syntax of the filtergraph is the same as the one specified by
6764 the option <var>graph</var>.
6765 </p>
6766 </dd>
6767 </dl>
6768
6769 <a name="Examples-27"></a>
6770 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-27">18.8.2 Examples</a></h3>
6771
6772 <ul>
6773 <li>
6774 Create a color video stream and play it back with <code>ffplay</code>:
6775 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f lavfi -graph &quot;color=c=pink [out0]&quot; dummy
6776 </pre></td></tr></table>
6777
6778 </li><li>
6779 As the previous example, but use filename for specifying the graph
6780 description, and omit the &quot;out0&quot; label:
6781 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f lavfi color=c=pink
6782 </pre></td></tr></table>
6783
6784 </li><li>
6785 Create three different video test filtered sources and play them:
6786 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f lavfi -graph &quot;testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]&quot; test3
6787 </pre></td></tr></table>
6788
6789 </li><li>
6790 Read an audio stream from a file using the amovie source and play it
6791 back with <code>ffplay</code>:
6792 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f lavfi &quot;amovie=test.wav&quot;
6793 </pre></td></tr></table>
6794
6795 </li><li>
6796 Read an audio stream and a video stream and play it back with
6797 <code>ffplay</code>:
6798 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f lavfi &quot;movie=test.avi[out0];amovie=test.wav[out1]&quot;
6799 </pre></td></tr></table>
6800
6801 </li></ul>
6802
6803 <a name="libdc1394"></a>
6804 <h2 class="section"><a href="ffplay-all.html#toc-libdc1394">18.9 libdc1394</a></h2>
6805
6806 <p>IIDC1394 input device, based on libdc1394 and libraw1394.
6807 </p>
6808 <a name="openal"></a>
6809 <h2 class="section"><a href="ffplay-all.html#toc-openal">18.10 openal</a></h2>
6810
6811 <p>The OpenAL input device provides audio capture on all systems with a
6812 working OpenAL 1.1 implementation.
6813 </p>
6814 <p>To enable this input device during configuration, you need OpenAL
6815 headers and libraries installed on your system, and need to configure
6816 FFmpeg with <code>--enable-openal</code>.
6817 </p>
6818 <p>OpenAL headers and libraries should be provided as part of your OpenAL
6819 implementation, or as an additional download (an SDK). Depending on your
6820 installation you may need to specify additional flags via the
6821 <code>--extra-cflags</code> and <code>--extra-ldflags</code> for allowing the build
6822 system to locate the OpenAL headers and libraries.
6823 </p>
6824 <p>An incomplete list of OpenAL implementations follows:
6825 </p>
6826 <dl compact="compact">
6827 <dt> <strong>Creative</strong></dt>
6828 <dd><p>The official Windows implementation, providing hardware acceleration
6829 with supported devices and software fallback.
6830 See <a href="http://openal.org/">http://openal.org/</a>.
6831 </p></dd>
6832 <dt> <strong>OpenAL Soft</strong></dt>
6833 <dd><p>Portable, open source (LGPL) software implementation. Includes
6834 backends for the most common sound APIs on the Windows, Linux,
6835 Solaris, and BSD operating systems.
6836 See <a href="http://kcat.strangesoft.net/openal.html">http://kcat.strangesoft.net/openal.html</a>.
6837 </p></dd>
6838 <dt> <strong>Apple</strong></dt>
6839 <dd><p>OpenAL is part of Core Audio, the official Mac OS X Audio interface.
6840 See <a href="http://developer.apple.com/technologies/mac/audio-and-video.html">http://developer.apple.com/technologies/mac/audio-and-video.html</a>
6841 </p></dd>
6842 </dl>
6843
6844 <p>This device allows one to capture from an audio input device handled
6845 through OpenAL.
6846 </p>
6847 <p>You need to specify the name of the device to capture in the provided
6848 filename. If the empty string is provided, the device will
6849 automatically select the default device. You can get the list of the
6850 supported devices by using the option <var>list_devices</var>.
6851 </p>
6852 <a name="Options-14"></a>
6853 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-14">18.10.1 Options</a></h3>
6854
6855 <dl compact="compact">
6856 <dt> &lsquo;<samp>channels</samp>&rsquo;</dt>
6857 <dd><p>Set the number of channels in the captured audio. Only the values
6858 &lsquo;<samp>1</samp>&rsquo; (monaural) and &lsquo;<samp>2</samp>&rsquo; (stereo) are currently supported.
6859 Defaults to &lsquo;<samp>2</samp>&rsquo;.
6860 </p>
6861 </dd>
6862 <dt> &lsquo;<samp>sample_size</samp>&rsquo;</dt>
6863 <dd><p>Set the sample size (in bits) of the captured audio. Only the values
6864 &lsquo;<samp>8</samp>&rsquo; and &lsquo;<samp>16</samp>&rsquo; are currently supported. Defaults to
6865 &lsquo;<samp>16</samp>&rsquo;.
6866 </p>
6867 </dd>
6868 <dt> &lsquo;<samp>sample_rate</samp>&rsquo;</dt>
6869 <dd><p>Set the sample rate (in Hz) of the captured audio.
6870 Defaults to &lsquo;<samp>44.1k</samp>&rsquo;.
6871 </p>
6872 </dd>
6873 <dt> &lsquo;<samp>list_devices</samp>&rsquo;</dt>
6874 <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of devices and exit.
6875 Defaults to &lsquo;<samp>false</samp>&rsquo;.
6876 </p>
6877 </dd>
6878 </dl>
6879
6880 <a name="Examples-42"></a>
6881 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-42">18.10.2 Examples</a></h3>
6882
6883 <p>Print the list of OpenAL supported devices and exit:
6884 </p><table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -list_devices true -f openal -i dummy out.ogg
6885 </pre></td></tr></table>
6886
6887 <p>Capture from the OpenAL device &lsquo;<tt>DR-BT101 via PulseAudio</tt>&rsquo;:
6888 </p><table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
6889 </pre></td></tr></table>
6890
6891 <p>Capture from the default device (note the empty string &rdquo; as filename):
6892 </p><table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -f openal -i '' out.ogg
6893 </pre></td></tr></table>
6894
6895 <p>Capture from two devices simultaneously, writing to two different files,
6896 within the same <code>ffmpeg</code> command:
6897 </p><table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
6898 </pre></td></tr></table>
6899 <p>Note: not all OpenAL implementations support multiple simultaneous capture -
6900 try the latest OpenAL Soft if the above does not work.
6901 </p>
6902 <a name="oss"></a>
6903 <h2 class="section"><a href="ffplay-all.html#toc-oss">18.11 oss</a></h2>
6904
6905 <p>Open Sound System input device.
6906 </p>
6907 <p>The filename to provide to the input device is the device node
6908 representing the OSS input device, and is usually set to
6909 &lsquo;<tt>/dev/dsp</tt>&rsquo;.
6910 </p>
6911 <p>For example to grab from &lsquo;<tt>/dev/dsp</tt>&rsquo; using <code>ffmpeg</code> use the
6912 command:
6913 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
6914 </pre></td></tr></table>
6915
6916 <p>For more information about OSS see:
6917 <a href="http://manuals.opensound.com/usersguide/dsp.html">http://manuals.opensound.com/usersguide/dsp.html</a>
6918 </p>
6919 <a name="pulse"></a>
6920 <h2 class="section"><a href="ffplay-all.html#toc-pulse">18.12 pulse</a></h2>
6921
6922 <p>PulseAudio input device.
6923 </p>
6924 <p>To enable this output device you need to configure FFmpeg with <code>--enable-libpulse</code>.
6925 </p>
6926 <p>The filename to provide to the input device is a source device or the
6927 string &quot;default&quot;
6928 </p>
6929 <p>To list the PulseAudio source devices and their properties you can invoke
6930 the command <code>pactl list sources</code>.
6931 </p>
6932 <p>More information about PulseAudio can be found on <a href="http://www.pulseaudio.org">http://www.pulseaudio.org</a>.
6933 </p>
6934 <a name="Options"></a>
6935 <h3 class="subsection"><a href="ffplay-all.html#toc-Options">18.12.1 Options</a></h3>
6936 <dl compact="compact">
6937 <dt> &lsquo;<samp>server</samp>&rsquo;</dt>
6938 <dd><p>Connect to a specific PulseAudio server, specified by an IP address.
6939 Default server is used when not provided.
6940 </p>
6941 </dd>
6942 <dt> &lsquo;<samp>name</samp>&rsquo;</dt>
6943 <dd><p>Specify the application name PulseAudio will use when showing active clients,
6944 by default it is the <code>LIBAVFORMAT_IDENT</code> string.
6945 </p>
6946 </dd>
6947 <dt> &lsquo;<samp>stream_name</samp>&rsquo;</dt>
6948 <dd><p>Specify the stream name PulseAudio will use when showing active streams,
6949 by default it is &quot;record&quot;.
6950 </p>
6951 </dd>
6952 <dt> &lsquo;<samp>sample_rate</samp>&rsquo;</dt>
6953 <dd><p>Specify the samplerate in Hz, by default 48kHz is used.
6954 </p>
6955 </dd>
6956 <dt> &lsquo;<samp>channels</samp>&rsquo;</dt>
6957 <dd><p>Specify the channels in use, by default 2 (stereo) is set.
6958 </p>
6959 </dd>
6960 <dt> &lsquo;<samp>frame_size</samp>&rsquo;</dt>
6961 <dd><p>Specify the number of bytes per frame, by default it is set to 1024.
6962 </p>
6963 </dd>
6964 <dt> &lsquo;<samp>fragment_size</samp>&rsquo;</dt>
6965 <dd><p>Specify the minimal buffering fragment in PulseAudio, it will affect the
6966 audio latency. By default it is unset.
6967 </p></dd>
6968 </dl>
6969
6970 <a name="Examples-71"></a>
6971 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-71">18.12.2 Examples</a></h3>
6972 <p>Record a stream from default device:
6973 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f pulse -i default /tmp/pulse.wav
6974 </pre></td></tr></table>
6975
6976 <a name="sndio"></a>
6977 <h2 class="section"><a href="ffplay-all.html#toc-sndio">18.13 sndio</a></h2>
6978
6979 <p>sndio input device.
6980 </p>
6981 <p>To enable this input device during configuration you need libsndio
6982 installed on your system.
6983 </p>
6984 <p>The filename to provide to the input device is the device node
6985 representing the sndio input device, and is usually set to
6986 &lsquo;<tt>/dev/audio0</tt>&rsquo;.
6987 </p>
6988 <p>For example to grab from &lsquo;<tt>/dev/audio0</tt>&rsquo; using <code>ffmpeg</code> use the
6989 command:
6990 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
6991 </pre></td></tr></table>
6992
6993 <a name="video4linux2_002c-v4l2"></a>
6994 <h2 class="section"><a href="ffplay-all.html#toc-video4linux2_002c-v4l2">18.14 video4linux2, v4l2</a></h2>
6995
6996 <p>Video4Linux2 input video device.
6997 </p>
6998 <p>&quot;v4l2&quot; can be used as alias for &quot;video4linux2&quot;.
6999 </p>
7000 <p>If FFmpeg is built with v4l-utils support (by using the
7001 <code>--enable-libv4l2</code> configure option), it is possible to use it with the
7002 <code>-use_libv4l2</code> input device option.
7003 </p>
7004 <p>The name of the device to grab is a file device node, usually Linux
7005 systems tend to automatically create such nodes when the device
7006 (e.g. an USB webcam) is plugged into the system, and has a name of the
7007 kind &lsquo;<tt>/dev/video<var>N</var></tt>&rsquo;, where <var>N</var> is a number associated to
7008 the device.
7009 </p>
7010 <p>Video4Linux2 devices usually support a limited set of
7011 <var>width</var>x<var>height</var> sizes and frame rates. You can check which are
7012 supported using <code>-list_formats all</code> for Video4Linux2 devices.
7013 Some devices, like TV cards, support one or more standards. It is possible
7014 to list all the supported standards using <code>-list_standards all</code>.
7015 </p>
7016 <p>The time base for the timestamps is 1 microsecond. Depending on the kernel
7017 version and configuration, the timestamps may be derived from the real time
7018 clock (origin at the Unix Epoch) or the monotonic clock (origin usually at
7019 boot time, unaffected by NTP or manual changes to the clock). The
7020 &lsquo;<samp>-timestamps abs</samp>&rsquo; or &lsquo;<samp>-ts abs</samp>&rsquo; option can be used to force
7021 conversion into the real time clock.
7022 </p>
7023 <p>Some usage examples of the video4linux2 device with <code>ffmpeg</code>
7024 and <code>ffplay</code>:
7025 </p><ul>
7026 <li>
7027 Grab and show the input of a video4linux2 device:
7028 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
7029 </pre></td></tr></table>
7030
7031 </li><li>
7032 Grab and record the input of a video4linux2 device, leave the
7033 frame rate and size as previously set:
7034 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
7035 </pre></td></tr></table>
7036 </li></ul>
7037
7038 <p>For more information about Video4Linux, check <a href="http://linuxtv.org/">http://linuxtv.org/</a>.
7039 </p>
7040 <a name="Options-9"></a>
7041 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-9">18.14.1 Options</a></h3>
7042
7043 <dl compact="compact">
7044 <dt> &lsquo;<samp>standard</samp>&rsquo;</dt>
7045 <dd><p>Set the standard. Must be the name of a supported standard. To get a
7046 list of the supported standards, use the &lsquo;<samp>list_standards</samp>&rsquo;
7047 option.
7048 </p>
7049 </dd>
7050 <dt> &lsquo;<samp>channel</samp>&rsquo;</dt>
7051 <dd><p>Set the input channel number. Default to -1, which means using the
7052 previously selected channel.
7053 </p>
7054 </dd>
7055 <dt> &lsquo;<samp>video_size</samp>&rsquo;</dt>
7056 <dd><p>Set the video frame size. The argument must be a string in the form
7057 <var>WIDTH</var>x<var>HEIGHT</var> or a valid size abbreviation.
7058 </p>
7059 </dd>
7060 <dt> &lsquo;<samp>pixel_format</samp>&rsquo;</dt>
7061 <dd><p>Select the pixel format (only valid for raw video input).
7062 </p>
7063 </dd>
7064 <dt> &lsquo;<samp>input_format</samp>&rsquo;</dt>
7065 <dd><p>Set the preferred pixel format (for raw video) or a codec name.
7066 This option allows one to select the input format, when several are
7067 available.
7068 </p>
7069 </dd>
7070 <dt> &lsquo;<samp>framerate</samp>&rsquo;</dt>
7071 <dd><p>Set the preferred video frame rate.
7072 </p>
7073 </dd>
7074 <dt> &lsquo;<samp>list_formats</samp>&rsquo;</dt>
7075 <dd><p>List available formats (supported pixel formats, codecs, and frame
7076 sizes) and exit.
7077 </p>
7078 <p>Available values are:
7079 </p><dl compact="compact">
7080 <dt> &lsquo;<samp>all</samp>&rsquo;</dt>
7081 <dd><p>Show all available (compressed and non-compressed) formats.
7082 </p>
7083 </dd>
7084 <dt> &lsquo;<samp>raw</samp>&rsquo;</dt>
7085 <dd><p>Show only raw video (non-compressed) formats.
7086 </p>
7087 </dd>
7088 <dt> &lsquo;<samp>compressed</samp>&rsquo;</dt>
7089 <dd><p>Show only compressed formats.
7090 </p></dd>
7091 </dl>
7092
7093 </dd>
7094 <dt> &lsquo;<samp>list_standards</samp>&rsquo;</dt>
7095 <dd><p>List supported standards and exit.
7096 </p>
7097 <p>Available values are:
7098 </p><dl compact="compact">
7099 <dt> &lsquo;<samp>all</samp>&rsquo;</dt>
7100 <dd><p>Show all supported standards.
7101 </p></dd>
7102 </dl>
7103
7104 </dd>
7105 <dt> &lsquo;<samp>timestamps, ts</samp>&rsquo;</dt>
7106 <dd><p>Set type of timestamps for grabbed frames.
7107 </p>
7108 <p>Available values are:
7109 </p><dl compact="compact">
7110 <dt> &lsquo;<samp>default</samp>&rsquo;</dt>
7111 <dd><p>Use timestamps from the kernel.
7112 </p>
7113 </dd>
7114 <dt> &lsquo;<samp>abs</samp>&rsquo;</dt>
7115 <dd><p>Use absolute timestamps (wall clock).
7116 </p>
7117 </dd>
7118 <dt> &lsquo;<samp>mono2abs</samp>&rsquo;</dt>
7119 <dd><p>Force conversion from monotonic to absolute timestamps.
7120 </p></dd>
7121 </dl>
7122
7123 <p>Default value is <code>default</code>.
7124 </p></dd>
7125 </dl>
7126
7127 <a name="vfwcap"></a>
7128 <h2 class="section"><a href="ffplay-all.html#toc-vfwcap">18.15 vfwcap</a></h2>
7129
7130 <p>VfW (Video for Windows) capture input device.
7131 </p>
7132 <p>The filename passed as input is the capture driver number, ranging from
7133 0 to 9. You may use &quot;list&quot; as filename to print a list of drivers. Any
7134 other filename will be interpreted as device number 0.
7135 </p>
7136 <a name="x11grab"></a>
7137 <h2 class="section"><a href="ffplay-all.html#toc-x11grab">18.16 x11grab</a></h2>
7138
7139 <p>X11 video input device.
7140 </p>
7141 <p>This device allows one to capture a region of an X11 display.
7142 </p>
7143 <p>The filename passed as input has the syntax:
7144 </p><table><tr><td>&nbsp;</td><td><pre class="example">[<var>hostname</var>]:<var>display_number</var>.<var>screen_number</var>[+<var>x_offset</var>,<var>y_offset</var>]
7145 </pre></td></tr></table>
7146
7147 <p><var>hostname</var>:<var>display_number</var>.<var>screen_number</var> specifies the
7148 X11 display name of the screen to grab from. <var>hostname</var> can be
7149 omitted, and defaults to &quot;localhost&quot;. The environment variable
7150 <code>DISPLAY</code> contains the default display name.
7151 </p>
7152 <p><var>x_offset</var> and <var>y_offset</var> specify the offsets of the grabbed
7153 area with respect to the top-left border of the X11 screen. They
7154 default to 0.
7155 </p>
7156 <p>Check the X11 documentation (e.g. man X) for more detailed information.
7157 </p>
7158 <p>Use the <code>dpyinfo</code> program for getting basic information about the
7159 properties of your X11 display (e.g. grep for &quot;name&quot; or &quot;dimensions&quot;).
7160 </p>
7161 <p>For example to grab from &lsquo;<tt>:0.0</tt>&rsquo; using <code>ffmpeg</code>:
7162 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0 out.mpg
7163 </pre></td></tr></table>
7164
7165 <p>Grab at position <code>10,20</code>:
7166 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
7167 </pre></td></tr></table>
7168
7169 <a name="Options-8"></a>
7170 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-8">18.16.1 Options</a></h3>
7171
7172 <dl compact="compact">
7173 <dt> &lsquo;<samp>draw_mouse</samp>&rsquo;</dt>
7174 <dd><p>Specify whether to draw the mouse pointer. A value of <code>0</code> specify
7175 not to draw the pointer. Default value is <code>1</code>.
7176 </p>
7177 </dd>
7178 <dt> &lsquo;<samp>follow_mouse</samp>&rsquo;</dt>
7179 <dd><p>Make the grabbed area follow the mouse. The argument can be
7180 <code>centered</code> or a number of pixels <var>PIXELS</var>.
7181 </p>
7182 <p>When it is specified with &quot;centered&quot;, the grabbing region follows the mouse
7183 pointer and keeps the pointer at the center of region; otherwise, the region
7184 follows only when the mouse pointer reaches within <var>PIXELS</var> (greater than
7185 zero) to the edge of region.
7186 </p>
7187 <p>For example:
7188 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f x11grab -follow_mouse centered -framerate 25 -video_size cif -i :0.0 out.mpg
7189 </pre></td></tr></table>
7190
7191 <p>To follow only when the mouse pointer reaches within 100 pixels to edge:
7192 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f x11grab -follow_mouse 100 -framerate 25 -video_size cif -i :0.0 out.mpg
7193 </pre></td></tr></table>
7194
7195 </dd>
7196 <dt> &lsquo;<samp>framerate</samp>&rsquo;</dt>
7197 <dd><p>Set the grabbing frame rate. Default value is <code>ntsc</code>,
7198 corresponding to a frame rate of <code>30000/1001</code>.
7199 </p>
7200 </dd>
7201 <dt> &lsquo;<samp>show_region</samp>&rsquo;</dt>
7202 <dd><p>Show grabbed region on screen.
7203 </p>
7204 <p>If <var>show_region</var> is specified with <code>1</code>, then the grabbing
7205 region will be indicated on screen. With this option, it is easy to
7206 know what is being grabbed if only a portion of the screen is grabbed.
7207 </p>
7208 <p>For example:
7209 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f x11grab -show_region 1 -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
7210 </pre></td></tr></table>
7211
7212 <p>With <var>follow_mouse</var>:
7213 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f x11grab -follow_mouse centered -show_region 1 -framerate 25 -video_size cif -i :0.0 out.mpg
7214 </pre></td></tr></table>
7215
7216 </dd>
7217 <dt> &lsquo;<samp>video_size</samp>&rsquo;</dt>
7218 <dd><p>Set the video frame size. Default value is <code>vga</code>.
7219 </p></dd>
7220 </dl>
7221
7222 <a name="Resampler-Options"></a>
7223 <h1 class="chapter"><a href="ffplay-all.html#toc-Resampler-Options">19. Resampler Options</a></h1>
7224
7225 <p>The audio resampler supports the following named options.
7226 </p>
7227 <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
7228 FFmpeg tools, <var>option</var>=<var>value</var> for the aresample filter,
7229 by setting the value explicitly in the
7230 <code>SwrContext</code> options or using the &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API for
7231 programmatic use.
7232 </p>
7233 <dl compact="compact">
7234 <dt> &lsquo;<samp>ich, in_channel_count</samp>&rsquo;</dt>
7235 <dd><p>Set the number of input channels. Default value is 0. Setting this
7236 value is not mandatory if the corresponding channel layout
7237 &lsquo;<samp>in_channel_layout</samp>&rsquo; is set.
7238 </p>
7239 </dd>
7240 <dt> &lsquo;<samp>och, out_channel_count</samp>&rsquo;</dt>
7241 <dd><p>Set the number of output channels. Default value is 0. Setting this
7242 value is not mandatory if the corresponding channel layout
7243 &lsquo;<samp>out_channel_layout</samp>&rsquo; is set.
7244 </p>
7245 </dd>
7246 <dt> &lsquo;<samp>uch, used_channel_count</samp>&rsquo;</dt>
7247 <dd><p>Set the number of used input channels. Default value is 0. This option is
7248 only used for special remapping.
7249 </p>
7250 </dd>
7251 <dt> &lsquo;<samp>isr, in_sample_rate</samp>&rsquo;</dt>
7252 <dd><p>Set the input sample rate. Default value is 0.
7253 </p>
7254 </dd>
7255 <dt> &lsquo;<samp>osr, out_sample_rate</samp>&rsquo;</dt>
7256 <dd><p>Set the output sample rate. Default value is 0.
7257 </p>
7258 </dd>
7259 <dt> &lsquo;<samp>isf, in_sample_fmt</samp>&rsquo;</dt>
7260 <dd><p>Specify the input sample format. It is set by default to <code>none</code>.
7261 </p>
7262 </dd>
7263 <dt> &lsquo;<samp>osf, out_sample_fmt</samp>&rsquo;</dt>
7264 <dd><p>Specify the output sample format. It is set by default to <code>none</code>.
7265 </p>
7266 </dd>
7267 <dt> &lsquo;<samp>tsf, internal_sample_fmt</samp>&rsquo;</dt>
7268 <dd><p>Set the internal sample format. Default value is <code>none</code>.
7269 This will automatically be chosen when it is not explicitly set.
7270 </p>
7271 </dd>
7272 <dt> &lsquo;<samp>icl, in_channel_layout</samp>&rsquo;</dt>
7273 <dt> &lsquo;<samp>ocl, out_channel_layout</samp>&rsquo;</dt>
7274 <dd><p>Set the input/output channel layout.
7275 </p>
7276 <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)channel layout syntax</a>
7277 for the required syntax.
7278 </p>
7279 </dd>
7280 <dt> &lsquo;<samp>clev, center_mix_level</samp>&rsquo;</dt>
7281 <dd><p>Set the center mix level. It is a value expressed in deciBel, and must be
7282 in the interval [-32,32].
7283 </p>
7284 </dd>
7285 <dt> &lsquo;<samp>slev, surround_mix_level</samp>&rsquo;</dt>
7286 <dd><p>Set the surround mix level. It is a value expressed in deciBel, and must
7287 be in the interval [-32,32].
7288 </p>
7289 </dd>
7290 <dt> &lsquo;<samp>lfe_mix_level</samp>&rsquo;</dt>
7291 <dd><p>Set LFE mix into non LFE level. It is used when there is a LFE input but no
7292 LFE output. It is a value expressed in deciBel, and must
7293 be in the interval [-32,32].
7294 </p>
7295 </dd>
7296 <dt> &lsquo;<samp>rmvol, rematrix_volume</samp>&rsquo;</dt>
7297 <dd><p>Set rematrix volume. Default value is 1.0.
7298 </p>
7299 </dd>
7300 <dt> &lsquo;<samp>rematrix_maxval</samp>&rsquo;</dt>
7301 <dd><p>Set maximum output value for rematrixing.
7302 This can be used to prevent clipping vs. preventing volumn reduction
7303 A value of 1.0 prevents cliping.
7304 </p>
7305 </dd>
7306 <dt> &lsquo;<samp>flags, swr_flags</samp>&rsquo;</dt>
7307 <dd><p>Set flags used by the converter. Default value is 0.
7308 </p>
7309 <p>It supports the following individual flags:
7310 </p><dl compact="compact">
7311 <dt> &lsquo;<samp>res</samp>&rsquo;</dt>
7312 <dd><p>force resampling, this flag forces resampling to be used even when the
7313 input and output sample rates match.
7314 </p></dd>
7315 </dl>
7316
7317 </dd>
7318 <dt> &lsquo;<samp>dither_scale</samp>&rsquo;</dt>
7319 <dd><p>Set the dither scale. Default value is 1.
7320 </p>
7321 </dd>
7322 <dt> &lsquo;<samp>dither_method</samp>&rsquo;</dt>
7323 <dd><p>Set dither method. Default value is 0.
7324 </p>
7325 <p>Supported values:
7326 </p><dl compact="compact">
7327 <dt> &lsquo;<samp>rectangular</samp>&rsquo;</dt>
7328 <dd><p>select rectangular dither
7329 </p></dd>
7330 <dt> &lsquo;<samp>triangular</samp>&rsquo;</dt>
7331 <dd><p>select triangular dither
7332 </p></dd>
7333 <dt> &lsquo;<samp>triangular_hp</samp>&rsquo;</dt>
7334 <dd><p>select triangular dither with high pass
7335 </p></dd>
7336 <dt> &lsquo;<samp>lipshitz</samp>&rsquo;</dt>
7337 <dd><p>select lipshitz noise shaping dither
7338 </p></dd>
7339 <dt> &lsquo;<samp>shibata</samp>&rsquo;</dt>
7340 <dd><p>select shibata noise shaping dither
7341 </p></dd>
7342 <dt> &lsquo;<samp>low_shibata</samp>&rsquo;</dt>
7343 <dd><p>select low shibata noise shaping dither
7344 </p></dd>
7345 <dt> &lsquo;<samp>high_shibata</samp>&rsquo;</dt>
7346 <dd><p>select high shibata noise shaping dither
7347 </p></dd>
7348 <dt> &lsquo;<samp>f_weighted</samp>&rsquo;</dt>
7349 <dd><p>select f-weighted noise shaping dither
7350 </p></dd>
7351 <dt> &lsquo;<samp>modified_e_weighted</samp>&rsquo;</dt>
7352 <dd><p>select modified-e-weighted noise shaping dither
7353 </p></dd>
7354 <dt> &lsquo;<samp>improved_e_weighted</samp>&rsquo;</dt>
7355 <dd><p>select improved-e-weighted noise shaping dither
7356 </p>
7357 </dd>
7358 </dl>
7359
7360 </dd>
7361 <dt> &lsquo;<samp>resampler</samp>&rsquo;</dt>
7362 <dd><p>Set resampling engine. Default value is swr.
7363 </p>
7364 <p>Supported values:
7365 </p><dl compact="compact">
7366 <dt> &lsquo;<samp>swr</samp>&rsquo;</dt>
7367 <dd><p>select the native SW Resampler; filter options precision and cheby are not
7368 applicable in this case.
7369 </p></dd>
7370 <dt> &lsquo;<samp>soxr</samp>&rsquo;</dt>
7371 <dd><p>select the SoX Resampler (where available); compensation, and filter options
7372 filter_size, phase_shift, filter_type &amp; kaiser_beta, are not applicable in this
7373 case.
7374 </p></dd>
7375 </dl>
7376
7377 </dd>
7378 <dt> &lsquo;<samp>filter_size</samp>&rsquo;</dt>
7379 <dd><p>For swr only, set resampling filter size, default value is 32.
7380 </p>
7381 </dd>
7382 <dt> &lsquo;<samp>phase_shift</samp>&rsquo;</dt>
7383 <dd><p>For swr only, set resampling phase shift, default value is 10, and must be in
7384 the interval [0,30].
7385 </p>
7386 </dd>
7387 <dt> &lsquo;<samp>linear_interp</samp>&rsquo;</dt>
7388 <dd><p>Use Linear Interpolation if set to 1, default value is 0.
7389 </p>
7390 </dd>
7391 <dt> &lsquo;<samp>cutoff</samp>&rsquo;</dt>
7392 <dd><p>Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
7393 value between 0 and 1.  Default value is 0.97 with swr, and 0.91 with soxr
7394 (which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
7395 </p>
7396 </dd>
7397 <dt> &lsquo;<samp>precision</samp>&rsquo;</dt>
7398 <dd><p>For soxr only, the precision in bits to which the resampled signal will be
7399 calculated.  The default value of 20 (which, with suitable dithering, is
7400 appropriate for a destination bit-depth of 16) gives SoX&rsquo;s &rsquo;High Quality&rsquo;; a
7401 value of 28 gives SoX&rsquo;s &rsquo;Very High Quality&rsquo;.
7402 </p>
7403 </dd>
7404 <dt> &lsquo;<samp>cheby</samp>&rsquo;</dt>
7405 <dd><p>For soxr only, selects passband rolloff none (Chebyshev) &amp; higher-precision
7406 approximation for &rsquo;irrational&rsquo; ratios. Default value is 0.
7407 </p>
7408 </dd>
7409 <dt> &lsquo;<samp>async</samp>&rsquo;</dt>
7410 <dd><p>For swr only, simple 1 parameter audio sync to timestamps using stretching,
7411 squeezing, filling and trimming. Setting this to 1 will enable filling and
7412 trimming, larger values represent the maximum amount in samples that the data
7413 may be stretched or squeezed for each second.
7414 Default value is 0, thus no compensation is applied to make the samples match
7415 the audio timestamps.
7416 </p>
7417 </dd>
7418 <dt> &lsquo;<samp>first_pts</samp>&rsquo;</dt>
7419 <dd><p>For swr only, assume the first pts should be this value. The time unit is 1 / sample rate.
7420 This allows for padding/trimming at the start of stream. By default, no
7421 assumption is made about the first frame&rsquo;s expected pts, so no padding or
7422 trimming is done. For example, this could be set to 0 to pad the beginning with
7423 silence if an audio stream starts after the video stream or to trim any samples
7424 with a negative pts due to encoder delay.
7425 </p>
7426 </dd>
7427 <dt> &lsquo;<samp>min_comp</samp>&rsquo;</dt>
7428 <dd><p>For swr only, set the minimum difference between timestamps and audio data (in
7429 seconds) to trigger stretching/squeezing/filling or trimming of the
7430 data to make it match the timestamps. The default is that
7431 stretching/squeezing/filling and trimming is disabled
7432 (&lsquo;<samp>min_comp</samp>&rsquo; = <code>FLT_MAX</code>).
7433 </p>
7434 </dd>
7435 <dt> &lsquo;<samp>min_hard_comp</samp>&rsquo;</dt>
7436 <dd><p>For swr only, set the minimum difference between timestamps and audio data (in
7437 seconds) to trigger adding/dropping samples to make it match the
7438 timestamps.  This option effectively is a threshold to select between
7439 hard (trim/fill) and soft (squeeze/stretch) compensation. Note that
7440 all compensation is by default disabled through &lsquo;<samp>min_comp</samp>&rsquo;.
7441 The default is 0.1.
7442 </p>
7443 </dd>
7444 <dt> &lsquo;<samp>comp_duration</samp>&rsquo;</dt>
7445 <dd><p>For swr only, set duration (in seconds) over which data is stretched/squeezed
7446 to make it match the timestamps. Must be a non-negative double float value,
7447 default value is 1.0.
7448 </p>
7449 </dd>
7450 <dt> &lsquo;<samp>max_soft_comp</samp>&rsquo;</dt>
7451 <dd><p>For swr only, set maximum factor by which data is stretched/squeezed to make it
7452 match the timestamps. Must be a non-negative double float value, default value
7453 is 0.
7454 </p>
7455 </dd>
7456 <dt> &lsquo;<samp>matrix_encoding</samp>&rsquo;</dt>
7457 <dd><p>Select matrixed stereo encoding.
7458 </p>
7459 <p>It accepts the following values:
7460 </p><dl compact="compact">
7461 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
7462 <dd><p>select none
7463 </p></dd>
7464 <dt> &lsquo;<samp>dolby</samp>&rsquo;</dt>
7465 <dd><p>select Dolby
7466 </p></dd>
7467 <dt> &lsquo;<samp>dplii</samp>&rsquo;</dt>
7468 <dd><p>select Dolby Pro Logic II
7469 </p></dd>
7470 </dl>
7471
7472 <p>Default value is <code>none</code>.
7473 </p>
7474 </dd>
7475 <dt> &lsquo;<samp>filter_type</samp>&rsquo;</dt>
7476 <dd><p>For swr only, select resampling filter type. This only affects resampling
7477 operations.
7478 </p>
7479 <p>It accepts the following values:
7480 </p><dl compact="compact">
7481 <dt> &lsquo;<samp>cubic</samp>&rsquo;</dt>
7482 <dd><p>select cubic
7483 </p></dd>
7484 <dt> &lsquo;<samp>blackman_nuttall</samp>&rsquo;</dt>
7485 <dd><p>select Blackman Nuttall Windowed Sinc
7486 </p></dd>
7487 <dt> &lsquo;<samp>kaiser</samp>&rsquo;</dt>
7488 <dd><p>select Kaiser Windowed Sinc
7489 </p></dd>
7490 </dl>
7491
7492 </dd>
7493 <dt> &lsquo;<samp>kaiser_beta</samp>&rsquo;</dt>
7494 <dd><p>For swr only, set Kaiser Window Beta value. Must be an integer in the
7495 interval [2,16], default value is 9.
7496 </p>
7497 </dd>
7498 <dt> &lsquo;<samp>output_sample_bits</samp>&rsquo;</dt>
7499 <dd><p>For swr only, set number of used output sample bits for dithering. Must be an integer in the
7500 interval [0,64], default value is 0, which means it&rsquo;s not used.
7501 </p>
7502 </dd>
7503 </dl>
7504
7505 <p><a name="scaler_005foptions"></a>
7506 </p><a name="Scaler-Options"></a>
7507 <h1 class="chapter"><a href="ffplay-all.html#toc-Scaler-Options">20. Scaler Options</a></h1>
7508
7509 <p>The video scaler supports the following named options.
7510 </p>
7511 <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
7512 FFmpeg tools. For programmatic use, they can be set explicitly in the
7513 <code>SwsContext</code> options or through the &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API.
7514 </p>
7515 <dl compact="compact">
7516 <dd>
7517 <p><a name="sws_005fflags"></a>
7518 </p></dd>
7519 <dt> &lsquo;<samp>sws_flags</samp>&rsquo;</dt>
7520 <dd><p>Set the scaler flags. This is also used to set the scaling
7521 algorithm. Only a single algorithm should be selected.
7522 </p>
7523 <p>It accepts the following values:
7524 </p><dl compact="compact">
7525 <dt> &lsquo;<samp>fast_bilinear</samp>&rsquo;</dt>
7526 <dd><p>Select fast bilinear scaling algorithm.
7527 </p>
7528 </dd>
7529 <dt> &lsquo;<samp>bilinear</samp>&rsquo;</dt>
7530 <dd><p>Select bilinear scaling algorithm.
7531 </p>
7532 </dd>
7533 <dt> &lsquo;<samp>bicubic</samp>&rsquo;</dt>
7534 <dd><p>Select bicubic scaling algorithm.
7535 </p>
7536 </dd>
7537 <dt> &lsquo;<samp>experimental</samp>&rsquo;</dt>
7538 <dd><p>Select experimental scaling algorithm.
7539 </p>
7540 </dd>
7541 <dt> &lsquo;<samp>neighbor</samp>&rsquo;</dt>
7542 <dd><p>Select nearest neighbor rescaling algorithm.
7543 </p>
7544 </dd>
7545 <dt> &lsquo;<samp>area</samp>&rsquo;</dt>
7546 <dd><p>Select averaging area rescaling algorithm.
7547 </p>
7548 </dd>
7549 <dt> &lsquo;<samp>bicublin</samp>&rsquo;</dt>
7550 <dd><p>Select bicubic scaling algorithm for the luma component, bilinear for
7551 chroma components.
7552 </p>
7553 </dd>
7554 <dt> &lsquo;<samp>gauss</samp>&rsquo;</dt>
7555 <dd><p>Select Gaussian rescaling algorithm.
7556 </p>
7557 </dd>
7558 <dt> &lsquo;<samp>sinc</samp>&rsquo;</dt>
7559 <dd><p>Select sinc rescaling algorithm.
7560 </p>
7561 </dd>
7562 <dt> &lsquo;<samp>lanczos</samp>&rsquo;</dt>
7563 <dd><p>Select lanczos rescaling algorithm.
7564 </p>
7565 </dd>
7566 <dt> &lsquo;<samp>spline</samp>&rsquo;</dt>
7567 <dd><p>Select natural bicubic spline rescaling algorithm.
7568 </p>
7569 </dd>
7570 <dt> &lsquo;<samp>print_info</samp>&rsquo;</dt>
7571 <dd><p>Enable printing/debug logging.
7572 </p>
7573 </dd>
7574 <dt> &lsquo;<samp>accurate_rnd</samp>&rsquo;</dt>
7575 <dd><p>Enable accurate rounding.
7576 </p>
7577 </dd>
7578 <dt> &lsquo;<samp>full_chroma_int</samp>&rsquo;</dt>
7579 <dd><p>Enable full chroma interpolation.
7580 </p>
7581 </dd>
7582 <dt> &lsquo;<samp>full_chroma_inp</samp>&rsquo;</dt>
7583 <dd><p>Select full chroma input.
7584 </p>
7585 </dd>
7586 <dt> &lsquo;<samp>bitexact</samp>&rsquo;</dt>
7587 <dd><p>Enable bitexact output.
7588 </p></dd>
7589 </dl>
7590
7591 </dd>
7592 <dt> &lsquo;<samp>srcw</samp>&rsquo;</dt>
7593 <dd><p>Set source width.
7594 </p>
7595 </dd>
7596 <dt> &lsquo;<samp>srch</samp>&rsquo;</dt>
7597 <dd><p>Set source height.
7598 </p>
7599 </dd>
7600 <dt> &lsquo;<samp>dstw</samp>&rsquo;</dt>
7601 <dd><p>Set destination width.
7602 </p>
7603 </dd>
7604 <dt> &lsquo;<samp>dsth</samp>&rsquo;</dt>
7605 <dd><p>Set destination height.
7606 </p>
7607 </dd>
7608 <dt> &lsquo;<samp>src_format</samp>&rsquo;</dt>
7609 <dd><p>Set source pixel format (must be expressed as an integer).
7610 </p>
7611 </dd>
7612 <dt> &lsquo;<samp>dst_format</samp>&rsquo;</dt>
7613 <dd><p>Set destination pixel format (must be expressed as an integer).
7614 </p>
7615 </dd>
7616 <dt> &lsquo;<samp>src_range</samp>&rsquo;</dt>
7617 <dd><p>Select source range.
7618 </p>
7619 </dd>
7620 <dt> &lsquo;<samp>dst_range</samp>&rsquo;</dt>
7621 <dd><p>Select destination range.
7622 </p>
7623 </dd>
7624 <dt> &lsquo;<samp>param0, param1</samp>&rsquo;</dt>
7625 <dd><p>Set scaling algorithm parameters. The specified values are specific of
7626 some scaling algorithms and ignored by others. The specified values
7627 are floating point number values.
7628 </p>
7629 </dd>
7630 <dt> &lsquo;<samp>sws_dither</samp>&rsquo;</dt>
7631 <dd><p>Set the dithering algorithm. Accepts one of the following
7632 values. Default value is &lsquo;<samp>auto</samp>&rsquo;.
7633 </p>
7634 <dl compact="compact">
7635 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
7636 <dd><p>automatic choice
7637 </p>
7638 </dd>
7639 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
7640 <dd><p>no dithering
7641 </p>
7642 </dd>
7643 <dt> &lsquo;<samp>bayer</samp>&rsquo;</dt>
7644 <dd><p>bayer dither
7645 </p>
7646 </dd>
7647 <dt> &lsquo;<samp>ed</samp>&rsquo;</dt>
7648 <dd><p>error diffusion dither
7649 </p></dd>
7650 </dl>
7651
7652 </dd>
7653 </dl>
7654
7655 <a name="Filtering-Introduction"></a>
7656 <h1 class="chapter"><a href="ffplay-all.html#toc-Filtering-Introduction">21. Filtering Introduction</a></h1>
7657
7658 <p>Filtering in FFmpeg is enabled through the libavfilter library.
7659 </p>
7660 <p>In libavfilter, a filter can have multiple inputs and multiple
7661 outputs.
7662 To illustrate the sorts of things that are possible, we consider the
7663 following filtergraph.
7664 </p>
7665 <table><tr><td>&nbsp;</td><td><pre class="example">                [main]
7666 input --&gt; split ---------------------&gt; overlay --&gt; output
7667             |                             ^
7668             |[tmp]                  [flip]|
7669             +-----&gt; crop --&gt; vflip -------+
7670 </pre></td></tr></table>
7671
7672 <p>This filtergraph splits the input stream in two streams, sends one
7673 stream through the crop filter and the vflip filter before merging it
7674 back with the other stream by overlaying it on top. You can use the
7675 following command to achieve this:
7676 </p>
7677 <table><tr><td>&nbsp;</td><td><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
7678 </pre></td></tr></table>
7679
7680 <p>The result will be that in output the top half of the video is mirrored
7681 onto the bottom half.
7682 </p>
7683 <p>Filters in the same linear chain are separated by commas, and distinct
7684 linear chains of filters are separated by semicolons. In our example,
7685 <var>crop,vflip</var> are in one linear chain, <var>split</var> and
7686 <var>overlay</var> are separately in another. The points where the linear
7687 chains join are labelled by names enclosed in square brackets. In the
7688 example, the split filter generates two outputs that are associated to
7689 the labels <var>[main]</var> and <var>[tmp]</var>.
7690 </p>
7691 <p>The stream sent to the second output of <var>split</var>, labelled as
7692 <var>[tmp]</var>, is processed through the <var>crop</var> filter, which crops
7693 away the lower half part of the video, and then vertically flipped. The
7694 <var>overlay</var> filter takes in input the first unchanged output of the
7695 split filter (which was labelled as <var>[main]</var>), and overlay on its
7696 lower half the output generated by the <var>crop,vflip</var> filterchain.
7697 </p>
7698 <p>Some filters take in input a list of parameters: they are specified
7699 after the filter name and an equal sign, and are separated from each other
7700 by a colon.
7701 </p>
7702 <p>There exist so-called <var>source filters</var> that do not have an
7703 audio/video input, and <var>sink filters</var> that will not have audio/video
7704 output.
7705 </p>
7706
7707 <a name="graph2dot"></a>
7708 <h1 class="chapter"><a href="ffplay-all.html#toc-graph2dot">22. graph2dot</a></h1>
7709
7710 <p>The &lsquo;<tt>graph2dot</tt>&rsquo; program included in the FFmpeg &lsquo;<tt>tools</tt>&rsquo;
7711 directory can be used to parse a filtergraph description and issue a
7712 corresponding textual representation in the dot language.
7713 </p>
7714 <p>Invoke the command:
7715 </p><table><tr><td>&nbsp;</td><td><pre class="example">graph2dot -h
7716 </pre></td></tr></table>
7717
7718 <p>to see how to use &lsquo;<tt>graph2dot</tt>&rsquo;.
7719 </p>
7720 <p>You can then pass the dot description to the &lsquo;<tt>dot</tt>&rsquo; program (from
7721 the graphviz suite of programs) and obtain a graphical representation
7722 of the filtergraph.
7723 </p>
7724 <p>For example the sequence of commands:
7725 </p><table><tr><td>&nbsp;</td><td><pre class="example">echo <var>GRAPH_DESCRIPTION</var> | \
7726 tools/graph2dot -o graph.tmp &amp;&amp; \
7727 dot -Tpng graph.tmp -o graph.png &amp;&amp; \
7728 display graph.png
7729 </pre></td></tr></table>
7730
7731 <p>can be used to create and display an image representing the graph
7732 described by the <var>GRAPH_DESCRIPTION</var> string. Note that this string must be
7733 a complete self-contained graph, with its inputs and outputs explicitly defined.
7734 For example if your command line is of the form:
7735 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i infile -vf scale=640:360 outfile
7736 </pre></td></tr></table>
7737 <p>your <var>GRAPH_DESCRIPTION</var> string will need to be of the form:
7738 </p><table><tr><td>&nbsp;</td><td><pre class="example">nullsrc,scale=640:360,nullsink
7739 </pre></td></tr></table>
7740 <p>you may also need to set the <var>nullsrc</var> parameters and add a <var>format</var>
7741 filter in order to simulate a specific input file.
7742 </p>
7743
7744 <a name="Filtergraph-description"></a>
7745 <h1 class="chapter"><a href="ffplay-all.html#toc-Filtergraph-description">23. Filtergraph description</a></h1>
7746
7747 <p>A filtergraph is a directed graph of connected filters. It can contain
7748 cycles, and there can be multiple links between a pair of
7749 filters. Each link has one input pad on one side connecting it to one
7750 filter from which it takes its input, and one output pad on the other
7751 side connecting it to the one filter accepting its output.
7752 </p>
7753 <p>Each filter in a filtergraph is an instance of a filter class
7754 registered in the application, which defines the features and the
7755 number of input and output pads of the filter.
7756 </p>
7757 <p>A filter with no input pads is called a &quot;source&quot;, a filter with no
7758 output pads is called a &quot;sink&quot;.
7759 </p>
7760 <p><a name="Filtergraph-syntax"></a>
7761 </p><a name="Filtergraph-syntax-1"></a>
7762 <h2 class="section"><a href="ffplay-all.html#toc-Filtergraph-syntax-1">23.1 Filtergraph syntax</a></h2>
7763
7764 <p>A filtergraph can be represented using a textual representation, which is
7765 recognized by the &lsquo;<samp>-filter</samp>&rsquo;/&lsquo;<samp>-vf</samp>&rsquo; and &lsquo;<samp>-filter_complex</samp>&rsquo;
7766 options in <code>ffmpeg</code> and &lsquo;<samp>-vf</samp>&rsquo; in <code>ffplay</code>, and by the
7767 <code>avfilter_graph_parse()</code>/<code>avfilter_graph_parse2()</code> function defined in
7768 &lsquo;<tt>libavfilter/avfilter.h</tt>&rsquo;.
7769 </p>
7770 <p>A filterchain consists of a sequence of connected filters, each one
7771 connected to the previous one in the sequence. A filterchain is
7772 represented by a list of &quot;,&quot;-separated filter descriptions.
7773 </p>
7774 <p>A filtergraph consists of a sequence of filterchains. A sequence of
7775 filterchains is represented by a list of &quot;;&quot;-separated filterchain
7776 descriptions.
7777 </p>
7778 <p>A filter is represented by a string of the form:
7779 [<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>]
7780 </p>
7781 <p><var>filter_name</var> is the name of the filter class of which the
7782 described filter is an instance of, and has to be the name of one of
7783 the filter classes registered in the program.
7784 The name of the filter class is optionally followed by a string
7785 &quot;=<var>arguments</var>&quot;.
7786 </p>
7787 <p><var>arguments</var> is a string which contains the parameters used to
7788 initialize the filter instance. It may have one of the following forms:
7789 </p><ul>
7790 <li>
7791 A &rsquo;:&rsquo;-separated list of <var>key=value</var> pairs.
7792
7793 </li><li>
7794 A &rsquo;:&rsquo;-separated list of <var>value</var>. In this case, the keys are assumed to be
7795 the option names in the order they are declared. E.g. the <code>fade</code> filter
7796 declares three options in this order &ndash; &lsquo;<samp>type</samp>&rsquo;, &lsquo;<samp>start_frame</samp>&rsquo; and
7797 &lsquo;<samp>nb_frames</samp>&rsquo;. Then the parameter list <var>in:0:30</var> means that the value
7798 <var>in</var> is assigned to the option &lsquo;<samp>type</samp>&rsquo;, <var>0</var> to
7799 &lsquo;<samp>start_frame</samp>&rsquo; and <var>30</var> to &lsquo;<samp>nb_frames</samp>&rsquo;.
7800
7801 </li><li>
7802 A &rsquo;:&rsquo;-separated list of mixed direct <var>value</var> and long <var>key=value</var>
7803 pairs. The direct <var>value</var> must precede the <var>key=value</var> pairs, and
7804 follow the same constraints order of the previous point. The following
7805 <var>key=value</var> pairs can be set in any preferred order.
7806
7807 </li></ul>
7808
7809 <p>If the option value itself is a list of items (e.g. the <code>format</code> filter
7810 takes a list of pixel formats), the items in the list are usually separated by
7811 &rsquo;|&rsquo;.
7812 </p>
7813 <p>The list of arguments can be quoted using the character &quot;&rsquo;&quot; as initial
7814 and ending mark, and the character &rsquo;\&rsquo; for escaping the characters
7815 within the quoted text; otherwise the argument string is considered
7816 terminated when the next special character (belonging to the set
7817 &quot;[]=;,&quot;) is encountered.
7818 </p>
7819 <p>The name and arguments of the filter are optionally preceded and
7820 followed by a list of link labels.
7821 A link label allows one to name a link and associate it to a filter output
7822 or input pad. The preceding labels <var>in_link_1</var>
7823 ... <var>in_link_N</var>, are associated to the filter input pads,
7824 the following labels <var>out_link_1</var> ... <var>out_link_M</var>, are
7825 associated to the output pads.
7826 </p>
7827 <p>When two link labels with the same name are found in the
7828 filtergraph, a link between the corresponding input and output pad is
7829 created.
7830 </p>
7831 <p>If an output pad is not labelled, it is linked by default to the first
7832 unlabelled input pad of the next filter in the filterchain.
7833 For example in the filterchain:
7834 </p><table><tr><td>&nbsp;</td><td><pre class="example">nullsrc, split[L1], [L2]overlay, nullsink
7835 </pre></td></tr></table>
7836 <p>the split filter instance has two output pads, and the overlay filter
7837 instance two input pads. The first output pad of split is labelled
7838 &quot;L1&quot;, the first input pad of overlay is labelled &quot;L2&quot;, and the second
7839 output pad of split is linked to the second input pad of overlay,
7840 which are both unlabelled.
7841 </p>
7842 <p>In a complete filterchain all the unlabelled filter input and output
7843 pads must be connected. A filtergraph is considered valid if all the
7844 filter input and output pads of all the filterchains are connected.
7845 </p>
7846 <p>Libavfilter will automatically insert <a href="#scale">scale</a> filters where format
7847 conversion is required. It is possible to specify swscale flags
7848 for those automatically inserted scalers by prepending
7849 <code>sws_flags=<var>flags</var>;</code>
7850 to the filtergraph description.
7851 </p>
7852 <p>Follows a BNF description for the filtergraph syntax:
7853 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>NAME</var>             ::= sequence of alphanumeric characters and '_'
7854 <var>LINKLABEL</var>        ::= &quot;[&quot; <var>NAME</var> &quot;]&quot;
7855 <var>LINKLABELS</var>       ::= <var>LINKLABEL</var> [<var>LINKLABELS</var>]
7856 <var>FILTER_ARGUMENTS</var> ::= sequence of chars (eventually quoted)
7857 <var>FILTER</var>           ::= [<var>LINKLABELS</var>] <var>NAME</var> [&quot;=&quot; <var>FILTER_ARGUMENTS</var>] [<var>LINKLABELS</var>]
7858 <var>FILTERCHAIN</var>      ::= <var>FILTER</var> [,<var>FILTERCHAIN</var>]
7859 <var>FILTERGRAPH</var>      ::= [sws_flags=<var>flags</var>;] <var>FILTERCHAIN</var> [;<var>FILTERGRAPH</var>]
7860 </pre></td></tr></table>
7861
7862 <a name="Notes-on-filtergraph-escaping"></a>
7863 <h2 class="section"><a href="ffplay-all.html#toc-Notes-on-filtergraph-escaping">23.2 Notes on filtergraph escaping</a></h2>
7864
7865 <p>Filtergraph description composition entails several levels of
7866 escaping. See <a href="ffmpeg-utils.html#quoting_005fand_005fescaping">(ffmpeg-utils)quoting_and_escaping</a> for more
7867 information about the employed escaping procedure.
7868 </p>
7869 <p>A first level escaping affects the content of each filter option
7870 value, which may contain the special character <code>:</code> used to
7871 separate values, or one of the escaping characters <code>\'</code>.
7872 </p>
7873 <p>A second level escaping affects the whole filter description, which
7874 may contain the escaping characters <code>\'</code> or the special
7875 characters <code>[],;</code> used by the filtergraph description.
7876 </p>
7877 <p>Finally, when you specify a filtergraph on a shell commandline, you
7878 need to perform a third level escaping for the shell special
7879 characters contained within it.
7880 </p>
7881 <p>For example, consider the following string to be embedded in
7882 the <a href="#drawtext">drawtext</a> filter description &lsquo;<samp>text</samp>&rsquo; value:
7883 </p><table><tr><td>&nbsp;</td><td><pre class="example">this is a 'string': may contain one, or more, special characters
7884 </pre></td></tr></table>
7885
7886 <p>This string contains the <code>'</code> special escaping character, and the
7887 <code>:</code> special character, so it needs to be escaped in this way:
7888 </p><table><tr><td>&nbsp;</td><td><pre class="example">text=this is a \'string\'\: may contain one, or more, special characters
7889 </pre></td></tr></table>
7890
7891 <p>A second level of escaping is required when embedding the filter
7892 description in a filtergraph description, in order to escape all the
7893 filtergraph special characters. Thus the example above becomes:
7894 </p><table><tr><td>&nbsp;</td><td><pre class="example">drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
7895 </pre></td></tr></table>
7896 <p>(note that in addition to the <code>\'</code> escaping special characters,
7897 also <code>,</code> needs to be escaped).
7898 </p>
7899 <p>Finally an additional level of escaping is needed when writing the
7900 filtergraph description in a shell command, which depends on the
7901 escaping rules of the adopted shell. For example, assuming that
7902 <code>\</code> is special and needs to be escaped with another <code>\</code>, the
7903 previous string will finally result in:
7904 </p><table><tr><td>&nbsp;</td><td><pre class="example">-vf &quot;drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters&quot;
7905 </pre></td></tr></table>
7906
7907 <a name="Timeline-editing"></a>
7908 <h1 class="chapter"><a href="ffplay-all.html#toc-Timeline-editing">24. Timeline editing</a></h1>
7909
7910 <p>Some filters support a generic &lsquo;<samp>enable</samp>&rsquo; option. For the filters
7911 supporting timeline editing, this option can be set to an expression which is
7912 evaluated before sending a frame to the filter. If the evaluation is non-zero,
7913 the filter will be enabled, otherwise the frame will be sent unchanged to the
7914 next filter in the filtergraph.
7915 </p>
7916 <p>The expression accepts the following values:
7917 </p><dl compact="compact">
7918 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
7919 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
7920 </p>
7921 </dd>
7922 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
7923 <dd><p>sequential number of the input frame, starting from 0
7924 </p>
7925 </dd>
7926 <dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
7927 <dd><p>the position in the file of the input frame, NAN if unknown
7928 </p></dd>
7929 </dl>
7930
7931 <p>Additionally, these filters support an &lsquo;<samp>enable</samp>&rsquo; command that can be used
7932 to re-define the expression.
7933 </p>
7934 <p>Like any other filtering option, the &lsquo;<samp>enable</samp>&rsquo; option follows the same
7935 rules.
7936 </p>
7937 <p>For example, to enable a blur filter (<a href="#smartblur">smartblur</a>) from 10 seconds to 3
7938 minutes, and a <a href="#curves">curves</a> filter starting at 3 seconds:
7939 </p><table><tr><td>&nbsp;</td><td><pre class="example">smartblur = enable='between(t,10,3*60)',
7940 curves    = enable='gte(t,3)' : preset=cross_process
7941 </pre></td></tr></table>
7942
7943
7944 <a name="Audio-Filters"></a>
7945 <h1 class="chapter"><a href="ffplay-all.html#toc-Audio-Filters">25. Audio Filters</a></h1>
7946
7947 <p>When you configure your FFmpeg build, you can disable any of the
7948 existing filters using <code>--disable-filters</code>.
7949 The configure output will show the audio filters included in your
7950 build.
7951 </p>
7952 <p>Below is a description of the currently available audio filters.
7953 </p>
7954 <a name="aconvert"></a>
7955 <h2 class="section"><a href="ffplay-all.html#toc-aconvert">25.1 aconvert</a></h2>
7956
7957 <p>Convert the input audio format to the specified formats.
7958 </p>
7959 <p><em>This filter is deprecated. Use <a href="#aformat">aformat</a> instead.</em>
7960 </p>
7961 <p>The filter accepts a string of the form:
7962 &quot;<var>sample_format</var>:<var>channel_layout</var>&quot;.
7963 </p>
7964 <p><var>sample_format</var> specifies the sample format, and can be a string or the
7965 corresponding numeric value defined in &lsquo;<tt>libavutil/samplefmt.h</tt>&rsquo;. Use &rsquo;p&rsquo;
7966 suffix for a planar sample format.
7967 </p>
7968 <p><var>channel_layout</var> specifies the channel layout, and can be a string
7969 or the corresponding number value defined in &lsquo;<tt>libavutil/channel_layout.h</tt>&rsquo;.
7970 </p>
7971 <p>The special parameter &quot;auto&quot;, signifies that the filter will
7972 automatically select the output format depending on the output filter.
7973 </p>
7974 <a name="Examples-18"></a>
7975 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-18">25.1.1 Examples</a></h3>
7976
7977 <ul>
7978 <li>
7979 Convert input to float, planar, stereo:
7980 <table><tr><td>&nbsp;</td><td><pre class="example">aconvert=fltp:stereo
7981 </pre></td></tr></table>
7982
7983 </li><li>
7984 Convert input to unsigned 8-bit, automatically select out channel layout:
7985 <table><tr><td>&nbsp;</td><td><pre class="example">aconvert=u8:auto
7986 </pre></td></tr></table>
7987 </li></ul>
7988
7989 <a name="adelay"></a>
7990 <h2 class="section"><a href="ffplay-all.html#toc-adelay">25.2 adelay</a></h2>
7991
7992 <p>Delay one or more audio channels.
7993 </p>
7994 <p>Samples in delayed channel are filled with silence.
7995 </p>
7996 <p>The filter accepts the following option:
7997 </p>
7998 <dl compact="compact">
7999 <dt> &lsquo;<samp>delays</samp>&rsquo;</dt>
8000 <dd><p>Set list of delays in milliseconds for each channel separated by &rsquo;|&rsquo;.
8001 At least one delay greater than 0 should be provided.
8002 Unused delays will be silently ignored. If number of given delays is
8003 smaller than number of channels all remaining channels will not be delayed.
8004 </p></dd>
8005 </dl>
8006
8007 <a name="Examples-30"></a>
8008 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-30">25.2.1 Examples</a></h3>
8009
8010 <ul>
8011 <li>
8012 Delay first channel by 1.5 seconds, the third channel by 0.5 seconds and leave
8013 the second channel (and any other channels that may be present) unchanged.
8014 <table><tr><td>&nbsp;</td><td><pre class="example">adelay=1500|0|500
8015 </pre></td></tr></table>
8016 </li></ul>
8017
8018 <a name="aecho"></a>
8019 <h2 class="section"><a href="ffplay-all.html#toc-aecho">25.3 aecho</a></h2>
8020
8021 <p>Apply echoing to the input audio.
8022 </p>
8023 <p>Echoes are reflected sound and can occur naturally amongst mountains
8024 (and sometimes large buildings) when talking or shouting; digital echo
8025 effects emulate this behaviour and are often used to help fill out the
8026 sound of a single instrument or vocal. The time difference between the
8027 original signal and the reflection is the <code>delay</code>, and the
8028 loudness of the reflected signal is the <code>decay</code>.
8029 Multiple echoes can have different delays and decays.
8030 </p>
8031 <p>A description of the accepted parameters follows.
8032 </p>
8033 <dl compact="compact">
8034 <dt> &lsquo;<samp>in_gain</samp>&rsquo;</dt>
8035 <dd><p>Set input gain of reflected signal. Default is <code>0.6</code>.
8036 </p>
8037 </dd>
8038 <dt> &lsquo;<samp>out_gain</samp>&rsquo;</dt>
8039 <dd><p>Set output gain of reflected signal. Default is <code>0.3</code>.
8040 </p>
8041 </dd>
8042 <dt> &lsquo;<samp>delays</samp>&rsquo;</dt>
8043 <dd><p>Set list of time intervals in milliseconds between original signal and reflections
8044 separated by &rsquo;|&rsquo;. Allowed range for each <code>delay</code> is <code>(0 - 90000.0]</code>.
8045 Default is <code>1000</code>.
8046 </p>
8047 </dd>
8048 <dt> &lsquo;<samp>decays</samp>&rsquo;</dt>
8049 <dd><p>Set list of loudnesses of reflected signals separated by &rsquo;|&rsquo;.
8050 Allowed range for each <code>decay</code> is <code>(0 - 1.0]</code>.
8051 Default is <code>0.5</code>.
8052 </p></dd>
8053 </dl>
8054
8055 <a name="Examples-41"></a>
8056 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-41">25.3.1 Examples</a></h3>
8057
8058 <ul>
8059 <li>
8060 Make it sound as if there are twice as many instruments as are actually playing:
8061 <table><tr><td>&nbsp;</td><td><pre class="example">aecho=0.8:0.88:60:0.4
8062 </pre></td></tr></table>
8063
8064 </li><li>
8065 If delay is very short, then it sound like a (metallic) robot playing music:
8066 <table><tr><td>&nbsp;</td><td><pre class="example">aecho=0.8:0.88:6:0.4
8067 </pre></td></tr></table>
8068
8069 </li><li>
8070 A longer delay will sound like an open air concert in the mountains:
8071 <table><tr><td>&nbsp;</td><td><pre class="example">aecho=0.8:0.9:1000:0.3
8072 </pre></td></tr></table>
8073
8074 </li><li>
8075 Same as above but with one more mountain:
8076 <table><tr><td>&nbsp;</td><td><pre class="example">aecho=0.8:0.9:1000|1800:0.3|0.25
8077 </pre></td></tr></table>
8078 </li></ul>
8079
8080 <a name="aeval"></a>
8081 <h2 class="section"><a href="ffplay-all.html#toc-aeval">25.4 aeval</a></h2>
8082
8083 <p>Modify an audio signal according to the specified expressions.
8084 </p>
8085 <p>This filter accepts one or more expressions (one for each channel),
8086 which are evaluated and used to modify a corresponding audio signal.
8087 </p>
8088 <p>This filter accepts the following options:
8089 </p>
8090 <dl compact="compact">
8091 <dt> &lsquo;<samp>exprs</samp>&rsquo;</dt>
8092 <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. If
8093 the number of input channels is greater than the number of
8094 expressions, the last specified expression is used for the remaining
8095 output channels.
8096 </p>
8097 </dd>
8098 <dt> &lsquo;<samp>channel_layout, c</samp>&rsquo;</dt>
8099 <dd><p>Set output channel layout. If not specified, the channel layout is
8100 specified by the number of expressions. If set to &lsquo;<samp>same</samp>&rsquo;, it will
8101 use by default the same input channel layout.
8102 </p></dd>
8103 </dl>
8104
8105 <p>Each expression in <var>exprs</var> can contain the following constants and functions:
8106 </p>
8107 <dl compact="compact">
8108 <dt> &lsquo;<samp>ch</samp>&rsquo;</dt>
8109 <dd><p>channel number of the current expression
8110 </p>
8111 </dd>
8112 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
8113 <dd><p>number of the evaluated sample, starting from 0
8114 </p>
8115 </dd>
8116 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
8117 <dd><p>sample rate
8118 </p>
8119 </dd>
8120 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
8121 <dd><p>time of the evaluated sample expressed in seconds
8122 </p>
8123 </dd>
8124 <dt> &lsquo;<samp>nb_in_channels</samp>&rsquo;</dt>
8125 <dt> &lsquo;<samp>nb_out_channels</samp>&rsquo;</dt>
8126 <dd><p>input and output number of channels
8127 </p>
8128 </dd>
8129 <dt> &lsquo;<samp>val(CH)</samp>&rsquo;</dt>
8130 <dd><p>the value of input channel with number <var>CH</var>
8131 </p></dd>
8132 </dl>
8133
8134 <p>Note: this filter is slow. For faster processing you should use a
8135 dedicated filter.
8136 </p>
8137 <a name="Examples-21"></a>
8138 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-21">25.4.1 Examples</a></h3>
8139
8140 <ul>
8141 <li>
8142 Half volume:
8143 <table><tr><td>&nbsp;</td><td><pre class="example">aeval=val(ch)/2:c=same
8144 </pre></td></tr></table>
8145
8146 </li><li>
8147 Invert phase of the second channel:
8148 <table><tr><td>&nbsp;</td><td><pre class="example">eval=val(0)|-val(1)
8149 </pre></td></tr></table>
8150 </li></ul>
8151
8152 <a name="afade"></a>
8153 <h2 class="section"><a href="ffplay-all.html#toc-afade">25.5 afade</a></h2>
8154
8155 <p>Apply fade-in/out effect to input audio.
8156 </p>
8157 <p>A description of the accepted parameters follows.
8158 </p>
8159 <dl compact="compact">
8160 <dt> &lsquo;<samp>type, t</samp>&rsquo;</dt>
8161 <dd><p>Specify the effect type, can be either <code>in</code> for fade-in, or
8162 <code>out</code> for a fade-out effect. Default is <code>in</code>.
8163 </p>
8164 </dd>
8165 <dt> &lsquo;<samp>start_sample, ss</samp>&rsquo;</dt>
8166 <dd><p>Specify the number of the start sample for starting to apply the fade
8167 effect. Default is 0.
8168 </p>
8169 </dd>
8170 <dt> &lsquo;<samp>nb_samples, ns</samp>&rsquo;</dt>
8171 <dd><p>Specify the number of samples for which the fade effect has to last. At
8172 the end of the fade-in effect the output audio will have the same
8173 volume as the input audio, at the end of the fade-out transition
8174 the output audio will be silence. Default is 44100.
8175 </p>
8176 </dd>
8177 <dt> &lsquo;<samp>start_time, st</samp>&rsquo;</dt>
8178 <dd><p>Specify time for starting to apply the fade effect. Default is 0.
8179 The accepted syntax is:
8180 </p><table><tr><td>&nbsp;</td><td><pre class="example">[-]HH[:MM[:SS[.m...]]]
8181 [-]S+[.m...]
8182 </pre></td></tr></table>
8183 <p>See also the function <code>av_parse_time()</code>.
8184 If set this option is used instead of <var>start_sample</var> one.
8185 </p>
8186 </dd>
8187 <dt> &lsquo;<samp>duration, d</samp>&rsquo;</dt>
8188 <dd><p>Specify the duration for which the fade effect has to last. Default is 0.
8189 The accepted syntax is:
8190 </p><table><tr><td>&nbsp;</td><td><pre class="example">[-]HH[:MM[:SS[.m...]]]
8191 [-]S+[.m...]
8192 </pre></td></tr></table>
8193 <p>See also the function <code>av_parse_time()</code>.
8194 At the end of the fade-in effect the output audio will have the same
8195 volume as the input audio, at the end of the fade-out transition
8196 the output audio will be silence.
8197 If set this option is used instead of <var>nb_samples</var> one.
8198 </p>
8199 </dd>
8200 <dt> &lsquo;<samp>curve</samp>&rsquo;</dt>
8201 <dd><p>Set curve for fade transition.
8202 </p>
8203 <p>It accepts the following values:
8204 </p><dl compact="compact">
8205 <dt> &lsquo;<samp>tri</samp>&rsquo;</dt>
8206 <dd><p>select triangular, linear slope (default)
8207 </p></dd>
8208 <dt> &lsquo;<samp>qsin</samp>&rsquo;</dt>
8209 <dd><p>select quarter of sine wave
8210 </p></dd>
8211 <dt> &lsquo;<samp>hsin</samp>&rsquo;</dt>
8212 <dd><p>select half of sine wave
8213 </p></dd>
8214 <dt> &lsquo;<samp>esin</samp>&rsquo;</dt>
8215 <dd><p>select exponential sine wave
8216 </p></dd>
8217 <dt> &lsquo;<samp>log</samp>&rsquo;</dt>
8218 <dd><p>select logarithmic
8219 </p></dd>
8220 <dt> &lsquo;<samp>par</samp>&rsquo;</dt>
8221 <dd><p>select inverted parabola
8222 </p></dd>
8223 <dt> &lsquo;<samp>qua</samp>&rsquo;</dt>
8224 <dd><p>select quadratic
8225 </p></dd>
8226 <dt> &lsquo;<samp>cub</samp>&rsquo;</dt>
8227 <dd><p>select cubic
8228 </p></dd>
8229 <dt> &lsquo;<samp>squ</samp>&rsquo;</dt>
8230 <dd><p>select square root
8231 </p></dd>
8232 <dt> &lsquo;<samp>cbr</samp>&rsquo;</dt>
8233 <dd><p>select cubic root
8234 </p></dd>
8235 </dl>
8236 </dd>
8237 </dl>
8238
8239 <a name="Examples-72"></a>
8240 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-72">25.5.1 Examples</a></h3>
8241
8242 <ul>
8243 <li>
8244 Fade in first 15 seconds of audio:
8245 <table><tr><td>&nbsp;</td><td><pre class="example">afade=t=in:ss=0:d=15
8246 </pre></td></tr></table>
8247
8248 </li><li>
8249 Fade out last 25 seconds of a 900 seconds audio:
8250 <table><tr><td>&nbsp;</td><td><pre class="example">afade=t=out:st=875:d=25
8251 </pre></td></tr></table>
8252 </li></ul>
8253
8254 <p><a name="aformat"></a>
8255 </p><a name="aformat-1"></a>
8256 <h2 class="section"><a href="ffplay-all.html#toc-aformat-1">25.6 aformat</a></h2>
8257
8258 <p>Set output format constraints for the input audio. The framework will
8259 negotiate the most appropriate format to minimize conversions.
8260 </p>
8261 <p>The filter accepts the following named parameters:
8262 </p><dl compact="compact">
8263 <dt> &lsquo;<samp>sample_fmts</samp>&rsquo;</dt>
8264 <dd><p>A &rsquo;|&rsquo;-separated list of requested sample formats.
8265 </p>
8266 </dd>
8267 <dt> &lsquo;<samp>sample_rates</samp>&rsquo;</dt>
8268 <dd><p>A &rsquo;|&rsquo;-separated list of requested sample rates.
8269 </p>
8270 </dd>
8271 <dt> &lsquo;<samp>channel_layouts</samp>&rsquo;</dt>
8272 <dd><p>A &rsquo;|&rsquo;-separated list of requested channel layouts.
8273 </p>
8274 <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)channel layout syntax</a>
8275 for the required syntax.
8276 </p></dd>
8277 </dl>
8278
8279 <p>If a parameter is omitted, all values are allowed.
8280 </p>
8281 <p>For example to force the output to either unsigned 8-bit or signed 16-bit stereo:
8282 </p><table><tr><td>&nbsp;</td><td><pre class="example">aformat=sample_fmts=u8|s16:channel_layouts=stereo
8283 </pre></td></tr></table>
8284
8285 <a name="allpass"></a>
8286 <h2 class="section"><a href="ffplay-all.html#toc-allpass">25.7 allpass</a></h2>
8287
8288 <p>Apply a two-pole all-pass filter with central frequency (in Hz)
8289 <var>frequency</var>, and filter-width <var>width</var>.
8290 An all-pass filter changes the audio&rsquo;s frequency to phase relationship
8291 without changing its frequency to amplitude relationship.
8292 </p>
8293 <p>The filter accepts the following options:
8294 </p>
8295 <dl compact="compact">
8296 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
8297 <dd><p>Set frequency in Hz.
8298 </p>
8299 </dd>
8300 <dt> &lsquo;<samp>width_type</samp>&rsquo;</dt>
8301 <dd><p>Set method to specify band-width of filter.
8302 </p><dl compact="compact">
8303 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
8304 <dd><p>Hz
8305 </p></dd>
8306 <dt> &lsquo;<samp>q</samp>&rsquo;</dt>
8307 <dd><p>Q-Factor
8308 </p></dd>
8309 <dt> &lsquo;<samp>o</samp>&rsquo;</dt>
8310 <dd><p>octave
8311 </p></dd>
8312 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
8313 <dd><p>slope
8314 </p></dd>
8315 </dl>
8316
8317 </dd>
8318 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
8319 <dd><p>Specify the band-width of a filter in width_type units.
8320 </p></dd>
8321 </dl>
8322
8323 <a name="amerge"></a>
8324 <h2 class="section"><a href="ffplay-all.html#toc-amerge">25.8 amerge</a></h2>
8325
8326 <p>Merge two or more audio streams into a single multi-channel stream.
8327 </p>
8328 <p>The filter accepts the following options:
8329 </p>
8330 <dl compact="compact">
8331 <dt> &lsquo;<samp>inputs</samp>&rsquo;</dt>
8332 <dd><p>Set the number of inputs. Default is 2.
8333 </p>
8334 </dd>
8335 </dl>
8336
8337 <p>If the channel layouts of the inputs are disjoint, and therefore compatible,
8338 the channel layout of the output will be set accordingly and the channels
8339 will be reordered as necessary. If the channel layouts of the inputs are not
8340 disjoint, the output will have all the channels of the first input then all
8341 the channels of the second input, in that order, and the channel layout of
8342 the output will be the default value corresponding to the total number of
8343 channels.
8344 </p>
8345 <p>For example, if the first input is in 2.1 (FL+FR+LF) and the second input
8346 is FC+BL+BR, then the output will be in 5.1, with the channels in the
8347 following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the
8348 first input, b1 is the first channel of the second input).
8349 </p>
8350 <p>On the other hand, if both input are in stereo, the output channels will be
8351 in the default order: a1, a2, b1, b2, and the channel layout will be
8352 arbitrarily set to 4.0, which may or may not be the expected value.
8353 </p>
8354 <p>All inputs must have the same sample rate, and format.
8355 </p>
8356 <p>If inputs do not have the same duration, the output will stop with the
8357 shortest.
8358 </p>
8359 <a name="Examples-28"></a>
8360 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-28">25.8.1 Examples</a></h3>
8361
8362 <ul>
8363 <li>
8364 Merge two mono files into a stereo stream:
8365 <table><tr><td>&nbsp;</td><td><pre class="example">amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
8366 </pre></td></tr></table>
8367
8368 </li><li>
8369 Multiple merges assuming 1 video stream and 6 audio streams in &lsquo;<tt>input.mkv</tt>&rsquo;:
8370 <table><tr><td>&nbsp;</td><td><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
8371 </pre></td></tr></table>
8372 </li></ul>
8373
8374 <a name="amix"></a>
8375 <h2 class="section"><a href="ffplay-all.html#toc-amix">25.9 amix</a></h2>
8376
8377 <p>Mixes multiple audio inputs into a single output.
8378 </p>
8379 <p>For example
8380 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
8381 </pre></td></tr></table>
8382 <p>will mix 3 input audio streams to a single output with the same duration as the
8383 first input and a dropout transition time of 3 seconds.
8384 </p>
8385 <p>The filter accepts the following named parameters:
8386 </p><dl compact="compact">
8387 <dt> &lsquo;<samp>inputs</samp>&rsquo;</dt>
8388 <dd><p>Number of inputs. If unspecified, it defaults to 2.
8389 </p>
8390 </dd>
8391 <dt> &lsquo;<samp>duration</samp>&rsquo;</dt>
8392 <dd><p>How to determine the end-of-stream.
8393 </p><dl compact="compact">
8394 <dt> &lsquo;<samp>longest</samp>&rsquo;</dt>
8395 <dd><p>Duration of longest input. (default)
8396 </p>
8397 </dd>
8398 <dt> &lsquo;<samp>shortest</samp>&rsquo;</dt>
8399 <dd><p>Duration of shortest input.
8400 </p>
8401 </dd>
8402 <dt> &lsquo;<samp>first</samp>&rsquo;</dt>
8403 <dd><p>Duration of first input.
8404 </p>
8405 </dd>
8406 </dl>
8407
8408 </dd>
8409 <dt> &lsquo;<samp>dropout_transition</samp>&rsquo;</dt>
8410 <dd><p>Transition time, in seconds, for volume renormalization when an input
8411 stream ends. The default value is 2 seconds.
8412 </p>
8413 </dd>
8414 </dl>
8415
8416 <a name="anull"></a>
8417 <h2 class="section"><a href="ffplay-all.html#toc-anull">25.10 anull</a></h2>
8418
8419 <p>Pass the audio source unchanged to the output.
8420 </p>
8421 <a name="apad"></a>
8422 <h2 class="section"><a href="ffplay-all.html#toc-apad">25.11 apad</a></h2>
8423
8424 <p>Pad the end of a audio stream with silence, this can be used together with
8425 -shortest to extend audio streams to the same length as the video stream.
8426 </p>
8427 <a name="aphaser"></a>
8428 <h2 class="section"><a href="ffplay-all.html#toc-aphaser">25.12 aphaser</a></h2>
8429 <p>Add a phasing effect to the input audio.
8430 </p>
8431 <p>A phaser filter creates series of peaks and troughs in the frequency spectrum.
8432 The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect.
8433 </p>
8434 <p>A description of the accepted parameters follows.
8435 </p>
8436 <dl compact="compact">
8437 <dt> &lsquo;<samp>in_gain</samp>&rsquo;</dt>
8438 <dd><p>Set input gain. Default is 0.4.
8439 </p>
8440 </dd>
8441 <dt> &lsquo;<samp>out_gain</samp>&rsquo;</dt>
8442 <dd><p>Set output gain. Default is 0.74
8443 </p>
8444 </dd>
8445 <dt> &lsquo;<samp>delay</samp>&rsquo;</dt>
8446 <dd><p>Set delay in milliseconds. Default is 3.0.
8447 </p>
8448 </dd>
8449 <dt> &lsquo;<samp>decay</samp>&rsquo;</dt>
8450 <dd><p>Set decay. Default is 0.4.
8451 </p>
8452 </dd>
8453 <dt> &lsquo;<samp>speed</samp>&rsquo;</dt>
8454 <dd><p>Set modulation speed in Hz. Default is 0.5.
8455 </p>
8456 </dd>
8457 <dt> &lsquo;<samp>type</samp>&rsquo;</dt>
8458 <dd><p>Set modulation type. Default is triangular.
8459 </p>
8460 <p>It accepts the following values:
8461 </p><dl compact="compact">
8462 <dt> &lsquo;<samp>triangular, t</samp>&rsquo;</dt>
8463 <dt> &lsquo;<samp>sinusoidal, s</samp>&rsquo;</dt>
8464 </dl>
8465 </dd>
8466 </dl>
8467
8468 <p><a name="aresample"></a>
8469 </p><a name="aresample-1"></a>
8470 <h2 class="section"><a href="ffplay-all.html#toc-aresample-1">25.13 aresample</a></h2>
8471
8472 <p>Resample the input audio to the specified parameters, using the
8473 libswresample library. If none are specified then the filter will
8474 automatically convert between its input and output.
8475 </p>
8476 <p>This filter is also able to stretch/squeeze the audio data to make it match
8477 the timestamps or to inject silence / cut out audio to make it match the
8478 timestamps, do a combination of both or do neither.
8479 </p>
8480 <p>The filter accepts the syntax
8481 [<var>sample_rate</var>:]<var>resampler_options</var>, where <var>sample_rate</var>
8482 expresses a sample rate and <var>resampler_options</var> is a list of
8483 <var>key</var>=<var>value</var> pairs, separated by &quot;:&quot;. See the
8484 ffmpeg-resampler manual for the complete list of supported options.
8485 </p>
8486 <a name="Examples-84"></a>
8487 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-84">25.13.1 Examples</a></h3>
8488
8489 <ul>
8490 <li>
8491 Resample the input audio to 44100Hz:
8492 <table><tr><td>&nbsp;</td><td><pre class="example">aresample=44100
8493 </pre></td></tr></table>
8494
8495 </li><li>
8496 Stretch/squeeze samples to the given timestamps, with a maximum of 1000
8497 samples per second compensation:
8498 <table><tr><td>&nbsp;</td><td><pre class="example">aresample=async=1000
8499 </pre></td></tr></table>
8500 </li></ul>
8501
8502 <a name="asetnsamples"></a>
8503 <h2 class="section"><a href="ffplay-all.html#toc-asetnsamples">25.14 asetnsamples</a></h2>
8504
8505 <p>Set the number of samples per each output audio frame.
8506 </p>
8507 <p>The last output packet may contain a different number of samples, as
8508 the filter will flush all the remaining samples when the input audio
8509 signal its end.
8510 </p>
8511 <p>The filter accepts the following options:
8512 </p>
8513 <dl compact="compact">
8514 <dt> &lsquo;<samp>nb_out_samples, n</samp>&rsquo;</dt>
8515 <dd><p>Set the number of frames per each output audio frame. The number is
8516 intended as the number of samples <em>per each channel</em>.
8517 Default value is 1024.
8518 </p>
8519 </dd>
8520 <dt> &lsquo;<samp>pad, p</samp>&rsquo;</dt>
8521 <dd><p>If set to 1, the filter will pad the last audio frame with zeroes, so
8522 that the last frame will contain the same number of samples as the
8523 previous ones. Default value is 1.
8524 </p></dd>
8525 </dl>
8526
8527 <p>For example, to set the number of per-frame samples to 1234 and
8528 disable padding for the last frame, use:
8529 </p><table><tr><td>&nbsp;</td><td><pre class="example">asetnsamples=n=1234:p=0
8530 </pre></td></tr></table>
8531
8532 <a name="asetrate"></a>
8533 <h2 class="section"><a href="ffplay-all.html#toc-asetrate">25.15 asetrate</a></h2>
8534
8535 <p>Set the sample rate without altering the PCM data.
8536 This will result in a change of speed and pitch.
8537 </p>
8538 <p>The filter accepts the following options:
8539 </p>
8540 <dl compact="compact">
8541 <dt> &lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
8542 <dd><p>Set the output sample rate. Default is 44100 Hz.
8543 </p></dd>
8544 </dl>
8545
8546 <a name="ashowinfo"></a>
8547 <h2 class="section"><a href="ffplay-all.html#toc-ashowinfo">25.16 ashowinfo</a></h2>
8548
8549 <p>Show a line containing various information for each input audio frame.
8550 The input audio is not modified.
8551 </p>
8552 <p>The shown line contains a sequence of key/value pairs of the form
8553 <var>key</var>:<var>value</var>.
8554 </p>
8555 <p>A description of each shown parameter follows:
8556 </p>
8557 <dl compact="compact">
8558 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
8559 <dd><p>sequential number of the input frame, starting from 0
8560 </p>
8561 </dd>
8562 <dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
8563 <dd><p>Presentation timestamp of the input frame, in time base units; the time base
8564 depends on the filter input pad, and is usually 1/<var>sample_rate</var>.
8565 </p>
8566 </dd>
8567 <dt> &lsquo;<samp>pts_time</samp>&rsquo;</dt>
8568 <dd><p>presentation timestamp of the input frame in seconds
8569 </p>
8570 </dd>
8571 <dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
8572 <dd><p>position of the frame in the input stream, -1 if this information in
8573 unavailable and/or meaningless (for example in case of synthetic audio)
8574 </p>
8575 </dd>
8576 <dt> &lsquo;<samp>fmt</samp>&rsquo;</dt>
8577 <dd><p>sample format
8578 </p>
8579 </dd>
8580 <dt> &lsquo;<samp>chlayout</samp>&rsquo;</dt>
8581 <dd><p>channel layout
8582 </p>
8583 </dd>
8584 <dt> &lsquo;<samp>rate</samp>&rsquo;</dt>
8585 <dd><p>sample rate for the audio frame
8586 </p>
8587 </dd>
8588 <dt> &lsquo;<samp>nb_samples</samp>&rsquo;</dt>
8589 <dd><p>number of samples (per channel) in the frame
8590 </p>
8591 </dd>
8592 <dt> &lsquo;<samp>checksum</samp>&rsquo;</dt>
8593 <dd><p>Adler-32 checksum (printed in hexadecimal) of the audio data. For planar audio
8594 the data is treated as if all the planes were concatenated.
8595 </p>
8596 </dd>
8597 <dt> &lsquo;<samp>plane_checksums</samp>&rsquo;</dt>
8598 <dd><p>A list of Adler-32 checksums for each data plane.
8599 </p></dd>
8600 </dl>
8601
8602 <a name="astats"></a>
8603 <h2 class="section"><a href="ffplay-all.html#toc-astats">25.17 astats</a></h2>
8604
8605 <p>Display time domain statistical information about the audio channels.
8606 Statistics are calculated and displayed for each audio channel and,
8607 where applicable, an overall figure is also given.
8608 </p>
8609 <p>The filter accepts the following option:
8610 </p><dl compact="compact">
8611 <dt> &lsquo;<samp>length</samp>&rsquo;</dt>
8612 <dd><p>Short window length in seconds, used for peak and trough RMS measurement.
8613 Default is <code>0.05</code> (50 miliseconds). Allowed range is <code>[0.1 - 10]</code>.
8614 </p></dd>
8615 </dl>
8616
8617 <p>A description of each shown parameter follows:
8618 </p>
8619 <dl compact="compact">
8620 <dt> &lsquo;<samp>DC offset</samp>&rsquo;</dt>
8621 <dd><p>Mean amplitude displacement from zero.
8622 </p>
8623 </dd>
8624 <dt> &lsquo;<samp>Min level</samp>&rsquo;</dt>
8625 <dd><p>Minimal sample level.
8626 </p>
8627 </dd>
8628 <dt> &lsquo;<samp>Max level</samp>&rsquo;</dt>
8629 <dd><p>Maximal sample level.
8630 </p>
8631 </dd>
8632 <dt> &lsquo;<samp>Peak level dB</samp>&rsquo;</dt>
8633 <dt> &lsquo;<samp>RMS level dB</samp>&rsquo;</dt>
8634 <dd><p>Standard peak and RMS level measured in dBFS.
8635 </p>
8636 </dd>
8637 <dt> &lsquo;<samp>RMS peak dB</samp>&rsquo;</dt>
8638 <dt> &lsquo;<samp>RMS trough dB</samp>&rsquo;</dt>
8639 <dd><p>Peak and trough values for RMS level measured over a short window.
8640 </p>
8641 </dd>
8642 <dt> &lsquo;<samp>Crest factor</samp>&rsquo;</dt>
8643 <dd><p>Standard ratio of peak to RMS level (note: not in dB).
8644 </p>
8645 </dd>
8646 <dt> &lsquo;<samp>Flat factor</samp>&rsquo;</dt>
8647 <dd><p>Flatness (i.e. consecutive samples with the same value) of the signal at its peak levels
8648 (i.e. either <var>Min level</var> or <var>Max level</var>).
8649 </p>
8650 </dd>
8651 <dt> &lsquo;<samp>Peak count</samp>&rsquo;</dt>
8652 <dd><p>Number of occasions (not the number of samples) that the signal attained either
8653 <var>Min level</var> or <var>Max level</var>.
8654 </p></dd>
8655 </dl>
8656
8657 <a name="astreamsync"></a>
8658 <h2 class="section"><a href="ffplay-all.html#toc-astreamsync">25.18 astreamsync</a></h2>
8659
8660 <p>Forward two audio streams and control the order the buffers are forwarded.
8661 </p>
8662 <p>The filter accepts the following options:
8663 </p>
8664 <dl compact="compact">
8665 <dt> &lsquo;<samp>expr, e</samp>&rsquo;</dt>
8666 <dd><p>Set the expression deciding which stream should be
8667 forwarded next: if the result is negative, the first stream is forwarded; if
8668 the result is positive or zero, the second stream is forwarded. It can use
8669 the following variables:
8670 </p>
8671 <dl compact="compact">
8672 <dt> <var>b1 b2</var></dt>
8673 <dd><p>number of buffers forwarded so far on each stream
8674 </p></dd>
8675 <dt> <var>s1 s2</var></dt>
8676 <dd><p>number of samples forwarded so far on each stream
8677 </p></dd>
8678 <dt> <var>t1 t2</var></dt>
8679 <dd><p>current timestamp of each stream
8680 </p></dd>
8681 </dl>
8682
8683 <p>The default value is <code>t1-t2</code>, which means to always forward the stream
8684 that has a smaller timestamp.
8685 </p></dd>
8686 </dl>
8687
8688 <a name="Examples-35"></a>
8689 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-35">25.18.1 Examples</a></h3>
8690
8691 <p>Stress-test <code>amerge</code> by randomly sending buffers on the wrong
8692 input, while avoiding too much of a desynchronization:
8693 </p><table><tr><td>&nbsp;</td><td><pre class="example">amovie=file.ogg [a] ; amovie=file.mp3 [b] ;
8694 [a] [b] astreamsync=(2*random(1))-1+tanh(5*(t1-t2)) [a2] [b2] ;
8695 [a2] [b2] amerge
8696 </pre></td></tr></table>
8697
8698 <a name="asyncts"></a>
8699 <h2 class="section"><a href="ffplay-all.html#toc-asyncts">25.19 asyncts</a></h2>
8700
8701 <p>Synchronize audio data with timestamps by squeezing/stretching it and/or
8702 dropping samples/adding silence when needed.
8703 </p>
8704 <p>This filter is not built by default, please use <a href="#aresample">aresample</a> to do squeezing/stretching.
8705 </p>
8706 <p>The filter accepts the following named parameters:
8707 </p><dl compact="compact">
8708 <dt> &lsquo;<samp>compensate</samp>&rsquo;</dt>
8709 <dd><p>Enable stretching/squeezing the data to make it match the timestamps. Disabled
8710 by default. When disabled, time gaps are covered with silence.
8711 </p>
8712 </dd>
8713 <dt> &lsquo;<samp>min_delta</samp>&rsquo;</dt>
8714 <dd><p>Minimum difference between timestamps and audio data (in seconds) to trigger
8715 adding/dropping samples. Default value is 0.1. If you get non-perfect sync with
8716 this filter, try setting this parameter to 0.
8717 </p>
8718 </dd>
8719 <dt> &lsquo;<samp>max_comp</samp>&rsquo;</dt>
8720 <dd><p>Maximum compensation in samples per second. Relevant only with compensate=1.
8721 Default value 500.
8722 </p>
8723 </dd>
8724 <dt> &lsquo;<samp>first_pts</samp>&rsquo;</dt>
8725 <dd><p>Assume the first pts should be this value. The time base is 1 / sample rate.
8726 This allows for padding/trimming at the start of stream. By default, no
8727 assumption is made about the first frame&rsquo;s expected pts, so no padding or
8728 trimming is done. For example, this could be set to 0 to pad the beginning with
8729 silence if an audio stream starts after the video stream or to trim any samples
8730 with a negative pts due to encoder delay.
8731 </p>
8732 </dd>
8733 </dl>
8734
8735 <a name="atempo"></a>
8736 <h2 class="section"><a href="ffplay-all.html#toc-atempo">25.20 atempo</a></h2>
8737
8738 <p>Adjust audio tempo.
8739 </p>
8740 <p>The filter accepts exactly one parameter, the audio tempo. If not
8741 specified then the filter will assume nominal 1.0 tempo. Tempo must
8742 be in the [0.5, 2.0] range.
8743 </p>
8744 <a name="Examples-57"></a>
8745 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-57">25.20.1 Examples</a></h3>
8746
8747 <ul>
8748 <li>
8749 Slow down audio to 80% tempo:
8750 <table><tr><td>&nbsp;</td><td><pre class="example">atempo=0.8
8751 </pre></td></tr></table>
8752
8753 </li><li>
8754 To speed up audio to 125% tempo:
8755 <table><tr><td>&nbsp;</td><td><pre class="example">atempo=1.25
8756 </pre></td></tr></table>
8757 </li></ul>
8758
8759 <a name="atrim"></a>
8760 <h2 class="section"><a href="ffplay-all.html#toc-atrim">25.21 atrim</a></h2>
8761
8762 <p>Trim the input so that the output contains one continuous subpart of the input.
8763 </p>
8764 <p>This filter accepts the following options:
8765 </p><dl compact="compact">
8766 <dt> &lsquo;<samp>start</samp>&rsquo;</dt>
8767 <dd><p>Specify time of the start of the kept section, i.e. the audio sample
8768 with the timestamp <var>start</var> will be the first sample in the output.
8769 </p>
8770 </dd>
8771 <dt> &lsquo;<samp>end</samp>&rsquo;</dt>
8772 <dd><p>Specify time of the first audio sample that will be dropped, i.e. the
8773 audio sample immediately preceding the one with the timestamp <var>end</var> will be
8774 the last sample in the output.
8775 </p>
8776 </dd>
8777 <dt> &lsquo;<samp>start_pts</samp>&rsquo;</dt>
8778 <dd><p>Same as <var>start</var>, except this option sets the start timestamp in samples
8779 instead of seconds.
8780 </p>
8781 </dd>
8782 <dt> &lsquo;<samp>end_pts</samp>&rsquo;</dt>
8783 <dd><p>Same as <var>end</var>, except this option sets the end timestamp in samples instead
8784 of seconds.
8785 </p>
8786 </dd>
8787 <dt> &lsquo;<samp>duration</samp>&rsquo;</dt>
8788 <dd><p>Specify maximum duration of the output.
8789 </p>
8790 </dd>
8791 <dt> &lsquo;<samp>start_sample</samp>&rsquo;</dt>
8792 <dd><p>Number of the first sample that should be passed to output.
8793 </p>
8794 </dd>
8795 <dt> &lsquo;<samp>end_sample</samp>&rsquo;</dt>
8796 <dd><p>Number of the first sample that should be dropped.
8797 </p></dd>
8798 </dl>
8799
8800 <p>&lsquo;<samp>start</samp>&rsquo;, &lsquo;<samp>end</samp>&rsquo;, &lsquo;<samp>duration</samp>&rsquo; are expressed as time
8801 duration specifications, check the &quot;Time duration&quot; section in the
8802 ffmpeg-utils manual.
8803 </p>
8804 <p>Note that the first two sets of the start/end options and the &lsquo;<samp>duration</samp>&rsquo;
8805 option look at the frame timestamp, while the _sample options simply count the
8806 samples that pass through the filter. So start/end_pts and start/end_sample will
8807 give different results when the timestamps are wrong, inexact or do not start at
8808 zero. Also note that this filter does not modify the timestamps. If you wish
8809 that the output timestamps start at zero, insert the asetpts filter after the
8810 atrim filter.
8811 </p>
8812 <p>If multiple start or end options are set, this filter tries to be greedy and
8813 keep all samples that match at least one of the specified constraints. To keep
8814 only the part that matches all the constraints at once, chain multiple atrim
8815 filters.
8816 </p>
8817 <p>The defaults are such that all the input is kept. So it is possible to set e.g.
8818 just the end values to keep everything before the specified time.
8819 </p>
8820 <p>Examples:
8821 </p><ul>
8822 <li>
8823 drop everything except the second minute of input
8824 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -af atrim=60:120
8825 </pre></td></tr></table>
8826
8827 </li><li>
8828 keep only the first 1000 samples
8829 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -af atrim=end_sample=1000
8830 </pre></td></tr></table>
8831
8832 </li></ul>
8833
8834 <a name="bandpass"></a>
8835 <h2 class="section"><a href="ffplay-all.html#toc-bandpass">25.22 bandpass</a></h2>
8836
8837 <p>Apply a two-pole Butterworth band-pass filter with central
8838 frequency <var>frequency</var>, and (3dB-point) band-width width.
8839 The <var>csg</var> option selects a constant skirt gain (peak gain = Q)
8840 instead of the default: constant 0dB peak gain.
8841 The filter roll off at 6dB per octave (20dB per decade).
8842 </p>
8843 <p>The filter accepts the following options:
8844 </p>
8845 <dl compact="compact">
8846 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
8847 <dd><p>Set the filter&rsquo;s central frequency. Default is <code>3000</code>.
8848 </p>
8849 </dd>
8850 <dt> &lsquo;<samp>csg</samp>&rsquo;</dt>
8851 <dd><p>Constant skirt gain if set to 1. Defaults to 0.
8852 </p>
8853 </dd>
8854 <dt> &lsquo;<samp>width_type</samp>&rsquo;</dt>
8855 <dd><p>Set method to specify band-width of filter.
8856 </p><dl compact="compact">
8857 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
8858 <dd><p>Hz
8859 </p></dd>
8860 <dt> &lsquo;<samp>q</samp>&rsquo;</dt>
8861 <dd><p>Q-Factor
8862 </p></dd>
8863 <dt> &lsquo;<samp>o</samp>&rsquo;</dt>
8864 <dd><p>octave
8865 </p></dd>
8866 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
8867 <dd><p>slope
8868 </p></dd>
8869 </dl>
8870
8871 </dd>
8872 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
8873 <dd><p>Specify the band-width of a filter in width_type units.
8874 </p></dd>
8875 </dl>
8876
8877 <a name="bandreject"></a>
8878 <h2 class="section"><a href="ffplay-all.html#toc-bandreject">25.23 bandreject</a></h2>
8879
8880 <p>Apply a two-pole Butterworth band-reject filter with central
8881 frequency <var>frequency</var>, and (3dB-point) band-width <var>width</var>.
8882 The filter roll off at 6dB per octave (20dB per decade).
8883 </p>
8884 <p>The filter accepts the following options:
8885 </p>
8886 <dl compact="compact">
8887 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
8888 <dd><p>Set the filter&rsquo;s central frequency. Default is <code>3000</code>.
8889 </p>
8890 </dd>
8891 <dt> &lsquo;<samp>width_type</samp>&rsquo;</dt>
8892 <dd><p>Set method to specify band-width of filter.
8893 </p><dl compact="compact">
8894 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
8895 <dd><p>Hz
8896 </p></dd>
8897 <dt> &lsquo;<samp>q</samp>&rsquo;</dt>
8898 <dd><p>Q-Factor
8899 </p></dd>
8900 <dt> &lsquo;<samp>o</samp>&rsquo;</dt>
8901 <dd><p>octave
8902 </p></dd>
8903 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
8904 <dd><p>slope
8905 </p></dd>
8906 </dl>
8907
8908 </dd>
8909 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
8910 <dd><p>Specify the band-width of a filter in width_type units.
8911 </p></dd>
8912 </dl>
8913
8914 <a name="bass"></a>
8915 <h2 class="section"><a href="ffplay-all.html#toc-bass">25.24 bass</a></h2>
8916
8917 <p>Boost or cut the bass (lower) frequencies of the audio using a two-pole
8918 shelving filter with a response similar to that of a standard
8919 hi-fi&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
8920 </p>
8921 <p>The filter accepts the following options:
8922 </p>
8923 <dl compact="compact">
8924 <dt> &lsquo;<samp>gain, g</samp>&rsquo;</dt>
8925 <dd><p>Give the gain at 0 Hz. Its useful range is about -20
8926 (for a large cut) to +20 (for a large boost).
8927 Beware of clipping when using a positive gain.
8928 </p>
8929 </dd>
8930 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
8931 <dd><p>Set the filter&rsquo;s central frequency and so can be used
8932 to extend or reduce the frequency range to be boosted or cut.
8933 The default value is <code>100</code> Hz.
8934 </p>
8935 </dd>
8936 <dt> &lsquo;<samp>width_type</samp>&rsquo;</dt>
8937 <dd><p>Set method to specify band-width of filter.
8938 </p><dl compact="compact">
8939 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
8940 <dd><p>Hz
8941 </p></dd>
8942 <dt> &lsquo;<samp>q</samp>&rsquo;</dt>
8943 <dd><p>Q-Factor
8944 </p></dd>
8945 <dt> &lsquo;<samp>o</samp>&rsquo;</dt>
8946 <dd><p>octave
8947 </p></dd>
8948 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
8949 <dd><p>slope
8950 </p></dd>
8951 </dl>
8952
8953 </dd>
8954 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
8955 <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
8956 </p></dd>
8957 </dl>
8958
8959 <a name="biquad"></a>
8960 <h2 class="section"><a href="ffplay-all.html#toc-biquad">25.25 biquad</a></h2>
8961
8962 <p>Apply a biquad IIR filter with the given coefficients.
8963 Where <var>b0</var>, <var>b1</var>, <var>b2</var> and <var>a0</var>, <var>a1</var>, <var>a2</var>
8964 are the numerator and denominator coefficients respectively.
8965 </p>
8966 <a name="channelmap"></a>
8967 <h2 class="section"><a href="ffplay-all.html#toc-channelmap">25.26 channelmap</a></h2>
8968
8969 <p>Remap input channels to new locations.
8970 </p>
8971 <p>This filter accepts the following named parameters:
8972 </p><dl compact="compact">
8973 <dt> &lsquo;<samp>channel_layout</samp>&rsquo;</dt>
8974 <dd><p>Channel layout of the output stream.
8975 </p>
8976 </dd>
8977 <dt> &lsquo;<samp>map</samp>&rsquo;</dt>
8978 <dd><p>Map channels from input to output. The argument is a &rsquo;|&rsquo;-separated list of
8979 mappings, each in the <code><var>in_channel</var>-<var>out_channel</var></code> or
8980 <var>in_channel</var> form. <var>in_channel</var> can be either the name of the input
8981 channel (e.g. FL for front left) or its index in the input channel layout.
8982 <var>out_channel</var> is the name of the output channel or its index in the output
8983 channel layout. If <var>out_channel</var> is not given then it is implicitly an
8984 index, starting with zero and increasing by one for each mapping.
8985 </p></dd>
8986 </dl>
8987
8988 <p>If no mapping is present, the filter will implicitly map input channels to
8989 output channels preserving index.
8990 </p>
8991 <p>For example, assuming a 5.1+downmix input MOV file
8992 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
8993 </pre></td></tr></table>
8994 <p>will create an output WAV file tagged as stereo from the downmix channels of
8995 the input.
8996 </p>
8997 <p>To fix a 5.1 WAV improperly encoded in AAC&rsquo;s native channel order
8998 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:channel_layout=5.1' out.wav
8999 </pre></td></tr></table>
9000
9001 <a name="channelsplit"></a>
9002 <h2 class="section"><a href="ffplay-all.html#toc-channelsplit">25.27 channelsplit</a></h2>
9003
9004 <p>Split each channel in input audio stream into a separate output stream.
9005 </p>
9006 <p>This filter accepts the following named parameters:
9007 </p><dl compact="compact">
9008 <dt> &lsquo;<samp>channel_layout</samp>&rsquo;</dt>
9009 <dd><p>Channel layout of the input stream. Default is &quot;stereo&quot;.
9010 </p></dd>
9011 </dl>
9012
9013 <p>For example, assuming a stereo input MP3 file
9014 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
9015 </pre></td></tr></table>
9016 <p>will create an output Matroska file with two audio streams, one containing only
9017 the left channel and the other the right channel.
9018 </p>
9019 <p>To split a 5.1 WAV file into per-channel files
9020 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.wav -filter_complex
9021 'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
9022 -map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
9023 front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
9024 side_right.wav
9025 </pre></td></tr></table>
9026
9027 <a name="compand"></a>
9028 <h2 class="section"><a href="ffplay-all.html#toc-compand">25.28 compand</a></h2>
9029 <p>Compress or expand audio dynamic range.
9030 </p>
9031 <p>A description of the accepted options follows.
9032 </p>
9033 <dl compact="compact">
9034 <dt> &lsquo;<samp>attacks</samp>&rsquo;</dt>
9035 <dt> &lsquo;<samp>decays</samp>&rsquo;</dt>
9036 <dd><p>Set list of times in seconds for each channel over which the instantaneous level
9037 of the input signal is averaged to determine its volume. <var>attacks</var> refers to
9038 increase of volume and <var>decays</var> refers to decrease of volume. For most
9039 situations, the attack time (response to the audio getting louder) should be
9040 shorter than the decay time because the human ear is more sensitive to sudden
9041 loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and
9042 a typical value for decay is 0.8 seconds.
9043 </p>
9044 </dd>
9045 <dt> &lsquo;<samp>points</samp>&rsquo;</dt>
9046 <dd><p>Set list of points for the transfer function, specified in dB relative to the
9047 maximum possible signal amplitude. Each key points list must be defined using
9048 the following syntax: <code>x0/y0|x1/y1|x2/y2|....</code> or
9049 <code>x0/y0 x1/y1 x2/y2 ....</code>
9050 </p>
9051 <p>The input values must be in strictly increasing order but the transfer function
9052 does not have to be monotonically rising. The point <code>0/0</code> is assumed but
9053 may be overridden (by <code>0/out-dBn</code>). Typical values for the transfer
9054 function are <code>-70/-70|-60/-20</code>.
9055 </p>
9056 </dd>
9057 <dt> &lsquo;<samp>soft-knee</samp>&rsquo;</dt>
9058 <dd><p>Set the curve radius in dB for all joints. Defaults to 0.01.
9059 </p>
9060 </dd>
9061 <dt> &lsquo;<samp>gain</samp>&rsquo;</dt>
9062 <dd><p>Set additional gain in dB to be applied at all points on the transfer function.
9063 This allows easy adjustment of the overall gain. Defaults to 0.
9064 </p>
9065 </dd>
9066 <dt> &lsquo;<samp>volume</samp>&rsquo;</dt>
9067 <dd><p>Set initial volume in dB to be assumed for each channel when filtering starts.
9068 This permits the user to supply a nominal level initially, so that, for
9069 example, a very large gain is not applied to initial signal levels before the
9070 companding has begun to operate. A typical value for audio which is initially
9071 quiet is -90 dB. Defaults to 0.
9072 </p>
9073 </dd>
9074 <dt> &lsquo;<samp>delay</samp>&rsquo;</dt>
9075 <dd><p>Set delay in seconds. The input audio is analyzed immediately, but audio is
9076 delayed before being fed to the volume adjuster. Specifying a delay
9077 approximately equal to the attack/decay times allows the filter to effectively
9078 operate in predictive rather than reactive mode. Defaults to 0.
9079 </p>
9080 </dd>
9081 </dl>
9082
9083 <a name="Examples-37"></a>
9084 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-37">25.28.1 Examples</a></h3>
9085
9086 <ul>
9087 <li>
9088 Make music with both quiet and loud passages suitable for listening in a noisy
9089 environment:
9090 <table><tr><td>&nbsp;</td><td><pre class="example">compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:0.2
9091 </pre></td></tr></table>
9092
9093 </li><li>
9094 Noise gate for when the noise is at a lower level than the signal:
9095 <table><tr><td>&nbsp;</td><td><pre class="example">compand=.1|.1:.2|.2:-900/-900|-50.1/-900|-50/-50:.01:0:-90:.1
9096 </pre></td></tr></table>
9097
9098 </li><li>
9099 Here is another noise gate, this time for when the noise is at a higher level
9100 than the signal (making it, in some ways, similar to squelch):
9101 <table><tr><td>&nbsp;</td><td><pre class="example">compand=.1|.1:.1|.1:-45.1/-45.1|-45/-900|0/-900:.01:45:-90:.1
9102 </pre></td></tr></table>
9103 </li></ul>
9104
9105 <a name="earwax"></a>
9106 <h2 class="section"><a href="ffplay-all.html#toc-earwax">25.29 earwax</a></h2>
9107
9108 <p>Make audio easier to listen to on headphones.
9109 </p>
9110 <p>This filter adds &lsquo;cues&rsquo; to 44.1kHz stereo (i.e. audio CD format) audio
9111 so that when listened to on headphones the stereo image is moved from
9112 inside your head (standard for headphones) to outside and in front of
9113 the listener (standard for speakers).
9114 </p>
9115 <p>Ported from SoX.
9116 </p>
9117 <a name="equalizer"></a>
9118 <h2 class="section"><a href="ffplay-all.html#toc-equalizer">25.30 equalizer</a></h2>
9119
9120 <p>Apply a two-pole peaking equalisation (EQ) filter. With this
9121 filter, the signal-level at and around a selected frequency can
9122 be increased or decreased, whilst (unlike bandpass and bandreject
9123 filters) that at all other frequencies is unchanged.
9124 </p>
9125 <p>In order to produce complex equalisation curves, this filter can
9126 be given several times, each with a different central frequency.
9127 </p>
9128 <p>The filter accepts the following options:
9129 </p>
9130 <dl compact="compact">
9131 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
9132 <dd><p>Set the filter&rsquo;s central frequency in Hz.
9133 </p>
9134 </dd>
9135 <dt> &lsquo;<samp>width_type</samp>&rsquo;</dt>
9136 <dd><p>Set method to specify band-width of filter.
9137 </p><dl compact="compact">
9138 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
9139 <dd><p>Hz
9140 </p></dd>
9141 <dt> &lsquo;<samp>q</samp>&rsquo;</dt>
9142 <dd><p>Q-Factor
9143 </p></dd>
9144 <dt> &lsquo;<samp>o</samp>&rsquo;</dt>
9145 <dd><p>octave
9146 </p></dd>
9147 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
9148 <dd><p>slope
9149 </p></dd>
9150 </dl>
9151
9152 </dd>
9153 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
9154 <dd><p>Specify the band-width of a filter in width_type units.
9155 </p>
9156 </dd>
9157 <dt> &lsquo;<samp>gain, g</samp>&rsquo;</dt>
9158 <dd><p>Set the required gain or attenuation in dB.
9159 Beware of clipping when using a positive gain.
9160 </p></dd>
9161 </dl>
9162
9163 <a name="Examples-69"></a>
9164 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-69">25.30.1 Examples</a></h3>
9165 <ul>
9166 <li>
9167 Attenuate 10 dB at 1000 Hz, with a bandwidth of 200 Hz:
9168 <table><tr><td>&nbsp;</td><td><pre class="example">equalizer=f=1000:width_type=h:width=200:g=-10
9169 </pre></td></tr></table>
9170
9171 </li><li>
9172 Apply 2 dB gain at 1000 Hz with Q 1 and attenuate 5 dB at 100 Hz with Q 2:
9173 <table><tr><td>&nbsp;</td><td><pre class="example">equalizer=f=1000:width_type=q:width=1:g=2,equalizer=f=100:width_type=q:width=2:g=-5
9174 </pre></td></tr></table>
9175 </li></ul>
9176
9177 <a name="highpass"></a>
9178 <h2 class="section"><a href="ffplay-all.html#toc-highpass">25.31 highpass</a></h2>
9179
9180 <p>Apply a high-pass filter with 3dB point frequency.
9181 The filter can be either single-pole, or double-pole (the default).
9182 The filter roll off at 6dB per pole per octave (20dB per pole per decade).
9183 </p>
9184 <p>The filter accepts the following options:
9185 </p>
9186 <dl compact="compact">
9187 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
9188 <dd><p>Set frequency in Hz. Default is 3000.
9189 </p>
9190 </dd>
9191 <dt> &lsquo;<samp>poles, p</samp>&rsquo;</dt>
9192 <dd><p>Set number of poles. Default is 2.
9193 </p>
9194 </dd>
9195 <dt> &lsquo;<samp>width_type</samp>&rsquo;</dt>
9196 <dd><p>Set method to specify band-width of filter.
9197 </p><dl compact="compact">
9198 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
9199 <dd><p>Hz
9200 </p></dd>
9201 <dt> &lsquo;<samp>q</samp>&rsquo;</dt>
9202 <dd><p>Q-Factor
9203 </p></dd>
9204 <dt> &lsquo;<samp>o</samp>&rsquo;</dt>
9205 <dd><p>octave
9206 </p></dd>
9207 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
9208 <dd><p>slope
9209 </p></dd>
9210 </dl>
9211
9212 </dd>
9213 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
9214 <dd><p>Specify the band-width of a filter in width_type units.
9215 Applies only to double-pole filter.
9216 The default is 0.707q and gives a Butterworth response.
9217 </p></dd>
9218 </dl>
9219
9220 <a name="join"></a>
9221 <h2 class="section"><a href="ffplay-all.html#toc-join">25.32 join</a></h2>
9222
9223 <p>Join multiple input streams into one multi-channel stream.
9224 </p>
9225 <p>The filter accepts the following named parameters:
9226 </p><dl compact="compact">
9227 <dt> &lsquo;<samp>inputs</samp>&rsquo;</dt>
9228 <dd><p>Number of input streams. Defaults to 2.
9229 </p>
9230 </dd>
9231 <dt> &lsquo;<samp>channel_layout</samp>&rsquo;</dt>
9232 <dd><p>Desired output channel layout. Defaults to stereo.
9233 </p>
9234 </dd>
9235 <dt> &lsquo;<samp>map</samp>&rsquo;</dt>
9236 <dd><p>Map channels from inputs to output. The argument is a &rsquo;|&rsquo;-separated list of
9237 mappings, each in the <code><var>input_idx</var>.<var>in_channel</var>-<var>out_channel</var></code>
9238 form. <var>input_idx</var> is the 0-based index of the input stream. <var>in_channel</var>
9239 can be either the name of the input channel (e.g. FL for front left) or its
9240 index in the specified input stream. <var>out_channel</var> is the name of the output
9241 channel.
9242 </p></dd>
9243 </dl>
9244
9245 <p>The filter will attempt to guess the mappings when those are not specified
9246 explicitly. It does so by first trying to find an unused matching input channel
9247 and if that fails it picks the first unused input channel.
9248 </p>
9249 <p>E.g. to join 3 inputs (with properly set channel layouts)
9250 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
9251 </pre></td></tr></table>
9252
9253 <p>To build a 5.1 output from 6 single-channel streams:
9254 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
9255 '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'
9256 out
9257 </pre></td></tr></table>
9258
9259 <a name="ladspa"></a>
9260 <h2 class="section"><a href="ffplay-all.html#toc-ladspa">25.33 ladspa</a></h2>
9261
9262 <p>Load a LADSPA (Linux Audio Developer&rsquo;s Simple Plugin API) plugin.
9263 </p>
9264 <p>To enable compilation of this filter you need to configure FFmpeg with
9265 <code>--enable-ladspa</code>.
9266 </p>
9267 <dl compact="compact">
9268 <dt> &lsquo;<samp>file, f</samp>&rsquo;</dt>
9269 <dd><p>Specifies the name of LADSPA plugin library to load. If the environment
9270 variable <code>LADSPA_PATH</code> is defined, the LADSPA plugin is searched in
9271 each one of the directories specified by the colon separated list in
9272 <code>LADSPA_PATH</code>, otherwise in the standard LADSPA paths, which are in
9273 this order: &lsquo;<tt>HOME/.ladspa/lib/</tt>&rsquo;, &lsquo;<tt>/usr/local/lib/ladspa/</tt>&rsquo;,
9274 &lsquo;<tt>/usr/lib/ladspa/</tt>&rsquo;.
9275 </p>
9276 </dd>
9277 <dt> &lsquo;<samp>plugin, p</samp>&rsquo;</dt>
9278 <dd><p>Specifies the plugin within the library. Some libraries contain only
9279 one plugin, but others contain many of them. If this is not set filter
9280 will list all available plugins within the specified library.
9281 </p>
9282 </dd>
9283 <dt> &lsquo;<samp>controls, c</samp>&rsquo;</dt>
9284 <dd><p>Set the &rsquo;|&rsquo; separated list of controls which are zero or more floating point
9285 values that determine the behavior of the loaded plugin (for example delay,
9286 threshold or gain).
9287 Controls need to be defined using the following syntax:
9288 c0=<var>value0</var>|c1=<var>value1</var>|c2=<var>value2</var>|..., where
9289 <var>valuei</var> is the value set on the <var>i</var>-th control.
9290 If &lsquo;<samp>controls</samp>&rsquo; is set to <code>help</code>, all available controls and
9291 their valid ranges are printed.
9292 </p>
9293 </dd>
9294 <dt> &lsquo;<samp>sample_rate, s</samp>&rsquo;</dt>
9295 <dd><p>Specify the sample rate, default to 44100. Only used if plugin have
9296 zero inputs.
9297 </p>
9298 </dd>
9299 <dt> &lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
9300 <dd><p>Set the number of samples per channel per each output frame, default
9301 is 1024. Only used if plugin have zero inputs.
9302 </p>
9303 </dd>
9304 <dt> &lsquo;<samp>duration, d</samp>&rsquo;</dt>
9305 <dd><p>Set the minimum duration of the sourced audio. See the function
9306 <code>av_parse_time()</code> for the accepted format, also check the &quot;Time duration&quot;
9307 section in the ffmpeg-utils manual.
9308 Note that the resulting duration may be greater than the specified duration,
9309 as the generated audio is always cut at the end of a complete frame.
9310 If not specified, or the expressed duration is negative, the audio is
9311 supposed to be generated forever.
9312 Only used if plugin have zero inputs.
9313 </p>
9314 </dd>
9315 </dl>
9316
9317 <a name="Examples-54"></a>
9318 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-54">25.33.1 Examples</a></h3>
9319
9320 <ul>
9321 <li>
9322 List all available plugins within amp (LADSPA example plugin) library:
9323 <table><tr><td>&nbsp;</td><td><pre class="example">ladspa=file=amp
9324 </pre></td></tr></table>
9325
9326 </li><li>
9327 List all available controls and their valid ranges for <code>vcf_notch</code>
9328 plugin from <code>VCF</code> library:
9329 <table><tr><td>&nbsp;</td><td><pre class="example">ladspa=f=vcf:p=vcf_notch:c=help
9330 </pre></td></tr></table>
9331
9332 </li><li>
9333 Simulate low quality audio equipment using <code>Computer Music Toolkit</code> (CMT)
9334 plugin library:
9335 <table><tr><td>&nbsp;</td><td><pre class="example">ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12
9336 </pre></td></tr></table>
9337
9338 </li><li>
9339 Add reverberation to the audio using TAP-plugins
9340 (Tom&rsquo;s Audio Processing plugins):
9341 <table><tr><td>&nbsp;</td><td><pre class="example">ladspa=file=tap_reverb:tap_reverb
9342 </pre></td></tr></table>
9343
9344 </li><li>
9345 Generate white noise, with 0.2 amplitude:
9346 <table><tr><td>&nbsp;</td><td><pre class="example">ladspa=file=cmt:noise_source_white:c=c0=.2
9347 </pre></td></tr></table>
9348
9349 </li><li>
9350 Generate 20 bpm clicks using plugin <code>C* Click - Metronome</code> from the
9351 <code>C* Audio Plugin Suite</code> (CAPS) library:
9352 <table><tr><td>&nbsp;</td><td><pre class="example">ladspa=file=caps:Click:c=c1=20'
9353 </pre></td></tr></table>
9354
9355 </li><li>
9356 Apply <code>C* Eq10X2 - Stereo 10-band equaliser</code> effect:
9357 <table><tr><td>&nbsp;</td><td><pre class="example">ladspa=caps:Eq10X2:c=c0=-48|c9=-24|c3=12|c4=2
9358 </pre></td></tr></table>
9359 </li></ul>
9360
9361 <a name="Commands-1"></a>
9362 <h3 class="subsection"><a href="ffplay-all.html#toc-Commands-1">25.33.2 Commands</a></h3>
9363
9364 <p>This filter supports the following commands:
9365 </p><dl compact="compact">
9366 <dt> &lsquo;<samp>cN</samp>&rsquo;</dt>
9367 <dd><p>Modify the <var>N</var>-th control value.
9368 </p>
9369 <p>If the specified value is not valid, it is ignored and prior one is kept.
9370 </p></dd>
9371 </dl>
9372
9373 <a name="lowpass"></a>
9374 <h2 class="section"><a href="ffplay-all.html#toc-lowpass">25.34 lowpass</a></h2>
9375
9376 <p>Apply a low-pass filter with 3dB point frequency.
9377 The filter can be either single-pole or double-pole (the default).
9378 The filter roll off at 6dB per pole per octave (20dB per pole per decade).
9379 </p>
9380 <p>The filter accepts the following options:
9381 </p>
9382 <dl compact="compact">
9383 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
9384 <dd><p>Set frequency in Hz. Default is 500.
9385 </p>
9386 </dd>
9387 <dt> &lsquo;<samp>poles, p</samp>&rsquo;</dt>
9388 <dd><p>Set number of poles. Default is 2.
9389 </p>
9390 </dd>
9391 <dt> &lsquo;<samp>width_type</samp>&rsquo;</dt>
9392 <dd><p>Set method to specify band-width of filter.
9393 </p><dl compact="compact">
9394 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
9395 <dd><p>Hz
9396 </p></dd>
9397 <dt> &lsquo;<samp>q</samp>&rsquo;</dt>
9398 <dd><p>Q-Factor
9399 </p></dd>
9400 <dt> &lsquo;<samp>o</samp>&rsquo;</dt>
9401 <dd><p>octave
9402 </p></dd>
9403 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
9404 <dd><p>slope
9405 </p></dd>
9406 </dl>
9407
9408 </dd>
9409 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
9410 <dd><p>Specify the band-width of a filter in width_type units.
9411 Applies only to double-pole filter.
9412 The default is 0.707q and gives a Butterworth response.
9413 </p></dd>
9414 </dl>
9415
9416 <a name="pan"></a>
9417 <h2 class="section"><a href="ffplay-all.html#toc-pan">25.35 pan</a></h2>
9418
9419 <p>Mix channels with specific gain levels. The filter accepts the output
9420 channel layout followed by a set of channels definitions.
9421 </p>
9422 <p>This filter is also designed to remap efficiently the channels of an audio
9423 stream.
9424 </p>
9425 <p>The filter accepts parameters of the form:
9426 &quot;<var>l</var>:<var>outdef</var>:<var>outdef</var>:...&quot;
9427 </p>
9428 <dl compact="compact">
9429 <dt> &lsquo;<samp>l</samp>&rsquo;</dt>
9430 <dd><p>output channel layout or number of channels
9431 </p>
9432 </dd>
9433 <dt> &lsquo;<samp>outdef</samp>&rsquo;</dt>
9434 <dd><p>output channel specification, of the form:
9435 &quot;<var>out_name</var>=[<var>gain</var>*]<var>in_name</var>[+[<var>gain</var>*]<var>in_name</var>...]&quot;
9436 </p>
9437 </dd>
9438 <dt> &lsquo;<samp>out_name</samp>&rsquo;</dt>
9439 <dd><p>output channel to define, either a channel name (FL, FR, etc.) or a channel
9440 number (c0, c1, etc.)
9441 </p>
9442 </dd>
9443 <dt> &lsquo;<samp>gain</samp>&rsquo;</dt>
9444 <dd><p>multiplicative coefficient for the channel, 1 leaving the volume unchanged
9445 </p>
9446 </dd>
9447 <dt> &lsquo;<samp>in_name</samp>&rsquo;</dt>
9448 <dd><p>input channel to use, see out_name for details; it is not possible to mix
9449 named and numbered input channels
9450 </p></dd>
9451 </dl>
9452
9453 <p>If the &lsquo;=&rsquo; in a channel specification is replaced by &lsquo;&lt;&rsquo;, then the gains for
9454 that specification will be renormalized so that the total is 1, thus
9455 avoiding clipping noise.
9456 </p>
9457 <a name="Mixing-examples"></a>
9458 <h3 class="subsection"><a href="ffplay-all.html#toc-Mixing-examples">25.35.1 Mixing examples</a></h3>
9459
9460 <p>For example, if you want to down-mix from stereo to mono, but with a bigger
9461 factor for the left channel:
9462 </p><table><tr><td>&nbsp;</td><td><pre class="example">pan=1:c0=0.9*c0+0.1*c1
9463 </pre></td></tr></table>
9464
9465 <p>A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
9466 7-channels surround:
9467 </p><table><tr><td>&nbsp;</td><td><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
9468 </pre></td></tr></table>
9469
9470 <p>Note that <code>ffmpeg</code> integrates a default down-mix (and up-mix) system
9471 that should be preferred (see &quot;-ac&quot; option) unless you have very specific
9472 needs.
9473 </p>
9474 <a name="Remapping-examples"></a>
9475 <h3 class="subsection"><a href="ffplay-all.html#toc-Remapping-examples">25.35.2 Remapping examples</a></h3>
9476
9477 <p>The channel remapping will be effective if, and only if:
9478 </p>
9479 <ul>
9480 <li> gain coefficients are zeroes or ones,
9481 </li><li> only one input per channel output,
9482 </li></ul>
9483
9484 <p>If all these conditions are satisfied, the filter will notify the user (&quot;Pure
9485 channel mapping detected&quot;), and use an optimized and lossless method to do the
9486 remapping.
9487 </p>
9488 <p>For example, if you have a 5.1 source and want a stereo audio stream by
9489 dropping the extra channels:
9490 </p><table><tr><td>&nbsp;</td><td><pre class="example">pan=&quot;stereo: c0=FL : c1=FR&quot;
9491 </pre></td></tr></table>
9492
9493 <p>Given the same source, you can also switch front left and front right channels
9494 and keep the input channel layout:
9495 </p><table><tr><td>&nbsp;</td><td><pre class="example">pan=&quot;5.1: c0=c1 : c1=c0 : c2=c2 : c3=c3 : c4=c4 : c5=c5&quot;
9496 </pre></td></tr></table>
9497
9498 <p>If the input is a stereo audio stream, you can mute the front left channel (and
9499 still keep the stereo channel layout) with:
9500 </p><table><tr><td>&nbsp;</td><td><pre class="example">pan=&quot;stereo:c1=c1&quot;
9501 </pre></td></tr></table>
9502
9503 <p>Still with a stereo audio stream input, you can copy the right channel in both
9504 front left and right:
9505 </p><table><tr><td>&nbsp;</td><td><pre class="example">pan=&quot;stereo: c0=FR : c1=FR&quot;
9506 </pre></td></tr></table>
9507
9508 <a name="replaygain"></a>
9509 <h2 class="section"><a href="ffplay-all.html#toc-replaygain">25.36 replaygain</a></h2>
9510
9511 <p>ReplayGain scanner filter. This filter takes an audio stream as an input and
9512 outputs it unchanged.
9513 At end of filtering it displays <code>track_gain</code> and <code>track_peak</code>.
9514 </p>
9515 <a name="resample"></a>
9516 <h2 class="section"><a href="ffplay-all.html#toc-resample">25.37 resample</a></h2>
9517
9518 <p>Convert the audio sample format, sample rate and channel layout. This filter is
9519 not meant to be used directly.
9520 </p>
9521 <a name="silencedetect"></a>
9522 <h2 class="section"><a href="ffplay-all.html#toc-silencedetect">25.38 silencedetect</a></h2>
9523
9524 <p>Detect silence in an audio stream.
9525 </p>
9526 <p>This filter logs a message when it detects that the input audio volume is less
9527 or equal to a noise tolerance value for a duration greater or equal to the
9528 minimum detected noise duration.
9529 </p>
9530 <p>The printed times and duration are expressed in seconds.
9531 </p>
9532 <p>The filter accepts the following options:
9533 </p>
9534 <dl compact="compact">
9535 <dt> &lsquo;<samp>duration, d</samp>&rsquo;</dt>
9536 <dd><p>Set silence duration until notification (default is 2 seconds).
9537 </p>
9538 </dd>
9539 <dt> &lsquo;<samp>noise, n</samp>&rsquo;</dt>
9540 <dd><p>Set noise tolerance. Can be specified in dB (in case &quot;dB&quot; is appended to the
9541 specified value) or amplitude ratio. Default is -60dB, or 0.001.
9542 </p></dd>
9543 </dl>
9544
9545 <a name="Examples-14"></a>
9546 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-14">25.38.1 Examples</a></h3>
9547
9548 <ul>
9549 <li>
9550 Detect 5 seconds of silence with -50dB noise tolerance:
9551 <table><tr><td>&nbsp;</td><td><pre class="example">silencedetect=n=-50dB:d=5
9552 </pre></td></tr></table>
9553
9554 </li><li>
9555 Complete example with <code>ffmpeg</code> to detect silence with 0.0001 noise
9556 tolerance in &lsquo;<tt>silence.mp3</tt>&rsquo;:
9557 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
9558 </pre></td></tr></table>
9559 </li></ul>
9560
9561 <a name="treble"></a>
9562 <h2 class="section"><a href="ffplay-all.html#toc-treble">25.39 treble</a></h2>
9563
9564 <p>Boost or cut treble (upper) frequencies of the audio using a two-pole
9565 shelving filter with a response similar to that of a standard
9566 hi-fi&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
9567 </p>
9568 <p>The filter accepts the following options:
9569 </p>
9570 <dl compact="compact">
9571 <dt> &lsquo;<samp>gain, g</samp>&rsquo;</dt>
9572 <dd><p>Give the gain at whichever is the lower of ~22 kHz and the
9573 Nyquist frequency. Its useful range is about -20 (for a large cut)
9574 to +20 (for a large boost). Beware of clipping when using a positive gain.
9575 </p>
9576 </dd>
9577 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
9578 <dd><p>Set the filter&rsquo;s central frequency and so can be used
9579 to extend or reduce the frequency range to be boosted or cut.
9580 The default value is <code>3000</code> Hz.
9581 </p>
9582 </dd>
9583 <dt> &lsquo;<samp>width_type</samp>&rsquo;</dt>
9584 <dd><p>Set method to specify band-width of filter.
9585 </p><dl compact="compact">
9586 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
9587 <dd><p>Hz
9588 </p></dd>
9589 <dt> &lsquo;<samp>q</samp>&rsquo;</dt>
9590 <dd><p>Q-Factor
9591 </p></dd>
9592 <dt> &lsquo;<samp>o</samp>&rsquo;</dt>
9593 <dd><p>octave
9594 </p></dd>
9595 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
9596 <dd><p>slope
9597 </p></dd>
9598 </dl>
9599
9600 </dd>
9601 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
9602 <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
9603 </p></dd>
9604 </dl>
9605
9606 <a name="volume"></a>
9607 <h2 class="section"><a href="ffplay-all.html#toc-volume">25.40 volume</a></h2>
9608
9609 <p>Adjust the input audio volume.
9610 </p>
9611 <p>The filter accepts the following options:
9612 </p>
9613 <dl compact="compact">
9614 <dt> &lsquo;<samp>volume</samp>&rsquo;</dt>
9615 <dd><p>Set audio volume expression.
9616 </p>
9617 <p>Output values are clipped to the maximum value.
9618 </p>
9619 <p>The output audio volume is given by the relation:
9620 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>output_volume</var> = <var>volume</var> * <var>input_volume</var>
9621 </pre></td></tr></table>
9622
9623 <p>Default value for <var>volume</var> is &quot;1.0&quot;.
9624 </p>
9625 </dd>
9626 <dt> &lsquo;<samp>precision</samp>&rsquo;</dt>
9627 <dd><p>Set the mathematical precision.
9628 </p>
9629 <p>This determines which input sample formats will be allowed, which affects the
9630 precision of the volume scaling.
9631 </p>
9632 <dl compact="compact">
9633 <dt> &lsquo;<samp>fixed</samp>&rsquo;</dt>
9634 <dd><p>8-bit fixed-point; limits input sample format to U8, S16, and S32.
9635 </p></dd>
9636 <dt> &lsquo;<samp>float</samp>&rsquo;</dt>
9637 <dd><p>32-bit floating-point; limits input sample format to FLT. (default)
9638 </p></dd>
9639 <dt> &lsquo;<samp>double</samp>&rsquo;</dt>
9640 <dd><p>64-bit floating-point; limits input sample format to DBL.
9641 </p></dd>
9642 </dl>
9643
9644 </dd>
9645 <dt> &lsquo;<samp>eval</samp>&rsquo;</dt>
9646 <dd><p>Set when the volume expression is evaluated.
9647 </p>
9648 <p>It accepts the following values:
9649 </p><dl compact="compact">
9650 <dt> &lsquo;<samp>once</samp>&rsquo;</dt>
9651 <dd><p>only evaluate expression once during the filter initialization, or
9652 when the &lsquo;<samp>volume</samp>&rsquo; command is sent
9653 </p>
9654 </dd>
9655 <dt> &lsquo;<samp>frame</samp>&rsquo;</dt>
9656 <dd><p>evaluate expression for each incoming frame
9657 </p></dd>
9658 </dl>
9659
9660 <p>Default value is &lsquo;<samp>once</samp>&rsquo;.
9661 </p></dd>
9662 </dl>
9663
9664 <p>The volume expression can contain the following parameters.
9665 </p>
9666 <dl compact="compact">
9667 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
9668 <dd><p>frame number (starting at zero)
9669 </p></dd>
9670 <dt> &lsquo;<samp>nb_channels</samp>&rsquo;</dt>
9671 <dd><p>number of channels
9672 </p></dd>
9673 <dt> &lsquo;<samp>nb_consumed_samples</samp>&rsquo;</dt>
9674 <dd><p>number of samples consumed by the filter
9675 </p></dd>
9676 <dt> &lsquo;<samp>nb_samples</samp>&rsquo;</dt>
9677 <dd><p>number of samples in the current frame
9678 </p></dd>
9679 <dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
9680 <dd><p>original frame position in the file
9681 </p></dd>
9682 <dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
9683 <dd><p>frame PTS
9684 </p></dd>
9685 <dt> &lsquo;<samp>sample_rate</samp>&rsquo;</dt>
9686 <dd><p>sample rate
9687 </p></dd>
9688 <dt> &lsquo;<samp>startpts</samp>&rsquo;</dt>
9689 <dd><p>PTS at start of stream
9690 </p></dd>
9691 <dt> &lsquo;<samp>startt</samp>&rsquo;</dt>
9692 <dd><p>time at start of stream
9693 </p></dd>
9694 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
9695 <dd><p>frame time
9696 </p></dd>
9697 <dt> &lsquo;<samp>tb</samp>&rsquo;</dt>
9698 <dd><p>timestamp timebase
9699 </p></dd>
9700 <dt> &lsquo;<samp>volume</samp>&rsquo;</dt>
9701 <dd><p>last set volume value
9702 </p></dd>
9703 </dl>
9704
9705 <p>Note that when &lsquo;<samp>eval</samp>&rsquo; is set to &lsquo;<samp>once</samp>&rsquo; only the
9706 <var>sample_rate</var> and <var>tb</var> variables are available, all other
9707 variables will evaluate to NAN.
9708 </p>
9709 <a name="Commands-3"></a>
9710 <h3 class="subsection"><a href="ffplay-all.html#toc-Commands-3">25.40.1 Commands</a></h3>
9711
9712 <p>This filter supports the following commands:
9713 </p><dl compact="compact">
9714 <dt> &lsquo;<samp>volume</samp>&rsquo;</dt>
9715 <dd><p>Modify the volume expression.
9716 The command accepts the same syntax of the corresponding option.
9717 </p>
9718 <p>If the specified expression is not valid, it is kept at its current
9719 value.
9720 </p></dd>
9721 </dl>
9722
9723 <a name="Examples-51"></a>
9724 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-51">25.40.2 Examples</a></h3>
9725
9726 <ul>
9727 <li>
9728 Halve the input audio volume:
9729 <table><tr><td>&nbsp;</td><td><pre class="example">volume=volume=0.5
9730 volume=volume=1/2
9731 volume=volume=-6.0206dB
9732 </pre></td></tr></table>
9733
9734 <p>In all the above example the named key for &lsquo;<samp>volume</samp>&rsquo; can be
9735 omitted, for example like in:
9736 </p><table><tr><td>&nbsp;</td><td><pre class="example">volume=0.5
9737 </pre></td></tr></table>
9738
9739 </li><li>
9740 Increase input audio power by 6 decibels using fixed-point precision:
9741 <table><tr><td>&nbsp;</td><td><pre class="example">volume=volume=6dB:precision=fixed
9742 </pre></td></tr></table>
9743
9744 </li><li>
9745 Fade volume after time 10 with an annihilation period of 5 seconds:
9746 <table><tr><td>&nbsp;</td><td><pre class="example">volume='if(lt(t,10),1,max(1-(t-10)/5,0))':eval=frame
9747 </pre></td></tr></table>
9748 </li></ul>
9749
9750 <a name="volumedetect"></a>
9751 <h2 class="section"><a href="ffplay-all.html#toc-volumedetect">25.41 volumedetect</a></h2>
9752
9753 <p>Detect the volume of the input video.
9754 </p>
9755 <p>The filter has no parameters. The input is not modified. Statistics about
9756 the volume will be printed in the log when the input stream end is reached.
9757 </p>
9758 <p>In particular it will show the mean volume (root mean square), maximum
9759 volume (on a per-sample basis), and the beginning of a histogram of the
9760 registered volume values (from the maximum value to a cumulated 1/1000 of
9761 the samples).
9762 </p>
9763 <p>All volumes are in decibels relative to the maximum PCM value.
9764 </p>
9765 <a name="Examples-63"></a>
9766 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-63">25.41.1 Examples</a></h3>
9767
9768 <p>Here is an excerpt of the output:
9769 </p><table><tr><td>&nbsp;</td><td><pre class="example">[Parsed_volumedetect_0 &nbsp;0xa23120] mean_volume: -27 dB
9770 [Parsed_volumedetect_0 &nbsp;0xa23120] max_volume: -4 dB
9771 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_4db: 6
9772 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_5db: 62
9773 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_6db: 286
9774 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_7db: 1042
9775 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_8db: 2551
9776 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_9db: 4609
9777 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_10db: 8409
9778 </pre></td></tr></table>
9779
9780 <p>It means that:
9781 </p><ul>
9782 <li>
9783 The mean square energy is approximately -27 dB, or 10^-2.7.
9784 </li><li>
9785 The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB.
9786 </li><li>
9787 There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc.
9788 </li></ul>
9789
9790 <p>In other words, raising the volume by +4 dB does not cause any clipping,
9791 raising it by +5 dB causes clipping for 6 samples, etc.
9792 </p>
9793
9794 <a name="Audio-Sources"></a>
9795 <h1 class="chapter"><a href="ffplay-all.html#toc-Audio-Sources">26. Audio Sources</a></h1>
9796
9797 <p>Below is a description of the currently available audio sources.
9798 </p>
9799 <a name="abuffer"></a>
9800 <h2 class="section"><a href="ffplay-all.html#toc-abuffer">26.1 abuffer</a></h2>
9801
9802 <p>Buffer audio frames, and make them available to the filter chain.
9803 </p>
9804 <p>This source is mainly intended for a programmatic use, in particular
9805 through the interface defined in &lsquo;<tt>libavfilter/asrc_abuffer.h</tt>&rsquo;.
9806 </p>
9807 <p>It accepts the following named parameters:
9808 </p>
9809 <dl compact="compact">
9810 <dt> &lsquo;<samp>time_base</samp>&rsquo;</dt>
9811 <dd><p>Timebase which will be used for timestamps of submitted frames. It must be
9812 either a floating-point number or in <var>numerator</var>/<var>denominator</var> form.
9813 </p>
9814 </dd>
9815 <dt> &lsquo;<samp>sample_rate</samp>&rsquo;</dt>
9816 <dd><p>The sample rate of the incoming audio buffers.
9817 </p>
9818 </dd>
9819 <dt> &lsquo;<samp>sample_fmt</samp>&rsquo;</dt>
9820 <dd><p>The sample format of the incoming audio buffers.
9821 Either a sample format name or its corresponging integer representation from
9822 the enum AVSampleFormat in &lsquo;<tt>libavutil/samplefmt.h</tt>&rsquo;
9823 </p>
9824 </dd>
9825 <dt> &lsquo;<samp>channel_layout</samp>&rsquo;</dt>
9826 <dd><p>The channel layout of the incoming audio buffers.
9827 Either a channel layout name from channel_layout_map in
9828 &lsquo;<tt>libavutil/channel_layout.c</tt>&rsquo; or its corresponding integer representation
9829 from the AV_CH_LAYOUT_* macros in &lsquo;<tt>libavutil/channel_layout.h</tt>&rsquo;
9830 </p>
9831 </dd>
9832 <dt> &lsquo;<samp>channels</samp>&rsquo;</dt>
9833 <dd><p>The number of channels of the incoming audio buffers.
9834 If both <var>channels</var> and <var>channel_layout</var> are specified, then they
9835 must be consistent.
9836 </p>
9837 </dd>
9838 </dl>
9839
9840 <a name="Examples-6"></a>
9841 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-6">26.1.1 Examples</a></h3>
9842
9843 <table><tr><td>&nbsp;</td><td><pre class="example">abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
9844 </pre></td></tr></table>
9845
9846 <p>will instruct the source to accept planar 16bit signed stereo at 44100Hz.
9847 Since the sample format with name &quot;s16p&quot; corresponds to the number
9848 6 and the &quot;stereo&quot; channel layout corresponds to the value 0x3, this is
9849 equivalent to:
9850 </p><table><tr><td>&nbsp;</td><td><pre class="example">abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
9851 </pre></td></tr></table>
9852
9853 <a name="aevalsrc"></a>
9854 <h2 class="section"><a href="ffplay-all.html#toc-aevalsrc">26.2 aevalsrc</a></h2>
9855
9856 <p>Generate an audio signal specified by an expression.
9857 </p>
9858 <p>This source accepts in input one or more expressions (one for each
9859 channel), which are evaluated and used to generate a corresponding
9860 audio signal.
9861 </p>
9862 <p>This source accepts the following options:
9863 </p>
9864 <dl compact="compact">
9865 <dt> &lsquo;<samp>exprs</samp>&rsquo;</dt>
9866 <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. In case the
9867 &lsquo;<samp>channel_layout</samp>&rsquo; option is not specified, the selected channel layout
9868 depends on the number of provided expressions. Otherwise the last
9869 specified expression is applied to the remaining output channels.
9870 </p>
9871 </dd>
9872 <dt> &lsquo;<samp>channel_layout, c</samp>&rsquo;</dt>
9873 <dd><p>Set the channel layout. The number of channels in the specified layout
9874 must be equal to the number of specified expressions.
9875 </p>
9876 </dd>
9877 <dt> &lsquo;<samp>duration, d</samp>&rsquo;</dt>
9878 <dd><p>Set the minimum duration of the sourced audio. See the function
9879 <code>av_parse_time()</code> for the accepted format.
9880 Note that the resulting duration may be greater than the specified
9881 duration, as the generated audio is always cut at the end of a
9882 complete frame.
9883 </p>
9884 <p>If not specified, or the expressed duration is negative, the audio is
9885 supposed to be generated forever.
9886 </p>
9887 </dd>
9888 <dt> &lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
9889 <dd><p>Set the number of samples per channel per each output frame,
9890 default to 1024.
9891 </p>
9892 </dd>
9893 <dt> &lsquo;<samp>sample_rate, s</samp>&rsquo;</dt>
9894 <dd><p>Specify the sample rate, default to 44100.
9895 </p></dd>
9896 </dl>
9897
9898 <p>Each expression in <var>exprs</var> can contain the following constants:
9899 </p>
9900 <dl compact="compact">
9901 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
9902 <dd><p>number of the evaluated sample, starting from 0
9903 </p>
9904 </dd>
9905 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
9906 <dd><p>time of the evaluated sample expressed in seconds, starting from 0
9907 </p>
9908 </dd>
9909 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
9910 <dd><p>sample rate
9911 </p>
9912 </dd>
9913 </dl>
9914
9915 <a name="Examples-56"></a>
9916 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-56">26.2.1 Examples</a></h3>
9917
9918 <ul>
9919 <li>
9920 Generate silence:
9921 <table><tr><td>&nbsp;</td><td><pre class="example">aevalsrc=0
9922 </pre></td></tr></table>
9923
9924 </li><li>
9925 Generate a sin signal with frequency of 440 Hz, set sample rate to
9926 8000 Hz:
9927 <table><tr><td>&nbsp;</td><td><pre class="example">aevalsrc=&quot;sin(440*2*PI*t):s=8000&quot;
9928 </pre></td></tr></table>
9929
9930 </li><li>
9931 Generate a two channels signal, specify the channel layout (Front
9932 Center + Back Center) explicitly:
9933 <table><tr><td>&nbsp;</td><td><pre class="example">aevalsrc=&quot;sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC&quot;
9934 </pre></td></tr></table>
9935
9936 </li><li>
9937 Generate white noise:
9938 <table><tr><td>&nbsp;</td><td><pre class="example">aevalsrc=&quot;-2+random(0)&quot;
9939 </pre></td></tr></table>
9940
9941 </li><li>
9942 Generate an amplitude modulated signal:
9943 <table><tr><td>&nbsp;</td><td><pre class="example">aevalsrc=&quot;sin(10*2*PI*t)*sin(880*2*PI*t)&quot;
9944 </pre></td></tr></table>
9945
9946 </li><li>
9947 Generate 2.5 Hz binaural beats on a 360 Hz carrier:
9948 <table><tr><td>&nbsp;</td><td><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;
9949 </pre></td></tr></table>
9950
9951 </li></ul>
9952
9953 <a name="anullsrc"></a>
9954 <h2 class="section"><a href="ffplay-all.html#toc-anullsrc">26.3 anullsrc</a></h2>
9955
9956 <p>Null audio source, return unprocessed audio frames. It is mainly useful
9957 as a template and to be employed in analysis / debugging tools, or as
9958 the source for filters which ignore the input data (for example the sox
9959 synth filter).
9960 </p>
9961 <p>This source accepts the following options:
9962 </p>
9963 <dl compact="compact">
9964 <dt> &lsquo;<samp>channel_layout, cl</samp>&rsquo;</dt>
9965 <dd>
9966 <p>Specify the channel layout, and can be either an integer or a string
9967 representing a channel layout. The default value of <var>channel_layout</var>
9968 is &quot;stereo&quot;.
9969 </p>
9970 <p>Check the channel_layout_map definition in
9971 &lsquo;<tt>libavutil/channel_layout.c</tt>&rsquo; for the mapping between strings and
9972 channel layout values.
9973 </p>
9974 </dd>
9975 <dt> &lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
9976 <dd><p>Specify the sample rate, and defaults to 44100.
9977 </p>
9978 </dd>
9979 <dt> &lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
9980 <dd><p>Set the number of samples per requested frames.
9981 </p>
9982 </dd>
9983 </dl>
9984
9985 <a name="Examples-38"></a>
9986 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-38">26.3.1 Examples</a></h3>
9987
9988 <ul>
9989 <li>
9990 Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO.
9991 <table><tr><td>&nbsp;</td><td><pre class="example">anullsrc=r=48000:cl=4
9992 </pre></td></tr></table>
9993
9994 </li><li>
9995 Do the same operation with a more obvious syntax:
9996 <table><tr><td>&nbsp;</td><td><pre class="example">anullsrc=r=48000:cl=mono
9997 </pre></td></tr></table>
9998 </li></ul>
9999
10000 <p>All the parameters need to be explicitly defined.
10001 </p>
10002 <a name="flite"></a>
10003 <h2 class="section"><a href="ffplay-all.html#toc-flite">26.4 flite</a></h2>
10004
10005 <p>Synthesize a voice utterance using the libflite library.
10006 </p>
10007 <p>To enable compilation of this filter you need to configure FFmpeg with
10008 <code>--enable-libflite</code>.
10009 </p>
10010 <p>Note that the flite library is not thread-safe.
10011 </p>
10012 <p>The filter accepts the following options:
10013 </p>
10014 <dl compact="compact">
10015 <dt> &lsquo;<samp>list_voices</samp>&rsquo;</dt>
10016 <dd><p>If set to 1, list the names of the available voices and exit
10017 immediately. Default value is 0.
10018 </p>
10019 </dd>
10020 <dt> &lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
10021 <dd><p>Set the maximum number of samples per frame. Default value is 512.
10022 </p>
10023 </dd>
10024 <dt> &lsquo;<samp>textfile</samp>&rsquo;</dt>
10025 <dd><p>Set the filename containing the text to speak.
10026 </p>
10027 </dd>
10028 <dt> &lsquo;<samp>text</samp>&rsquo;</dt>
10029 <dd><p>Set the text to speak.
10030 </p>
10031 </dd>
10032 <dt> &lsquo;<samp>voice, v</samp>&rsquo;</dt>
10033 <dd><p>Set the voice to use for the speech synthesis. Default value is
10034 <code>kal</code>. See also the <var>list_voices</var> option.
10035 </p></dd>
10036 </dl>
10037
10038 <a name="Examples-80"></a>
10039 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-80">26.4.1 Examples</a></h3>
10040
10041 <ul>
10042 <li>
10043 Read from file &lsquo;<tt>speech.txt</tt>&rsquo;, and synthetize the text using the
10044 standard flite voice:
10045 <table><tr><td>&nbsp;</td><td><pre class="example">flite=textfile=speech.txt
10046 </pre></td></tr></table>
10047
10048 </li><li>
10049 Read the specified text selecting the <code>slt</code> voice:
10050 <table><tr><td>&nbsp;</td><td><pre class="example">flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
10051 </pre></td></tr></table>
10052
10053 </li><li>
10054 Input text to ffmpeg:
10055 <table><tr><td>&nbsp;</td><td><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
10056 </pre></td></tr></table>
10057
10058 </li><li>
10059 Make &lsquo;<tt>ffplay</tt>&rsquo; speak the specified text, using <code>flite</code> and
10060 the <code>lavfi</code> device:
10061 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.'
10062 </pre></td></tr></table>
10063 </li></ul>
10064
10065 <p>For more information about libflite, check:
10066 <a href="http://www.speech.cs.cmu.edu/flite/">http://www.speech.cs.cmu.edu/flite/</a>
10067 </p>
10068 <a name="sine"></a>
10069 <h2 class="section"><a href="ffplay-all.html#toc-sine">26.5 sine</a></h2>
10070
10071 <p>Generate an audio signal made of a sine wave with amplitude 1/8.
10072 </p>
10073 <p>The audio signal is bit-exact.
10074 </p>
10075 <p>The filter accepts the following options:
10076 </p>
10077 <dl compact="compact">
10078 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
10079 <dd><p>Set the carrier frequency. Default is 440 Hz.
10080 </p>
10081 </dd>
10082 <dt> &lsquo;<samp>beep_factor, b</samp>&rsquo;</dt>
10083 <dd><p>Enable a periodic beep every second with frequency <var>beep_factor</var> times
10084 the carrier frequency. Default is 0, meaning the beep is disabled.
10085 </p>
10086 </dd>
10087 <dt> &lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
10088 <dd><p>Specify the sample rate, default is 44100.
10089 </p>
10090 </dd>
10091 <dt> &lsquo;<samp>duration, d</samp>&rsquo;</dt>
10092 <dd><p>Specify the duration of the generated audio stream.
10093 </p>
10094 </dd>
10095 <dt> &lsquo;<samp>samples_per_frame</samp>&rsquo;</dt>
10096 <dd><p>Set the number of samples per output frame, default is 1024.
10097 </p></dd>
10098 </dl>
10099
10100 <a name="Examples-50"></a>
10101 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-50">26.5.1 Examples</a></h3>
10102
10103 <ul>
10104 <li>
10105 Generate a simple 440 Hz sine wave:
10106 <table><tr><td>&nbsp;</td><td><pre class="example">sine
10107 </pre></td></tr></table>
10108
10109 </li><li>
10110 Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds:
10111 <table><tr><td>&nbsp;</td><td><pre class="example">sine=220:4:d=5
10112 sine=f=220:b=4:d=5
10113 sine=frequency=220:beep_factor=4:duration=5
10114 </pre></td></tr></table>
10115
10116 </li></ul>
10117
10118
10119 <a name="Audio-Sinks"></a>
10120 <h1 class="chapter"><a href="ffplay-all.html#toc-Audio-Sinks">27. Audio Sinks</a></h1>
10121
10122 <p>Below is a description of the currently available audio sinks.
10123 </p>
10124 <a name="abuffersink"></a>
10125 <h2 class="section"><a href="ffplay-all.html#toc-abuffersink">27.1 abuffersink</a></h2>
10126
10127 <p>Buffer audio frames, and make them available to the end of filter chain.
10128 </p>
10129 <p>This sink is mainly intended for programmatic use, in particular
10130 through the interface defined in &lsquo;<tt>libavfilter/buffersink.h</tt>&rsquo;
10131 or the options system.
10132 </p>
10133 <p>It accepts a pointer to an AVABufferSinkContext structure, which
10134 defines the incoming buffers&rsquo; formats, to be passed as the opaque
10135 parameter to <code>avfilter_init_filter</code> for initialization.
10136 </p>
10137 <a name="anullsink"></a>
10138 <h2 class="section"><a href="ffplay-all.html#toc-anullsink">27.2 anullsink</a></h2>
10139
10140 <p>Null audio sink, do absolutely nothing with the input audio. It is
10141 mainly useful as a template and to be employed in analysis / debugging
10142 tools.
10143 </p>
10144
10145 <a name="Video-Filters"></a>
10146 <h1 class="chapter"><a href="ffplay-all.html#toc-Video-Filters">28. Video Filters</a></h1>
10147
10148 <p>When you configure your FFmpeg build, you can disable any of the
10149 existing filters using <code>--disable-filters</code>.
10150 The configure output will show the video filters included in your
10151 build.
10152 </p>
10153 <p>Below is a description of the currently available video filters.
10154 </p>
10155 <a name="alphaextract"></a>
10156 <h2 class="section"><a href="ffplay-all.html#toc-alphaextract">28.1 alphaextract</a></h2>
10157
10158 <p>Extract the alpha component from the input as a grayscale video. This
10159 is especially useful with the <var>alphamerge</var> filter.
10160 </p>
10161 <a name="alphamerge"></a>
10162 <h2 class="section"><a href="ffplay-all.html#toc-alphamerge">28.2 alphamerge</a></h2>
10163
10164 <p>Add or replace the alpha component of the primary input with the
10165 grayscale value of a second input. This is intended for use with
10166 <var>alphaextract</var> to allow the transmission or storage of frame
10167 sequences that have alpha in a format that doesn&rsquo;t support an alpha
10168 channel.
10169 </p>
10170 <p>For example, to reconstruct full frames from a normal YUV-encoded video
10171 and a separate video created with <var>alphaextract</var>, you might use:
10172 </p><table><tr><td>&nbsp;</td><td><pre class="example">movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
10173 </pre></td></tr></table>
10174
10175 <p>Since this filter is designed for reconstruction, it operates on frame
10176 sequences without considering timestamps, and terminates when either
10177 input reaches end of stream. This will cause problems if your encoding
10178 pipeline drops frames. If you&rsquo;re trying to apply an image as an
10179 overlay to a video stream, consider the <var>overlay</var> filter instead.
10180 </p>
10181 <a name="ass"></a>
10182 <h2 class="section"><a href="ffplay-all.html#toc-ass">28.3 ass</a></h2>
10183
10184 <p>Same as the <a href="#subtitles">subtitles</a> filter, except that it doesn&rsquo;t require libavcodec
10185 and libavformat to work. On the other hand, it is limited to ASS (Advanced
10186 Substation Alpha) subtitles files.
10187 </p>
10188 <a name="bbox"></a>
10189 <h2 class="section"><a href="ffplay-all.html#toc-bbox">28.4 bbox</a></h2>
10190
10191 <p>Compute the bounding box for the non-black pixels in the input frame
10192 luminance plane.
10193 </p>
10194 <p>This filter computes the bounding box containing all the pixels with a
10195 luminance value greater than the minimum allowed value.
10196 The parameters describing the bounding box are printed on the filter
10197 log.
10198 </p>
10199 <p>The filter accepts the following option:
10200 </p>
10201 <dl compact="compact">
10202 <dt> &lsquo;<samp>min_val</samp>&rsquo;</dt>
10203 <dd><p>Set the minimal luminance value. Default is <code>16</code>.
10204 </p></dd>
10205 </dl>
10206
10207 <a name="blackdetect"></a>
10208 <h2 class="section"><a href="ffplay-all.html#toc-blackdetect">28.5 blackdetect</a></h2>
10209
10210 <p>Detect video intervals that are (almost) completely black. Can be
10211 useful to detect chapter transitions, commercials, or invalid
10212 recordings. Output lines contains the time for the start, end and
10213 duration of the detected black interval expressed in seconds.
10214 </p>
10215 <p>In order to display the output lines, you need to set the loglevel at
10216 least to the AV_LOG_INFO value.
10217 </p>
10218 <p>The filter accepts the following options:
10219 </p>
10220 <dl compact="compact">
10221 <dt> &lsquo;<samp>black_min_duration, d</samp>&rsquo;</dt>
10222 <dd><p>Set the minimum detected black duration expressed in seconds. It must
10223 be a non-negative floating point number.
10224 </p>
10225 <p>Default value is 2.0.
10226 </p>
10227 </dd>
10228 <dt> &lsquo;<samp>picture_black_ratio_th, pic_th</samp>&rsquo;</dt>
10229 <dd><p>Set the threshold for considering a picture &quot;black&quot;.
10230 Express the minimum value for the ratio:
10231 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>nb_black_pixels</var> / <var>nb_pixels</var>
10232 </pre></td></tr></table>
10233
10234 <p>for which a picture is considered black.
10235 Default value is 0.98.
10236 </p>
10237 </dd>
10238 <dt> &lsquo;<samp>pixel_black_th, pix_th</samp>&rsquo;</dt>
10239 <dd><p>Set the threshold for considering a pixel &quot;black&quot;.
10240 </p>
10241 <p>The threshold expresses the maximum pixel luminance value for which a
10242 pixel is considered &quot;black&quot;. The provided value is scaled according to
10243 the following equation:
10244 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>absolute_threshold</var> = <var>luminance_minimum_value</var> + <var>pixel_black_th</var> * <var>luminance_range_size</var>
10245 </pre></td></tr></table>
10246
10247 <p><var>luminance_range_size</var> and <var>luminance_minimum_value</var> depend on
10248 the input video format, the range is [0-255] for YUV full-range
10249 formats and [16-235] for YUV non full-range formats.
10250 </p>
10251 <p>Default value is 0.10.
10252 </p></dd>
10253 </dl>
10254
10255 <p>The following example sets the maximum pixel threshold to the minimum
10256 value, and detects only black intervals of 2 or more seconds:
10257 </p><table><tr><td>&nbsp;</td><td><pre class="example">blackdetect=d=2:pix_th=0.00
10258 </pre></td></tr></table>
10259
10260 <a name="blackframe"></a>
10261 <h2 class="section"><a href="ffplay-all.html#toc-blackframe">28.6 blackframe</a></h2>
10262
10263 <p>Detect frames that are (almost) completely black. Can be useful to
10264 detect chapter transitions or commercials. Output lines consist of
10265 the frame number of the detected frame, the percentage of blackness,
10266 the position in the file if known or -1 and the timestamp in seconds.
10267 </p>
10268 <p>In order to display the output lines, you need to set the loglevel at
10269 least to the AV_LOG_INFO value.
10270 </p>
10271 <p>The filter accepts the following options:
10272 </p>
10273 <dl compact="compact">
10274 <dt> &lsquo;<samp>amount</samp>&rsquo;</dt>
10275 <dd><p>Set the percentage of the pixels that have to be below the threshold, defaults
10276 to <code>98</code>.
10277 </p>
10278 </dd>
10279 <dt> &lsquo;<samp>threshold, thresh</samp>&rsquo;</dt>
10280 <dd><p>Set the threshold below which a pixel value is considered black, defaults to
10281 <code>32</code>.
10282 </p>
10283 </dd>
10284 </dl>
10285
10286 <a name="blend"></a>
10287 <h2 class="section"><a href="ffplay-all.html#toc-blend">28.7 blend</a></h2>
10288
10289 <p>Blend two video frames into each other.
10290 </p>
10291 <p>It takes two input streams and outputs one stream, the first input is the
10292 &quot;top&quot; layer and second input is &quot;bottom&quot; layer.
10293 Output terminates when shortest input terminates.
10294 </p>
10295 <p>A description of the accepted options follows.
10296 </p>
10297 <dl compact="compact">
10298 <dt> &lsquo;<samp>c0_mode</samp>&rsquo;</dt>
10299 <dt> &lsquo;<samp>c1_mode</samp>&rsquo;</dt>
10300 <dt> &lsquo;<samp>c2_mode</samp>&rsquo;</dt>
10301 <dt> &lsquo;<samp>c3_mode</samp>&rsquo;</dt>
10302 <dt> &lsquo;<samp>all_mode</samp>&rsquo;</dt>
10303 <dd><p>Set blend mode for specific pixel component or all pixel components in case
10304 of <var>all_mode</var>. Default value is <code>normal</code>.
10305 </p>
10306 <p>Available values for component modes are:
10307 </p><dl compact="compact">
10308 <dt> &lsquo;<samp>addition</samp>&rsquo;</dt>
10309 <dt> &lsquo;<samp>and</samp>&rsquo;</dt>
10310 <dt> &lsquo;<samp>average</samp>&rsquo;</dt>
10311 <dt> &lsquo;<samp>burn</samp>&rsquo;</dt>
10312 <dt> &lsquo;<samp>darken</samp>&rsquo;</dt>
10313 <dt> &lsquo;<samp>difference</samp>&rsquo;</dt>
10314 <dt> &lsquo;<samp>divide</samp>&rsquo;</dt>
10315 <dt> &lsquo;<samp>dodge</samp>&rsquo;</dt>
10316 <dt> &lsquo;<samp>exclusion</samp>&rsquo;</dt>
10317 <dt> &lsquo;<samp>hardlight</samp>&rsquo;</dt>
10318 <dt> &lsquo;<samp>lighten</samp>&rsquo;</dt>
10319 <dt> &lsquo;<samp>multiply</samp>&rsquo;</dt>
10320 <dt> &lsquo;<samp>negation</samp>&rsquo;</dt>
10321 <dt> &lsquo;<samp>normal</samp>&rsquo;</dt>
10322 <dt> &lsquo;<samp>or</samp>&rsquo;</dt>
10323 <dt> &lsquo;<samp>overlay</samp>&rsquo;</dt>
10324 <dt> &lsquo;<samp>phoenix</samp>&rsquo;</dt>
10325 <dt> &lsquo;<samp>pinlight</samp>&rsquo;</dt>
10326 <dt> &lsquo;<samp>reflect</samp>&rsquo;</dt>
10327 <dt> &lsquo;<samp>screen</samp>&rsquo;</dt>
10328 <dt> &lsquo;<samp>softlight</samp>&rsquo;</dt>
10329 <dt> &lsquo;<samp>subtract</samp>&rsquo;</dt>
10330 <dt> &lsquo;<samp>vividlight</samp>&rsquo;</dt>
10331 <dt> &lsquo;<samp>xor</samp>&rsquo;</dt>
10332 </dl>
10333
10334 </dd>
10335 <dt> &lsquo;<samp>c0_opacity</samp>&rsquo;</dt>
10336 <dt> &lsquo;<samp>c1_opacity</samp>&rsquo;</dt>
10337 <dt> &lsquo;<samp>c2_opacity</samp>&rsquo;</dt>
10338 <dt> &lsquo;<samp>c3_opacity</samp>&rsquo;</dt>
10339 <dt> &lsquo;<samp>all_opacity</samp>&rsquo;</dt>
10340 <dd><p>Set blend opacity for specific pixel component or all pixel components in case
10341 of <var>all_opacity</var>. Only used in combination with pixel component blend modes.
10342 </p>
10343 </dd>
10344 <dt> &lsquo;<samp>c0_expr</samp>&rsquo;</dt>
10345 <dt> &lsquo;<samp>c1_expr</samp>&rsquo;</dt>
10346 <dt> &lsquo;<samp>c2_expr</samp>&rsquo;</dt>
10347 <dt> &lsquo;<samp>c3_expr</samp>&rsquo;</dt>
10348 <dt> &lsquo;<samp>all_expr</samp>&rsquo;</dt>
10349 <dd><p>Set blend expression for specific pixel component or all pixel components in case
10350 of <var>all_expr</var>. Note that related mode options will be ignored if those are set.
10351 </p>
10352 <p>The expressions can use the following variables:
10353 </p>
10354 <dl compact="compact">
10355 <dt> &lsquo;<samp>N</samp>&rsquo;</dt>
10356 <dd><p>The sequential number of the filtered frame, starting from <code>0</code>.
10357 </p>
10358 </dd>
10359 <dt> &lsquo;<samp>X</samp>&rsquo;</dt>
10360 <dt> &lsquo;<samp>Y</samp>&rsquo;</dt>
10361 <dd><p>the coordinates of the current sample
10362 </p>
10363 </dd>
10364 <dt> &lsquo;<samp>W</samp>&rsquo;</dt>
10365 <dt> &lsquo;<samp>H</samp>&rsquo;</dt>
10366 <dd><p>the width and height of currently filtered plane
10367 </p>
10368 </dd>
10369 <dt> &lsquo;<samp>SW</samp>&rsquo;</dt>
10370 <dt> &lsquo;<samp>SH</samp>&rsquo;</dt>
10371 <dd><p>Width and height scale depending on the currently filtered plane. It is the
10372 ratio between the corresponding luma plane number of pixels and the current
10373 plane ones. E.g. for YUV4:2:0 the values are <code>1,1</code> for the luma plane, and
10374 <code>0.5,0.5</code> for chroma planes.
10375 </p>
10376 </dd>
10377 <dt> &lsquo;<samp>T</samp>&rsquo;</dt>
10378 <dd><p>Time of the current frame, expressed in seconds.
10379 </p>
10380 </dd>
10381 <dt> &lsquo;<samp>TOP, A</samp>&rsquo;</dt>
10382 <dd><p>Value of pixel component at current location for first video frame (top layer).
10383 </p>
10384 </dd>
10385 <dt> &lsquo;<samp>BOTTOM, B</samp>&rsquo;</dt>
10386 <dd><p>Value of pixel component at current location for second video frame (bottom layer).
10387 </p></dd>
10388 </dl>
10389
10390 </dd>
10391 <dt> &lsquo;<samp>shortest</samp>&rsquo;</dt>
10392 <dd><p>Force termination when the shortest input terminates. Default is <code>0</code>.
10393 </p></dd>
10394 <dt> &lsquo;<samp>repeatlast</samp>&rsquo;</dt>
10395 <dd><p>Continue applying the last bottom frame after the end of the stream. A value of
10396 <code>0</code> disable the filter after the last frame of the bottom layer is reached.
10397 Default is <code>1</code>.
10398 </p></dd>
10399 </dl>
10400
10401 <a name="Examples-62"></a>
10402 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-62">28.7.1 Examples</a></h3>
10403
10404 <ul>
10405 <li>
10406 Apply transition from bottom layer to top layer in first 10 seconds:
10407 <table><tr><td>&nbsp;</td><td><pre class="example">blend=all_expr='A*(if(gte(T,10),1,T/10))+B*(1-(if(gte(T,10),1,T/10)))'
10408 </pre></td></tr></table>
10409
10410 </li><li>
10411 Apply 1x1 checkerboard effect:
10412 <table><tr><td>&nbsp;</td><td><pre class="example">blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
10413 </pre></td></tr></table>
10414
10415 </li><li>
10416 Apply uncover left effect:
10417 <table><tr><td>&nbsp;</td><td><pre class="example">blend=all_expr='if(gte(N*SW+X,W),A,B)'
10418 </pre></td></tr></table>
10419
10420 </li><li>
10421 Apply uncover down effect:
10422 <table><tr><td>&nbsp;</td><td><pre class="example">blend=all_expr='if(gte(Y-N*SH,0),A,B)'
10423 </pre></td></tr></table>
10424
10425 </li><li>
10426 Apply uncover up-left effect:
10427 <table><tr><td>&nbsp;</td><td><pre class="example">blend=all_expr='if(gte(T*SH*40+Y,H)*gte((T*40*SW+X)*W/H,W),A,B)'
10428 </pre></td></tr></table>
10429 </li></ul>
10430
10431 <a name="boxblur"></a>
10432 <h2 class="section"><a href="ffplay-all.html#toc-boxblur">28.8 boxblur</a></h2>
10433
10434 <p>Apply boxblur algorithm to the input video.
10435 </p>
10436 <p>The filter accepts the following options:
10437 </p>
10438 <dl compact="compact">
10439 <dt> &lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
10440 <dt> &lsquo;<samp>luma_power, lp</samp>&rsquo;</dt>
10441 <dt> &lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
10442 <dt> &lsquo;<samp>chroma_power, cp</samp>&rsquo;</dt>
10443 <dt> &lsquo;<samp>alpha_radius, ar</samp>&rsquo;</dt>
10444 <dt> &lsquo;<samp>alpha_power, ap</samp>&rsquo;</dt>
10445 </dl>
10446
10447 <p>A description of the accepted options follows.
10448 </p>
10449 <dl compact="compact">
10450 <dt> &lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
10451 <dt> &lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
10452 <dt> &lsquo;<samp>alpha_radius, ar</samp>&rsquo;</dt>
10453 <dd><p>Set an expression for the box radius in pixels used for blurring the
10454 corresponding input plane.
10455 </p>
10456 <p>The radius value must be a non-negative number, and must not be
10457 greater than the value of the expression <code>min(w,h)/2</code> for the
10458 luma and alpha planes, and of <code>min(cw,ch)/2</code> for the chroma
10459 planes.
10460 </p>
10461 <p>Default value for &lsquo;<samp>luma_radius</samp>&rsquo; is &quot;2&quot;. If not specified,
10462 &lsquo;<samp>chroma_radius</samp>&rsquo; and &lsquo;<samp>alpha_radius</samp>&rsquo; default to the
10463 corresponding value set for &lsquo;<samp>luma_radius</samp>&rsquo;.
10464 </p>
10465 <p>The expressions can contain the following constants:
10466 </p><dl compact="compact">
10467 <dt> &lsquo;<samp>w</samp>&rsquo;</dt>
10468 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
10469 <dd><p>the input width and height in pixels
10470 </p>
10471 </dd>
10472 <dt> &lsquo;<samp>cw</samp>&rsquo;</dt>
10473 <dt> &lsquo;<samp>ch</samp>&rsquo;</dt>
10474 <dd><p>the input chroma image width and height in pixels
10475 </p>
10476 </dd>
10477 <dt> &lsquo;<samp>hsub</samp>&rsquo;</dt>
10478 <dt> &lsquo;<samp>vsub</samp>&rsquo;</dt>
10479 <dd><p>horizontal and vertical chroma subsample values. For example for the
10480 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
10481 </p></dd>
10482 </dl>
10483
10484 </dd>
10485 <dt> &lsquo;<samp>luma_power, lp</samp>&rsquo;</dt>
10486 <dt> &lsquo;<samp>chroma_power, cp</samp>&rsquo;</dt>
10487 <dt> &lsquo;<samp>alpha_power, ap</samp>&rsquo;</dt>
10488 <dd><p>Specify how many times the boxblur filter is applied to the
10489 corresponding plane.
10490 </p>
10491 <p>Default value for &lsquo;<samp>luma_power</samp>&rsquo; is 2. If not specified,
10492 &lsquo;<samp>chroma_power</samp>&rsquo; and &lsquo;<samp>alpha_power</samp>&rsquo; default to the
10493 corresponding value set for &lsquo;<samp>luma_power</samp>&rsquo;.
10494 </p>
10495 <p>A value of 0 will disable the effect.
10496 </p></dd>
10497 </dl>
10498
10499 <a name="Examples-12"></a>
10500 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-12">28.8.1 Examples</a></h3>
10501
10502 <ul>
10503 <li>
10504 Apply a boxblur filter with luma, chroma, and alpha radius
10505 set to 2:
10506 <table><tr><td>&nbsp;</td><td><pre class="example">boxblur=luma_radius=2:luma_power=1
10507 boxblur=2:1
10508 </pre></td></tr></table>
10509
10510 </li><li>
10511 Set luma radius to 2, alpha and chroma radius to 0:
10512 <table><tr><td>&nbsp;</td><td><pre class="example">boxblur=2:1:cr=0:ar=0
10513 </pre></td></tr></table>
10514
10515 </li><li>
10516 Set luma and chroma radius to a fraction of the video dimension:
10517 <table><tr><td>&nbsp;</td><td><pre class="example">boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1
10518 </pre></td></tr></table>
10519 </li></ul>
10520
10521 <a name="colorbalance"></a>
10522 <h2 class="section"><a href="ffplay-all.html#toc-colorbalance">28.9 colorbalance</a></h2>
10523 <p>Modify intensity of primary colors (red, green and blue) of input frames.
10524 </p>
10525 <p>The filter allows an input frame to be adjusted in the shadows, midtones or highlights
10526 regions for the red-cyan, green-magenta or blue-yellow balance.
10527 </p>
10528 <p>A positive adjustment value shifts the balance towards the primary color, a negative
10529 value towards the complementary color.
10530 </p>
10531 <p>The filter accepts the following options:
10532 </p>
10533 <dl compact="compact">
10534 <dt> &lsquo;<samp>rs</samp>&rsquo;</dt>
10535 <dt> &lsquo;<samp>gs</samp>&rsquo;</dt>
10536 <dt> &lsquo;<samp>bs</samp>&rsquo;</dt>
10537 <dd><p>Adjust red, green and blue shadows (darkest pixels).
10538 </p>
10539 </dd>
10540 <dt> &lsquo;<samp>rm</samp>&rsquo;</dt>
10541 <dt> &lsquo;<samp>gm</samp>&rsquo;</dt>
10542 <dt> &lsquo;<samp>bm</samp>&rsquo;</dt>
10543 <dd><p>Adjust red, green and blue midtones (medium pixels).
10544 </p>
10545 </dd>
10546 <dt> &lsquo;<samp>rh</samp>&rsquo;</dt>
10547 <dt> &lsquo;<samp>gh</samp>&rsquo;</dt>
10548 <dt> &lsquo;<samp>bh</samp>&rsquo;</dt>
10549 <dd><p>Adjust red, green and blue highlights (brightest pixels).
10550 </p>
10551 <p>Allowed ranges for options are <code>[-1.0, 1.0]</code>. Defaults are <code>0</code>.
10552 </p></dd>
10553 </dl>
10554
10555 <a name="Examples-68"></a>
10556 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-68">28.9.1 Examples</a></h3>
10557
10558 <ul>
10559 <li>
10560 Add red color cast to shadows:
10561 <table><tr><td>&nbsp;</td><td><pre class="example">colorbalance=rs=.3
10562 </pre></td></tr></table>
10563 </li></ul>
10564
10565 <a name="colorchannelmixer"></a>
10566 <h2 class="section"><a href="ffplay-all.html#toc-colorchannelmixer">28.10 colorchannelmixer</a></h2>
10567
10568 <p>Adjust video input frames by re-mixing color channels.
10569 </p>
10570 <p>This filter modifies a color channel by adding the values associated to
10571 the other channels of the same pixels. For example if the value to
10572 modify is red, the output value will be:
10573 </p><table><tr><td>&nbsp;</td><td><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>
10574 </pre></td></tr></table>
10575
10576 <p>The filter accepts the following options:
10577 </p>
10578 <dl compact="compact">
10579 <dt> &lsquo;<samp>rr</samp>&rsquo;</dt>
10580 <dt> &lsquo;<samp>rg</samp>&rsquo;</dt>
10581 <dt> &lsquo;<samp>rb</samp>&rsquo;</dt>
10582 <dt> &lsquo;<samp>ra</samp>&rsquo;</dt>
10583 <dd><p>Adjust contribution of input red, green, blue and alpha channels for output red channel.
10584 Default is <code>1</code> for <var>rr</var>, and <code>0</code> for <var>rg</var>, <var>rb</var> and <var>ra</var>.
10585 </p>
10586 </dd>
10587 <dt> &lsquo;<samp>gr</samp>&rsquo;</dt>
10588 <dt> &lsquo;<samp>gg</samp>&rsquo;</dt>
10589 <dt> &lsquo;<samp>gb</samp>&rsquo;</dt>
10590 <dt> &lsquo;<samp>ga</samp>&rsquo;</dt>
10591 <dd><p>Adjust contribution of input red, green, blue and alpha channels for output green channel.
10592 Default is <code>1</code> for <var>gg</var>, and <code>0</code> for <var>gr</var>, <var>gb</var> and <var>ga</var>.
10593 </p>
10594 </dd>
10595 <dt> &lsquo;<samp>br</samp>&rsquo;</dt>
10596 <dt> &lsquo;<samp>bg</samp>&rsquo;</dt>
10597 <dt> &lsquo;<samp>bb</samp>&rsquo;</dt>
10598 <dt> &lsquo;<samp>ba</samp>&rsquo;</dt>
10599 <dd><p>Adjust contribution of input red, green, blue and alpha channels for output blue channel.
10600 Default is <code>1</code> for <var>bb</var>, and <code>0</code> for <var>br</var>, <var>bg</var> and <var>ba</var>.
10601 </p>
10602 </dd>
10603 <dt> &lsquo;<samp>ar</samp>&rsquo;</dt>
10604 <dt> &lsquo;<samp>ag</samp>&rsquo;</dt>
10605 <dt> &lsquo;<samp>ab</samp>&rsquo;</dt>
10606 <dt> &lsquo;<samp>aa</samp>&rsquo;</dt>
10607 <dd><p>Adjust contribution of input red, green, blue and alpha channels for output alpha channel.
10608 Default is <code>1</code> for <var>aa</var>, and <code>0</code> for <var>ar</var>, <var>ag</var> and <var>ab</var>.
10609 </p>
10610 <p>Allowed ranges for options are <code>[-2.0, 2.0]</code>.
10611 </p></dd>
10612 </dl>
10613
10614 <a name="Examples-33"></a>
10615 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-33">28.10.1 Examples</a></h3>
10616
10617 <ul>
10618 <li>
10619 Convert source to grayscale:
10620 <table><tr><td>&nbsp;</td><td><pre class="example">colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
10621 </pre></td></tr></table>
10622 </li><li>
10623 Simulate sepia tones:
10624 <table><tr><td>&nbsp;</td><td><pre class="example">colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131
10625 </pre></td></tr></table>
10626 </li></ul>
10627
10628 <a name="colormatrix"></a>
10629 <h2 class="section"><a href="ffplay-all.html#toc-colormatrix">28.11 colormatrix</a></h2>
10630
10631 <p>Convert color matrix.
10632 </p>
10633 <p>The filter accepts the following options:
10634 </p>
10635 <dl compact="compact">
10636 <dt> &lsquo;<samp>src</samp>&rsquo;</dt>
10637 <dt> &lsquo;<samp>dst</samp>&rsquo;</dt>
10638 <dd><p>Specify the source and destination color matrix. Both values must be
10639 specified.
10640 </p>
10641 <p>The accepted values are:
10642 </p><dl compact="compact">
10643 <dt> &lsquo;<samp>bt709</samp>&rsquo;</dt>
10644 <dd><p>BT.709
10645 </p>
10646 </dd>
10647 <dt> &lsquo;<samp>bt601</samp>&rsquo;</dt>
10648 <dd><p>BT.601
10649 </p>
10650 </dd>
10651 <dt> &lsquo;<samp>smpte240m</samp>&rsquo;</dt>
10652 <dd><p>SMPTE-240M
10653 </p>
10654 </dd>
10655 <dt> &lsquo;<samp>fcc</samp>&rsquo;</dt>
10656 <dd><p>FCC
10657 </p></dd>
10658 </dl>
10659 </dd>
10660 </dl>
10661
10662 <p>For example to convert from BT.601 to SMPTE-240M, use the command:
10663 </p><table><tr><td>&nbsp;</td><td><pre class="example">colormatrix=bt601:smpte240m
10664 </pre></td></tr></table>
10665
10666 <a name="copy"></a>
10667 <h2 class="section"><a href="ffplay-all.html#toc-copy">28.12 copy</a></h2>
10668
10669 <p>Copy the input source unchanged to the output. Mainly useful for
10670 testing purposes.
10671 </p>
10672 <a name="crop"></a>
10673 <h2 class="section"><a href="ffplay-all.html#toc-crop">28.13 crop</a></h2>
10674
10675 <p>Crop the input video to given dimensions.
10676 </p>
10677 <p>The filter accepts the following options:
10678 </p>
10679 <dl compact="compact">
10680 <dt> &lsquo;<samp>w, out_w</samp>&rsquo;</dt>
10681 <dd><p>Width of the output video. It defaults to <code>iw</code>.
10682 This expression is evaluated only once during the filter
10683 configuration.
10684 </p>
10685 </dd>
10686 <dt> &lsquo;<samp>h, out_h</samp>&rsquo;</dt>
10687 <dd><p>Height of the output video. It defaults to <code>ih</code>.
10688 This expression is evaluated only once during the filter
10689 configuration.
10690 </p>
10691 </dd>
10692 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
10693 <dd><p>Horizontal position, in the input video, of the left edge of the output video.
10694 It defaults to <code>(in_w-out_w)/2</code>.
10695 This expression is evaluated per-frame.
10696 </p>
10697 </dd>
10698 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
10699 <dd><p>Vertical position, in the input video, of the top edge of the output video.
10700 It defaults to <code>(in_h-out_h)/2</code>.
10701 This expression is evaluated per-frame.
10702 </p>
10703 </dd>
10704 <dt> &lsquo;<samp>keep_aspect</samp>&rsquo;</dt>
10705 <dd><p>If set to 1 will force the output display aspect ratio
10706 to be the same of the input, by changing the output sample aspect
10707 ratio. It defaults to 0.
10708 </p></dd>
10709 </dl>
10710
10711 <p>The <var>out_w</var>, <var>out_h</var>, <var>x</var>, <var>y</var> parameters are
10712 expressions containing the following constants:
10713 </p>
10714 <dl compact="compact">
10715 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
10716 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
10717 <dd><p>the computed values for <var>x</var> and <var>y</var>. They are evaluated for
10718 each new frame.
10719 </p>
10720 </dd>
10721 <dt> &lsquo;<samp>in_w</samp>&rsquo;</dt>
10722 <dt> &lsquo;<samp>in_h</samp>&rsquo;</dt>
10723 <dd><p>the input width and height
10724 </p>
10725 </dd>
10726 <dt> &lsquo;<samp>iw</samp>&rsquo;</dt>
10727 <dt> &lsquo;<samp>ih</samp>&rsquo;</dt>
10728 <dd><p>same as <var>in_w</var> and <var>in_h</var>
10729 </p>
10730 </dd>
10731 <dt> &lsquo;<samp>out_w</samp>&rsquo;</dt>
10732 <dt> &lsquo;<samp>out_h</samp>&rsquo;</dt>
10733 <dd><p>the output (cropped) width and height
10734 </p>
10735 </dd>
10736 <dt> &lsquo;<samp>ow</samp>&rsquo;</dt>
10737 <dt> &lsquo;<samp>oh</samp>&rsquo;</dt>
10738 <dd><p>same as <var>out_w</var> and <var>out_h</var>
10739 </p>
10740 </dd>
10741 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
10742 <dd><p>same as <var>iw</var> / <var>ih</var>
10743 </p>
10744 </dd>
10745 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
10746 <dd><p>input sample aspect ratio
10747 </p>
10748 </dd>
10749 <dt> &lsquo;<samp>dar</samp>&rsquo;</dt>
10750 <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
10751 </p>
10752 </dd>
10753 <dt> &lsquo;<samp>hsub</samp>&rsquo;</dt>
10754 <dt> &lsquo;<samp>vsub</samp>&rsquo;</dt>
10755 <dd><p>horizontal and vertical chroma subsample values. For example for the
10756 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
10757 </p>
10758 </dd>
10759 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
10760 <dd><p>the number of input frame, starting from 0
10761 </p>
10762 </dd>
10763 <dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
10764 <dd><p>the position in the file of the input frame, NAN if unknown
10765 </p>
10766 </dd>
10767 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
10768 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
10769 </p>
10770 </dd>
10771 </dl>
10772
10773 <p>The expression for <var>out_w</var> may depend on the value of <var>out_h</var>,
10774 and the expression for <var>out_h</var> may depend on <var>out_w</var>, but they
10775 cannot depend on <var>x</var> and <var>y</var>, as <var>x</var> and <var>y</var> are
10776 evaluated after <var>out_w</var> and <var>out_h</var>.
10777 </p>
10778 <p>The <var>x</var> and <var>y</var> parameters specify the expressions for the
10779 position of the top-left corner of the output (non-cropped) area. They
10780 are evaluated for each frame. If the evaluated value is not valid, it
10781 is approximated to the nearest valid value.
10782 </p>
10783 <p>The expression for <var>x</var> may depend on <var>y</var>, and the expression
10784 for <var>y</var> may depend on <var>x</var>.
10785 </p>
10786 <a name="Examples-64"></a>
10787 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-64">28.13.1 Examples</a></h3>
10788
10789 <ul>
10790 <li>
10791 Crop area with size 100x100 at position (12,34).
10792 <table><tr><td>&nbsp;</td><td><pre class="example">crop=100:100:12:34
10793 </pre></td></tr></table>
10794
10795 <p>Using named options, the example above becomes:
10796 </p><table><tr><td>&nbsp;</td><td><pre class="example">crop=w=100:h=100:x=12:y=34
10797 </pre></td></tr></table>
10798
10799 </li><li>
10800 Crop the central input area with size 100x100:
10801 <table><tr><td>&nbsp;</td><td><pre class="example">crop=100:100
10802 </pre></td></tr></table>
10803
10804 </li><li>
10805 Crop the central input area with size 2/3 of the input video:
10806 <table><tr><td>&nbsp;</td><td><pre class="example">crop=2/3*in_w:2/3*in_h
10807 </pre></td></tr></table>
10808
10809 </li><li>
10810 Crop the input video central square:
10811 <table><tr><td>&nbsp;</td><td><pre class="example">crop=out_w=in_h
10812 crop=in_h
10813 </pre></td></tr></table>
10814
10815 </li><li>
10816 Delimit the rectangle with the top-left corner placed at position
10817 100:100 and the right-bottom corner corresponding to the right-bottom
10818 corner of the input image:
10819 <table><tr><td>&nbsp;</td><td><pre class="example">crop=in_w-100:in_h-100:100:100
10820 </pre></td></tr></table>
10821
10822 </li><li>
10823 Crop 10 pixels from the left and right borders, and 20 pixels from
10824 the top and bottom borders
10825 <table><tr><td>&nbsp;</td><td><pre class="example">crop=in_w-2*10:in_h-2*20
10826 </pre></td></tr></table>
10827
10828 </li><li>
10829 Keep only the bottom right quarter of the input image:
10830 <table><tr><td>&nbsp;</td><td><pre class="example">crop=in_w/2:in_h/2:in_w/2:in_h/2
10831 </pre></td></tr></table>
10832
10833 </li><li>
10834 Crop height for getting Greek harmony:
10835 <table><tr><td>&nbsp;</td><td><pre class="example">crop=in_w:1/PHI*in_w
10836 </pre></td></tr></table>
10837
10838 </li><li>
10839 Appply trembling effect:
10840 <table><tr><td>&nbsp;</td><td><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)
10841 </pre></td></tr></table>
10842
10843 </li><li>
10844 Apply erratic camera effect depending on timestamp:
10845 <table><tr><td>&nbsp;</td><td><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;
10846 </pre></td></tr></table>
10847
10848 </li><li>
10849 Set x depending on the value of y:
10850 <table><tr><td>&nbsp;</td><td><pre class="example">crop=in_w/2:in_h/2:y:10+10*sin(n/10)
10851 </pre></td></tr></table>
10852 </li></ul>
10853
10854 <a name="cropdetect"></a>
10855 <h2 class="section"><a href="ffplay-all.html#toc-cropdetect">28.14 cropdetect</a></h2>
10856
10857 <p>Auto-detect crop size.
10858 </p>
10859 <p>Calculate necessary cropping parameters and prints the recommended
10860 parameters through the logging system. The detected dimensions
10861 correspond to the non-black area of the input video.
10862 </p>
10863 <p>The filter accepts the following options:
10864 </p>
10865 <dl compact="compact">
10866 <dt> &lsquo;<samp>limit</samp>&rsquo;</dt>
10867 <dd><p>Set higher black value threshold, which can be optionally specified
10868 from nothing (0) to everything (255). An intensity value greater
10869 to the set value is considered non-black. Default value is 24.
10870 </p>
10871 </dd>
10872 <dt> &lsquo;<samp>round</samp>&rsquo;</dt>
10873 <dd><p>Set the value for which the width/height should be divisible by. The
10874 offset is automatically adjusted to center the video. Use 2 to get
10875 only even dimensions (needed for 4:2:2 video). 16 is best when
10876 encoding to most video codecs. Default value is 16.
10877 </p>
10878 </dd>
10879 <dt> &lsquo;<samp>reset_count, reset</samp>&rsquo;</dt>
10880 <dd><p>Set the counter that determines after how many frames cropdetect will
10881 reset the previously detected largest video area and start over to
10882 detect the current optimal crop area. Default value is 0.
10883 </p>
10884 <p>This can be useful when channel logos distort the video area. 0
10885 indicates never reset and return the largest area encountered during
10886 playback.
10887 </p></dd>
10888 </dl>
10889
10890 <p><a name="curves"></a>
10891 </p><a name="curves-1"></a>
10892 <h2 class="section"><a href="ffplay-all.html#toc-curves-1">28.15 curves</a></h2>
10893
10894 <p>Apply color adjustments using curves.
10895 </p>
10896 <p>This filter is similar to the Adobe Photoshop and GIMP curves tools. Each
10897 component (red, green and blue) has its values defined by <var>N</var> key points
10898 tied from each other using a smooth curve. The x-axis represents the pixel
10899 values from the input frame, and the y-axis the new pixel values to be set for
10900 the output frame.
10901 </p>
10902 <p>By default, a component curve is defined by the two points <var>(0;0)</var> and
10903 <var>(1;1)</var>. This creates a straight line where each original pixel value is
10904 &quot;adjusted&quot; to its own value, which means no change to the image.
10905 </p>
10906 <p>The filter allows you to redefine these two points and add some more. A new
10907 curve (using a natural cubic spline interpolation) will be define to pass
10908 smoothly through all these new coordinates. The new defined points needs to be
10909 strictly increasing over the x-axis, and their <var>x</var> and <var>y</var> values must
10910 be in the <var>[0;1]</var> interval.  If the computed curves happened to go outside
10911 the vector spaces, the values will be clipped accordingly.
10912 </p>
10913 <p>If there is no key point defined in <code>x=0</code>, the filter will automatically
10914 insert a <var>(0;0)</var> point. In the same way, if there is no key point defined
10915 in <code>x=1</code>, the filter will automatically insert a <var>(1;1)</var> point.
10916 </p>
10917 <p>The filter accepts the following options:
10918 </p>
10919 <dl compact="compact">
10920 <dt> &lsquo;<samp>preset</samp>&rsquo;</dt>
10921 <dd><p>Select one of the available color presets. This option can be used in addition
10922 to the &lsquo;<samp>r</samp>&rsquo;, &lsquo;<samp>g</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; parameters; in this case, the later
10923 options takes priority on the preset values.
10924 Available presets are:
10925 </p><dl compact="compact">
10926 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
10927 <dt> &lsquo;<samp>color_negative</samp>&rsquo;</dt>
10928 <dt> &lsquo;<samp>cross_process</samp>&rsquo;</dt>
10929 <dt> &lsquo;<samp>darker</samp>&rsquo;</dt>
10930 <dt> &lsquo;<samp>increase_contrast</samp>&rsquo;</dt>
10931 <dt> &lsquo;<samp>lighter</samp>&rsquo;</dt>
10932 <dt> &lsquo;<samp>linear_contrast</samp>&rsquo;</dt>
10933 <dt> &lsquo;<samp>medium_contrast</samp>&rsquo;</dt>
10934 <dt> &lsquo;<samp>negative</samp>&rsquo;</dt>
10935 <dt> &lsquo;<samp>strong_contrast</samp>&rsquo;</dt>
10936 <dt> &lsquo;<samp>vintage</samp>&rsquo;</dt>
10937 </dl>
10938 <p>Default is <code>none</code>.
10939 </p></dd>
10940 <dt> &lsquo;<samp>master, m</samp>&rsquo;</dt>
10941 <dd><p>Set the master key points. These points will define a second pass mapping. It
10942 is sometimes called a &quot;luminance&quot; or &quot;value&quot; mapping. It can be used with
10943 &lsquo;<samp>r</samp>&rsquo;, &lsquo;<samp>g</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; or &lsquo;<samp>all</samp>&rsquo; since it acts like a
10944 post-processing LUT.
10945 </p></dd>
10946 <dt> &lsquo;<samp>red, r</samp>&rsquo;</dt>
10947 <dd><p>Set the key points for the red component.
10948 </p></dd>
10949 <dt> &lsquo;<samp>green, g</samp>&rsquo;</dt>
10950 <dd><p>Set the key points for the green component.
10951 </p></dd>
10952 <dt> &lsquo;<samp>blue, b</samp>&rsquo;</dt>
10953 <dd><p>Set the key points for the blue component.
10954 </p></dd>
10955 <dt> &lsquo;<samp>all</samp>&rsquo;</dt>
10956 <dd><p>Set the key points for all components (not including master).
10957 Can be used in addition to the other key points component
10958 options. In this case, the unset component(s) will fallback on this
10959 &lsquo;<samp>all</samp>&rsquo; setting.
10960 </p></dd>
10961 <dt> &lsquo;<samp>psfile</samp>&rsquo;</dt>
10962 <dd><p>Specify a Photoshop curves file (<code>.asv</code>) to import the settings from.
10963 </p></dd>
10964 </dl>
10965
10966 <p>To avoid some filtergraph syntax conflicts, each key points list need to be
10967 defined using the following syntax: <code>x0/y0 x1/y1 x2/y2 ...</code>.
10968 </p>
10969 <a name="Examples-77"></a>
10970 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-77">28.15.1 Examples</a></h3>
10971
10972 <ul>
10973 <li>
10974 Increase slightly the middle level of blue:
10975 <table><tr><td>&nbsp;</td><td><pre class="example">curves=blue='0.5/0.58'
10976 </pre></td></tr></table>
10977
10978 </li><li>
10979 Vintage effect:
10980 <table><tr><td>&nbsp;</td><td><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'
10981 </pre></td></tr></table>
10982 <p>Here we obtain the following coordinates for each components:
10983 </p><dl compact="compact">
10984 <dt> <var>red</var></dt>
10985 <dd><p><code>(0;0.11) (0.42;0.51) (1;0.95)</code>
10986 </p></dd>
10987 <dt> <var>green</var></dt>
10988 <dd><p><code>(0;0) (0.50;0.48) (1;1)</code>
10989 </p></dd>
10990 <dt> <var>blue</var></dt>
10991 <dd><p><code>(0;0.22) (0.49;0.44) (1;0.80)</code>
10992 </p></dd>
10993 </dl>
10994
10995 </li><li>
10996 The previous example can also be achieved with the associated built-in preset:
10997 <table><tr><td>&nbsp;</td><td><pre class="example">curves=preset=vintage
10998 </pre></td></tr></table>
10999
11000 </li><li>
11001 Or simply:
11002 <table><tr><td>&nbsp;</td><td><pre class="example">curves=vintage
11003 </pre></td></tr></table>
11004
11005 </li><li>
11006 Use a Photoshop preset and redefine the points of the green component:
11007 <table><tr><td>&nbsp;</td><td><pre class="example">curves=psfile='MyCurvesPresets/purple.asv':green='0.45/0.53'
11008 </pre></td></tr></table>
11009 </li></ul>
11010
11011 <a name="dctdnoiz"></a>
11012 <h2 class="section"><a href="ffplay-all.html#toc-dctdnoiz">28.16 dctdnoiz</a></h2>
11013
11014 <p>Denoise frames using 2D DCT (frequency domain filtering).
11015 </p>
11016 <p>This filter is not designed for real time and can be extremely slow.
11017 </p>
11018 <p>The filter accepts the following options:
11019 </p>
11020 <dl compact="compact">
11021 <dt> &lsquo;<samp>sigma, s</samp>&rsquo;</dt>
11022 <dd><p>Set the noise sigma constant.
11023 </p>
11024 <p>This <var>sigma</var> defines a hard threshold of <code>3 * sigma</code>; every DCT
11025 coefficient (absolute value) below this threshold with be dropped.
11026 </p>
11027 <p>If you need a more advanced filtering, see &lsquo;<samp>expr</samp>&rsquo;.
11028 </p>
11029 <p>Default is <code>0</code>.
11030 </p>
11031 </dd>
11032 <dt> &lsquo;<samp>overlap</samp>&rsquo;</dt>
11033 <dd><p>Set number overlapping pixels for each block. Each block is of size
11034 <code>16x16</code>. Since the filter can be slow, you may want to reduce this value,
11035 at the cost of a less effective filter and the risk of various artefacts.
11036 </p>
11037 <p>If the overlapping value doesn&rsquo;t allow to process the whole input width or
11038 height, a warning will be displayed and according borders won&rsquo;t be denoised.
11039 </p>
11040 <p>Default value is <code>15</code>.
11041 </p>
11042 </dd>
11043 <dt> &lsquo;<samp>expr, e</samp>&rsquo;</dt>
11044 <dd><p>Set the coefficient factor expression.
11045 </p>
11046 <p>For each coefficient of a DCT block, this expression will be evaluated as a
11047 multiplier value for the coefficient.
11048 </p>
11049 <p>If this is option is set, the &lsquo;<samp>sigma</samp>&rsquo; option will be ignored.
11050 </p>
11051 <p>The absolute value of the coefficient can be accessed through the <var>c</var>
11052 variable.
11053 </p></dd>
11054 </dl>
11055
11056 <a name="Examples-22"></a>
11057 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-22">28.16.1 Examples</a></h3>
11058
11059 <p>Apply a denoise with a &lsquo;<samp>sigma</samp>&rsquo; of <code>4.5</code>:
11060 </p><table><tr><td>&nbsp;</td><td><pre class="example">dctdnoiz=4.5
11061 </pre></td></tr></table>
11062
11063 <p>The same operation can be achieved using the expression system:
11064 </p><table><tr><td>&nbsp;</td><td><pre class="example">dctdnoiz=e='gte(c, 4.5*3)'
11065 </pre></td></tr></table>
11066
11067 <p><a name="decimate"></a>
11068 </p><a name="decimate-1"></a>
11069 <h2 class="section"><a href="ffplay-all.html#toc-decimate-1">28.17 decimate</a></h2>
11070
11071 <p>Drop duplicated frames at regular intervals.
11072 </p>
11073 <p>The filter accepts the following options:
11074 </p>
11075 <dl compact="compact">
11076 <dt> &lsquo;<samp>cycle</samp>&rsquo;</dt>
11077 <dd><p>Set the number of frames from which one will be dropped. Setting this to
11078 <var>N</var> means one frame in every batch of <var>N</var> frames will be dropped.
11079 Default is <code>5</code>.
11080 </p>
11081 </dd>
11082 <dt> &lsquo;<samp>dupthresh</samp>&rsquo;</dt>
11083 <dd><p>Set the threshold for duplicate detection. If the difference metric for a frame
11084 is less than or equal to this value, then it is declared as duplicate. Default
11085 is <code>1.1</code>
11086 </p>
11087 </dd>
11088 <dt> &lsquo;<samp>scthresh</samp>&rsquo;</dt>
11089 <dd><p>Set scene change threshold. Default is <code>15</code>.
11090 </p>
11091 </dd>
11092 <dt> &lsquo;<samp>blockx</samp>&rsquo;</dt>
11093 <dt> &lsquo;<samp>blocky</samp>&rsquo;</dt>
11094 <dd><p>Set the size of the x and y-axis blocks used during metric calculations.
11095 Larger blocks give better noise suppression, but also give worse detection of
11096 small movements. Must be a power of two. Default is <code>32</code>.
11097 </p>
11098 </dd>
11099 <dt> &lsquo;<samp>ppsrc</samp>&rsquo;</dt>
11100 <dd><p>Mark main input as a pre-processed input and activate clean source input
11101 stream. This allows the input to be pre-processed with various filters to help
11102 the metrics calculation while keeping the frame selection lossless. When set to
11103 <code>1</code>, the first stream is for the pre-processed input, and the second
11104 stream is the clean source from where the kept frames are chosen. Default is
11105 <code>0</code>.
11106 </p>
11107 </dd>
11108 <dt> &lsquo;<samp>chroma</samp>&rsquo;</dt>
11109 <dd><p>Set whether or not chroma is considered in the metric calculations. Default is
11110 <code>1</code>.
11111 </p></dd>
11112 </dl>
11113
11114 <a name="dejudder"></a>
11115 <h2 class="section"><a href="ffplay-all.html#toc-dejudder">28.18 dejudder</a></h2>
11116
11117 <p>Remove judder produced by partially interlaced telecined content.
11118 </p>
11119 <p>Judder can be introduced, for instance, by <a href="#pullup">pullup</a> filter. If the original
11120 source was partially telecined content then the output of <code>pullup,dejudder</code>
11121 will have a variable frame rate. May change the recorded frame rate of the
11122 container. Aside from that change, this filter will not affect constant frame
11123 rate video.
11124 </p>
11125 <p>The option available in this filter is:
11126 </p><dl compact="compact">
11127 <dt> &lsquo;<samp>cycle</samp>&rsquo;</dt>
11128 <dd><p>Specify the length of the window over which the judder repeats.
11129 </p>
11130 <p>Accepts any interger greater than 1. Useful values are:
11131 </p><dl compact="compact">
11132 <dt> &lsquo;<samp>4</samp>&rsquo;</dt>
11133 <dd><p>If the original was telecined from 24 to 30 fps (Film to NTSC).
11134 </p>
11135 </dd>
11136 <dt> &lsquo;<samp>5</samp>&rsquo;</dt>
11137 <dd><p>If the original was telecined from 25 to 30 fps (PAL to NTSC).
11138 </p>
11139 </dd>
11140 <dt> &lsquo;<samp>20</samp>&rsquo;</dt>
11141 <dd><p>If a mixture of the two.
11142 </p></dd>
11143 </dl>
11144
11145 <p>The default is &lsquo;<samp>4</samp>&rsquo;.
11146 </p></dd>
11147 </dl>
11148
11149 <a name="delogo"></a>
11150 <h2 class="section"><a href="ffplay-all.html#toc-delogo">28.19 delogo</a></h2>
11151
11152 <p>Suppress a TV station logo by a simple interpolation of the surrounding
11153 pixels. Just set a rectangle covering the logo and watch it disappear
11154 (and sometimes something even uglier appear - your mileage may vary).
11155 </p>
11156 <p>This filter accepts the following options:
11157 </p><dl compact="compact">
11158 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
11159 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
11160 <dd><p>Specify the top left corner coordinates of the logo. They must be
11161 specified.
11162 </p>
11163 </dd>
11164 <dt> &lsquo;<samp>w</samp>&rsquo;</dt>
11165 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
11166 <dd><p>Specify the width and height of the logo to clear. They must be
11167 specified.
11168 </p>
11169 </dd>
11170 <dt> &lsquo;<samp>band, t</samp>&rsquo;</dt>
11171 <dd><p>Specify the thickness of the fuzzy edge of the rectangle (added to
11172 <var>w</var> and <var>h</var>). The default value is 4.
11173 </p>
11174 </dd>
11175 <dt> &lsquo;<samp>show</samp>&rsquo;</dt>
11176 <dd><p>When set to 1, a green rectangle is drawn on the screen to simplify
11177 finding the right <var>x</var>, <var>y</var>, <var>w</var>, and <var>h</var> parameters.
11178 The default value is 0.
11179 </p>
11180 <p>The rectangle is drawn on the outermost pixels which will be (partly)
11181 replaced with interpolated values. The values of the next pixels
11182 immediately outside this rectangle in each direction will be used to
11183 compute the interpolated pixel values inside the rectangle.
11184 </p>
11185 </dd>
11186 </dl>
11187
11188 <a name="Examples-32"></a>
11189 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-32">28.19.1 Examples</a></h3>
11190
11191 <ul>
11192 <li>
11193 Set a rectangle covering the area with top left corner coordinates 0,0
11194 and size 100x77, setting a band of size 10:
11195 <table><tr><td>&nbsp;</td><td><pre class="example">delogo=x=0:y=0:w=100:h=77:band=10
11196 </pre></td></tr></table>
11197
11198 </li></ul>
11199
11200 <a name="deshake"></a>
11201 <h2 class="section"><a href="ffplay-all.html#toc-deshake">28.20 deshake</a></h2>
11202
11203 <p>Attempt to fix small changes in horizontal and/or vertical shift. This
11204 filter helps remove camera shake from hand-holding a camera, bumping a
11205 tripod, moving on a vehicle, etc.
11206 </p>
11207 <p>The filter accepts the following options:
11208 </p>
11209 <dl compact="compact">
11210 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
11211 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
11212 <dt> &lsquo;<samp>w</samp>&rsquo;</dt>
11213 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
11214 <dd><p>Specify a rectangular area where to limit the search for motion
11215 vectors.
11216 If desired the search for motion vectors can be limited to a
11217 rectangular area of the frame defined by its top left corner, width
11218 and height. These parameters have the same meaning as the drawbox
11219 filter which can be used to visualise the position of the bounding
11220 box.
11221 </p>
11222 <p>This is useful when simultaneous movement of subjects within the frame
11223 might be confused for camera motion by the motion vector search.
11224 </p>
11225 <p>If any or all of <var>x</var>, <var>y</var>, <var>w</var> and <var>h</var> are set to -1
11226 then the full frame is used. This allows later options to be set
11227 without specifying the bounding box for the motion vector search.
11228 </p>
11229 <p>Default - search the whole frame.
11230 </p>
11231 </dd>
11232 <dt> &lsquo;<samp>rx</samp>&rsquo;</dt>
11233 <dt> &lsquo;<samp>ry</samp>&rsquo;</dt>
11234 <dd><p>Specify the maximum extent of movement in x and y directions in the
11235 range 0-64 pixels. Default 16.
11236 </p>
11237 </dd>
11238 <dt> &lsquo;<samp>edge</samp>&rsquo;</dt>
11239 <dd><p>Specify how to generate pixels to fill blanks at the edge of the
11240 frame. Available values are:
11241 </p><dl compact="compact">
11242 <dt> &lsquo;<samp>blank, 0</samp>&rsquo;</dt>
11243 <dd><p>Fill zeroes at blank locations
11244 </p></dd>
11245 <dt> &lsquo;<samp>original, 1</samp>&rsquo;</dt>
11246 <dd><p>Original image at blank locations
11247 </p></dd>
11248 <dt> &lsquo;<samp>clamp, 2</samp>&rsquo;</dt>
11249 <dd><p>Extruded edge value at blank locations
11250 </p></dd>
11251 <dt> &lsquo;<samp>mirror, 3</samp>&rsquo;</dt>
11252 <dd><p>Mirrored edge at blank locations
11253 </p></dd>
11254 </dl>
11255 <p>Default value is &lsquo;<samp>mirror</samp>&rsquo;.
11256 </p>
11257 </dd>
11258 <dt> &lsquo;<samp>blocksize</samp>&rsquo;</dt>
11259 <dd><p>Specify the blocksize to use for motion search. Range 4-128 pixels,
11260 default 8.
11261 </p>
11262 </dd>
11263 <dt> &lsquo;<samp>contrast</samp>&rsquo;</dt>
11264 <dd><p>Specify the contrast threshold for blocks. Only blocks with more than
11265 the specified contrast (difference between darkest and lightest
11266 pixels) will be considered. Range 1-255, default 125.
11267 </p>
11268 </dd>
11269 <dt> &lsquo;<samp>search</samp>&rsquo;</dt>
11270 <dd><p>Specify the search strategy. Available values are:
11271 </p><dl compact="compact">
11272 <dt> &lsquo;<samp>exhaustive, 0</samp>&rsquo;</dt>
11273 <dd><p>Set exhaustive search
11274 </p></dd>
11275 <dt> &lsquo;<samp>less, 1</samp>&rsquo;</dt>
11276 <dd><p>Set less exhaustive search.
11277 </p></dd>
11278 </dl>
11279 <p>Default value is &lsquo;<samp>exhaustive</samp>&rsquo;.
11280 </p>
11281 </dd>
11282 <dt> &lsquo;<samp>filename</samp>&rsquo;</dt>
11283 <dd><p>If set then a detailed log of the motion search is written to the
11284 specified file.
11285 </p>
11286 </dd>
11287 <dt> &lsquo;<samp>opencl</samp>&rsquo;</dt>
11288 <dd><p>If set to 1, specify using OpenCL capabilities, only available if
11289 FFmpeg was configured with <code>--enable-opencl</code>. Default value is 0.
11290 </p>
11291 </dd>
11292 </dl>
11293
11294 <a name="drawbox"></a>
11295 <h2 class="section"><a href="ffplay-all.html#toc-drawbox">28.21 drawbox</a></h2>
11296
11297 <p>Draw a colored box on the input image.
11298 </p>
11299 <p>This filter accepts the following options:
11300 </p>
11301 <dl compact="compact">
11302 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
11303 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
11304 <dd><p>The expressions which specify the top left corner coordinates of the box. Default to 0.
11305 </p>
11306 </dd>
11307 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
11308 <dt> &lsquo;<samp>height, h</samp>&rsquo;</dt>
11309 <dd><p>The expressions which specify the width and height of the box, if 0 they are interpreted as
11310 the input width and height. Default to 0.
11311 </p>
11312 </dd>
11313 <dt> &lsquo;<samp>color, c</samp>&rsquo;</dt>
11314 <dd><p>Specify the color of the box to write. For the general syntax of this option,
11315 check the &quot;Color&quot; section in the ffmpeg-utils manual. If the special
11316 value <code>invert</code> is used, the box edge color is the same as the
11317 video with inverted luma.
11318 </p>
11319 </dd>
11320 <dt> &lsquo;<samp>thickness, t</samp>&rsquo;</dt>
11321 <dd><p>The expression which sets the thickness of the box edge. Default value is <code>3</code>.
11322 </p>
11323 <p>See below for the list of accepted constants.
11324 </p></dd>
11325 </dl>
11326
11327 <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
11328 following constants:
11329 </p>
11330 <dl compact="compact">
11331 <dt> &lsquo;<samp>dar</samp>&rsquo;</dt>
11332 <dd><p>The input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>.
11333 </p>
11334 </dd>
11335 <dt> &lsquo;<samp>hsub</samp>&rsquo;</dt>
11336 <dt> &lsquo;<samp>vsub</samp>&rsquo;</dt>
11337 <dd><p>horizontal and vertical chroma subsample values. For example for the
11338 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
11339 </p>
11340 </dd>
11341 <dt> &lsquo;<samp>in_h, ih</samp>&rsquo;</dt>
11342 <dt> &lsquo;<samp>in_w, iw</samp>&rsquo;</dt>
11343 <dd><p>The input width and height.
11344 </p>
11345 </dd>
11346 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
11347 <dd><p>The input sample aspect ratio.
11348 </p>
11349 </dd>
11350 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
11351 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
11352 <dd><p>The x and y offset coordinates where the box is drawn.
11353 </p>
11354 </dd>
11355 <dt> &lsquo;<samp>w</samp>&rsquo;</dt>
11356 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
11357 <dd><p>The width and height of the drawn box.
11358 </p>
11359 </dd>
11360 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
11361 <dd><p>The thickness of the drawn box.
11362 </p>
11363 <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
11364 each other, so you may for example specify <code>y=x/dar</code> or <code>h=w/dar</code>.
11365 </p>
11366 </dd>
11367 </dl>
11368
11369 <a name="Examples-19"></a>
11370 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-19">28.21.1 Examples</a></h3>
11371
11372 <ul>
11373 <li>
11374 Draw a black box around the edge of the input image:
11375 <table><tr><td>&nbsp;</td><td><pre class="example">drawbox
11376 </pre></td></tr></table>
11377
11378 </li><li>
11379 Draw a box with color red and an opacity of 50%:
11380 <table><tr><td>&nbsp;</td><td><pre class="example">drawbox=10:20:200:60:red@0.5
11381 </pre></td></tr></table>
11382
11383 <p>The previous example can be specified as:
11384 </p><table><tr><td>&nbsp;</td><td><pre class="example">drawbox=x=10:y=20:w=200:h=60:color=red@0.5
11385 </pre></td></tr></table>
11386
11387 </li><li>
11388 Fill the box with pink color:
11389 <table><tr><td>&nbsp;</td><td><pre class="example">drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=max
11390 </pre></td></tr></table>
11391
11392 </li><li>
11393 Draw a 2-pixel red 2.40:1 mask:
11394 <table><tr><td>&nbsp;</td><td><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
11395 </pre></td></tr></table>
11396 </li></ul>
11397
11398 <a name="drawgrid"></a>
11399 <h2 class="section"><a href="ffplay-all.html#toc-drawgrid">28.22 drawgrid</a></h2>
11400
11401 <p>Draw a grid on the input image.
11402 </p>
11403 <p>This filter accepts the following options:
11404 </p>
11405 <dl compact="compact">
11406 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
11407 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
11408 <dd><p>The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0.
11409 </p>
11410 </dd>
11411 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
11412 <dt> &lsquo;<samp>height, h</samp>&rsquo;</dt>
11413 <dd><p>The expressions which specify the width and height of the grid cell, if 0 they are interpreted as the
11414 input width and height, respectively, minus <code>thickness</code>, so image gets
11415 framed. Default to 0.
11416 </p>
11417 </dd>
11418 <dt> &lsquo;<samp>color, c</samp>&rsquo;</dt>
11419 <dd><p>Specify the color of the grid. For the general syntax of this option,
11420 check the &quot;Color&quot; section in the ffmpeg-utils manual. If the special
11421 value <code>invert</code> is used, the grid color is the same as the
11422 video with inverted luma.
11423 </p>
11424 </dd>
11425 <dt> &lsquo;<samp>thickness, t</samp>&rsquo;</dt>
11426 <dd><p>The expression which sets the thickness of the grid line. Default value is <code>1</code>.
11427 </p>
11428 <p>See below for the list of accepted constants.
11429 </p></dd>
11430 </dl>
11431
11432 <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
11433 following constants:
11434 </p>
11435 <dl compact="compact">
11436 <dt> &lsquo;<samp>dar</samp>&rsquo;</dt>
11437 <dd><p>The input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>.
11438 </p>
11439 </dd>
11440 <dt> &lsquo;<samp>hsub</samp>&rsquo;</dt>
11441 <dt> &lsquo;<samp>vsub</samp>&rsquo;</dt>
11442 <dd><p>horizontal and vertical chroma subsample values. For example for the
11443 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
11444 </p>
11445 </dd>
11446 <dt> &lsquo;<samp>in_h, ih</samp>&rsquo;</dt>
11447 <dt> &lsquo;<samp>in_w, iw</samp>&rsquo;</dt>
11448 <dd><p>The input grid cell width and height.
11449 </p>
11450 </dd>
11451 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
11452 <dd><p>The input sample aspect ratio.
11453 </p>
11454 </dd>
11455 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
11456 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
11457 <dd><p>The x and y coordinates of some point of grid intersection (meant to configure offset).
11458 </p>
11459 </dd>
11460 <dt> &lsquo;<samp>w</samp>&rsquo;</dt>
11461 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
11462 <dd><p>The width and height of the drawn cell.
11463 </p>
11464 </dd>
11465 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
11466 <dd><p>The thickness of the drawn cell.
11467 </p>
11468 <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
11469 each other, so you may for example specify <code>y=x/dar</code> or <code>h=w/dar</code>.
11470 </p>
11471 </dd>
11472 </dl>
11473
11474 <a name="Examples-40"></a>
11475 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-40">28.22.1 Examples</a></h3>
11476
11477 <ul>
11478 <li>
11479 Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an opacity of 50%:
11480 <table><tr><td>&nbsp;</td><td><pre class="example">drawgrid=width=100:height=100:thickness=2:color=red@0.5
11481 </pre></td></tr></table>
11482
11483 </li><li>
11484 Draw a white 3x3 grid with an opacity of 50%:
11485 <table><tr><td>&nbsp;</td><td><pre class="example">drawgrid=w=iw/3:h=ih/3:t=2:c=white@0.5
11486 </pre></td></tr></table>
11487 </li></ul>
11488
11489 <p><a name="drawtext"></a>
11490 </p><a name="drawtext-1"></a>
11491 <h2 class="section"><a href="ffplay-all.html#toc-drawtext-1">28.23 drawtext</a></h2>
11492
11493 <p>Draw text string or text from specified file on top of video using the
11494 libfreetype library.
11495 </p>
11496 <p>To enable compilation of this filter you need to configure FFmpeg with
11497 <code>--enable-libfreetype</code>.
11498 </p>
11499 <a name="Syntax-2"></a>
11500 <h3 class="subsection"><a href="ffplay-all.html#toc-Syntax-2">28.23.1 Syntax</a></h3>
11501
11502 <p>The description of the accepted parameters follows.
11503 </p>
11504 <dl compact="compact">
11505 <dt> &lsquo;<samp>box</samp>&rsquo;</dt>
11506 <dd><p>Used to draw a box around text using background color.
11507 Value should be either 1 (enable) or 0 (disable).
11508 The default value of <var>box</var> is 0.
11509 </p>
11510 </dd>
11511 <dt> &lsquo;<samp>boxcolor</samp>&rsquo;</dt>
11512 <dd><p>The color to be used for drawing box around text. For the syntax of this
11513 option, check the &quot;Color&quot; section in the ffmpeg-utils manual.
11514 </p>
11515 <p>The default value of <var>boxcolor</var> is &quot;white&quot;.
11516 </p>
11517 </dd>
11518 <dt> &lsquo;<samp>borderw</samp>&rsquo;</dt>
11519 <dd><p>Set the width of the border to be drawn around the text using <var>bordercolor</var>.
11520 The default value of <var>borderw</var> is 0.
11521 </p>
11522 </dd>
11523 <dt> &lsquo;<samp>bordercolor</samp>&rsquo;</dt>
11524 <dd><p>Set the color to be used for drawing border around text. For the syntax of this
11525 option, check the &quot;Color&quot; section in the ffmpeg-utils manual.
11526 </p>
11527 <p>The default value of <var>bordercolor</var> is &quot;black&quot;.
11528 </p>
11529 </dd>
11530 <dt> &lsquo;<samp>expansion</samp>&rsquo;</dt>
11531 <dd><p>Select how the <var>text</var> is expanded. Can be either <code>none</code>,
11532 <code>strftime</code> (deprecated) or
11533 <code>normal</code> (default). See the <a href="#drawtext_005fexpansion">Text expansion</a> section
11534 below for details.
11535 </p>
11536 </dd>
11537 <dt> &lsquo;<samp>fix_bounds</samp>&rsquo;</dt>
11538 <dd><p>If true, check and fix text coords to avoid clipping.
11539 </p>
11540 </dd>
11541 <dt> &lsquo;<samp>fontcolor</samp>&rsquo;</dt>
11542 <dd><p>The color to be used for drawing fonts. For the syntax of this option, check
11543 the &quot;Color&quot; section in the ffmpeg-utils manual.
11544 </p>
11545 <p>The default value of <var>fontcolor</var> is &quot;black&quot;.
11546 </p>
11547 </dd>
11548 <dt> &lsquo;<samp>fontfile</samp>&rsquo;</dt>
11549 <dd><p>The font file to be used for drawing text. Path must be included.
11550 This parameter is mandatory.
11551 </p>
11552 </dd>
11553 <dt> &lsquo;<samp>fontsize</samp>&rsquo;</dt>
11554 <dd><p>The font size to be used for drawing text.
11555 The default value of <var>fontsize</var> is 16.
11556 </p>
11557 </dd>
11558 <dt> &lsquo;<samp>ft_load_flags</samp>&rsquo;</dt>
11559 <dd><p>Flags to be used for loading the fonts.
11560 </p>
11561 <p>The flags map the corresponding flags supported by libfreetype, and are
11562 a combination of the following values:
11563 </p><dl compact="compact">
11564 <dt> <var>default</var></dt>
11565 <dt> <var>no_scale</var></dt>
11566 <dt> <var>no_hinting</var></dt>
11567 <dt> <var>render</var></dt>
11568 <dt> <var>no_bitmap</var></dt>
11569 <dt> <var>vertical_layout</var></dt>
11570 <dt> <var>force_autohint</var></dt>
11571 <dt> <var>crop_bitmap</var></dt>
11572 <dt> <var>pedantic</var></dt>
11573 <dt> <var>ignore_global_advance_width</var></dt>
11574 <dt> <var>no_recurse</var></dt>
11575 <dt> <var>ignore_transform</var></dt>
11576 <dt> <var>monochrome</var></dt>
11577 <dt> <var>linear_design</var></dt>
11578 <dt> <var>no_autohint</var></dt>
11579 </dl>
11580
11581 <p>Default value is &quot;default&quot;.
11582 </p>
11583 <p>For more information consult the documentation for the FT_LOAD_*
11584 libfreetype flags.
11585 </p>
11586 </dd>
11587 <dt> &lsquo;<samp>shadowcolor</samp>&rsquo;</dt>
11588 <dd><p>The color to be used for drawing a shadow behind the drawn text. For the
11589 syntax of this option, check the &quot;Color&quot; section in the ffmpeg-utils manual.
11590 </p>
11591 <p>The default value of <var>shadowcolor</var> is &quot;black&quot;.
11592 </p>
11593 </dd>
11594 <dt> &lsquo;<samp>shadowx</samp>&rsquo;</dt>
11595 <dt> &lsquo;<samp>shadowy</samp>&rsquo;</dt>
11596 <dd><p>The x and y offsets for the text shadow position with respect to the
11597 position of the text. They can be either positive or negative
11598 values. Default value for both is &quot;0&quot;.
11599 </p>
11600 </dd>
11601 <dt> &lsquo;<samp>start_number</samp>&rsquo;</dt>
11602 <dd><p>The starting frame number for the n/frame_num variable. The default value
11603 is &quot;0&quot;.
11604 </p>
11605 </dd>
11606 <dt> &lsquo;<samp>tabsize</samp>&rsquo;</dt>
11607 <dd><p>The size in number of spaces to use for rendering the tab.
11608 Default value is 4.
11609 </p>
11610 </dd>
11611 <dt> &lsquo;<samp>timecode</samp>&rsquo;</dt>
11612 <dd><p>Set the initial timecode representation in &quot;hh:mm:ss[:;.]ff&quot;
11613 format. It can be used with or without text parameter. <var>timecode_rate</var>
11614 option must be specified.
11615 </p>
11616 </dd>
11617 <dt> &lsquo;<samp>timecode_rate, rate, r</samp>&rsquo;</dt>
11618 <dd><p>Set the timecode frame rate (timecode only).
11619 </p>
11620 </dd>
11621 <dt> &lsquo;<samp>text</samp>&rsquo;</dt>
11622 <dd><p>The text string to be drawn. The text must be a sequence of UTF-8
11623 encoded characters.
11624 This parameter is mandatory if no file is specified with the parameter
11625 <var>textfile</var>.
11626 </p>
11627 </dd>
11628 <dt> &lsquo;<samp>textfile</samp>&rsquo;</dt>
11629 <dd><p>A text file containing text to be drawn. The text must be a sequence
11630 of UTF-8 encoded characters.
11631 </p>
11632 <p>This parameter is mandatory if no text string is specified with the
11633 parameter <var>text</var>.
11634 </p>
11635 <p>If both <var>text</var> and <var>textfile</var> are specified, an error is thrown.
11636 </p>
11637 </dd>
11638 <dt> &lsquo;<samp>reload</samp>&rsquo;</dt>
11639 <dd><p>If set to 1, the <var>textfile</var> will be reloaded before each frame.
11640 Be sure to update it atomically, or it may be read partially, or even fail.
11641 </p>
11642 </dd>
11643 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
11644 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
11645 <dd><p>The expressions which specify the offsets where text will be drawn
11646 within the video frame. They are relative to the top/left border of the
11647 output image.
11648 </p>
11649 <p>The default value of <var>x</var> and <var>y</var> is &quot;0&quot;.
11650 </p>
11651 <p>See below for the list of accepted constants and functions.
11652 </p></dd>
11653 </dl>
11654
11655 <p>The parameters for <var>x</var> and <var>y</var> are expressions containing the
11656 following constants and functions:
11657 </p>
11658 <dl compact="compact">
11659 <dt> &lsquo;<samp>dar</samp>&rsquo;</dt>
11660 <dd><p>input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>
11661 </p>
11662 </dd>
11663 <dt> &lsquo;<samp>hsub</samp>&rsquo;</dt>
11664 <dt> &lsquo;<samp>vsub</samp>&rsquo;</dt>
11665 <dd><p>horizontal and vertical chroma subsample values. For example for the
11666 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
11667 </p>
11668 </dd>
11669 <dt> &lsquo;<samp>line_h, lh</samp>&rsquo;</dt>
11670 <dd><p>the height of each text line
11671 </p>
11672 </dd>
11673 <dt> &lsquo;<samp>main_h, h, H</samp>&rsquo;</dt>
11674 <dd><p>the input height
11675 </p>
11676 </dd>
11677 <dt> &lsquo;<samp>main_w, w, W</samp>&rsquo;</dt>
11678 <dd><p>the input width
11679 </p>
11680 </dd>
11681 <dt> &lsquo;<samp>max_glyph_a, ascent</samp>&rsquo;</dt>
11682 <dd><p>the maximum distance from the baseline to the highest/upper grid
11683 coordinate used to place a glyph outline point, for all the rendered
11684 glyphs.
11685 It is a positive value, due to the grid&rsquo;s orientation with the Y axis
11686 upwards.
11687 </p>
11688 </dd>
11689 <dt> &lsquo;<samp>max_glyph_d, descent</samp>&rsquo;</dt>
11690 <dd><p>the maximum distance from the baseline to the lowest grid coordinate
11691 used to place a glyph outline point, for all the rendered glyphs.
11692 This is a negative value, due to the grid&rsquo;s orientation, with the Y axis
11693 upwards.
11694 </p>
11695 </dd>
11696 <dt> &lsquo;<samp>max_glyph_h</samp>&rsquo;</dt>
11697 <dd><p>maximum glyph height, that is the maximum height for all the glyphs
11698 contained in the rendered text, it is equivalent to <var>ascent</var> -
11699 <var>descent</var>.
11700 </p>
11701 </dd>
11702 <dt> &lsquo;<samp>max_glyph_w</samp>&rsquo;</dt>
11703 <dd><p>maximum glyph width, that is the maximum width for all the glyphs
11704 contained in the rendered text
11705 </p>
11706 </dd>
11707 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
11708 <dd><p>the number of input frame, starting from 0
11709 </p>
11710 </dd>
11711 <dt> &lsquo;<samp>rand(min, max)</samp>&rsquo;</dt>
11712 <dd><p>return a random number included between <var>min</var> and <var>max</var>
11713 </p>
11714 </dd>
11715 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
11716 <dd><p>input sample aspect ratio
11717 </p>
11718 </dd>
11719 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
11720 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
11721 </p>
11722 </dd>
11723 <dt> &lsquo;<samp>text_h, th</samp>&rsquo;</dt>
11724 <dd><p>the height of the rendered text
11725 </p>
11726 </dd>
11727 <dt> &lsquo;<samp>text_w, tw</samp>&rsquo;</dt>
11728 <dd><p>the width of the rendered text
11729 </p>
11730 </dd>
11731 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
11732 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
11733 <dd><p>the x and y offset coordinates where the text is drawn.
11734 </p>
11735 <p>These parameters allow the <var>x</var> and <var>y</var> expressions to refer
11736 each other, so you can for example specify <code>y=x/dar</code>.
11737 </p></dd>
11738 </dl>
11739
11740 <p>If libavfilter was built with <code>--enable-fontconfig</code>, then
11741 &lsquo;<samp>fontfile</samp>&rsquo; can be a fontconfig pattern or omitted.
11742 </p>
11743 <p><a name="drawtext_005fexpansion"></a>
11744 </p><a name="Text-expansion"></a>
11745 <h3 class="subsection"><a href="ffplay-all.html#toc-Text-expansion">28.23.2 Text expansion</a></h3>
11746
11747 <p>If &lsquo;<samp>expansion</samp>&rsquo; is set to <code>strftime</code>,
11748 the filter recognizes strftime() sequences in the provided text and
11749 expands them accordingly. Check the documentation of strftime(). This
11750 feature is deprecated.
11751 </p>
11752 <p>If &lsquo;<samp>expansion</samp>&rsquo; is set to <code>none</code>, the text is printed verbatim.
11753 </p>
11754 <p>If &lsquo;<samp>expansion</samp>&rsquo; is set to <code>normal</code> (which is the default),
11755 the following expansion mechanism is used.
11756 </p>
11757 <p>The backslash character &rsquo;\&rsquo;, followed by any character, always expands to
11758 the second character.
11759 </p>
11760 <p>Sequence of the form <code>%{...}</code> are expanded. The text between the
11761 braces is a function name, possibly followed by arguments separated by &rsquo;:&rsquo;.
11762 If the arguments contain special characters or delimiters (&rsquo;:&rsquo; or &rsquo;}&rsquo;),
11763 they should be escaped.
11764 </p>
11765 <p>Note that they probably must also be escaped as the value for the
11766 &lsquo;<samp>text</samp>&rsquo; option in the filter argument string and as the filter
11767 argument in the filtergraph description, and possibly also for the shell,
11768 that makes up to four levels of escaping; using a text file avoids these
11769 problems.
11770 </p>
11771 <p>The following functions are available:
11772 </p>
11773 <dl compact="compact">
11774 <dt> <code>expr, e</code></dt>
11775 <dd><p>The expression evaluation result.
11776 </p>
11777 <p>It must take one argument specifying the expression to be evaluated,
11778 which accepts the same constants and functions as the <var>x</var> and
11779 <var>y</var> values. Note that not all constants should be used, for
11780 example the text size is not known when evaluating the expression, so
11781 the constants <var>text_w</var> and <var>text_h</var> will have an undefined
11782 value.
11783 </p>
11784 </dd>
11785 <dt> <code>gmtime</code></dt>
11786 <dd><p>The time at which the filter is running, expressed in UTC.
11787 It can accept an argument: a strftime() format string.
11788 </p>
11789 </dd>
11790 <dt> <code>localtime</code></dt>
11791 <dd><p>The time at which the filter is running, expressed in the local time zone.
11792 It can accept an argument: a strftime() format string.
11793 </p>
11794 </dd>
11795 <dt> <code>metadata</code></dt>
11796 <dd><p>Frame metadata. It must take one argument specifying metadata key.
11797 </p>
11798 </dd>
11799 <dt> <code>n, frame_num</code></dt>
11800 <dd><p>The frame number, starting from 0.
11801 </p>
11802 </dd>
11803 <dt> <code>pict_type</code></dt>
11804 <dd><p>A 1 character description of the current picture type.
11805 </p>
11806 </dd>
11807 <dt> <code>pts</code></dt>
11808 <dd><p>The timestamp of the current frame, in seconds, with microsecond accuracy.
11809 </p>
11810 </dd>
11811 </dl>
11812
11813 <a name="Examples-44"></a>
11814 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-44">28.23.3 Examples</a></h3>
11815
11816 <ul>
11817 <li>
11818 Draw &quot;Test Text&quot; with font FreeSerif, using the default values for the
11819 optional parameters.
11820
11821 <table><tr><td>&nbsp;</td><td><pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'&quot;
11822 </pre></td></tr></table>
11823
11824 </li><li>
11825 Draw &rsquo;Test Text&rsquo; with font FreeSerif of size 24 at position x=100
11826 and y=50 (counting from the top-left corner of the screen), text is
11827 yellow with a red box around it. Both the text and the box have an
11828 opacity of 20%.
11829
11830 <table><tr><td>&nbsp;</td><td><pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
11831           x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2&quot;
11832 </pre></td></tr></table>
11833
11834 <p>Note that the double quotes are not necessary if spaces are not used
11835 within the parameter list.
11836 </p>
11837 </li><li>
11838 Show the text at the center of the video frame:
11839 <table><tr><td>&nbsp;</td><td><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;
11840 </pre></td></tr></table>
11841
11842 </li><li>
11843 Show a text line sliding from right to left in the last row of the video
11844 frame. The file &lsquo;<tt>LONG_LINE</tt>&rsquo; is assumed to contain a single line
11845 with no newlines.
11846 <table><tr><td>&nbsp;</td><td><pre class="example">drawtext=&quot;fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t&quot;
11847 </pre></td></tr></table>
11848
11849 </li><li>
11850 Show the content of file &lsquo;<tt>CREDITS</tt>&rsquo; off the bottom of the frame and scroll up.
11851 <table><tr><td>&nbsp;</td><td><pre class="example">drawtext=&quot;fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t&quot;
11852 </pre></td></tr></table>
11853
11854 </li><li>
11855 Draw a single green letter &quot;g&quot;, at the center of the input video.
11856 The glyph baseline is placed at half screen height.
11857 <table><tr><td>&nbsp;</td><td><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;
11858 </pre></td></tr></table>
11859
11860 </li><li>
11861 Show text for 1 second every 3 seconds:
11862 <table><tr><td>&nbsp;</td><td><pre class="example">drawtext=&quot;fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:enable=lt(mod(t\,3)\,1):text='blink'&quot;
11863 </pre></td></tr></table>
11864
11865 </li><li>
11866 Use fontconfig to set the font. Note that the colons need to be escaped.
11867 <table><tr><td>&nbsp;</td><td><pre class="example">drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg'
11868 </pre></td></tr></table>
11869
11870 </li><li>
11871 Print the date of a real-time encoding (see strftime(3)):
11872 <table><tr><td>&nbsp;</td><td><pre class="example">drawtext='fontfile=FreeSans.ttf:text=%{localtime:%a %b %d %Y}'
11873 </pre></td></tr></table>
11874
11875 </li></ul>
11876
11877 <p>For more information about libfreetype, check:
11878 <a href="http://www.freetype.org/">http://www.freetype.org/</a>.
11879 </p>
11880 <p>For more information about fontconfig, check:
11881 <a href="http://freedesktop.org/software/fontconfig/fontconfig-user.html">http://freedesktop.org/software/fontconfig/fontconfig-user.html</a>.
11882 </p>
11883 <a name="edgedetect"></a>
11884 <h2 class="section"><a href="ffplay-all.html#toc-edgedetect">28.24 edgedetect</a></h2>
11885
11886 <p>Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
11887 </p>
11888 <p>The filter accepts the following options:
11889 </p>
11890 <dl compact="compact">
11891 <dt> &lsquo;<samp>low</samp>&rsquo;</dt>
11892 <dt> &lsquo;<samp>high</samp>&rsquo;</dt>
11893 <dd><p>Set low and high threshold values used by the Canny thresholding
11894 algorithm.
11895 </p>
11896 <p>The high threshold selects the &quot;strong&quot; edge pixels, which are then
11897 connected through 8-connectivity with the &quot;weak&quot; edge pixels selected
11898 by the low threshold.
11899 </p>
11900 <p><var>low</var> and <var>high</var> threshold values must be chosen in the range
11901 [0,1], and <var>low</var> should be lesser or equal to <var>high</var>.
11902 </p>
11903 <p>Default value for <var>low</var> is <code>20/255</code>, and default value for <var>high</var>
11904 is <code>50/255</code>.
11905 </p></dd>
11906 </dl>
11907
11908 <p>Example:
11909 </p><table><tr><td>&nbsp;</td><td><pre class="example">edgedetect=low=0.1:high=0.4
11910 </pre></td></tr></table>
11911
11912 <a name="extractplanes"></a>
11913 <h2 class="section"><a href="ffplay-all.html#toc-extractplanes">28.25 extractplanes</a></h2>
11914
11915 <p>Extract color channel components from input video stream into
11916 separate grayscale video streams.
11917 </p>
11918 <p>The filter accepts the following option:
11919 </p>
11920 <dl compact="compact">
11921 <dt> &lsquo;<samp>planes</samp>&rsquo;</dt>
11922 <dd><p>Set plane(s) to extract.
11923 </p>
11924 <p>Available values for planes are:
11925 </p><dl compact="compact">
11926 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
11927 <dt> &lsquo;<samp>u</samp>&rsquo;</dt>
11928 <dt> &lsquo;<samp>v</samp>&rsquo;</dt>
11929 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
11930 <dt> &lsquo;<samp>r</samp>&rsquo;</dt>
11931 <dt> &lsquo;<samp>g</samp>&rsquo;</dt>
11932 <dt> &lsquo;<samp>b</samp>&rsquo;</dt>
11933 </dl>
11934
11935 <p>Choosing planes not available in the input will result in an error.
11936 That means you cannot select <code>r</code>, <code>g</code>, <code>b</code> planes
11937 with <code>y</code>, <code>u</code>, <code>v</code> planes at same time.
11938 </p></dd>
11939 </dl>
11940
11941 <a name="Examples-43"></a>
11942 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-43">28.25.1 Examples</a></h3>
11943
11944 <ul>
11945 <li>
11946 Extract luma, u and v color channel component from input video frame
11947 into 3 grayscale outputs:
11948 <table><tr><td>&nbsp;</td><td><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
11949 </pre></td></tr></table>
11950 </li></ul>
11951
11952 <a name="elbg"></a>
11953 <h2 class="section"><a href="ffplay-all.html#toc-elbg">28.26 elbg</a></h2>
11954
11955 <p>Apply a posterize effect using the ELBG (Enhanced LBG) algorithm.
11956 </p>
11957 <p>For each input image, the filter will compute the optimal mapping from
11958 the input to the output given the codebook length, that is the number
11959 of distinct output colors.
11960 </p>
11961 <p>This filter accepts the following options.
11962 </p>
11963 <dl compact="compact">
11964 <dt> &lsquo;<samp>codebook_length, l</samp>&rsquo;</dt>
11965 <dd><p>Set codebook length. The value must be a positive integer, and
11966 represents the number of distinct output colors. Default value is 256.
11967 </p>
11968 </dd>
11969 <dt> &lsquo;<samp>nb_steps, n</samp>&rsquo;</dt>
11970 <dd><p>Set the maximum number of iterations to apply for computing the optimal
11971 mapping. The higher the value the better the result and the higher the
11972 computation time. Default value is 1.
11973 </p>
11974 </dd>
11975 <dt> &lsquo;<samp>seed, s</samp>&rsquo;</dt>
11976 <dd><p>Set a random seed, must be an integer included between 0 and
11977 UINT32_MAX. If not specified, or if explicitly set to -1, the filter
11978 will try to use a good random seed on a best effort basis.
11979 </p></dd>
11980 </dl>
11981
11982 <a name="fade"></a>
11983 <h2 class="section"><a href="ffplay-all.html#toc-fade">28.27 fade</a></h2>
11984
11985 <p>Apply fade-in/out effect to input video.
11986 </p>
11987 <p>This filter accepts the following options:
11988 </p>
11989 <dl compact="compact">
11990 <dt> &lsquo;<samp>type, t</samp>&rsquo;</dt>
11991 <dd><p>The effect type &ndash; can be either &quot;in&quot; for fade-in, or &quot;out&quot; for a fade-out
11992 effect.
11993 Default is <code>in</code>.
11994 </p>
11995 </dd>
11996 <dt> &lsquo;<samp>start_frame, s</samp>&rsquo;</dt>
11997 <dd><p>Specify the number of the start frame for starting to apply the fade
11998 effect. Default is 0.
11999 </p>
12000 </dd>
12001 <dt> &lsquo;<samp>nb_frames, n</samp>&rsquo;</dt>
12002 <dd><p>The number of frames for which the fade effect has to last. At the end of the
12003 fade-in effect the output video will have the same intensity as the input video,
12004 at the end of the fade-out transition the output video will be filled with the
12005 selected &lsquo;<samp>color</samp>&rsquo;.
12006 Default is 25.
12007 </p>
12008 </dd>
12009 <dt> &lsquo;<samp>alpha</samp>&rsquo;</dt>
12010 <dd><p>If set to 1, fade only alpha channel, if one exists on the input.
12011 Default value is 0.
12012 </p>
12013 </dd>
12014 <dt> &lsquo;<samp>start_time, st</samp>&rsquo;</dt>
12015 <dd><p>Specify the timestamp (in seconds) of the frame to start to apply the fade
12016 effect. If both start_frame and start_time are specified, the fade will start at
12017 whichever comes last.  Default is 0.
12018 </p>
12019 </dd>
12020 <dt> &lsquo;<samp>duration, d</samp>&rsquo;</dt>
12021 <dd><p>The number of seconds for which the fade effect has to last. At the end of the
12022 fade-in effect the output video will have the same intensity as the input video,
12023 at the end of the fade-out transition the output video will be filled with the
12024 selected &lsquo;<samp>color</samp>&rsquo;.
12025 If both duration and nb_frames are specified, duration is used. Default is 0.
12026 </p>
12027 </dd>
12028 <dt> &lsquo;<samp>color, c</samp>&rsquo;</dt>
12029 <dd><p>Specify the color of the fade. Default is &quot;black&quot;.
12030 </p></dd>
12031 </dl>
12032
12033 <a name="Examples-34"></a>
12034 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-34">28.27.1 Examples</a></h3>
12035
12036 <ul>
12037 <li>
12038 Fade in first 30 frames of video:
12039 <table><tr><td>&nbsp;</td><td><pre class="example">fade=in:0:30
12040 </pre></td></tr></table>
12041
12042 <p>The command above is equivalent to:
12043 </p><table><tr><td>&nbsp;</td><td><pre class="example">fade=t=in:s=0:n=30
12044 </pre></td></tr></table>
12045
12046 </li><li>
12047 Fade out last 45 frames of a 200-frame video:
12048 <table><tr><td>&nbsp;</td><td><pre class="example">fade=out:155:45
12049 fade=type=out:start_frame=155:nb_frames=45
12050 </pre></td></tr></table>
12051
12052 </li><li>
12053 Fade in first 25 frames and fade out last 25 frames of a 1000-frame video:
12054 <table><tr><td>&nbsp;</td><td><pre class="example">fade=in:0:25, fade=out:975:25
12055 </pre></td></tr></table>
12056
12057 </li><li>
12058 Make first 5 frames yellow, then fade in from frame 5-24:
12059 <table><tr><td>&nbsp;</td><td><pre class="example">fade=in:5:20:color=yellow
12060 </pre></td></tr></table>
12061
12062 </li><li>
12063 Fade in alpha over first 25 frames of video:
12064 <table><tr><td>&nbsp;</td><td><pre class="example">fade=in:0:25:alpha=1
12065 </pre></td></tr></table>
12066
12067 </li><li>
12068 Make first 5.5 seconds black, then fade in for 0.5 seconds:
12069 <table><tr><td>&nbsp;</td><td><pre class="example">fade=t=in:st=5.5:d=0.5
12070 </pre></td></tr></table>
12071
12072 </li></ul>
12073
12074 <a name="field"></a>
12075 <h2 class="section"><a href="ffplay-all.html#toc-field">28.28 field</a></h2>
12076
12077 <p>Extract a single field from an interlaced image using stride
12078 arithmetic to avoid wasting CPU time. The output frames are marked as
12079 non-interlaced.
12080 </p>
12081 <p>The filter accepts the following options:
12082 </p>
12083 <dl compact="compact">
12084 <dt> &lsquo;<samp>type</samp>&rsquo;</dt>
12085 <dd><p>Specify whether to extract the top (if the value is <code>0</code> or
12086 <code>top</code>) or the bottom field (if the value is <code>1</code> or
12087 <code>bottom</code>).
12088 </p></dd>
12089 </dl>
12090
12091 <a name="fieldmatch"></a>
12092 <h2 class="section"><a href="ffplay-all.html#toc-fieldmatch">28.29 fieldmatch</a></h2>
12093
12094 <p>Field matching filter for inverse telecine. It is meant to reconstruct the
12095 progressive frames from a telecined stream. The filter does not drop duplicated
12096 frames, so to achieve a complete inverse telecine <code>fieldmatch</code> needs to be
12097 followed by a decimation filter such as <a href="#decimate">decimate</a> in the filtergraph.
12098 </p>
12099 <p>The separation of the field matching and the decimation is notably motivated by
12100 the possibility of inserting a de-interlacing filter fallback between the two.
12101 If the source has mixed telecined and real interlaced content,
12102 <code>fieldmatch</code> will not be able to match fields for the interlaced parts.
12103 But these remaining combed frames will be marked as interlaced, and thus can be
12104 de-interlaced by a later filter such as <a href="#yadif">yadif</a> before decimation.
12105 </p>
12106 <p>In addition to the various configuration options, <code>fieldmatch</code> can take an
12107 optional second stream, activated through the &lsquo;<samp>ppsrc</samp>&rsquo; option. If
12108 enabled, the frames reconstruction will be based on the fields and frames from
12109 this second stream. This allows the first input to be pre-processed in order to
12110 help the various algorithms of the filter, while keeping the output lossless
12111 (assuming the fields are matched properly). Typically, a field-aware denoiser,
12112 or brightness/contrast adjustments can help.
12113 </p>
12114 <p>Note that this filter uses the same algorithms as TIVTC/TFM (AviSynth project)
12115 and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from
12116 which <code>fieldmatch</code> is based on. While the semantic and usage are very
12117 close, some behaviour and options names can differ.
12118 </p>
12119 <p>The filter accepts the following options:
12120 </p>
12121 <dl compact="compact">
12122 <dt> &lsquo;<samp>order</samp>&rsquo;</dt>
12123 <dd><p>Specify the assumed field order of the input stream. Available values are:
12124 </p>
12125 <dl compact="compact">
12126 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
12127 <dd><p>Auto detect parity (use FFmpeg&rsquo;s internal parity value).
12128 </p></dd>
12129 <dt> &lsquo;<samp>bff</samp>&rsquo;</dt>
12130 <dd><p>Assume bottom field first.
12131 </p></dd>
12132 <dt> &lsquo;<samp>tff</samp>&rsquo;</dt>
12133 <dd><p>Assume top field first.
12134 </p></dd>
12135 </dl>
12136
12137 <p>Note that it is sometimes recommended not to trust the parity announced by the
12138 stream.
12139 </p>
12140 <p>Default value is <var>auto</var>.
12141 </p>
12142 </dd>
12143 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
12144 <dd><p>Set the matching mode or strategy to use. &lsquo;<samp>pc</samp>&rsquo; mode is the safest in the
12145 sense that it won&rsquo;t risk creating jerkiness due to duplicate frames when
12146 possible, but if there are bad edits or blended fields it will end up
12147 outputting combed frames when a good match might actually exist. On the other
12148 hand, &lsquo;<samp>pcn_ub</samp>&rsquo; mode is the most risky in terms of creating jerkiness,
12149 but will almost always find a good frame if there is one. The other values are
12150 all somewhere in between &lsquo;<samp>pc</samp>&rsquo; and &lsquo;<samp>pcn_ub</samp>&rsquo; in terms of risking
12151 jerkiness and creating duplicate frames versus finding good matches in sections
12152 with bad edits, orphaned fields, blended fields, etc.
12153 </p>
12154 <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.
12155 </p>
12156 <p>Available values are:
12157 </p>
12158 <dl compact="compact">
12159 <dt> &lsquo;<samp>pc</samp>&rsquo;</dt>
12160 <dd><p>2-way matching (p/c)
12161 </p></dd>
12162 <dt> &lsquo;<samp>pc_n</samp>&rsquo;</dt>
12163 <dd><p>2-way matching, and trying 3rd match if still combed (p/c + n)
12164 </p></dd>
12165 <dt> &lsquo;<samp>pc_u</samp>&rsquo;</dt>
12166 <dd><p>2-way matching, and trying 3rd match (same order) if still combed (p/c + u)
12167 </p></dd>
12168 <dt> &lsquo;<samp>pc_n_ub</samp>&rsquo;</dt>
12169 <dd><p>2-way matching, trying 3rd match if still combed, and trying 4th/5th matches if
12170 still combed (p/c + n + u/b)
12171 </p></dd>
12172 <dt> &lsquo;<samp>pcn</samp>&rsquo;</dt>
12173 <dd><p>3-way matching (p/c/n)
12174 </p></dd>
12175 <dt> &lsquo;<samp>pcn_ub</samp>&rsquo;</dt>
12176 <dd><p>3-way matching, and trying 4th/5th matches if all 3 of the original matches are
12177 detected as combed (p/c/n + u/b)
12178 </p></dd>
12179 </dl>
12180
12181 <p>The parenthesis at the end indicate the matches that would be used for that
12182 mode assuming &lsquo;<samp>order</samp>&rsquo;=<var>tff</var> (and &lsquo;<samp>field</samp>&rsquo; on <var>auto</var> or
12183 <var>top</var>).
12184 </p>
12185 <p>In terms of speed &lsquo;<samp>pc</samp>&rsquo; mode is by far the fastest and &lsquo;<samp>pcn_ub</samp>&rsquo; is
12186 the slowest.
12187 </p>
12188 <p>Default value is <var>pc_n</var>.
12189 </p>
12190 </dd>
12191 <dt> &lsquo;<samp>ppsrc</samp>&rsquo;</dt>
12192 <dd><p>Mark the main input stream as a pre-processed input, and enable the secondary
12193 input stream as the clean source to pick the fields from. See the filter
12194 introduction for more details. It is similar to the &lsquo;<samp>clip2</samp>&rsquo; feature from
12195 VFM/TFM.
12196 </p>
12197 <p>Default value is <code>0</code> (disabled).
12198 </p>
12199 </dd>
12200 <dt> &lsquo;<samp>field</samp>&rsquo;</dt>
12201 <dd><p>Set the field to match from. It is recommended to set this to the same value as
12202 &lsquo;<samp>order</samp>&rsquo; unless you experience matching failures with that setting. In
12203 certain circumstances changing the field that is used to match from can have a
12204 large impact on matching performance. Available values are:
12205 </p>
12206 <dl compact="compact">
12207 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
12208 <dd><p>Automatic (same value as &lsquo;<samp>order</samp>&rsquo;).
12209 </p></dd>
12210 <dt> &lsquo;<samp>bottom</samp>&rsquo;</dt>
12211 <dd><p>Match from the bottom field.
12212 </p></dd>
12213 <dt> &lsquo;<samp>top</samp>&rsquo;</dt>
12214 <dd><p>Match from the top field.
12215 </p></dd>
12216 </dl>
12217
12218 <p>Default value is <var>auto</var>.
12219 </p>
12220 </dd>
12221 <dt> &lsquo;<samp>mchroma</samp>&rsquo;</dt>
12222 <dd><p>Set whether or not chroma is included during the match comparisons. In most
12223 cases it is recommended to leave this enabled. You should set this to <code>0</code>
12224 only if your clip has bad chroma problems such as heavy rainbowing or other
12225 artifacts. Setting this to <code>0</code> could also be used to speed things up at
12226 the cost of some accuracy.
12227 </p>
12228 <p>Default value is <code>1</code>.
12229 </p>
12230 </dd>
12231 <dt> &lsquo;<samp>y0</samp>&rsquo;</dt>
12232 <dt> &lsquo;<samp>y1</samp>&rsquo;</dt>
12233 <dd><p>These define an exclusion band which excludes the lines between &lsquo;<samp>y0</samp>&rsquo; and
12234 &lsquo;<samp>y1</samp>&rsquo; from being included in the field matching decision. An exclusion
12235 band can be used to ignore subtitles, a logo, or other things that may
12236 interfere with the matching. &lsquo;<samp>y0</samp>&rsquo; sets the starting scan line and
12237 &lsquo;<samp>y1</samp>&rsquo; sets the ending line; all lines in between &lsquo;<samp>y0</samp>&rsquo; and
12238 &lsquo;<samp>y1</samp>&rsquo; (including &lsquo;<samp>y0</samp>&rsquo; and &lsquo;<samp>y1</samp>&rsquo;) will be ignored. Setting
12239 &lsquo;<samp>y0</samp>&rsquo; and &lsquo;<samp>y1</samp>&rsquo; to the same value will disable the feature.
12240 &lsquo;<samp>y0</samp>&rsquo; and &lsquo;<samp>y1</samp>&rsquo; defaults to <code>0</code>.
12241 </p>
12242 </dd>
12243 <dt> &lsquo;<samp>scthresh</samp>&rsquo;</dt>
12244 <dd><p>Set the scene change detection threshold as a percentage of maximum change on
12245 the luma plane. Good values are in the <code>[8.0, 14.0]</code> range. Scene change
12246 detection is only relevant in case &lsquo;<samp>combmatch</samp>&rsquo;=<var>sc</var>.  The range for
12247 &lsquo;<samp>scthresh</samp>&rsquo; is <code>[0.0, 100.0]</code>.
12248 </p>
12249 <p>Default value is <code>12.0</code>.
12250 </p>
12251 </dd>
12252 <dt> &lsquo;<samp>combmatch</samp>&rsquo;</dt>
12253 <dd><p>When &lsquo;<samp>combatch</samp>&rsquo; is not <var>none</var>, <code>fieldmatch</code> will take into
12254 account the combed scores of matches when deciding what match to use as the
12255 final match. Available values are:
12256 </p>
12257 <dl compact="compact">
12258 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
12259 <dd><p>No final matching based on combed scores.
12260 </p></dd>
12261 <dt> &lsquo;<samp>sc</samp>&rsquo;</dt>
12262 <dd><p>Combed scores are only used when a scene change is detected.
12263 </p></dd>
12264 <dt> &lsquo;<samp>full</samp>&rsquo;</dt>
12265 <dd><p>Use combed scores all the time.
12266 </p></dd>
12267 </dl>
12268
12269 <p>Default is <var>sc</var>.
12270 </p>
12271 </dd>
12272 <dt> &lsquo;<samp>combdbg</samp>&rsquo;</dt>
12273 <dd><p>Force <code>fieldmatch</code> to calculate the combed metrics for certain matches and
12274 print them. This setting is known as &lsquo;<samp>micout</samp>&rsquo; in TFM/VFM vocabulary.
12275 Available values are:
12276 </p>
12277 <dl compact="compact">
12278 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
12279 <dd><p>No forced calculation.
12280 </p></dd>
12281 <dt> &lsquo;<samp>pcn</samp>&rsquo;</dt>
12282 <dd><p>Force p/c/n calculations.
12283 </p></dd>
12284 <dt> &lsquo;<samp>pcnub</samp>&rsquo;</dt>
12285 <dd><p>Force p/c/n/u/b calculations.
12286 </p></dd>
12287 </dl>
12288
12289 <p>Default value is <var>none</var>.
12290 </p>
12291 </dd>
12292 <dt> &lsquo;<samp>cthresh</samp>&rsquo;</dt>
12293 <dd><p>This is the area combing threshold used for combed frame detection. This
12294 essentially controls how &quot;strong&quot; or &quot;visible&quot; combing must be to be detected.
12295 Larger values mean combing must be more visible and smaller values mean combing
12296 can be less visible or strong and still be detected. Valid settings are from
12297 <code>-1</code> (every pixel will be detected as combed) to <code>255</code> (no pixel will
12298 be detected as combed). This is basically a pixel difference value. A good
12299 range is <code>[8, 12]</code>.
12300 </p>
12301 <p>Default value is <code>9</code>.
12302 </p>
12303 </dd>
12304 <dt> &lsquo;<samp>chroma</samp>&rsquo;</dt>
12305 <dd><p>Sets whether or not chroma is considered in the combed frame decision.  Only
12306 disable this if your source has chroma problems (rainbowing, etc.) that are
12307 causing problems for the combed frame detection with chroma enabled. Actually,
12308 using &lsquo;<samp>chroma</samp>&rsquo;=<var>0</var> is usually more reliable, except for the case
12309 where there is chroma only combing in the source.
12310 </p>
12311 <p>Default value is <code>0</code>.
12312 </p>
12313 </dd>
12314 <dt> &lsquo;<samp>blockx</samp>&rsquo;</dt>
12315 <dt> &lsquo;<samp>blocky</samp>&rsquo;</dt>
12316 <dd><p>Respectively set the x-axis and y-axis size of the window used during combed
12317 frame detection. This has to do with the size of the area in which
12318 &lsquo;<samp>combpel</samp>&rsquo; pixels are required to be detected as combed for a frame to be
12319 declared combed. See the &lsquo;<samp>combpel</samp>&rsquo; parameter description for more info.
12320 Possible values are any number that is a power of 2 starting at 4 and going up
12321 to 512.
12322 </p>
12323 <p>Default value is <code>16</code>.
12324 </p>
12325 </dd>
12326 <dt> &lsquo;<samp>combpel</samp>&rsquo;</dt>
12327 <dd><p>The number of combed pixels inside any of the &lsquo;<samp>blocky</samp>&rsquo; by
12328 &lsquo;<samp>blockx</samp>&rsquo; size blocks on the frame for the frame to be detected as
12329 combed. While &lsquo;<samp>cthresh</samp>&rsquo; controls how &quot;visible&quot; the combing must be, this
12330 setting controls &quot;how much&quot; combing there must be in any localized area (a
12331 window defined by the &lsquo;<samp>blockx</samp>&rsquo; and &lsquo;<samp>blocky</samp>&rsquo; settings) on the
12332 frame. Minimum value is <code>0</code> and maximum is <code>blocky x blockx</code> (at
12333 which point no frames will ever be detected as combed). This setting is known
12334 as &lsquo;<samp>MI</samp>&rsquo; in TFM/VFM vocabulary.
12335 </p>
12336 <p>Default value is <code>80</code>.
12337 </p></dd>
12338 </dl>
12339
12340 <p><a name="p_002fc_002fn_002fu_002fb-meaning"></a>
12341 </p><a name="p_002fc_002fn_002fu_002fb-meaning-1"></a>
12342 <h3 class="subsection"><a href="ffplay-all.html#toc-p_002fc_002fn_002fu_002fb-meaning-1">28.29.1 p/c/n/u/b meaning</a></h3>
12343
12344 <a name="p_002fc_002fn"></a>
12345 <h4 class="subsubsection"><a href="ffplay-all.html#toc-p_002fc_002fn">28.29.1.1 p/c/n</a></h4>
12346
12347 <p>We assume the following telecined stream:
12348 </p>
12349 <table><tr><td>&nbsp;</td><td><pre class="example">Top fields:     1 2 2 3 4
12350 Bottom fields:  1 2 3 4 4
12351 </pre></td></tr></table>
12352
12353 <p>The numbers correspond to the progressive frame the fields relate to. Here, the
12354 first two frames are progressive, the 3rd and 4th are combed, and so on.
12355 </p>
12356 <p>When <code>fieldmatch</code> is configured to run a matching from bottom
12357 (&lsquo;<samp>field</samp>&rsquo;=<var>bottom</var>) this is how this input stream get transformed:
12358 </p>
12359 <table><tr><td>&nbsp;</td><td><pre class="example">Input stream:
12360                 T     1 2 2 3 4
12361                 B     1 2 3 4 4   &lt;-- matching reference
12362
12363 Matches:              c c n n c
12364
12365 Output stream:
12366                 T     1 2 3 4 4
12367                 B     1 2 3 4 4
12368 </pre></td></tr></table>
12369
12370 <p>As a result of the field matching, we can see that some frames get duplicated.
12371 To perform a complete inverse telecine, you need to rely on a decimation filter
12372 after this operation. See for instance the <a href="#decimate">decimate</a> filter.
12373 </p>
12374 <p>The same operation now matching from top fields (&lsquo;<samp>field</samp>&rsquo;=<var>top</var>)
12375 looks like this:
12376 </p>
12377 <table><tr><td>&nbsp;</td><td><pre class="example">Input stream:
12378                 T     1 2 2 3 4   &lt;-- matching reference
12379                 B     1 2 3 4 4
12380
12381 Matches:              c c p p c
12382
12383 Output stream:
12384                 T     1 2 2 3 4
12385                 B     1 2 2 3 4
12386 </pre></td></tr></table>
12387
12388 <p>In these examples, we can see what <var>p</var>, <var>c</var> and <var>n</var> mean;
12389 basically, they refer to the frame and field of the opposite parity:
12390 </p>
12391 <ul>
12392 <li> <var>p</var> matches the field of the opposite parity in the previous frame
12393 </li><li> <var>c</var> matches the field of the opposite parity in the current frame
12394 </li><li> <var>n</var> matches the field of the opposite parity in the next frame
12395 </li></ul>
12396
12397 <a name="u_002fb"></a>
12398 <h4 class="subsubsection"><a href="ffplay-all.html#toc-u_002fb">28.29.1.2 u/b</a></h4>
12399
12400 <p>The <var>u</var> and <var>b</var> matching are a bit special in the sense that they match
12401 from the opposite parity flag. In the following examples, we assume that we are
12402 currently matching the 2nd frame (Top:2, bottom:2). According to the match, a
12403 &rsquo;x&rsquo; is placed above and below each matched fields.
12404 </p>
12405 <p>With bottom matching (&lsquo;<samp>field</samp>&rsquo;=<var>bottom</var>):
12406 </p><table><tr><td>&nbsp;</td><td><pre class="example">Match:           c         p           n          b          u
12407
12408                  x       x               x        x          x
12409   Top          1 2 2     1 2 2       1 2 2      1 2 2      1 2 2
12410   Bottom       1 2 3     1 2 3       1 2 3      1 2 3      1 2 3
12411                  x         x           x        x              x
12412
12413 Output frames:
12414                  2          1          2          2          2
12415                  2          2          2          1          3
12416 </pre></td></tr></table>
12417
12418 <p>With top matching (&lsquo;<samp>field</samp>&rsquo;=<var>top</var>):
12419 </p><table><tr><td>&nbsp;</td><td><pre class="example">Match:           c         p           n          b          u
12420
12421                  x         x           x        x              x
12422   Top          1 2 2     1 2 2       1 2 2      1 2 2      1 2 2
12423   Bottom       1 2 3     1 2 3       1 2 3      1 2 3      1 2 3
12424                  x       x               x        x          x
12425
12426 Output frames:
12427                  2          2          2          1          2
12428                  2          1          3          2          2
12429 </pre></td></tr></table>
12430
12431 <a name="Examples-55"></a>
12432 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-55">28.29.2 Examples</a></h3>
12433
12434 <p>Simple IVTC of a top field first telecined stream:
12435 </p><table><tr><td>&nbsp;</td><td><pre class="example">fieldmatch=order=tff:combmatch=none, decimate
12436 </pre></td></tr></table>
12437
12438 <p>Advanced IVTC, with fallback on <a href="#yadif">yadif</a> for still combed frames:
12439 </p><table><tr><td>&nbsp;</td><td><pre class="example">fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
12440 </pre></td></tr></table>
12441
12442 <a name="fieldorder"></a>
12443 <h2 class="section"><a href="ffplay-all.html#toc-fieldorder">28.30 fieldorder</a></h2>
12444
12445 <p>Transform the field order of the input video.
12446 </p>
12447 <p>This filter accepts the following options:
12448 </p>
12449 <dl compact="compact">
12450 <dt> &lsquo;<samp>order</samp>&rsquo;</dt>
12451 <dd><p>Output field order. Valid values are <var>tff</var> for top field first or <var>bff</var>
12452 for bottom field first.
12453 </p></dd>
12454 </dl>
12455
12456 <p>Default value is &lsquo;<samp>tff</samp>&rsquo;.
12457 </p>
12458 <p>Transformation is achieved by shifting the picture content up or down
12459 by one line, and filling the remaining line with appropriate picture content.
12460 This method is consistent with most broadcast field order converters.
12461 </p>
12462 <p>If the input video is not flagged as being interlaced, or it is already
12463 flagged as being of the required output field order then this filter does
12464 not alter the incoming video.
12465 </p>
12466 <p>This filter is very useful when converting to or from PAL DV material,
12467 which is bottom field first.
12468 </p>
12469 <p>For example:
12470 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.vob -vf &quot;fieldorder=bff&quot; out.dv
12471 </pre></td></tr></table>
12472
12473 <a name="fifo"></a>
12474 <h2 class="section"><a href="ffplay-all.html#toc-fifo">28.31 fifo</a></h2>
12475
12476 <p>Buffer input images and send them when they are requested.
12477 </p>
12478 <p>This filter is mainly useful when auto-inserted by the libavfilter
12479 framework.
12480 </p>
12481 <p>The filter does not take parameters.
12482 </p>
12483 <p><a name="format"></a>
12484 </p><a name="format-1"></a>
12485 <h2 class="section"><a href="ffplay-all.html#toc-format-1">28.32 format</a></h2>
12486
12487 <p>Convert the input video to one of the specified pixel formats.
12488 Libavfilter will try to pick one that is supported for the input to
12489 the next filter.
12490 </p>
12491 <p>This filter accepts the following parameters:
12492 </p><dl compact="compact">
12493 <dt> &lsquo;<samp>pix_fmts</samp>&rsquo;</dt>
12494 <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, for example
12495 &quot;pix_fmts=yuv420p|monow|rgb24&quot;.
12496 </p>
12497 </dd>
12498 </dl>
12499
12500 <a name="Examples-17"></a>
12501 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-17">28.32.1 Examples</a></h3>
12502
12503 <ul>
12504 <li>
12505 Convert the input video to the format <var>yuv420p</var>
12506 <table><tr><td>&nbsp;</td><td><pre class="example">format=pix_fmts=yuv420p
12507 </pre></td></tr></table>
12508
12509 <p>Convert the input video to any of the formats in the list
12510 </p><table><tr><td>&nbsp;</td><td><pre class="example">format=pix_fmts=yuv420p|yuv444p|yuv410p
12511 </pre></td></tr></table>
12512 </li></ul>
12513
12514 <p><a name="fps"></a>
12515 </p><a name="fps-1"></a>
12516 <h2 class="section"><a href="ffplay-all.html#toc-fps-1">28.33 fps</a></h2>
12517
12518 <p>Convert the video to specified constant frame rate by duplicating or dropping
12519 frames as necessary.
12520 </p>
12521 <p>This filter accepts the following named parameters:
12522 </p><dl compact="compact">
12523 <dt> &lsquo;<samp>fps</samp>&rsquo;</dt>
12524 <dd><p>Desired output frame rate. The default is <code>25</code>.
12525 </p>
12526 </dd>
12527 <dt> &lsquo;<samp>round</samp>&rsquo;</dt>
12528 <dd><p>Rounding method.
12529 </p>
12530 <p>Possible values are:
12531 </p><dl compact="compact">
12532 <dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
12533 <dd><p>zero round towards 0
12534 </p></dd>
12535 <dt> &lsquo;<samp>inf</samp>&rsquo;</dt>
12536 <dd><p>round away from 0
12537 </p></dd>
12538 <dt> &lsquo;<samp>down</samp>&rsquo;</dt>
12539 <dd><p>round towards -infinity
12540 </p></dd>
12541 <dt> &lsquo;<samp>up</samp>&rsquo;</dt>
12542 <dd><p>round towards +infinity
12543 </p></dd>
12544 <dt> &lsquo;<samp>near</samp>&rsquo;</dt>
12545 <dd><p>round to nearest
12546 </p></dd>
12547 </dl>
12548 <p>The default is <code>near</code>.
12549 </p>
12550 </dd>
12551 <dt> &lsquo;<samp>start_time</samp>&rsquo;</dt>
12552 <dd><p>Assume the first PTS should be the given value, in seconds. This allows for
12553 padding/trimming at the start of stream. By default, no assumption is made
12554 about the first frame&rsquo;s expected PTS, so no padding or trimming is done.
12555 For example, this could be set to 0 to pad the beginning with duplicates of
12556 the first frame if a video stream starts after the audio stream or to trim any
12557 frames with a negative PTS.
12558 </p>
12559 </dd>
12560 </dl>
12561
12562 <p>Alternatively, the options can be specified as a flat string:
12563 <var>fps</var>[:<var>round</var>].
12564 </p>
12565 <p>See also the <a href="#setpts">setpts</a> filter.
12566 </p>
12567 <a name="Examples-60"></a>
12568 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-60">28.33.1 Examples</a></h3>
12569
12570 <ul>
12571 <li>
12572 A typical usage in order to set the fps to 25:
12573 <table><tr><td>&nbsp;</td><td><pre class="example">fps=fps=25
12574 </pre></td></tr></table>
12575
12576 </li><li>
12577 Sets the fps to 24, using abbreviation and rounding method to round to nearest:
12578 <table><tr><td>&nbsp;</td><td><pre class="example">fps=fps=film:round=near
12579 </pre></td></tr></table>
12580 </li></ul>
12581
12582 <a name="framepack"></a>
12583 <h2 class="section"><a href="ffplay-all.html#toc-framepack">28.34 framepack</a></h2>
12584
12585 <p>Pack two different video streams into a stereoscopic video, setting proper
12586 metadata on supported codecs. The two views should have the same size and
12587 framerate and processing will stop when the shorter video ends. Please note
12588 that you may conveniently adjust view properties with the <a href="#scale">scale</a> and
12589 <a href="#fps">fps</a> filters.
12590 </p>
12591 <p>This filter accepts the following named parameters:
12592 </p><dl compact="compact">
12593 <dt> &lsquo;<samp>format</samp>&rsquo;</dt>
12594 <dd><p>Desired packing format. Supported values are:
12595 </p>
12596 <dl compact="compact">
12597 <dt> &lsquo;<samp>sbs</samp>&rsquo;</dt>
12598 <dd><p>Views are next to each other (default).
12599 </p>
12600 </dd>
12601 <dt> &lsquo;<samp>tab</samp>&rsquo;</dt>
12602 <dd><p>Views are on top of each other.
12603 </p>
12604 </dd>
12605 <dt> &lsquo;<samp>lines</samp>&rsquo;</dt>
12606 <dd><p>Views are packed by line.
12607 </p>
12608 </dd>
12609 <dt> &lsquo;<samp>columns</samp>&rsquo;</dt>
12610 <dd><p>Views are eacked by column.
12611 </p>
12612 </dd>
12613 <dt> &lsquo;<samp>frameseq</samp>&rsquo;</dt>
12614 <dd><p>Views are temporally interleaved.
12615 </p>
12616 </dd>
12617 </dl>
12618
12619 </dd>
12620 </dl>
12621
12622 <p>Some examples follow:
12623 </p>
12624 <table><tr><td>&nbsp;</td><td><pre class="example"># Convert left and right views into a frame sequential video.
12625 ffmpeg -i LEFT -i RIGHT -filter_complex framepack=frameseq OUTPUT
12626
12627 # Convert views into a side-by-side video with the same output resolution as the input.
12628 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
12629 </pre></td></tr></table>
12630
12631 <a name="framestep"></a>
12632 <h2 class="section"><a href="ffplay-all.html#toc-framestep">28.35 framestep</a></h2>
12633
12634 <p>Select one frame every N-th frame.
12635 </p>
12636 <p>This filter accepts the following option:
12637 </p><dl compact="compact">
12638 <dt> &lsquo;<samp>step</samp>&rsquo;</dt>
12639 <dd><p>Select frame after every <code>step</code> frames.
12640 Allowed values are positive integers higher than 0. Default value is <code>1</code>.
12641 </p></dd>
12642 </dl>
12643
12644 <p><a name="frei0r"></a>
12645 </p><a name="frei0r-1"></a>
12646 <h2 class="section"><a href="ffplay-all.html#toc-frei0r-1">28.36 frei0r</a></h2>
12647
12648 <p>Apply a frei0r effect to the input video.
12649 </p>
12650 <p>To enable compilation of this filter you need to install the frei0r
12651 header and configure FFmpeg with <code>--enable-frei0r</code>.
12652 </p>
12653 <p>This filter accepts the following options:
12654 </p>
12655 <dl compact="compact">
12656 <dt> &lsquo;<samp>filter_name</samp>&rsquo;</dt>
12657 <dd><p>The name to the frei0r effect to load. If the environment variable
12658 <code>FREI0R_PATH</code> is defined, the frei0r effect is searched in each one of the
12659 directories specified by the colon separated list in <code>FREIOR_PATH</code>,
12660 otherwise in the standard frei0r paths, which are in this order:
12661 &lsquo;<tt>HOME/.frei0r-1/lib/</tt>&rsquo;, &lsquo;<tt>/usr/local/lib/frei0r-1/</tt>&rsquo;,
12662 &lsquo;<tt>/usr/lib/frei0r-1/</tt>&rsquo;.
12663 </p>
12664 </dd>
12665 <dt> &lsquo;<samp>filter_params</samp>&rsquo;</dt>
12666 <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r effect.
12667 </p>
12668 </dd>
12669 </dl>
12670
12671 <p>A frei0r effect parameter can be a boolean (whose values are specified
12672 with &quot;y&quot; and &quot;n&quot;), a double, a color (specified by the syntax
12673 <var>R</var>/<var>G</var>/<var>B</var>, (<var>R</var>, <var>G</var>, and <var>B</var> being float
12674 numbers from 0.0 to 1.0) or by a color description specified in the &quot;Color&quot;
12675 section in the ffmpeg-utils manual), a position (specified by the syntax <var>X</var>/<var>Y</var>,
12676 <var>X</var> and <var>Y</var> being float numbers) and a string.
12677 </p>
12678 <p>The number and kind of parameters depend on the loaded effect. If an
12679 effect parameter is not specified the default value is set.
12680 </p>
12681 <a name="Examples-1"></a>
12682 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-1">28.36.1 Examples</a></h3>
12683
12684 <ul>
12685 <li>
12686 Apply the distort0r effect, set the first two double parameters:
12687 <table><tr><td>&nbsp;</td><td><pre class="example">frei0r=filter_name=distort0r:filter_params=0.5|0.01
12688 </pre></td></tr></table>
12689
12690 </li><li>
12691 Apply the colordistance effect, take a color as first parameter:
12692 <table><tr><td>&nbsp;</td><td><pre class="example">frei0r=colordistance:0.2/0.3/0.4
12693 frei0r=colordistance:violet
12694 frei0r=colordistance:0x112233
12695 </pre></td></tr></table>
12696
12697 </li><li>
12698 Apply the perspective effect, specify the top left and top right image
12699 positions:
12700 <table><tr><td>&nbsp;</td><td><pre class="example">frei0r=perspective:0.2/0.2|0.8/0.2
12701 </pre></td></tr></table>
12702 </li></ul>
12703
12704 <p>For more information see:
12705 <a href="http://frei0r.dyne.org">http://frei0r.dyne.org</a>
12706 </p>
12707 <a name="geq"></a>
12708 <h2 class="section"><a href="ffplay-all.html#toc-geq">28.37 geq</a></h2>
12709
12710 <p>The filter accepts the following options:
12711 </p>
12712 <dl compact="compact">
12713 <dt> &lsquo;<samp>lum_expr, lum</samp>&rsquo;</dt>
12714 <dd><p>Set the luminance expression.
12715 </p></dd>
12716 <dt> &lsquo;<samp>cb_expr, cb</samp>&rsquo;</dt>
12717 <dd><p>Set the chrominance blue expression.
12718 </p></dd>
12719 <dt> &lsquo;<samp>cr_expr, cr</samp>&rsquo;</dt>
12720 <dd><p>Set the chrominance red expression.
12721 </p></dd>
12722 <dt> &lsquo;<samp>alpha_expr, a</samp>&rsquo;</dt>
12723 <dd><p>Set the alpha expression.
12724 </p></dd>
12725 <dt> &lsquo;<samp>red_expr, r</samp>&rsquo;</dt>
12726 <dd><p>Set the red expression.
12727 </p></dd>
12728 <dt> &lsquo;<samp>green_expr, g</samp>&rsquo;</dt>
12729 <dd><p>Set the green expression.
12730 </p></dd>
12731 <dt> &lsquo;<samp>blue_expr, b</samp>&rsquo;</dt>
12732 <dd><p>Set the blue expression.
12733 </p></dd>
12734 </dl>
12735
12736 <p>The colorspace is selected according to the specified options. If one
12737 of the &lsquo;<samp>lum_expr</samp>&rsquo;, &lsquo;<samp>cb_expr</samp>&rsquo;, or &lsquo;<samp>cr_expr</samp>&rsquo;
12738 options is specified, the filter will automatically select a YCbCr
12739 colorspace. If one of the &lsquo;<samp>red_expr</samp>&rsquo;, &lsquo;<samp>green_expr</samp>&rsquo;, or
12740 &lsquo;<samp>blue_expr</samp>&rsquo; options is specified, it will select an RGB
12741 colorspace.
12742 </p>
12743 <p>If one of the chrominance expression is not defined, it falls back on the other
12744 one. If no alpha expression is specified it will evaluate to opaque value.
12745 If none of chrominance expressions are specified, they will evaluate
12746 to the luminance expression.
12747 </p>
12748 <p>The expressions can use the following variables and functions:
12749 </p>
12750 <dl compact="compact">
12751 <dt> &lsquo;<samp>N</samp>&rsquo;</dt>
12752 <dd><p>The sequential number of the filtered frame, starting from <code>0</code>.
12753 </p>
12754 </dd>
12755 <dt> &lsquo;<samp>X</samp>&rsquo;</dt>
12756 <dt> &lsquo;<samp>Y</samp>&rsquo;</dt>
12757 <dd><p>The coordinates of the current sample.
12758 </p>
12759 </dd>
12760 <dt> &lsquo;<samp>W</samp>&rsquo;</dt>
12761 <dt> &lsquo;<samp>H</samp>&rsquo;</dt>
12762 <dd><p>The width and height of the image.
12763 </p>
12764 </dd>
12765 <dt> &lsquo;<samp>SW</samp>&rsquo;</dt>
12766 <dt> &lsquo;<samp>SH</samp>&rsquo;</dt>
12767 <dd><p>Width and height scale depending on the currently filtered plane. It is the
12768 ratio between the corresponding luma plane number of pixels and the current
12769 plane ones. E.g. for YUV4:2:0 the values are <code>1,1</code> for the luma plane, and
12770 <code>0.5,0.5</code> for chroma planes.
12771 </p>
12772 </dd>
12773 <dt> &lsquo;<samp>T</samp>&rsquo;</dt>
12774 <dd><p>Time of the current frame, expressed in seconds.
12775 </p>
12776 </dd>
12777 <dt> &lsquo;<samp>p(x, y)</samp>&rsquo;</dt>
12778 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the current
12779 plane.
12780 </p>
12781 </dd>
12782 <dt> &lsquo;<samp>lum(x, y)</samp>&rsquo;</dt>
12783 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the luminance
12784 plane.
12785 </p>
12786 </dd>
12787 <dt> &lsquo;<samp>cb(x, y)</samp>&rsquo;</dt>
12788 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
12789 blue-difference chroma plane. Return 0 if there is no such plane.
12790 </p>
12791 </dd>
12792 <dt> &lsquo;<samp>cr(x, y)</samp>&rsquo;</dt>
12793 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
12794 red-difference chroma plane. Return 0 if there is no such plane.
12795 </p>
12796 </dd>
12797 <dt> &lsquo;<samp>r(x, y)</samp>&rsquo;</dt>
12798 <dt> &lsquo;<samp>g(x, y)</samp>&rsquo;</dt>
12799 <dt> &lsquo;<samp>b(x, y)</samp>&rsquo;</dt>
12800 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
12801 red/green/blue component. Return 0 if there is no such component.
12802 </p>
12803 </dd>
12804 <dt> &lsquo;<samp>alpha(x, y)</samp>&rsquo;</dt>
12805 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the alpha
12806 plane. Return 0 if there is no such plane.
12807 </p></dd>
12808 </dl>
12809
12810 <p>For functions, if <var>x</var> and <var>y</var> are outside the area, the value will be
12811 automatically clipped to the closer edge.
12812 </p>
12813 <a name="Examples-82"></a>
12814 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-82">28.37.1 Examples</a></h3>
12815
12816 <ul>
12817 <li>
12818 Flip the image horizontally:
12819 <table><tr><td>&nbsp;</td><td><pre class="example">geq=p(W-X\,Y)
12820 </pre></td></tr></table>
12821
12822 </li><li>
12823 Generate a bidimensional sine wave, with angle <code>PI/3</code> and a
12824 wavelength of 100 pixels:
12825 <table><tr><td>&nbsp;</td><td><pre class="example">geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X-50*T) + sin(PI/3)*Y)):128:128
12826 </pre></td></tr></table>
12827
12828 </li><li>
12829 Generate a fancy enigmatic moving light:
12830 <table><tr><td>&nbsp;</td><td><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
12831 </pre></td></tr></table>
12832
12833 </li><li>
12834 Generate a quick emboss effect:
12835 <table><tr><td>&nbsp;</td><td><pre class="example">format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'
12836 </pre></td></tr></table>
12837
12838 </li><li>
12839 Modify RGB components depending on pixel position:
12840 <table><tr><td>&nbsp;</td><td><pre class="example">geq=r='X/W*r(X,Y)':g='(1-X/W)*g(X,Y)':b='(H-Y)/H*b(X,Y)'
12841 </pre></td></tr></table>
12842 </li></ul>
12843
12844 <a name="gradfun"></a>
12845 <h2 class="section"><a href="ffplay-all.html#toc-gradfun">28.38 gradfun</a></h2>
12846
12847 <p>Fix the banding artifacts that are sometimes introduced into nearly flat
12848 regions by truncation to 8bit color depth.
12849 Interpolate the gradients that should go where the bands are, and
12850 dither them.
12851 </p>
12852 <p>This filter is designed for playback only.  Do not use it prior to
12853 lossy compression, because compression tends to lose the dither and
12854 bring back the bands.
12855 </p>
12856 <p>This filter accepts the following options:
12857 </p>
12858 <dl compact="compact">
12859 <dt> &lsquo;<samp>strength</samp>&rsquo;</dt>
12860 <dd><p>The maximum amount by which the filter will change any one pixel. Also the
12861 threshold for detecting nearly flat regions. Acceptable values range from .51 to
12862 64, default value is 1.2, out-of-range values will be clipped to the valid
12863 range.
12864 </p>
12865 </dd>
12866 <dt> &lsquo;<samp>radius</samp>&rsquo;</dt>
12867 <dd><p>The neighborhood to fit the gradient to. A larger radius makes for smoother
12868 gradients, but also prevents the filter from modifying the pixels near detailed
12869 regions. Acceptable values are 8-32, default value is 16, out-of-range values
12870 will be clipped to the valid range.
12871 </p>
12872 </dd>
12873 </dl>
12874
12875 <p>Alternatively, the options can be specified as a flat string:
12876 <var>strength</var>[:<var>radius</var>]
12877 </p>
12878 <a name="Examples"></a>
12879 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples">28.38.1 Examples</a></h3>
12880
12881 <ul>
12882 <li>
12883 Apply the filter with a <code>3.5</code> strength and radius of <code>8</code>:
12884 <table><tr><td>&nbsp;</td><td><pre class="example">gradfun=3.5:8
12885 </pre></td></tr></table>
12886
12887 </li><li>
12888 Specify radius, omitting the strength (which will fall-back to the default
12889 value):
12890 <table><tr><td>&nbsp;</td><td><pre class="example">gradfun=radius=8
12891 </pre></td></tr></table>
12892
12893 </li></ul>
12894
12895 <p><a name="haldclut"></a>
12896 </p><a name="haldclut-1"></a>
12897 <h2 class="section"><a href="ffplay-all.html#toc-haldclut-1">28.39 haldclut</a></h2>
12898
12899 <p>Apply a Hald CLUT to a video stream.
12900 </p>
12901 <p>First input is the video stream to process, and second one is the Hald CLUT.
12902 The Hald CLUT input can be a simple picture or a complete video stream.
12903 </p>
12904 <p>The filter accepts the following options:
12905 </p>
12906 <dl compact="compact">
12907 <dt> &lsquo;<samp>shortest</samp>&rsquo;</dt>
12908 <dd><p>Force termination when the shortest input terminates. Default is <code>0</code>.
12909 </p></dd>
12910 <dt> &lsquo;<samp>repeatlast</samp>&rsquo;</dt>
12911 <dd><p>Continue applying the last CLUT after the end of the stream. A value of
12912 <code>0</code> disable the filter after the last frame of the CLUT is reached.
12913 Default is <code>1</code>.
12914 </p></dd>
12915 </dl>
12916
12917 <p><code>haldclut</code> also has the same interpolation options as <a href="#lut3d">lut3d</a> (both
12918 filters share the same internals).
12919 </p>
12920 <p>More information about the Hald CLUT can be found on Eskil Steenberg&rsquo;s website
12921 (Hald CLUT author) at <a href="http://www.quelsolaar.com/technology/clut.html">http://www.quelsolaar.com/technology/clut.html</a>.
12922 </p>
12923 <a name="Workflow-examples"></a>
12924 <h3 class="subsection"><a href="ffplay-all.html#toc-Workflow-examples">28.39.1 Workflow examples</a></h3>
12925
12926 <a name="Hald-CLUT-video-stream"></a>
12927 <h4 class="subsubsection"><a href="ffplay-all.html#toc-Hald-CLUT-video-stream">28.39.1.1 Hald CLUT video stream</a></h4>
12928
12929 <p>Generate an identity Hald CLUT stream altered with various effects:
12930 </p><table><tr><td>&nbsp;</td><td><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
12931 </pre></td></tr></table>
12932
12933 <p>Note: make sure you use a lossless codec.
12934 </p>
12935 <p>Then use it with <code>haldclut</code> to apply it on some random stream:
12936 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f lavfi -i mandelbrot -i clut.nut -filter_complex '[0][1] haldclut' -t 20 mandelclut.mkv
12937 </pre></td></tr></table>
12938
12939 <p>The Hald CLUT will be applied to the 10 first seconds (duration of
12940 &lsquo;<tt>clut.nut</tt>&rsquo;), then the latest picture of that CLUT stream will be applied
12941 to the remaining frames of the <code>mandelbrot</code> stream.
12942 </p>
12943 <a name="Hald-CLUT-with-preview"></a>
12944 <h4 class="subsubsection"><a href="ffplay-all.html#toc-Hald-CLUT-with-preview">28.39.1.2 Hald CLUT with preview</a></h4>
12945
12946 <p>A Hald CLUT is supposed to be a squared image of <code>Level*Level*Level</code> by
12947 <code>Level*Level*Level</code> pixels. For a given Hald CLUT, FFmpeg will select the
12948 biggest possible square starting at the top left of the picture. The remaining
12949 padding pixels (bottom or right) will be ignored. This area can be used to add
12950 a preview of the Hald CLUT.
12951 </p>
12952 <p>Typically, the following generated Hald CLUT will be supported by the
12953 <code>haldclut</code> filter:
12954 </p>
12955 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f lavfi -i <a href="#haldclutsrc">haldclutsrc</a>=8 -vf &quot;
12956    pad=iw+320 [padded_clut];
12957    smptebars=s=320x256, split [a][b];
12958    [padded_clut][a] overlay=W-320:h, curves=color_negative [main];
12959    [main][b] overlay=W-320&quot; -frames:v 1 clut.png
12960 </pre></td></tr></table>
12961
12962 <p>It contains the original and a preview of the effect of the CLUT: SMPTE color
12963 bars are displayed on the right-top, and below the same color bars processed by
12964 the color changes.
12965 </p>
12966 <p>Then, the effect of this Hald CLUT can be visualized with:
12967 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay input.mkv -vf &quot;movie=clut.png, [in] haldclut&quot;
12968 </pre></td></tr></table>
12969
12970 <a name="hflip"></a>
12971 <h2 class="section"><a href="ffplay-all.html#toc-hflip">28.40 hflip</a></h2>
12972
12973 <p>Flip the input video horizontally.
12974 </p>
12975 <p>For example to horizontally flip the input video with <code>ffmpeg</code>:
12976 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -vf &quot;hflip&quot; out.avi
12977 </pre></td></tr></table>
12978
12979 <a name="histeq"></a>
12980 <h2 class="section"><a href="ffplay-all.html#toc-histeq">28.41 histeq</a></h2>
12981 <p>This filter applies a global color histogram equalization on a
12982 per-frame basis.
12983 </p>
12984 <p>It can be used to correct video that has a compressed range of pixel
12985 intensities.  The filter redistributes the pixel intensities to
12986 equalize their distribution across the intensity range. It may be
12987 viewed as an &quot;automatically adjusting contrast filter&quot;. This filter is
12988 useful only for correcting degraded or poorly captured source
12989 video.
12990 </p>
12991 <p>The filter accepts the following options:
12992 </p>
12993 <dl compact="compact">
12994 <dt> &lsquo;<samp>strength</samp>&rsquo;</dt>
12995 <dd><p>Determine the amount of equalization to be applied.  As the strength
12996 is reduced, the distribution of pixel intensities more-and-more
12997 approaches that of the input frame. The value must be a float number
12998 in the range [0,1] and defaults to 0.200.
12999 </p>
13000 </dd>
13001 <dt> &lsquo;<samp>intensity</samp>&rsquo;</dt>
13002 <dd><p>Set the maximum intensity that can generated and scale the output
13003 values appropriately.  The strength should be set as desired and then
13004 the intensity can be limited if needed to avoid washing-out. The value
13005 must be a float number in the range [0,1] and defaults to 0.210.
13006 </p>
13007 </dd>
13008 <dt> &lsquo;<samp>antibanding</samp>&rsquo;</dt>
13009 <dd><p>Set the antibanding level. If enabled the filter will randomly vary
13010 the luminance of output pixels by a small amount to avoid banding of
13011 the histogram. Possible values are <code>none</code>, <code>weak</code> or
13012 <code>strong</code>. It defaults to <code>none</code>.
13013 </p></dd>
13014 </dl>
13015
13016 <a name="histogram"></a>
13017 <h2 class="section"><a href="ffplay-all.html#toc-histogram">28.42 histogram</a></h2>
13018
13019 <p>Compute and draw a color distribution histogram for the input video.
13020 </p>
13021 <p>The computed histogram is a representation of the color component
13022 distribution in an image.
13023 </p>
13024 <p>The filter accepts the following options:
13025 </p>
13026 <dl compact="compact">
13027 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
13028 <dd><p>Set histogram mode.
13029 </p>
13030 <p>It accepts the following values:
13031 </p><dl compact="compact">
13032 <dt> &lsquo;<samp>levels</samp>&rsquo;</dt>
13033 <dd><p>Standard histogram that displays the color components distribution in an
13034 image. Displays color graph for each color component. Shows distribution of
13035 the Y, U, V, A or R, G, B components, depending on input format, in the
13036 current frame. Below each graph a color component scale meter is shown.
13037 </p>
13038 </dd>
13039 <dt> &lsquo;<samp>color</samp>&rsquo;</dt>
13040 <dd><p>Displays chroma values (U/V color placement) in a two dimensional
13041 graph (which is called a vectorscope). The brighter a pixel in the
13042 vectorscope, the more pixels of the input frame correspond to that pixel
13043 (i.e., more pixels have this chroma value). The V component is displayed on
13044 the horizontal (X) axis, with the leftmost side being V = 0 and the rightmost
13045 side being V = 255. The U component is displayed on the vertical (Y) axis,
13046 with the top representing U = 0 and the bottom representing U = 255.
13047 </p>
13048 <p>The position of a white pixel in the graph corresponds to the chroma value of
13049 a pixel of the input clip. The graph can therefore be used to read the hue
13050 (color flavor) and the saturation (the dominance of the hue in the color). As
13051 the hue of a color changes, it moves around the square. At the center of the
13052 square the saturation is zero, which means that the corresponding pixel has no
13053 color. If the amount of a specific color is increased (while leaving the other
13054 colors unchanged) the saturation increases, and the indicator moves towards
13055 the edge of the square.
13056 </p>
13057 </dd>
13058 <dt> &lsquo;<samp>color2</samp>&rsquo;</dt>
13059 <dd><p>Chroma values in vectorscope, similar as <code>color</code> but actual chroma values
13060 are displayed.
13061 </p>
13062 </dd>
13063 <dt> &lsquo;<samp>waveform</samp>&rsquo;</dt>
13064 <dd><p>Per row/column color component graph. In row mode, the graph on the left side
13065 represents color component value 0 and the right side represents value = 255.
13066 In column mode, the top side represents color component value = 0 and bottom
13067 side represents value = 255.
13068 </p></dd>
13069 </dl>
13070 <p>Default value is <code>levels</code>.
13071 </p>
13072 </dd>
13073 <dt> &lsquo;<samp>level_height</samp>&rsquo;</dt>
13074 <dd><p>Set height of level in <code>levels</code>. Default value is <code>200</code>.
13075 Allowed range is [50, 2048].
13076 </p>
13077 </dd>
13078 <dt> &lsquo;<samp>scale_height</samp>&rsquo;</dt>
13079 <dd><p>Set height of color scale in <code>levels</code>. Default value is <code>12</code>.
13080 Allowed range is [0, 40].
13081 </p>
13082 </dd>
13083 <dt> &lsquo;<samp>step</samp>&rsquo;</dt>
13084 <dd><p>Set step for <code>waveform</code> mode. Smaller values are useful to find out how
13085 many values of the same luminance are distributed across input rows/columns.
13086 Default value is <code>10</code>. Allowed range is [1, 255].
13087 </p>
13088 </dd>
13089 <dt> &lsquo;<samp>waveform_mode</samp>&rsquo;</dt>
13090 <dd><p>Set mode for <code>waveform</code>. Can be either <code>row</code>, or <code>column</code>.
13091 Default is <code>row</code>.
13092 </p>
13093 </dd>
13094 <dt> &lsquo;<samp>waveform_mirror</samp>&rsquo;</dt>
13095 <dd><p>Set mirroring mode for <code>waveform</code>. <code>0</code> means unmirrored, <code>1</code>
13096 means mirrored. In mirrored mode, higher values will be represented on the left
13097 side for <code>row</code> mode and at the top for <code>column</code> mode. Default is
13098 <code>0</code> (unmirrored).
13099 </p>
13100 </dd>
13101 <dt> &lsquo;<samp>display_mode</samp>&rsquo;</dt>
13102 <dd><p>Set display mode for <code>waveform</code> and <code>levels</code>.
13103 It accepts the following values:
13104 </p><dl compact="compact">
13105 <dt> &lsquo;<samp>parade</samp>&rsquo;</dt>
13106 <dd><p>Display separate graph for the color components side by side in
13107 <code>row</code> waveform mode or one below the other in <code>column</code> waveform mode
13108 for <code>waveform</code> histogram mode. For <code>levels</code> histogram mode,
13109 per color component graphs are placed below each other.
13110 </p>
13111 <p>Using this display mode in <code>waveform</code> histogram mode makes it easy to
13112 spot color casts in the highlights and shadows of an image, by comparing the
13113 contours of the top and the bottom graphs of each waveform. Since whites,
13114 grays, and blacks are characterized by exactly equal amounts of red, green,
13115 and blue, neutral areas of the picture should display three waveforms of
13116 roughly equal width/height. If not, the correction is easy to perform by
13117 making level adjustments the three waveforms.
13118 </p>
13119 </dd>
13120 <dt> &lsquo;<samp>overlay</samp>&rsquo;</dt>
13121 <dd><p>Presents information identical to that in the <code>parade</code>, except
13122 that the graphs representing color components are superimposed directly
13123 over one another.
13124 </p>
13125 <p>This display mode in <code>waveform</code> histogram mode makes it easier to spot
13126 relative differences or similarities in overlapping areas of the color
13127 components that are supposed to be identical, such as neutral whites, grays,
13128 or blacks.
13129 </p></dd>
13130 </dl>
13131 <p>Default is <code>parade</code>.
13132 </p>
13133 </dd>
13134 <dt> &lsquo;<samp>levels_mode</samp>&rsquo;</dt>
13135 <dd><p>Set mode for <code>levels</code>. Can be either <code>linear</code>, or <code>logarithmic</code>.
13136 Default is <code>linear</code>.
13137 </p></dd>
13138 </dl>
13139
13140 <a name="Examples-74"></a>
13141 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-74">28.42.1 Examples</a></h3>
13142
13143 <ul>
13144 <li>
13145 Calculate and draw histogram:
13146 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -i input -vf histogram
13147 </pre></td></tr></table>
13148
13149 </li></ul>
13150
13151 <p><a name="hqdn3d"></a>
13152 </p><a name="hqdn3d-1"></a>
13153 <h2 class="section"><a href="ffplay-all.html#toc-hqdn3d-1">28.43 hqdn3d</a></h2>
13154
13155 <p>High precision/quality 3d denoise filter. This filter aims to reduce
13156 image noise producing smooth images and making still images really
13157 still. It should enhance compressibility.
13158 </p>
13159 <p>It accepts the following optional parameters:
13160 </p>
13161 <dl compact="compact">
13162 <dt> &lsquo;<samp>luma_spatial</samp>&rsquo;</dt>
13163 <dd><p>a non-negative float number which specifies spatial luma strength,
13164 defaults to 4.0
13165 </p>
13166 </dd>
13167 <dt> &lsquo;<samp>chroma_spatial</samp>&rsquo;</dt>
13168 <dd><p>a non-negative float number which specifies spatial chroma strength,
13169 defaults to 3.0*<var>luma_spatial</var>/4.0
13170 </p>
13171 </dd>
13172 <dt> &lsquo;<samp>luma_tmp</samp>&rsquo;</dt>
13173 <dd><p>a float number which specifies luma temporal strength, defaults to
13174 6.0*<var>luma_spatial</var>/4.0
13175 </p>
13176 </dd>
13177 <dt> &lsquo;<samp>chroma_tmp</samp>&rsquo;</dt>
13178 <dd><p>a float number which specifies chroma temporal strength, defaults to
13179 <var>luma_tmp</var>*<var>chroma_spatial</var>/<var>luma_spatial</var>
13180 </p></dd>
13181 </dl>
13182
13183 <a name="hue"></a>
13184 <h2 class="section"><a href="ffplay-all.html#toc-hue">28.44 hue</a></h2>
13185
13186 <p>Modify the hue and/or the saturation of the input.
13187 </p>
13188 <p>This filter accepts the following options:
13189 </p>
13190 <dl compact="compact">
13191 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
13192 <dd><p>Specify the hue angle as a number of degrees. It accepts an expression,
13193 and defaults to &quot;0&quot;.
13194 </p>
13195 </dd>
13196 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
13197 <dd><p>Specify the saturation in the [-10,10] range. It accepts an expression and
13198 defaults to &quot;1&quot;.
13199 </p>
13200 </dd>
13201 <dt> &lsquo;<samp>H</samp>&rsquo;</dt>
13202 <dd><p>Specify the hue angle as a number of radians. It accepts an
13203 expression, and defaults to &quot;0&quot;.
13204 </p>
13205 </dd>
13206 <dt> &lsquo;<samp>b</samp>&rsquo;</dt>
13207 <dd><p>Specify the brightness in the [-10,10] range. It accepts an expression and
13208 defaults to &quot;0&quot;.
13209 </p></dd>
13210 </dl>
13211
13212 <p>&lsquo;<samp>h</samp>&rsquo; and &lsquo;<samp>H</samp>&rsquo; are mutually exclusive, and can&rsquo;t be
13213 specified at the same time.
13214 </p>
13215 <p>The &lsquo;<samp>b</samp>&rsquo;, &lsquo;<samp>h</samp>&rsquo;, &lsquo;<samp>H</samp>&rsquo; and &lsquo;<samp>s</samp>&rsquo; option values are
13216 expressions containing the following constants:
13217 </p>
13218 <dl compact="compact">
13219 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
13220 <dd><p>frame count of the input frame starting from 0
13221 </p>
13222 </dd>
13223 <dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
13224 <dd><p>presentation timestamp of the input frame expressed in time base units
13225 </p>
13226 </dd>
13227 <dt> &lsquo;<samp>r</samp>&rsquo;</dt>
13228 <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
13229 </p>
13230 </dd>
13231 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
13232 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
13233 </p>
13234 </dd>
13235 <dt> &lsquo;<samp>tb</samp>&rsquo;</dt>
13236 <dd><p>time base of the input video
13237 </p></dd>
13238 </dl>
13239
13240 <a name="Examples-39"></a>
13241 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-39">28.44.1 Examples</a></h3>
13242
13243 <ul>
13244 <li>
13245 Set the hue to 90 degrees and the saturation to 1.0:
13246 <table><tr><td>&nbsp;</td><td><pre class="example">hue=h=90:s=1
13247 </pre></td></tr></table>
13248
13249 </li><li>
13250 Same command but expressing the hue in radians:
13251 <table><tr><td>&nbsp;</td><td><pre class="example">hue=H=PI/2:s=1
13252 </pre></td></tr></table>
13253
13254 </li><li>
13255 Rotate hue and make the saturation swing between 0
13256 and 2 over a period of 1 second:
13257 <table><tr><td>&nbsp;</td><td><pre class="example">hue=&quot;H=2*PI*t: s=sin(2*PI*t)+1&quot;
13258 </pre></td></tr></table>
13259
13260 </li><li>
13261 Apply a 3 seconds saturation fade-in effect starting at 0:
13262 <table><tr><td>&nbsp;</td><td><pre class="example">hue=&quot;s=min(t/3\,1)&quot;
13263 </pre></td></tr></table>
13264
13265 <p>The general fade-in expression can be written as:
13266 </p><table><tr><td>&nbsp;</td><td><pre class="example">hue=&quot;s=min(0\, max((t-START)/DURATION\, 1))&quot;
13267 </pre></td></tr></table>
13268
13269 </li><li>
13270 Apply a 3 seconds saturation fade-out effect starting at 5 seconds:
13271 <table><tr><td>&nbsp;</td><td><pre class="example">hue=&quot;s=max(0\, min(1\, (8-t)/3))&quot;
13272 </pre></td></tr></table>
13273
13274 <p>The general fade-out expression can be written as:
13275 </p><table><tr><td>&nbsp;</td><td><pre class="example">hue=&quot;s=max(0\, min(1\, (START+DURATION-t)/DURATION))&quot;
13276 </pre></td></tr></table>
13277
13278 </li></ul>
13279
13280 <a name="Commands"></a>
13281 <h3 class="subsection"><a href="ffplay-all.html#toc-Commands">28.44.2 Commands</a></h3>
13282
13283 <p>This filter supports the following commands:
13284 </p><dl compact="compact">
13285 <dt> &lsquo;<samp>b</samp>&rsquo;</dt>
13286 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
13287 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
13288 <dt> &lsquo;<samp>H</samp>&rsquo;</dt>
13289 <dd><p>Modify the hue and/or the saturation and/or brightness of the input video.
13290 The command accepts the same syntax of the corresponding option.
13291 </p>
13292 <p>If the specified expression is not valid, it is kept at its current
13293 value.
13294 </p></dd>
13295 </dl>
13296
13297 <a name="idet"></a>
13298 <h2 class="section"><a href="ffplay-all.html#toc-idet">28.45 idet</a></h2>
13299
13300 <p>Detect video interlacing type.
13301 </p>
13302 <p>This filter tries to detect if the input is interlaced or progressive,
13303 top or bottom field first.
13304 </p>
13305 <p>The filter accepts the following options:
13306 </p>
13307 <dl compact="compact">
13308 <dt> &lsquo;<samp>intl_thres</samp>&rsquo;</dt>
13309 <dd><p>Set interlacing threshold.
13310 </p></dd>
13311 <dt> &lsquo;<samp>prog_thres</samp>&rsquo;</dt>
13312 <dd><p>Set progressive threshold.
13313 </p></dd>
13314 </dl>
13315
13316 <a name="il"></a>
13317 <h2 class="section"><a href="ffplay-all.html#toc-il">28.46 il</a></h2>
13318
13319 <p>Deinterleave or interleave fields.
13320 </p>
13321 <p>This filter allows one to process interlaced images fields without
13322 deinterlacing them. Deinterleaving splits the input frame into 2
13323 fields (so called half pictures). Odd lines are moved to the top
13324 half of the output image, even lines to the bottom half.
13325 You can process (filter) them independently and then re-interleave them.
13326 </p>
13327 <p>The filter accepts the following options:
13328 </p>
13329 <dl compact="compact">
13330 <dt> &lsquo;<samp>luma_mode, l</samp>&rsquo;</dt>
13331 <dt> &lsquo;<samp>chroma_mode, c</samp>&rsquo;</dt>
13332 <dt> &lsquo;<samp>alpha_mode, a</samp>&rsquo;</dt>
13333 <dd><p>Available values for <var>luma_mode</var>, <var>chroma_mode</var> and
13334 <var>alpha_mode</var> are:
13335 </p>
13336 <dl compact="compact">
13337 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
13338 <dd><p>Do nothing.
13339 </p>
13340 </dd>
13341 <dt> &lsquo;<samp>deinterleave, d</samp>&rsquo;</dt>
13342 <dd><p>Deinterleave fields, placing one above the other.
13343 </p>
13344 </dd>
13345 <dt> &lsquo;<samp>interleave, i</samp>&rsquo;</dt>
13346 <dd><p>Interleave fields. Reverse the effect of deinterleaving.
13347 </p></dd>
13348 </dl>
13349 <p>Default value is <code>none</code>.
13350 </p>
13351 </dd>
13352 <dt> &lsquo;<samp>luma_swap, ls</samp>&rsquo;</dt>
13353 <dt> &lsquo;<samp>chroma_swap, cs</samp>&rsquo;</dt>
13354 <dt> &lsquo;<samp>alpha_swap, as</samp>&rsquo;</dt>
13355 <dd><p>Swap luma/chroma/alpha fields. Exchange even &amp; odd lines. Default value is <code>0</code>.
13356 </p></dd>
13357 </dl>
13358
13359 <a name="interlace"></a>
13360 <h2 class="section"><a href="ffplay-all.html#toc-interlace">28.47 interlace</a></h2>
13361
13362 <p>Simple interlacing filter from progressive contents. This interleaves upper (or
13363 lower) lines from odd frames with lower (or upper) lines from even frames,
13364 halving the frame rate and preserving image height. A vertical lowpass filter
13365 is always applied in order to avoid twitter effects and reduce moiré patterns.
13366 </p>
13367 <table><tr><td>&nbsp;</td><td><pre class="example">   Original        Original             New Frame
13368    Frame 'j'      Frame 'j+1'             (tff)
13369   ==========      ===========       ==================
13370     Line 0  --------------------&gt;    Frame 'j' Line 0
13371     Line 1          Line 1  ----&gt;   Frame 'j+1' Line 1
13372     Line 2 ---------------------&gt;    Frame 'j' Line 2
13373     Line 3          Line 3  ----&gt;   Frame 'j+1' Line 3
13374      ...             ...                   ...
13375 New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on
13376 </pre></td></tr></table>
13377
13378 <p>It accepts the following optional parameters:
13379 </p>
13380 <dl compact="compact">
13381 <dt> &lsquo;<samp>scan</samp>&rsquo;</dt>
13382 <dd><p>determines whether the interlaced frame is taken from the even (tff - default)
13383 or odd (bff) lines of the progressive frame.
13384 </p></dd>
13385 </dl>
13386
13387 <a name="kerndeint"></a>
13388 <h2 class="section"><a href="ffplay-all.html#toc-kerndeint">28.48 kerndeint</a></h2>
13389
13390 <p>Deinterlace input video by applying Donald Graft&rsquo;s adaptive kernel
13391 deinterling. Work on interlaced parts of a video to produce
13392 progressive frames.
13393 </p>
13394 <p>The description of the accepted parameters follows.
13395 </p>
13396 <dl compact="compact">
13397 <dt> &lsquo;<samp>thresh</samp>&rsquo;</dt>
13398 <dd><p>Set the threshold which affects the filter&rsquo;s tolerance when
13399 determining if a pixel line must be processed. It must be an integer
13400 in the range [0,255] and defaults to 10. A value of 0 will result in
13401 applying the process on every pixels.
13402 </p>
13403 </dd>
13404 <dt> &lsquo;<samp>map</samp>&rsquo;</dt>
13405 <dd><p>Paint pixels exceeding the threshold value to white if set to 1.
13406 Default is 0.
13407 </p>
13408 </dd>
13409 <dt> &lsquo;<samp>order</samp>&rsquo;</dt>
13410 <dd><p>Set the fields order. Swap fields if set to 1, leave fields alone if
13411 0. Default is 0.
13412 </p>
13413 </dd>
13414 <dt> &lsquo;<samp>sharp</samp>&rsquo;</dt>
13415 <dd><p>Enable additional sharpening if set to 1. Default is 0.
13416 </p>
13417 </dd>
13418 <dt> &lsquo;<samp>twoway</samp>&rsquo;</dt>
13419 <dd><p>Enable twoway sharpening if set to 1. Default is 0.
13420 </p></dd>
13421 </dl>
13422
13423 <a name="Examples-45"></a>
13424 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-45">28.48.1 Examples</a></h3>
13425
13426 <ul>
13427 <li>
13428 Apply default values:
13429 <table><tr><td>&nbsp;</td><td><pre class="example">kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
13430 </pre></td></tr></table>
13431
13432 </li><li>
13433 Enable additional sharpening:
13434 <table><tr><td>&nbsp;</td><td><pre class="example">kerndeint=sharp=1
13435 </pre></td></tr></table>
13436
13437 </li><li>
13438 Paint processed pixels in white:
13439 <table><tr><td>&nbsp;</td><td><pre class="example">kerndeint=map=1
13440 </pre></td></tr></table>
13441 </li></ul>
13442
13443 <p><a name="lut3d"></a>
13444 </p><a name="lut3d-1"></a>
13445 <h2 class="section"><a href="ffplay-all.html#toc-lut3d-1">28.49 lut3d</a></h2>
13446
13447 <p>Apply a 3D LUT to an input video.
13448 </p>
13449 <p>The filter accepts the following options:
13450 </p>
13451 <dl compact="compact">
13452 <dt> &lsquo;<samp>file</samp>&rsquo;</dt>
13453 <dd><p>Set the 3D LUT file name.
13454 </p>
13455 <p>Currently supported formats:
13456 </p><dl compact="compact">
13457 <dt> &lsquo;<samp>3dl</samp>&rsquo;</dt>
13458 <dd><p>AfterEffects
13459 </p></dd>
13460 <dt> &lsquo;<samp>cube</samp>&rsquo;</dt>
13461 <dd><p>Iridas
13462 </p></dd>
13463 <dt> &lsquo;<samp>dat</samp>&rsquo;</dt>
13464 <dd><p>DaVinci
13465 </p></dd>
13466 <dt> &lsquo;<samp>m3d</samp>&rsquo;</dt>
13467 <dd><p>Pandora
13468 </p></dd>
13469 </dl>
13470 </dd>
13471 <dt> &lsquo;<samp>interp</samp>&rsquo;</dt>
13472 <dd><p>Select interpolation mode.
13473 </p>
13474 <p>Available values are:
13475 </p>
13476 <dl compact="compact">
13477 <dt> &lsquo;<samp>nearest</samp>&rsquo;</dt>
13478 <dd><p>Use values from the nearest defined point.
13479 </p></dd>
13480 <dt> &lsquo;<samp>trilinear</samp>&rsquo;</dt>
13481 <dd><p>Interpolate values using the 8 points defining a cube.
13482 </p></dd>
13483 <dt> &lsquo;<samp>tetrahedral</samp>&rsquo;</dt>
13484 <dd><p>Interpolate values using a tetrahedron.
13485 </p></dd>
13486 </dl>
13487 </dd>
13488 </dl>
13489
13490 <a name="lut_002c-lutrgb_002c-lutyuv"></a>
13491 <h2 class="section"><a href="ffplay-all.html#toc-lut_002c-lutrgb_002c-lutyuv">28.50 lut, lutrgb, lutyuv</a></h2>
13492
13493 <p>Compute a look-up table for binding each pixel component input value
13494 to an output value, and apply it to input video.
13495 </p>
13496 <p><var>lutyuv</var> applies a lookup table to a YUV input video, <var>lutrgb</var>
13497 to an RGB input video.
13498 </p>
13499 <p>These filters accept the following options:
13500 </p><dl compact="compact">
13501 <dt> &lsquo;<samp>c0</samp>&rsquo;</dt>
13502 <dd><p>set first pixel component expression
13503 </p></dd>
13504 <dt> &lsquo;<samp>c1</samp>&rsquo;</dt>
13505 <dd><p>set second pixel component expression
13506 </p></dd>
13507 <dt> &lsquo;<samp>c2</samp>&rsquo;</dt>
13508 <dd><p>set third pixel component expression
13509 </p></dd>
13510 <dt> &lsquo;<samp>c3</samp>&rsquo;</dt>
13511 <dd><p>set fourth pixel component expression, corresponds to the alpha component
13512 </p>
13513 </dd>
13514 <dt> &lsquo;<samp>r</samp>&rsquo;</dt>
13515 <dd><p>set red component expression
13516 </p></dd>
13517 <dt> &lsquo;<samp>g</samp>&rsquo;</dt>
13518 <dd><p>set green component expression
13519 </p></dd>
13520 <dt> &lsquo;<samp>b</samp>&rsquo;</dt>
13521 <dd><p>set blue component expression
13522 </p></dd>
13523 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
13524 <dd><p>alpha component expression
13525 </p>
13526 </dd>
13527 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
13528 <dd><p>set Y/luminance component expression
13529 </p></dd>
13530 <dt> &lsquo;<samp>u</samp>&rsquo;</dt>
13531 <dd><p>set U/Cb component expression
13532 </p></dd>
13533 <dt> &lsquo;<samp>v</samp>&rsquo;</dt>
13534 <dd><p>set V/Cr component expression
13535 </p></dd>
13536 </dl>
13537
13538 <p>Each of them specifies the expression to use for computing the lookup table for
13539 the corresponding pixel component values.
13540 </p>
13541 <p>The exact component associated to each of the <var>c*</var> options depends on the
13542 format in input.
13543 </p>
13544 <p>The <var>lut</var> filter requires either YUV or RGB pixel formats in input,
13545 <var>lutrgb</var> requires RGB pixel formats in input, and <var>lutyuv</var> requires YUV.
13546 </p>
13547 <p>The expressions can contain the following constants and functions:
13548 </p>
13549 <dl compact="compact">
13550 <dt> &lsquo;<samp>w</samp>&rsquo;</dt>
13551 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
13552 <dd><p>the input width and height
13553 </p>
13554 </dd>
13555 <dt> &lsquo;<samp>val</samp>&rsquo;</dt>
13556 <dd><p>input value for the pixel component
13557 </p>
13558 </dd>
13559 <dt> &lsquo;<samp>clipval</samp>&rsquo;</dt>
13560 <dd><p>the input value clipped in the <var>minval</var>-<var>maxval</var> range
13561 </p>
13562 </dd>
13563 <dt> &lsquo;<samp>maxval</samp>&rsquo;</dt>
13564 <dd><p>maximum value for the pixel component
13565 </p>
13566 </dd>
13567 <dt> &lsquo;<samp>minval</samp>&rsquo;</dt>
13568 <dd><p>minimum value for the pixel component
13569 </p>
13570 </dd>
13571 <dt> &lsquo;<samp>negval</samp>&rsquo;</dt>
13572 <dd><p>the negated value for the pixel component value clipped in the
13573 <var>minval</var>-<var>maxval</var> range , it corresponds to the expression
13574 &quot;maxval-clipval+minval&quot;
13575 </p>
13576 </dd>
13577 <dt> &lsquo;<samp>clip(val)</samp>&rsquo;</dt>
13578 <dd><p>the computed value in <var>val</var> clipped in the
13579 <var>minval</var>-<var>maxval</var> range
13580 </p>
13581 </dd>
13582 <dt> &lsquo;<samp>gammaval(gamma)</samp>&rsquo;</dt>
13583 <dd><p>the computed gamma correction value of the pixel component value
13584 clipped in the <var>minval</var>-<var>maxval</var> range, corresponds to the
13585 expression
13586 &quot;pow((clipval-minval)/(maxval-minval)\,<var>gamma</var>)*(maxval-minval)+minval&quot;
13587 </p>
13588 </dd>
13589 </dl>
13590
13591 <p>All expressions default to &quot;val&quot;.
13592 </p>
13593 <a name="Examples-5"></a>
13594 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-5">28.50.1 Examples</a></h3>
13595
13596 <ul>
13597 <li>
13598 Negate input video:
13599 <table><tr><td>&nbsp;</td><td><pre class="example">lutrgb=&quot;r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val&quot;
13600 lutyuv=&quot;y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val&quot;
13601 </pre></td></tr></table>
13602
13603 <p>The above is the same as:
13604 </p><table><tr><td>&nbsp;</td><td><pre class="example">lutrgb=&quot;r=negval:g=negval:b=negval&quot;
13605 lutyuv=&quot;y=negval:u=negval:v=negval&quot;
13606 </pre></td></tr></table>
13607
13608 </li><li>
13609 Negate luminance:
13610 <table><tr><td>&nbsp;</td><td><pre class="example">lutyuv=y=negval
13611 </pre></td></tr></table>
13612
13613 </li><li>
13614 Remove chroma components, turns the video into a graytone image:
13615 <table><tr><td>&nbsp;</td><td><pre class="example">lutyuv=&quot;u=128:v=128&quot;
13616 </pre></td></tr></table>
13617
13618 </li><li>
13619 Apply a luma burning effect:
13620 <table><tr><td>&nbsp;</td><td><pre class="example">lutyuv=&quot;y=2*val&quot;
13621 </pre></td></tr></table>
13622
13623 </li><li>
13624 Remove green and blue components:
13625 <table><tr><td>&nbsp;</td><td><pre class="example">lutrgb=&quot;g=0:b=0&quot;
13626 </pre></td></tr></table>
13627
13628 </li><li>
13629 Set a constant alpha channel value on input:
13630 <table><tr><td>&nbsp;</td><td><pre class="example">format=rgba,lutrgb=a=&quot;maxval-minval/2&quot;
13631 </pre></td></tr></table>
13632
13633 </li><li>
13634 Correct luminance gamma by a 0.5 factor:
13635 <table><tr><td>&nbsp;</td><td><pre class="example">lutyuv=y=gammaval(0.5)
13636 </pre></td></tr></table>
13637
13638 </li><li>
13639 Discard least significant bits of luma:
13640 <table><tr><td>&nbsp;</td><td><pre class="example">lutyuv=y='bitand(val, 128+64+32)'
13641 </pre></td></tr></table>
13642 </li></ul>
13643
13644 <a name="mergeplanes"></a>
13645 <h2 class="section"><a href="ffplay-all.html#toc-mergeplanes">28.51 mergeplanes</a></h2>
13646
13647 <p>Merge color channel components from several video streams.
13648 </p>
13649 <p>The filter accepts up to 4 input streams, and merge selected input
13650 planes to the output video.
13651 </p>
13652 <p>This filter accepts the following options:
13653 </p><dl compact="compact">
13654 <dt> &lsquo;<samp>mapping</samp>&rsquo;</dt>
13655 <dd><p>Set input to output plane mapping. Default is <code>0</code>.
13656 </p>
13657 <p>The mappings is specified as a bitmap. It should be specified as a
13658 hexadecimal number in the form 0xAa[Bb[Cc[Dd]]]. &rsquo;Aa&rsquo; describes the
13659 mapping for the first plane of the output stream. &rsquo;A&rsquo; sets the number of
13660 the input stream to use (from 0 to 3), and &rsquo;a&rsquo; the plane number of the
13661 corresponding input to use (from 0 to 3). The rest of the mappings is
13662 similar, &rsquo;Bb&rsquo; describes the mapping for the output stream second
13663 plane, &rsquo;Cc&rsquo; describes the mapping for the output stream third plane and
13664 &rsquo;Dd&rsquo; describes the mapping for the output stream fourth plane.
13665 </p>
13666 </dd>
13667 <dt> &lsquo;<samp>format</samp>&rsquo;</dt>
13668 <dd><p>Set output pixel format. Default is <code>yuva444p</code>.
13669 </p></dd>
13670 </dl>
13671
13672 <a name="Examples-3"></a>
13673 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-3">28.51.1 Examples</a></h3>
13674
13675 <ul>
13676 <li>
13677 Merge three gray video streams of same width and height into single video stream:
13678 <table><tr><td>&nbsp;</td><td><pre class="example">[a0][a1][a2]mergeplanes=0x001020:yuv444p
13679 </pre></td></tr></table>
13680
13681 </li><li>
13682 Merge 1st yuv444p stream and 2nd gray video stream into yuva444p video stream:
13683 <table><tr><td>&nbsp;</td><td><pre class="example">[a0][a1]mergeplanes=0x00010210:yuva444p
13684 </pre></td></tr></table>
13685
13686 </li><li>
13687 Swap Y and A plane in yuva444p stream:
13688 <table><tr><td>&nbsp;</td><td><pre class="example">format=yuva444p,mergeplanes=0x03010200:yuva444p
13689 </pre></td></tr></table>
13690
13691 </li><li>
13692 Swap U and V plane in yuv420p stream:
13693 <table><tr><td>&nbsp;</td><td><pre class="example">format=yuv420p,mergeplanes=0x000201:yuv420p
13694 </pre></td></tr></table>
13695
13696 </li><li>
13697 Cast a rgb24 clip to yuv444p:
13698 <table><tr><td>&nbsp;</td><td><pre class="example">format=rgb24,mergeplanes=0x000102:yuv444p
13699 </pre></td></tr></table>
13700 </li></ul>
13701
13702 <a name="mcdeint"></a>
13703 <h2 class="section"><a href="ffplay-all.html#toc-mcdeint">28.52 mcdeint</a></h2>
13704
13705 <p>Apply motion-compensation deinterlacing.
13706 </p>
13707 <p>It needs one field per frame as input and must thus be used together
13708 with yadif=1/3 or equivalent.
13709 </p>
13710 <p>This filter accepts the following options:
13711 </p><dl compact="compact">
13712 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
13713 <dd><p>Set the deinterlacing mode.
13714 </p>
13715 <p>It accepts one of the following values:
13716 </p><dl compact="compact">
13717 <dt> &lsquo;<samp>fast</samp>&rsquo;</dt>
13718 <dt> &lsquo;<samp>medium</samp>&rsquo;</dt>
13719 <dt> &lsquo;<samp>slow</samp>&rsquo;</dt>
13720 <dd><p>use iterative motion estimation
13721 </p></dd>
13722 <dt> &lsquo;<samp>extra_slow</samp>&rsquo;</dt>
13723 <dd><p>like &lsquo;<samp>slow</samp>&rsquo;, but use multiple reference frames.
13724 </p></dd>
13725 </dl>
13726 <p>Default value is &lsquo;<samp>fast</samp>&rsquo;.
13727 </p>
13728 </dd>
13729 <dt> &lsquo;<samp>parity</samp>&rsquo;</dt>
13730 <dd><p>Set the picture field parity assumed for the input video. It must be
13731 one of the following values:
13732 </p>
13733 <dl compact="compact">
13734 <dt> &lsquo;<samp>0, tff</samp>&rsquo;</dt>
13735 <dd><p>assume top field first
13736 </p></dd>
13737 <dt> &lsquo;<samp>1, bff</samp>&rsquo;</dt>
13738 <dd><p>assume bottom field first
13739 </p></dd>
13740 </dl>
13741
13742 <p>Default value is &lsquo;<samp>bff</samp>&rsquo;.
13743 </p>
13744 </dd>
13745 <dt> &lsquo;<samp>qp</samp>&rsquo;</dt>
13746 <dd><p>Set per-block quantization parameter (QP) used by the internal
13747 encoder.
13748 </p>
13749 <p>Higher values should result in a smoother motion vector field but less
13750 optimal individual vectors. Default value is 1.
13751 </p></dd>
13752 </dl>
13753
13754 <a name="mp"></a>
13755 <h2 class="section"><a href="ffplay-all.html#toc-mp">28.53 mp</a></h2>
13756
13757 <p>Apply an MPlayer filter to the input video.
13758 </p>
13759 <p>This filter provides a wrapper around some of the filters of
13760 MPlayer/MEncoder.
13761 </p>
13762 <p>This wrapper is considered experimental. Some of the wrapped filters
13763 may not work properly and we may drop support for them, as they will
13764 be implemented natively into FFmpeg. Thus you should avoid
13765 depending on them when writing portable scripts.
13766 </p>
13767 <p>The filter accepts the parameters:
13768 <var>filter_name</var>[:=]<var>filter_params</var>
13769 </p>
13770 <p><var>filter_name</var> is the name of a supported MPlayer filter,
13771 <var>filter_params</var> is a string containing the parameters accepted by
13772 the named filter.
13773 </p>
13774 <p>The list of the currently supported filters follows:
13775 </p><dl compact="compact">
13776 <dt> <var>eq2</var></dt>
13777 <dt> <var>eq</var></dt>
13778 <dt> <var>fspp</var></dt>
13779 <dt> <var>ilpack</var></dt>
13780 <dt> <var>pp7</var></dt>
13781 <dt> <var>softpulldown</var></dt>
13782 <dt> <var>uspp</var></dt>
13783 </dl>
13784
13785 <p>The parameter syntax and behavior for the listed filters are the same
13786 of the corresponding MPlayer filters. For detailed instructions check
13787 the &quot;VIDEO FILTERS&quot; section in the MPlayer manual.
13788 </p>
13789 <a name="Examples-10"></a>
13790 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-10">28.53.1 Examples</a></h3>
13791
13792 <ul>
13793 <li>
13794 Adjust gamma, brightness, contrast:
13795 <table><tr><td>&nbsp;</td><td><pre class="example">mp=eq2=1.0:2:0.5
13796 </pre></td></tr></table>
13797 </li></ul>
13798
13799 <p>See also mplayer(1), <a href="http://www.mplayerhq.hu/">http://www.mplayerhq.hu/</a>.
13800 </p>
13801 <a name="mpdecimate"></a>
13802 <h2 class="section"><a href="ffplay-all.html#toc-mpdecimate">28.54 mpdecimate</a></h2>
13803
13804 <p>Drop frames that do not differ greatly from the previous frame in
13805 order to reduce frame rate.
13806 </p>
13807 <p>The main use of this filter is for very-low-bitrate encoding
13808 (e.g. streaming over dialup modem), but it could in theory be used for
13809 fixing movies that were inverse-telecined incorrectly.
13810 </p>
13811 <p>A description of the accepted options follows.
13812 </p>
13813 <dl compact="compact">
13814 <dt> &lsquo;<samp>max</samp>&rsquo;</dt>
13815 <dd><p>Set the maximum number of consecutive frames which can be dropped (if
13816 positive), or the minimum interval between dropped frames (if
13817 negative). If the value is 0, the frame is dropped unregarding the
13818 number of previous sequentially dropped frames.
13819 </p>
13820 <p>Default value is 0.
13821 </p>
13822 </dd>
13823 <dt> &lsquo;<samp>hi</samp>&rsquo;</dt>
13824 <dt> &lsquo;<samp>lo</samp>&rsquo;</dt>
13825 <dt> &lsquo;<samp>frac</samp>&rsquo;</dt>
13826 <dd><p>Set the dropping threshold values.
13827 </p>
13828 <p>Values for &lsquo;<samp>hi</samp>&rsquo; and &lsquo;<samp>lo</samp>&rsquo; are for 8x8 pixel blocks and
13829 represent actual pixel value differences, so a threshold of 64
13830 corresponds to 1 unit of difference for each pixel, or the same spread
13831 out differently over the block.
13832 </p>
13833 <p>A frame is a candidate for dropping if no 8x8 blocks differ by more
13834 than a threshold of &lsquo;<samp>hi</samp>&rsquo;, and if no more than &lsquo;<samp>frac</samp>&rsquo; blocks (1
13835 meaning the whole image) differ by more than a threshold of &lsquo;<samp>lo</samp>&rsquo;.
13836 </p>
13837 <p>Default value for &lsquo;<samp>hi</samp>&rsquo; is 64*12, default value for &lsquo;<samp>lo</samp>&rsquo; is
13838 64*5, and default value for &lsquo;<samp>frac</samp>&rsquo; is 0.33.
13839 </p></dd>
13840 </dl>
13841
13842
13843 <a name="negate"></a>
13844 <h2 class="section"><a href="ffplay-all.html#toc-negate">28.55 negate</a></h2>
13845
13846 <p>Negate input video.
13847 </p>
13848 <p>This filter accepts an integer in input, if non-zero it negates the
13849 alpha component (if available). The default value in input is 0.
13850 </p>
13851 <a name="noformat"></a>
13852 <h2 class="section"><a href="ffplay-all.html#toc-noformat">28.56 noformat</a></h2>
13853
13854 <p>Force libavfilter not to use any of the specified pixel formats for the
13855 input to the next filter.
13856 </p>
13857 <p>This filter accepts the following parameters:
13858 </p><dl compact="compact">
13859 <dt> &lsquo;<samp>pix_fmts</samp>&rsquo;</dt>
13860 <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, for example
13861 &quot;pix_fmts=yuv420p|monow|rgb24&quot;.
13862 </p>
13863 </dd>
13864 </dl>
13865
13866 <a name="Examples-65"></a>
13867 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-65">28.56.1 Examples</a></h3>
13868
13869 <ul>
13870 <li>
13871 Force libavfilter to use a format different from <var>yuv420p</var> for the
13872 input to the vflip filter:
13873 <table><tr><td>&nbsp;</td><td><pre class="example">noformat=pix_fmts=yuv420p,vflip
13874 </pre></td></tr></table>
13875
13876 </li><li>
13877 Convert the input video to any of the formats not contained in the list:
13878 <table><tr><td>&nbsp;</td><td><pre class="example">noformat=yuv420p|yuv444p|yuv410p
13879 </pre></td></tr></table>
13880 </li></ul>
13881
13882 <a name="noise-1"></a>
13883 <h2 class="section"><a href="ffplay-all.html#toc-noise-1">28.57 noise</a></h2>
13884
13885 <p>Add noise on video input frame.
13886 </p>
13887 <p>The filter accepts the following options:
13888 </p>
13889 <dl compact="compact">
13890 <dt> &lsquo;<samp>all_seed</samp>&rsquo;</dt>
13891 <dt> &lsquo;<samp>c0_seed</samp>&rsquo;</dt>
13892 <dt> &lsquo;<samp>c1_seed</samp>&rsquo;</dt>
13893 <dt> &lsquo;<samp>c2_seed</samp>&rsquo;</dt>
13894 <dt> &lsquo;<samp>c3_seed</samp>&rsquo;</dt>
13895 <dd><p>Set noise seed for specific pixel component or all pixel components in case
13896 of <var>all_seed</var>. Default value is <code>123457</code>.
13897 </p>
13898 </dd>
13899 <dt> &lsquo;<samp>all_strength, alls</samp>&rsquo;</dt>
13900 <dt> &lsquo;<samp>c0_strength, c0s</samp>&rsquo;</dt>
13901 <dt> &lsquo;<samp>c1_strength, c1s</samp>&rsquo;</dt>
13902 <dt> &lsquo;<samp>c2_strength, c2s</samp>&rsquo;</dt>
13903 <dt> &lsquo;<samp>c3_strength, c3s</samp>&rsquo;</dt>
13904 <dd><p>Set noise strength for specific pixel component or all pixel components in case
13905 <var>all_strength</var>. Default value is <code>0</code>. Allowed range is [0, 100].
13906 </p>
13907 </dd>
13908 <dt> &lsquo;<samp>all_flags, allf</samp>&rsquo;</dt>
13909 <dt> &lsquo;<samp>c0_flags, c0f</samp>&rsquo;</dt>
13910 <dt> &lsquo;<samp>c1_flags, c1f</samp>&rsquo;</dt>
13911 <dt> &lsquo;<samp>c2_flags, c2f</samp>&rsquo;</dt>
13912 <dt> &lsquo;<samp>c3_flags, c3f</samp>&rsquo;</dt>
13913 <dd><p>Set pixel component flags or set flags for all components if <var>all_flags</var>.
13914 Available values for component flags are:
13915 </p><dl compact="compact">
13916 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
13917 <dd><p>averaged temporal noise (smoother)
13918 </p></dd>
13919 <dt> &lsquo;<samp>p</samp>&rsquo;</dt>
13920 <dd><p>mix random noise with a (semi)regular pattern
13921 </p></dd>
13922 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
13923 <dd><p>temporal noise (noise pattern changes between frames)
13924 </p></dd>
13925 <dt> &lsquo;<samp>u</samp>&rsquo;</dt>
13926 <dd><p>uniform noise (gaussian otherwise)
13927 </p></dd>
13928 </dl>
13929 </dd>
13930 </dl>
13931
13932 <a name="Examples-58"></a>
13933 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-58">28.57.1 Examples</a></h3>
13934
13935 <p>Add temporal and uniform noise to input video:
13936 </p><table><tr><td>&nbsp;</td><td><pre class="example">noise=alls=20:allf=t+u
13937 </pre></td></tr></table>
13938
13939 <a name="null"></a>
13940 <h2 class="section"><a href="ffplay-all.html#toc-null">28.58 null</a></h2>
13941
13942 <p>Pass the video source unchanged to the output.
13943 </p>
13944 <a name="ocv"></a>
13945 <h2 class="section"><a href="ffplay-all.html#toc-ocv">28.59 ocv</a></h2>
13946
13947 <p>Apply video transform using libopencv.
13948 </p>
13949 <p>To enable this filter install libopencv library and headers and
13950 configure FFmpeg with <code>--enable-libopencv</code>.
13951 </p>
13952 <p>This filter accepts the following parameters:
13953 </p>
13954 <dl compact="compact">
13955 <dt> &lsquo;<samp>filter_name</samp>&rsquo;</dt>
13956 <dd><p>The name of the libopencv filter to apply.
13957 </p>
13958 </dd>
13959 <dt> &lsquo;<samp>filter_params</samp>&rsquo;</dt>
13960 <dd><p>The parameters to pass to the libopencv filter. If not specified the default
13961 values are assumed.
13962 </p>
13963 </dd>
13964 </dl>
13965
13966 <p>Refer to the official libopencv documentation for more precise
13967 information:
13968 <a href="http://opencv.willowgarage.com/documentation/c/image_filtering.html">http://opencv.willowgarage.com/documentation/c/image_filtering.html</a>
13969 </p>
13970 <p>Follows the list of supported libopencv filters.
13971 </p>
13972 <p><a name="dilate"></a>
13973 </p><a name="dilate-1"></a>
13974 <h3 class="subsection"><a href="ffplay-all.html#toc-dilate-1">28.59.1 dilate</a></h3>
13975
13976 <p>Dilate an image by using a specific structuring element.
13977 This filter corresponds to the libopencv function <code>cvDilate</code>.
13978 </p>
13979 <p>It accepts the parameters: <var>struct_el</var>|<var>nb_iterations</var>.
13980 </p>
13981 <p><var>struct_el</var> represents a structuring element, and has the syntax:
13982 <var>cols</var>x<var>rows</var>+<var>anchor_x</var>x<var>anchor_y</var>/<var>shape</var>
13983 </p>
13984 <p><var>cols</var> and <var>rows</var> represent the number of columns and rows of
13985 the structuring element, <var>anchor_x</var> and <var>anchor_y</var> the anchor
13986 point, and <var>shape</var> the shape for the structuring element, and
13987 can be one of the values &quot;rect&quot;, &quot;cross&quot;, &quot;ellipse&quot;, &quot;custom&quot;.
13988 </p>
13989 <p>If the value for <var>shape</var> is &quot;custom&quot;, it must be followed by a
13990 string of the form &quot;=<var>filename</var>&quot;. The file with name
13991 <var>filename</var> is assumed to represent a binary image, with each
13992 printable character corresponding to a bright pixel. When a custom
13993 <var>shape</var> is used, <var>cols</var> and <var>rows</var> are ignored, the number
13994 or columns and rows of the read file are assumed instead.
13995 </p>
13996 <p>The default value for <var>struct_el</var> is &quot;3x3+0x0/rect&quot;.
13997 </p>
13998 <p><var>nb_iterations</var> specifies the number of times the transform is
13999 applied to the image, and defaults to 1.
14000 </p>
14001 <p>Follow some example:
14002 </p><table><tr><td>&nbsp;</td><td><pre class="example"># use the default values
14003 ocv=dilate
14004
14005 # dilate using a structuring element with a 5x5 cross, iterate two times
14006 ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
14007
14008 # read the shape from the file diamond.shape, iterate two times
14009 # the file diamond.shape may contain a pattern of characters like this:
14010 #   *
14011 #  ***
14012 # *****
14013 #  ***
14014 #   *
14015 # the specified cols and rows are ignored (but not the anchor point coordinates)
14016 ocv=dilate:0x0+2x2/custom=diamond.shape|2
14017 </pre></td></tr></table>
14018
14019 <a name="erode"></a>
14020 <h3 class="subsection"><a href="ffplay-all.html#toc-erode">28.59.2 erode</a></h3>
14021
14022 <p>Erode an image by using a specific structuring element.
14023 This filter corresponds to the libopencv function <code>cvErode</code>.
14024 </p>
14025 <p>The filter accepts the parameters: <var>struct_el</var>:<var>nb_iterations</var>,
14026 with the same syntax and semantics as the <a href="#dilate">dilate</a> filter.
14027 </p>
14028 <a name="smooth"></a>
14029 <h3 class="subsection"><a href="ffplay-all.html#toc-smooth">28.59.3 smooth</a></h3>
14030
14031 <p>Smooth the input video.
14032 </p>
14033 <p>The filter takes the following parameters:
14034 <var>type</var>|<var>param1</var>|<var>param2</var>|<var>param3</var>|<var>param4</var>.
14035 </p>
14036 <p><var>type</var> is the type of smooth filter to apply, and can be one of
14037 the following values: &quot;blur&quot;, &quot;blur_no_scale&quot;, &quot;median&quot;, &quot;gaussian&quot;,
14038 &quot;bilateral&quot;. The default value is &quot;gaussian&quot;.
14039 </p>
14040 <p><var>param1</var>, <var>param2</var>, <var>param3</var>, and <var>param4</var> are
14041 parameters whose meanings depend on smooth type. <var>param1</var> and
14042 <var>param2</var> accept integer positive values or 0, <var>param3</var> and
14043 <var>param4</var> accept float values.
14044 </p>
14045 <p>The default value for <var>param1</var> is 3, the default value for the
14046 other parameters is 0.
14047 </p>
14048 <p>These parameters correspond to the parameters assigned to the
14049 libopencv function <code>cvSmooth</code>.
14050 </p>
14051 <p><a name="overlay"></a>
14052 </p><a name="overlay-1"></a>
14053 <h2 class="section"><a href="ffplay-all.html#toc-overlay-1">28.60 overlay</a></h2>
14054
14055 <p>Overlay one video on top of another.
14056 </p>
14057 <p>It takes two inputs and one output, the first input is the &quot;main&quot;
14058 video on which the second input is overlayed.
14059 </p>
14060 <p>This filter accepts the following parameters:
14061 </p>
14062 <p>A description of the accepted options follows.
14063 </p>
14064 <dl compact="compact">
14065 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
14066 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
14067 <dd><p>Set the expression for the x and y coordinates of the overlayed video
14068 on the main video. Default value is &quot;0&quot; for both expressions. In case
14069 the expression is invalid, it is set to a huge value (meaning that the
14070 overlay will not be displayed within the output visible area).
14071 </p>
14072 </dd>
14073 <dt> &lsquo;<samp>eof_action</samp>&rsquo;</dt>
14074 <dd><p>The action to take when EOF is encountered on the secondary input, accepts one
14075 of the following values:
14076 </p>
14077 <dl compact="compact">
14078 <dt> &lsquo;<samp>repeat</samp>&rsquo;</dt>
14079 <dd><p>repeat the last frame (the default)
14080 </p></dd>
14081 <dt> &lsquo;<samp>endall</samp>&rsquo;</dt>
14082 <dd><p>end both streams
14083 </p></dd>
14084 <dt> &lsquo;<samp>pass</samp>&rsquo;</dt>
14085 <dd><p>pass through the main input
14086 </p></dd>
14087 </dl>
14088
14089 </dd>
14090 <dt> &lsquo;<samp>eval</samp>&rsquo;</dt>
14091 <dd><p>Set when the expressions for &lsquo;<samp>x</samp>&rsquo;, and &lsquo;<samp>y</samp>&rsquo; are evaluated.
14092 </p>
14093 <p>It accepts the following values:
14094 </p><dl compact="compact">
14095 <dt> &lsquo;<samp>init</samp>&rsquo;</dt>
14096 <dd><p>only evaluate expressions once during the filter initialization or
14097 when a command is processed
14098 </p>
14099 </dd>
14100 <dt> &lsquo;<samp>frame</samp>&rsquo;</dt>
14101 <dd><p>evaluate expressions for each incoming frame
14102 </p></dd>
14103 </dl>
14104
14105 <p>Default value is &lsquo;<samp>frame</samp>&rsquo;.
14106 </p>
14107 </dd>
14108 <dt> &lsquo;<samp>shortest</samp>&rsquo;</dt>
14109 <dd><p>If set to 1, force the output to terminate when the shortest input
14110 terminates. Default value is 0.
14111 </p>
14112 </dd>
14113 <dt> &lsquo;<samp>format</samp>&rsquo;</dt>
14114 <dd><p>Set the format for the output video.
14115 </p>
14116 <p>It accepts the following values:
14117 </p><dl compact="compact">
14118 <dt> &lsquo;<samp>yuv420</samp>&rsquo;</dt>
14119 <dd><p>force YUV420 output
14120 </p>
14121 </dd>
14122 <dt> &lsquo;<samp>yuv422</samp>&rsquo;</dt>
14123 <dd><p>force YUV422 output
14124 </p>
14125 </dd>
14126 <dt> &lsquo;<samp>yuv444</samp>&rsquo;</dt>
14127 <dd><p>force YUV444 output
14128 </p>
14129 </dd>
14130 <dt> &lsquo;<samp>rgb</samp>&rsquo;</dt>
14131 <dd><p>force RGB output
14132 </p></dd>
14133 </dl>
14134
14135 <p>Default value is &lsquo;<samp>yuv420</samp>&rsquo;.
14136 </p>
14137 </dd>
14138 <dt> &lsquo;<samp>rgb <em>(deprecated)</em></samp>&rsquo;</dt>
14139 <dd><p>If set to 1, force the filter to accept inputs in the RGB
14140 color space. Default value is 0. This option is deprecated, use
14141 &lsquo;<samp>format</samp>&rsquo; instead.
14142 </p>
14143 </dd>
14144 <dt> &lsquo;<samp>repeatlast</samp>&rsquo;</dt>
14145 <dd><p>If set to 1, force the filter to draw the last overlay frame over the
14146 main input until the end of the stream. A value of 0 disables this
14147 behavior. Default value is 1.
14148 </p></dd>
14149 </dl>
14150
14151 <p>The &lsquo;<samp>x</samp>&rsquo;, and &lsquo;<samp>y</samp>&rsquo; expressions can contain the following
14152 parameters.
14153 </p>
14154 <dl compact="compact">
14155 <dt> &lsquo;<samp>main_w, W</samp>&rsquo;</dt>
14156 <dt> &lsquo;<samp>main_h, H</samp>&rsquo;</dt>
14157 <dd><p>main input width and height
14158 </p>
14159 </dd>
14160 <dt> &lsquo;<samp>overlay_w, w</samp>&rsquo;</dt>
14161 <dt> &lsquo;<samp>overlay_h, h</samp>&rsquo;</dt>
14162 <dd><p>overlay input width and height
14163 </p>
14164 </dd>
14165 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
14166 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
14167 <dd><p>the computed values for <var>x</var> and <var>y</var>. They are evaluated for
14168 each new frame.
14169 </p>
14170 </dd>
14171 <dt> &lsquo;<samp>hsub</samp>&rsquo;</dt>
14172 <dt> &lsquo;<samp>vsub</samp>&rsquo;</dt>
14173 <dd><p>horizontal and vertical chroma subsample values of the output
14174 format. For example for the pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and
14175 <var>vsub</var> is 1.
14176 </p>
14177 </dd>
14178 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
14179 <dd><p>the number of input frame, starting from 0
14180 </p>
14181 </dd>
14182 <dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
14183 <dd><p>the position in the file of the input frame, NAN if unknown
14184 </p>
14185 </dd>
14186 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
14187 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
14188 </p>
14189 </dd>
14190 </dl>
14191
14192 <p>Note that the <var>n</var>, <var>pos</var>, <var>t</var> variables are available only
14193 when evaluation is done <em>per frame</em>, and will evaluate to NAN
14194 when &lsquo;<samp>eval</samp>&rsquo; is set to &lsquo;<samp>init</samp>&rsquo;.
14195 </p>
14196 <p>Be aware that frames are taken from each input video in timestamp
14197 order, hence, if their initial timestamps differ, it is a good idea
14198 to pass the two inputs through a <var>setpts=PTS-STARTPTS</var> filter to
14199 have them begin in the same zero timestamp, as it does the example for
14200 the <var>movie</var> filter.
14201 </p>
14202 <p>You can chain together more overlays but you should test the
14203 efficiency of such approach.
14204 </p>
14205 <a name="Commands-4"></a>
14206 <h3 class="subsection"><a href="ffplay-all.html#toc-Commands-4">28.60.1 Commands</a></h3>
14207
14208 <p>This filter supports the following commands:
14209 </p><dl compact="compact">
14210 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
14211 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
14212 <dd><p>Modify the x and y of the overlay input.
14213 The command accepts the same syntax of the corresponding option.
14214 </p>
14215 <p>If the specified expression is not valid, it is kept at its current
14216 value.
14217 </p></dd>
14218 </dl>
14219
14220 <a name="Examples-15"></a>
14221 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-15">28.60.2 Examples</a></h3>
14222
14223 <ul>
14224 <li>
14225 Draw the overlay at 10 pixels from the bottom right corner of the main
14226 video:
14227 <table><tr><td>&nbsp;</td><td><pre class="example">overlay=main_w-overlay_w-10:main_h-overlay_h-10
14228 </pre></td></tr></table>
14229
14230 <p>Using named options the example above becomes:
14231 </p><table><tr><td>&nbsp;</td><td><pre class="example">overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10
14232 </pre></td></tr></table>
14233
14234 </li><li>
14235 Insert a transparent PNG logo in the bottom left corner of the input,
14236 using the <code>ffmpeg</code> tool with the <code>-filter_complex</code> option:
14237 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i input -i logo -filter_complex 'overlay=10:main_h-overlay_h-10' output
14238 </pre></td></tr></table>
14239
14240 </li><li>
14241 Insert 2 different transparent PNG logos (second logo on bottom
14242 right corner) using the <code>ffmpeg</code> tool:
14243 <table><tr><td>&nbsp;</td><td><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
14244 </pre></td></tr></table>
14245
14246 </li><li>
14247 Add a transparent color layer on top of the main video, <code>WxH</code>
14248 must specify the size of the main input to the overlay filter:
14249 <table><tr><td>&nbsp;</td><td><pre class="example">color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
14250 </pre></td></tr></table>
14251
14252 </li><li>
14253 Play an original video and a filtered version (here with the deshake
14254 filter) side by side using the <code>ffplay</code> tool:
14255 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay input.avi -vf 'split[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w'
14256 </pre></td></tr></table>
14257
14258 <p>The above command is the same as:
14259 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay input.avi -vf 'split[b], pad=iw*2[src], [b]deshake, [src]overlay=w'
14260 </pre></td></tr></table>
14261
14262 </li><li>
14263 Make a sliding overlay appearing from the left to the right top part of the
14264 screen starting since time 2:
14265 <table><tr><td>&nbsp;</td><td><pre class="example">overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
14266 </pre></td></tr></table>
14267
14268 </li><li>
14269 Compose output by putting two input videos side to side:
14270 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i left.avi -i right.avi -filter_complex &quot;
14271 nullsrc=size=200x100 [background];
14272 [0:v] setpts=PTS-STARTPTS, scale=100x100 [left];
14273 [1:v] setpts=PTS-STARTPTS, scale=100x100 [right];
14274 [background][left]       overlay=shortest=1       [background+left];
14275 [background+left][right] overlay=shortest=1:x=100 [left+right]
14276 &quot;
14277 </pre></td></tr></table>
14278
14279 </li><li>
14280 mask 10-20 seconds of a video by applying the delogo filter to a section
14281 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i test.avi -codec:v:0 wmv2 -ar 11025 -b:v 9000k
14282 -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]'
14283 masked.avi
14284 </pre></td></tr></table>
14285
14286 </li><li>
14287 Chain several overlays in cascade:
14288 <table><tr><td>&nbsp;</td><td><pre class="example">nullsrc=s=200x200 [bg];
14289 testsrc=s=100x100, split=4 [in0][in1][in2][in3];
14290 [in0] lutrgb=r=0, [bg]   overlay=0:0     [mid0];
14291 [in1] lutrgb=g=0, [mid0] overlay=100:0   [mid1];
14292 [in2] lutrgb=b=0, [mid1] overlay=0:100   [mid2];
14293 [in3] null,       [mid2] overlay=100:100 [out0]
14294 </pre></td></tr></table>
14295
14296 </li></ul>
14297
14298 <a name="owdenoise"></a>
14299 <h2 class="section"><a href="ffplay-all.html#toc-owdenoise">28.61 owdenoise</a></h2>
14300
14301 <p>Apply Overcomplete Wavelet denoiser.
14302 </p>
14303 <p>The filter accepts the following options:
14304 </p>
14305 <dl compact="compact">
14306 <dt> &lsquo;<samp>depth</samp>&rsquo;</dt>
14307 <dd><p>Set depth.
14308 </p>
14309 <p>Larger depth values will denoise lower frequency components more, but
14310 slow down filtering.
14311 </p>
14312 <p>Must be an int in the range 8-16, default is <code>8</code>.
14313 </p>
14314 </dd>
14315 <dt> &lsquo;<samp>luma_strength, ls</samp>&rsquo;</dt>
14316 <dd><p>Set luma strength.
14317 </p>
14318 <p>Must be a double value in the range 0-1000, default is <code>1.0</code>.
14319 </p>
14320 </dd>
14321 <dt> &lsquo;<samp>chroma_strength, cs</samp>&rsquo;</dt>
14322 <dd><p>Set chroma strength.
14323 </p>
14324 <p>Must be a double value in the range 0-1000, default is <code>1.0</code>.
14325 </p></dd>
14326 </dl>
14327
14328 <a name="pad"></a>
14329 <h2 class="section"><a href="ffplay-all.html#toc-pad">28.62 pad</a></h2>
14330
14331 <p>Add paddings to the input image, and place the original input at the
14332 given coordinates <var>x</var>, <var>y</var>.
14333 </p>
14334 <p>This filter accepts the following parameters:
14335 </p>
14336 <dl compact="compact">
14337 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
14338 <dt> &lsquo;<samp>height, h</samp>&rsquo;</dt>
14339 <dd><p>Specify an expression for the size of the output image with the
14340 paddings added. If the value for <var>width</var> or <var>height</var> is 0, the
14341 corresponding input size is used for the output.
14342 </p>
14343 <p>The <var>width</var> expression can reference the value set by the
14344 <var>height</var> expression, and vice versa.
14345 </p>
14346 <p>The default value of <var>width</var> and <var>height</var> is 0.
14347 </p>
14348 </dd>
14349 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
14350 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
14351 <dd><p>Specify an expression for the offsets where to place the input image
14352 in the padded area with respect to the top/left border of the output
14353 image.
14354 </p>
14355 <p>The <var>x</var> expression can reference the value set by the <var>y</var>
14356 expression, and vice versa.
14357 </p>
14358 <p>The default value of <var>x</var> and <var>y</var> is 0.
14359 </p>
14360 </dd>
14361 <dt> &lsquo;<samp>color</samp>&rsquo;</dt>
14362 <dd><p>Specify the color of the padded area. For the syntax of this option,
14363 check the &quot;Color&quot; section in the ffmpeg-utils manual.
14364 </p>
14365 <p>The default value of <var>color</var> is &quot;black&quot;.
14366 </p></dd>
14367 </dl>
14368
14369 <p>The value for the <var>width</var>, <var>height</var>, <var>x</var>, and <var>y</var>
14370 options are expressions containing the following constants:
14371 </p>
14372 <dl compact="compact">
14373 <dt> &lsquo;<samp>in_w</samp>&rsquo;</dt>
14374 <dt> &lsquo;<samp>in_h</samp>&rsquo;</dt>
14375 <dd><p>the input video width and height
14376 </p>
14377 </dd>
14378 <dt> &lsquo;<samp>iw</samp>&rsquo;</dt>
14379 <dt> &lsquo;<samp>ih</samp>&rsquo;</dt>
14380 <dd><p>same as <var>in_w</var> and <var>in_h</var>
14381 </p>
14382 </dd>
14383 <dt> &lsquo;<samp>out_w</samp>&rsquo;</dt>
14384 <dt> &lsquo;<samp>out_h</samp>&rsquo;</dt>
14385 <dd><p>the output width and height, that is the size of the padded area as
14386 specified by the <var>width</var> and <var>height</var> expressions
14387 </p>
14388 </dd>
14389 <dt> &lsquo;<samp>ow</samp>&rsquo;</dt>
14390 <dt> &lsquo;<samp>oh</samp>&rsquo;</dt>
14391 <dd><p>same as <var>out_w</var> and <var>out_h</var>
14392 </p>
14393 </dd>
14394 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
14395 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
14396 <dd><p>x and y offsets as specified by the <var>x</var> and <var>y</var>
14397 expressions, or NAN if not yet specified
14398 </p>
14399 </dd>
14400 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
14401 <dd><p>same as <var>iw</var> / <var>ih</var>
14402 </p>
14403 </dd>
14404 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
14405 <dd><p>input sample aspect ratio
14406 </p>
14407 </dd>
14408 <dt> &lsquo;<samp>dar</samp>&rsquo;</dt>
14409 <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
14410 </p>
14411 </dd>
14412 <dt> &lsquo;<samp>hsub</samp>&rsquo;</dt>
14413 <dt> &lsquo;<samp>vsub</samp>&rsquo;</dt>
14414 <dd><p>horizontal and vertical chroma subsample values. For example for the
14415 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
14416 </p></dd>
14417 </dl>
14418
14419 <a name="Examples-52"></a>
14420 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-52">28.62.1 Examples</a></h3>
14421
14422 <ul>
14423 <li>
14424 Add paddings with color &quot;violet&quot; to the input video. Output video
14425 size is 640x480, the top-left corner of the input video is placed at
14426 column 0, row 40:
14427 <table><tr><td>&nbsp;</td><td><pre class="example">pad=640:480:0:40:violet
14428 </pre></td></tr></table>
14429
14430 <p>The example above is equivalent to the following command:
14431 </p><table><tr><td>&nbsp;</td><td><pre class="example">pad=width=640:height=480:x=0:y=40:color=violet
14432 </pre></td></tr></table>
14433
14434 </li><li>
14435 Pad the input to get an output with dimensions increased by 3/2,
14436 and put the input video at the center of the padded area:
14437 <table><tr><td>&nbsp;</td><td><pre class="example">pad=&quot;3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2&quot;
14438 </pre></td></tr></table>
14439
14440 </li><li>
14441 Pad the input to get a squared output with size equal to the maximum
14442 value between the input width and height, and put the input video at
14443 the center of the padded area:
14444 <table><tr><td>&nbsp;</td><td><pre class="example">pad=&quot;max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2&quot;
14445 </pre></td></tr></table>
14446
14447 </li><li>
14448 Pad the input to get a final w/h ratio of 16:9:
14449 <table><tr><td>&nbsp;</td><td><pre class="example">pad=&quot;ih*16/9:ih:(ow-iw)/2:(oh-ih)/2&quot;
14450 </pre></td></tr></table>
14451
14452 </li><li>
14453 In case of anamorphic video, in order to set the output display aspect
14454 correctly, it is necessary to use <var>sar</var> in the expression,
14455 according to the relation:
14456 <table><tr><td>&nbsp;</td><td><pre class="example">(ih * X / ih) * sar = output_dar
14457 X = output_dar / sar
14458 </pre></td></tr></table>
14459
14460 <p>Thus the previous example needs to be modified to:
14461 </p><table><tr><td>&nbsp;</td><td><pre class="example">pad=&quot;ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2&quot;
14462 </pre></td></tr></table>
14463
14464 </li><li>
14465 Double output size and put the input video in the bottom-right
14466 corner of the output padded area:
14467 <table><tr><td>&nbsp;</td><td><pre class="example">pad=&quot;2*iw:2*ih:ow-iw:oh-ih&quot;
14468 </pre></td></tr></table>
14469 </li></ul>
14470
14471 <a name="perspective"></a>
14472 <h2 class="section"><a href="ffplay-all.html#toc-perspective">28.63 perspective</a></h2>
14473
14474 <p>Correct perspective of video not recorded perpendicular to the screen.
14475 </p>
14476 <p>A description of the accepted parameters follows.
14477 </p>
14478 <dl compact="compact">
14479 <dt> &lsquo;<samp>x0</samp>&rsquo;</dt>
14480 <dt> &lsquo;<samp>y0</samp>&rsquo;</dt>
14481 <dt> &lsquo;<samp>x1</samp>&rsquo;</dt>
14482 <dt> &lsquo;<samp>y1</samp>&rsquo;</dt>
14483 <dt> &lsquo;<samp>x2</samp>&rsquo;</dt>
14484 <dt> &lsquo;<samp>y2</samp>&rsquo;</dt>
14485 <dt> &lsquo;<samp>x3</samp>&rsquo;</dt>
14486 <dt> &lsquo;<samp>y3</samp>&rsquo;</dt>
14487 <dd><p>Set coordinates expression for top left, top right, bottom left and bottom right corners.
14488 Default values are <code>0:0:W:0:0:H:W:H</code> with which perspective will remain unchanged.
14489 </p>
14490 <p>The expressions can use the following variables:
14491 </p>
14492 <dl compact="compact">
14493 <dt> &lsquo;<samp>W</samp>&rsquo;</dt>
14494 <dt> &lsquo;<samp>H</samp>&rsquo;</dt>
14495 <dd><p>the width and height of video frame.
14496 </p></dd>
14497 </dl>
14498
14499 </dd>
14500 <dt> &lsquo;<samp>interpolation</samp>&rsquo;</dt>
14501 <dd><p>Set interpolation for perspective correction.
14502 </p>
14503 <p>It accepts the following values:
14504 </p><dl compact="compact">
14505 <dt> &lsquo;<samp>linear</samp>&rsquo;</dt>
14506 <dt> &lsquo;<samp>cubic</samp>&rsquo;</dt>
14507 </dl>
14508
14509 <p>Default value is &lsquo;<samp>linear</samp>&rsquo;.
14510 </p></dd>
14511 </dl>
14512
14513 <a name="phase"></a>
14514 <h2 class="section"><a href="ffplay-all.html#toc-phase">28.64 phase</a></h2>
14515
14516 <p>Delay interlaced video by one field time so that the field order changes.
14517 </p>
14518 <p>The intended use is to fix PAL movies that have been captured with the
14519 opposite field order to the film-to-video transfer.
14520 </p>
14521 <p>A description of the accepted parameters follows.
14522 </p>
14523 <dl compact="compact">
14524 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
14525 <dd><p>Set phase mode.
14526 </p>
14527 <p>It accepts the following values:
14528 </p><dl compact="compact">
14529 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
14530 <dd><p>Capture field order top-first, transfer bottom-first.
14531 Filter will delay the bottom field.
14532 </p>
14533 </dd>
14534 <dt> &lsquo;<samp>b</samp>&rsquo;</dt>
14535 <dd><p>Capture field order bottom-first, transfer top-first.
14536 Filter will delay the top field.
14537 </p>
14538 </dd>
14539 <dt> &lsquo;<samp>p</samp>&rsquo;</dt>
14540 <dd><p>Capture and transfer with the same field order. This mode only exists
14541 for the documentation of the other options to refer to, but if you
14542 actually select it, the filter will faithfully do nothing.
14543 </p>
14544 </dd>
14545 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
14546 <dd><p>Capture field order determined automatically by field flags, transfer
14547 opposite.
14548 Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>b</samp>&rsquo; modes on a frame by frame
14549 basis using field flags. If no field information is available,
14550 then this works just like &lsquo;<samp>u</samp>&rsquo;.
14551 </p>
14552 </dd>
14553 <dt> &lsquo;<samp>u</samp>&rsquo;</dt>
14554 <dd><p>Capture unknown or varying, transfer opposite.
14555 Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>b</samp>&rsquo; on a frame by frame basis by
14556 analyzing the images and selecting the alternative that produces best
14557 match between the fields.
14558 </p>
14559 </dd>
14560 <dt> &lsquo;<samp>T</samp>&rsquo;</dt>
14561 <dd><p>Capture top-first, transfer unknown or varying.
14562 Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis.
14563 </p>
14564 </dd>
14565 <dt> &lsquo;<samp>B</samp>&rsquo;</dt>
14566 <dd><p>Capture bottom-first, transfer unknown or varying.
14567 Filter selects among &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis.
14568 </p>
14569 </dd>
14570 <dt> &lsquo;<samp>A</samp>&rsquo;</dt>
14571 <dd><p>Capture determined by field flags, transfer unknown or varying.
14572 Filter selects among &lsquo;<samp>t</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using field flags and
14573 image analysis. If no field information is available, then this works just
14574 like &lsquo;<samp>U</samp>&rsquo;. This is the default mode.
14575 </p>
14576 </dd>
14577 <dt> &lsquo;<samp>U</samp>&rsquo;</dt>
14578 <dd><p>Both capture and transfer unknown or varying.
14579 Filter selects among &lsquo;<samp>t</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis only.
14580 </p></dd>
14581 </dl>
14582 </dd>
14583 </dl>
14584
14585 <a name="pixdesctest"></a>
14586 <h2 class="section"><a href="ffplay-all.html#toc-pixdesctest">28.65 pixdesctest</a></h2>
14587
14588 <p>Pixel format descriptor test filter, mainly useful for internal
14589 testing. The output video should be equal to the input video.
14590 </p>
14591 <p>For example:
14592 </p><table><tr><td>&nbsp;</td><td><pre class="example">format=monow, pixdesctest
14593 </pre></td></tr></table>
14594
14595 <p>can be used to test the monowhite pixel format descriptor definition.
14596 </p>
14597 <a name="pp"></a>
14598 <h2 class="section"><a href="ffplay-all.html#toc-pp">28.66 pp</a></h2>
14599
14600 <p>Enable the specified chain of postprocessing subfilters using libpostproc. This
14601 library should be automatically selected with a GPL build (<code>--enable-gpl</code>).
14602 Subfilters must be separated by &rsquo;/&rsquo; and can be disabled by prepending a &rsquo;-&rsquo;.
14603 Each subfilter and some options have a short and a long name that can be used
14604 interchangeably, i.e. dr/dering are the same.
14605 </p>
14606 <p>The filters accept the following options:
14607 </p>
14608 <dl compact="compact">
14609 <dt> &lsquo;<samp>subfilters</samp>&rsquo;</dt>
14610 <dd><p>Set postprocessing subfilters string.
14611 </p></dd>
14612 </dl>
14613
14614 <p>All subfilters share common options to determine their scope:
14615 </p>
14616 <dl compact="compact">
14617 <dt> &lsquo;<samp>a/autoq</samp>&rsquo;</dt>
14618 <dd><p>Honor the quality commands for this subfilter.
14619 </p>
14620 </dd>
14621 <dt> &lsquo;<samp>c/chrom</samp>&rsquo;</dt>
14622 <dd><p>Do chrominance filtering, too (default).
14623 </p>
14624 </dd>
14625 <dt> &lsquo;<samp>y/nochrom</samp>&rsquo;</dt>
14626 <dd><p>Do luminance filtering only (no chrominance).
14627 </p>
14628 </dd>
14629 <dt> &lsquo;<samp>n/noluma</samp>&rsquo;</dt>
14630 <dd><p>Do chrominance filtering only (no luminance).
14631 </p></dd>
14632 </dl>
14633
14634 <p>These options can be appended after the subfilter name, separated by a &rsquo;|&rsquo;.
14635 </p>
14636 <p>Available subfilters are:
14637 </p>
14638 <dl compact="compact">
14639 <dt> &lsquo;<samp>hb/hdeblock[|difference[|flatness]]</samp>&rsquo;</dt>
14640 <dd><p>Horizontal deblocking filter
14641 </p><dl compact="compact">
14642 <dt> &lsquo;<samp>difference</samp>&rsquo;</dt>
14643 <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
14644 </p></dd>
14645 <dt> &lsquo;<samp>flatness</samp>&rsquo;</dt>
14646 <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
14647 </p></dd>
14648 </dl>
14649
14650 </dd>
14651 <dt> &lsquo;<samp>vb/vdeblock[|difference[|flatness]]</samp>&rsquo;</dt>
14652 <dd><p>Vertical deblocking filter
14653 </p><dl compact="compact">
14654 <dt> &lsquo;<samp>difference</samp>&rsquo;</dt>
14655 <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
14656 </p></dd>
14657 <dt> &lsquo;<samp>flatness</samp>&rsquo;</dt>
14658 <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
14659 </p></dd>
14660 </dl>
14661
14662 </dd>
14663 <dt> &lsquo;<samp>ha/hadeblock[|difference[|flatness]]</samp>&rsquo;</dt>
14664 <dd><p>Accurate horizontal deblocking filter
14665 </p><dl compact="compact">
14666 <dt> &lsquo;<samp>difference</samp>&rsquo;</dt>
14667 <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
14668 </p></dd>
14669 <dt> &lsquo;<samp>flatness</samp>&rsquo;</dt>
14670 <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
14671 </p></dd>
14672 </dl>
14673
14674 </dd>
14675 <dt> &lsquo;<samp>va/vadeblock[|difference[|flatness]]</samp>&rsquo;</dt>
14676 <dd><p>Accurate vertical deblocking filter
14677 </p><dl compact="compact">
14678 <dt> &lsquo;<samp>difference</samp>&rsquo;</dt>
14679 <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
14680 </p></dd>
14681 <dt> &lsquo;<samp>flatness</samp>&rsquo;</dt>
14682 <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
14683 </p></dd>
14684 </dl>
14685 </dd>
14686 </dl>
14687
14688 <p>The horizontal and vertical deblocking filters share the difference and
14689 flatness values so you cannot set different horizontal and vertical
14690 thresholds.
14691 </p>
14692 <dl compact="compact">
14693 <dt> &lsquo;<samp>h1/x1hdeblock</samp>&rsquo;</dt>
14694 <dd><p>Experimental horizontal deblocking filter
14695 </p>
14696 </dd>
14697 <dt> &lsquo;<samp>v1/x1vdeblock</samp>&rsquo;</dt>
14698 <dd><p>Experimental vertical deblocking filter
14699 </p>
14700 </dd>
14701 <dt> &lsquo;<samp>dr/dering</samp>&rsquo;</dt>
14702 <dd><p>Deringing filter
14703 </p>
14704 </dd>
14705 <dt> &lsquo;<samp>tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer</samp>&rsquo;</dt>
14706 <dd><dl compact="compact">
14707 <dt> &lsquo;<samp>threshold1</samp>&rsquo;</dt>
14708 <dd><p>larger -&gt; stronger filtering
14709 </p></dd>
14710 <dt> &lsquo;<samp>threshold2</samp>&rsquo;</dt>
14711 <dd><p>larger -&gt; stronger filtering
14712 </p></dd>
14713 <dt> &lsquo;<samp>threshold3</samp>&rsquo;</dt>
14714 <dd><p>larger -&gt; stronger filtering
14715 </p></dd>
14716 </dl>
14717
14718 </dd>
14719 <dt> &lsquo;<samp>al/autolevels[:f/fullyrange], automatic brightness / contrast correction</samp>&rsquo;</dt>
14720 <dd><dl compact="compact">
14721 <dt> &lsquo;<samp>f/fullyrange</samp>&rsquo;</dt>
14722 <dd><p>Stretch luminance to <code>0-255</code>.
14723 </p></dd>
14724 </dl>
14725
14726 </dd>
14727 <dt> &lsquo;<samp>lb/linblenddeint</samp>&rsquo;</dt>
14728 <dd><p>Linear blend deinterlacing filter that deinterlaces the given block by
14729 filtering all lines with a <code>(1 2 1)</code> filter.
14730 </p>
14731 </dd>
14732 <dt> &lsquo;<samp>li/linipoldeint</samp>&rsquo;</dt>
14733 <dd><p>Linear interpolating deinterlacing filter that deinterlaces the given block by
14734 linearly interpolating every second line.
14735 </p>
14736 </dd>
14737 <dt> &lsquo;<samp>ci/cubicipoldeint</samp>&rsquo;</dt>
14738 <dd><p>Cubic interpolating deinterlacing filter deinterlaces the given block by
14739 cubically interpolating every second line.
14740 </p>
14741 </dd>
14742 <dt> &lsquo;<samp>md/mediandeint</samp>&rsquo;</dt>
14743 <dd><p>Median deinterlacing filter that deinterlaces the given block by applying a
14744 median filter to every second line.
14745 </p>
14746 </dd>
14747 <dt> &lsquo;<samp>fd/ffmpegdeint</samp>&rsquo;</dt>
14748 <dd><p>FFmpeg deinterlacing filter that deinterlaces the given block by filtering every
14749 second line with a <code>(-1 4 2 4 -1)</code> filter.
14750 </p>
14751 </dd>
14752 <dt> &lsquo;<samp>l5/lowpass5</samp>&rsquo;</dt>
14753 <dd><p>Vertically applied FIR lowpass deinterlacing filter that deinterlaces the given
14754 block by filtering all lines with a <code>(-1 2 6 2 -1)</code> filter.
14755 </p>
14756 </dd>
14757 <dt> &lsquo;<samp>fq/forceQuant[|quantizer]</samp>&rsquo;</dt>
14758 <dd><p>Overrides the quantizer table from the input with the constant quantizer you
14759 specify.
14760 </p><dl compact="compact">
14761 <dt> &lsquo;<samp>quantizer</samp>&rsquo;</dt>
14762 <dd><p>Quantizer to use
14763 </p></dd>
14764 </dl>
14765
14766 </dd>
14767 <dt> &lsquo;<samp>de/default</samp>&rsquo;</dt>
14768 <dd><p>Default pp filter combination (<code>hb|a,vb|a,dr|a</code>)
14769 </p>
14770 </dd>
14771 <dt> &lsquo;<samp>fa/fast</samp>&rsquo;</dt>
14772 <dd><p>Fast pp filter combination (<code>h1|a,v1|a,dr|a</code>)
14773 </p>
14774 </dd>
14775 <dt> &lsquo;<samp>ac</samp>&rsquo;</dt>
14776 <dd><p>High quality pp filter combination (<code>ha|a|128|7,va|a,dr|a</code>)
14777 </p></dd>
14778 </dl>
14779
14780 <a name="Examples-11"></a>
14781 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-11">28.66.1 Examples</a></h3>
14782
14783 <ul>
14784 <li>
14785 Apply horizontal and vertical deblocking, deringing and automatic
14786 brightness/contrast:
14787 <table><tr><td>&nbsp;</td><td><pre class="example">pp=hb/vb/dr/al
14788 </pre></td></tr></table>
14789
14790 </li><li>
14791 Apply default filters without brightness/contrast correction:
14792 <table><tr><td>&nbsp;</td><td><pre class="example">pp=de/-al
14793 </pre></td></tr></table>
14794
14795 </li><li>
14796 Apply default filters and temporal denoiser:
14797 <table><tr><td>&nbsp;</td><td><pre class="example">pp=default/tmpnoise|1|2|3
14798 </pre></td></tr></table>
14799
14800 </li><li>
14801 Apply deblocking on luminance only, and switch vertical deblocking on or off
14802 automatically depending on available CPU time:
14803 <table><tr><td>&nbsp;</td><td><pre class="example">pp=hb|y/vb|a
14804 </pre></td></tr></table>
14805 </li></ul>
14806
14807 <a name="psnr"></a>
14808 <h2 class="section"><a href="ffplay-all.html#toc-psnr">28.67 psnr</a></h2>
14809
14810 <p>Obtain the average, maximum and minimum PSNR (Peak Signal to Noise
14811 Ratio) between two input videos.
14812 </p>
14813 <p>This filter takes in input two input videos, the first input is
14814 considered the &quot;main&quot; source and is passed unchanged to the
14815 output. The second input is used as a &quot;reference&quot; video for computing
14816 the PSNR.
14817 </p>
14818 <p>Both video inputs must have the same resolution and pixel format for
14819 this filter to work correctly. Also it assumes that both inputs
14820 have the same number of frames, which are compared one by one.
14821 </p>
14822 <p>The obtained average PSNR is printed through the logging system.
14823 </p>
14824 <p>The filter stores the accumulated MSE (mean squared error) of each
14825 frame, and at the end of the processing it is averaged across all frames
14826 equally, and the following formula is applied to obtain the PSNR:
14827 </p>
14828 <table><tr><td>&nbsp;</td><td><pre class="example">PSNR = 10*log10(MAX^2/MSE)
14829 </pre></td></tr></table>
14830
14831 <p>Where MAX is the average of the maximum values of each component of the
14832 image.
14833 </p>
14834 <p>The description of the accepted parameters follows.
14835 </p>
14836 <dl compact="compact">
14837 <dt> &lsquo;<samp>stats_file, f</samp>&rsquo;</dt>
14838 <dd><p>If specified the filter will use the named file to save the PSNR of
14839 each individual frame.
14840 </p></dd>
14841 </dl>
14842
14843 <p>The file printed if <var>stats_file</var> is selected, contains a sequence of
14844 key/value pairs of the form <var>key</var>:<var>value</var> for each compared
14845 couple of frames.
14846 </p>
14847 <p>A description of each shown parameter follows:
14848 </p>
14849 <dl compact="compact">
14850 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
14851 <dd><p>sequential number of the input frame, starting from 1
14852 </p>
14853 </dd>
14854 <dt> &lsquo;<samp>mse_avg</samp>&rsquo;</dt>
14855 <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
14856 frames, averaged over all the image components.
14857 </p>
14858 </dd>
14859 <dt> &lsquo;<samp>mse_y, mse_u, mse_v, mse_r, mse_g, mse_g, mse_a</samp>&rsquo;</dt>
14860 <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
14861 frames for the component specified by the suffix.
14862 </p>
14863 </dd>
14864 <dt> &lsquo;<samp>psnr_y, psnr_u, psnr_v, psnr_r, psnr_g, psnr_b, psnr_a</samp>&rsquo;</dt>
14865 <dd><p>Peak Signal to Noise ratio of the compared frames for the component
14866 specified by the suffix.
14867 </p></dd>
14868 </dl>
14869
14870 <p>For example:
14871 </p><table><tr><td>&nbsp;</td><td><pre class="example">movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
14872 [main][ref] psnr=&quot;stats_file=stats.log&quot; [out]
14873 </pre></td></tr></table>
14874
14875 <p>On this example the input file being processed is compared with the
14876 reference file &lsquo;<tt>ref_movie.mpg</tt>&rsquo;. The PSNR of each individual frame
14877 is stored in &lsquo;<tt>stats.log</tt>&rsquo;.
14878 </p>
14879 <p><a name="pullup"></a>
14880 </p><a name="pullup-1"></a>
14881 <h2 class="section"><a href="ffplay-all.html#toc-pullup-1">28.68 pullup</a></h2>
14882
14883 <p>Pulldown reversal (inverse telecine) filter, capable of handling mixed
14884 hard-telecine, 24000/1001 fps progressive, and 30000/1001 fps progressive
14885 content.
14886 </p>
14887 <p>The pullup filter is designed to take advantage of future context in making
14888 its decisions. This filter is stateless in the sense that it does not lock
14889 onto a pattern to follow, but it instead looks forward to the following
14890 fields in order to identify matches and rebuild progressive frames.
14891 </p>
14892 <p>To produce content with an even framerate, insert the fps filter after
14893 pullup, use <code>fps=24000/1001</code> if the input frame rate is 29.97fps,
14894 <code>fps=24</code> for 30fps and the (rare) telecined 25fps input.
14895 </p>
14896 <p>The filter accepts the following options:
14897 </p>
14898 <dl compact="compact">
14899 <dt> &lsquo;<samp>jl</samp>&rsquo;</dt>
14900 <dt> &lsquo;<samp>jr</samp>&rsquo;</dt>
14901 <dt> &lsquo;<samp>jt</samp>&rsquo;</dt>
14902 <dt> &lsquo;<samp>jb</samp>&rsquo;</dt>
14903 <dd><p>These options set the amount of &quot;junk&quot; to ignore at the left, right, top, and
14904 bottom of the image, respectively. Left and right are in units of 8 pixels,
14905 while top and bottom are in units of 2 lines.
14906 The default is 8 pixels on each side.
14907 </p>
14908 </dd>
14909 <dt> &lsquo;<samp>sb</samp>&rsquo;</dt>
14910 <dd><p>Set the strict breaks. Setting this option to 1 will reduce the chances of
14911 filter generating an occasional mismatched frame, but it may also cause an
14912 excessive number of frames to be dropped during high motion sequences.
14913 Conversely, setting it to -1 will make filter match fields more easily.
14914 This may help processing of video where there is slight blurring between
14915 the fields, but may also cause there to be interlaced frames in the output.
14916 Default value is <code>0</code>.
14917 </p>
14918 </dd>
14919 <dt> &lsquo;<samp>mp</samp>&rsquo;</dt>
14920 <dd><p>Set the metric plane to use. It accepts the following values:
14921 </p><dl compact="compact">
14922 <dt> &lsquo;<samp>l</samp>&rsquo;</dt>
14923 <dd><p>Use luma plane.
14924 </p>
14925 </dd>
14926 <dt> &lsquo;<samp>u</samp>&rsquo;</dt>
14927 <dd><p>Use chroma blue plane.
14928 </p>
14929 </dd>
14930 <dt> &lsquo;<samp>v</samp>&rsquo;</dt>
14931 <dd><p>Use chroma red plane.
14932 </p></dd>
14933 </dl>
14934
14935 <p>This option may be set to use chroma plane instead of the default luma plane
14936 for doing filter&rsquo;s computations. This may improve accuracy on very clean
14937 source material, but more likely will decrease accuracy, especially if there
14938 is chroma noise (rainbow effect) or any grayscale video.
14939 The main purpose of setting &lsquo;<samp>mp</samp>&rsquo; to a chroma plane is to reduce CPU
14940 load and make pullup usable in realtime on slow machines.
14941 </p></dd>
14942 </dl>
14943
14944 <p>For best results (without duplicated frames in the output file) it is
14945 necessary to change the output frame rate. For example, to inverse
14946 telecine NTSC input:
14947 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i input -vf pullup -r 24000/1001 ...
14948 </pre></td></tr></table>
14949
14950 <a name="removelogo"></a>
14951 <h2 class="section"><a href="ffplay-all.html#toc-removelogo">28.69 removelogo</a></h2>
14952
14953 <p>Suppress a TV station logo, using an image file to determine which
14954 pixels comprise the logo. It works by filling in the pixels that
14955 comprise the logo with neighboring pixels.
14956 </p>
14957 <p>The filter accepts the following options:
14958 </p>
14959 <dl compact="compact">
14960 <dt> &lsquo;<samp>filename, f</samp>&rsquo;</dt>
14961 <dd><p>Set the filter bitmap file, which can be any image format supported by
14962 libavformat. The width and height of the image file must match those of the
14963 video stream being processed.
14964 </p></dd>
14965 </dl>
14966
14967 <p>Pixels in the provided bitmap image with a value of zero are not
14968 considered part of the logo, non-zero pixels are considered part of
14969 the logo. If you use white (255) for the logo and black (0) for the
14970 rest, you will be safe. For making the filter bitmap, it is
14971 recommended to take a screen capture of a black frame with the logo
14972 visible, and then using a threshold filter followed by the erode
14973 filter once or twice.
14974 </p>
14975 <p>If needed, little splotches can be fixed manually. Remember that if
14976 logo pixels are not covered, the filter quality will be much
14977 reduced. Marking too many pixels as part of the logo does not hurt as
14978 much, but it will increase the amount of blurring needed to cover over
14979 the image and will destroy more information than necessary, and extra
14980 pixels will slow things down on a large logo.
14981 </p>
14982 <a name="rotate"></a>
14983 <h2 class="section"><a href="ffplay-all.html#toc-rotate">28.70 rotate</a></h2>
14984
14985 <p>Rotate video by an arbitrary angle expressed in radians.
14986 </p>
14987 <p>The filter accepts the following options:
14988 </p>
14989 <p>A description of the optional parameters follows.
14990 </p><dl compact="compact">
14991 <dt> &lsquo;<samp>angle, a</samp>&rsquo;</dt>
14992 <dd><p>Set an expression for the angle by which to rotate the input video
14993 clockwise, expressed as a number of radians. A negative value will
14994 result in a counter-clockwise rotation. By default it is set to &quot;0&quot;.
14995 </p>
14996 <p>This expression is evaluated for each frame.
14997 </p>
14998 </dd>
14999 <dt> &lsquo;<samp>out_w, ow</samp>&rsquo;</dt>
15000 <dd><p>Set the output width expression, default value is &quot;iw&quot;.
15001 This expression is evaluated just once during configuration.
15002 </p>
15003 </dd>
15004 <dt> &lsquo;<samp>out_h, oh</samp>&rsquo;</dt>
15005 <dd><p>Set the output height expression, default value is &quot;ih&quot;.
15006 This expression is evaluated just once during configuration.
15007 </p>
15008 </dd>
15009 <dt> &lsquo;<samp>bilinear</samp>&rsquo;</dt>
15010 <dd><p>Enable bilinear interpolation if set to 1, a value of 0 disables
15011 it. Default value is 1.
15012 </p>
15013 </dd>
15014 <dt> &lsquo;<samp>fillcolor, c</samp>&rsquo;</dt>
15015 <dd><p>Set the color used to fill the output area not covered by the rotated
15016 image. For the generalsyntax of this option, check the &quot;Color&quot; section in the
15017 ffmpeg-utils manual. If the special value &quot;none&quot; is selected then no
15018 background is printed (useful for example if the background is never shown).
15019 </p>
15020 <p>Default value is &quot;black&quot;.
15021 </p></dd>
15022 </dl>
15023
15024 <p>The expressions for the angle and the output size can contain the
15025 following constants and functions:
15026 </p>
15027 <dl compact="compact">
15028 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
15029 <dd><p>sequential number of the input frame, starting from 0. It is always NAN
15030 before the first frame is filtered.
15031 </p>
15032 </dd>
15033 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
15034 <dd><p>time in seconds of the input frame, it is set to 0 when the filter is
15035 configured. It is always NAN before the first frame is filtered.
15036 </p>
15037 </dd>
15038 <dt> &lsquo;<samp>hsub</samp>&rsquo;</dt>
15039 <dt> &lsquo;<samp>vsub</samp>&rsquo;</dt>
15040 <dd><p>horizontal and vertical chroma subsample values. For example for the
15041 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
15042 </p>
15043 </dd>
15044 <dt> &lsquo;<samp>in_w, iw</samp>&rsquo;</dt>
15045 <dt> &lsquo;<samp>in_h, ih</samp>&rsquo;</dt>
15046 <dd><p>the input video width and height
15047 </p>
15048 </dd>
15049 <dt> &lsquo;<samp>out_w, ow</samp>&rsquo;</dt>
15050 <dt> &lsquo;<samp>out_h, oh</samp>&rsquo;</dt>
15051 <dd><p>the output width and height, that is the size of the padded area as
15052 specified by the <var>width</var> and <var>height</var> expressions
15053 </p>
15054 </dd>
15055 <dt> &lsquo;<samp>rotw(a)</samp>&rsquo;</dt>
15056 <dt> &lsquo;<samp>roth(a)</samp>&rsquo;</dt>
15057 <dd><p>the minimal width/height required for completely containing the input
15058 video rotated by <var>a</var> radians.
15059 </p>
15060 <p>These are only available when computing the &lsquo;<samp>out_w</samp>&rsquo; and
15061 &lsquo;<samp>out_h</samp>&rsquo; expressions.
15062 </p></dd>
15063 </dl>
15064
15065 <a name="Examples-79"></a>
15066 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-79">28.70.1 Examples</a></h3>
15067
15068 <ul>
15069 <li>
15070 Rotate the input by PI/6 radians clockwise:
15071 <table><tr><td>&nbsp;</td><td><pre class="example">rotate=PI/6
15072 </pre></td></tr></table>
15073
15074 </li><li>
15075 Rotate the input by PI/6 radians counter-clockwise:
15076 <table><tr><td>&nbsp;</td><td><pre class="example">rotate=-PI/6
15077 </pre></td></tr></table>
15078
15079 </li><li>
15080 Rotate the input by 45 degrees clockwise:
15081 <table><tr><td>&nbsp;</td><td><pre class="example">rotate=45*PI/180
15082 </pre></td></tr></table>
15083
15084 </li><li>
15085 Apply a constant rotation with period T, starting from an angle of PI/3:
15086 <table><tr><td>&nbsp;</td><td><pre class="example">rotate=PI/3+2*PI*t/T
15087 </pre></td></tr></table>
15088
15089 </li><li>
15090 Make the input video rotation oscillating with a period of T
15091 seconds and an amplitude of A radians:
15092 <table><tr><td>&nbsp;</td><td><pre class="example">rotate=A*sin(2*PI/T*t)
15093 </pre></td></tr></table>
15094
15095 </li><li>
15096 Rotate the video, output size is chosen so that the whole rotating
15097 input video is always completely contained in the output:
15098 <table><tr><td>&nbsp;</td><td><pre class="example">rotate='2*PI*t:ow=hypot(iw,ih):oh=ow'
15099 </pre></td></tr></table>
15100
15101 </li><li>
15102 Rotate the video, reduce the output size so that no background is ever
15103 shown:
15104 <table><tr><td>&nbsp;</td><td><pre class="example">rotate=2*PI*t:ow='min(iw,ih)/sqrt(2)':oh=ow:c=none
15105 </pre></td></tr></table>
15106 </li></ul>
15107
15108 <a name="Commands-5"></a>
15109 <h3 class="subsection"><a href="ffplay-all.html#toc-Commands-5">28.70.2 Commands</a></h3>
15110
15111 <p>The filter supports the following commands:
15112 </p>
15113 <dl compact="compact">
15114 <dt> &lsquo;<samp>a, angle</samp>&rsquo;</dt>
15115 <dd><p>Set the angle expression.
15116 The command accepts the same syntax of the corresponding option.
15117 </p>
15118 <p>If the specified expression is not valid, it is kept at its current
15119 value.
15120 </p></dd>
15121 </dl>
15122
15123 <a name="sab"></a>
15124 <h2 class="section"><a href="ffplay-all.html#toc-sab">28.71 sab</a></h2>
15125
15126 <p>Apply Shape Adaptive Blur.
15127 </p>
15128 <p>The filter accepts the following options:
15129 </p>
15130 <dl compact="compact">
15131 <dt> &lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
15132 <dd><p>Set luma blur filter strength, must be a value in range 0.1-4.0, default
15133 value is 1.0. A greater value will result in a more blurred image, and
15134 in slower processing.
15135 </p>
15136 </dd>
15137 <dt> &lsquo;<samp>luma_pre_filter_radius, lpfr</samp>&rsquo;</dt>
15138 <dd><p>Set luma pre-filter radius, must be a value in the 0.1-2.0 range, default
15139 value is 1.0.
15140 </p>
15141 </dd>
15142 <dt> &lsquo;<samp>luma_strength, ls</samp>&rsquo;</dt>
15143 <dd><p>Set luma maximum difference between pixels to still be considered, must
15144 be a value in the 0.1-100.0 range, default value is 1.0.
15145 </p>
15146 </dd>
15147 <dt> &lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
15148 <dd><p>Set chroma blur filter strength, must be a value in range 0.1-4.0. A
15149 greater value will result in a more blurred image, and in slower
15150 processing.
15151 </p>
15152 </dd>
15153 <dt> &lsquo;<samp>chroma_pre_filter_radius, cpfr</samp>&rsquo;</dt>
15154 <dd><p>Set chroma pre-filter radius, must be a value in the 0.1-2.0 range.
15155 </p>
15156 </dd>
15157 <dt> &lsquo;<samp>chroma_strength, cs</samp>&rsquo;</dt>
15158 <dd><p>Set chroma maximum difference between pixels to still be considered,
15159 must be a value in the 0.1-100.0 range.
15160 </p></dd>
15161 </dl>
15162
15163 <p>Each chroma option value, if not explicitly specified, is set to the
15164 corresponding luma option value.
15165 </p>
15166 <p><a name="scale"></a>
15167 </p><a name="scale-1"></a>
15168 <h2 class="section"><a href="ffplay-all.html#toc-scale-1">28.72 scale</a></h2>
15169
15170 <p>Scale (resize) the input video, using the libswscale library.
15171 </p>
15172 <p>The scale filter forces the output display aspect ratio to be the same
15173 of the input, by changing the output sample aspect ratio.
15174 </p>
15175 <p>If the input image format is different from the format requested by
15176 the next filter, the scale filter will convert the input to the
15177 requested format.
15178 </p>
15179 <a name="Options-6"></a>
15180 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-6">28.72.1 Options</a></h3>
15181 <p>The filter accepts the following options, or any of the options
15182 supported by the libswscale scaler.
15183 </p>
15184 <p>See <a href="ffmpeg-scaler.html#scaler_005foptions">(ffmpeg-scaler)scaler_options</a> for
15185 the complete list of scaler options.
15186 </p>
15187 <dl compact="compact">
15188 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
15189 <dt> &lsquo;<samp>height, h</samp>&rsquo;</dt>
15190 <dd><p>Set the output video dimension expression. Default value is the input
15191 dimension.
15192 </p>
15193 <p>If the value is 0, the input width is used for the output.
15194 </p>
15195 <p>If one of the values is -1, the scale filter will use a value that
15196 maintains the aspect ratio of the input image, calculated from the
15197 other specified dimension. If both of them are -1, the input size is
15198 used
15199 </p>
15200 <p>If one of the values is -n with n &gt; 1, the scale filter will also use a value
15201 that maintains the aspect ratio of the input image, calculated from the other
15202 specified dimension. After that it will, however, make sure that the calculated
15203 dimension is divisible by n and adjust the value if necessary.
15204 </p>
15205 <p>See below for the list of accepted constants for use in the dimension
15206 expression.
15207 </p>
15208 </dd>
15209 <dt> &lsquo;<samp>interl</samp>&rsquo;</dt>
15210 <dd><p>Set the interlacing mode. It accepts the following values:
15211 </p>
15212 <dl compact="compact">
15213 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
15214 <dd><p>Force interlaced aware scaling.
15215 </p>
15216 </dd>
15217 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
15218 <dd><p>Do not apply interlaced scaling.
15219 </p>
15220 </dd>
15221 <dt> &lsquo;<samp>-1</samp>&rsquo;</dt>
15222 <dd><p>Select interlaced aware scaling depending on whether the source frames
15223 are flagged as interlaced or not.
15224 </p></dd>
15225 </dl>
15226
15227 <p>Default value is &lsquo;<samp>0</samp>&rsquo;.
15228 </p>
15229 </dd>
15230 <dt> &lsquo;<samp>flags</samp>&rsquo;</dt>
15231 <dd><p>Set libswscale scaling flags. See
15232 <a href="ffmpeg-scaler.html#sws_005fflags">(ffmpeg-scaler)sws_flags</a> for the
15233 complete list of values. If not explicitly specified the filter applies
15234 the default flags.
15235 </p>
15236 </dd>
15237 <dt> &lsquo;<samp>size, s</samp>&rsquo;</dt>
15238 <dd><p>Set the video size. For the syntax of this option, check the &quot;Video size&quot;
15239 section in the ffmpeg-utils manual.
15240 </p>
15241 </dd>
15242 <dt> &lsquo;<samp>in_color_matrix</samp>&rsquo;</dt>
15243 <dt> &lsquo;<samp>out_color_matrix</samp>&rsquo;</dt>
15244 <dd><p>Set in/output YCbCr color space type.
15245 </p>
15246 <p>This allows the autodetected value to be overridden as well as allows forcing
15247 a specific value used for the output and encoder.
15248 </p>
15249 <p>If not specified, the color space type depends on the pixel format.
15250 </p>
15251 <p>Possible values:
15252 </p>
15253 <dl compact="compact">
15254 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
15255 <dd><p>Choose automatically.
15256 </p>
15257 </dd>
15258 <dt> &lsquo;<samp>bt709</samp>&rsquo;</dt>
15259 <dd><p>Format conforming to International Telecommunication Union (ITU)
15260 Recommendation BT.709.
15261 </p>
15262 </dd>
15263 <dt> &lsquo;<samp>fcc</samp>&rsquo;</dt>
15264 <dd><p>Set color space conforming to the United States Federal Communications
15265 Commission (FCC) Code of Federal Regulations (CFR) Title 47 (2003) 73.682 (a).
15266 </p>
15267 </dd>
15268 <dt> &lsquo;<samp>bt601</samp>&rsquo;</dt>
15269 <dd><p>Set color space conforming to:
15270 </p>
15271 <ul>
15272 <li>
15273 ITU Radiocommunication Sector (ITU-R) Recommendation BT.601
15274
15275 </li><li>
15276 ITU-R Rec. BT.470-6 (1998) Systems B, B1, and G
15277
15278 </li><li>
15279 Society of Motion Picture and Television Engineers (SMPTE) ST 170:2004
15280
15281 </li></ul>
15282
15283 </dd>
15284 <dt> &lsquo;<samp>smpte240m</samp>&rsquo;</dt>
15285 <dd><p>Set color space conforming to SMPTE ST 240:1999.
15286 </p></dd>
15287 </dl>
15288
15289 </dd>
15290 <dt> &lsquo;<samp>in_range</samp>&rsquo;</dt>
15291 <dt> &lsquo;<samp>out_range</samp>&rsquo;</dt>
15292 <dd><p>Set in/output YCbCr sample range.
15293 </p>
15294 <p>This allows the autodetected value to be overridden as well as allows forcing
15295 a specific value used for the output and encoder. If not specified, the
15296 range depends on the pixel format. Possible values:
15297 </p>
15298 <dl compact="compact">
15299 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
15300 <dd><p>Choose automatically.
15301 </p>
15302 </dd>
15303 <dt> &lsquo;<samp>jpeg/full/pc</samp>&rsquo;</dt>
15304 <dd><p>Set full range (0-255 in case of 8-bit luma).
15305 </p>
15306 </dd>
15307 <dt> &lsquo;<samp>mpeg/tv</samp>&rsquo;</dt>
15308 <dd><p>Set &quot;MPEG&quot; range (16-235 in case of 8-bit luma).
15309 </p></dd>
15310 </dl>
15311
15312 </dd>
15313 <dt> &lsquo;<samp>force_original_aspect_ratio</samp>&rsquo;</dt>
15314 <dd><p>Enable decreasing or increasing output video width or height if necessary to
15315 keep the original aspect ratio. Possible values:
15316 </p>
15317 <dl compact="compact">
15318 <dt> &lsquo;<samp>disable</samp>&rsquo;</dt>
15319 <dd><p>Scale the video as specified and disable this feature.
15320 </p>
15321 </dd>
15322 <dt> &lsquo;<samp>decrease</samp>&rsquo;</dt>
15323 <dd><p>The output video dimensions will automatically be decreased if needed.
15324 </p>
15325 </dd>
15326 <dt> &lsquo;<samp>increase</samp>&rsquo;</dt>
15327 <dd><p>The output video dimensions will automatically be increased if needed.
15328 </p>
15329 </dd>
15330 </dl>
15331
15332 <p>One useful instance of this option is that when you know a specific device&rsquo;s
15333 maximum allowed resolution, you can use this to limit the output video to
15334 that, while retaining the aspect ratio. For example, device A allows
15335 1280x720 playback, and your video is 1920x800. Using this option (set it to
15336 decrease) and specifying 1280x720 to the command line makes the output
15337 1280x533.
15338 </p>
15339 <p>Please note that this is a different thing than specifying -1 for &lsquo;<samp>w</samp>&rsquo;
15340 or &lsquo;<samp>h</samp>&rsquo;, you still need to specify the output resolution for this option
15341 to work.
15342 </p>
15343 </dd>
15344 </dl>
15345
15346 <p>The values of the &lsquo;<samp>w</samp>&rsquo; and &lsquo;<samp>h</samp>&rsquo; options are expressions
15347 containing the following constants:
15348 </p>
15349 <dl compact="compact">
15350 <dt> <var>in_w</var></dt>
15351 <dt> <var>in_h</var></dt>
15352 <dd><p>the input width and height
15353 </p>
15354 </dd>
15355 <dt> <var>iw</var></dt>
15356 <dt> <var>ih</var></dt>
15357 <dd><p>same as <var>in_w</var> and <var>in_h</var>
15358 </p>
15359 </dd>
15360 <dt> <var>out_w</var></dt>
15361 <dt> <var>out_h</var></dt>
15362 <dd><p>the output (scaled) width and height
15363 </p>
15364 </dd>
15365 <dt> <var>ow</var></dt>
15366 <dt> <var>oh</var></dt>
15367 <dd><p>same as <var>out_w</var> and <var>out_h</var>
15368 </p>
15369 </dd>
15370 <dt> <var>a</var></dt>
15371 <dd><p>same as <var>iw</var> / <var>ih</var>
15372 </p>
15373 </dd>
15374 <dt> <var>sar</var></dt>
15375 <dd><p>input sample aspect ratio
15376 </p>
15377 </dd>
15378 <dt> <var>dar</var></dt>
15379 <dd><p>input display aspect ratio. Calculated from <code>(iw / ih) * sar</code>.
15380 </p>
15381 </dd>
15382 <dt> <var>hsub</var></dt>
15383 <dt> <var>vsub</var></dt>
15384 <dd><p>horizontal and vertical input chroma subsample values. For example for the
15385 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
15386 </p>
15387 </dd>
15388 <dt> <var>ohsub</var></dt>
15389 <dt> <var>ovsub</var></dt>
15390 <dd><p>horizontal and vertical output chroma subsample values. For example for the
15391 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
15392 </p></dd>
15393 </dl>
15394
15395 <a name="Examples-47"></a>
15396 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-47">28.72.2 Examples</a></h3>
15397
15398 <ul>
15399 <li>
15400 Scale the input video to a size of 200x100:
15401 <table><tr><td>&nbsp;</td><td><pre class="example">scale=w=200:h=100
15402 </pre></td></tr></table>
15403
15404 <p>This is equivalent to:
15405 </p><table><tr><td>&nbsp;</td><td><pre class="example">scale=200:100
15406 </pre></td></tr></table>
15407
15408 <p>or:
15409 </p><table><tr><td>&nbsp;</td><td><pre class="example">scale=200x100
15410 </pre></td></tr></table>
15411
15412 </li><li>
15413 Specify a size abbreviation for the output size:
15414 <table><tr><td>&nbsp;</td><td><pre class="example">scale=qcif
15415 </pre></td></tr></table>
15416
15417 <p>which can also be written as:
15418 </p><table><tr><td>&nbsp;</td><td><pre class="example">scale=size=qcif
15419 </pre></td></tr></table>
15420
15421 </li><li>
15422 Scale the input to 2x:
15423 <table><tr><td>&nbsp;</td><td><pre class="example">scale=w=2*iw:h=2*ih
15424 </pre></td></tr></table>
15425
15426 </li><li>
15427 The above is the same as:
15428 <table><tr><td>&nbsp;</td><td><pre class="example">scale=2*in_w:2*in_h
15429 </pre></td></tr></table>
15430
15431 </li><li>
15432 Scale the input to 2x with forced interlaced scaling:
15433 <table><tr><td>&nbsp;</td><td><pre class="example">scale=2*iw:2*ih:interl=1
15434 </pre></td></tr></table>
15435
15436 </li><li>
15437 Scale the input to half size:
15438 <table><tr><td>&nbsp;</td><td><pre class="example">scale=w=iw/2:h=ih/2
15439 </pre></td></tr></table>
15440
15441 </li><li>
15442 Increase the width, and set the height to the same size:
15443 <table><tr><td>&nbsp;</td><td><pre class="example">scale=3/2*iw:ow
15444 </pre></td></tr></table>
15445
15446 </li><li>
15447 Seek for Greek harmony:
15448 <table><tr><td>&nbsp;</td><td><pre class="example">scale=iw:1/PHI*iw
15449 scale=ih*PHI:ih
15450 </pre></td></tr></table>
15451
15452 </li><li>
15453 Increase the height, and set the width to 3/2 of the height:
15454 <table><tr><td>&nbsp;</td><td><pre class="example">scale=w=3/2*oh:h=3/5*ih
15455 </pre></td></tr></table>
15456
15457 </li><li>
15458 Increase the size, but make the size a multiple of the chroma
15459 subsample values:
15460 <table><tr><td>&nbsp;</td><td><pre class="example">scale=&quot;trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub&quot;
15461 </pre></td></tr></table>
15462
15463 </li><li>
15464 Increase the width to a maximum of 500 pixels, keep the same input
15465 aspect ratio:
15466 <table><tr><td>&nbsp;</td><td><pre class="example">scale=w='min(500\, iw*3/2):h=-1'
15467 </pre></td></tr></table>
15468 </li></ul>
15469
15470 <a name="separatefields"></a>
15471 <h2 class="section"><a href="ffplay-all.html#toc-separatefields">28.73 separatefields</a></h2>
15472
15473 <p>The <code>separatefields</code> takes a frame-based video input and splits
15474 each frame into its components fields, producing a new half height clip
15475 with twice the frame rate and twice the frame count.
15476 </p>
15477 <p>This filter use field-dominance information in frame to decide which
15478 of each pair of fields to place first in the output.
15479 If it gets it wrong use <a href="#setfield">setfield</a> filter before <code>separatefields</code> filter.
15480 </p>
15481 <a name="setdar_002c-setsar"></a>
15482 <h2 class="section"><a href="ffplay-all.html#toc-setdar_002c-setsar">28.74 setdar, setsar</a></h2>
15483
15484 <p>The <code>setdar</code> filter sets the Display Aspect Ratio for the filter
15485 output video.
15486 </p>
15487 <p>This is done by changing the specified Sample (aka Pixel) Aspect
15488 Ratio, according to the following equation:
15489 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>DAR</var> = <var>HORIZONTAL_RESOLUTION</var> / <var>VERTICAL_RESOLUTION</var> * <var>SAR</var>
15490 </pre></td></tr></table>
15491
15492 <p>Keep in mind that the <code>setdar</code> filter does not modify the pixel
15493 dimensions of the video frame. Also the display aspect ratio set by
15494 this filter may be changed by later filters in the filterchain,
15495 e.g. in case of scaling or if another &quot;setdar&quot; or a &quot;setsar&quot; filter is
15496 applied.
15497 </p>
15498 <p>The <code>setsar</code> filter sets the Sample (aka Pixel) Aspect Ratio for
15499 the filter output video.
15500 </p>
15501 <p>Note that as a consequence of the application of this filter, the
15502 output display aspect ratio will change according to the equation
15503 above.
15504 </p>
15505 <p>Keep in mind that the sample aspect ratio set by the <code>setsar</code>
15506 filter may be changed by later filters in the filterchain, e.g. if
15507 another &quot;setsar&quot; or a &quot;setdar&quot; filter is applied.
15508 </p>
15509 <p>The filters accept the following options:
15510 </p>
15511 <dl compact="compact">
15512 <dt> &lsquo;<samp>r, ratio, dar (<code>setdar</code> only), sar (<code>setsar</code> only)</samp>&rsquo;</dt>
15513 <dd><p>Set the aspect ratio used by the filter.
15514 </p>
15515 <p>The parameter can be a floating point number string, an expression, or
15516 a string of the form <var>num</var>:<var>den</var>, where <var>num</var> and
15517 <var>den</var> are the numerator and denominator of the aspect ratio. If
15518 the parameter is not specified, it is assumed the value &quot;0&quot;.
15519 In case the form &quot;<var>num</var>:<var>den</var>&quot; is used, the <code>:</code> character
15520 should be escaped.
15521 </p>
15522 </dd>
15523 <dt> &lsquo;<samp>max</samp>&rsquo;</dt>
15524 <dd><p>Set the maximum integer value to use for expressing numerator and
15525 denominator when reducing the expressed aspect ratio to a rational.
15526 Default value is <code>100</code>.
15527 </p>
15528 </dd>
15529 </dl>
15530
15531 <p>The parameter <var>sar</var> is an expression containing
15532 the following constants:
15533 </p>
15534 <dl compact="compact">
15535 <dt> &lsquo;<samp>E, PI, PHI</samp>&rsquo;</dt>
15536 <dd><p>the corresponding mathematical approximated values for e
15537 (euler number), pi (greek PI), phi (golden ratio)
15538 </p>
15539 </dd>
15540 <dt> &lsquo;<samp>w, h</samp>&rsquo;</dt>
15541 <dd><p>the input width and height
15542 </p>
15543 </dd>
15544 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
15545 <dd><p>same as <var>w</var> / <var>h</var>
15546 </p>
15547 </dd>
15548 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
15549 <dd><p>input sample aspect ratio
15550 </p>
15551 </dd>
15552 <dt> &lsquo;<samp>dar</samp>&rsquo;</dt>
15553 <dd><p>input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>
15554 </p>
15555 </dd>
15556 <dt> &lsquo;<samp>hsub, vsub</samp>&rsquo;</dt>
15557 <dd><p>horizontal and vertical chroma subsample values. For example for the
15558 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
15559 </p></dd>
15560 </dl>
15561
15562 <a name="Examples-76"></a>
15563 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-76">28.74.1 Examples</a></h3>
15564
15565 <ul>
15566 <li>
15567 To change the display aspect ratio to 16:9, specify one of the following:
15568 <table><tr><td>&nbsp;</td><td><pre class="example">setdar=dar=1.77777
15569 setdar=dar=16/9
15570 setdar=dar=1.77777
15571 </pre></td></tr></table>
15572
15573 </li><li>
15574 To change the sample aspect ratio to 10:11, specify:
15575 <table><tr><td>&nbsp;</td><td><pre class="example">setsar=sar=10/11
15576 </pre></td></tr></table>
15577
15578 </li><li>
15579 To set a display aspect ratio of 16:9, and specify a maximum integer value of
15580 1000 in the aspect ratio reduction, use the command:
15581 <table><tr><td>&nbsp;</td><td><pre class="example">setdar=ratio=16/9:max=1000
15582 </pre></td></tr></table>
15583
15584 </li></ul>
15585
15586 <p><a name="setfield"></a>
15587 </p><a name="setfield-1"></a>
15588 <h2 class="section"><a href="ffplay-all.html#toc-setfield-1">28.75 setfield</a></h2>
15589
15590 <p>Force field for the output video frame.
15591 </p>
15592 <p>The <code>setfield</code> filter marks the interlace type field for the
15593 output frames. It does not change the input frame, but only sets the
15594 corresponding property, which affects how the frame is treated by
15595 following filters (e.g. <code>fieldorder</code> or <code>yadif</code>).
15596 </p>
15597 <p>The filter accepts the following options:
15598 </p>
15599 <dl compact="compact">
15600 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
15601 <dd><p>Available values are:
15602 </p>
15603 <dl compact="compact">
15604 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
15605 <dd><p>Keep the same field property.
15606 </p>
15607 </dd>
15608 <dt> &lsquo;<samp>bff</samp>&rsquo;</dt>
15609 <dd><p>Mark the frame as bottom-field-first.
15610 </p>
15611 </dd>
15612 <dt> &lsquo;<samp>tff</samp>&rsquo;</dt>
15613 <dd><p>Mark the frame as top-field-first.
15614 </p>
15615 </dd>
15616 <dt> &lsquo;<samp>prog</samp>&rsquo;</dt>
15617 <dd><p>Mark the frame as progressive.
15618 </p></dd>
15619 </dl>
15620 </dd>
15621 </dl>
15622
15623 <a name="showinfo"></a>
15624 <h2 class="section"><a href="ffplay-all.html#toc-showinfo">28.76 showinfo</a></h2>
15625
15626 <p>Show a line containing various information for each input video frame.
15627 The input video is not modified.
15628 </p>
15629 <p>The shown line contains a sequence of key/value pairs of the form
15630 <var>key</var>:<var>value</var>.
15631 </p>
15632 <p>A description of each shown parameter follows:
15633 </p>
15634 <dl compact="compact">
15635 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
15636 <dd><p>sequential number of the input frame, starting from 0
15637 </p>
15638 </dd>
15639 <dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
15640 <dd><p>Presentation TimeStamp of the input frame, expressed as a number of
15641 time base units. The time base unit depends on the filter input pad.
15642 </p>
15643 </dd>
15644 <dt> &lsquo;<samp>pts_time</samp>&rsquo;</dt>
15645 <dd><p>Presentation TimeStamp of the input frame, expressed as a number of
15646 seconds
15647 </p>
15648 </dd>
15649 <dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
15650 <dd><p>position of the frame in the input stream, -1 if this information in
15651 unavailable and/or meaningless (for example in case of synthetic video)
15652 </p>
15653 </dd>
15654 <dt> &lsquo;<samp>fmt</samp>&rsquo;</dt>
15655 <dd><p>pixel format name
15656 </p>
15657 </dd>
15658 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
15659 <dd><p>sample aspect ratio of the input frame, expressed in the form
15660 <var>num</var>/<var>den</var>
15661 </p>
15662 </dd>
15663 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
15664 <dd><p>size of the input frame. For the syntax of this option, check the &quot;Video size&quot;
15665 section in the ffmpeg-utils manual.
15666 </p>
15667 </dd>
15668 <dt> &lsquo;<samp>i</samp>&rsquo;</dt>
15669 <dd><p>interlaced mode (&quot;P&quot; for &quot;progressive&quot;, &quot;T&quot; for top field first, &quot;B&quot;
15670 for bottom field first)
15671 </p>
15672 </dd>
15673 <dt> &lsquo;<samp>iskey</samp>&rsquo;</dt>
15674 <dd><p>1 if the frame is a key frame, 0 otherwise
15675 </p>
15676 </dd>
15677 <dt> &lsquo;<samp>type</samp>&rsquo;</dt>
15678 <dd><p>picture type of the input frame (&quot;I&quot; for an I-frame, &quot;P&quot; for a
15679 P-frame, &quot;B&quot; for a B-frame, &quot;?&quot; for unknown type).
15680 Check also the documentation of the <code>AVPictureType</code> enum and of
15681 the <code>av_get_picture_type_char</code> function defined in
15682 &lsquo;<tt>libavutil/avutil.h</tt>&rsquo;.
15683 </p>
15684 </dd>
15685 <dt> &lsquo;<samp>checksum</samp>&rsquo;</dt>
15686 <dd><p>Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame
15687 </p>
15688 </dd>
15689 <dt> &lsquo;<samp>plane_checksum</samp>&rsquo;</dt>
15690 <dd><p>Adler-32 checksum (printed in hexadecimal) of each plane of the input frame,
15691 expressed in the form &quot;[<var>c0</var> <var>c1</var> <var>c2</var> <var>c3</var>]&quot;
15692 </p></dd>
15693 </dl>
15694
15695 <p><a name="smartblur"></a>
15696 </p><a name="smartblur-1"></a>
15697 <h2 class="section"><a href="ffplay-all.html#toc-smartblur-1">28.77 smartblur</a></h2>
15698
15699 <p>Blur the input video without impacting the outlines.
15700 </p>
15701 <p>The filter accepts the following options:
15702 </p>
15703 <dl compact="compact">
15704 <dt> &lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
15705 <dd><p>Set the luma radius. The option value must be a float number in
15706 the range [0.1,5.0] that specifies the variance of the gaussian filter
15707 used to blur the image (slower if larger). Default value is 1.0.
15708 </p>
15709 </dd>
15710 <dt> &lsquo;<samp>luma_strength, ls</samp>&rsquo;</dt>
15711 <dd><p>Set the luma strength. The option value must be a float number
15712 in the range [-1.0,1.0] that configures the blurring. A value included
15713 in [0.0,1.0] will blur the image whereas a value included in
15714 [-1.0,0.0] will sharpen the image. Default value is 1.0.
15715 </p>
15716 </dd>
15717 <dt> &lsquo;<samp>luma_threshold, lt</samp>&rsquo;</dt>
15718 <dd><p>Set the luma threshold used as a coefficient to determine
15719 whether a pixel should be blurred or not. The option value must be an
15720 integer in the range [-30,30]. A value of 0 will filter all the image,
15721 a value included in [0,30] will filter flat areas and a value included
15722 in [-30,0] will filter edges. Default value is 0.
15723 </p>
15724 </dd>
15725 <dt> &lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
15726 <dd><p>Set the chroma radius. The option value must be a float number in
15727 the range [0.1,5.0] that specifies the variance of the gaussian filter
15728 used to blur the image (slower if larger). Default value is 1.0.
15729 </p>
15730 </dd>
15731 <dt> &lsquo;<samp>chroma_strength, cs</samp>&rsquo;</dt>
15732 <dd><p>Set the chroma strength. The option value must be a float number
15733 in the range [-1.0,1.0] that configures the blurring. A value included
15734 in [0.0,1.0] will blur the image whereas a value included in
15735 [-1.0,0.0] will sharpen the image. Default value is 1.0.
15736 </p>
15737 </dd>
15738 <dt> &lsquo;<samp>chroma_threshold, ct</samp>&rsquo;</dt>
15739 <dd><p>Set the chroma threshold used as a coefficient to determine
15740 whether a pixel should be blurred or not. The option value must be an
15741 integer in the range [-30,30]. A value of 0 will filter all the image,
15742 a value included in [0,30] will filter flat areas and a value included
15743 in [-30,0] will filter edges. Default value is 0.
15744 </p></dd>
15745 </dl>
15746
15747 <p>If a chroma option is not explicitly set, the corresponding luma value
15748 is set.
15749 </p>
15750 <a name="stereo3d"></a>
15751 <h2 class="section"><a href="ffplay-all.html#toc-stereo3d">28.78 stereo3d</a></h2>
15752
15753 <p>Convert between different stereoscopic image formats.
15754 </p>
15755 <p>The filters accept the following options:
15756 </p>
15757 <dl compact="compact">
15758 <dt> &lsquo;<samp>in</samp>&rsquo;</dt>
15759 <dd><p>Set stereoscopic image format of input.
15760 </p>
15761 <p>Available values for input image formats are:
15762 </p><dl compact="compact">
15763 <dt> &lsquo;<samp>sbsl</samp>&rsquo;</dt>
15764 <dd><p>side by side parallel (left eye left, right eye right)
15765 </p>
15766 </dd>
15767 <dt> &lsquo;<samp>sbsr</samp>&rsquo;</dt>
15768 <dd><p>side by side crosseye (right eye left, left eye right)
15769 </p>
15770 </dd>
15771 <dt> &lsquo;<samp>sbs2l</samp>&rsquo;</dt>
15772 <dd><p>side by side parallel with half width resolution
15773 (left eye left, right eye right)
15774 </p>
15775 </dd>
15776 <dt> &lsquo;<samp>sbs2r</samp>&rsquo;</dt>
15777 <dd><p>side by side crosseye with half width resolution
15778 (right eye left, left eye right)
15779 </p>
15780 </dd>
15781 <dt> &lsquo;<samp>abl</samp>&rsquo;</dt>
15782 <dd><p>above-below (left eye above, right eye below)
15783 </p>
15784 </dd>
15785 <dt> &lsquo;<samp>abr</samp>&rsquo;</dt>
15786 <dd><p>above-below (right eye above, left eye below)
15787 </p>
15788 </dd>
15789 <dt> &lsquo;<samp>ab2l</samp>&rsquo;</dt>
15790 <dd><p>above-below with half height resolution
15791 (left eye above, right eye below)
15792 </p>
15793 </dd>
15794 <dt> &lsquo;<samp>ab2r</samp>&rsquo;</dt>
15795 <dd><p>above-below with half height resolution
15796 (right eye above, left eye below)
15797 </p>
15798 </dd>
15799 <dt> &lsquo;<samp>al</samp>&rsquo;</dt>
15800 <dd><p>alternating frames (left eye first, right eye second)
15801 </p>
15802 </dd>
15803 <dt> &lsquo;<samp>ar</samp>&rsquo;</dt>
15804 <dd><p>alternating frames (right eye first, left eye second)
15805 </p>
15806 <p>Default value is &lsquo;<samp>sbsl</samp>&rsquo;.
15807 </p></dd>
15808 </dl>
15809
15810 </dd>
15811 <dt> &lsquo;<samp>out</samp>&rsquo;</dt>
15812 <dd><p>Set stereoscopic image format of output.
15813 </p>
15814 <p>Available values for output image formats are all the input formats as well as:
15815 </p><dl compact="compact">
15816 <dt> &lsquo;<samp>arbg</samp>&rsquo;</dt>
15817 <dd><p>anaglyph red/blue gray
15818 (red filter on left eye, blue filter on right eye)
15819 </p>
15820 </dd>
15821 <dt> &lsquo;<samp>argg</samp>&rsquo;</dt>
15822 <dd><p>anaglyph red/green gray
15823 (red filter on left eye, green filter on right eye)
15824 </p>
15825 </dd>
15826 <dt> &lsquo;<samp>arcg</samp>&rsquo;</dt>
15827 <dd><p>anaglyph red/cyan gray
15828 (red filter on left eye, cyan filter on right eye)
15829 </p>
15830 </dd>
15831 <dt> &lsquo;<samp>arch</samp>&rsquo;</dt>
15832 <dd><p>anaglyph red/cyan half colored
15833 (red filter on left eye, cyan filter on right eye)
15834 </p>
15835 </dd>
15836 <dt> &lsquo;<samp>arcc</samp>&rsquo;</dt>
15837 <dd><p>anaglyph red/cyan color
15838 (red filter on left eye, cyan filter on right eye)
15839 </p>
15840 </dd>
15841 <dt> &lsquo;<samp>arcd</samp>&rsquo;</dt>
15842 <dd><p>anaglyph red/cyan color optimized with the least squares projection of dubois
15843 (red filter on left eye, cyan filter on right eye)
15844 </p>
15845 </dd>
15846 <dt> &lsquo;<samp>agmg</samp>&rsquo;</dt>
15847 <dd><p>anaglyph green/magenta gray
15848 (green filter on left eye, magenta filter on right eye)
15849 </p>
15850 </dd>
15851 <dt> &lsquo;<samp>agmh</samp>&rsquo;</dt>
15852 <dd><p>anaglyph green/magenta half colored
15853 (green filter on left eye, magenta filter on right eye)
15854 </p>
15855 </dd>
15856 <dt> &lsquo;<samp>agmc</samp>&rsquo;</dt>
15857 <dd><p>anaglyph green/magenta colored
15858 (green filter on left eye, magenta filter on right eye)
15859 </p>
15860 </dd>
15861 <dt> &lsquo;<samp>agmd</samp>&rsquo;</dt>
15862 <dd><p>anaglyph green/magenta color optimized with the least squares projection of dubois
15863 (green filter on left eye, magenta filter on right eye)
15864 </p>
15865 </dd>
15866 <dt> &lsquo;<samp>aybg</samp>&rsquo;</dt>
15867 <dd><p>anaglyph yellow/blue gray
15868 (yellow filter on left eye, blue filter on right eye)
15869 </p>
15870 </dd>
15871 <dt> &lsquo;<samp>aybh</samp>&rsquo;</dt>
15872 <dd><p>anaglyph yellow/blue half colored
15873 (yellow filter on left eye, blue filter on right eye)
15874 </p>
15875 </dd>
15876 <dt> &lsquo;<samp>aybc</samp>&rsquo;</dt>
15877 <dd><p>anaglyph yellow/blue colored
15878 (yellow filter on left eye, blue filter on right eye)
15879 </p>
15880 </dd>
15881 <dt> &lsquo;<samp>aybd</samp>&rsquo;</dt>
15882 <dd><p>anaglyph yellow/blue color optimized with the least squares projection of dubois
15883 (yellow filter on left eye, blue filter on right eye)
15884 </p>
15885 </dd>
15886 <dt> &lsquo;<samp>irl</samp>&rsquo;</dt>
15887 <dd><p>interleaved rows (left eye has top row, right eye starts on next row)
15888 </p>
15889 </dd>
15890 <dt> &lsquo;<samp>irr</samp>&rsquo;</dt>
15891 <dd><p>interleaved rows (right eye has top row, left eye starts on next row)
15892 </p>
15893 </dd>
15894 <dt> &lsquo;<samp>ml</samp>&rsquo;</dt>
15895 <dd><p>mono output (left eye only)
15896 </p>
15897 </dd>
15898 <dt> &lsquo;<samp>mr</samp>&rsquo;</dt>
15899 <dd><p>mono output (right eye only)
15900 </p></dd>
15901 </dl>
15902
15903 <p>Default value is &lsquo;<samp>arcd</samp>&rsquo;.
15904 </p></dd>
15905 </dl>
15906
15907 <a name="Examples-2"></a>
15908 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-2">28.78.1 Examples</a></h3>
15909
15910 <ul>
15911 <li>
15912 Convert input video from side by side parallel to anaglyph yellow/blue dubois:
15913 <table><tr><td>&nbsp;</td><td><pre class="example">stereo3d=sbsl:aybd
15914 </pre></td></tr></table>
15915
15916 </li><li>
15917 Convert input video from above bellow (left eye above, right eye below) to side by side crosseye.
15918 <table><tr><td>&nbsp;</td><td><pre class="example">stereo3d=abl:sbsr
15919 </pre></td></tr></table>
15920 </li></ul>
15921
15922 <a name="spp"></a>
15923 <h2 class="section"><a href="ffplay-all.html#toc-spp">28.79 spp</a></h2>
15924
15925 <p>Apply a simple postprocessing filter that compresses and decompresses the image
15926 at several (or - in the case of &lsquo;<samp>quality</samp>&rsquo; level <code>6</code> - all) shifts
15927 and average the results.
15928 </p>
15929 <p>The filter accepts the following options:
15930 </p>
15931 <dl compact="compact">
15932 <dt> &lsquo;<samp>quality</samp>&rsquo;</dt>
15933 <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
15934 an integer in the range 0-6. If set to <code>0</code>, the filter will have no
15935 effect. A value of <code>6</code> means the higher quality. For each increment of
15936 that value the speed drops by a factor of approximately 2.  Default value is
15937 <code>3</code>.
15938 </p>
15939 </dd>
15940 <dt> &lsquo;<samp>qp</samp>&rsquo;</dt>
15941 <dd><p>Force a constant quantization parameter. If not set, the filter will use the QP
15942 from the video stream (if available).
15943 </p>
15944 </dd>
15945 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
15946 <dd><p>Set thresholding mode. Available modes are:
15947 </p>
15948 <dl compact="compact">
15949 <dt> &lsquo;<samp>hard</samp>&rsquo;</dt>
15950 <dd><p>Set hard thresholding (default).
15951 </p></dd>
15952 <dt> &lsquo;<samp>soft</samp>&rsquo;</dt>
15953 <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
15954 </p></dd>
15955 </dl>
15956
15957 </dd>
15958 <dt> &lsquo;<samp>use_bframe_qp</samp>&rsquo;</dt>
15959 <dd><p>Enable the use of the QP from the B-Frames if set to <code>1</code>. Using this
15960 option may cause flicker since the B-Frames have often larger QP. Default is
15961 <code>0</code> (not enabled).
15962 </p></dd>
15963 </dl>
15964
15965 <p><a name="subtitles"></a>
15966 </p><a name="subtitles-1"></a>
15967 <h2 class="section"><a href="ffplay-all.html#toc-subtitles-1">28.80 subtitles</a></h2>
15968
15969 <p>Draw subtitles on top of input video using the libass library.
15970 </p>
15971 <p>To enable compilation of this filter you need to configure FFmpeg with
15972 <code>--enable-libass</code>. This filter also requires a build with libavcodec and
15973 libavformat to convert the passed subtitles file to ASS (Advanced Substation
15974 Alpha) subtitles format.
15975 </p>
15976 <p>The filter accepts the following options:
15977 </p>
15978 <dl compact="compact">
15979 <dt> &lsquo;<samp>filename, f</samp>&rsquo;</dt>
15980 <dd><p>Set the filename of the subtitle file to read. It must be specified.
15981 </p>
15982 </dd>
15983 <dt> &lsquo;<samp>original_size</samp>&rsquo;</dt>
15984 <dd><p>Specify the size of the original video, the video for which the ASS file
15985 was composed. For the syntax of this option, check the &quot;Video size&quot; section in
15986 the ffmpeg-utils manual. Due to a misdesign in ASS aspect ratio arithmetic,
15987 this is necessary to correctly scale the fonts if the aspect ratio has been
15988 changed.
15989 </p>
15990 </dd>
15991 <dt> &lsquo;<samp>charenc</samp>&rsquo;</dt>
15992 <dd><p>Set subtitles input character encoding. <code>subtitles</code> filter only. Only
15993 useful if not UTF-8.
15994 </p></dd>
15995 </dl>
15996
15997 <p>If the first key is not specified, it is assumed that the first value
15998 specifies the &lsquo;<samp>filename</samp>&rsquo;.
15999 </p>
16000 <p>For example, to render the file &lsquo;<tt>sub.srt</tt>&rsquo; on top of the input
16001 video, use the command:
16002 </p><table><tr><td>&nbsp;</td><td><pre class="example">subtitles=sub.srt
16003 </pre></td></tr></table>
16004
16005 <p>which is equivalent to:
16006 </p><table><tr><td>&nbsp;</td><td><pre class="example">subtitles=filename=sub.srt
16007 </pre></td></tr></table>
16008
16009 <a name="super2xsai"></a>
16010 <h2 class="section"><a href="ffplay-all.html#toc-super2xsai">28.81 super2xsai</a></h2>
16011
16012 <p>Scale the input by 2x and smooth using the Super2xSaI (Scale and
16013 Interpolate) pixel art scaling algorithm.
16014 </p>
16015 <p>Useful for enlarging pixel art images without reducing sharpness.
16016 </p>
16017 <a name="swapuv"></a>
16018 <h2 class="section"><a href="ffplay-all.html#toc-swapuv">28.82 swapuv</a></h2>
16019 <p>Swap U &amp; V plane.
16020 </p>
16021 <a name="telecine"></a>
16022 <h2 class="section"><a href="ffplay-all.html#toc-telecine">28.83 telecine</a></h2>
16023
16024 <p>Apply telecine process to the video.
16025 </p>
16026 <p>This filter accepts the following options:
16027 </p>
16028 <dl compact="compact">
16029 <dt> &lsquo;<samp>first_field</samp>&rsquo;</dt>
16030 <dd><dl compact="compact">
16031 <dt> &lsquo;<samp>top, t</samp>&rsquo;</dt>
16032 <dd><p>top field first
16033 </p></dd>
16034 <dt> &lsquo;<samp>bottom, b</samp>&rsquo;</dt>
16035 <dd><p>bottom field first
16036 The default value is <code>top</code>.
16037 </p></dd>
16038 </dl>
16039
16040 </dd>
16041 <dt> &lsquo;<samp>pattern</samp>&rsquo;</dt>
16042 <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
16043 The default value is <code>23</code>.
16044 </p></dd>
16045 </dl>
16046
16047 <table><tr><td>&nbsp;</td><td><pre class="example">Some typical patterns:
16048
16049 NTSC output (30i):
16050 27.5p: 32222
16051 24p: 23 (classic)
16052 24p: 2332 (preferred)
16053 20p: 33
16054 18p: 334
16055 16p: 3444
16056
16057 PAL output (25i):
16058 27.5p: 12222
16059 24p: 222222222223 (&quot;Euro pulldown&quot;)
16060 16.67p: 33
16061 16p: 33333334
16062 </pre></td></tr></table>
16063
16064 <a name="thumbnail"></a>
16065 <h2 class="section"><a href="ffplay-all.html#toc-thumbnail">28.84 thumbnail</a></h2>
16066 <p>Select the most representative frame in a given sequence of consecutive frames.
16067 </p>
16068 <p>The filter accepts the following options:
16069 </p>
16070 <dl compact="compact">
16071 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
16072 <dd><p>Set the frames batch size to analyze; in a set of <var>n</var> frames, the filter
16073 will pick one of them, and then handle the next batch of <var>n</var> frames until
16074 the end. Default is <code>100</code>.
16075 </p></dd>
16076 </dl>
16077
16078 <p>Since the filter keeps track of the whole frames sequence, a bigger <var>n</var>
16079 value will result in a higher memory usage, so a high value is not recommended.
16080 </p>
16081 <a name="Examples-9"></a>
16082 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-9">28.84.1 Examples</a></h3>
16083
16084 <ul>
16085 <li>
16086 Extract one picture each 50 frames:
16087 <table><tr><td>&nbsp;</td><td><pre class="example">thumbnail=50
16088 </pre></td></tr></table>
16089
16090 </li><li>
16091 Complete example of a thumbnail creation with <code>ffmpeg</code>:
16092 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
16093 </pre></td></tr></table>
16094 </li></ul>
16095
16096 <a name="tile"></a>
16097 <h2 class="section"><a href="ffplay-all.html#toc-tile">28.85 tile</a></h2>
16098
16099 <p>Tile several successive frames together.
16100 </p>
16101 <p>The filter accepts the following options:
16102 </p>
16103 <dl compact="compact">
16104 <dt> &lsquo;<samp>layout</samp>&rsquo;</dt>
16105 <dd><p>Set the grid size (i.e. the number of lines and columns). For the syntax of
16106 this option, check the &quot;Video size&quot; section in the ffmpeg-utils manual.
16107 </p>
16108 </dd>
16109 <dt> &lsquo;<samp>nb_frames</samp>&rsquo;</dt>
16110 <dd><p>Set the maximum number of frames to render in the given area. It must be less
16111 than or equal to <var>w</var>x<var>h</var>. The default value is <code>0</code>, meaning all
16112 the area will be used.
16113 </p>
16114 </dd>
16115 <dt> &lsquo;<samp>margin</samp>&rsquo;</dt>
16116 <dd><p>Set the outer border margin in pixels.
16117 </p>
16118 </dd>
16119 <dt> &lsquo;<samp>padding</samp>&rsquo;</dt>
16120 <dd><p>Set the inner border thickness (i.e. the number of pixels between frames). For
16121 more advanced padding options (such as having different values for the edges),
16122 refer to the pad video filter.
16123 </p>
16124 </dd>
16125 <dt> &lsquo;<samp>color</samp>&rsquo;</dt>
16126 <dd><p>Specify the color of the unused areaFor the syntax of this option, check the
16127 &quot;Color&quot; section in the ffmpeg-utils manual. The default value of <var>color</var>
16128 is &quot;black&quot;.
16129 </p></dd>
16130 </dl>
16131
16132 <a name="Examples-70"></a>
16133 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-70">28.85.1 Examples</a></h3>
16134
16135 <ul>
16136 <li>
16137 Produce 8x8 PNG tiles of all keyframes (&lsquo;<samp>-skip_frame nokey</samp>&rsquo;) in a movie:
16138 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
16139 </pre></td></tr></table>
16140 <p>The &lsquo;<samp>-vsync 0</samp>&rsquo; is necessary to prevent <code>ffmpeg</code> from
16141 duplicating each output frame to accommodate the originally detected frame
16142 rate.
16143 </p>
16144 </li><li>
16145 Display <code>5</code> pictures in an area of <code>3x2</code> frames,
16146 with <code>7</code> pixels between them, and <code>2</code> pixels of initial margin, using
16147 mixed flat and named options:
16148 <table><tr><td>&nbsp;</td><td><pre class="example">tile=3x2:nb_frames=5:padding=7:margin=2
16149 </pre></td></tr></table>
16150 </li></ul>
16151
16152 <a name="tinterlace"></a>
16153 <h2 class="section"><a href="ffplay-all.html#toc-tinterlace">28.86 tinterlace</a></h2>
16154
16155 <p>Perform various types of temporal field interlacing.
16156 </p>
16157 <p>Frames are counted starting from 1, so the first input frame is
16158 considered odd.
16159 </p>
16160 <p>The filter accepts the following options:
16161 </p>
16162 <dl compact="compact">
16163 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
16164 <dd><p>Specify the mode of the interlacing. This option can also be specified
16165 as a value alone. See below for a list of values for this option.
16166 </p>
16167 <p>Available values are:
16168 </p>
16169 <dl compact="compact">
16170 <dt> &lsquo;<samp>merge, 0</samp>&rsquo;</dt>
16171 <dd><p>Move odd frames into the upper field, even into the lower field,
16172 generating a double height frame at half frame rate.
16173 </p>
16174 </dd>
16175 <dt> &lsquo;<samp>drop_odd, 1</samp>&rsquo;</dt>
16176 <dd><p>Only output even frames, odd frames are dropped, generating a frame with
16177 unchanged height at half frame rate.
16178 </p>
16179 </dd>
16180 <dt> &lsquo;<samp>drop_even, 2</samp>&rsquo;</dt>
16181 <dd><p>Only output odd frames, even frames are dropped, generating a frame with
16182 unchanged height at half frame rate.
16183 </p>
16184 </dd>
16185 <dt> &lsquo;<samp>pad, 3</samp>&rsquo;</dt>
16186 <dd><p>Expand each frame to full height, but pad alternate lines with black,
16187 generating a frame with double height at the same input frame rate.
16188 </p>
16189 </dd>
16190 <dt> &lsquo;<samp>interleave_top, 4</samp>&rsquo;</dt>
16191 <dd><p>Interleave the upper field from odd frames with the lower field from
16192 even frames, generating a frame with unchanged height at half frame rate.
16193 </p>
16194 </dd>
16195 <dt> &lsquo;<samp>interleave_bottom, 5</samp>&rsquo;</dt>
16196 <dd><p>Interleave the lower field from odd frames with the upper field from
16197 even frames, generating a frame with unchanged height at half frame rate.
16198 </p>
16199 </dd>
16200 <dt> &lsquo;<samp>interlacex2, 6</samp>&rsquo;</dt>
16201 <dd><p>Double frame rate with unchanged height. Frames are inserted each
16202 containing the second temporal field from the previous input frame and
16203 the first temporal field from the next input frame. This mode relies on
16204 the top_field_first flag. Useful for interlaced video displays with no
16205 field synchronisation.
16206 </p></dd>
16207 </dl>
16208
16209 <p>Numeric values are deprecated but are accepted for backward
16210 compatibility reasons.
16211 </p>
16212 <p>Default mode is <code>merge</code>.
16213 </p>
16214 </dd>
16215 <dt> &lsquo;<samp>flags</samp>&rsquo;</dt>
16216 <dd><p>Specify flags influencing the filter process.
16217 </p>
16218 <p>Available value for <var>flags</var> is:
16219 </p>
16220 <dl compact="compact">
16221 <dt> &lsquo;<samp>low_pass_filter, vlfp</samp>&rsquo;</dt>
16222 <dd><p>Enable vertical low-pass filtering in the filter.
16223 Vertical low-pass filtering is required when creating an interlaced
16224 destination from a progressive source which contains high-frequency
16225 vertical detail. Filtering will reduce interlace &rsquo;twitter&rsquo; and Moire
16226 patterning.
16227 </p>
16228 <p>Vertical low-pass filtering can only be enabled for &lsquo;<samp>mode</samp>&rsquo;
16229 <var>interleave_top</var> and <var>interleave_bottom</var>.
16230 </p>
16231 </dd>
16232 </dl>
16233 </dd>
16234 </dl>
16235
16236 <a name="transpose"></a>
16237 <h2 class="section"><a href="ffplay-all.html#toc-transpose">28.87 transpose</a></h2>
16238
16239 <p>Transpose rows with columns in the input video and optionally flip it.
16240 </p>
16241 <p>This filter accepts the following options:
16242 </p>
16243 <dl compact="compact">
16244 <dt> &lsquo;<samp>dir</samp>&rsquo;</dt>
16245 <dd><p>Specify the transposition direction.
16246 </p>
16247 <p>Can assume the following values:
16248 </p><dl compact="compact">
16249 <dt> &lsquo;<samp>0, 4, cclock_flip</samp>&rsquo;</dt>
16250 <dd><p>Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
16251 </p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     L.l
16252 . . -&gt;  . .
16253 l.r     R.r
16254 </pre></td></tr></table>
16255
16256 </dd>
16257 <dt> &lsquo;<samp>1, 5, clock</samp>&rsquo;</dt>
16258 <dd><p>Rotate by 90 degrees clockwise, that is:
16259 </p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     l.L
16260 . . -&gt;  . .
16261 l.r     r.R
16262 </pre></td></tr></table>
16263
16264 </dd>
16265 <dt> &lsquo;<samp>2, 6, cclock</samp>&rsquo;</dt>
16266 <dd><p>Rotate by 90 degrees counterclockwise, that is:
16267 </p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     R.r
16268 . . -&gt;  . .
16269 l.r     L.l
16270 </pre></td></tr></table>
16271
16272 </dd>
16273 <dt> &lsquo;<samp>3, 7, clock_flip</samp>&rsquo;</dt>
16274 <dd><p>Rotate by 90 degrees clockwise and vertically flip, that is:
16275 </p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     r.R
16276 . . -&gt;  . .
16277 l.r     l.L
16278 </pre></td></tr></table>
16279 </dd>
16280 </dl>
16281
16282 <p>For values between 4-7, the transposition is only done if the input
16283 video geometry is portrait and not landscape. These values are
16284 deprecated, the <code>passthrough</code> option should be used instead.
16285 </p>
16286 <p>Numerical values are deprecated, and should be dropped in favor of
16287 symbolic constants.
16288 </p>
16289 </dd>
16290 <dt> &lsquo;<samp>passthrough</samp>&rsquo;</dt>
16291 <dd><p>Do not apply the transposition if the input geometry matches the one
16292 specified by the specified value. It accepts the following values:
16293 </p><dl compact="compact">
16294 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
16295 <dd><p>Always apply transposition.
16296 </p></dd>
16297 <dt> &lsquo;<samp>portrait</samp>&rsquo;</dt>
16298 <dd><p>Preserve portrait geometry (when <var>height</var> &gt;= <var>width</var>).
16299 </p></dd>
16300 <dt> &lsquo;<samp>landscape</samp>&rsquo;</dt>
16301 <dd><p>Preserve landscape geometry (when <var>width</var> &gt;= <var>height</var>).
16302 </p></dd>
16303 </dl>
16304
16305 <p>Default value is <code>none</code>.
16306 </p></dd>
16307 </dl>
16308
16309 <p>For example to rotate by 90 degrees clockwise and preserve portrait
16310 layout:
16311 </p><table><tr><td>&nbsp;</td><td><pre class="example">transpose=dir=1:passthrough=portrait
16312 </pre></td></tr></table>
16313
16314 <p>The command above can also be specified as:
16315 </p><table><tr><td>&nbsp;</td><td><pre class="example">transpose=1:portrait
16316 </pre></td></tr></table>
16317
16318 <a name="trim"></a>
16319 <h2 class="section"><a href="ffplay-all.html#toc-trim">28.88 trim</a></h2>
16320 <p>Trim the input so that the output contains one continuous subpart of the input.
16321 </p>
16322 <p>This filter accepts the following options:
16323 </p><dl compact="compact">
16324 <dt> &lsquo;<samp>start</samp>&rsquo;</dt>
16325 <dd><p>Specify time of the start of the kept section, i.e. the frame with the
16326 timestamp <var>start</var> will be the first frame in the output.
16327 </p>
16328 </dd>
16329 <dt> &lsquo;<samp>end</samp>&rsquo;</dt>
16330 <dd><p>Specify time of the first frame that will be dropped, i.e. the frame
16331 immediately preceding the one with the timestamp <var>end</var> will be the last
16332 frame in the output.
16333 </p>
16334 </dd>
16335 <dt> &lsquo;<samp>start_pts</samp>&rsquo;</dt>
16336 <dd><p>Same as <var>start</var>, except this option sets the start timestamp in timebase
16337 units instead of seconds.
16338 </p>
16339 </dd>
16340 <dt> &lsquo;<samp>end_pts</samp>&rsquo;</dt>
16341 <dd><p>Same as <var>end</var>, except this option sets the end timestamp in timebase units
16342 instead of seconds.
16343 </p>
16344 </dd>
16345 <dt> &lsquo;<samp>duration</samp>&rsquo;</dt>
16346 <dd><p>Specify maximum duration of the output.
16347 </p>
16348 </dd>
16349 <dt> &lsquo;<samp>start_frame</samp>&rsquo;</dt>
16350 <dd><p>Number of the first frame that should be passed to output.
16351 </p>
16352 </dd>
16353 <dt> &lsquo;<samp>end_frame</samp>&rsquo;</dt>
16354 <dd><p>Number of the first frame that should be dropped.
16355 </p></dd>
16356 </dl>
16357
16358 <p>&lsquo;<samp>start</samp>&rsquo;, &lsquo;<samp>end</samp>&rsquo;, &lsquo;<samp>duration</samp>&rsquo; are expressed as time
16359 duration specifications, check the &quot;Time duration&quot; section in the
16360 ffmpeg-utils manual.
16361 </p>
16362 <p>Note that the first two sets of the start/end options and the &lsquo;<samp>duration</samp>&rsquo;
16363 option look at the frame timestamp, while the _frame variants simply count the
16364 frames that pass through the filter. Also note that this filter does not modify
16365 the timestamps. If you wish that the output timestamps start at zero, insert a
16366 setpts filter after the trim filter.
16367 </p>
16368 <p>If multiple start or end options are set, this filter tries to be greedy and
16369 keep all the frames that match at least one of the specified constraints. To keep
16370 only the part that matches all the constraints at once, chain multiple trim
16371 filters.
16372 </p>
16373 <p>The defaults are such that all the input is kept. So it is possible to set e.g.
16374 just the end values to keep everything before the specified time.
16375 </p>
16376 <p>Examples:
16377 </p><ul>
16378 <li>
16379 drop everything except the second minute of input
16380 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -vf trim=60:120
16381 </pre></td></tr></table>
16382
16383 </li><li>
16384 keep only the first second
16385 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -vf trim=duration=1
16386 </pre></td></tr></table>
16387
16388 </li></ul>
16389
16390
16391 <a name="unsharp"></a>
16392 <h2 class="section"><a href="ffplay-all.html#toc-unsharp">28.89 unsharp</a></h2>
16393
16394 <p>Sharpen or blur the input video.
16395 </p>
16396 <p>It accepts the following parameters:
16397 </p>
16398 <dl compact="compact">
16399 <dt> &lsquo;<samp>luma_msize_x, lx</samp>&rsquo;</dt>
16400 <dd><p>Set the luma matrix horizontal size. It must be an odd integer between
16401 3 and 63, default value is 5.
16402 </p>
16403 </dd>
16404 <dt> &lsquo;<samp>luma_msize_y, ly</samp>&rsquo;</dt>
16405 <dd><p>Set the luma matrix vertical size. It must be an odd integer between 3
16406 and 63, default value is 5.
16407 </p>
16408 </dd>
16409 <dt> &lsquo;<samp>luma_amount, la</samp>&rsquo;</dt>
16410 <dd><p>Set the luma effect strength. It can be a float number, reasonable
16411 values lay between -1.5 and 1.5.
16412 </p>
16413 <p>Negative values will blur the input video, while positive values will
16414 sharpen it, a value of zero will disable the effect.
16415 </p>
16416 <p>Default value is 1.0.
16417 </p>
16418 </dd>
16419 <dt> &lsquo;<samp>chroma_msize_x, cx</samp>&rsquo;</dt>
16420 <dd><p>Set the chroma matrix horizontal size. It must be an odd integer
16421 between 3 and 63, default value is 5.
16422 </p>
16423 </dd>
16424 <dt> &lsquo;<samp>chroma_msize_y, cy</samp>&rsquo;</dt>
16425 <dd><p>Set the chroma matrix vertical size. It must be an odd integer
16426 between 3 and 63, default value is 5.
16427 </p>
16428 </dd>
16429 <dt> &lsquo;<samp>chroma_amount, ca</samp>&rsquo;</dt>
16430 <dd><p>Set the chroma effect strength. It can be a float number, reasonable
16431 values lay between -1.5 and 1.5.
16432 </p>
16433 <p>Negative values will blur the input video, while positive values will
16434 sharpen it, a value of zero will disable the effect.
16435 </p>
16436 <p>Default value is 0.0.
16437 </p>
16438 </dd>
16439 <dt> &lsquo;<samp>opencl</samp>&rsquo;</dt>
16440 <dd><p>If set to 1, specify using OpenCL capabilities, only available if
16441 FFmpeg was configured with <code>--enable-opencl</code>. Default value is 0.
16442 </p>
16443 </dd>
16444 </dl>
16445
16446 <p>All parameters are optional and default to the equivalent of the
16447 string &rsquo;5:5:1.0:5:5:0.0&rsquo;.
16448 </p>
16449 <a name="Examples-81"></a>
16450 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-81">28.89.1 Examples</a></h3>
16451
16452 <ul>
16453 <li>
16454 Apply strong luma sharpen effect:
16455 <table><tr><td>&nbsp;</td><td><pre class="example">unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
16456 </pre></td></tr></table>
16457
16458 </li><li>
16459 Apply strong blur of both luma and chroma parameters:
16460 <table><tr><td>&nbsp;</td><td><pre class="example">unsharp=7:7:-2:7:7:-2
16461 </pre></td></tr></table>
16462 </li></ul>
16463
16464 <p><a name="vidstabdetect"></a>
16465 </p><a name="vidstabdetect-1"></a>
16466 <h2 class="section"><a href="ffplay-all.html#toc-vidstabdetect-1">28.90 vidstabdetect</a></h2>
16467
16468 <p>Analyze video stabilization/deshaking. Perform pass 1 of 2, see
16469 <a href="#vidstabtransform">vidstabtransform</a> for pass 2.
16470 </p>
16471 <p>This filter generates a file with relative translation and rotation
16472 transform information about subsequent frames, which is then used by
16473 the <a href="#vidstabtransform">vidstabtransform</a> filter.
16474 </p>
16475 <p>To enable compilation of this filter you need to configure FFmpeg with
16476 <code>--enable-libvidstab</code>.
16477 </p>
16478 <p>This filter accepts the following options:
16479 </p>
16480 <dl compact="compact">
16481 <dt> &lsquo;<samp>result</samp>&rsquo;</dt>
16482 <dd><p>Set the path to the file used to write the transforms information.
16483 Default value is &lsquo;<tt>transforms.trf</tt>&rsquo;.
16484 </p>
16485 </dd>
16486 <dt> &lsquo;<samp>shakiness</samp>&rsquo;</dt>
16487 <dd><p>Set how shaky the video is and how quick the camera is. It accepts an
16488 integer in the range 1-10, a value of 1 means little shakiness, a
16489 value of 10 means strong shakiness. Default value is 5.
16490 </p>
16491 </dd>
16492 <dt> &lsquo;<samp>accuracy</samp>&rsquo;</dt>
16493 <dd><p>Set the accuracy of the detection process. It must be a value in the
16494 range 1-15. A value of 1 means low accuracy, a value of 15 means high
16495 accuracy. Default value is 15.
16496 </p>
16497 </dd>
16498 <dt> &lsquo;<samp>stepsize</samp>&rsquo;</dt>
16499 <dd><p>Set stepsize of the search process. The region around minimum is
16500 scanned with 1 pixel resolution. Default value is 6.
16501 </p>
16502 </dd>
16503 <dt> &lsquo;<samp>mincontrast</samp>&rsquo;</dt>
16504 <dd><p>Set minimum contrast. Below this value a local measurement field is
16505 discarded. Must be a floating point value in the range 0-1. Default
16506 value is 0.3.
16507 </p>
16508 </dd>
16509 <dt> &lsquo;<samp>tripod</samp>&rsquo;</dt>
16510 <dd><p>Set reference frame number for tripod mode.
16511 </p>
16512 <p>If enabled, the motion of the frames is compared to a reference frame
16513 in the filtered stream, identified by the specified number. The idea
16514 is to compensate all movements in a more-or-less static scene and keep
16515 the camera view absolutely still.
16516 </p>
16517 <p>If set to 0, it is disabled. The frames are counted starting from 1.
16518 </p>
16519 </dd>
16520 <dt> &lsquo;<samp>show</samp>&rsquo;</dt>
16521 <dd><p>Show fields and transforms in the resulting frames. It accepts an
16522 integer in the range 0-2. Default value is 0, which disables any
16523 visualization.
16524 </p></dd>
16525 </dl>
16526
16527 <a name="Examples-29"></a>
16528 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-29">28.90.1 Examples</a></h3>
16529
16530 <ul>
16531 <li>
16532 Use default values:
16533 <table><tr><td>&nbsp;</td><td><pre class="example">vidstabdetect
16534 </pre></td></tr></table>
16535
16536 </li><li>
16537 Analyze strongly shaky movie and put the results in file
16538 &lsquo;<tt>mytransforms.trf</tt>&rsquo;:
16539 <table><tr><td>&nbsp;</td><td><pre class="example">vidstabdetect=shakiness=10:accuracy=15:result=&quot;mytransforms.trf&quot;
16540 </pre></td></tr></table>
16541
16542 </li><li>
16543 Visualize the result of internal transformations in the resulting
16544 video:
16545 <table><tr><td>&nbsp;</td><td><pre class="example">vidstabdetect=show=1
16546 </pre></td></tr></table>
16547
16548 </li><li>
16549 Analyze a video with medium shakiness using <code>ffmpeg</code>:
16550 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i input -vf vidstabdetect=shakiness=5:show=1 dummy.avi
16551 </pre></td></tr></table>
16552 </li></ul>
16553
16554 <p><a name="vidstabtransform"></a>
16555 </p><a name="vidstabtransform-1"></a>
16556 <h2 class="section"><a href="ffplay-all.html#toc-vidstabtransform-1">28.91 vidstabtransform</a></h2>
16557
16558 <p>Video stabilization/deshaking: pass 2 of 2,
16559 see <a href="#vidstabdetect">vidstabdetect</a> for pass 1.
16560 </p>
16561 <p>Read a file with transform information for each frame and
16562 apply/compensate them. Together with the <a href="#vidstabdetect">vidstabdetect</a>
16563 filter this can be used to deshake videos. See also
16564 <a href="http://public.hronopik.de/vid.stab">http://public.hronopik.de/vid.stab</a>. It is important to also use
16565 the unsharp filter, see below.
16566 </p>
16567 <p>To enable compilation of this filter you need to configure FFmpeg with
16568 <code>--enable-libvidstab</code>.
16569 </p>
16570 <a name="Options-5"></a>
16571 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-5">28.91.1 Options</a></h3>
16572
16573 <dl compact="compact">
16574 <dt> &lsquo;<samp>input</samp>&rsquo;</dt>
16575 <dd><p>Set path to the file used to read the transforms. Default value is
16576 &lsquo;<tt>transforms.trf</tt>&rsquo;).
16577 </p>
16578 </dd>
16579 <dt> &lsquo;<samp>smoothing</samp>&rsquo;</dt>
16580 <dd><p>Set the number of frames (value*2 + 1) used for lowpass filtering the
16581 camera movements. Default value is 10.
16582 </p>
16583 <p>For example a number of 10 means that 21 frames are used (10 in the
16584 past and 10 in the future) to smoothen the motion in the video. A
16585 larger values leads to a smoother video, but limits the acceleration
16586 of the camera (pan/tilt movements). 0 is a special case where a
16587 static camera is simulated.
16588 </p>
16589 </dd>
16590 <dt> &lsquo;<samp>optalgo</samp>&rsquo;</dt>
16591 <dd><p>Set the camera path optimization algorithm.
16592 </p>
16593 <p>Accepted values are:
16594 </p><dl compact="compact">
16595 <dt> &lsquo;<samp>gauss</samp>&rsquo;</dt>
16596 <dd><p>gaussian kernel low-pass filter on camera motion (default)
16597 </p></dd>
16598 <dt> &lsquo;<samp>avg</samp>&rsquo;</dt>
16599 <dd><p>averaging on transformations
16600 </p></dd>
16601 </dl>
16602
16603 </dd>
16604 <dt> &lsquo;<samp>maxshift</samp>&rsquo;</dt>
16605 <dd><p>Set maximal number of pixels to translate frames. Default value is -1,
16606 meaning no limit.
16607 </p>
16608 </dd>
16609 <dt> &lsquo;<samp>maxangle</samp>&rsquo;</dt>
16610 <dd><p>Set maximal angle in radians (degree*PI/180) to rotate frames. Default
16611 value is -1, meaning no limit.
16612 </p>
16613 </dd>
16614 <dt> &lsquo;<samp>crop</samp>&rsquo;</dt>
16615 <dd><p>Specify how to deal with borders that may be visible due to movement
16616 compensation.
16617 </p>
16618 <p>Available values are:
16619 </p><dl compact="compact">
16620 <dt> &lsquo;<samp>keep</samp>&rsquo;</dt>
16621 <dd><p>keep image information from previous frame (default)
16622 </p></dd>
16623 <dt> &lsquo;<samp>black</samp>&rsquo;</dt>
16624 <dd><p>fill the border black
16625 </p></dd>
16626 </dl>
16627
16628 </dd>
16629 <dt> &lsquo;<samp>invert</samp>&rsquo;</dt>
16630 <dd><p>Invert transforms if set to 1. Default value is 0.
16631 </p>
16632 </dd>
16633 <dt> &lsquo;<samp>relative</samp>&rsquo;</dt>
16634 <dd><p>Consider transforms as relative to previsou frame if set to 1,
16635 absolute if set to 0. Default value is 0.
16636 </p>
16637 </dd>
16638 <dt> &lsquo;<samp>zoom</samp>&rsquo;</dt>
16639 <dd><p>Set percentage to zoom. A positive value will result in a zoom-in
16640 effect, a negative value in a zoom-out effect. Default value is 0 (no
16641 zoom).
16642 </p>
16643 </dd>
16644 <dt> &lsquo;<samp>optzoom</samp>&rsquo;</dt>
16645 <dd><p>Set optimal zooming to avoid borders.
16646 </p>
16647 <p>Accepted values are:
16648 </p><dl compact="compact">
16649 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
16650 <dd><p>disabled
16651 </p></dd>
16652 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
16653 <dd><p>optimal static zoom value is determined (only very strong movements
16654 will lead to visible borders) (default)
16655 </p></dd>
16656 <dt> &lsquo;<samp>2</samp>&rsquo;</dt>
16657 <dd><p>optimal adaptive zoom value is determined (no borders will be
16658 visible), see &lsquo;<samp>zoomspeed</samp>&rsquo;
16659 </p></dd>
16660 </dl>
16661
16662 <p>Note that the value given at zoom is added to the one calculated here.
16663 </p>
16664 </dd>
16665 <dt> &lsquo;<samp>zoomspeed</samp>&rsquo;</dt>
16666 <dd><p>Set percent to zoom maximally each frame (enabled when
16667 &lsquo;<samp>optzoom</samp>&rsquo; is set to 2). Range is from 0 to 5, default value is
16668 0.25.
16669 </p>
16670 </dd>
16671 <dt> &lsquo;<samp>interpol</samp>&rsquo;</dt>
16672 <dd><p>Specify type of interpolation.
16673 </p>
16674 <p>Available values are:
16675 </p><dl compact="compact">
16676 <dt> &lsquo;<samp>no</samp>&rsquo;</dt>
16677 <dd><p>no interpolation
16678 </p></dd>
16679 <dt> &lsquo;<samp>linear</samp>&rsquo;</dt>
16680 <dd><p>linear only horizontal
16681 </p></dd>
16682 <dt> &lsquo;<samp>bilinear</samp>&rsquo;</dt>
16683 <dd><p>linear in both directions (default)
16684 </p></dd>
16685 <dt> &lsquo;<samp>bicubic</samp>&rsquo;</dt>
16686 <dd><p>cubic in both directions (slow)
16687 </p></dd>
16688 </dl>
16689
16690 </dd>
16691 <dt> &lsquo;<samp>tripod</samp>&rsquo;</dt>
16692 <dd><p>Enable virtual tripod mode if set to 1, which is equivalent to
16693 <code>relative=0:smoothing=0</code>. Default value is 0.
16694 </p>
16695 <p>Use also <code>tripod</code> option of <a href="#vidstabdetect">vidstabdetect</a>.
16696 </p>
16697 </dd>
16698 <dt> &lsquo;<samp>debug</samp>&rsquo;</dt>
16699 <dd><p>Increase log verbosity if set to 1. Also the detected global motions
16700 are written to the temporary file &lsquo;<tt>global_motions.trf</tt>&rsquo;. Default
16701 value is 0.
16702 </p></dd>
16703 </dl>
16704
16705 <a name="Examples-25"></a>
16706 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-25">28.91.2 Examples</a></h3>
16707
16708 <ul>
16709 <li>
16710 Use <code>ffmpeg</code> for a typical stabilization with default values:
16711 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i inp.mpeg -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4 inp_stabilized.mpeg
16712 </pre></td></tr></table>
16713
16714 <p>Note the use of the unsharp filter which is always recommended.
16715 </p>
16716 </li><li>
16717 Zoom in a bit more and load transform data from a given file:
16718 <table><tr><td>&nbsp;</td><td><pre class="example">vidstabtransform=zoom=5:input=&quot;mytransforms.trf&quot;
16719 </pre></td></tr></table>
16720
16721 </li><li>
16722 Smoothen the video even more:
16723 <table><tr><td>&nbsp;</td><td><pre class="example">vidstabtransform=smoothing=30
16724 </pre></td></tr></table>
16725 </li></ul>
16726
16727 <a name="vflip"></a>
16728 <h2 class="section"><a href="ffplay-all.html#toc-vflip">28.92 vflip</a></h2>
16729
16730 <p>Flip the input video vertically.
16731 </p>
16732 <p>For example, to vertically flip a video with <code>ffmpeg</code>:
16733 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -vf &quot;vflip&quot; out.avi
16734 </pre></td></tr></table>
16735
16736 <a name="vignette"></a>
16737 <h2 class="section"><a href="ffplay-all.html#toc-vignette">28.93 vignette</a></h2>
16738
16739 <p>Make or reverse a natural vignetting effect.
16740 </p>
16741 <p>The filter accepts the following options:
16742 </p>
16743 <dl compact="compact">
16744 <dt> &lsquo;<samp>angle, a</samp>&rsquo;</dt>
16745 <dd><p>Set lens angle expression as a number of radians.
16746 </p>
16747 <p>The value is clipped in the <code>[0,PI/2]</code> range.
16748 </p>
16749 <p>Default value: <code>&quot;PI/5&quot;</code>
16750 </p>
16751 </dd>
16752 <dt> &lsquo;<samp>x0</samp>&rsquo;</dt>
16753 <dt> &lsquo;<samp>y0</samp>&rsquo;</dt>
16754 <dd><p>Set center coordinates expressions. Respectively <code>&quot;w/2&quot;</code> and <code>&quot;h/2&quot;</code>
16755 by default.
16756 </p>
16757 </dd>
16758 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
16759 <dd><p>Set forward/backward mode.
16760 </p>
16761 <p>Available modes are:
16762 </p><dl compact="compact">
16763 <dt> &lsquo;<samp>forward</samp>&rsquo;</dt>
16764 <dd><p>The larger the distance from the central point, the darker the image becomes.
16765 </p>
16766 </dd>
16767 <dt> &lsquo;<samp>backward</samp>&rsquo;</dt>
16768 <dd><p>The larger the distance from the central point, the brighter the image becomes.
16769 This can be used to reverse a vignette effect, though there is no automatic
16770 detection to extract the lens &lsquo;<samp>angle</samp>&rsquo; and other settings (yet). It can
16771 also be used to create a burning effect.
16772 </p></dd>
16773 </dl>
16774
16775 <p>Default value is &lsquo;<samp>forward</samp>&rsquo;.
16776 </p>
16777 </dd>
16778 <dt> &lsquo;<samp>eval</samp>&rsquo;</dt>
16779 <dd><p>Set evaluation mode for the expressions (&lsquo;<samp>angle</samp>&rsquo;, &lsquo;<samp>x0</samp>&rsquo;, &lsquo;<samp>y0</samp>&rsquo;).
16780 </p>
16781 <p>It accepts the following values:
16782 </p><dl compact="compact">
16783 <dt> &lsquo;<samp>init</samp>&rsquo;</dt>
16784 <dd><p>Evaluate expressions only once during the filter initialization.
16785 </p>
16786 </dd>
16787 <dt> &lsquo;<samp>frame</samp>&rsquo;</dt>
16788 <dd><p>Evaluate expressions for each incoming frame. This is way slower than the
16789 &lsquo;<samp>init</samp>&rsquo; mode since it requires all the scalers to be re-computed, but it
16790 allows advanced dynamic expressions.
16791 </p></dd>
16792 </dl>
16793
16794 <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
16795 </p>
16796 </dd>
16797 <dt> &lsquo;<samp>dither</samp>&rsquo;</dt>
16798 <dd><p>Set dithering to reduce the circular banding effects. Default is <code>1</code>
16799 (enabled).
16800 </p>
16801 </dd>
16802 <dt> &lsquo;<samp>aspect</samp>&rsquo;</dt>
16803 <dd><p>Set vignette aspect. This setting allows one to adjust the shape of the vignette.
16804 Setting this value to the SAR of the input will make a rectangular vignetting
16805 following the dimensions of the video.
16806 </p>
16807 <p>Default is <code>1/1</code>.
16808 </p></dd>
16809 </dl>
16810
16811 <a name="Expressions"></a>
16812 <h3 class="subsection"><a href="ffplay-all.html#toc-Expressions">28.93.1 Expressions</a></h3>
16813
16814 <p>The &lsquo;<samp>alpha</samp>&rsquo;, &lsquo;<samp>x0</samp>&rsquo; and &lsquo;<samp>y0</samp>&rsquo; expressions can contain the
16815 following parameters.
16816 </p>
16817 <dl compact="compact">
16818 <dt> &lsquo;<samp>w</samp>&rsquo;</dt>
16819 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
16820 <dd><p>input width and height
16821 </p>
16822 </dd>
16823 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
16824 <dd><p>the number of input frame, starting from 0
16825 </p>
16826 </dd>
16827 <dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
16828 <dd><p>the PTS (Presentation TimeStamp) time of the filtered video frame, expressed in
16829 <var>TB</var> units, NAN if undefined
16830 </p>
16831 </dd>
16832 <dt> &lsquo;<samp>r</samp>&rsquo;</dt>
16833 <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
16834 </p>
16835 </dd>
16836 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
16837 <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
16838 expressed in seconds, NAN if undefined
16839 </p>
16840 </dd>
16841 <dt> &lsquo;<samp>tb</samp>&rsquo;</dt>
16842 <dd><p>time base of the input video
16843 </p></dd>
16844 </dl>
16845
16846
16847 <a name="Examples-49"></a>
16848 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-49">28.93.2 Examples</a></h3>
16849
16850 <ul>
16851 <li>
16852 Apply simple strong vignetting effect:
16853 <table><tr><td>&nbsp;</td><td><pre class="example">vignette=PI/4
16854 </pre></td></tr></table>
16855
16856 </li><li>
16857 Make a flickering vignetting:
16858 <table><tr><td>&nbsp;</td><td><pre class="example">vignette='PI/4+random(1)*PI/50':eval=frame
16859 </pre></td></tr></table>
16860
16861 </li></ul>
16862
16863 <a name="w3fdif"></a>
16864 <h2 class="section"><a href="ffplay-all.html#toc-w3fdif">28.94 w3fdif</a></h2>
16865
16866 <p>Deinterlace the input video (&quot;w3fdif&quot; stands for &quot;Weston 3 Field
16867 Deinterlacing Filter&quot;).
16868 </p>
16869 <p>Based on the process described by Martin Weston for BBC R&amp;D, and
16870 implemented based on the de-interlace algorithm written by Jim
16871 Easterbrook for BBC R&amp;D, the Weston 3 field deinterlacing filter
16872 uses filter coefficients calculated by BBC R&amp;D.
16873 </p>
16874 <p>There are two sets of filter coefficients, so called &quot;simple&quot;:
16875 and &quot;complex&quot;. Which set of filter coefficients is used can
16876 be set by passing an optional parameter:
16877 </p>
16878 <dl compact="compact">
16879 <dt> &lsquo;<samp>filter</samp>&rsquo;</dt>
16880 <dd><p>Set the interlacing filter coefficients. Accepts one of the following values:
16881 </p>
16882 <dl compact="compact">
16883 <dt> &lsquo;<samp>simple</samp>&rsquo;</dt>
16884 <dd><p>Simple filter coefficient set.
16885 </p></dd>
16886 <dt> &lsquo;<samp>complex</samp>&rsquo;</dt>
16887 <dd><p>More-complex filter coefficient set.
16888 </p></dd>
16889 </dl>
16890 <p>Default value is &lsquo;<samp>complex</samp>&rsquo;.
16891 </p>
16892 </dd>
16893 <dt> &lsquo;<samp>deint</samp>&rsquo;</dt>
16894 <dd><p>Specify which frames to deinterlace. Accept one of the following values:
16895 </p>
16896 <dl compact="compact">
16897 <dt> &lsquo;<samp>all</samp>&rsquo;</dt>
16898 <dd><p>Deinterlace all frames,
16899 </p></dd>
16900 <dt> &lsquo;<samp>interlaced</samp>&rsquo;</dt>
16901 <dd><p>Only deinterlace frames marked as interlaced.
16902 </p></dd>
16903 </dl>
16904
16905 <p>Default value is &lsquo;<samp>all</samp>&rsquo;.
16906 </p></dd>
16907 </dl>
16908
16909 <p><a name="yadif"></a>
16910 </p><a name="yadif-1"></a>
16911 <h2 class="section"><a href="ffplay-all.html#toc-yadif-1">28.95 yadif</a></h2>
16912
16913 <p>Deinterlace the input video (&quot;yadif&quot; means &quot;yet another deinterlacing
16914 filter&quot;).
16915 </p>
16916 <p>This filter accepts the following options:
16917 </p>
16918
16919 <dl compact="compact">
16920 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
16921 <dd><p>The interlacing mode to adopt, accepts one of the following values:
16922 </p>
16923 <dl compact="compact">
16924 <dt> &lsquo;<samp>0, send_frame</samp>&rsquo;</dt>
16925 <dd><p>output 1 frame for each frame
16926 </p></dd>
16927 <dt> &lsquo;<samp>1, send_field</samp>&rsquo;</dt>
16928 <dd><p>output 1 frame for each field
16929 </p></dd>
16930 <dt> &lsquo;<samp>2, send_frame_nospatial</samp>&rsquo;</dt>
16931 <dd><p>like <code>send_frame</code> but skip spatial interlacing check
16932 </p></dd>
16933 <dt> &lsquo;<samp>3, send_field_nospatial</samp>&rsquo;</dt>
16934 <dd><p>like <code>send_field</code> but skip spatial interlacing check
16935 </p></dd>
16936 </dl>
16937
16938 <p>Default value is <code>send_frame</code>.
16939 </p>
16940 </dd>
16941 <dt> &lsquo;<samp>parity</samp>&rsquo;</dt>
16942 <dd><p>The picture field parity assumed for the input interlaced video, accepts one of
16943 the following values:
16944 </p>
16945 <dl compact="compact">
16946 <dt> &lsquo;<samp>0, tff</samp>&rsquo;</dt>
16947 <dd><p>assume top field first
16948 </p></dd>
16949 <dt> &lsquo;<samp>1, bff</samp>&rsquo;</dt>
16950 <dd><p>assume bottom field first
16951 </p></dd>
16952 <dt> &lsquo;<samp>-1, auto</samp>&rsquo;</dt>
16953 <dd><p>enable automatic detection
16954 </p></dd>
16955 </dl>
16956
16957 <p>Default value is <code>auto</code>.
16958 If interlacing is unknown or decoder does not export this information,
16959 top field first will be assumed.
16960 </p>
16961 </dd>
16962 <dt> &lsquo;<samp>deint</samp>&rsquo;</dt>
16963 <dd><p>Specify which frames to deinterlace. Accept one of the following
16964 values:
16965 </p>
16966 <dl compact="compact">
16967 <dt> &lsquo;<samp>0, all</samp>&rsquo;</dt>
16968 <dd><p>deinterlace all frames
16969 </p></dd>
16970 <dt> &lsquo;<samp>1, interlaced</samp>&rsquo;</dt>
16971 <dd><p>only deinterlace frames marked as interlaced
16972 </p></dd>
16973 </dl>
16974
16975 <p>Default value is <code>all</code>.
16976 </p></dd>
16977 </dl>
16978
16979
16980 <a name="Video-Sources"></a>
16981 <h1 class="chapter"><a href="ffplay-all.html#toc-Video-Sources">29. Video Sources</a></h1>
16982
16983 <p>Below is a description of the currently available video sources.
16984 </p>
16985 <a name="buffer"></a>
16986 <h2 class="section"><a href="ffplay-all.html#toc-buffer">29.1 buffer</a></h2>
16987
16988 <p>Buffer video frames, and make them available to the filter chain.
16989 </p>
16990 <p>This source is mainly intended for a programmatic use, in particular
16991 through the interface defined in &lsquo;<tt>libavfilter/vsrc_buffer.h</tt>&rsquo;.
16992 </p>
16993 <p>This source accepts the following options:
16994 </p>
16995 <dl compact="compact">
16996 <dt> &lsquo;<samp>video_size</samp>&rsquo;</dt>
16997 <dd><p>Specify the size (width and height) of the buffered video frames. For the
16998 syntax of this option, check the &quot;Video size&quot; section in the ffmpeg-utils
16999 manual.
17000 </p>
17001 </dd>
17002 <dt> &lsquo;<samp>width</samp>&rsquo;</dt>
17003 <dd><p>Input video width.
17004 </p>
17005 </dd>
17006 <dt> &lsquo;<samp>height</samp>&rsquo;</dt>
17007 <dd><p>Input video height.
17008 </p>
17009 </dd>
17010 <dt> &lsquo;<samp>pix_fmt</samp>&rsquo;</dt>
17011 <dd><p>A string representing the pixel format of the buffered video frames.
17012 It may be a number corresponding to a pixel format, or a pixel format
17013 name.
17014 </p>
17015 </dd>
17016 <dt> &lsquo;<samp>time_base</samp>&rsquo;</dt>
17017 <dd><p>Specify the timebase assumed by the timestamps of the buffered frames.
17018 </p>
17019 </dd>
17020 <dt> &lsquo;<samp>frame_rate</samp>&rsquo;</dt>
17021 <dd><p>Specify the frame rate expected for the video stream.
17022 </p>
17023 </dd>
17024 <dt> &lsquo;<samp>pixel_aspect, sar</samp>&rsquo;</dt>
17025 <dd><p>Specify the sample aspect ratio assumed by the video frames.
17026 </p>
17027 </dd>
17028 <dt> &lsquo;<samp>sws_param</samp>&rsquo;</dt>
17029 <dd><p>Specify the optional parameters to be used for the scale filter which
17030 is automatically inserted when an input change is detected in the
17031 input size or format.
17032 </p></dd>
17033 </dl>
17034
17035 <p>For example:
17036 </p><table><tr><td>&nbsp;</td><td><pre class="example">buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
17037 </pre></td></tr></table>
17038
17039 <p>will instruct the source to accept video frames with size 320x240 and
17040 with format &quot;yuv410p&quot;, assuming 1/24 as the timestamps timebase and
17041 square pixels (1:1 sample aspect ratio).
17042 Since the pixel format with name &quot;yuv410p&quot; corresponds to the number 6
17043 (check the enum AVPixelFormat definition in &lsquo;<tt>libavutil/pixfmt.h</tt>&rsquo;),
17044 this example corresponds to:
17045 </p><table><tr><td>&nbsp;</td><td><pre class="example">buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
17046 </pre></td></tr></table>
17047
17048 <p>Alternatively, the options can be specified as a flat string, but this
17049 syntax is deprecated:
17050 </p>
17051 <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>]
17052 </p>
17053 <a name="cellauto"></a>
17054 <h2 class="section"><a href="ffplay-all.html#toc-cellauto">29.2 cellauto</a></h2>
17055
17056 <p>Create a pattern generated by an elementary cellular automaton.
17057 </p>
17058 <p>The initial state of the cellular automaton can be defined through the
17059 &lsquo;<samp>filename</samp>&rsquo;, and &lsquo;<samp>pattern</samp>&rsquo; options. If such options are
17060 not specified an initial state is created randomly.
17061 </p>
17062 <p>At each new frame a new row in the video is filled with the result of
17063 the cellular automaton next generation. The behavior when the whole
17064 frame is filled is defined by the &lsquo;<samp>scroll</samp>&rsquo; option.
17065 </p>
17066 <p>This source accepts the following options:
17067 </p>
17068 <dl compact="compact">
17069 <dt> &lsquo;<samp>filename, f</samp>&rsquo;</dt>
17070 <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
17071 the specified file.
17072 In the file, each non-whitespace character is considered an alive
17073 cell, a newline will terminate the row, and further characters in the
17074 file will be ignored.
17075 </p>
17076 </dd>
17077 <dt> &lsquo;<samp>pattern, p</samp>&rsquo;</dt>
17078 <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
17079 the specified string.
17080 </p>
17081 <p>Each non-whitespace character in the string is considered an alive
17082 cell, a newline will terminate the row, and further characters in the
17083 string will be ignored.
17084 </p>
17085 </dd>
17086 <dt> &lsquo;<samp>rate, r</samp>&rsquo;</dt>
17087 <dd><p>Set the video rate, that is the number of frames generated per second.
17088 Default is 25.
17089 </p>
17090 </dd>
17091 <dt> &lsquo;<samp>random_fill_ratio, ratio</samp>&rsquo;</dt>
17092 <dd><p>Set the random fill ratio for the initial cellular automaton row. It
17093 is a floating point number value ranging from 0 to 1, defaults to
17094 1/PHI.
17095 </p>
17096 <p>This option is ignored when a file or a pattern is specified.
17097 </p>
17098 </dd>
17099 <dt> &lsquo;<samp>random_seed, seed</samp>&rsquo;</dt>
17100 <dd><p>Set the seed for filling randomly the initial row, must be an integer
17101 included between 0 and UINT32_MAX. If not specified, or if explicitly
17102 set to -1, the filter will try to use a good random seed on a best
17103 effort basis.
17104 </p>
17105 </dd>
17106 <dt> &lsquo;<samp>rule</samp>&rsquo;</dt>
17107 <dd><p>Set the cellular automaton rule, it is a number ranging from 0 to 255.
17108 Default value is 110.
17109 </p>
17110 </dd>
17111 <dt> &lsquo;<samp>size, s</samp>&rsquo;</dt>
17112 <dd><p>Set the size of the output video. For the syntax of this option, check
17113 the &quot;Video size&quot; section in the ffmpeg-utils manual.
17114 </p>
17115 <p>If &lsquo;<samp>filename</samp>&rsquo; or &lsquo;<samp>pattern</samp>&rsquo; is specified, the size is set
17116 by default to the width of the specified initial state row, and the
17117 height is set to <var>width</var> * PHI.
17118 </p>
17119 <p>If &lsquo;<samp>size</samp>&rsquo; is set, it must contain the width of the specified
17120 pattern string, and the specified pattern will be centered in the
17121 larger row.
17122 </p>
17123 <p>If a filename or a pattern string is not specified, the size value
17124 defaults to &quot;320x518&quot; (used for a randomly generated initial state).
17125 </p>
17126 </dd>
17127 <dt> &lsquo;<samp>scroll</samp>&rsquo;</dt>
17128 <dd><p>If set to 1, scroll the output upward when all the rows in the output
17129 have been already filled. If set to 0, the new generated row will be
17130 written over the top row just after the bottom row is filled.
17131 Defaults to 1.
17132 </p>
17133 </dd>
17134 <dt> &lsquo;<samp>start_full, full</samp>&rsquo;</dt>
17135 <dd><p>If set to 1, completely fill the output with generated rows before
17136 outputting the first frame.
17137 This is the default behavior, for disabling set the value to 0.
17138 </p>
17139 </dd>
17140 <dt> &lsquo;<samp>stitch</samp>&rsquo;</dt>
17141 <dd><p>If set to 1, stitch the left and right row edges together.
17142 This is the default behavior, for disabling set the value to 0.
17143 </p></dd>
17144 </dl>
17145
17146 <a name="Examples-16"></a>
17147 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-16">29.2.1 Examples</a></h3>
17148
17149 <ul>
17150 <li>
17151 Read the initial state from &lsquo;<tt>pattern</tt>&rsquo;, and specify an output of
17152 size 200x400.
17153 <table><tr><td>&nbsp;</td><td><pre class="example">cellauto=f=pattern:s=200x400
17154 </pre></td></tr></table>
17155
17156 </li><li>
17157 Generate a random initial row with a width of 200 cells, with a fill
17158 ratio of 2/3:
17159 <table><tr><td>&nbsp;</td><td><pre class="example">cellauto=ratio=2/3:s=200x200
17160 </pre></td></tr></table>
17161
17162 </li><li>
17163 Create a pattern generated by rule 18 starting by a single alive cell
17164 centered on an initial row with width 100:
17165 <table><tr><td>&nbsp;</td><td><pre class="example">cellauto=p=@:s=100x400:full=0:rule=18
17166 </pre></td></tr></table>
17167
17168 </li><li>
17169 Specify a more elaborated initial pattern:
17170 <table><tr><td>&nbsp;</td><td><pre class="example">cellauto=p='@@ @ @@':s=100x400:full=0:rule=18
17171 </pre></td></tr></table>
17172
17173 </li></ul>
17174
17175 <a name="mandelbrot"></a>
17176 <h2 class="section"><a href="ffplay-all.html#toc-mandelbrot">29.3 mandelbrot</a></h2>
17177
17178 <p>Generate a Mandelbrot set fractal, and progressively zoom towards the
17179 point specified with <var>start_x</var> and <var>start_y</var>.
17180 </p>
17181 <p>This source accepts the following options:
17182 </p>
17183 <dl compact="compact">
17184 <dt> &lsquo;<samp>end_pts</samp>&rsquo;</dt>
17185 <dd><p>Set the terminal pts value. Default value is 400.
17186 </p>
17187 </dd>
17188 <dt> &lsquo;<samp>end_scale</samp>&rsquo;</dt>
17189 <dd><p>Set the terminal scale value.
17190 Must be a floating point value. Default value is 0.3.
17191 </p>
17192 </dd>
17193 <dt> &lsquo;<samp>inner</samp>&rsquo;</dt>
17194 <dd><p>Set the inner coloring mode, that is the algorithm used to draw the
17195 Mandelbrot fractal internal region.
17196 </p>
17197 <p>It shall assume one of the following values:
17198 </p><dl compact="compact">
17199 <dt> &lsquo;<samp>black</samp>&rsquo;</dt>
17200 <dd><p>Set black mode.
17201 </p></dd>
17202 <dt> &lsquo;<samp>convergence</samp>&rsquo;</dt>
17203 <dd><p>Show time until convergence.
17204 </p></dd>
17205 <dt> &lsquo;<samp>mincol</samp>&rsquo;</dt>
17206 <dd><p>Set color based on point closest to the origin of the iterations.
17207 </p></dd>
17208 <dt> &lsquo;<samp>period</samp>&rsquo;</dt>
17209 <dd><p>Set period mode.
17210 </p></dd>
17211 </dl>
17212
17213 <p>Default value is <var>mincol</var>.
17214 </p>
17215 </dd>
17216 <dt> &lsquo;<samp>bailout</samp>&rsquo;</dt>
17217 <dd><p>Set the bailout value. Default value is 10.0.
17218 </p>
17219 </dd>
17220 <dt> &lsquo;<samp>maxiter</samp>&rsquo;</dt>
17221 <dd><p>Set the maximum of iterations performed by the rendering
17222 algorithm. Default value is 7189.
17223 </p>
17224 </dd>
17225 <dt> &lsquo;<samp>outer</samp>&rsquo;</dt>
17226 <dd><p>Set outer coloring mode.
17227 It shall assume one of following values:
17228 </p><dl compact="compact">
17229 <dt> &lsquo;<samp>iteration_count</samp>&rsquo;</dt>
17230 <dd><p>Set iteration cound mode.
17231 </p></dd>
17232 <dt> &lsquo;<samp>normalized_iteration_count</samp>&rsquo;</dt>
17233 <dd><p>set normalized iteration count mode.
17234 </p></dd>
17235 </dl>
17236 <p>Default value is <var>normalized_iteration_count</var>.
17237 </p>
17238 </dd>
17239 <dt> &lsquo;<samp>rate, r</samp>&rsquo;</dt>
17240 <dd><p>Set frame rate, expressed as number of frames per second. Default
17241 value is &quot;25&quot;.
17242 </p>
17243 </dd>
17244 <dt> &lsquo;<samp>size, s</samp>&rsquo;</dt>
17245 <dd><p>Set frame size. For the syntax of this option, check the &quot;Video
17246 size&quot; section in the ffmpeg-utils manual. Default value is &quot;640x480&quot;.
17247 </p>
17248 </dd>
17249 <dt> &lsquo;<samp>start_scale</samp>&rsquo;</dt>
17250 <dd><p>Set the initial scale value. Default value is 3.0.
17251 </p>
17252 </dd>
17253 <dt> &lsquo;<samp>start_x</samp>&rsquo;</dt>
17254 <dd><p>Set the initial x position. Must be a floating point value between
17255 -100 and 100. Default value is -0.743643887037158704752191506114774.
17256 </p>
17257 </dd>
17258 <dt> &lsquo;<samp>start_y</samp>&rsquo;</dt>
17259 <dd><p>Set the initial y position. Must be a floating point value between
17260 -100 and 100. Default value is -0.131825904205311970493132056385139.
17261 </p></dd>
17262 </dl>
17263
17264 <a name="mptestsrc"></a>
17265 <h2 class="section"><a href="ffplay-all.html#toc-mptestsrc">29.4 mptestsrc</a></h2>
17266
17267 <p>Generate various test patterns, as generated by the MPlayer test filter.
17268 </p>
17269 <p>The size of the generated video is fixed, and is 256x256.
17270 This source is useful in particular for testing encoding features.
17271 </p>
17272 <p>This source accepts the following options:
17273 </p>
17274 <dl compact="compact">
17275 <dt> &lsquo;<samp>rate, r</samp>&rsquo;</dt>
17276 <dd><p>Specify the frame rate of the sourced video, as the number of frames
17277 generated per second. It has to be a string in the format
17278 <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a float
17279 number or a valid video frame rate abbreviation. The default value is
17280 &quot;25&quot;.
17281 </p>
17282 </dd>
17283 <dt> &lsquo;<samp>duration, d</samp>&rsquo;</dt>
17284 <dd><p>Set the video duration of the sourced video. The accepted syntax is:
17285 </p><table><tr><td>&nbsp;</td><td><pre class="example">[-]HH:MM:SS[.m...]
17286 [-]S+[.m...]
17287 </pre></td></tr></table>
17288 <p>See also the function <code>av_parse_time()</code>.
17289 </p>
17290 <p>If not specified, or the expressed duration is negative, the video is
17291 supposed to be generated forever.
17292 </p>
17293 </dd>
17294 <dt> &lsquo;<samp>test, t</samp>&rsquo;</dt>
17295 <dd>
17296 <p>Set the number or the name of the test to perform. Supported tests are:
17297 </p><dl compact="compact">
17298 <dt> &lsquo;<samp>dc_luma</samp>&rsquo;</dt>
17299 <dt> &lsquo;<samp>dc_chroma</samp>&rsquo;</dt>
17300 <dt> &lsquo;<samp>freq_luma</samp>&rsquo;</dt>
17301 <dt> &lsquo;<samp>freq_chroma</samp>&rsquo;</dt>
17302 <dt> &lsquo;<samp>amp_luma</samp>&rsquo;</dt>
17303 <dt> &lsquo;<samp>amp_chroma</samp>&rsquo;</dt>
17304 <dt> &lsquo;<samp>cbp</samp>&rsquo;</dt>
17305 <dt> &lsquo;<samp>mv</samp>&rsquo;</dt>
17306 <dt> &lsquo;<samp>ring1</samp>&rsquo;</dt>
17307 <dt> &lsquo;<samp>ring2</samp>&rsquo;</dt>
17308 <dt> &lsquo;<samp>all</samp>&rsquo;</dt>
17309 </dl>
17310
17311 <p>Default value is &quot;all&quot;, which will cycle through the list of all tests.
17312 </p></dd>
17313 </dl>
17314
17315 <p>For example the following:
17316 </p><table><tr><td>&nbsp;</td><td><pre class="example">testsrc=t=dc_luma
17317 </pre></td></tr></table>
17318
17319 <p>will generate a &quot;dc_luma&quot; test pattern.
17320 </p>
17321 <a name="frei0r_005fsrc"></a>
17322 <h2 class="section"><a href="ffplay-all.html#toc-frei0r_005fsrc">29.5 frei0r_src</a></h2>
17323
17324 <p>Provide a frei0r source.
17325 </p>
17326 <p>To enable compilation of this filter you need to install the frei0r
17327 header and configure FFmpeg with <code>--enable-frei0r</code>.
17328 </p>
17329 <p>This source accepts the following options:
17330 </p>
17331 <dl compact="compact">
17332 <dt> &lsquo;<samp>size</samp>&rsquo;</dt>
17333 <dd><p>The size of the video to generate. For the syntax of this option, check the
17334 &quot;Video size&quot; section in the ffmpeg-utils manual.
17335 </p>
17336 </dd>
17337 <dt> &lsquo;<samp>framerate</samp>&rsquo;</dt>
17338 <dd><p>Framerate of the generated video, may be a string of the form
17339 <var>num</var>/<var>den</var> or a frame rate abbreviation.
17340 </p>
17341 </dd>
17342 <dt> &lsquo;<samp>filter_name</samp>&rsquo;</dt>
17343 <dd><p>The name to the frei0r source to load. For more information regarding frei0r and
17344 how to set the parameters read the section <a href="#frei0r">frei0r</a> in the description of
17345 the video filters.
17346 </p>
17347 </dd>
17348 <dt> &lsquo;<samp>filter_params</samp>&rsquo;</dt>
17349 <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r source.
17350 </p>
17351 </dd>
17352 </dl>
17353
17354 <p>For example, to generate a frei0r partik0l source with size 200x200
17355 and frame rate 10 which is overlayed on the overlay filter main input:
17356 </p><table><tr><td>&nbsp;</td><td><pre class="example">frei0r_src=size=200x200:framerate=10:filter_name=partik0l:filter_params=1234 [overlay]; [in][overlay] overlay
17357 </pre></td></tr></table>
17358
17359 <a name="life"></a>
17360 <h2 class="section"><a href="ffplay-all.html#toc-life">29.6 life</a></h2>
17361
17362 <p>Generate a life pattern.
17363 </p>
17364 <p>This source is based on a generalization of John Conway&rsquo;s life game.
17365 </p>
17366 <p>The sourced input represents a life grid, each pixel represents a cell
17367 which can be in one of two possible states, alive or dead. Every cell
17368 interacts with its eight neighbours, which are the cells that are
17369 horizontally, vertically, or diagonally adjacent.
17370 </p>
17371 <p>At each interaction the grid evolves according to the adopted rule,
17372 which specifies the number of neighbor alive cells which will make a
17373 cell stay alive or born. The &lsquo;<samp>rule</samp>&rsquo; option allows one to specify
17374 the rule to adopt.
17375 </p>
17376 <p>This source accepts the following options:
17377 </p>
17378 <dl compact="compact">
17379 <dt> &lsquo;<samp>filename, f</samp>&rsquo;</dt>
17380 <dd><p>Set the file from which to read the initial grid state. In the file,
17381 each non-whitespace character is considered an alive cell, and newline
17382 is used to delimit the end of each row.
17383 </p>
17384 <p>If this option is not specified, the initial grid is generated
17385 randomly.
17386 </p>
17387 </dd>
17388 <dt> &lsquo;<samp>rate, r</samp>&rsquo;</dt>
17389 <dd><p>Set the video rate, that is the number of frames generated per second.
17390 Default is 25.
17391 </p>
17392 </dd>
17393 <dt> &lsquo;<samp>random_fill_ratio, ratio</samp>&rsquo;</dt>
17394 <dd><p>Set the random fill ratio for the initial random grid. It is a
17395 floating point number value ranging from 0 to 1, defaults to 1/PHI.
17396 It is ignored when a file is specified.
17397 </p>
17398 </dd>
17399 <dt> &lsquo;<samp>random_seed, seed</samp>&rsquo;</dt>
17400 <dd><p>Set the seed for filling the initial random grid, must be an integer
17401 included between 0 and UINT32_MAX. If not specified, or if explicitly
17402 set to -1, the filter will try to use a good random seed on a best
17403 effort basis.
17404 </p>
17405 </dd>
17406 <dt> &lsquo;<samp>rule</samp>&rsquo;</dt>
17407 <dd><p>Set the life rule.
17408 </p>
17409 <p>A rule can be specified with a code of the kind &quot;S<var>NS</var>/B<var>NB</var>&quot;,
17410 where <var>NS</var> and <var>NB</var> are sequences of numbers in the range 0-8,
17411 <var>NS</var> specifies the number of alive neighbor cells which make a
17412 live cell stay alive, and <var>NB</var> the number of alive neighbor cells
17413 which make a dead cell to become alive (i.e. to &quot;born&quot;).
17414 &quot;s&quot; and &quot;b&quot; can be used in place of &quot;S&quot; and &quot;B&quot;, respectively.
17415 </p>
17416 <p>Alternatively a rule can be specified by an 18-bits integer. The 9
17417 high order bits are used to encode the next cell state if it is alive
17418 for each number of neighbor alive cells, the low order bits specify
17419 the rule for &quot;borning&quot; new cells. Higher order bits encode for an
17420 higher number of neighbor cells.
17421 For example the number 6153 = <code>(12&lt;&lt;9)+9</code> specifies a stay alive
17422 rule of 12 and a born rule of 9, which corresponds to &quot;S23/B03&quot;.
17423 </p>
17424 <p>Default value is &quot;S23/B3&quot;, which is the original Conway&rsquo;s game of life
17425 rule, and will keep a cell alive if it has 2 or 3 neighbor alive
17426 cells, and will born a new cell if there are three alive cells around
17427 a dead cell.
17428 </p>
17429 </dd>
17430 <dt> &lsquo;<samp>size, s</samp>&rsquo;</dt>
17431 <dd><p>Set the size of the output video. For the syntax of this option, check the
17432 &quot;Video size&quot; section in the ffmpeg-utils manual.
17433 </p>
17434 <p>If &lsquo;<samp>filename</samp>&rsquo; is specified, the size is set by default to the
17435 same size of the input file. If &lsquo;<samp>size</samp>&rsquo; is set, it must contain
17436 the size specified in the input file, and the initial grid defined in
17437 that file is centered in the larger resulting area.
17438 </p>
17439 <p>If a filename is not specified, the size value defaults to &quot;320x240&quot;
17440 (used for a randomly generated initial grid).
17441 </p>
17442 </dd>
17443 <dt> &lsquo;<samp>stitch</samp>&rsquo;</dt>
17444 <dd><p>If set to 1, stitch the left and right grid edges together, and the
17445 top and bottom edges also. Defaults to 1.
17446 </p>
17447 </dd>
17448 <dt> &lsquo;<samp>mold</samp>&rsquo;</dt>
17449 <dd><p>Set cell mold speed. If set, a dead cell will go from &lsquo;<samp>death_color</samp>&rsquo; to
17450 &lsquo;<samp>mold_color</samp>&rsquo; with a step of &lsquo;<samp>mold</samp>&rsquo;. &lsquo;<samp>mold</samp>&rsquo; can have a
17451 value from 0 to 255.
17452 </p>
17453 </dd>
17454 <dt> &lsquo;<samp>life_color</samp>&rsquo;</dt>
17455 <dd><p>Set the color of living (or new born) cells.
17456 </p>
17457 </dd>
17458 <dt> &lsquo;<samp>death_color</samp>&rsquo;</dt>
17459 <dd><p>Set the color of dead cells. If &lsquo;<samp>mold</samp>&rsquo; is set, this is the first color
17460 used to represent a dead cell.
17461 </p>
17462 </dd>
17463 <dt> &lsquo;<samp>mold_color</samp>&rsquo;</dt>
17464 <dd><p>Set mold color, for definitely dead and moldy cells.
17465 </p>
17466 <p>For the syntax of these 3 color options, check the &quot;Color&quot; section in the
17467 ffmpeg-utils manual.
17468 </p></dd>
17469 </dl>
17470
17471 <a name="Examples-73"></a>
17472 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-73">29.6.1 Examples</a></h3>
17473
17474 <ul>
17475 <li>
17476 Read a grid from &lsquo;<tt>pattern</tt>&rsquo;, and center it on a grid of size
17477 300x300 pixels:
17478 <table><tr><td>&nbsp;</td><td><pre class="example">life=f=pattern:s=300x300
17479 </pre></td></tr></table>
17480
17481 </li><li>
17482 Generate a random grid of size 200x200, with a fill ratio of 2/3:
17483 <table><tr><td>&nbsp;</td><td><pre class="example">life=ratio=2/3:s=200x200
17484 </pre></td></tr></table>
17485
17486 </li><li>
17487 Specify a custom rule for evolving a randomly generated grid:
17488 <table><tr><td>&nbsp;</td><td><pre class="example">life=rule=S14/B34
17489 </pre></td></tr></table>
17490
17491 </li><li>
17492 Full example with slow death effect (mold) using <code>ffplay</code>:
17493 <table><tr><td>&nbsp;</td><td><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
17494 </pre></td></tr></table>
17495 </li></ul>
17496
17497 <p><a name="color"></a>
17498 <a name="haldclutsrc"></a>
17499 <a name="nullsrc"></a>
17500 <a name="rgbtestsrc"></a>
17501 <a name="smptebars"></a>
17502 <a name="smptehdbars"></a>
17503 <a name="testsrc"></a>
17504 </p><a name="color_002c-haldclutsrc_002c-nullsrc_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc"></a>
17505 <h2 class="section"><a href="ffplay-all.html#toc-color_002c-haldclutsrc_002c-nullsrc_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc">29.7 color, haldclutsrc, nullsrc, rgbtestsrc, smptebars, smptehdbars, testsrc</a></h2>
17506
17507 <p>The <code>color</code> source provides an uniformly colored input.
17508 </p>
17509 <p>The <code>haldclutsrc</code> source provides an identity Hald CLUT. See also
17510 <a href="#haldclut">haldclut</a> filter.
17511 </p>
17512 <p>The <code>nullsrc</code> source returns unprocessed video frames. It is
17513 mainly useful to be employed in analysis / debugging tools, or as the
17514 source for filters which ignore the input data.
17515 </p>
17516 <p>The <code>rgbtestsrc</code> source generates an RGB test pattern useful for
17517 detecting RGB vs BGR issues. You should see a red, green and blue
17518 stripe from top to bottom.
17519 </p>
17520 <p>The <code>smptebars</code> source generates a color bars pattern, based on
17521 the SMPTE Engineering Guideline EG 1-1990.
17522 </p>
17523 <p>The <code>smptehdbars</code> source generates a color bars pattern, based on
17524 the SMPTE RP 219-2002.
17525 </p>
17526 <p>The <code>testsrc</code> source generates a test video pattern, showing a
17527 color pattern, a scrolling gradient and a timestamp. This is mainly
17528 intended for testing purposes.
17529 </p>
17530 <p>The sources accept the following options:
17531 </p>
17532 <dl compact="compact">
17533 <dt> &lsquo;<samp>color, c</samp>&rsquo;</dt>
17534 <dd><p>Specify the color of the source, only available in the <code>color</code>
17535 source. For the syntax of this option, check the &quot;Color&quot; section in the
17536 ffmpeg-utils manual.
17537 </p>
17538 </dd>
17539 <dt> &lsquo;<samp>level</samp>&rsquo;</dt>
17540 <dd><p>Specify the level of the Hald CLUT, only available in the <code>haldclutsrc</code>
17541 source. A level of <code>N</code> generates a picture of <code>N*N*N</code> by <code>N*N*N</code>
17542 pixels to be used as identity matrix for 3D lookup tables. Each component is
17543 coded on a <code>1/(N*N)</code> scale.
17544 </p>
17545 </dd>
17546 <dt> &lsquo;<samp>size, s</samp>&rsquo;</dt>
17547 <dd><p>Specify the size of the sourced video. For the syntax of this option, check the
17548 &quot;Video size&quot; section in the ffmpeg-utils manual. The default value is
17549 &quot;320x240&quot;.
17550 </p>
17551 <p>This option is not available with the <code>haldclutsrc</code> filter.
17552 </p>
17553 </dd>
17554 <dt> &lsquo;<samp>rate, r</samp>&rsquo;</dt>
17555 <dd><p>Specify the frame rate of the sourced video, as the number of frames
17556 generated per second. It has to be a string in the format
17557 <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a float
17558 number or a valid video frame rate abbreviation. The default value is
17559 &quot;25&quot;.
17560 </p>
17561 </dd>
17562 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
17563 <dd><p>Set the sample aspect ratio of the sourced video.
17564 </p>
17565 </dd>
17566 <dt> &lsquo;<samp>duration, d</samp>&rsquo;</dt>
17567 <dd><p>Set the video duration of the sourced video. The accepted syntax is:
17568 </p><table><tr><td>&nbsp;</td><td><pre class="example">[-]HH[:MM[:SS[.m...]]]
17569 [-]S+[.m...]
17570 </pre></td></tr></table>
17571 <p>See also the function <code>av_parse_time()</code>.
17572 </p>
17573 <p>If not specified, or the expressed duration is negative, the video is
17574 supposed to be generated forever.
17575 </p>
17576 </dd>
17577 <dt> &lsquo;<samp>decimals, n</samp>&rsquo;</dt>
17578 <dd><p>Set the number of decimals to show in the timestamp, only available in the
17579 <code>testsrc</code> source.
17580 </p>
17581 <p>The displayed timestamp value will correspond to the original
17582 timestamp value multiplied by the power of 10 of the specified
17583 value. Default value is 0.
17584 </p></dd>
17585 </dl>
17586
17587 <p>For example the following:
17588 </p><table><tr><td>&nbsp;</td><td><pre class="example">testsrc=duration=5.3:size=qcif:rate=10
17589 </pre></td></tr></table>
17590
17591 <p>will generate a video with a duration of 5.3 seconds, with size
17592 176x144 and a frame rate of 10 frames per second.
17593 </p>
17594 <p>The following graph description will generate a red source
17595 with an opacity of 0.2, with size &quot;qcif&quot; and a frame rate of 10
17596 frames per second.
17597 </p><table><tr><td>&nbsp;</td><td><pre class="example">color=c=red@0.2:s=qcif:r=10
17598 </pre></td></tr></table>
17599
17600 <p>If the input content is to be ignored, <code>nullsrc</code> can be used. The
17601 following command generates noise in the luminance plane by employing
17602 the <code>geq</code> filter:
17603 </p><table><tr><td>&nbsp;</td><td><pre class="example">nullsrc=s=256x256, geq=random(1)*255:128:128
17604 </pre></td></tr></table>
17605
17606 <a name="Commands-2"></a>
17607 <h3 class="subsection"><a href="ffplay-all.html#toc-Commands-2">29.7.1 Commands</a></h3>
17608
17609 <p>The <code>color</code> source supports the following commands:
17610 </p>
17611 <dl compact="compact">
17612 <dt> &lsquo;<samp>c, color</samp>&rsquo;</dt>
17613 <dd><p>Set the color of the created image. Accepts the same syntax of the
17614 corresponding &lsquo;<samp>color</samp>&rsquo; option.
17615 </p></dd>
17616 </dl>
17617
17618
17619 <a name="Video-Sinks"></a>
17620 <h1 class="chapter"><a href="ffplay-all.html#toc-Video-Sinks">30. Video Sinks</a></h1>
17621
17622 <p>Below is a description of the currently available video sinks.
17623 </p>
17624 <a name="buffersink"></a>
17625 <h2 class="section"><a href="ffplay-all.html#toc-buffersink">30.1 buffersink</a></h2>
17626
17627 <p>Buffer video frames, and make them available to the end of the filter
17628 graph.
17629 </p>
17630 <p>This sink is mainly intended for a programmatic use, in particular
17631 through the interface defined in &lsquo;<tt>libavfilter/buffersink.h</tt>&rsquo;
17632 or the options system.
17633 </p>
17634 <p>It accepts a pointer to an AVBufferSinkContext structure, which
17635 defines the incoming buffers&rsquo; formats, to be passed as the opaque
17636 parameter to <code>avfilter_init_filter</code> for initialization.
17637 </p>
17638 <a name="nullsink"></a>
17639 <h2 class="section"><a href="ffplay-all.html#toc-nullsink">30.2 nullsink</a></h2>
17640
17641 <p>Null video sink, do absolutely nothing with the input video. It is
17642 mainly useful as a template and to be employed in analysis / debugging
17643 tools.
17644 </p>
17645
17646 <a name="Multimedia-Filters"></a>
17647 <h1 class="chapter"><a href="ffplay-all.html#toc-Multimedia-Filters">31. Multimedia Filters</a></h1>
17648
17649 <p>Below is a description of the currently available multimedia filters.
17650 </p>
17651 <a name="avectorscope"></a>
17652 <h2 class="section"><a href="ffplay-all.html#toc-avectorscope">31.1 avectorscope</a></h2>
17653
17654 <p>Convert input audio to a video output, representing the audio vector
17655 scope.
17656 </p>
17657 <p>The filter is used to measure the difference between channels of stereo
17658 audio stream. A monoaural signal, consisting of identical left and right
17659 signal, results in straight vertical line. Any stereo separation is visible
17660 as a deviation from this line, creating a Lissajous figure.
17661 If the straight (or deviation from it) but horizontal line appears this
17662 indicates that the left and right channels are out of phase.
17663 </p>
17664 <p>The filter accepts the following options:
17665 </p>
17666 <dl compact="compact">
17667 <dt> &lsquo;<samp>mode, m</samp>&rsquo;</dt>
17668 <dd><p>Set the vectorscope mode.
17669 </p>
17670 <p>Available values are:
17671 </p><dl compact="compact">
17672 <dt> &lsquo;<samp>lissajous</samp>&rsquo;</dt>
17673 <dd><p>Lissajous rotated by 45 degrees.
17674 </p>
17675 </dd>
17676 <dt> &lsquo;<samp>lissajous_xy</samp>&rsquo;</dt>
17677 <dd><p>Same as above but not rotated.
17678 </p></dd>
17679 </dl>
17680
17681 <p>Default value is &lsquo;<samp>lissajous</samp>&rsquo;.
17682 </p>
17683 </dd>
17684 <dt> &lsquo;<samp>size, s</samp>&rsquo;</dt>
17685 <dd><p>Set the video size for the output. For the syntax of this option, check the &quot;Video size&quot;
17686 section in the ffmpeg-utils manual. Default value is <code>400x400</code>.
17687 </p>
17688 </dd>
17689 <dt> &lsquo;<samp>rate, r</samp>&rsquo;</dt>
17690 <dd><p>Set the output frame rate. Default value is <code>25</code>.
17691 </p>
17692 </dd>
17693 <dt> &lsquo;<samp>rc</samp>&rsquo;</dt>
17694 <dt> &lsquo;<samp>gc</samp>&rsquo;</dt>
17695 <dt> &lsquo;<samp>bc</samp>&rsquo;</dt>
17696 <dd><p>Specify the red, green and blue contrast. Default values are <code>40</code>, <code>160</code> and <code>80</code>.
17697 Allowed range is <code>[0, 255]</code>.
17698 </p>
17699 </dd>
17700 <dt> &lsquo;<samp>rf</samp>&rsquo;</dt>
17701 <dt> &lsquo;<samp>gf</samp>&rsquo;</dt>
17702 <dt> &lsquo;<samp>bf</samp>&rsquo;</dt>
17703 <dd><p>Specify the red, green and blue fade. Default values are <code>15</code>, <code>10</code> and <code>5</code>.
17704 Allowed range is <code>[0, 255]</code>.
17705 </p>
17706 </dd>
17707 <dt> &lsquo;<samp>zoom</samp>&rsquo;</dt>
17708 <dd><p>Set the zoom factor. Default value is <code>1</code>. Allowed range is <code>[1, 10]</code>.
17709 </p></dd>
17710 </dl>
17711
17712 <a name="Examples-48"></a>
17713 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-48">31.1.1 Examples</a></h3>
17714
17715 <ul>
17716 <li>
17717 Complete example using <code>ffplay</code>:
17718 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
17719              [a] avectorscope=zoom=1.3:rc=2:gc=200:bc=10:rf=1:gf=8:bf=7 [out0]'
17720 </pre></td></tr></table>
17721 </li></ul>
17722
17723 <a name="concat-2"></a>
17724 <h2 class="section"><a href="ffplay-all.html#toc-concat-2">31.2 concat</a></h2>
17725
17726 <p>Concatenate audio and video streams, joining them together one after the
17727 other.
17728 </p>
17729 <p>The filter works on segments of synchronized video and audio streams. All
17730 segments must have the same number of streams of each type, and that will
17731 also be the number of streams at output.
17732 </p>
17733 <p>The filter accepts the following options:
17734 </p>
17735 <dl compact="compact">
17736 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
17737 <dd><p>Set the number of segments. Default is 2.
17738 </p>
17739 </dd>
17740 <dt> &lsquo;<samp>v</samp>&rsquo;</dt>
17741 <dd><p>Set the number of output video streams, that is also the number of video
17742 streams in each segment. Default is 1.
17743 </p>
17744 </dd>
17745 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
17746 <dd><p>Set the number of output audio streams, that is also the number of video
17747 streams in each segment. Default is 0.
17748 </p>
17749 </dd>
17750 <dt> &lsquo;<samp>unsafe</samp>&rsquo;</dt>
17751 <dd><p>Activate unsafe mode: do not fail if segments have a different format.
17752 </p>
17753 </dd>
17754 </dl>
17755
17756 <p>The filter has <var>v</var>+<var>a</var> outputs: first <var>v</var> video outputs, then
17757 <var>a</var> audio outputs.
17758 </p>
17759 <p>There are <var>n</var>x(<var>v</var>+<var>a</var>) inputs: first the inputs for the first
17760 segment, in the same order as the outputs, then the inputs for the second
17761 segment, etc.
17762 </p>
17763 <p>Related streams do not always have exactly the same duration, for various
17764 reasons including codec frame size or sloppy authoring. For that reason,
17765 related synchronized streams (e.g. a video and its audio track) should be
17766 concatenated at once. The concat filter will use the duration of the longest
17767 stream in each segment (except the last one), and if necessary pad shorter
17768 audio streams with silence.
17769 </p>
17770 <p>For this filter to work correctly, all segments must start at timestamp 0.
17771 </p>
17772 <p>All corresponding streams must have the same parameters in all segments; the
17773 filtering system will automatically select a common pixel format for video
17774 streams, and a common sample format, sample rate and channel layout for
17775 audio streams, but other settings, such as resolution, must be converted
17776 explicitly by the user.
17777 </p>
17778 <p>Different frame rates are acceptable but will result in variable frame rate
17779 at output; be sure to configure the output file to handle it.
17780 </p>
17781 <a name="Examples-24"></a>
17782 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-24">31.2.1 Examples</a></h3>
17783
17784 <ul>
17785 <li>
17786 Concatenate an opening, an episode and an ending, all in bilingual version
17787 (video in stream 0, audio in streams 1 and 2):
17788 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \
17789   '[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
17790    concat=n=3:v=1:a=2 [v] [a1] [a2]' \
17791   -map '[v]' -map '[a1]' -map '[a2]' output.mkv
17792 </pre></td></tr></table>
17793
17794 </li><li>
17795 Concatenate two parts, handling audio and video separately, using the
17796 (a)movie sources, and adjusting the resolution:
17797 <table><tr><td>&nbsp;</td><td><pre class="example">movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
17798 movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
17799 [v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
17800 </pre></td></tr></table>
17801 <p>Note that a desync will happen at the stitch if the audio and video streams
17802 do not have exactly the same duration in the first file.
17803 </p>
17804 </li></ul>
17805
17806 <a name="ebur128"></a>
17807 <h2 class="section"><a href="ffplay-all.html#toc-ebur128">31.3 ebur128</a></h2>
17808
17809 <p>EBU R128 scanner filter. This filter takes an audio stream as input and outputs
17810 it unchanged. By default, it logs a message at a frequency of 10Hz with the
17811 Momentary loudness (identified by <code>M</code>), Short-term loudness (<code>S</code>),
17812 Integrated loudness (<code>I</code>) and Loudness Range (<code>LRA</code>).
17813 </p>
17814 <p>The filter also has a video output (see the <var>video</var> option) with a real
17815 time graph to observe the loudness evolution. The graphic contains the logged
17816 message mentioned above, so it is not printed anymore when this option is set,
17817 unless the verbose logging is set. The main graphing area contains the
17818 short-term loudness (3 seconds of analysis), and the gauge on the right is for
17819 the momentary loudness (400 milliseconds).
17820 </p>
17821 <p>More information about the Loudness Recommendation EBU R128 on
17822 <a href="http://tech.ebu.ch/loudness">http://tech.ebu.ch/loudness</a>.
17823 </p>
17824 <p>The filter accepts the following options:
17825 </p>
17826 <dl compact="compact">
17827 <dt> &lsquo;<samp>video</samp>&rsquo;</dt>
17828 <dd><p>Activate the video output. The audio stream is passed unchanged whether this
17829 option is set or no. The video stream will be the first output stream if
17830 activated. Default is <code>0</code>.
17831 </p>
17832 </dd>
17833 <dt> &lsquo;<samp>size</samp>&rsquo;</dt>
17834 <dd><p>Set the video size. This option is for video only. For the syntax of this
17835 option, check the &quot;Video size&quot; section in the ffmpeg-utils manual. Default
17836 and minimum resolution is <code>640x480</code>.
17837 </p>
17838 </dd>
17839 <dt> &lsquo;<samp>meter</samp>&rsquo;</dt>
17840 <dd><p>Set the EBU scale meter. Default is <code>9</code>. Common values are <code>9</code> and
17841 <code>18</code>, respectively for EBU scale meter +9 and EBU scale meter +18. Any
17842 other integer value between this range is allowed.
17843 </p>
17844 </dd>
17845 <dt> &lsquo;<samp>metadata</samp>&rsquo;</dt>
17846 <dd><p>Set metadata injection. If set to <code>1</code>, the audio input will be segmented
17847 into 100ms output frames, each of them containing various loudness information
17848 in metadata.  All the metadata keys are prefixed with <code>lavfi.r128.</code>.
17849 </p>
17850 <p>Default is <code>0</code>.
17851 </p>
17852 </dd>
17853 <dt> &lsquo;<samp>framelog</samp>&rsquo;</dt>
17854 <dd><p>Force the frame logging level.
17855 </p>
17856 <p>Available values are:
17857 </p><dl compact="compact">
17858 <dt> &lsquo;<samp>info</samp>&rsquo;</dt>
17859 <dd><p>information logging level
17860 </p></dd>
17861 <dt> &lsquo;<samp>verbose</samp>&rsquo;</dt>
17862 <dd><p>verbose logging level
17863 </p></dd>
17864 </dl>
17865
17866 <p>By default, the logging level is set to <var>info</var>. If the &lsquo;<samp>video</samp>&rsquo; or
17867 the &lsquo;<samp>metadata</samp>&rsquo; options are set, it switches to <var>verbose</var>.
17868 </p>
17869 </dd>
17870 <dt> &lsquo;<samp>peak</samp>&rsquo;</dt>
17871 <dd><p>Set peak mode(s).
17872 </p>
17873 <p>Available modes can be cumulated (the option is a <code>flag</code> type). Possible
17874 values are:
17875 </p><dl compact="compact">
17876 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
17877 <dd><p>Disable any peak mode (default).
17878 </p></dd>
17879 <dt> &lsquo;<samp>sample</samp>&rsquo;</dt>
17880 <dd><p>Enable sample-peak mode.
17881 </p>
17882 <p>Simple peak mode looking for the higher sample value. It logs a message
17883 for sample-peak (identified by <code>SPK</code>).
17884 </p></dd>
17885 <dt> &lsquo;<samp>true</samp>&rsquo;</dt>
17886 <dd><p>Enable true-peak mode.
17887 </p>
17888 <p>If enabled, the peak lookup is done on an over-sampled version of the input
17889 stream for better peak accuracy. It logs a message for true-peak.
17890 (identified by <code>TPK</code>) and true-peak per frame (identified by <code>FTPK</code>).
17891 This mode requires a build with <code>libswresample</code>.
17892 </p></dd>
17893 </dl>
17894
17895 </dd>
17896 </dl>
17897
17898 <a name="Examples-13"></a>
17899 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-13">31.3.1 Examples</a></h3>
17900
17901 <ul>
17902 <li>
17903 Real-time graph using <code>ffplay</code>, with a EBU scale meter +18:
17904 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f lavfi -i &quot;amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]&quot;
17905 </pre></td></tr></table>
17906
17907 </li><li>
17908 Run an analysis with <code>ffmpeg</code>:
17909 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -nostats -i input.mp3 -filter_complex ebur128 -f null -
17910 </pre></td></tr></table>
17911 </li></ul>
17912
17913 <a name="interleave_002c-ainterleave"></a>
17914 <h2 class="section"><a href="ffplay-all.html#toc-interleave_002c-ainterleave">31.4 interleave, ainterleave</a></h2>
17915
17916 <p>Temporally interleave frames from several inputs.
17917 </p>
17918 <p><code>interleave</code> works with video inputs, <code>ainterleave</code> with audio.
17919 </p>
17920 <p>These filters read frames from several inputs and send the oldest
17921 queued frame to the output.
17922 </p>
17923 <p>Input streams must have a well defined, monotonically increasing frame
17924 timestamp values.
17925 </p>
17926 <p>In order to submit one frame to output, these filters need to enqueue
17927 at least one frame for each input, so they cannot work in case one
17928 input is not yet terminated and will not receive incoming frames.
17929 </p>
17930 <p>For example consider the case when one input is a <code>select</code> filter
17931 which always drop input frames. The <code>interleave</code> filter will keep
17932 reading from that input, but it will never be able to send new frames
17933 to output until the input will send an end-of-stream signal.
17934 </p>
17935 <p>Also, depending on inputs synchronization, the filters will drop
17936 frames in case one input receives more frames than the other ones, and
17937 the queue is already filled.
17938 </p>
17939 <p>These filters accept the following options:
17940 </p>
17941 <dl compact="compact">
17942 <dt> &lsquo;<samp>nb_inputs, n</samp>&rsquo;</dt>
17943 <dd><p>Set the number of different inputs, it is 2 by default.
17944 </p></dd>
17945 </dl>
17946
17947 <a name="Examples-7"></a>
17948 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-7">31.4.1 Examples</a></h3>
17949
17950 <ul>
17951 <li>
17952 Interleave frames belonging to different streams using <code>ffmpeg</code>:
17953 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i bambi.avi -i pr0n.mkv -filter_complex &quot;[0:v][1:v] interleave&quot; out.avi
17954 </pre></td></tr></table>
17955
17956 </li><li>
17957 Add flickering blur effect:
17958 <table><tr><td>&nbsp;</td><td><pre class="example">select='if(gt(random(0), 0.2), 1, 2)':n=2 [tmp], boxblur=2:2, [tmp] interleave
17959 </pre></td></tr></table>
17960 </li></ul>
17961
17962 <a name="perms_002c-aperms"></a>
17963 <h2 class="section"><a href="ffplay-all.html#toc-perms_002c-aperms">31.5 perms, aperms</a></h2>
17964
17965 <p>Set read/write permissions for the output frames.
17966 </p>
17967 <p>These filters are mainly aimed at developers to test direct path in the
17968 following filter in the filtergraph.
17969 </p>
17970 <p>The filters accept the following options:
17971 </p>
17972 <dl compact="compact">
17973 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
17974 <dd><p>Select the permissions mode.
17975 </p>
17976 <p>It accepts the following values:
17977 </p><dl compact="compact">
17978 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
17979 <dd><p>Do nothing. This is the default.
17980 </p></dd>
17981 <dt> &lsquo;<samp>ro</samp>&rsquo;</dt>
17982 <dd><p>Set all the output frames read-only.
17983 </p></dd>
17984 <dt> &lsquo;<samp>rw</samp>&rsquo;</dt>
17985 <dd><p>Set all the output frames directly writable.
17986 </p></dd>
17987 <dt> &lsquo;<samp>toggle</samp>&rsquo;</dt>
17988 <dd><p>Make the frame read-only if writable, and writable if read-only.
17989 </p></dd>
17990 <dt> &lsquo;<samp>random</samp>&rsquo;</dt>
17991 <dd><p>Set each output frame read-only or writable randomly.
17992 </p></dd>
17993 </dl>
17994
17995 </dd>
17996 <dt> &lsquo;<samp>seed</samp>&rsquo;</dt>
17997 <dd><p>Set the seed for the <var>random</var> mode, must be an integer included between
17998 <code>0</code> and <code>UINT32_MAX</code>. If not specified, or if explicitly set to
17999 <code>-1</code>, the filter will try to use a good random seed on a best effort
18000 basis.
18001 </p></dd>
18002 </dl>
18003
18004 <p>Note: in case of auto-inserted filter between the permission filter and the
18005 following one, the permission might not be received as expected in that
18006 following filter. Inserting a <a href="#format">format</a> or <a href="#aformat">aformat</a> filter before the
18007 perms/aperms filter can avoid this problem.
18008 </p>
18009 <a name="select_002c-aselect"></a>
18010 <h2 class="section"><a href="ffplay-all.html#toc-select_002c-aselect">31.6 select, aselect</a></h2>
18011
18012 <p>Select frames to pass in output.
18013 </p>
18014 <p>This filter accepts the following options:
18015 </p>
18016 <dl compact="compact">
18017 <dt> &lsquo;<samp>expr, e</samp>&rsquo;</dt>
18018 <dd><p>Set expression, which is evaluated for each input frame.
18019 </p>
18020 <p>If the expression is evaluated to zero, the frame is discarded.
18021 </p>
18022 <p>If the evaluation result is negative or NaN, the frame is sent to the
18023 first output; otherwise it is sent to the output with index
18024 <code>ceil(val)-1</code>, assuming that the input index starts from 0.
18025 </p>
18026 <p>For example a value of <code>1.2</code> corresponds to the output with index
18027 <code>ceil(1.2)-1 = 2-1 = 1</code>, that is the second output.
18028 </p>
18029 </dd>
18030 <dt> &lsquo;<samp>outputs, n</samp>&rsquo;</dt>
18031 <dd><p>Set the number of outputs. The output to which to send the selected
18032 frame is based on the result of the evaluation. Default value is 1.
18033 </p></dd>
18034 </dl>
18035
18036 <p>The expression can contain the following constants:
18037 </p>
18038 <dl compact="compact">
18039 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
18040 <dd><p>the sequential number of the filtered frame, starting from 0
18041 </p>
18042 </dd>
18043 <dt> &lsquo;<samp>selected_n</samp>&rsquo;</dt>
18044 <dd><p>the sequential number of the selected frame, starting from 0
18045 </p>
18046 </dd>
18047 <dt> &lsquo;<samp>prev_selected_n</samp>&rsquo;</dt>
18048 <dd><p>the sequential number of the last selected frame, NAN if undefined
18049 </p>
18050 </dd>
18051 <dt> &lsquo;<samp>TB</samp>&rsquo;</dt>
18052 <dd><p>timebase of the input timestamps
18053 </p>
18054 </dd>
18055 <dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
18056 <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
18057 expressed in <var>TB</var> units, NAN if undefined
18058 </p>
18059 </dd>
18060 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
18061 <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
18062 expressed in seconds, NAN if undefined
18063 </p>
18064 </dd>
18065 <dt> &lsquo;<samp>prev_pts</samp>&rsquo;</dt>
18066 <dd><p>the PTS of the previously filtered video frame, NAN if undefined
18067 </p>
18068 </dd>
18069 <dt> &lsquo;<samp>prev_selected_pts</samp>&rsquo;</dt>
18070 <dd><p>the PTS of the last previously filtered video frame, NAN if undefined
18071 </p>
18072 </dd>
18073 <dt> &lsquo;<samp>prev_selected_t</samp>&rsquo;</dt>
18074 <dd><p>the PTS of the last previously selected video frame, NAN if undefined
18075 </p>
18076 </dd>
18077 <dt> &lsquo;<samp>start_pts</samp>&rsquo;</dt>
18078 <dd><p>the PTS of the first video frame in the video, NAN if undefined
18079 </p>
18080 </dd>
18081 <dt> &lsquo;<samp>start_t</samp>&rsquo;</dt>
18082 <dd><p>the time of the first video frame in the video, NAN if undefined
18083 </p>
18084 </dd>
18085 <dt> &lsquo;<samp>pict_type <em>(video only)</em></samp>&rsquo;</dt>
18086 <dd><p>the type of the filtered frame, can assume one of the following
18087 values:
18088 </p><dl compact="compact">
18089 <dt> &lsquo;<samp>I</samp>&rsquo;</dt>
18090 <dt> &lsquo;<samp>P</samp>&rsquo;</dt>
18091 <dt> &lsquo;<samp>B</samp>&rsquo;</dt>
18092 <dt> &lsquo;<samp>S</samp>&rsquo;</dt>
18093 <dt> &lsquo;<samp>SI</samp>&rsquo;</dt>
18094 <dt> &lsquo;<samp>SP</samp>&rsquo;</dt>
18095 <dt> &lsquo;<samp>BI</samp>&rsquo;</dt>
18096 </dl>
18097
18098 </dd>
18099 <dt> &lsquo;<samp>interlace_type <em>(video only)</em></samp>&rsquo;</dt>
18100 <dd><p>the frame interlace type, can assume one of the following values:
18101 </p><dl compact="compact">
18102 <dt> &lsquo;<samp>PROGRESSIVE</samp>&rsquo;</dt>
18103 <dd><p>the frame is progressive (not interlaced)
18104 </p></dd>
18105 <dt> &lsquo;<samp>TOPFIRST</samp>&rsquo;</dt>
18106 <dd><p>the frame is top-field-first
18107 </p></dd>
18108 <dt> &lsquo;<samp>BOTTOMFIRST</samp>&rsquo;</dt>
18109 <dd><p>the frame is bottom-field-first
18110 </p></dd>
18111 </dl>
18112
18113 </dd>
18114 <dt> &lsquo;<samp>consumed_sample_n <em>(audio only)</em></samp>&rsquo;</dt>
18115 <dd><p>the number of selected samples before the current frame
18116 </p>
18117 </dd>
18118 <dt> &lsquo;<samp>samples_n <em>(audio only)</em></samp>&rsquo;</dt>
18119 <dd><p>the number of samples in the current frame
18120 </p>
18121 </dd>
18122 <dt> &lsquo;<samp>sample_rate <em>(audio only)</em></samp>&rsquo;</dt>
18123 <dd><p>the input sample rate
18124 </p>
18125 </dd>
18126 <dt> &lsquo;<samp>key</samp>&rsquo;</dt>
18127 <dd><p>1 if the filtered frame is a key-frame, 0 otherwise
18128 </p>
18129 </dd>
18130 <dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
18131 <dd><p>the position in the file of the filtered frame, -1 if the information
18132 is not available (e.g. for synthetic video)
18133 </p>
18134 </dd>
18135 <dt> &lsquo;<samp>scene <em>(video only)</em></samp>&rsquo;</dt>
18136 <dd><p>value between 0 and 1 to indicate a new scene; a low value reflects a low
18137 probability for the current frame to introduce a new scene, while a higher
18138 value means the current frame is more likely to be one (see the example below)
18139 </p>
18140 </dd>
18141 </dl>
18142
18143 <p>The default value of the select expression is &quot;1&quot;.
18144 </p>
18145 <a name="Examples-20"></a>
18146 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-20">31.6.1 Examples</a></h3>
18147
18148 <ul>
18149 <li>
18150 Select all frames in input:
18151 <table><tr><td>&nbsp;</td><td><pre class="example">select
18152 </pre></td></tr></table>
18153
18154 <p>The example above is the same as:
18155 </p><table><tr><td>&nbsp;</td><td><pre class="example">select=1
18156 </pre></td></tr></table>
18157
18158 </li><li>
18159 Skip all frames:
18160 <table><tr><td>&nbsp;</td><td><pre class="example">select=0
18161 </pre></td></tr></table>
18162
18163 </li><li>
18164 Select only I-frames:
18165 <table><tr><td>&nbsp;</td><td><pre class="example">select='eq(pict_type\,I)'
18166 </pre></td></tr></table>
18167
18168 </li><li>
18169 Select one frame every 100:
18170 <table><tr><td>&nbsp;</td><td><pre class="example">select='not(mod(n\,100))'
18171 </pre></td></tr></table>
18172
18173 </li><li>
18174 Select only frames contained in the 10-20 time interval:
18175 <table><tr><td>&nbsp;</td><td><pre class="example">select=between(t\,10\,20)
18176 </pre></td></tr></table>
18177
18178 </li><li>
18179 Select only I frames contained in the 10-20 time interval:
18180 <table><tr><td>&nbsp;</td><td><pre class="example">select=between(t\,10\,20)*eq(pict_type\,I)
18181 </pre></td></tr></table>
18182
18183 </li><li>
18184 Select frames with a minimum distance of 10 seconds:
18185 <table><tr><td>&nbsp;</td><td><pre class="example">select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
18186 </pre></td></tr></table>
18187
18188 </li><li>
18189 Use aselect to select only audio frames with samples number &gt; 100:
18190 <table><tr><td>&nbsp;</td><td><pre class="example">aselect='gt(samples_n\,100)'
18191 </pre></td></tr></table>
18192
18193 </li><li>
18194 Create a mosaic of the first scenes:
18195 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png
18196 </pre></td></tr></table>
18197
18198 <p>Comparing <var>scene</var> against a value between 0.3 and 0.5 is generally a sane
18199 choice.
18200 </p>
18201 </li><li>
18202 Send even and odd frames to separate outputs, and compose them:
18203 <table><tr><td>&nbsp;</td><td><pre class="example">select=n=2:e='mod(n, 2)+1' [odd][even]; [odd] pad=h=2*ih [tmp]; [tmp][even] overlay=y=h
18204 </pre></td></tr></table>
18205 </li></ul>
18206
18207 <a name="sendcmd_002c-asendcmd"></a>
18208 <h2 class="section"><a href="ffplay-all.html#toc-sendcmd_002c-asendcmd">31.7 sendcmd, asendcmd</a></h2>
18209
18210 <p>Send commands to filters in the filtergraph.
18211 </p>
18212 <p>These filters read commands to be sent to other filters in the
18213 filtergraph.
18214 </p>
18215 <p><code>sendcmd</code> must be inserted between two video filters,
18216 <code>asendcmd</code> must be inserted between two audio filters, but apart
18217 from that they act the same way.
18218 </p>
18219 <p>The specification of commands can be provided in the filter arguments
18220 with the <var>commands</var> option, or in a file specified by the
18221 <var>filename</var> option.
18222 </p>
18223 <p>These filters accept the following options:
18224 </p><dl compact="compact">
18225 <dt> &lsquo;<samp>commands, c</samp>&rsquo;</dt>
18226 <dd><p>Set the commands to be read and sent to the other filters.
18227 </p></dd>
18228 <dt> &lsquo;<samp>filename, f</samp>&rsquo;</dt>
18229 <dd><p>Set the filename of the commands to be read and sent to the other
18230 filters.
18231 </p></dd>
18232 </dl>
18233
18234 <a name="Commands-syntax"></a>
18235 <h3 class="subsection"><a href="ffplay-all.html#toc-Commands-syntax">31.7.1 Commands syntax</a></h3>
18236
18237 <p>A commands description consists of a sequence of interval
18238 specifications, comprising a list of commands to be executed when a
18239 particular event related to that interval occurs. The occurring event
18240 is typically the current frame time entering or leaving a given time
18241 interval.
18242 </p>
18243 <p>An interval is specified by the following syntax:
18244 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>START</var>[-<var>END</var>] <var>COMMANDS</var>;
18245 </pre></td></tr></table>
18246
18247 <p>The time interval is specified by the <var>START</var> and <var>END</var> times.
18248 <var>END</var> is optional and defaults to the maximum time.
18249 </p>
18250 <p>The current frame time is considered within the specified interval if
18251 it is included in the interval [<var>START</var>, <var>END</var>), that is when
18252 the time is greater or equal to <var>START</var> and is lesser than
18253 <var>END</var>.
18254 </p>
18255 <p><var>COMMANDS</var> consists of a sequence of one or more command
18256 specifications, separated by &quot;,&quot;, relating to that interval.  The
18257 syntax of a command specification is given by:
18258 </p><table><tr><td>&nbsp;</td><td><pre class="example">[<var>FLAGS</var>] <var>TARGET</var> <var>COMMAND</var> <var>ARG</var>
18259 </pre></td></tr></table>
18260
18261 <p><var>FLAGS</var> is optional and specifies the type of events relating to
18262 the time interval which enable sending the specified command, and must
18263 be a non-null sequence of identifier flags separated by &quot;+&quot; or &quot;|&quot; and
18264 enclosed between &quot;[&quot; and &quot;]&quot;.
18265 </p>
18266 <p>The following flags are recognized:
18267 </p><dl compact="compact">
18268 <dt> &lsquo;<samp>enter</samp>&rsquo;</dt>
18269 <dd><p>The command is sent when the current frame timestamp enters the
18270 specified interval. In other words, the command is sent when the
18271 previous frame timestamp was not in the given interval, and the
18272 current is.
18273 </p>
18274 </dd>
18275 <dt> &lsquo;<samp>leave</samp>&rsquo;</dt>
18276 <dd><p>The command is sent when the current frame timestamp leaves the
18277 specified interval. In other words, the command is sent when the
18278 previous frame timestamp was in the given interval, and the
18279 current is not.
18280 </p></dd>
18281 </dl>
18282
18283 <p>If <var>FLAGS</var> is not specified, a default value of <code>[enter]</code> is
18284 assumed.
18285 </p>
18286 <p><var>TARGET</var> specifies the target of the command, usually the name of
18287 the filter class or a specific filter instance name.
18288 </p>
18289 <p><var>COMMAND</var> specifies the name of the command for the target filter.
18290 </p>
18291 <p><var>ARG</var> is optional and specifies the optional list of argument for
18292 the given <var>COMMAND</var>.
18293 </p>
18294 <p>Between one interval specification and another, whitespaces, or
18295 sequences of characters starting with <code>#</code> until the end of line,
18296 are ignored and can be used to annotate comments.
18297 </p>
18298 <p>A simplified BNF description of the commands specification syntax
18299 follows:
18300 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>COMMAND_FLAG</var>  ::= &quot;enter&quot; | &quot;leave&quot;
18301 <var>COMMAND_FLAGS</var> ::= <var>COMMAND_FLAG</var> [(+|&quot;|&quot;)<var>COMMAND_FLAG</var>]
18302 <var>COMMAND</var>       ::= [&quot;[&quot; <var>COMMAND_FLAGS</var> &quot;]&quot;] <var>TARGET</var> <var>COMMAND</var> [<var>ARG</var>]
18303 <var>COMMANDS</var>      ::= <var>COMMAND</var> [,<var>COMMANDS</var>]
18304 <var>INTERVAL</var>      ::= <var>START</var>[-<var>END</var>] <var>COMMANDS</var>
18305 <var>INTERVALS</var>     ::= <var>INTERVAL</var>[;<var>INTERVALS</var>]
18306 </pre></td></tr></table>
18307
18308 <a name="Examples-36"></a>
18309 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-36">31.7.2 Examples</a></h3>
18310
18311 <ul>
18312 <li>
18313 Specify audio tempo change at second 4:
18314 <table><tr><td>&nbsp;</td><td><pre class="example">asendcmd=c='4.0 atempo tempo 1.5',atempo
18315 </pre></td></tr></table>
18316
18317 </li><li>
18318 Specify a list of drawtext and hue commands in a file.
18319 <table><tr><td>&nbsp;</td><td><pre class="example"># show text in the interval 5-10
18320 5.0-10.0 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=hello world',
18321          [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=';
18322
18323 # desaturate the image in the interval 15-20
18324 15.0-20.0 [enter] hue s 0,
18325           [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=nocolor',
18326           [leave] hue s 1,
18327           [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color';
18328
18329 # apply an exponential saturation fade-out effect, starting from time 25
18330 25 [enter] hue s exp(25-t)
18331 </pre></td></tr></table>
18332
18333 <p>A filtergraph allowing to read and process the above command list
18334 stored in a file &lsquo;<tt>test.cmd</tt>&rsquo;, can be specified with:
18335 </p><table><tr><td>&nbsp;</td><td><pre class="example">sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue
18336 </pre></td></tr></table>
18337 </li></ul>
18338
18339 <p><a name="setpts"></a>
18340 </p><a name="setpts_002c-asetpts"></a>
18341 <h2 class="section"><a href="ffplay-all.html#toc-setpts_002c-asetpts">31.8 setpts, asetpts</a></h2>
18342
18343 <p>Change the PTS (presentation timestamp) of the input frames.
18344 </p>
18345 <p><code>setpts</code> works on video frames, <code>asetpts</code> on audio frames.
18346 </p>
18347 <p>This filter accepts the following options:
18348 </p>
18349 <dl compact="compact">
18350 <dt> &lsquo;<samp>expr</samp>&rsquo;</dt>
18351 <dd><p>The expression which is evaluated for each frame to construct its timestamp.
18352 </p>
18353 </dd>
18354 </dl>
18355
18356 <p>The expression is evaluated through the eval API and can contain the following
18357 constants:
18358 </p>
18359 <dl compact="compact">
18360 <dt> &lsquo;<samp>FRAME_RATE</samp>&rsquo;</dt>
18361 <dd><p>frame rate, only defined for constant frame-rate video
18362 </p>
18363 </dd>
18364 <dt> &lsquo;<samp>PTS</samp>&rsquo;</dt>
18365 <dd><p>the presentation timestamp in input
18366 </p>
18367 </dd>
18368 <dt> &lsquo;<samp>N</samp>&rsquo;</dt>
18369 <dd><p>the count of the input frame for video or the number of consumed samples,
18370 not including the current frame for audio, starting from 0.
18371 </p>
18372 </dd>
18373 <dt> &lsquo;<samp>NB_CONSUMED_SAMPLES</samp>&rsquo;</dt>
18374 <dd><p>the number of consumed samples, not including the current frame (only
18375 audio)
18376 </p>
18377 </dd>
18378 <dt> &lsquo;<samp>NB_SAMPLES, S</samp>&rsquo;</dt>
18379 <dd><p>the number of samples in the current frame (only audio)
18380 </p>
18381 </dd>
18382 <dt> &lsquo;<samp>SAMPLE_RATE, SR</samp>&rsquo;</dt>
18383 <dd><p>audio sample rate
18384 </p>
18385 </dd>
18386 <dt> &lsquo;<samp>STARTPTS</samp>&rsquo;</dt>
18387 <dd><p>the PTS of the first frame
18388 </p>
18389 </dd>
18390 <dt> &lsquo;<samp>STARTT</samp>&rsquo;</dt>
18391 <dd><p>the time in seconds of the first frame
18392 </p>
18393 </dd>
18394 <dt> &lsquo;<samp>INTERLACED</samp>&rsquo;</dt>
18395 <dd><p>tell if the current frame is interlaced
18396 </p>
18397 </dd>
18398 <dt> &lsquo;<samp>T</samp>&rsquo;</dt>
18399 <dd><p>the time in seconds of the current frame
18400 </p>
18401 </dd>
18402 <dt> &lsquo;<samp>POS</samp>&rsquo;</dt>
18403 <dd><p>original position in the file of the frame, or undefined if undefined
18404 for the current frame
18405 </p>
18406 </dd>
18407 <dt> &lsquo;<samp>PREV_INPTS</samp>&rsquo;</dt>
18408 <dd><p>previous input PTS
18409 </p>
18410 </dd>
18411 <dt> &lsquo;<samp>PREV_INT</samp>&rsquo;</dt>
18412 <dd><p>previous input time in seconds
18413 </p>
18414 </dd>
18415 <dt> &lsquo;<samp>PREV_OUTPTS</samp>&rsquo;</dt>
18416 <dd><p>previous output PTS
18417 </p>
18418 </dd>
18419 <dt> &lsquo;<samp>PREV_OUTT</samp>&rsquo;</dt>
18420 <dd><p>previous output time in seconds
18421 </p>
18422 </dd>
18423 <dt> &lsquo;<samp>RTCTIME</samp>&rsquo;</dt>
18424 <dd><p>wallclock (RTC) time in microseconds. This is deprecated, use time(0)
18425 instead.
18426 </p>
18427 </dd>
18428 <dt> &lsquo;<samp>RTCSTART</samp>&rsquo;</dt>
18429 <dd><p>wallclock (RTC) time at the start of the movie in microseconds
18430 </p>
18431 </dd>
18432 <dt> &lsquo;<samp>TB</samp>&rsquo;</dt>
18433 <dd><p>timebase of the input timestamps
18434 </p>
18435 </dd>
18436 </dl>
18437
18438 <a name="Examples-59"></a>
18439 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-59">31.8.1 Examples</a></h3>
18440
18441 <ul>
18442 <li>
18443 Start counting PTS from zero
18444 <table><tr><td>&nbsp;</td><td><pre class="example">setpts=PTS-STARTPTS
18445 </pre></td></tr></table>
18446
18447 </li><li>
18448 Apply fast motion effect:
18449 <table><tr><td>&nbsp;</td><td><pre class="example">setpts=0.5*PTS
18450 </pre></td></tr></table>
18451
18452 </li><li>
18453 Apply slow motion effect:
18454 <table><tr><td>&nbsp;</td><td><pre class="example">setpts=2.0*PTS
18455 </pre></td></tr></table>
18456
18457 </li><li>
18458 Set fixed rate of 25 frames per second:
18459 <table><tr><td>&nbsp;</td><td><pre class="example">setpts=N/(25*TB)
18460 </pre></td></tr></table>
18461
18462 </li><li>
18463 Set fixed rate 25 fps with some jitter:
18464 <table><tr><td>&nbsp;</td><td><pre class="example">setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
18465 </pre></td></tr></table>
18466
18467 </li><li>
18468 Apply an offset of 10 seconds to the input PTS:
18469 <table><tr><td>&nbsp;</td><td><pre class="example">setpts=PTS+10/TB
18470 </pre></td></tr></table>
18471
18472 </li><li>
18473 Generate timestamps from a &quot;live source&quot; and rebase onto the current timebase:
18474 <table><tr><td>&nbsp;</td><td><pre class="example">setpts='(RTCTIME - RTCSTART) / (TB * 1000000)'
18475 </pre></td></tr></table>
18476
18477 </li><li>
18478 Generate timestamps by counting samples:
18479 <table><tr><td>&nbsp;</td><td><pre class="example">asetpts=N/SR/TB
18480 </pre></td></tr></table>
18481
18482 </li></ul>
18483
18484 <a name="settb_002c-asettb"></a>
18485 <h2 class="section"><a href="ffplay-all.html#toc-settb_002c-asettb">31.9 settb, asettb</a></h2>
18486
18487 <p>Set the timebase to use for the output frames timestamps.
18488 It is mainly useful for testing timebase configuration.
18489 </p>
18490 <p>This filter accepts the following options:
18491 </p>
18492 <dl compact="compact">
18493 <dt> &lsquo;<samp>expr, tb</samp>&rsquo;</dt>
18494 <dd><p>The expression which is evaluated into the output timebase.
18495 </p>
18496 </dd>
18497 </dl>
18498
18499 <p>The value for &lsquo;<samp>tb</samp>&rsquo; is an arithmetic expression representing a
18500 rational. The expression can contain the constants &quot;AVTB&quot; (the default
18501 timebase), &quot;intb&quot; (the input timebase) and &quot;sr&quot; (the sample rate,
18502 audio only). Default value is &quot;intb&quot;.
18503 </p>
18504 <a name="Examples-8"></a>
18505 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-8">31.9.1 Examples</a></h3>
18506
18507 <ul>
18508 <li>
18509 Set the timebase to 1/25:
18510 <table><tr><td>&nbsp;</td><td><pre class="example">settb=expr=1/25
18511 </pre></td></tr></table>
18512
18513 </li><li>
18514 Set the timebase to 1/10:
18515 <table><tr><td>&nbsp;</td><td><pre class="example">settb=expr=0.1
18516 </pre></td></tr></table>
18517
18518 </li><li>
18519 Set the timebase to 1001/1000:
18520 <table><tr><td>&nbsp;</td><td><pre class="example">settb=1+0.001
18521 </pre></td></tr></table>
18522
18523 </li><li>
18524 Set the timebase to 2*intb:
18525 <table><tr><td>&nbsp;</td><td><pre class="example">settb=2*intb
18526 </pre></td></tr></table>
18527
18528 </li><li>
18529 Set the default timebase value:
18530 <table><tr><td>&nbsp;</td><td><pre class="example">settb=AVTB
18531 </pre></td></tr></table>
18532 </li></ul>
18533
18534 <a name="showspectrum"></a>
18535 <h2 class="section"><a href="ffplay-all.html#toc-showspectrum">31.10 showspectrum</a></h2>
18536
18537 <p>Convert input audio to a video output, representing the audio frequency
18538 spectrum.
18539 </p>
18540 <p>The filter accepts the following options:
18541 </p>
18542 <dl compact="compact">
18543 <dt> &lsquo;<samp>size, s</samp>&rsquo;</dt>
18544 <dd><p>Specify the video size for the output. For the syntax of this option, check
18545 the &quot;Video size&quot; section in the ffmpeg-utils manual. Default value is
18546 <code>640x512</code>.
18547 </p>
18548 </dd>
18549 <dt> &lsquo;<samp>slide</samp>&rsquo;</dt>
18550 <dd><p>Specify if the spectrum should slide along the window. Default value is
18551 <code>0</code>.
18552 </p>
18553 </dd>
18554 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
18555 <dd><p>Specify display mode.
18556 </p>
18557 <p>It accepts the following values:
18558 </p><dl compact="compact">
18559 <dt> &lsquo;<samp>combined</samp>&rsquo;</dt>
18560 <dd><p>all channels are displayed in the same row
18561 </p></dd>
18562 <dt> &lsquo;<samp>separate</samp>&rsquo;</dt>
18563 <dd><p>all channels are displayed in separate rows
18564 </p></dd>
18565 </dl>
18566
18567 <p>Default value is &lsquo;<samp>combined</samp>&rsquo;.
18568 </p>
18569 </dd>
18570 <dt> &lsquo;<samp>color</samp>&rsquo;</dt>
18571 <dd><p>Specify display color mode.
18572 </p>
18573 <p>It accepts the following values:
18574 </p><dl compact="compact">
18575 <dt> &lsquo;<samp>channel</samp>&rsquo;</dt>
18576 <dd><p>each channel is displayed in a separate color
18577 </p></dd>
18578 <dt> &lsquo;<samp>intensity</samp>&rsquo;</dt>
18579 <dd><p>each channel is is displayed using the same color scheme
18580 </p></dd>
18581 </dl>
18582
18583 <p>Default value is &lsquo;<samp>channel</samp>&rsquo;.
18584 </p>
18585 </dd>
18586 <dt> &lsquo;<samp>scale</samp>&rsquo;</dt>
18587 <dd><p>Specify scale used for calculating intensity color values.
18588 </p>
18589 <p>It accepts the following values:
18590 </p><dl compact="compact">
18591 <dt> &lsquo;<samp>lin</samp>&rsquo;</dt>
18592 <dd><p>linear
18593 </p></dd>
18594 <dt> &lsquo;<samp>sqrt</samp>&rsquo;</dt>
18595 <dd><p>square root, default
18596 </p></dd>
18597 <dt> &lsquo;<samp>cbrt</samp>&rsquo;</dt>
18598 <dd><p>cubic root
18599 </p></dd>
18600 <dt> &lsquo;<samp>log</samp>&rsquo;</dt>
18601 <dd><p>logarithmic
18602 </p></dd>
18603 </dl>
18604
18605 <p>Default value is &lsquo;<samp>sqrt</samp>&rsquo;.
18606 </p>
18607 </dd>
18608 <dt> &lsquo;<samp>saturation</samp>&rsquo;</dt>
18609 <dd><p>Set saturation modifier for displayed colors. Negative values provide
18610 alternative color scheme. <code>0</code> is no saturation at all.
18611 Saturation must be in [-10.0, 10.0] range.
18612 Default value is <code>1</code>.
18613 </p>
18614 </dd>
18615 <dt> &lsquo;<samp>win_func</samp>&rsquo;</dt>
18616 <dd><p>Set window function.
18617 </p>
18618 <p>It accepts the following values:
18619 </p><dl compact="compact">
18620 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
18621 <dd><p>No samples pre-processing (do not expect this to be faster)
18622 </p></dd>
18623 <dt> &lsquo;<samp>hann</samp>&rsquo;</dt>
18624 <dd><p>Hann window
18625 </p></dd>
18626 <dt> &lsquo;<samp>hamming</samp>&rsquo;</dt>
18627 <dd><p>Hamming window
18628 </p></dd>
18629 <dt> &lsquo;<samp>blackman</samp>&rsquo;</dt>
18630 <dd><p>Blackman window
18631 </p></dd>
18632 </dl>
18633
18634 <p>Default value is <code>hann</code>.
18635 </p></dd>
18636 </dl>
18637
18638 <p>The usage is very similar to the showwaves filter; see the examples in that
18639 section.
18640 </p>
18641 <a name="Examples-67"></a>
18642 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-67">31.10.1 Examples</a></h3>
18643
18644 <ul>
18645 <li>
18646 Large window with logarithmic color scaling:
18647 <table><tr><td>&nbsp;</td><td><pre class="example">showspectrum=s=1280x480:scale=log
18648 </pre></td></tr></table>
18649
18650 </li><li>
18651 Complete example for a colored and sliding spectrum per channel using <code>ffplay</code>:
18652 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
18653              [a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]'
18654 </pre></td></tr></table>
18655 </li></ul>
18656
18657 <a name="showwaves"></a>
18658 <h2 class="section"><a href="ffplay-all.html#toc-showwaves">31.11 showwaves</a></h2>
18659
18660 <p>Convert input audio to a video output, representing the samples waves.
18661 </p>
18662 <p>The filter accepts the following options:
18663 </p>
18664 <dl compact="compact">
18665 <dt> &lsquo;<samp>size, s</samp>&rsquo;</dt>
18666 <dd><p>Specify the video size for the output. For the syntax of this option, check
18667 the &quot;Video size&quot; section in the ffmpeg-utils manual. Default value
18668 is &quot;600x240&quot;.
18669 </p>
18670 </dd>
18671 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
18672 <dd><p>Set display mode.
18673 </p>
18674 <p>Available values are:
18675 </p><dl compact="compact">
18676 <dt> &lsquo;<samp>point</samp>&rsquo;</dt>
18677 <dd><p>Draw a point for each sample.
18678 </p>
18679 </dd>
18680 <dt> &lsquo;<samp>line</samp>&rsquo;</dt>
18681 <dd><p>Draw a vertical line for each sample.
18682 </p></dd>
18683 </dl>
18684
18685 <p>Default value is <code>point</code>.
18686 </p>
18687 </dd>
18688 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
18689 <dd><p>Set the number of samples which are printed on the same column. A
18690 larger value will decrease the frame rate. Must be a positive
18691 integer. This option can be set only if the value for <var>rate</var>
18692 is not explicitly specified.
18693 </p>
18694 </dd>
18695 <dt> &lsquo;<samp>rate, r</samp>&rsquo;</dt>
18696 <dd><p>Set the (approximate) output frame rate. This is done by setting the
18697 option <var>n</var>. Default value is &quot;25&quot;.
18698 </p>
18699 </dd>
18700 </dl>
18701
18702 <a name="Examples-83"></a>
18703 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-83">31.11.1 Examples</a></h3>
18704
18705 <ul>
18706 <li>
18707 Output the input file audio and the corresponding video representation
18708 at the same time:
18709 <table><tr><td>&nbsp;</td><td><pre class="example">amovie=a.mp3,asplit[out0],showwaves[out1]
18710 </pre></td></tr></table>
18711
18712 </li><li>
18713 Create a synthetic signal and show it with showwaves, forcing a
18714 frame rate of 30 frames per second:
18715 <table><tr><td>&nbsp;</td><td><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]
18716 </pre></td></tr></table>
18717 </li></ul>
18718
18719 <a name="split_002c-asplit"></a>
18720 <h2 class="section"><a href="ffplay-all.html#toc-split_002c-asplit">31.12 split, asplit</a></h2>
18721
18722 <p>Split input into several identical outputs.
18723 </p>
18724 <p><code>asplit</code> works with audio input, <code>split</code> with video.
18725 </p>
18726 <p>The filter accepts a single parameter which specifies the number of outputs. If
18727 unspecified, it defaults to 2.
18728 </p>
18729 <a name="Examples-46"></a>
18730 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-46">31.12.1 Examples</a></h3>
18731
18732 <ul>
18733 <li>
18734 Create two separate outputs from the same input:
18735 <table><tr><td>&nbsp;</td><td><pre class="example">[in] split [out0][out1]
18736 </pre></td></tr></table>
18737
18738 </li><li>
18739 To create 3 or more outputs, you need to specify the number of
18740 outputs, like in:
18741 <table><tr><td>&nbsp;</td><td><pre class="example">[in] asplit=3 [out0][out1][out2]
18742 </pre></td></tr></table>
18743
18744 </li><li>
18745 Create two separate outputs from the same input, one cropped and
18746 one padded:
18747 <table><tr><td>&nbsp;</td><td><pre class="example">[in] split [splitout1][splitout2];
18748 [splitout1] crop=100:100:0:0    [cropout];
18749 [splitout2] pad=200:200:100:100 [padout];
18750 </pre></td></tr></table>
18751
18752 </li><li>
18753 Create 5 copies of the input audio with <code>ffmpeg</code>:
18754 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT
18755 </pre></td></tr></table>
18756 </li></ul>
18757
18758 <a name="zmq_002c-azmq"></a>
18759 <h2 class="section"><a href="ffplay-all.html#toc-zmq_002c-azmq">31.13 zmq, azmq</a></h2>
18760
18761 <p>Receive commands sent through a libzmq client, and forward them to
18762 filters in the filtergraph.
18763 </p>
18764 <p><code>zmq</code> and <code>azmq</code> work as a pass-through filters. <code>zmq</code>
18765 must be inserted between two video filters, <code>azmq</code> between two
18766 audio filters.
18767 </p>
18768 <p>To enable these filters you need to install the libzmq library and
18769 headers and configure FFmpeg with <code>--enable-libzmq</code>.
18770 </p>
18771 <p>For more information about libzmq see:
18772 <a href="http://www.zeromq.org/">http://www.zeromq.org/</a>
18773 </p>
18774 <p>The <code>zmq</code> and <code>azmq</code> filters work as a libzmq server, which
18775 receives messages sent through a network interface defined by the
18776 &lsquo;<samp>bind_address</samp>&rsquo; option.
18777 </p>
18778 <p>The received message must be in the form:
18779 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>TARGET</var> <var>COMMAND</var> [<var>ARG</var>]
18780 </pre></td></tr></table>
18781
18782 <p><var>TARGET</var> specifies the target of the command, usually the name of
18783 the filter class or a specific filter instance name.
18784 </p>
18785 <p><var>COMMAND</var> specifies the name of the command for the target filter.
18786 </p>
18787 <p><var>ARG</var> is optional and specifies the optional argument list for the
18788 given <var>COMMAND</var>.
18789 </p>
18790 <p>Upon reception, the message is processed and the corresponding command
18791 is injected into the filtergraph. Depending on the result, the filter
18792 will send a reply to the client, adopting the format:
18793 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>ERROR_CODE</var> <var>ERROR_REASON</var>
18794 <var>MESSAGE</var>
18795 </pre></td></tr></table>
18796
18797 <p><var>MESSAGE</var> is optional.
18798 </p>
18799 <a name="Examples-31"></a>
18800 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-31">31.13.1 Examples</a></h3>
18801
18802 <p>Look at &lsquo;<tt>tools/zmqsend</tt>&rsquo; for an example of a zmq client which can
18803 be used to send commands processed by these filters.
18804 </p>
18805 <p>Consider the following filtergraph generated by <code>ffplay</code>
18806 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay -dumpgraph 1 -f lavfi &quot;
18807 color=s=100x100:c=red  [l];
18808 color=s=100x100:c=blue [r];
18809 nullsrc=s=200x100, zmq [bg];
18810 [bg][l]   overlay      [bg+l];
18811 [bg+l][r] overlay=x=100 &quot;
18812 </pre></td></tr></table>
18813
18814 <p>To change the color of the left side of the video, the following
18815 command can be used:
18816 </p><table><tr><td>&nbsp;</td><td><pre class="example">echo Parsed_color_0 c yellow | tools/zmqsend
18817 </pre></td></tr></table>
18818
18819 <p>To change the right side:
18820 </p><table><tr><td>&nbsp;</td><td><pre class="example">echo Parsed_color_1 c pink | tools/zmqsend
18821 </pre></td></tr></table>
18822
18823
18824 <a name="Multimedia-Sources"></a>
18825 <h1 class="chapter"><a href="ffplay-all.html#toc-Multimedia-Sources">32. Multimedia Sources</a></h1>
18826
18827 <p>Below is a description of the currently available multimedia sources.
18828 </p>
18829 <a name="amovie"></a>
18830 <h2 class="section"><a href="ffplay-all.html#toc-amovie">32.1 amovie</a></h2>
18831
18832 <p>This is the same as <a href="#movie">movie</a> source, except it selects an audio
18833 stream by default.
18834 </p>
18835 <p><a name="movie"></a>
18836 </p><a name="movie-1"></a>
18837 <h2 class="section"><a href="ffplay-all.html#toc-movie-1">32.2 movie</a></h2>
18838
18839 <p>Read audio and/or video stream(s) from a movie container.
18840 </p>
18841 <p>This filter accepts the following options:
18842 </p>
18843 <dl compact="compact">
18844 <dt> &lsquo;<samp>filename</samp>&rsquo;</dt>
18845 <dd><p>The name of the resource to read (not necessarily a file but also a device or a
18846 stream accessed through some protocol).
18847 </p>
18848 </dd>
18849 <dt> &lsquo;<samp>format_name, f</samp>&rsquo;</dt>
18850 <dd><p>Specifies the format assumed for the movie to read, and can be either
18851 the name of a container or an input device. If not specified the
18852 format is guessed from <var>movie_name</var> or by probing.
18853 </p>
18854 </dd>
18855 <dt> &lsquo;<samp>seek_point, sp</samp>&rsquo;</dt>
18856 <dd><p>Specifies the seek point in seconds, the frames will be output
18857 starting from this seek point, the parameter is evaluated with
18858 <code>av_strtod</code> so the numerical value may be suffixed by an IS
18859 postfix. Default value is &quot;0&quot;.
18860 </p>
18861 </dd>
18862 <dt> &lsquo;<samp>streams, s</samp>&rsquo;</dt>
18863 <dd><p>Specifies the streams to read. Several streams can be specified,
18864 separated by &quot;+&quot;. The source will then have as many outputs, in the
18865 same order. The syntax is explained in the &ldquo;Stream specifiers&rdquo;
18866 section in the ffmpeg manual. Two special names, &quot;dv&quot; and &quot;da&quot; specify
18867 respectively the default (best suited) video and audio stream. Default
18868 is &quot;dv&quot;, or &quot;da&quot; if the filter is called as &quot;amovie&quot;.
18869 </p>
18870 </dd>
18871 <dt> &lsquo;<samp>stream_index, si</samp>&rsquo;</dt>
18872 <dd><p>Specifies the index of the video stream to read. If the value is -1,
18873 the best suited video stream will be automatically selected. Default
18874 value is &quot;-1&quot;. Deprecated. If the filter is called &quot;amovie&quot;, it will select
18875 audio instead of video.
18876 </p>
18877 </dd>
18878 <dt> &lsquo;<samp>loop</samp>&rsquo;</dt>
18879 <dd><p>Specifies how many times to read the stream in sequence.
18880 If the value is less than 1, the stream will be read again and again.
18881 Default value is &quot;1&quot;.
18882 </p>
18883 <p>Note that when the movie is looped the source timestamps are not
18884 changed, so it will generate non monotonically increasing timestamps.
18885 </p></dd>
18886 </dl>
18887
18888 <p>This filter allows one to overlay a second video on top of main input of
18889 a filtergraph as shown in this graph:
18890 </p><table><tr><td>&nbsp;</td><td><pre class="example">input -----------&gt; deltapts0 --&gt; overlay --&gt; output
18891                                     ^
18892                                     |
18893 movie --&gt; scale--&gt; deltapts1 -------+
18894 </pre></td></tr></table>
18895
18896 <a name="Examples-61"></a>
18897 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-61">32.2.1 Examples</a></h3>
18898
18899 <ul>
18900 <li>
18901 Skip 3.2 seconds from the start of the avi file in.avi, and overlay it
18902 on top of the input labelled as &quot;in&quot;:
18903 <table><tr><td>&nbsp;</td><td><pre class="example">movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [over];
18904 [in] setpts=PTS-STARTPTS [main];
18905 [main][over] overlay=16:16 [out]
18906 </pre></td></tr></table>
18907
18908 </li><li>
18909 Read from a video4linux2 device, and overlay it on top of the input
18910 labelled as &quot;in&quot;:
18911 <table><tr><td>&nbsp;</td><td><pre class="example">movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [over];
18912 [in] setpts=PTS-STARTPTS [main];
18913 [main][over] overlay=16:16 [out]
18914 </pre></td></tr></table>
18915
18916 </li><li>
18917 Read the first video stream and the audio stream with id 0x81 from
18918 dvd.vob; the video is connected to the pad named &quot;video&quot; and the audio is
18919 connected to the pad named &quot;audio&quot;:
18920 <table><tr><td>&nbsp;</td><td><pre class="example">movie=dvd.vob:s=v:0+#0x81 [video] [audio]
18921 </pre></td></tr></table>
18922 </li></ul>
18923
18924
18925 <a name="See-Also"></a>
18926 <h1 class="chapter"><a href="ffplay-all.html#toc-See-Also">33. See Also</a></h1>
18927
18928 <p><a href="ffplay.html">ffplay</a>,
18929 <a href="ffmpeg.html">ffmpeg</a>, <a href="ffprobe.html">ffprobe</a>, <a href="ffserver.html">ffserver</a>,
18930 <a href="ffmpeg-utils.html">ffmpeg-utils</a>,
18931 <a href="ffmpeg-scaler.html">ffmpeg-scaler</a>,
18932 <a href="ffmpeg-resampler.html">ffmpeg-resampler</a>,
18933 <a href="ffmpeg-codecs.html">ffmpeg-codecs</a>,
18934 <a href="ffmpeg-bitstream-filters.html">ffmpeg-bitstream-filters</a>,
18935 <a href="ffmpeg-formats.html">ffmpeg-formats</a>,
18936 <a href="ffmpeg-devices.html">ffmpeg-devices</a>,
18937 <a href="ffmpeg-protocols.html">ffmpeg-protocols</a>,
18938 <a href="ffmpeg-filters.html">ffmpeg-filters</a>
18939 </p>
18940
18941 <a name="Authors"></a>
18942 <h1 class="chapter"><a href="ffplay-all.html#toc-Authors">34. Authors</a></h1>
18943
18944 <p>The FFmpeg developers.
18945 </p>
18946 <p>For details about the authorship, see the Git history of the project
18947 (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
18948 <code>git log</code> in the FFmpeg source directory, or browsing the
18949 online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
18950 </p>
18951 <p>Maintainers for the specific components are listed in the file
18952 &lsquo;<tt>MAINTAINERS</tt>&rsquo; in the source code tree.
18953 </p>
18954
18955 <footer class="footer pagination-right">
18956 <span class="label label-info">This document was generated by <em>Kyle Schwarz</em> on <em>June 19, 2014</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.</span></footer></div></div></body>