3 <!-- Created on June 19, 2014 by texi2html 1.82 -->
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>
10 Maintained by: Many creative people.
11 Send bugs and suggestions to <texi2html-bug@nongnu.org>
15 <title>FFmpeg documentation : ffplay </title>
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" />
23 <link rel="icon" href="favicon.png" type="image/png" />
29 <a name="SEC_Top"></a>
30 <h1 class="settitle">ffplay Documentation</h1>
32 <a name="SEC_Contents"></a>
33 <h1>Table of Contents</h1>
34 <div class="contents">
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>
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>
48 <li><a name="toc-Syntax" href="#Syntax">4. Syntax</a>
50 <li><a name="toc-Quoting-and-escaping" href="#Quoting-and-escaping">4.1 Quoting and escaping</a>
52 <li><a name="toc-Examples-4" href="#Examples-4">4.1.1 Examples</a></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>
57 <li><a name="toc-Examples-66" href="#Examples-66">4.3.1 Examples</a></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>
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>
71 <li><a name="toc-rawvideo-1" href="#rawvideo-1">9.1 rawvideo</a>
73 <li><a name="toc-Options-7" href="#Options-7">9.1.1 Options</a></li>
77 <li><a name="toc-Audio-Decoders" href="#Audio-Decoders">10. Audio Decoders</a>
79 <li><a name="toc-ac3" href="#ac3">10.1 ac3</a>
81 <li><a name="toc-AC_002d3-Decoder-Options" href="#AC_002d3-Decoder-Options">10.1.1 AC-3 Decoder Options</a></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>
88 <li><a name="toc-Options-11" href="#Options-11">10.5.1 Options</a></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>
94 <li><a name="toc-Subtitles-Decoders" href="#Subtitles-Decoders">11. Subtitles Decoders</a>
96 <li><a name="toc-dvdsub" href="#dvdsub">11.1 dvdsub</a>
98 <li><a name="toc-Options-10" href="#Options-10">11.1.1 Options</a></li>
100 <li><a name="toc-libzvbi_002dteletext" href="#libzvbi_002dteletext">11.2 libzvbi-teletext</a>
102 <li><a name="toc-Options-3" href="#Options-3">11.2.1 Options</a></li>
106 <li><a name="toc-Bitstream-Filters" href="#Bitstream-Filters">12. Bitstream Filters</a>
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>
120 <li><a name="toc-Format-Options" href="#Format-Options">13. Format Options</a>
122 <li><a name="toc-Format-stream-specifiers-1" href="#Format-stream-specifiers-1">13.1 Format stream specifiers</a></li>
124 <li><a name="toc-Demuxers" href="#Demuxers">14. Demuxers</a>
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>
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>
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>
138 <li><a name="toc-Examples-75" href="#Examples-75">14.7.1 Examples</a></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>
145 <li><a name="toc-Metadata" href="#Metadata">15. Metadata</a></li>
146 <li><a name="toc-Protocols" href="#Protocols">16. Protocols</a>
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>
159 <li><a name="toc-HTTP-Cookies" href="#HTTP-Cookies">16.10.1 HTTP Cookies</a></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>
176 <li><a name="toc-Examples-78" href="#Examples-78">16.24.1 Examples</a></li>
178 <li><a name="toc-sap" href="#sap">16.25 sap</a>
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>
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>
189 <li><a name="toc-Examples-53" href="#Examples-53">16.30.1 Examples</a></li>
191 <li><a name="toc-unix" href="#unix">16.31 unix</a></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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
231 <li><a name="toc-Options-9" href="#Options-9">18.14.1 Options</a></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>
236 <li><a name="toc-Options-8" href="#Options-8">18.16.1 Options</a></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>
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>
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>
252 <li><a name="toc-aconvert" href="#aconvert">25.1 aconvert</a>
254 <li><a name="toc-Examples-18" href="#Examples-18">25.1.1 Examples</a></li>
256 <li><a name="toc-adelay" href="#adelay">25.2 adelay</a>
258 <li><a name="toc-Examples-30" href="#Examples-30">25.2.1 Examples</a></li>
260 <li><a name="toc-aecho" href="#aecho">25.3 aecho</a>
262 <li><a name="toc-Examples-41" href="#Examples-41">25.3.1 Examples</a></li>
264 <li><a name="toc-aeval" href="#aeval">25.4 aeval</a>
266 <li><a name="toc-Examples-21" href="#Examples-21">25.4.1 Examples</a></li>
268 <li><a name="toc-afade" href="#afade">25.5 afade</a>
270 <li><a name="toc-Examples-72" href="#Examples-72">25.5.1 Examples</a></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>
276 <li><a name="toc-Examples-28" href="#Examples-28">25.8.1 Examples</a></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>
284 <li><a name="toc-Examples-84" href="#Examples-84">25.13.1 Examples</a></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>
292 <li><a name="toc-Examples-35" href="#Examples-35">25.18.1 Examples</a></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>
297 <li><a name="toc-Examples-57" href="#Examples-57">25.20.1 Examples</a></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>
308 <li><a name="toc-Examples-37" href="#Examples-37">25.28.1 Examples</a></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>
313 <li><a name="toc-Examples-69" href="#Examples-69">25.30.1 Examples</a></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>
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>
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>
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>
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>
332 <li><a name="toc-Examples-14" href="#Examples-14">25.38.1 Examples</a></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>
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>
340 <li><a name="toc-volumedetect" href="#volumedetect">25.41 volumedetect</a>
342 <li><a name="toc-Examples-63" href="#Examples-63">25.41.1 Examples</a></li>
346 <li><a name="toc-Audio-Sources" href="#Audio-Sources">26. Audio Sources</a>
348 <li><a name="toc-abuffer" href="#abuffer">26.1 abuffer</a>
350 <li><a name="toc-Examples-6" href="#Examples-6">26.1.1 Examples</a></li>
352 <li><a name="toc-aevalsrc" href="#aevalsrc">26.2 aevalsrc</a>
354 <li><a name="toc-Examples-56" href="#Examples-56">26.2.1 Examples</a></li>
356 <li><a name="toc-anullsrc" href="#anullsrc">26.3 anullsrc</a>
358 <li><a name="toc-Examples-38" href="#Examples-38">26.3.1 Examples</a></li>
360 <li><a name="toc-flite" href="#flite">26.4 flite</a>
362 <li><a name="toc-Examples-80" href="#Examples-80">26.4.1 Examples</a></li>
364 <li><a name="toc-sine" href="#sine">26.5 sine</a>
366 <li><a name="toc-Examples-50" href="#Examples-50">26.5.1 Examples</a></li>
370 <li><a name="toc-Audio-Sinks" href="#Audio-Sinks">27. Audio Sinks</a>
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>
375 <li><a name="toc-Video-Filters" href="#Video-Filters">28. Video Filters</a>
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>
385 <li><a name="toc-Examples-62" href="#Examples-62">28.7.1 Examples</a></li>
387 <li><a name="toc-boxblur" href="#boxblur">28.8 boxblur</a>
389 <li><a name="toc-Examples-12" href="#Examples-12">28.8.1 Examples</a></li>
391 <li><a name="toc-colorbalance" href="#colorbalance">28.9 colorbalance</a>
393 <li><a name="toc-Examples-68" href="#Examples-68">28.9.1 Examples</a></li>
395 <li><a name="toc-colorchannelmixer" href="#colorchannelmixer">28.10 colorchannelmixer</a>
397 <li><a name="toc-Examples-33" href="#Examples-33">28.10.1 Examples</a></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>
403 <li><a name="toc-Examples-64" href="#Examples-64">28.13.1 Examples</a></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>
408 <li><a name="toc-Examples-77" href="#Examples-77">28.15.1 Examples</a></li>
410 <li><a name="toc-dctdnoiz" href="#dctdnoiz">28.16 dctdnoiz</a>
412 <li><a name="toc-Examples-22" href="#Examples-22">28.16.1 Examples</a></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>
418 <li><a name="toc-Examples-32" href="#Examples-32">28.19.1 Examples</a></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>
423 <li><a name="toc-Examples-19" href="#Examples-19">28.21.1 Examples</a></li>
425 <li><a name="toc-drawgrid" href="#drawgrid">28.22 drawgrid</a>
427 <li><a name="toc-Examples-40" href="#Examples-40">28.22.1 Examples</a></li>
429 <li><a name="toc-drawtext-1" href="#drawtext-1">28.23 drawtext</a>
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>
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>
438 <li><a name="toc-Examples-43" href="#Examples-43">28.25.1 Examples</a></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>
443 <li><a name="toc-Examples-34" href="#Examples-34">28.27.1 Examples</a></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>
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>
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>
453 <li><a name="toc-Examples-55" href="#Examples-55">28.29.2 Examples</a></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>
459 <li><a name="toc-Examples-17" href="#Examples-17">28.32.1 Examples</a></li>
461 <li><a name="toc-fps-1" href="#fps-1">28.33 fps</a>
463 <li><a name="toc-Examples-60" href="#Examples-60">28.33.1 Examples</a></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>
469 <li><a name="toc-Examples-1" href="#Examples-1">28.36.1 Examples</a></li>
471 <li><a name="toc-geq" href="#geq">28.37 geq</a>
473 <li><a name="toc-Examples-82" href="#Examples-82">28.37.1 Examples</a></li>
475 <li><a name="toc-gradfun" href="#gradfun">28.38 gradfun</a>
477 <li><a name="toc-Examples" href="#Examples">28.38.1 Examples</a></li>
479 <li><a name="toc-haldclut-1" href="#haldclut-1">28.39 haldclut</a>
481 <li><a name="toc-Workflow-examples" href="#Workflow-examples">28.39.1 Workflow examples</a>
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>
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>
492 <li><a name="toc-Examples-74" href="#Examples-74">28.42.1 Examples</a></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>
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>
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>
505 <li><a name="toc-Examples-45" href="#Examples-45">28.48.1 Examples</a></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>
510 <li><a name="toc-Examples-5" href="#Examples-5">28.50.1 Examples</a></li>
512 <li><a name="toc-mergeplanes" href="#mergeplanes">28.51 mergeplanes</a>
514 <li><a name="toc-Examples-3" href="#Examples-3">28.51.1 Examples</a></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>
519 <li><a name="toc-Examples-10" href="#Examples-10">28.53.1 Examples</a></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>
525 <li><a name="toc-Examples-65" href="#Examples-65">28.56.1 Examples</a></li>
527 <li><a name="toc-noise-1" href="#noise-1">28.57 noise</a>
529 <li><a name="toc-Examples-58" href="#Examples-58">28.57.1 Examples</a></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>
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>
538 <li><a name="toc-overlay-1" href="#overlay-1">28.60 overlay</a>
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>
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>
546 <li><a name="toc-Examples-52" href="#Examples-52">28.62.1 Examples</a></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>
553 <li><a name="toc-Examples-11" href="#Examples-11">28.66.1 Examples</a></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>
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>
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>
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>
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>
572 <li><a name="toc-Examples-76" href="#Examples-76">28.74.1 Examples</a></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>
579 <li><a name="toc-Examples-2" href="#Examples-2">28.78.1 Examples</a></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>
588 <li><a name="toc-Examples-9" href="#Examples-9">28.84.1 Examples</a></li>
590 <li><a name="toc-tile" href="#tile">28.85 tile</a>
592 <li><a name="toc-Examples-70" href="#Examples-70">28.85.1 Examples</a></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>
599 <li><a name="toc-Examples-81" href="#Examples-81">28.89.1 Examples</a></li>
601 <li><a name="toc-vidstabdetect-1" href="#vidstabdetect-1">28.90 vidstabdetect</a>
603 <li><a name="toc-Examples-29" href="#Examples-29">28.90.1 Examples</a></li>
605 <li><a name="toc-vidstabtransform-1" href="#vidstabtransform-1">28.91 vidstabtransform</a>
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>
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>
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>
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>
619 <li><a name="toc-Video-Sources" href="#Video-Sources">29. Video Sources</a>
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>
624 <li><a name="toc-Examples-16" href="#Examples-16">29.2.1 Examples</a></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>
631 <li><a name="toc-Examples-73" href="#Examples-73">29.6.1 Examples</a></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>
635 <li><a name="toc-Commands-2" href="#Commands-2">29.7.1 Commands</a></li>
639 <li><a name="toc-Video-Sinks" href="#Video-Sinks">30. Video Sinks</a>
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>
644 <li><a name="toc-Multimedia-Filters" href="#Multimedia-Filters">31. Multimedia Filters</a>
646 <li><a name="toc-avectorscope" href="#avectorscope">31.1 avectorscope</a>
648 <li><a name="toc-Examples-48" href="#Examples-48">31.1.1 Examples</a></li>
650 <li><a name="toc-concat-2" href="#concat-2">31.2 concat</a>
652 <li><a name="toc-Examples-24" href="#Examples-24">31.2.1 Examples</a></li>
654 <li><a name="toc-ebur128" href="#ebur128">31.3 ebur128</a>
656 <li><a name="toc-Examples-13" href="#Examples-13">31.3.1 Examples</a></li>
658 <li><a name="toc-interleave_002c-ainterleave" href="#interleave_002c-ainterleave">31.4 interleave, ainterleave</a>
660 <li><a name="toc-Examples-7" href="#Examples-7">31.4.1 Examples</a></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>
665 <li><a name="toc-Examples-20" href="#Examples-20">31.6.1 Examples</a></li>
667 <li><a name="toc-sendcmd_002c-asendcmd" href="#sendcmd_002c-asendcmd">31.7 sendcmd, asendcmd</a>
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>
672 <li><a name="toc-setpts_002c-asetpts" href="#setpts_002c-asetpts">31.8 setpts, asetpts</a>
674 <li><a name="toc-Examples-59" href="#Examples-59">31.8.1 Examples</a></li>
676 <li><a name="toc-settb_002c-asettb" href="#settb_002c-asettb">31.9 settb, asettb</a>
678 <li><a name="toc-Examples-8" href="#Examples-8">31.9.1 Examples</a></li>
680 <li><a name="toc-showspectrum" href="#showspectrum">31.10 showspectrum</a>
682 <li><a name="toc-Examples-67" href="#Examples-67">31.10.1 Examples</a></li>
684 <li><a name="toc-showwaves" href="#showwaves">31.11 showwaves</a>
686 <li><a name="toc-Examples-83" href="#Examples-83">31.11.1 Examples</a></li>
688 <li><a name="toc-split_002c-asplit" href="#split_002c-asplit">31.12 split, asplit</a>
690 <li><a name="toc-Examples-46" href="#Examples-46">31.12.1 Examples</a></li>
692 <li><a name="toc-zmq_002c-azmq" href="#zmq_002c-azmq">31.13 zmq, azmq</a>
694 <li><a name="toc-Examples-31" href="#Examples-31">31.13.1 Examples</a></li>
698 <li><a name="toc-Multimedia-Sources" href="#Multimedia-Sources">32. Multimedia Sources</a>
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>
703 <li><a name="toc-Examples-61" href="#Examples-61">32.2.1 Examples</a></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>
712 <a name="Synopsis"></a>
713 <h1 class="chapter"><a href="ffplay-all.html#toc-Synopsis">1. Synopsis</a></h1>
715 <p>ffplay [<var>options</var>] [‘<tt>input_file</tt>’]
717 <a name="Description"></a>
718 <h1 class="chapter"><a href="ffplay-all.html#toc-Description">2. Description</a></h1>
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
724 <a name="Options-4"></a>
725 <h1 class="chapter"><a href="ffplay-all.html#toc-Options-4">3. Options</a></h1>
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: ’K’, ’M’, or ’G’.
731 <p>If ’i’ 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 ’B’ to the SI unit
734 prefix multiplies the value by 8. This allows using, for example:
735 ’KB’, ’MiB’, ’G’ and ’B’ as number suffixes.
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 "no". For example using "-nofoo"
740 will set the boolean option with name "foo" to false.
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.
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.
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
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.
760 <p>Possible forms of stream specifiers are:
761 </p><dl compact="compact">
762 <dt> ‘<samp><var>stream_index</var></samp>’</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.
766 <dt> ‘<samp><var>stream_type</var>[:<var>stream_index</var>]</samp>’</dt>
767 <dd><p><var>stream_type</var> is one of following: ’v’ for video, ’a’ for audio, ’s’ for subtitle,
768 ’d’ for data, and ’t’ 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.
772 <dt> ‘<samp>p:<var>program_id</var>[:<var>stream_index</var>]</samp>’</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
777 <dt> ‘<samp>#<var>stream_id</var></samp>’</dt>
778 <dd><p>Matches the stream by a format-specific ID.
782 <a name="Generic-options"></a>
783 <h2 class="section"><a href="ffplay-all.html#toc-Generic-options">3.2 Generic options</a></h2>
785 <p>These options are shared amongst the ff* tools.
787 <dl compact="compact">
788 <dt> ‘<samp>-L</samp>’</dt>
792 <dt> ‘<samp>-h, -?, -help, --help [<var>arg</var>]</samp>’</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
797 <p>Possible values of <var>arg</var> are:
798 </p><dl compact="compact">
799 <dt> ‘<samp>long</samp>’</dt>
800 <dd><p>Print advanced tool options in addition to the basic tool options.
803 <dt> ‘<samp>full</samp>’</dt>
804 <dd><p>Print complete list of options, including shared and private options
805 for encoders, decoders, demuxers, muxers, filters, etc.
808 <dt> ‘<samp>decoder=<var>decoder_name</var></samp>’</dt>
809 <dd><p>Print detailed information about the decoder named <var>decoder_name</var>. Use the
810 ‘<samp>-decoders</samp>’ option to get a list of all decoders.
813 <dt> ‘<samp>encoder=<var>encoder_name</var></samp>’</dt>
814 <dd><p>Print detailed information about the encoder named <var>encoder_name</var>. Use the
815 ‘<samp>-encoders</samp>’ option to get a list of all encoders.
818 <dt> ‘<samp>demuxer=<var>demuxer_name</var></samp>’</dt>
819 <dd><p>Print detailed information about the demuxer named <var>demuxer_name</var>. Use the
820 ‘<samp>-formats</samp>’ option to get a list of all demuxers and muxers.
823 <dt> ‘<samp>muxer=<var>muxer_name</var></samp>’</dt>
824 <dd><p>Print detailed information about the muxer named <var>muxer_name</var>. Use the
825 ‘<samp>-formats</samp>’ option to get a list of all muxers and demuxers.
828 <dt> ‘<samp>filter=<var>filter_name</var></samp>’</dt>
829 <dd><p>Print detailed information about the filter name <var>filter_name</var>. Use the
830 ‘<samp>-filters</samp>’ option to get a list of all filters.
835 <dt> ‘<samp>-version</samp>’</dt>
839 <dt> ‘<samp>-formats</samp>’</dt>
840 <dd><p>Show available formats.
843 <dt> ‘<samp>-codecs</samp>’</dt>
844 <dd><p>Show all codecs known to libavcodec.
846 <p>Note that the term ’codec’ is used throughout this documentation as a shortcut
847 for what is more correctly called a media bitstream format.
850 <dt> ‘<samp>-decoders</samp>’</dt>
851 <dd><p>Show available decoders.
854 <dt> ‘<samp>-encoders</samp>’</dt>
855 <dd><p>Show all available encoders.
858 <dt> ‘<samp>-bsfs</samp>’</dt>
859 <dd><p>Show available bitstream filters.
862 <dt> ‘<samp>-protocols</samp>’</dt>
863 <dd><p>Show available protocols.
866 <dt> ‘<samp>-filters</samp>’</dt>
867 <dd><p>Show available libavfilter filters.
870 <dt> ‘<samp>-pix_fmts</samp>’</dt>
871 <dd><p>Show available pixel formats.
874 <dt> ‘<samp>-sample_fmts</samp>’</dt>
875 <dd><p>Show available sample formats.
878 <dt> ‘<samp>-layouts</samp>’</dt>
879 <dd><p>Show channel names and standard channel layouts.
882 <dt> ‘<samp>-colors</samp>’</dt>
883 <dd><p>Show recognized color names.
886 <dt> ‘<samp>-loglevel [repeat+]<var>loglevel</var> | -v [repeat+]<var>loglevel</var></samp>’</dt>
887 <dd><p>Set the logging level used by the library.
888 Adding "repeat+" indicates that repeated log output should not be compressed
889 to the first line and the "Last message repeated n times" line will be
890 omitted. "repeat" can also be used alone.
891 If "repeat" is used alone, and with no prior loglevel set, the default
892 loglevel will be used. If multiple loglevel parameters are given, using
893 ’repeat’ 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> ‘<samp>quiet</samp>’</dt>
897 <dd><p>Show nothing at all; be silent.
899 <dt> ‘<samp>panic</samp>’</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.
903 <dt> ‘<samp>fatal</samp>’</dt>
904 <dd><p>Only show fatal errors. These are errors after which the process absolutely
905 cannot continue after.
907 <dt> ‘<samp>error</samp>’</dt>
908 <dd><p>Show all errors, including ones which can be recovered from.
910 <dt> ‘<samp>warning</samp>’</dt>
911 <dd><p>Show all warnings and errors. Any message related to possibly
912 incorrect or unexpected events will be shown.
914 <dt> ‘<samp>info</samp>’</dt>
915 <dd><p>Show informative messages during processing. This is in addition to
916 warnings and errors. This is the default value.
918 <dt> ‘<samp>verbose</samp>’</dt>
919 <dd><p>Same as <code>info</code>, except more verbose.
921 <dt> ‘<samp>debug</samp>’</dt>
922 <dd><p>Show everything, including debugging information.
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.
935 <dt> ‘<samp>-report</samp>’</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
939 This file can be useful for bug reports.
940 It also implies <code>-loglevel verbose</code>.
942 <p>Setting the environment variable <code>FFREPORT</code> to any value has the
943 same effect. If the value is a ’:’-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 ’:’ (see the
946 “Quoting and escaping” section in the ffmpeg-utils manual). The
947 following option is recognized:
948 </p><dl compact="compact">
949 <dt> ‘<samp>file</samp>’</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>
956 <p>Errors in parsing the environment variable are not fatal, and will not
957 appear in the report.
960 <dt> ‘<samp>-hide_banner</samp>’</dt>
961 <dd><p>Suppress printing banner.
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
968 <dt> ‘<samp>-cpuflags flags (<em>global</em>)</samp>’</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’re doing.
971 </p><table><tr><td> </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> ‘<samp>x86</samp>’</dt>
978 <dd><dl compact="compact">
979 <dt> ‘<samp>mmx</samp>’</dt>
980 <dt> ‘<samp>mmxext</samp>’</dt>
981 <dt> ‘<samp>sse</samp>’</dt>
982 <dt> ‘<samp>sse2</samp>’</dt>
983 <dt> ‘<samp>sse2slow</samp>’</dt>
984 <dt> ‘<samp>sse3</samp>’</dt>
985 <dt> ‘<samp>sse3slow</samp>’</dt>
986 <dt> ‘<samp>ssse3</samp>’</dt>
987 <dt> ‘<samp>atom</samp>’</dt>
988 <dt> ‘<samp>sse4.1</samp>’</dt>
989 <dt> ‘<samp>sse4.2</samp>’</dt>
990 <dt> ‘<samp>avx</samp>’</dt>
991 <dt> ‘<samp>xop</samp>’</dt>
992 <dt> ‘<samp>fma4</samp>’</dt>
993 <dt> ‘<samp>3dnow</samp>’</dt>
994 <dt> ‘<samp>3dnowext</samp>’</dt>
995 <dt> ‘<samp>cmov</samp>’</dt>
998 <dt> ‘<samp>ARM</samp>’</dt>
999 <dd><dl compact="compact">
1000 <dt> ‘<samp>armv5te</samp>’</dt>
1001 <dt> ‘<samp>armv6</samp>’</dt>
1002 <dt> ‘<samp>armv6t2</samp>’</dt>
1003 <dt> ‘<samp>vfp</samp>’</dt>
1004 <dt> ‘<samp>vfpv3</samp>’</dt>
1005 <dt> ‘<samp>neon</samp>’</dt>
1008 <dt> ‘<samp>PowerPC</samp>’</dt>
1009 <dd><dl compact="compact">
1010 <dt> ‘<samp>altivec</samp>’</dt>
1013 <dt> ‘<samp>Specific Processors</samp>’</dt>
1014 <dd><dl compact="compact">
1015 <dt> ‘<samp>pentium2</samp>’</dt>
1016 <dt> ‘<samp>pentium3</samp>’</dt>
1017 <dt> ‘<samp>pentium4</samp>’</dt>
1018 <dt> ‘<samp>k6</samp>’</dt>
1019 <dt> ‘<samp>k62</samp>’</dt>
1020 <dt> ‘<samp>athlon</samp>’</dt>
1021 <dt> ‘<samp>athlonxp</samp>’</dt>
1022 <dt> ‘<samp>k8</samp>’</dt>
1028 <dt> ‘<samp>-opencl_bench</samp>’</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>.
1033 <dt> ‘<samp>-opencl_options options (<em>global</em>)</samp>’</dt>
1034 <dd><p>Set OpenCL environment options. This option is only available when
1035 FFmpeg has been compiled with <code>--enable-opencl</code>.
1037 <p><var>options</var> must be a list of <var>key</var>=<var>value</var> option pairs
1038 separated by ’:’. See the “OpenCL Options” section in the
1039 ffmpeg-utils manual for the list of supported options.
1043 <a name="AVOptions"></a>
1044 <h2 class="section"><a href="ffplay-all.html#toc-AVOptions">3.3 AVOptions</a></h2>
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 ‘<samp>-help</samp>’ option. They are separated into two categories:
1049 </p><dl compact="compact">
1050 <dt> ‘<samp>generic</samp>’</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.
1055 <dt> ‘<samp>private</samp>’</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.
1061 <p>For example to write an ID3v2.3 header instead of a default ID3v2.4 to
1062 an MP3 file, use the ‘<samp>id3v2_version</samp>’ private option of the MP3
1064 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i input.flac -id3v2_version 3 out.mp3
1065 </pre></td></tr></table>
1067 <p>All codec AVOptions are per-stream, and thus a stream specifier
1068 should be attached to them.
1070 <p>Note: the ‘<samp>-nooption</samp>’ syntax cannot be used for boolean
1071 AVOptions, use ‘<samp>-option 0</samp>’/‘<samp>-option 1</samp>’.
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
1077 <a name="Main-options"></a>
1078 <h2 class="section"><a href="ffplay-all.html#toc-Main-options">3.4 Main options</a></h2>
1080 <dl compact="compact">
1081 <dt> ‘<samp>-x <var>width</var></samp>’</dt>
1082 <dd><p>Force displayed width.
1084 <dt> ‘<samp>-y <var>height</var></samp>’</dt>
1085 <dd><p>Force displayed height.
1087 <dt> ‘<samp>-s <var>size</var></samp>’</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.
1092 <dt> ‘<samp>-an</samp>’</dt>
1093 <dd><p>Disable audio.
1095 <dt> ‘<samp>-vn</samp>’</dt>
1096 <dd><p>Disable video.
1098 <dt> ‘<samp>-ss <var>pos</var></samp>’</dt>
1099 <dd><p>Seek to a given position in seconds.
1101 <dt> ‘<samp>-t <var>duration</var></samp>’</dt>
1102 <dd><p>play <duration> seconds of audio/video
1104 <dt> ‘<samp>-bytes</samp>’</dt>
1105 <dd><p>Seek by bytes.
1107 <dt> ‘<samp>-nodisp</samp>’</dt>
1108 <dd><p>Disable graphical display.
1110 <dt> ‘<samp>-f <var>fmt</var></samp>’</dt>
1111 <dd><p>Force format.
1113 <dt> ‘<samp>-window_title <var>title</var></samp>’</dt>
1114 <dd><p>Set window title (default is the input filename).
1116 <dt> ‘<samp>-loop <var>number</var></samp>’</dt>
1117 <dd><p>Loops movie playback <number> times. 0 means forever.
1119 <dt> ‘<samp>-showmode <var>mode</var></samp>’</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> ‘<samp>0, video</samp>’</dt>
1126 <dt> ‘<samp>1, waves</samp>’</dt>
1127 <dd><p>show audio waves
1129 <dt> ‘<samp>2, rdft</samp>’</dt>
1130 <dd><p>show audio frequency band using RDFT ((Inverse) Real Discrete Fourier Transform)
1134 <p>Default value is "video", if video is not present or cannot be played
1135 "rdft" is automatically selected.
1137 <p>You can interactively cycle through the available show modes by
1138 pressing the key <w>.
1141 <dt> ‘<samp>-vf <var>filtergraph</var></samp>’</dt>
1142 <dd><p>Create the filtergraph specified by <var>filtergraph</var> and use it to
1143 filter the video stream.
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
1153 <dt> ‘<samp>-af <var>filtergraph</var></samp>’</dt>
1154 <dd><p><var>filtergraph</var> is a description of the filtergraph to apply to
1156 Use the option "-filters" to show all the available filters (including
1160 <dt> ‘<samp>-i <var>input_file</var></samp>’</dt>
1161 <dd><p>Read <var>input_file</var>.
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> ‘<samp>-pix_fmt <var>format</var></samp>’</dt>
1169 <dd><p>Set pixel format.
1170 This option has been deprecated in favor of private options, try -pixel_format.
1173 <dt> ‘<samp>-stats</samp>’</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>.
1180 <dt> ‘<samp>-bug</samp>’</dt>
1181 <dd><p>Work around bugs.
1183 <dt> ‘<samp>-fast</samp>’</dt>
1184 <dd><p>Non-spec-compliant optimizations.
1186 <dt> ‘<samp>-genpts</samp>’</dt>
1187 <dd><p>Generate pts.
1189 <dt> ‘<samp>-rtp_tcp</samp>’</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.
1193 <dt> ‘<samp>-sync <var>type</var></samp>’</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.
1201 <dt> ‘<samp>-threads <var>count</var></samp>’</dt>
1202 <dd><p>Set the thread count.
1204 <dt> ‘<samp>-ast <var>audio_stream_number</var></samp>’</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.
1210 <dt> ‘<samp>-vst <var>video_stream_number</var></samp>’</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.
1216 <dt> ‘<samp>-sst <var>subtitle_stream_number</var></samp>’</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.
1222 <dt> ‘<samp>-autoexit</samp>’</dt>
1223 <dd><p>Exit when video is done playing.
1225 <dt> ‘<samp>-exitonkeydown</samp>’</dt>
1226 <dd><p>Exit if any key is pressed.
1228 <dt> ‘<samp>-exitonmousedown</samp>’</dt>
1229 <dd><p>Exit if any mouse button is pressed.
1232 <dt> ‘<samp>-codec:<var>media_specifier</var> <var>codec_name</var></samp>’</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.
1238 <dt> ‘<samp>-acodec <var>codec_name</var></samp>’</dt>
1239 <dd><p>Force a specific audio decoder.
1242 <dt> ‘<samp>-vcodec <var>codec_name</var></samp>’</dt>
1243 <dd><p>Force a specific video decoder.
1246 <dt> ‘<samp>-scodec <var>codec_name</var></samp>’</dt>
1247 <dd><p>Force a specific subtitle decoder.
1251 <a name="While-playing"></a>
1252 <h2 class="section"><a href="ffplay-all.html#toc-While-playing">3.6 While playing</a></h2>
1254 <dl compact="compact">
1255 <dt> <q, ESC></dt>
1260 <dd><p>Toggle full screen.
1263 <dt> <p, SPC></dt>
1268 <dd><p>Cycle audio channel in the curret program.
1272 <dd><p>Cycle video channel.
1276 <dd><p>Cycle subtitle channel in the current program.
1280 <dd><p>Cycle program.
1284 <dd><p>Show audio waves.
1288 <dd><p>Step to the next frame.
1290 <p>Pause if the stream is not already paused, step to the next video
1294 <dt> <left/right></dt>
1295 <dd><p>Seek backward/forward 10 seconds.
1298 <dt> <down/up></dt>
1299 <dd><p>Seek backward/forward 1 minute.
1302 <dt> <page down/page up></dt>
1303 <dd><p>Seek to the previous/next chapter.
1304 or if there are no chapters
1305 Seek backward/forward 10 minutes.
1308 <dt> <mouse click></dt>
1309 <dd><p>Seek to percentage in file corresponding to fraction of width.
1315 <a name="Syntax"></a>
1316 <h1 class="chapter"><a href="ffplay-all.html#toc-Syntax">4. Syntax</a></h1>
1318 <p>This section documents the syntax and formats employed by the FFmpeg
1319 libraries and tools.
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>
1325 <p>FFmpeg adopts the following quoting and escaping mechanism, unless
1326 explicitly specified. The following rules are applied:
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.
1336 A special character is escaped by prefixing it with a ’\’.
1339 All characters enclosed between ” 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.
1344 Leading and trailing whitespaces, unless escaped or quoted, are
1345 removed from the parsed string.
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.
1352 <p>The function <code>av_get_token</code> defined in
1353 ‘<tt>libavutil/avstring.h</tt>’ can be used to parse a token quoted or
1354 escaped according to the rules defined above.
1356 <p>The tool ‘<tt>tools/ffescape</tt>’ in the FFmpeg source tree can be used
1357 to automatically quote or escape a string in a script.
1359 <a name="Examples-4"></a>
1360 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-4">4.1.1 Examples</a></h3>
1364 Escape the string <code>Crime d'Amour</code> containing the <code>'</code> special
1366 <table><tr><td> </td><td><pre class="example">Crime d\'Amour
1367 </pre></td></tr></table>
1370 The string above contains a quote, so the <code>'</code> needs to be escaped
1372 <table><tr><td> </td><td><pre class="example">'Crime d'\''Amour'
1373 </pre></td></tr></table>
1376 Include leading or trailing whitespaces using quoting:
1377 <table><tr><td> </td><td><pre class="example">' this string starts and ends with whitespaces '
1378 </pre></td></tr></table>
1381 Escaping and quoting can be mixed together:
1382 <table><tr><td> </td><td><pre class="example">' The string '\'string\'' is a string '
1383 </pre></td></tr></table>
1386 To include a literal <code>\</code> you can use either escaping or quoting:
1387 <table><tr><td> </td><td><pre class="example">'c:\foo' can be written as c:\\foo
1388 </pre></td></tr></table>
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>
1395 <p>The accepted syntax is:
1396 </p><table><tr><td> </td><td><pre class="example">[(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
1398 </pre></td></tr></table>
1400 <p>If the value is "now" it takes the current time.
1402 <p>Time is local time unless Z is appended, in which case it is
1404 If the year-month-day part is not specified it takes the current
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>
1411 <p>There are two accepted syntaxes for expressing time duration.
1413 <table><tr><td> </td><td><pre class="example">[-][<var>HH</var>:]<var>MM</var>:<var>SS</var>[.<var>m</var>...]
1414 </pre></td></tr></table>
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
1423 <table><tr><td> </td><td><pre class="example">[-]<var>S</var>+[.<var>m</var>...]
1424 </pre></td></tr></table>
1426 <p><var>S</var> expresses the number of seconds, with the optional decimal part
1429 <p>In both expressions, the optional ‘<samp>-</samp>’ indicates negative duration.
1431 <a name="Examples-66"></a>
1432 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-66">4.3.1 Examples</a></h3>
1434 <p>The following examples are all valid time duration:
1436 <dl compact="compact">
1437 <dt> ‘<samp>55</samp>’</dt>
1441 <dt> ‘<samp>12:03:45</samp>’</dt>
1442 <dd><p>12 hours, 03 minutes and 45 seconds
1445 <dt> ‘<samp>23.189</samp>’</dt>
1446 <dd><p>23.189 seconds
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.
1456 <p>The following abbreviations are recognized:
1457 </p><dl compact="compact">
1458 <dt> ‘<samp>ntsc</samp>’</dt>
1461 <dt> ‘<samp>pal</samp>’</dt>
1464 <dt> ‘<samp>qntsc</samp>’</dt>
1467 <dt> ‘<samp>qpal</samp>’</dt>
1470 <dt> ‘<samp>sntsc</samp>’</dt>
1473 <dt> ‘<samp>spal</samp>’</dt>
1476 <dt> ‘<samp>film</samp>’</dt>
1479 <dt> ‘<samp>ntsc-film</samp>’</dt>
1482 <dt> ‘<samp>sqcif</samp>’</dt>
1485 <dt> ‘<samp>qcif</samp>’</dt>
1488 <dt> ‘<samp>cif</samp>’</dt>
1491 <dt> ‘<samp>4cif</samp>’</dt>
1494 <dt> ‘<samp>16cif</samp>’</dt>
1497 <dt> ‘<samp>qqvga</samp>’</dt>
1500 <dt> ‘<samp>qvga</samp>’</dt>
1503 <dt> ‘<samp>vga</samp>’</dt>
1506 <dt> ‘<samp>svga</samp>’</dt>
1509 <dt> ‘<samp>xga</samp>’</dt>
1512 <dt> ‘<samp>uxga</samp>’</dt>
1515 <dt> ‘<samp>qxga</samp>’</dt>
1518 <dt> ‘<samp>sxga</samp>’</dt>
1521 <dt> ‘<samp>qsxga</samp>’</dt>
1524 <dt> ‘<samp>hsxga</samp>’</dt>
1527 <dt> ‘<samp>wvga</samp>’</dt>
1530 <dt> ‘<samp>wxga</samp>’</dt>
1533 <dt> ‘<samp>wsxga</samp>’</dt>
1536 <dt> ‘<samp>wuxga</samp>’</dt>
1539 <dt> ‘<samp>woxga</samp>’</dt>
1542 <dt> ‘<samp>wqsxga</samp>’</dt>
1545 <dt> ‘<samp>wquxga</samp>’</dt>
1548 <dt> ‘<samp>whsxga</samp>’</dt>
1551 <dt> ‘<samp>whuxga</samp>’</dt>
1554 <dt> ‘<samp>cga</samp>’</dt>
1557 <dt> ‘<samp>ega</samp>’</dt>
1560 <dt> ‘<samp>hd480</samp>’</dt>
1563 <dt> ‘<samp>hd720</samp>’</dt>
1566 <dt> ‘<samp>hd1080</samp>’</dt>
1569 <dt> ‘<samp>2k</samp>’</dt>
1572 <dt> ‘<samp>2kflat</samp>’</dt>
1575 <dt> ‘<samp>2kscope</samp>’</dt>
1578 <dt> ‘<samp>4k</samp>’</dt>
1581 <dt> ‘<samp>4kflat</samp>’</dt>
1584 <dt> ‘<samp>4kscope</samp>’</dt>
1587 <dt> ‘<samp>nhd</samp>’</dt>
1590 <dt> ‘<samp>hqvga</samp>’</dt>
1593 <dt> ‘<samp>wqvga</samp>’</dt>
1596 <dt> ‘<samp>fwqvga</samp>’</dt>
1599 <dt> ‘<samp>hvga</samp>’</dt>
1602 <dt> ‘<samp>qhd</samp>’</dt>
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>
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.
1616 <p>The following abbreviations are recognized:
1617 </p><dl compact="compact">
1618 <dt> ‘<samp>ntsc</samp>’</dt>
1621 <dt> ‘<samp>pal</samp>’</dt>
1624 <dt> ‘<samp>qntsc</samp>’</dt>
1627 <dt> ‘<samp>qpal</samp>’</dt>
1630 <dt> ‘<samp>sntsc</samp>’</dt>
1633 <dt> ‘<samp>spal</samp>’</dt>
1636 <dt> ‘<samp>film</samp>’</dt>
1639 <dt> ‘<samp>ntsc-film</samp>’</dt>
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>
1648 <p>A ratio can be expressed as an expression, or in the form
1649 <var>numerator</var>:<var>denominator</var>.
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.
1655 <p>The undefined value can be expressed using the "0:0" string.
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>
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.
1665 <p>The alpha component may be a string composed by "0x" followed by an
1666 hexadecimal number or a decimal number between 0.0 and 1.0, which
1667 represents the opacity value (‘<samp>0x00</samp>’ or ‘<samp>0.0</samp>’ means completely
1668 transparent, ‘<samp>0xff</samp>’ or ‘<samp>1.0</samp>’ completely opaque). If the alpha
1669 component is not specified then ‘<samp>0xff</samp>’ is assumed.
1671 <p>The string ‘<samp>random</samp>’ will result in a random color.
1673 <p>The following names of colors are recognized:
1674 </p><dl compact="compact">
1675 <dt> ‘<samp>AliceBlue</samp>’</dt>
1678 <dt> ‘<samp>AntiqueWhite</samp>’</dt>
1681 <dt> ‘<samp>Aqua</samp>’</dt>
1684 <dt> ‘<samp>Aquamarine</samp>’</dt>
1687 <dt> ‘<samp>Azure</samp>’</dt>
1690 <dt> ‘<samp>Beige</samp>’</dt>
1693 <dt> ‘<samp>Bisque</samp>’</dt>
1696 <dt> ‘<samp>Black</samp>’</dt>
1699 <dt> ‘<samp>BlanchedAlmond</samp>’</dt>
1702 <dt> ‘<samp>Blue</samp>’</dt>
1705 <dt> ‘<samp>BlueViolet</samp>’</dt>
1708 <dt> ‘<samp>Brown</samp>’</dt>
1711 <dt> ‘<samp>BurlyWood</samp>’</dt>
1714 <dt> ‘<samp>CadetBlue</samp>’</dt>
1717 <dt> ‘<samp>Chartreuse</samp>’</dt>
1720 <dt> ‘<samp>Chocolate</samp>’</dt>
1723 <dt> ‘<samp>Coral</samp>’</dt>
1726 <dt> ‘<samp>CornflowerBlue</samp>’</dt>
1729 <dt> ‘<samp>Cornsilk</samp>’</dt>
1732 <dt> ‘<samp>Crimson</samp>’</dt>
1735 <dt> ‘<samp>Cyan</samp>’</dt>
1738 <dt> ‘<samp>DarkBlue</samp>’</dt>
1741 <dt> ‘<samp>DarkCyan</samp>’</dt>
1744 <dt> ‘<samp>DarkGoldenRod</samp>’</dt>
1747 <dt> ‘<samp>DarkGray</samp>’</dt>
1750 <dt> ‘<samp>DarkGreen</samp>’</dt>
1753 <dt> ‘<samp>DarkKhaki</samp>’</dt>
1756 <dt> ‘<samp>DarkMagenta</samp>’</dt>
1759 <dt> ‘<samp>DarkOliveGreen</samp>’</dt>
1762 <dt> ‘<samp>Darkorange</samp>’</dt>
1765 <dt> ‘<samp>DarkOrchid</samp>’</dt>
1768 <dt> ‘<samp>DarkRed</samp>’</dt>
1771 <dt> ‘<samp>DarkSalmon</samp>’</dt>
1774 <dt> ‘<samp>DarkSeaGreen</samp>’</dt>
1777 <dt> ‘<samp>DarkSlateBlue</samp>’</dt>
1780 <dt> ‘<samp>DarkSlateGray</samp>’</dt>
1783 <dt> ‘<samp>DarkTurquoise</samp>’</dt>
1786 <dt> ‘<samp>DarkViolet</samp>’</dt>
1789 <dt> ‘<samp>DeepPink</samp>’</dt>
1792 <dt> ‘<samp>DeepSkyBlue</samp>’</dt>
1795 <dt> ‘<samp>DimGray</samp>’</dt>
1798 <dt> ‘<samp>DodgerBlue</samp>’</dt>
1801 <dt> ‘<samp>FireBrick</samp>’</dt>
1804 <dt> ‘<samp>FloralWhite</samp>’</dt>
1807 <dt> ‘<samp>ForestGreen</samp>’</dt>
1810 <dt> ‘<samp>Fuchsia</samp>’</dt>
1813 <dt> ‘<samp>Gainsboro</samp>’</dt>
1816 <dt> ‘<samp>GhostWhite</samp>’</dt>
1819 <dt> ‘<samp>Gold</samp>’</dt>
1822 <dt> ‘<samp>GoldenRod</samp>’</dt>
1825 <dt> ‘<samp>Gray</samp>’</dt>
1828 <dt> ‘<samp>Green</samp>’</dt>
1831 <dt> ‘<samp>GreenYellow</samp>’</dt>
1834 <dt> ‘<samp>HoneyDew</samp>’</dt>
1837 <dt> ‘<samp>HotPink</samp>’</dt>
1840 <dt> ‘<samp>IndianRed</samp>’</dt>
1843 <dt> ‘<samp>Indigo</samp>’</dt>
1846 <dt> ‘<samp>Ivory</samp>’</dt>
1849 <dt> ‘<samp>Khaki</samp>’</dt>
1852 <dt> ‘<samp>Lavender</samp>’</dt>
1855 <dt> ‘<samp>LavenderBlush</samp>’</dt>
1858 <dt> ‘<samp>LawnGreen</samp>’</dt>
1861 <dt> ‘<samp>LemonChiffon</samp>’</dt>
1864 <dt> ‘<samp>LightBlue</samp>’</dt>
1867 <dt> ‘<samp>LightCoral</samp>’</dt>
1870 <dt> ‘<samp>LightCyan</samp>’</dt>
1873 <dt> ‘<samp>LightGoldenRodYellow</samp>’</dt>
1876 <dt> ‘<samp>LightGreen</samp>’</dt>
1879 <dt> ‘<samp>LightGrey</samp>’</dt>
1882 <dt> ‘<samp>LightPink</samp>’</dt>
1885 <dt> ‘<samp>LightSalmon</samp>’</dt>
1888 <dt> ‘<samp>LightSeaGreen</samp>’</dt>
1891 <dt> ‘<samp>LightSkyBlue</samp>’</dt>
1894 <dt> ‘<samp>LightSlateGray</samp>’</dt>
1897 <dt> ‘<samp>LightSteelBlue</samp>’</dt>
1900 <dt> ‘<samp>LightYellow</samp>’</dt>
1903 <dt> ‘<samp>Lime</samp>’</dt>
1906 <dt> ‘<samp>LimeGreen</samp>’</dt>
1909 <dt> ‘<samp>Linen</samp>’</dt>
1912 <dt> ‘<samp>Magenta</samp>’</dt>
1915 <dt> ‘<samp>Maroon</samp>’</dt>
1918 <dt> ‘<samp>MediumAquaMarine</samp>’</dt>
1921 <dt> ‘<samp>MediumBlue</samp>’</dt>
1924 <dt> ‘<samp>MediumOrchid</samp>’</dt>
1927 <dt> ‘<samp>MediumPurple</samp>’</dt>
1930 <dt> ‘<samp>MediumSeaGreen</samp>’</dt>
1933 <dt> ‘<samp>MediumSlateBlue</samp>’</dt>
1936 <dt> ‘<samp>MediumSpringGreen</samp>’</dt>
1939 <dt> ‘<samp>MediumTurquoise</samp>’</dt>
1942 <dt> ‘<samp>MediumVioletRed</samp>’</dt>
1945 <dt> ‘<samp>MidnightBlue</samp>’</dt>
1948 <dt> ‘<samp>MintCream</samp>’</dt>
1951 <dt> ‘<samp>MistyRose</samp>’</dt>
1954 <dt> ‘<samp>Moccasin</samp>’</dt>
1957 <dt> ‘<samp>NavajoWhite</samp>’</dt>
1960 <dt> ‘<samp>Navy</samp>’</dt>
1963 <dt> ‘<samp>OldLace</samp>’</dt>
1966 <dt> ‘<samp>Olive</samp>’</dt>
1969 <dt> ‘<samp>OliveDrab</samp>’</dt>
1972 <dt> ‘<samp>Orange</samp>’</dt>
1975 <dt> ‘<samp>OrangeRed</samp>’</dt>
1978 <dt> ‘<samp>Orchid</samp>’</dt>
1981 <dt> ‘<samp>PaleGoldenRod</samp>’</dt>
1984 <dt> ‘<samp>PaleGreen</samp>’</dt>
1987 <dt> ‘<samp>PaleTurquoise</samp>’</dt>
1990 <dt> ‘<samp>PaleVioletRed</samp>’</dt>
1993 <dt> ‘<samp>PapayaWhip</samp>’</dt>
1996 <dt> ‘<samp>PeachPuff</samp>’</dt>
1999 <dt> ‘<samp>Peru</samp>’</dt>
2002 <dt> ‘<samp>Pink</samp>’</dt>
2005 <dt> ‘<samp>Plum</samp>’</dt>
2008 <dt> ‘<samp>PowderBlue</samp>’</dt>
2011 <dt> ‘<samp>Purple</samp>’</dt>
2014 <dt> ‘<samp>Red</samp>’</dt>
2017 <dt> ‘<samp>RosyBrown</samp>’</dt>
2020 <dt> ‘<samp>RoyalBlue</samp>’</dt>
2023 <dt> ‘<samp>SaddleBrown</samp>’</dt>
2026 <dt> ‘<samp>Salmon</samp>’</dt>
2029 <dt> ‘<samp>SandyBrown</samp>’</dt>
2032 <dt> ‘<samp>SeaGreen</samp>’</dt>
2035 <dt> ‘<samp>SeaShell</samp>’</dt>
2038 <dt> ‘<samp>Sienna</samp>’</dt>
2041 <dt> ‘<samp>Silver</samp>’</dt>
2044 <dt> ‘<samp>SkyBlue</samp>’</dt>
2047 <dt> ‘<samp>SlateBlue</samp>’</dt>
2050 <dt> ‘<samp>SlateGray</samp>’</dt>
2053 <dt> ‘<samp>Snow</samp>’</dt>
2056 <dt> ‘<samp>SpringGreen</samp>’</dt>
2059 <dt> ‘<samp>SteelBlue</samp>’</dt>
2062 <dt> ‘<samp>Tan</samp>’</dt>
2065 <dt> ‘<samp>Teal</samp>’</dt>
2068 <dt> ‘<samp>Thistle</samp>’</dt>
2071 <dt> ‘<samp>Tomato</samp>’</dt>
2074 <dt> ‘<samp>Turquoise</samp>’</dt>
2077 <dt> ‘<samp>Violet</samp>’</dt>
2080 <dt> ‘<samp>Wheat</samp>’</dt>
2083 <dt> ‘<samp>White</samp>’</dt>
2086 <dt> ‘<samp>WhiteSmoke</samp>’</dt>
2089 <dt> ‘<samp>Yellow</samp>’</dt>
2092 <dt> ‘<samp>YellowGreen</samp>’</dt>
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>
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.
2105 <p>Individual channels are identified by an id, as given by the table
2107 </p><dl compact="compact">
2108 <dt> ‘<samp>FL</samp>’</dt>
2111 <dt> ‘<samp>FR</samp>’</dt>
2114 <dt> ‘<samp>FC</samp>’</dt>
2117 <dt> ‘<samp>LFE</samp>’</dt>
2118 <dd><p>low frequency
2120 <dt> ‘<samp>BL</samp>’</dt>
2123 <dt> ‘<samp>BR</samp>’</dt>
2126 <dt> ‘<samp>FLC</samp>’</dt>
2127 <dd><p>front left-of-center
2129 <dt> ‘<samp>FRC</samp>’</dt>
2130 <dd><p>front right-of-center
2132 <dt> ‘<samp>BC</samp>’</dt>
2135 <dt> ‘<samp>SL</samp>’</dt>
2138 <dt> ‘<samp>SR</samp>’</dt>
2141 <dt> ‘<samp>TC</samp>’</dt>
2144 <dt> ‘<samp>TFL</samp>’</dt>
2145 <dd><p>top front left
2147 <dt> ‘<samp>TFC</samp>’</dt>
2148 <dd><p>top front center
2150 <dt> ‘<samp>TFR</samp>’</dt>
2151 <dd><p>top front right
2153 <dt> ‘<samp>TBL</samp>’</dt>
2154 <dd><p>top back left
2156 <dt> ‘<samp>TBC</samp>’</dt>
2157 <dd><p>top back center
2159 <dt> ‘<samp>TBR</samp>’</dt>
2160 <dd><p>top back right
2162 <dt> ‘<samp>DL</samp>’</dt>
2165 <dt> ‘<samp>DR</samp>’</dt>
2166 <dd><p>downmix right
2168 <dt> ‘<samp>WL</samp>’</dt>
2171 <dt> ‘<samp>WR</samp>’</dt>
2174 <dt> ‘<samp>SDL</samp>’</dt>
2175 <dd><p>surround direct left
2177 <dt> ‘<samp>SDR</samp>’</dt>
2178 <dd><p>surround direct right
2180 <dt> ‘<samp>LFE2</samp>’</dt>
2181 <dd><p>low frequency 2
2185 <p>Standard channel layout compositions can be specified by using the
2186 following identifiers:
2187 </p><dl compact="compact">
2188 <dt> ‘<samp>mono</samp>’</dt>
2191 <dt> ‘<samp>stereo</samp>’</dt>
2194 <dt> ‘<samp>2.1</samp>’</dt>
2197 <dt> ‘<samp>3.0</samp>’</dt>
2200 <dt> ‘<samp>3.0(back)</samp>’</dt>
2203 <dt> ‘<samp>4.0</samp>’</dt>
2206 <dt> ‘<samp>quad</samp>’</dt>
2209 <dt> ‘<samp>quad(side)</samp>’</dt>
2212 <dt> ‘<samp>3.1</samp>’</dt>
2215 <dt> ‘<samp>5.0</samp>’</dt>
2216 <dd><p>FL+FR+FC+BL+BR
2218 <dt> ‘<samp>5.0(side)</samp>’</dt>
2219 <dd><p>FL+FR+FC+SL+SR
2221 <dt> ‘<samp>4.1</samp>’</dt>
2222 <dd><p>FL+FR+FC+LFE+BC
2224 <dt> ‘<samp>5.1</samp>’</dt>
2225 <dd><p>FL+FR+FC+LFE+BL+BR
2227 <dt> ‘<samp>5.1(side)</samp>’</dt>
2228 <dd><p>FL+FR+FC+LFE+SL+SR
2230 <dt> ‘<samp>6.0</samp>’</dt>
2231 <dd><p>FL+FR+FC+BC+SL+SR
2233 <dt> ‘<samp>6.0(front)</samp>’</dt>
2234 <dd><p>FL+FR+FLC+FRC+SL+SR
2236 <dt> ‘<samp>hexagonal</samp>’</dt>
2237 <dd><p>FL+FR+FC+BL+BR+BC
2239 <dt> ‘<samp>6.1</samp>’</dt>
2240 <dd><p>FL+FR+FC+LFE+BC+SL+SR
2242 <dt> ‘<samp>6.1</samp>’</dt>
2243 <dd><p>FL+FR+FC+LFE+BL+BR+BC
2245 <dt> ‘<samp>6.1(front)</samp>’</dt>
2246 <dd><p>FL+FR+LFE+FLC+FRC+SL+SR
2248 <dt> ‘<samp>7.0</samp>’</dt>
2249 <dd><p>FL+FR+FC+BL+BR+SL+SR
2251 <dt> ‘<samp>7.0(front)</samp>’</dt>
2252 <dd><p>FL+FR+FC+FLC+FRC+SL+SR
2254 <dt> ‘<samp>7.1</samp>’</dt>
2255 <dd><p>FL+FR+FC+LFE+BL+BR+SL+SR
2257 <dt> ‘<samp>7.1(wide)</samp>’</dt>
2258 <dd><p>FL+FR+FC+LFE+BL+BR+FLC+FRC
2260 <dt> ‘<samp>7.1(wide-side)</samp>’</dt>
2261 <dd><p>FL+FR+FC+LFE+FLC+FRC+SL+SR
2263 <dt> ‘<samp>octagonal</samp>’</dt>
2264 <dd><p>FL+FR+FC+BL+BR+BC+SL+SR
2266 <dt> ‘<samp>downmix</samp>’</dt>
2271 <p>A custom channel layout can be specified as a sequence of terms, separated by
2272 ’+’ or ’|’. Each term can be:
2275 the name of a standard channel layout (e.g. ‘<samp>mono</samp>’,
2276 ‘<samp>stereo</samp>’, ‘<samp>4.0</samp>’, ‘<samp>quad</samp>’, ‘<samp>5.0</samp>’, etc.)
2279 the name of a single channel (e.g. ‘<samp>FL</samp>’, ‘<samp>FR</samp>’, ‘<samp>FC</samp>’, ‘<samp>LFE</samp>’, etc.)
2282 a number of channels, in decimal, optionally followed by ’c’, yielding
2283 the default channel layout for that number of channels (see the
2284 function <code>av_get_default_channel_layout</code>)
2287 a channel layout mask, in hexadecimal starting with "0x" (see the
2288 <code>AV_CH_*</code> macros in ‘<tt>libavutil/channel_layout.h</tt>’.
2291 <p>Starting from libavutil version 53 the trailing character "c" 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 "c").
2296 <p>See also the function <code>av_get_channel_layout</code> defined in
2297 ‘<tt>libavutil/channel_layout.h</tt>’.
2299 <a name="Expression-Evaluation"></a>
2300 <h1 class="chapter"><a href="ffplay-all.html#toc-Expression-Evaluation">5. Expression Evaluation</a></h1>
2302 <p>When evaluating an arithmetic expression, FFmpeg uses an internal
2303 formula evaluator, implemented through the ‘<tt>libavutil/eval.h</tt>’
2306 <p>An expression may contain unary, binary operators, constants, and
2309 <p>Two expressions <var>expr1</var> and <var>expr2</var> can be combined to form
2310 another expression "<var>expr1</var>;<var>expr2</var>".
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>.
2314 <p>The following binary operators are available: <code>+</code>, <code>-</code>,
2315 <code>*</code>, <code>/</code>, <code>^</code>.
2317 <p>The following unary operators are available: <code>+</code>, <code>-</code>.
2319 <p>The following functions are available:
2320 </p><dl compact="compact">
2321 <dt> ‘<samp>abs(x)</samp>’</dt>
2322 <dd><p>Compute absolute value of <var>x</var>.
2325 <dt> ‘<samp>acos(x)</samp>’</dt>
2326 <dd><p>Compute arccosine of <var>x</var>.
2329 <dt> ‘<samp>asin(x)</samp>’</dt>
2330 <dd><p>Compute arcsine of <var>x</var>.
2333 <dt> ‘<samp>atan(x)</samp>’</dt>
2334 <dd><p>Compute arctangent of <var>x</var>.
2337 <dt> ‘<samp>between(x, min, max)</samp>’</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.
2342 <dt> ‘<samp>bitand(x, y)</samp>’</dt>
2343 <dt> ‘<samp>bitor(x, y)</samp>’</dt>
2344 <dd><p>Compute bitwise and/or operation on <var>x</var> and <var>y</var>.
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.
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).
2354 <dt> ‘<samp>ceil(expr)</samp>’</dt>
2355 <dd><p>Round the value of expression <var>expr</var> upwards to the nearest
2356 integer. For example, "ceil(1.5)" is "2.0".
2359 <dt> ‘<samp>cos(x)</samp>’</dt>
2360 <dd><p>Compute cosine of <var>x</var>.
2363 <dt> ‘<samp>cosh(x)</samp>’</dt>
2364 <dd><p>Compute hyperbolic cosine of <var>x</var>.
2367 <dt> ‘<samp>eq(x, y)</samp>’</dt>
2368 <dd><p>Return 1 if <var>x</var> and <var>y</var> are equivalent, 0 otherwise.
2371 <dt> ‘<samp>exp(x)</samp>’</dt>
2372 <dd><p>Compute exponential of <var>x</var> (with base <code>e</code>, the Euler’s number).
2375 <dt> ‘<samp>floor(expr)</samp>’</dt>
2376 <dd><p>Round the value of expression <var>expr</var> downwards to the nearest
2377 integer. For example, "floor(-1.5)" is "-2.0".
2380 <dt> ‘<samp>gauss(x)</samp>’</dt>
2381 <dd><p>Compute Gauss function of <var>x</var>, corresponding to
2382 <code>exp(-x*x/2) / sqrt(2*PI)</code>.
2385 <dt> ‘<samp>gcd(x, y)</samp>’</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.
2390 <dt> ‘<samp>gt(x, y)</samp>’</dt>
2391 <dd><p>Return 1 if <var>x</var> is greater than <var>y</var>, 0 otherwise.
2394 <dt> ‘<samp>gte(x, y)</samp>’</dt>
2395 <dd><p>Return 1 if <var>x</var> is greater than or equal to <var>y</var>, 0 otherwise.
2398 <dt> ‘<samp>hypot(x, y)</samp>’</dt>
2399 <dd><p>This function is similar to the C function with the same name; it returns
2400 "sqrt(<var>x</var>*<var>x</var> + <var>y</var>*<var>y</var>)", 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.
2405 <dt> ‘<samp>if(x, y)</samp>’</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.
2410 <dt> ‘<samp>if(x, y, z)</samp>’</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>.
2415 <dt> ‘<samp>ifnot(x, y)</samp>’</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.
2420 <dt> ‘<samp>ifnot(x, y, z)</samp>’</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>.
2425 <dt> ‘<samp>isinf(x)</samp>’</dt>
2426 <dd><p>Return 1.0 if <var>x</var> is +/-INFINITY, 0.0 otherwise.
2429 <dt> ‘<samp>isnan(x)</samp>’</dt>
2430 <dd><p>Return 1.0 if <var>x</var> is NAN, 0.0 otherwise.
2433 <dt> ‘<samp>ld(var)</samp>’</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.
2439 <dt> ‘<samp>log(x)</samp>’</dt>
2440 <dd><p>Compute natural logarithm of <var>x</var>.
2443 <dt> ‘<samp>lt(x, y)</samp>’</dt>
2444 <dd><p>Return 1 if <var>x</var> is lesser than <var>y</var>, 0 otherwise.
2447 <dt> ‘<samp>lte(x, y)</samp>’</dt>
2448 <dd><p>Return 1 if <var>x</var> is lesser than or equal to <var>y</var>, 0 otherwise.
2451 <dt> ‘<samp>max(x, y)</samp>’</dt>
2452 <dd><p>Return the maximum between <var>x</var> and <var>y</var>.
2455 <dt> ‘<samp>min(x, y)</samp>’</dt>
2456 <dd><p>Return the maximum between <var>x</var> and <var>y</var>.
2459 <dt> ‘<samp>mod(x, y)</samp>’</dt>
2460 <dd><p>Compute the remainder of division of <var>x</var> by <var>y</var>.
2463 <dt> ‘<samp>not(expr)</samp>’</dt>
2464 <dd><p>Return 1.0 if <var>expr</var> is zero, 0.0 otherwise.
2467 <dt> ‘<samp>pow(x, y)</samp>’</dt>
2468 <dd><p>Compute the power of <var>x</var> elevated <var>y</var>, it is equivalent to
2469 "(<var>x</var>)^(<var>y</var>)".
2472 <dt> ‘<samp>print(t)</samp>’</dt>
2473 <dt> ‘<samp>print(t, l)</samp>’</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.
2478 <p>Prints t with loglevel l
2481 <dt> ‘<samp>random(x)</samp>’</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.
2486 <dt> ‘<samp>root(expr, max)</samp>’</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>.
2490 <p>The expression in <var>expr</var> must denote a continuous function or the
2491 result is undefined.
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.
2500 <dt> ‘<samp>sin(x)</samp>’</dt>
2501 <dd><p>Compute sine of <var>x</var>.
2504 <dt> ‘<samp>sinh(x)</samp>’</dt>
2505 <dd><p>Compute hyperbolic sine of <var>x</var>.
2508 <dt> ‘<samp>sqrt(expr)</samp>’</dt>
2509 <dd><p>Compute the square root of <var>expr</var>. This is equivalent to
2510 "(<var>expr</var>)^.5".
2513 <dt> ‘<samp>squish(x)</samp>’</dt>
2514 <dd><p>Compute expression <code>1/(1 + exp(4*x))</code>.
2517 <dt> ‘<samp>st(var, expr)</samp>’</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.
2525 <dt> ‘<samp>tan(x)</samp>’</dt>
2526 <dd><p>Compute tangent of <var>x</var>.
2529 <dt> ‘<samp>tanh(x)</samp>’</dt>
2530 <dd><p>Compute hyperbolic tangent of <var>x</var>.
2533 <dt> ‘<samp>taylor(expr, x)</samp>’</dt>
2534 <dt> ‘<samp>taylor(expr, x, id)</samp>’</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.
2538 <p>When the series does not converge the result is undefined.
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.
2545 <p>Note, when you have the derivatives at y instead of 0,
2546 <code>taylor(expr, x-y)</code> can be used.
2549 <dt> ‘<samp>time(0)</samp>’</dt>
2550 <dd><p>Return the current (wallclock) time in seconds.
2553 <dt> ‘<samp>trunc(expr)</samp>’</dt>
2554 <dd><p>Round the value of expression <var>expr</var> towards zero to the nearest
2555 integer. For example, "trunc(-1.5)" is "-1.0".
2558 <dt> ‘<samp>while(cond, expr)</samp>’</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.
2565 <p>The following constants are available:
2566 </p><dl compact="compact">
2567 <dt> ‘<samp>PI</samp>’</dt>
2568 <dd><p>area of the unit disc, approximately 3.14
2570 <dt> ‘<samp>E</samp>’</dt>
2571 <dd><p>exp(1) (Euler’s number), approximately 2.718
2573 <dt> ‘<samp>PHI</samp>’</dt>
2574 <dd><p>golden ratio (1+sqrt(5))/2, approximately 1.618
2578 <p>Assuming that an expression is considered "true" if it has a non-zero
2581 <p><code>*</code> works like AND
2583 <p><code>+</code> works like OR
2585 <p>For example the construct:
2586 </p><table><tr><td> </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> </td><td><pre class="example">if(A*B, C)
2590 </pre></td></tr></table>
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
2596 <p>The evaluator also recognizes the International System unit prefixes.
2597 If ’i’ is appended after the prefix, binary prefixes are used, which
2598 are based on powers of 1024 instead of powers of 1000.
2599 The ’B’ postfix multiplies the value by 8, and can be appended after a
2600 unit prefix or used alone. This allows using for example ’KB’, ’MiB’,
2601 ’G’ and ’B’ as number postfix.
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> ‘<samp>y</samp>’</dt>
2607 <dd><p>10^-24 / 2^-80
2609 <dt> ‘<samp>z</samp>’</dt>
2610 <dd><p>10^-21 / 2^-70
2612 <dt> ‘<samp>a</samp>’</dt>
2613 <dd><p>10^-18 / 2^-60
2615 <dt> ‘<samp>f</samp>’</dt>
2616 <dd><p>10^-15 / 2^-50
2618 <dt> ‘<samp>p</samp>’</dt>
2619 <dd><p>10^-12 / 2^-40
2621 <dt> ‘<samp>n</samp>’</dt>
2622 <dd><p>10^-9 / 2^-30
2624 <dt> ‘<samp>u</samp>’</dt>
2625 <dd><p>10^-6 / 2^-20
2627 <dt> ‘<samp>m</samp>’</dt>
2628 <dd><p>10^-3 / 2^-10
2630 <dt> ‘<samp>c</samp>’</dt>
2633 <dt> ‘<samp>d</samp>’</dt>
2636 <dt> ‘<samp>h</samp>’</dt>
2639 <dt> ‘<samp>k</samp>’</dt>
2642 <dt> ‘<samp>K</samp>’</dt>
2645 <dt> ‘<samp>M</samp>’</dt>
2648 <dt> ‘<samp>G</samp>’</dt>
2651 <dt> ‘<samp>T</samp>’</dt>
2654 <dt> ‘<samp>P</samp>’</dt>
2657 <dt> ‘<samp>E</samp>’</dt>
2660 <dt> ‘<samp>Z</samp>’</dt>
2663 <dt> ‘<samp>Y</samp>’</dt>
2669 <a name="OpenCL-Options"></a>
2670 <h1 class="chapter"><a href="ffplay-all.html#toc-OpenCL-Options">6. OpenCL Options</a></h1>
2672 <p>When FFmpeg is configured with <code>--enable-opencl</code>, it is possible
2673 to set the options for the global OpenCL context.
2675 <p>The list of supported options follows:
2677 <dl compact="compact">
2678 <dt> ‘<samp>build_options</samp>’</dt>
2679 <dd><p>Set build options used to compile the registered kernels.
2681 <p>See reference "OpenCL Specification Version: 1.2 chapter 5.6.4".
2684 <dt> ‘<samp>platform_idx</samp>’</dt>
2685 <dd><p>Select the index of the platform to run OpenCL code.
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>.
2691 <dt> ‘<samp>device_idx</samp>’</dt>
2692 <dd><p>Select the index of the device used to run OpenCL code.
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>.
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>
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.
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.
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 ‘<tt>libavutil/opt.h</tt>’ API
2716 for programmatic use.
2718 <p>The list of supported options follow:
2720 <dl compact="compact">
2721 <dt> ‘<samp>b <var>integer</var> (<em>encoding,audio,video</em>)</samp>’</dt>
2722 <dd><p>Set bitrate in bits/s. Default value is 200K.
2725 <dt> ‘<samp>ab <var>integer</var> (<em>encoding,audio</em>)</samp>’</dt>
2726 <dd><p>Set audio bitrate (in bits/s). Default value is 128K.
2729 <dt> ‘<samp>bt <var>integer</var> (<em>encoding,video</em>)</samp>’</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.
2736 <dt> ‘<samp>flags <var>flags</var> (<em>decoding/encoding,audio,video,subtitles</em>)</samp>’</dt>
2737 <dd><p>Set generic flags.
2740 </p><dl compact="compact">
2741 <dt> ‘<samp>mv4</samp>’</dt>
2742 <dd><p>Use four motion vector by macroblock (mpeg4).
2744 <dt> ‘<samp>qpel</samp>’</dt>
2745 <dd><p>Use 1/4 pel motion compensation.
2747 <dt> ‘<samp>loop</samp>’</dt>
2748 <dd><p>Use loop filter.
2750 <dt> ‘<samp>qscale</samp>’</dt>
2751 <dd><p>Use fixed qscale.
2753 <dt> ‘<samp>gmc</samp>’</dt>
2756 <dt> ‘<samp>mv0</samp>’</dt>
2757 <dd><p>Always try a mb with mv=<0,0>.
2759 <dt> ‘<samp>input_preserved</samp>’</dt>
2760 <dt> ‘<samp>pass1</samp>’</dt>
2761 <dd><p>Use internal 2pass ratecontrol in first pass mode.
2763 <dt> ‘<samp>pass2</samp>’</dt>
2764 <dd><p>Use internal 2pass ratecontrol in second pass mode.
2766 <dt> ‘<samp>gray</samp>’</dt>
2767 <dd><p>Only decode/encode grayscale.
2769 <dt> ‘<samp>emu_edge</samp>’</dt>
2770 <dd><p>Do not draw edges.
2772 <dt> ‘<samp>psnr</samp>’</dt>
2773 <dd><p>Set error[?] variables during encoding.
2775 <dt> ‘<samp>truncated</samp>’</dt>
2776 <dt> ‘<samp>naq</samp>’</dt>
2777 <dd><p>Normalize adaptive quantization.
2779 <dt> ‘<samp>ildct</samp>’</dt>
2780 <dd><p>Use interlaced DCT.
2782 <dt> ‘<samp>low_delay</samp>’</dt>
2783 <dd><p>Force low delay.
2785 <dt> ‘<samp>global_header</samp>’</dt>
2786 <dd><p>Place global headers in extradata instead of every keyframe.
2788 <dt> ‘<samp>bitexact</samp>’</dt>
2789 <dd><p>Use only bitexact stuff (except (I)DCT).
2791 <dt> ‘<samp>aic</samp>’</dt>
2792 <dd><p>Apply H263 advanced intra coding / mpeg4 ac prediction.
2794 <dt> ‘<samp>cbp</samp>’</dt>
2795 <dd><p>Deprecated, use mpegvideo private options instead.
2797 <dt> ‘<samp>qprd</samp>’</dt>
2798 <dd><p>Deprecated, use mpegvideo private options instead.
2800 <dt> ‘<samp>ilme</samp>’</dt>
2801 <dd><p>Apply interlaced motion estimation.
2803 <dt> ‘<samp>cgop</samp>’</dt>
2804 <dd><p>Use closed gop.
2809 <dt> ‘<samp>me_method <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
2810 <dd><p>Set motion estimation method.
2813 </p><dl compact="compact">
2814 <dt> ‘<samp>zero</samp>’</dt>
2815 <dd><p>zero motion estimation (fastest)
2817 <dt> ‘<samp>full</samp>’</dt>
2818 <dd><p>full motion estimation (slowest)
2820 <dt> ‘<samp>epzs</samp>’</dt>
2821 <dd><p>EPZS motion estimation (default)
2823 <dt> ‘<samp>esa</samp>’</dt>
2824 <dd><p>esa motion estimation (alias for full)
2826 <dt> ‘<samp>tesa</samp>’</dt>
2827 <dd><p>tesa motion estimation
2829 <dt> ‘<samp>dia</samp>’</dt>
2830 <dd><p>dia motion estimation (alias for epzs)
2832 <dt> ‘<samp>log</samp>’</dt>
2833 <dd><p>log motion estimation
2835 <dt> ‘<samp>phods</samp>’</dt>
2836 <dd><p>phods motion estimation
2838 <dt> ‘<samp>x1</samp>’</dt>
2839 <dd><p>X1 motion estimation
2841 <dt> ‘<samp>hex</samp>’</dt>
2842 <dd><p>hex motion estimation
2844 <dt> ‘<samp>umh</samp>’</dt>
2845 <dd><p>umh motion estimation
2847 <dt> ‘<samp>iter</samp>’</dt>
2848 <dd><p>iter motion estimation
2853 <dt> ‘<samp>extradata_size <var>integer</var></samp>’</dt>
2854 <dd><p>Set extradata size.
2857 <dt> ‘<samp>time_base <var>rational number</var></samp>’</dt>
2858 <dd><p>Set codec time base.
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
2866 <dt> ‘<samp>g <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
2867 <dd><p>Set the group of picture size. Default value is 12.
2870 <dt> ‘<samp>ar <var>integer</var> (<em>decoding/encoding,audio</em>)</samp>’</dt>
2871 <dd><p>Set audio sampling rate (in Hz).
2874 <dt> ‘<samp>ac <var>integer</var> (<em>decoding/encoding,audio</em>)</samp>’</dt>
2875 <dd><p>Set number of audio channels.
2878 <dt> ‘<samp>cutoff <var>integer</var> (<em>encoding,audio</em>)</samp>’</dt>
2879 <dd><p>Set cutoff bandwidth.
2882 <dt> ‘<samp>frame_size <var>integer</var> (<em>encoding,audio</em>)</samp>’</dt>
2883 <dd><p>Set audio frame size.
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
2892 <dt> ‘<samp>frame_number <var>integer</var></samp>’</dt>
2893 <dd><p>Set the frame number.
2896 <dt> ‘<samp>delay <var>integer</var></samp>’</dt>
2897 <dt> ‘<samp>qcomp <var>float</var> (<em>encoding,video</em>)</samp>’</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:
2903 <dt> ‘<samp>qblur <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
2904 <dd><p>Set video quantizer scale blur (VBR).
2907 <dt> ‘<samp>qmin <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
2908 <dd><p>Set min video quantizer scale (VBR). Must be included between -1 and
2909 69, default value is 2.
2912 <dt> ‘<samp>qmax <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
2913 <dd><p>Set max video quantizer scale (VBR). Must be included between -1 and
2914 1024, default value is 31.
2917 <dt> ‘<samp>qdiff <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
2918 <dd><p>Set max difference between the quantizer scale (VBR).
2921 <dt> ‘<samp>bf <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
2922 <dd><p>Set max number of B frames between non-B-frames.
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.
2928 <p>Default value is 0.
2931 <dt> ‘<samp>b_qfactor <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
2932 <dd><p>Set qp factor between P and B frames.
2935 <dt> ‘<samp>rc_strategy <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
2936 <dd><p>Set ratecontrol method.
2939 <dt> ‘<samp>b_strategy <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
2940 <dd><p>Set strategy to choose between I/P/B-frames.
2943 <dt> ‘<samp>ps <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
2944 <dd><p>Set RTP payload size in bytes.
2947 <dt> ‘<samp>mv_bits <var>integer</var></samp>’</dt>
2948 <dt> ‘<samp>header_bits <var>integer</var></samp>’</dt>
2949 <dt> ‘<samp>i_tex_bits <var>integer</var></samp>’</dt>
2950 <dt> ‘<samp>p_tex_bits <var>integer</var></samp>’</dt>
2951 <dt> ‘<samp>i_count <var>integer</var></samp>’</dt>
2952 <dt> ‘<samp>p_count <var>integer</var></samp>’</dt>
2953 <dt> ‘<samp>skip_count <var>integer</var></samp>’</dt>
2954 <dt> ‘<samp>misc_bits <var>integer</var></samp>’</dt>
2955 <dt> ‘<samp>frame_bits <var>integer</var></samp>’</dt>
2956 <dt> ‘<samp>codec_tag <var>integer</var></samp>’</dt>
2957 <dt> ‘<samp>bug <var>flags</var> (<em>decoding,video</em>)</samp>’</dt>
2958 <dd><p>Workaround not auto detected encoder bugs.
2961 </p><dl compact="compact">
2962 <dt> ‘<samp>autodetect</samp>’</dt>
2963 <dt> ‘<samp>old_msmpeg4</samp>’</dt>
2964 <dd><p>some old lavc generated msmpeg4v3 files (no autodetection)
2966 <dt> ‘<samp>xvid_ilace</samp>’</dt>
2967 <dd><p>Xvid interlacing bug (autodetected if fourcc==XVIX)
2969 <dt> ‘<samp>ump4</samp>’</dt>
2970 <dd><p>(autodetected if fourcc==UMP4)
2972 <dt> ‘<samp>no_padding</samp>’</dt>
2973 <dd><p>padding bug (autodetected)
2975 <dt> ‘<samp>amv</samp>’</dt>
2976 <dt> ‘<samp>ac_vlc</samp>’</dt>
2977 <dd><p>illegal vlc bug (autodetected per fourcc)
2979 <dt> ‘<samp>qpel_chroma</samp>’</dt>
2980 <dt> ‘<samp>std_qpel</samp>’</dt>
2981 <dd><p>old standard qpel (autodetected per fourcc/version)
2983 <dt> ‘<samp>qpel_chroma2</samp>’</dt>
2984 <dt> ‘<samp>direct_blocksize</samp>’</dt>
2985 <dd><p>direct-qpel-blocksize bug (autodetected per fourcc/version)
2987 <dt> ‘<samp>edge</samp>’</dt>
2988 <dd><p>edge padding bug (autodetected per fourcc/version)
2990 <dt> ‘<samp>hpel_chroma</samp>’</dt>
2991 <dt> ‘<samp>dc_clip</samp>’</dt>
2992 <dt> ‘<samp>ms</samp>’</dt>
2993 <dd><p>Workaround various bugs in microsoft broken decoders.
2995 <dt> ‘<samp>trunc</samp>’</dt>
2996 <dd><p>trancated frames
3001 <dt> ‘<samp>lelim <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3002 <dd><p>Set single coefficient elimination threshold for luminance (negative
3003 values also consider DC coefficient).
3006 <dt> ‘<samp>celim <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3007 <dd><p>Set single coefficient elimination threshold for chrominance (negative
3008 values also consider dc coefficient)
3011 <dt> ‘<samp>strict <var>integer</var> (<em>decoding/encoding,audio,video</em>)</samp>’</dt>
3012 <dd><p>Specify how strictly to follow the standards.
3015 </p><dl compact="compact">
3016 <dt> ‘<samp>very</samp>’</dt>
3017 <dd><p>strictly conform to a older more strict version of the spec or reference software
3019 <dt> ‘<samp>strict</samp>’</dt>
3020 <dd><p>strictly conform to all the things in the spec no matter what consequences
3022 <dt> ‘<samp>normal</samp>’</dt>
3023 <dt> ‘<samp>unofficial</samp>’</dt>
3024 <dd><p>allow unofficial extensions
3026 <dt> ‘<samp>experimental</samp>’</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.
3035 <dt> ‘<samp>b_qoffset <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3036 <dd><p>Set QP offset between P and B frames.
3039 <dt> ‘<samp>err_detect <var>flags</var> (<em>decoding,audio,video</em>)</samp>’</dt>
3040 <dd><p>Set error detection flags.
3043 </p><dl compact="compact">
3044 <dt> ‘<samp>crccheck</samp>’</dt>
3045 <dd><p>verify embedded CRCs
3047 <dt> ‘<samp>bitstream</samp>’</dt>
3048 <dd><p>detect bitstream specification deviations
3050 <dt> ‘<samp>buffer</samp>’</dt>
3051 <dd><p>detect improper bitstream length
3053 <dt> ‘<samp>explode</samp>’</dt>
3054 <dd><p>abort decoding on minor error detection
3056 <dt> ‘<samp>careful</samp>’</dt>
3057 <dd><p>consider things that violate the spec and have not been seen in the wild as errors
3059 <dt> ‘<samp>compliant</samp>’</dt>
3060 <dd><p>consider all spec non compliancies as errors
3062 <dt> ‘<samp>aggressive</samp>’</dt>
3063 <dd><p>consider things that a sane encoder should not do as an error
3068 <dt> ‘<samp>has_b_frames <var>integer</var></samp>’</dt>
3069 <dt> ‘<samp>block_align <var>integer</var></samp>’</dt>
3070 <dt> ‘<samp>mpeg_quant <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3071 <dd><p>Use MPEG quantizers instead of H.263.
3074 <dt> ‘<samp>qsquish <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3075 <dd><p>How to keep quantizer between qmin and qmax (0 = clip, 1 = use
3076 differentiable function).
3079 <dt> ‘<samp>rc_qmod_amp <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3080 <dd><p>Set experimental quantizer modulation.
3083 <dt> ‘<samp>rc_qmod_freq <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3084 <dd><p>Set experimental quantizer modulation.
3087 <dt> ‘<samp>rc_override_count <var>integer</var></samp>’</dt>
3088 <dt> ‘<samp>rc_eq <var>string</var> (<em>encoding,video</em>)</samp>’</dt>
3089 <dd><p>Set rate control equation. When computing the expression, besides the
3090 standard functions defined in the section ’Expression Evaluation’, 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
3097 <dt> ‘<samp>maxrate <var>integer</var> (<em>encoding,audio,video</em>)</samp>’</dt>
3098 <dd><p>Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
3101 <dt> ‘<samp>minrate <var>integer</var> (<em>encoding,audio,video</em>)</samp>’</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.
3106 <dt> ‘<samp>bufsize <var>integer</var> (<em>encoding,audio,video</em>)</samp>’</dt>
3107 <dd><p>Set ratecontrol buffer size (in bits).
3110 <dt> ‘<samp>rc_buf_aggressivity <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3111 <dd><p>Currently useless.
3114 <dt> ‘<samp>i_qfactor <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3115 <dd><p>Set QP factor between P and I frames.
3118 <dt> ‘<samp>i_qoffset <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3119 <dd><p>Set QP offset between P and I frames.
3122 <dt> ‘<samp>rc_init_cplx <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3123 <dd><p>Set initial complexity for 1-pass encoding.
3126 <dt> ‘<samp>dct <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3127 <dd><p>Set DCT algorithm.
3130 </p><dl compact="compact">
3131 <dt> ‘<samp>auto</samp>’</dt>
3132 <dd><p>autoselect a good one (default)
3134 <dt> ‘<samp>fastint</samp>’</dt>
3137 <dt> ‘<samp>int</samp>’</dt>
3138 <dd><p>accurate integer
3140 <dt> ‘<samp>mmx</samp>’</dt>
3141 <dt> ‘<samp>altivec</samp>’</dt>
3142 <dt> ‘<samp>faan</samp>’</dt>
3143 <dd><p>floating point AAN DCT
3148 <dt> ‘<samp>lumi_mask <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3149 <dd><p>Compress bright areas stronger than medium ones.
3152 <dt> ‘<samp>tcplx_mask <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3153 <dd><p>Set temporal complexity masking.
3156 <dt> ‘<samp>scplx_mask <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3157 <dd><p>Set spatial complexity masking.
3160 <dt> ‘<samp>p_mask <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3161 <dd><p>Set inter masking.
3164 <dt> ‘<samp>dark_mask <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3165 <dd><p>Compress dark areas stronger than medium ones.
3168 <dt> ‘<samp>idct <var>integer</var> (<em>decoding/encoding,video</em>)</samp>’</dt>
3169 <dd><p>Select IDCT implementation.
3172 </p><dl compact="compact">
3173 <dt> ‘<samp>auto</samp>’</dt>
3174 <dt> ‘<samp>int</samp>’</dt>
3175 <dt> ‘<samp>simple</samp>’</dt>
3176 <dt> ‘<samp>simplemmx</samp>’</dt>
3177 <dt> ‘<samp>arm</samp>’</dt>
3178 <dt> ‘<samp>altivec</samp>’</dt>
3179 <dt> ‘<samp>sh4</samp>’</dt>
3180 <dt> ‘<samp>simplearm</samp>’</dt>
3181 <dt> ‘<samp>simplearmv5te</samp>’</dt>
3182 <dt> ‘<samp>simplearmv6</samp>’</dt>
3183 <dt> ‘<samp>simpleneon</samp>’</dt>
3184 <dt> ‘<samp>simplealpha</samp>’</dt>
3185 <dt> ‘<samp>ipp</samp>’</dt>
3186 <dt> ‘<samp>xvidmmx</samp>’</dt>
3187 <dt> ‘<samp>faani</samp>’</dt>
3188 <dd><p>floating point AAN IDCT
3193 <dt> ‘<samp>slice_count <var>integer</var></samp>’</dt>
3194 <dt> ‘<samp>ec <var>flags</var> (<em>decoding,video</em>)</samp>’</dt>
3195 <dd><p>Set error concealment strategy.
3198 </p><dl compact="compact">
3199 <dt> ‘<samp>guess_mvs</samp>’</dt>
3200 <dd><p>iterative motion vector (MV) search (slow)
3202 <dt> ‘<samp>deblock</samp>’</dt>
3203 <dd><p>use strong deblock filter for damaged MBs
3208 <dt> ‘<samp>bits_per_coded_sample <var>integer</var></samp>’</dt>
3209 <dt> ‘<samp>pred <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3210 <dd><p>Set prediction method.
3213 </p><dl compact="compact">
3214 <dt> ‘<samp>left</samp>’</dt>
3215 <dt> ‘<samp>plane</samp>’</dt>
3216 <dt> ‘<samp>median</samp>’</dt>
3220 <dt> ‘<samp>aspect <var>rational number</var> (<em>encoding,video</em>)</samp>’</dt>
3221 <dd><p>Set sample aspect ratio.
3224 <dt> ‘<samp>debug <var>flags</var> (<em>decoding/encoding,audio,video,subtitles</em>)</samp>’</dt>
3225 <dd><p>Print specific debug info.
3228 </p><dl compact="compact">
3229 <dt> ‘<samp>pict</samp>’</dt>
3232 <dt> ‘<samp>rc</samp>’</dt>
3235 <dt> ‘<samp>bitstream</samp>’</dt>
3236 <dt> ‘<samp>mb_type</samp>’</dt>
3237 <dd><p>macroblock (MB) type
3239 <dt> ‘<samp>qp</samp>’</dt>
3240 <dd><p>per-block quantization parameter (QP)
3242 <dt> ‘<samp>mv</samp>’</dt>
3243 <dd><p>motion vector
3245 <dt> ‘<samp>dct_coeff</samp>’</dt>
3246 <dt> ‘<samp>skip</samp>’</dt>
3247 <dt> ‘<samp>startcode</samp>’</dt>
3248 <dt> ‘<samp>pts</samp>’</dt>
3249 <dt> ‘<samp>er</samp>’</dt>
3250 <dd><p>error recognition
3252 <dt> ‘<samp>mmco</samp>’</dt>
3253 <dd><p>memory management control operations (H.264)
3255 <dt> ‘<samp>bugs</samp>’</dt>
3256 <dt> ‘<samp>vis_qp</samp>’</dt>
3257 <dd><p>visualize quantization parameter (QP), lower QP are tinted greener
3259 <dt> ‘<samp>vis_mb_type</samp>’</dt>
3260 <dd><p>visualize block types
3262 <dt> ‘<samp>buffers</samp>’</dt>
3263 <dd><p>picture buffer allocations
3265 <dt> ‘<samp>thread_ops</samp>’</dt>
3266 <dd><p>threading operations
3271 <dt> ‘<samp>vismv <var>integer</var> (<em>decoding,video</em>)</samp>’</dt>
3272 <dd><p>Visualize motion vectors (MVs).
3275 </p><dl compact="compact">
3276 <dt> ‘<samp>pf</samp>’</dt>
3277 <dd><p>forward predicted MVs of P-frames
3279 <dt> ‘<samp>bf</samp>’</dt>
3280 <dd><p>forward predicted MVs of B-frames
3282 <dt> ‘<samp>bb</samp>’</dt>
3283 <dd><p>backward predicted MVs of B-frames
3288 <dt> ‘<samp>cmp <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3289 <dd><p>Set full pel me compare function.
3292 </p><dl compact="compact">
3293 <dt> ‘<samp>sad</samp>’</dt>
3294 <dd><p>sum of absolute differences, fast (default)
3296 <dt> ‘<samp>sse</samp>’</dt>
3297 <dd><p>sum of squared errors
3299 <dt> ‘<samp>satd</samp>’</dt>
3300 <dd><p>sum of absolute Hadamard transformed differences
3302 <dt> ‘<samp>dct</samp>’</dt>
3303 <dd><p>sum of absolute DCT transformed differences
3305 <dt> ‘<samp>psnr</samp>’</dt>
3306 <dd><p>sum of squared quantization errors (avoid, low quality)
3308 <dt> ‘<samp>bit</samp>’</dt>
3309 <dd><p>number of bits needed for the block
3311 <dt> ‘<samp>rd</samp>’</dt>
3312 <dd><p>rate distortion optimal, slow
3314 <dt> ‘<samp>zero</samp>’</dt>
3317 <dt> ‘<samp>vsad</samp>’</dt>
3318 <dd><p>sum of absolute vertical differences
3320 <dt> ‘<samp>vsse</samp>’</dt>
3321 <dd><p>sum of squared vertical differences
3323 <dt> ‘<samp>nsse</samp>’</dt>
3324 <dd><p>noise preserving sum of squared differences
3326 <dt> ‘<samp>w53</samp>’</dt>
3327 <dd><p>5/3 wavelet, only used in snow
3329 <dt> ‘<samp>w97</samp>’</dt>
3330 <dd><p>9/7 wavelet, only used in snow
3332 <dt> ‘<samp>dctmax</samp>’</dt>
3333 <dt> ‘<samp>chroma</samp>’</dt>
3337 <dt> ‘<samp>subcmp <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3338 <dd><p>Set sub pel me compare function.
3341 </p><dl compact="compact">
3342 <dt> ‘<samp>sad</samp>’</dt>
3343 <dd><p>sum of absolute differences, fast (default)
3345 <dt> ‘<samp>sse</samp>’</dt>
3346 <dd><p>sum of squared errors
3348 <dt> ‘<samp>satd</samp>’</dt>
3349 <dd><p>sum of absolute Hadamard transformed differences
3351 <dt> ‘<samp>dct</samp>’</dt>
3352 <dd><p>sum of absolute DCT transformed differences
3354 <dt> ‘<samp>psnr</samp>’</dt>
3355 <dd><p>sum of squared quantization errors (avoid, low quality)
3357 <dt> ‘<samp>bit</samp>’</dt>
3358 <dd><p>number of bits needed for the block
3360 <dt> ‘<samp>rd</samp>’</dt>
3361 <dd><p>rate distortion optimal, slow
3363 <dt> ‘<samp>zero</samp>’</dt>
3366 <dt> ‘<samp>vsad</samp>’</dt>
3367 <dd><p>sum of absolute vertical differences
3369 <dt> ‘<samp>vsse</samp>’</dt>
3370 <dd><p>sum of squared vertical differences
3372 <dt> ‘<samp>nsse</samp>’</dt>
3373 <dd><p>noise preserving sum of squared differences
3375 <dt> ‘<samp>w53</samp>’</dt>
3376 <dd><p>5/3 wavelet, only used in snow
3378 <dt> ‘<samp>w97</samp>’</dt>
3379 <dd><p>9/7 wavelet, only used in snow
3381 <dt> ‘<samp>dctmax</samp>’</dt>
3382 <dt> ‘<samp>chroma</samp>’</dt>
3386 <dt> ‘<samp>mbcmp <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3387 <dd><p>Set macroblock compare function.
3390 </p><dl compact="compact">
3391 <dt> ‘<samp>sad</samp>’</dt>
3392 <dd><p>sum of absolute differences, fast (default)
3394 <dt> ‘<samp>sse</samp>’</dt>
3395 <dd><p>sum of squared errors
3397 <dt> ‘<samp>satd</samp>’</dt>
3398 <dd><p>sum of absolute Hadamard transformed differences
3400 <dt> ‘<samp>dct</samp>’</dt>
3401 <dd><p>sum of absolute DCT transformed differences
3403 <dt> ‘<samp>psnr</samp>’</dt>
3404 <dd><p>sum of squared quantization errors (avoid, low quality)
3406 <dt> ‘<samp>bit</samp>’</dt>
3407 <dd><p>number of bits needed for the block
3409 <dt> ‘<samp>rd</samp>’</dt>
3410 <dd><p>rate distortion optimal, slow
3412 <dt> ‘<samp>zero</samp>’</dt>
3415 <dt> ‘<samp>vsad</samp>’</dt>
3416 <dd><p>sum of absolute vertical differences
3418 <dt> ‘<samp>vsse</samp>’</dt>
3419 <dd><p>sum of squared vertical differences
3421 <dt> ‘<samp>nsse</samp>’</dt>
3422 <dd><p>noise preserving sum of squared differences
3424 <dt> ‘<samp>w53</samp>’</dt>
3425 <dd><p>5/3 wavelet, only used in snow
3427 <dt> ‘<samp>w97</samp>’</dt>
3428 <dd><p>9/7 wavelet, only used in snow
3430 <dt> ‘<samp>dctmax</samp>’</dt>
3431 <dt> ‘<samp>chroma</samp>’</dt>
3435 <dt> ‘<samp>ildctcmp <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3436 <dd><p>Set interlaced dct compare function.
3439 </p><dl compact="compact">
3440 <dt> ‘<samp>sad</samp>’</dt>
3441 <dd><p>sum of absolute differences, fast (default)
3443 <dt> ‘<samp>sse</samp>’</dt>
3444 <dd><p>sum of squared errors
3446 <dt> ‘<samp>satd</samp>’</dt>
3447 <dd><p>sum of absolute Hadamard transformed differences
3449 <dt> ‘<samp>dct</samp>’</dt>
3450 <dd><p>sum of absolute DCT transformed differences
3452 <dt> ‘<samp>psnr</samp>’</dt>
3453 <dd><p>sum of squared quantization errors (avoid, low quality)
3455 <dt> ‘<samp>bit</samp>’</dt>
3456 <dd><p>number of bits needed for the block
3458 <dt> ‘<samp>rd</samp>’</dt>
3459 <dd><p>rate distortion optimal, slow
3461 <dt> ‘<samp>zero</samp>’</dt>
3464 <dt> ‘<samp>vsad</samp>’</dt>
3465 <dd><p>sum of absolute vertical differences
3467 <dt> ‘<samp>vsse</samp>’</dt>
3468 <dd><p>sum of squared vertical differences
3470 <dt> ‘<samp>nsse</samp>’</dt>
3471 <dd><p>noise preserving sum of squared differences
3473 <dt> ‘<samp>w53</samp>’</dt>
3474 <dd><p>5/3 wavelet, only used in snow
3476 <dt> ‘<samp>w97</samp>’</dt>
3477 <dd><p>9/7 wavelet, only used in snow
3479 <dt> ‘<samp>dctmax</samp>’</dt>
3480 <dt> ‘<samp>chroma</samp>’</dt>
3484 <dt> ‘<samp>dia_size <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3485 <dd><p>Set diamond type & size for motion estimation.
3488 <dt> ‘<samp>last_pred <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3489 <dd><p>Set amount of motion predictors from the previous frame.
3492 <dt> ‘<samp>preme <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3493 <dd><p>Set pre motion estimation.
3496 <dt> ‘<samp>precmp <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3497 <dd><p>Set pre motion estimation compare function.
3500 </p><dl compact="compact">
3501 <dt> ‘<samp>sad</samp>’</dt>
3502 <dd><p>sum of absolute differences, fast (default)
3504 <dt> ‘<samp>sse</samp>’</dt>
3505 <dd><p>sum of squared errors
3507 <dt> ‘<samp>satd</samp>’</dt>
3508 <dd><p>sum of absolute Hadamard transformed differences
3510 <dt> ‘<samp>dct</samp>’</dt>
3511 <dd><p>sum of absolute DCT transformed differences
3513 <dt> ‘<samp>psnr</samp>’</dt>
3514 <dd><p>sum of squared quantization errors (avoid, low quality)
3516 <dt> ‘<samp>bit</samp>’</dt>
3517 <dd><p>number of bits needed for the block
3519 <dt> ‘<samp>rd</samp>’</dt>
3520 <dd><p>rate distortion optimal, slow
3522 <dt> ‘<samp>zero</samp>’</dt>
3525 <dt> ‘<samp>vsad</samp>’</dt>
3526 <dd><p>sum of absolute vertical differences
3528 <dt> ‘<samp>vsse</samp>’</dt>
3529 <dd><p>sum of squared vertical differences
3531 <dt> ‘<samp>nsse</samp>’</dt>
3532 <dd><p>noise preserving sum of squared differences
3534 <dt> ‘<samp>w53</samp>’</dt>
3535 <dd><p>5/3 wavelet, only used in snow
3537 <dt> ‘<samp>w97</samp>’</dt>
3538 <dd><p>9/7 wavelet, only used in snow
3540 <dt> ‘<samp>dctmax</samp>’</dt>
3541 <dt> ‘<samp>chroma</samp>’</dt>
3545 <dt> ‘<samp>pre_dia_size <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3546 <dd><p>Set diamond type & size for motion estimation pre-pass.
3549 <dt> ‘<samp>subq <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3550 <dd><p>Set sub pel motion estimation quality.
3553 <dt> ‘<samp>dtg_active_format <var>integer</var></samp>’</dt>
3554 <dt> ‘<samp>me_range <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3555 <dd><p>Set limit motion vectors range (1023 for DivX player).
3558 <dt> ‘<samp>ibias <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3559 <dd><p>Set intra quant bias.
3562 <dt> ‘<samp>pbias <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3563 <dd><p>Set inter quant bias.
3566 <dt> ‘<samp>color_table_id <var>integer</var></samp>’</dt>
3567 <dt> ‘<samp>global_quality <var>integer</var> (<em>encoding,audio,video</em>)</samp>’</dt>
3568 <dt> ‘<samp>coder <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3571 </p><dl compact="compact">
3572 <dt> ‘<samp>vlc</samp>’</dt>
3573 <dd><p>variable length coder / huffman coder
3575 <dt> ‘<samp>ac</samp>’</dt>
3576 <dd><p>arithmetic coder
3578 <dt> ‘<samp>raw</samp>’</dt>
3579 <dd><p>raw (no encoding)
3581 <dt> ‘<samp>rle</samp>’</dt>
3582 <dd><p>run-length coder
3584 <dt> ‘<samp>deflate</samp>’</dt>
3585 <dd><p>deflate-based coder
3590 <dt> ‘<samp>context <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3591 <dd><p>Set context model.
3594 <dt> ‘<samp>slice_flags <var>integer</var></samp>’</dt>
3595 <dt> ‘<samp>xvmc_acceleration <var>integer</var></samp>’</dt>
3596 <dt> ‘<samp>mbd <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3597 <dd><p>Set macroblock decision algorithm (high quality mode).
3600 </p><dl compact="compact">
3601 <dt> ‘<samp>simple</samp>’</dt>
3602 <dd><p>use mbcmp (default)
3604 <dt> ‘<samp>bits</samp>’</dt>
3605 <dd><p>use fewest bits
3607 <dt> ‘<samp>rd</samp>’</dt>
3608 <dd><p>use best rate distortion
3613 <dt> ‘<samp>stream_codec_tag <var>integer</var></samp>’</dt>
3614 <dt> ‘<samp>sc_threshold <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3615 <dd><p>Set scene change threshold.
3618 <dt> ‘<samp>lmin <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3619 <dd><p>Set min lagrange factor (VBR).
3622 <dt> ‘<samp>lmax <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3623 <dd><p>Set max lagrange factor (VBR).
3626 <dt> ‘<samp>nr <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3627 <dd><p>Set noise reduction.
3630 <dt> ‘<samp>rc_init_occupancy <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3631 <dd><p>Set number of bits which should be loaded into the rc buffer before
3635 <dt> ‘<samp>flags2 <var>flags</var> (<em>decoding/encoding,audio,video</em>)</samp>’</dt>
3638 </p><dl compact="compact">
3639 <dt> ‘<samp>fast</samp>’</dt>
3640 <dd><p>Allow non spec compliant speedup tricks.
3642 <dt> ‘<samp>sgop</samp>’</dt>
3643 <dd><p>Deprecated, use mpegvideo private options instead.
3645 <dt> ‘<samp>noout</samp>’</dt>
3646 <dd><p>Skip bitstream encoding.
3648 <dt> ‘<samp>ignorecrop</samp>’</dt>
3649 <dd><p>Ignore cropping information from sps.
3651 <dt> ‘<samp>local_header</samp>’</dt>
3652 <dd><p>Place global headers at every keyframe instead of in extradata.
3654 <dt> ‘<samp>chunks</samp>’</dt>
3655 <dd><p>Frame data might be split into multiple chunks.
3657 <dt> ‘<samp>showall</samp>’</dt>
3658 <dd><p>Show all frames before the first keyframe.
3660 <dt> ‘<samp>skiprd</samp>’</dt>
3661 <dd><p>Deprecated, use mpegvideo private options instead.
3666 <dt> ‘<samp>error <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3667 <dt> ‘<samp>qns <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3668 <dd><p>Deprecated, use mpegvideo private options instead.
3671 <dt> ‘<samp>threads <var>integer</var> (<em>decoding/encoding,video</em>)</samp>’</dt>
3674 </p><dl compact="compact">
3675 <dt> ‘<samp>auto</samp>’</dt>
3676 <dd><p>detect a good number of threads
3681 <dt> ‘<samp>me_threshold <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3682 <dd><p>Set motion estimation threshold.
3685 <dt> ‘<samp>mb_threshold <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3686 <dd><p>Set macroblock threshold.
3689 <dt> ‘<samp>dc <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3690 <dd><p>Set intra_dc_precision.
3693 <dt> ‘<samp>nssew <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3694 <dd><p>Set nsse weight.
3697 <dt> ‘<samp>skip_top <var>integer</var> (<em>decoding,video</em>)</samp>’</dt>
3698 <dd><p>Set number of macroblock rows at the top which are skipped.
3701 <dt> ‘<samp>skip_bottom <var>integer</var> (<em>decoding,video</em>)</samp>’</dt>
3702 <dd><p>Set number of macroblock rows at the bottom which are skipped.
3705 <dt> ‘<samp>profile <var>integer</var> (<em>encoding,audio,video</em>)</samp>’</dt>
3708 </p><dl compact="compact">
3709 <dt> ‘<samp>unknown</samp>’</dt>
3710 <dt> ‘<samp>aac_main</samp>’</dt>
3711 <dt> ‘<samp>aac_low</samp>’</dt>
3712 <dt> ‘<samp>aac_ssr</samp>’</dt>
3713 <dt> ‘<samp>aac_ltp</samp>’</dt>
3714 <dt> ‘<samp>aac_he</samp>’</dt>
3715 <dt> ‘<samp>aac_he_v2</samp>’</dt>
3716 <dt> ‘<samp>aac_ld</samp>’</dt>
3717 <dt> ‘<samp>aac_eld</samp>’</dt>
3718 <dt> ‘<samp>mpeg2_aac_low</samp>’</dt>
3719 <dt> ‘<samp>mpeg2_aac_he</samp>’</dt>
3720 <dt> ‘<samp>dts</samp>’</dt>
3721 <dt> ‘<samp>dts_es</samp>’</dt>
3722 <dt> ‘<samp>dts_96_24</samp>’</dt>
3723 <dt> ‘<samp>dts_hd_hra</samp>’</dt>
3724 <dt> ‘<samp>dts_hd_ma</samp>’</dt>
3728 <dt> ‘<samp>level <var>integer</var> (<em>encoding,audio,video</em>)</samp>’</dt>
3731 </p><dl compact="compact">
3732 <dt> ‘<samp>unknown</samp>’</dt>
3736 <dt> ‘<samp>lowres <var>integer</var> (<em>decoding,audio,video</em>)</samp>’</dt>
3737 <dd><p>Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
3740 <dt> ‘<samp>skip_threshold <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3741 <dd><p>Set frame skip threshold.
3744 <dt> ‘<samp>skip_factor <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3745 <dd><p>Set frame skip factor.
3748 <dt> ‘<samp>skip_exp <var>integer</var> (<em>encoding,video</em>)</samp>’</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.
3755 <dt> ‘<samp>skipcmp <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3756 <dd><p>Set frame skip compare function.
3759 </p><dl compact="compact">
3760 <dt> ‘<samp>sad</samp>’</dt>
3761 <dd><p>sum of absolute differences, fast (default)
3763 <dt> ‘<samp>sse</samp>’</dt>
3764 <dd><p>sum of squared errors
3766 <dt> ‘<samp>satd</samp>’</dt>
3767 <dd><p>sum of absolute Hadamard transformed differences
3769 <dt> ‘<samp>dct</samp>’</dt>
3770 <dd><p>sum of absolute DCT transformed differences
3772 <dt> ‘<samp>psnr</samp>’</dt>
3773 <dd><p>sum of squared quantization errors (avoid, low quality)
3775 <dt> ‘<samp>bit</samp>’</dt>
3776 <dd><p>number of bits needed for the block
3778 <dt> ‘<samp>rd</samp>’</dt>
3779 <dd><p>rate distortion optimal, slow
3781 <dt> ‘<samp>zero</samp>’</dt>
3784 <dt> ‘<samp>vsad</samp>’</dt>
3785 <dd><p>sum of absolute vertical differences
3787 <dt> ‘<samp>vsse</samp>’</dt>
3788 <dd><p>sum of squared vertical differences
3790 <dt> ‘<samp>nsse</samp>’</dt>
3791 <dd><p>noise preserving sum of squared differences
3793 <dt> ‘<samp>w53</samp>’</dt>
3794 <dd><p>5/3 wavelet, only used in snow
3796 <dt> ‘<samp>w97</samp>’</dt>
3797 <dd><p>9/7 wavelet, only used in snow
3799 <dt> ‘<samp>dctmax</samp>’</dt>
3800 <dt> ‘<samp>chroma</samp>’</dt>
3804 <dt> ‘<samp>border_mask <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3805 <dd><p>Increase the quantizer for macroblocks close to borders.
3808 <dt> ‘<samp>mblmin <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3809 <dd><p>Set min macroblock lagrange factor (VBR).
3812 <dt> ‘<samp>mblmax <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3813 <dd><p>Set max macroblock lagrange factor (VBR).
3816 <dt> ‘<samp>mepc <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3817 <dd><p>Set motion estimation bitrate penalty compensation (1.0 = 256).
3820 <dt> ‘<samp>skip_loop_filter <var>integer</var> (<em>decoding,video</em>)</samp>’</dt>
3821 <dt> ‘<samp>skip_idct <var>integer</var> (<em>decoding,video</em>)</samp>’</dt>
3822 <dt> ‘<samp>skip_frame <var>integer</var> (<em>decoding,video</em>)</samp>’</dt>
3824 <p>Make decoder discard processing depending on the frame type selected
3825 by the option value.
3827 <p>‘<samp>skip_loop_filter</samp>’ skips frame loop filtering, ‘<samp>skip_idct</samp>’
3828 skips frame IDCT/dequantization, ‘<samp>skip_frame</samp>’ skips decoding.
3831 </p><dl compact="compact">
3832 <dt> ‘<samp>none</samp>’</dt>
3833 <dd><p>Discard no frame.
3836 <dt> ‘<samp>default</samp>’</dt>
3837 <dd><p>Discard useless frames like 0-sized frames.
3840 <dt> ‘<samp>noref</samp>’</dt>
3841 <dd><p>Discard all non-reference frames.
3844 <dt> ‘<samp>bidir</samp>’</dt>
3845 <dd><p>Discard all bidirectional frames.
3848 <dt> ‘<samp>nokey</samp>’</dt>
3849 <dd><p>Discard all frames excepts keyframes.
3852 <dt> ‘<samp>all</samp>’</dt>
3853 <dd><p>Discard all frames.
3857 <p>Default value is ‘<samp>default</samp>’.
3860 <dt> ‘<samp>bidir_refine <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3861 <dd><p>Refine the two motion vectors used in bidirectional macroblocks.
3864 <dt> ‘<samp>brd_scale <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3865 <dd><p>Downscale frames for dynamic B-frame decision.
3868 <dt> ‘<samp>keyint_min <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3869 <dd><p>Set minimum interval between IDR-frames.
3872 <dt> ‘<samp>refs <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3873 <dd><p>Set reference frames to consider for motion compensation.
3876 <dt> ‘<samp>chromaoffset <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3877 <dd><p>Set chroma qp offset from luma.
3880 <dt> ‘<samp>trellis <var>integer</var> (<em>encoding,audio,video</em>)</samp>’</dt>
3881 <dd><p>Set rate-distortion optimal quantization.
3884 <dt> ‘<samp>sc_factor <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3885 <dd><p>Set value multiplied by qscale for each frame and added to
3889 <dt> ‘<samp>mv0_threshold <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3890 <dt> ‘<samp>b_sensitivity <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3891 <dd><p>Adjust sensitivity of b_frame_strategy 1.
3894 <dt> ‘<samp>compression_level <var>integer</var> (<em>encoding,audio,video</em>)</samp>’</dt>
3895 <dt> ‘<samp>min_prediction_order <var>integer</var> (<em>encoding,audio</em>)</samp>’</dt>
3896 <dt> ‘<samp>max_prediction_order <var>integer</var> (<em>encoding,audio</em>)</samp>’</dt>
3897 <dt> ‘<samp>timecode_frame_start <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3898 <dd><p>Set GOP timecode frame start number, in non drop frame format.
3901 <dt> ‘<samp>request_channels <var>integer</var> (<em>decoding,audio</em>)</samp>’</dt>
3902 <dd><p>Set desired number of audio channels.
3905 <dt> ‘<samp>bits_per_raw_sample <var>integer</var></samp>’</dt>
3906 <dt> ‘<samp>channel_layout <var>integer</var> (<em>decoding/encoding,audio</em>)</samp>’</dt>
3910 <dt> ‘<samp>request_channel_layout <var>integer</var> (<em>decoding,audio</em>)</samp>’</dt>
3914 <dt> ‘<samp>rc_max_vbv_use <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3915 <dt> ‘<samp>rc_min_vbv_use <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3916 <dt> ‘<samp>ticks_per_frame <var>integer</var> (<em>decoding/encoding,audio,video</em>)</samp>’</dt>
3917 <dt> ‘<samp>color_primaries <var>integer</var> (<em>decoding/encoding,video</em>)</samp>’</dt>
3918 <dt> ‘<samp>color_trc <var>integer</var> (<em>decoding/encoding,video</em>)</samp>’</dt>
3919 <dt> ‘<samp>colorspace <var>integer</var> (<em>decoding/encoding,video</em>)</samp>’</dt>
3920 <dt> ‘<samp>color_range <var>integer</var> (<em>decoding/encoding,video</em>)</samp>’</dt>
3921 <dt> ‘<samp>chroma_sample_location <var>integer</var> (<em>decoding/encoding,video</em>)</samp>’</dt>
3922 <dt> ‘<samp>log_level_offset <var>integer</var></samp>’</dt>
3923 <dd><p>Set the log level offset.
3926 <dt> ‘<samp>slices <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3927 <dd><p>Number of slices, used in parallelized encoding.
3930 <dt> ‘<samp>thread_type <var>flags</var> (<em>decoding/encoding,video</em>)</samp>’</dt>
3931 <dd><p>Select multithreading type.
3934 </p><dl compact="compact">
3935 <dt> ‘<samp>slice</samp>’</dt>
3936 <dt> ‘<samp>frame</samp>’</dt>
3939 <dt> ‘<samp>audio_service_type <var>integer</var> (<em>encoding,audio</em>)</samp>’</dt>
3940 <dd><p>Set audio service type.
3943 </p><dl compact="compact">
3944 <dt> ‘<samp>ma</samp>’</dt>
3945 <dd><p>Main Audio Service
3947 <dt> ‘<samp>ef</samp>’</dt>
3950 <dt> ‘<samp>vi</samp>’</dt>
3951 <dd><p>Visually Impaired
3953 <dt> ‘<samp>hi</samp>’</dt>
3954 <dd><p>Hearing Impaired
3956 <dt> ‘<samp>di</samp>’</dt>
3959 <dt> ‘<samp>co</samp>’</dt>
3962 <dt> ‘<samp>em</samp>’</dt>
3965 <dt> ‘<samp>vo</samp>’</dt>
3968 <dt> ‘<samp>ka</samp>’</dt>
3974 <dt> ‘<samp>request_sample_fmt <var>sample_fmt</var> (<em>decoding,audio</em>)</samp>’</dt>
3975 <dd><p>Set sample format audio decoders should prefer. Default value is
3979 <dt> ‘<samp>pkt_timebase <var>rational number</var></samp>’</dt>
3980 <dt> ‘<samp>sub_charenc <var>encoding</var> (<em>decoding,subtitles</em>)</samp>’</dt>
3981 <dd><p>Set the input subtitles character encoding.
3984 <dt> ‘<samp>field_order <var>field_order</var> (<em>video</em>)</samp>’</dt>
3985 <dd><p>Set/override the field order of the video.
3987 </p><dl compact="compact">
3988 <dt> ‘<samp>progressive</samp>’</dt>
3989 <dd><p>Progressive video
3991 <dt> ‘<samp>tt</samp>’</dt>
3992 <dd><p>Interlaced video, top field coded and displayed first
3994 <dt> ‘<samp>bb</samp>’</dt>
3995 <dd><p>Interlaced video, bottom field coded and displayed first
3997 <dt> ‘<samp>tb</samp>’</dt>
3998 <dd><p>Interlaced video, top coded first, bottom displayed first
4000 <dt> ‘<samp>bt</samp>’</dt>
4001 <dd><p>Interlaced video, bottom coded first, top displayed first
4006 <dt> ‘<samp>skip_alpha <var>integer</var> (<em>decoding,video</em>)</samp>’</dt>
4007 <dd><p>Set to 1 to disable processing alpha (transparency). This works like the
4008 ‘<samp>gray</samp>’ flag in the ‘<samp>flags</samp>’ option which skips chroma information
4009 instead of alpha. Default is 0.
4014 <a name="Decoders"></a>
4015 <h1 class="chapter"><a href="ffplay-all.html#toc-Decoders">8. Decoders</a></h1>
4017 <p>Decoders are configured elements in FFmpeg which allow the decoding of
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>.
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>.
4030 <p>The option <code>-decoders</code> of the ff* tools will display the list of
4034 <a name="Video-Decoders"></a>
4035 <h1 class="chapter"><a href="ffplay-all.html#toc-Video-Decoders">9. Video Decoders</a></h1>
4037 <p>A description of some of the currently available video decoders
4040 <a name="rawvideo-1"></a>
4041 <h2 class="section"><a href="ffplay-all.html#toc-rawvideo-1">9.1 rawvideo</a></h2>
4043 <p>Raw video decoder.
4045 <p>This decoder decodes rawvideo streams.
4047 <a name="Options-7"></a>
4048 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-7">9.1.1 Options</a></h3>
4050 <dl compact="compact">
4051 <dt> ‘<samp>top <var>top_field_first</var></samp>’</dt>
4052 <dd><p>Specify the assumed field type of the input video.
4053 </p><dl compact="compact">
4054 <dt> ‘<samp>-1</samp>’</dt>
4055 <dd><p>the video is assumed to be progressive (default)
4057 <dt> ‘<samp>0</samp>’</dt>
4058 <dd><p>bottom-field-first is assumed
4060 <dt> ‘<samp>1</samp>’</dt>
4061 <dd><p>top-field-first is assumed
4069 <a name="Audio-Decoders"></a>
4070 <h1 class="chapter"><a href="ffplay-all.html#toc-Audio-Decoders">10. Audio Decoders</a></h1>
4072 <p>A description of some of the currently available audio decoders
4076 <h2 class="section"><a href="ffplay-all.html#toc-ac3">10.1 ac3</a></h2>
4078 <p>AC-3 audio decoder.
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).
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>
4086 <dl compact="compact">
4087 <dt> ‘<samp>-drc_scale <var>value</var></samp>’</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> ‘<samp>drc_scale == 0</samp>’</dt>
4093 <dd><p>DRC disabled. Produces full range audio.
4095 <dt> ‘<samp>0 < drc_scale <= 1</samp>’</dt>
4096 <dd><p>DRC enabled. Applies a fraction of the stream DRC value.
4097 Audio reproduction is between full range and full compression.
4099 <dt> ‘<samp>drc_scale > 1</samp>’</dt>
4100 <dd><p>DRC enabled. Applies drc_scale asymmetrically.
4101 Loud sounds are fully compressed. Soft sounds are enhanced.
4108 <a name="ffwavesynth"></a>
4109 <h2 class="section"><a href="ffplay-all.html#toc-ffwavesynth">10.2 ffwavesynth</a></h2>
4111 <p>Internal wave synthetizer.
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
4117 <a name="libcelt"></a>
4118 <h2 class="section"><a href="ffplay-all.html#toc-libcelt">10.3 libcelt</a></h2>
4120 <p>libcelt decoder wrapper.
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>.
4126 <a name="libgsm"></a>
4127 <h2 class="section"><a href="ffplay-all.html#toc-libgsm">10.4 libgsm</a></h2>
4129 <p>libgsm decoder wrapper.
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>.
4135 <p>This decoder supports both the ordinary GSM and the Microsoft variant.
4137 <a name="libilbc"></a>
4138 <h2 class="section"><a href="ffplay-all.html#toc-libilbc">10.5 libilbc</a></h2>
4140 <p>libilbc decoder wrapper.
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>.
4147 <a name="Options-11"></a>
4148 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-11">10.5.1 Options</a></h3>
4150 <p>The following option is supported by the libilbc wrapper.
4152 <dl compact="compact">
4153 <dt> ‘<samp>enhance</samp>’</dt>
4155 <p>Enable the enhancement of the decoded audio when set to 1. The default
4156 value is 0 (disabled).
4161 <a name="libopencore_002damrnb"></a>
4162 <h2 class="section"><a href="ffplay-all.html#toc-libopencore_002damrnb">10.6 libopencore-amrnb</a></h2>
4164 <p>libopencore-amrnb decoder wrapper.
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>.
4171 <p>An FFmpeg native decoder for AMR-NB exists, so users can decode AMR-NB
4172 without this library.
4174 <a name="libopencore_002damrwb"></a>
4175 <h2 class="section"><a href="ffplay-all.html#toc-libopencore_002damrwb">10.7 libopencore-amrwb</a></h2>
4177 <p>libopencore-amrwb decoder wrapper.
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>.
4184 <p>An FFmpeg native decoder for AMR-WB exists, so users can decode AMR-WB
4185 without this library.
4187 <a name="libopus"></a>
4188 <h2 class="section"><a href="ffplay-all.html#toc-libopus">10.8 libopus</a></h2>
4190 <p>libopus decoder wrapper.
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>.
4198 <a name="Subtitles-Decoders"></a>
4199 <h1 class="chapter"><a href="ffplay-all.html#toc-Subtitles-Decoders">11. Subtitles Decoders</a></h1>
4201 <a name="dvdsub"></a>
4202 <h2 class="section"><a href="ffplay-all.html#toc-dvdsub">11.1 dvdsub</a></h2>
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.
4207 <a name="Options-10"></a>
4208 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-10">11.1.1 Options</a></h3>
4210 <dl compact="compact">
4211 <dt> ‘<samp>palette</samp>’</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.
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>.
4225 <a name="libzvbi_002dteletext"></a>
4226 <h2 class="section"><a href="ffplay-all.html#toc-libzvbi_002dteletext">11.2 libzvbi-teletext</a></h2>
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>.
4233 <a name="Options-3"></a>
4234 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-3">11.2.1 Options</a></h3>
4236 <dl compact="compact">
4237 <dt> ‘<samp>txt_page</samp>’</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.
4242 <dt> ‘<samp>txt_chop_top</samp>’</dt>
4243 <dd><p>Discards the top teletext line. Default value is 1.
4245 <dt> ‘<samp>txt_format</samp>’</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 "bitmap" for teletext pages, because certain graphics and colors cannot be
4249 expressed in simple text. You might use "text" for teletext based subtitles if
4250 your application can handle simple text based subtitles. Default value is
4253 <dt> ‘<samp>txt_left</samp>’</dt>
4254 <dd><p>X offset of generated bitmaps, default is 0.
4256 <dt> ‘<samp>txt_top</samp>’</dt>
4257 <dd><p>Y offset of generated bitmaps, default is 0.
4259 <dt> ‘<samp>txt_chop_spaces</samp>’</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.
4266 <dt> ‘<samp>txt_duration</samp>’</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.
4270 <dt> ‘<samp>txt_transparent</samp>’</dt>
4271 <dd><p>Force transparent background of the generated teletext bitmaps. Default value
4272 is 0 which means an opaque (black) background.
4276 <a name="Bitstream-Filters"></a>
4277 <h1 class="chapter"><a href="ffplay-all.html#toc-Bitstream-Filters">12. Bitstream Filters</a></h1>
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>.
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>.
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.
4291 <p>Below is a description of the currently available bitstream filters.
4293 <a name="aac_005fadtstoasc"></a>
4294 <h2 class="section"><a href="ffplay-all.html#toc-aac_005fadtstoasc">12.1 aac_adtstoasc</a></h2>
4296 <p>Convert MPEG-2/4 AAC ADTS to MPEG-4 Audio Specific Configuration
4299 <p>This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4
4300 ADTS header and removes the ADTS header.
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.
4305 <a name="chomp"></a>
4306 <h2 class="section"><a href="ffplay-all.html#toc-chomp">12.2 chomp</a></h2>
4308 <p>Remove zero padding at the end of a packet.
4310 <a name="dump_005fextra"></a>
4311 <h2 class="section"><a href="ffplay-all.html#toc-dump_005fextra">12.3 dump_extra</a></h2>
4313 <p>Add extradata to the beginning of the filtered packets.
4315 <p>The additional argument specifies which packets should be filtered.
4316 It accepts the values:
4317 </p><dl compact="compact">
4318 <dt> ‘<samp>a</samp>’</dt>
4319 <dd><p>add extradata to all key packets, but only if <var>local_header</var> is
4320 set in the ‘<samp>flags2</samp>’ codec context field
4323 <dt> ‘<samp>k</samp>’</dt>
4324 <dd><p>add extradata to all key packets
4327 <dt> ‘<samp>e</samp>’</dt>
4328 <dd><p>add extradata to all packets
4332 <p>If not specified it is assumed ‘<samp>k</samp>’.
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> </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>
4341 <a name="h264_005fmp4toannexb"></a>
4342 <h2 class="section"><a href="ffplay-all.html#toc-h264_005fmp4toannexb">12.4 h264_mp4toannexb</a></h2>
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
4348 <p>This is required by some streaming formats, typically the MPEG-2
4349 transport stream format ("mpegts").
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:
4354 <table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
4355 </pre></td></tr></table>
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>
4360 <a name="mjpeg2jpeg"></a>
4361 <h2 class="section"><a href="ffplay-all.html#toc-mjpeg2jpeg">12.6 mjpeg2jpeg</a></h2>
4363 <p>Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
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,
4369 <table><tr><td> </td><td><pre class="example">ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
4370 </pre></td></tr></table>
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>:
4376 <p>Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
4377 commented that "MJPEG, or at least the MJPEG in AVIs having the
4378 MJPG fourcc, is restricted JPEG with a fixed – and *omitted* –
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’t have any idea
4384 how to decompress the data. The exact table necessary is given in
4385 the OpenDML spec."
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.
4391 <table><tr><td> </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>
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>
4399 <a name="movsub"></a>
4400 <h2 class="section"><a href="ffplay-all.html#toc-movsub">12.8 movsub</a></h2>
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>
4405 <a name="noise"></a>
4406 <h2 class="section"><a href="ffplay-all.html#toc-noise">12.10 noise</a></h2>
4408 <a name="remove_005fextra"></a>
4409 <h2 class="section"><a href="ffplay-all.html#toc-remove_005fextra">12.11 remove_extra</a></h2>
4411 <a name="Format-Options"></a>
4412 <h1 class="chapter"><a href="ffplay-all.html#toc-Format-Options">13. Format Options</a></h1>
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
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 ‘<tt>libavutil/opt.h</tt>’ API
4422 for programmatic use.
4424 <p>The list of supported options follows:
4426 <dl compact="compact">
4427 <dt> ‘<samp>avioflags <var>flags</var> (<em>input/output</em>)</samp>’</dt>
4428 <dd><p>Possible values:
4429 </p><dl compact="compact">
4430 <dt> ‘<samp>direct</samp>’</dt>
4431 <dd><p>Reduce buffering.
4436 <dt> ‘<samp>probesize <var>integer</var> (<em>input</em>)</samp>’</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.
4443 <dt> ‘<samp>packetsize <var>integer</var> (<em>output</em>)</samp>’</dt>
4444 <dd><p>Set packet size.
4447 <dt> ‘<samp>fflags <var>flags</var> (<em>input/output</em>)</samp>’</dt>
4448 <dd><p>Set format flags.
4451 </p><dl compact="compact">
4452 <dt> ‘<samp>ignidx</samp>’</dt>
4453 <dd><p>Ignore index.
4455 <dt> ‘<samp>genpts</samp>’</dt>
4456 <dd><p>Generate PTS.
4458 <dt> ‘<samp>nofillin</samp>’</dt>
4459 <dd><p>Do not fill in missing values that can be exactly calculated.
4461 <dt> ‘<samp>noparse</samp>’</dt>
4462 <dd><p>Disable AVParsers, this needs <code>+nofillin</code> too.
4464 <dt> ‘<samp>igndts</samp>’</dt>
4467 <dt> ‘<samp>discardcorrupt</samp>’</dt>
4468 <dd><p>Discard corrupted frames.
4470 <dt> ‘<samp>sortdts</samp>’</dt>
4471 <dd><p>Try to interleave output packets by DTS.
4473 <dt> ‘<samp>keepside</samp>’</dt>
4474 <dd><p>Do not merge side data.
4476 <dt> ‘<samp>latm</samp>’</dt>
4477 <dd><p>Enable RTP MP4A-LATM payload.
4479 <dt> ‘<samp>nobuffer</samp>’</dt>
4480 <dd><p>Reduce the latency introduced by optional buffering
4485 <dt> ‘<samp>seek2any <var>integer</var> (<em>input</em>)</samp>’</dt>
4486 <dd><p>Allow seeking to non-keyframes on demuxer level when supported if set to 1.
4490 <dt> ‘<samp>analyzeduration <var>integer</var> (<em>input</em>)</samp>’</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.
4496 <dt> ‘<samp>cryptokey <var>hexadecimal string</var> (<em>input</em>)</samp>’</dt>
4497 <dd><p>Set decryption key.
4500 <dt> ‘<samp>indexmem <var>integer</var> (<em>input</em>)</samp>’</dt>
4501 <dd><p>Set max memory used for timestamp index (per stream).
4504 <dt> ‘<samp>rtbufsize <var>integer</var> (<em>input</em>)</samp>’</dt>
4505 <dd><p>Set max memory used for buffering real-time frames.
4508 <dt> ‘<samp>fdebug <var>flags</var> (<em>input/output</em>)</samp>’</dt>
4509 <dd><p>Print specific debug info.
4512 </p><dl compact="compact">
4513 <dt> ‘<samp>ts</samp>’</dt>
4517 <dt> ‘<samp>max_delay <var>integer</var> (<em>input/output</em>)</samp>’</dt>
4518 <dd><p>Set maximum muxing or demuxing delay in microseconds.
4521 <dt> ‘<samp>fpsprobesize <var>integer</var> (<em>input</em>)</samp>’</dt>
4522 <dd><p>Set number of frames used to probe fps.
4525 <dt> ‘<samp>audio_preload <var>integer</var> (<em>output</em>)</samp>’</dt>
4526 <dd><p>Set microseconds by which audio packets should be interleaved earlier.
4529 <dt> ‘<samp>chunk_duration <var>integer</var> (<em>output</em>)</samp>’</dt>
4530 <dd><p>Set microseconds for each chunk.
4533 <dt> ‘<samp>chunk_size <var>integer</var> (<em>output</em>)</samp>’</dt>
4534 <dd><p>Set size in bytes for each chunk.
4537 <dt> ‘<samp>err_detect, f_err_detect <var>flags</var> (<em>input</em>)</samp>’</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.
4542 </p><dl compact="compact">
4543 <dt> ‘<samp>crccheck</samp>’</dt>
4544 <dd><p>Verify embedded CRCs.
4546 <dt> ‘<samp>bitstream</samp>’</dt>
4547 <dd><p>Detect bitstream specification deviations.
4549 <dt> ‘<samp>buffer</samp>’</dt>
4550 <dd><p>Detect improper bitstream length.
4552 <dt> ‘<samp>explode</samp>’</dt>
4553 <dd><p>Abort decoding on minor error detection.
4555 <dt> ‘<samp>careful</samp>’</dt>
4556 <dd><p>Consider things that violate the spec and have not been seen in the
4559 <dt> ‘<samp>compliant</samp>’</dt>
4560 <dd><p>Consider all spec non compliancies as errors.
4562 <dt> ‘<samp>aggressive</samp>’</dt>
4563 <dd><p>Consider things that a sane encoder should not do as an error.
4568 <dt> ‘<samp>use_wallclock_as_timestamps <var>integer</var> (<em>input</em>)</samp>’</dt>
4569 <dd><p>Use wallclock as timestamps.
4572 <dt> ‘<samp>avoid_negative_ts <var>integer</var> (<em>output</em>)</samp>’</dt>
4575 </p><dl compact="compact">
4576 <dt> ‘<samp>make_non_negative</samp>’</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.
4581 <dt> ‘<samp>make_zero</samp>’</dt>
4582 <dd><p>Shift timestamps so that the first timestamp is 0.
4584 <dt> ‘<samp>auto (default)</samp>’</dt>
4585 <dd><p>Enables shifting when required by the target format.
4587 <dt> ‘<samp>disabled</samp>’</dt>
4588 <dd><p>Disables shifting of timestamp.
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.
4598 <dt> ‘<samp>skip_initial_bytes <var>integer</var> (<em>input</em>)</samp>’</dt>
4599 <dd><p>Set number of bytes to skip before reading header and frames if set to 1.
4603 <dt> ‘<samp>correct_ts_overflow <var>integer</var> (<em>input</em>)</samp>’</dt>
4604 <dd><p>Correct single timestamp overflows if set to 1. Default is 1.
4607 <dt> ‘<samp>flush_packets <var>integer</var> (<em>output</em>)</samp>’</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.
4613 <dt> ‘<samp>output_ts_offset <var>offset</var> (<em>output</em>)</samp>’</dt>
4614 <dd><p>Set the output time offset.
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>.
4619 <p>The offset is added by the muxer to the output timestamps.
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).
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>
4632 <p>Format stream specifiers allow selection of one or more streams that
4633 match specific properties.
4635 <p>Possible forms of stream specifiers are:
4636 </p><dl compact="compact">
4637 <dt> ‘<samp><var>stream_index</var></samp>’</dt>
4638 <dd><p>Matches the stream with this index.
4641 <dt> ‘<samp><var>stream_type</var>[:<var>stream_index</var>]</samp>’</dt>
4642 <dd><p><var>stream_type</var> is one of following: ’v’ for video, ’a’ for audio,
4643 ’s’ for subtitle, ’d’ for data, and ’t’ 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
4649 <dt> ‘<samp>p:<var>program_id</var>[:<var>stream_index</var>]</samp>’</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.
4655 <dt> ‘<samp>#<var>stream_id</var></samp>’</dt>
4656 <dd><p>Matches the stream by a format-specific ID.
4660 <p>The exact semantics of stream specifiers is defined by the
4661 <code>avformat_match_stream_specifier()</code> function declared in the
4662 ‘<tt>libavformat/avformat.h</tt>’ header.
4664 <a name="Demuxers"></a>
4665 <h1 class="chapter"><a href="ffplay-all.html#toc-Demuxers">14. Demuxers</a></h1>
4667 <p>Demuxers are configured elements in FFmpeg that can read the
4668 multimedia streams from a particular type of file.
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>.
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>.
4679 <p>The option <code>-formats</code> of the ff* tools will display the list of
4682 <p>The description of some of the currently available demuxers follows.
4684 <a name="applehttp"></a>
4685 <h2 class="section"><a href="ffplay-all.html#toc-applehttp">14.1 applehttp</a></h2>
4687 <p>Apple HTTP Live Streaming demuxer.
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 ’a’ or ’v’ 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 "variant_bitrate".
4697 <h2 class="section"><a href="ffplay-all.html#toc-asf">14.2 asf</a></h2>
4699 <p>Advanced Systems Format demuxer.
4701 <p>This demuxer is used to demux ASF files and MMS network streams.
4703 <dl compact="compact">
4704 <dt> ‘<samp>-no_resync_search <var>bool</var></samp>’</dt>
4705 <dd><p>Do not try to resynchronize by looking for a certain optional start code.
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>
4713 <p>Virtual concatenation script demuxer.
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
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
4724 <p>All files must have the same streams (same codecs, same time base, etc.).
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
4732 <a name="Syntax-1"></a>
4733 <h3 class="subsection"><a href="ffplay-all.html#toc-Syntax-1">14.3.1 Syntax</a></h3>
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 ’#’ are ignored. The
4737 following directive is recognized:
4739 <dl compact="compact">
4740 <dt> ‘<samp><code>file <var>path</var></code></samp>’</dt>
4741 <dd><p>Path to a file to read; special characters and spaces must be escaped with
4742 backslash or single quotes.
4744 <p>All subsequent directives apply to that file.
4747 <dt> ‘<samp><code>ffconcat version 1.0</code></samp>’</dt>
4748 <dd><p>Identify the script type and version. It also sets the ‘<samp>safe</samp>’ option
4749 to 1 if it was to its default -1.
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
4756 <dt> ‘<samp><code>duration <var>dur</var></code></samp>’</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.
4761 <p>If the duration is set for all files, then it is possible to seek in the
4762 whole concatenated video.
4767 <a name="Options-2"></a>
4768 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-2">14.3.2 Options</a></h3>
4770 <p>This demuxer accepts the following option:
4772 <dl compact="compact">
4773 <dt> ‘<samp>safe</samp>’</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
4780 <p>If set to 0, any file name is accepted.
4782 <p>The default is -1, it is equivalent to 1 if the format was automatically
4783 probed and 0 otherwise.
4789 <h2 class="section"><a href="ffplay-all.html#toc-flv">14.4 flv</a></h2>
4791 <p>Adobe Flash Video Format demuxer.
4793 <p>This demuxer is used to demux FLV files and RTMP network streams.
4795 <dl compact="compact">
4796 <dt> ‘<samp>-flv_metadata <var>bool</var></samp>’</dt>
4797 <dd><p>Allocate the streams according to the onMetaData array content.
4801 <a name="libgme"></a>
4802 <h2 class="section"><a href="ffplay-all.html#toc-libgme">14.5 libgme</a></h2>
4804 <p>The Game Music Emu library is a collection of video game music file emulators.
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.
4808 <p>Some files have multiple tracks. The demuxer will pick the first track by
4809 default. The ‘<samp>track_index</samp>’ 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.
4813 <p>For very large files, the ‘<samp>max_size</samp>’ option may have to be adjusted.
4815 <a name="libquvi"></a>
4816 <h2 class="section"><a href="ffplay-all.html#toc-libquvi">14.6 libquvi</a></h2>
4818 <p>Play media from Internet services using the quvi project.
4820 <p>The demuxer accepts a ‘<samp>format</samp>’ option to request a specific quality. It
4821 is by default set to <var>best</var>.
4823 <p>See <a href="http://quvi.sourceforge.net/">http://quvi.sourceforge.net/</a> for more information.
4825 <p>FFmpeg needs to be built with <code>--enable-libquvi</code> for this demuxer to be
4828 <a name="image2"></a>
4829 <h2 class="section"><a href="ffplay-all.html#toc-image2">14.7 image2</a></h2>
4831 <p>Image file demuxer.
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>.
4837 <p>The pattern may contain a suffix which is used to automatically
4838 determine the format of the images contained in the files.
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.
4843 <p>This demuxer accepts the following options:
4844 </p><dl compact="compact">
4845 <dt> ‘<samp>framerate</samp>’</dt>
4846 <dd><p>Set the frame rate for the video stream. It defaults to 25.
4848 <dt> ‘<samp>loop</samp>’</dt>
4849 <dd><p>If set to 1, loop over the input. Default value is 0.
4851 <dt> ‘<samp>pattern_type</samp>’</dt>
4852 <dd><p>Select the pattern type used to interpret the provided filename.
4854 <p><var>pattern_type</var> accepts one of the following values.
4855 </p><dl compact="compact">
4856 <dt> ‘<samp>sequence</samp>’</dt>
4857 <dd><p>Select a sequence pattern type, used to specify a sequence of files
4858 indexed by sequential numbers.
4860 <p>A sequence pattern may contain the string "%d" or "%0<var>N</var>d", which
4861 specifies the position of the characters representing a sequential
4862 number in each filename matched by the pattern. If the form
4863 "%d0<var>N</var>d" 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 ’%’ can be
4866 specified in the pattern with the string "%%".
4868 <p>If the sequence pattern contains "%d" or "%0<var>N</var>d", 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.
4874 <p>For example the pattern "img-%03d.bmp" will match a sequence of
4875 filenames of the form ‘<tt>img-001.bmp</tt>’, ‘<tt>img-002.bmp</tt>’, ...,
4876 ‘<tt>img-010.bmp</tt>’, etc.; the pattern "i%%m%%g-%d.jpg" will match a
4877 sequence of filenames of the form ‘<tt>i%m%g-1.jpg</tt>’,
4878 ‘<tt>i%m%g-2.jpg</tt>’, ..., ‘<tt>i%m%g-10.jpg</tt>’, etc.
4880 <p>Note that the pattern must not necessarily contain "%d" or
4881 "%0<var>N</var>d", for example to convert a single image file
4882 ‘<tt>img.jpeg</tt>’ you can employ the command:
4883 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i img.jpeg img.png
4884 </pre></td></tr></table>
4887 <dt> ‘<samp>glob</samp>’</dt>
4888 <dd><p>Select a glob wildcard pattern type.
4890 <p>The pattern is interpreted like a <code>glob()</code> pattern. This is only
4891 selectable if libavformat was compiled with globbing support.
4894 <dt> ‘<samp>glob_sequence <em>(deprecated, will be removed)</em></samp>’</dt>
4895 <dd><p>Select a mixed glob wildcard/sequence pattern.
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 "%", the pattern is
4900 interpreted like a <code>glob()</code> pattern, otherwise it is interpreted
4901 like a sequence pattern.
4903 <p>All glob special characters <code>%*?[]{}</code> must be prefixed
4904 with "%". To escape a literal "%" you shall use "%%".
4906 <p>For example the pattern <code>foo-%*.jpeg</code> will match all the
4907 filenames prefixed by "foo-" and terminating with ".jpeg", and
4908 <code>foo-%?%?%?.jpeg</code> will match all the filenames prefixed with
4909 "foo-", followed by a sequence of three characters, and terminating
4910 with ".jpeg".
4912 <p>This pattern type is deprecated in favor of <var>glob</var> and
4913 <var>sequence</var>.
4917 <p>Default value is <var>glob_sequence</var>.
4919 <dt> ‘<samp>pixel_format</samp>’</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.
4923 <dt> ‘<samp>start_number</samp>’</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.
4927 <dt> ‘<samp>start_number_range</samp>’</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
4932 <dt> ‘<samp>ts_from_file</samp>’</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.
4937 <dt> ‘<samp>video_size</samp>’</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.
4943 <a name="Examples-75"></a>
4944 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-75">14.7.1 Examples</a></h3>
4948 Use <code>ffmpeg</code> for creating a video from the images in the file
4949 sequence ‘<tt>img-001.jpeg</tt>’, ‘<tt>img-002.jpeg</tt>’, ..., assuming an
4950 input frame rate of 10 frames per second:
4951 <table><tr><td> </td><td><pre class="example">ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
4952 </pre></td></tr></table>
4955 As above, but start by reading from a file with index 100 in the sequence:
4956 <table><tr><td> </td><td><pre class="example">ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
4957 </pre></td></tr></table>
4960 Read images matching the "*.png" glob pattern , that is all the files
4961 terminating with the ".png" suffix:
4962 <table><tr><td> </td><td><pre class="example">ffmpeg -framerate 10 -pattern_type glob -i "*.png" out.mkv
4963 </pre></td></tr></table>
4966 <a name="mpegts"></a>
4967 <h2 class="section"><a href="ffplay-all.html#toc-mpegts">14.8 mpegts</a></h2>
4969 <p>MPEG-2 transport stream demuxer.
4971 <dl compact="compact">
4972 <dt> ‘<samp>fix_teletext_pts</samp>’</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.
4980 <a name="rawvideo"></a>
4981 <h2 class="section"><a href="ffplay-all.html#toc-rawvideo">14.9 rawvideo</a></h2>
4983 <p>Raw video demuxer.
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.
4989 <p>This demuxer accepts the following options:
4990 </p><dl compact="compact">
4991 <dt> ‘<samp>framerate</samp>’</dt>
4992 <dd><p>Set input video frame rate. Default value is 25.
4995 <dt> ‘<samp>pixel_format</samp>’</dt>
4996 <dd><p>Set the input video pixel format. Default value is <code>yuv420p</code>.
4999 <dt> ‘<samp>video_size</samp>’</dt>
5000 <dd><p>Set the input video size. This value must be specified explicitly.
5004 <p>For example to read a rawvideo file ‘<tt>input.raw</tt>’ 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
5008 </p><table><tr><td> </td><td><pre class="example">ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
5009 </pre></td></tr></table>
5012 <h2 class="section"><a href="ffplay-all.html#toc-sbg">14.10 sbg</a></h2>
5014 <p>SBaGen script demuxer.
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> </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
5028 </pre></td></tr></table>
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’s clock accuracy, but if the user
5039 somehow pauses the playback or seeks, all times will be shifted accordingly.
5041 <a name="tedcaptions"></a>
5042 <h2 class="section"><a href="ffplay-all.html#toc-tedcaptions">14.11 tedcaptions</a></h2>
5044 <p>JSON captions used for <a href="http://www.ted.com/">TED Talks</a>.
5046 <p>TED does not provide links to the captions, but they can be guessed from the
5047 page. The file ‘<tt>tools/bookmarklets.html</tt>’ from the FFmpeg source tree
5048 contains a bookmarklet to expose them.
5050 <p>This demuxer accepts the following option:
5051 </p><dl compact="compact">
5052 <dt> ‘<samp>start_time</samp>’</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.
5059 <p>Example: convert the captions to a format most players understand:
5060 </p><table><tr><td> </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>
5063 <a name="Metadata"></a>
5064 <h1 class="chapter"><a href="ffplay-all.html#toc-Metadata">15. Metadata</a></h1>
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.
5069 <p>The file format is as follows:
5072 A file consists of a header and a number of metadata tags divided into sections,
5073 each on its own line.
5076 The header is a ’;FFMETADATA’ string, followed by a version number (now 1).
5079 Metadata tags are of the form ’key=value’
5082 Immediately after header follows global metadata
5085 After global metadata there may be sections with per-stream/per-chapter
5089 A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
5090 brackets (’[’, ’]’) and ends with next section or end of file.
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 ’TIMEBASE=num/den’, where num and
5095 den are integers. If the timebase is missing then start/end times are assumed to
5097 Next a chapter section must contain chapter start and end times in form
5098 ’START=num’, ’END=num’, where num is a positive integer.
5101 Empty lines and lines starting with ’;’ or ’#’ are ignored.
5104 Metadata keys or values containing special characters (’=’, ’;’, ’#’, ’\’ and a
5105 newline) must be escaped with a backslash ’\’.
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 ’foo ’, value is ’ bar’).
5112 <p>A ffmetadata file might look like this:
5113 </p><table><tr><td> </td><td><pre class="example">;FFMETADATA1
5116 artist=FFmpeg troll team
5121 #chapter ends at 0:01:00
5127 </pre></td></tr></table>
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.
5133 <p>Extracting an ffmetadata file with ‘<tt>ffmpeg</tt>’ goes as follows:
5134 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
5135 </pre></td></tr></table>
5137 <p>Reinserting edited metadata information from the FFMETADATAFILE file can
5139 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
5140 </pre></td></tr></table>
5142 <a name="Protocols"></a>
5143 <h1 class="chapter"><a href="ffplay-all.html#toc-Protocols">16. Protocols</a></h1>
5145 <p>Protocols are configured elements in FFmpeg that enable access to
5146 resources that require specific protocols.
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 "–list-protocols".
5152 <p>You can disable all the protocols using the configure option
5153 "–disable-protocols", and selectively enable a protocol using the
5154 option "–enable-protocol=<var>PROTOCOL</var>", or you can disable a
5155 particular protocol using the option
5156 "–disable-protocol=<var>PROTOCOL</var>".
5158 <p>The option "-protocols" of the ff* tools will display the list of
5159 supported protocols.
5161 <p>A description of the currently available protocols follows.
5163 <a name="bluray"></a>
5164 <h2 class="section"><a href="ffplay-all.html#toc-bluray">16.1 bluray</a></h2>
5166 <p>Read BluRay playlist.
5168 <p>The accepted options are:
5169 </p><dl compact="compact">
5170 <dt> ‘<samp>angle</samp>’</dt>
5174 <dt> ‘<samp>chapter</samp>’</dt>
5175 <dd><p>Start chapter (1...N)
5178 <dt> ‘<samp>playlist</samp>’</dt>
5179 <dd><p>Playlist to read (BDMV/PLAYLIST/?????.mpls)
5186 <p>Read longest playlist from BluRay mounted to /mnt/bluray:
5187 </p><table><tr><td> </td><td><pre class="example">bluray:/mnt/bluray
5188 </pre></td></tr></table>
5190 <p>Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2:
5191 </p><table><tr><td> </td><td><pre class="example">-playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
5192 </pre></td></tr></table>
5194 <a name="cache"></a>
5195 <h2 class="section"><a href="ffplay-all.html#toc-cache">16.2 cache</a></h2>
5197 <p>Caching wrapper for input stream.
5199 <p>Cache the input stream to temporary file. It brings seeking capability to live streams.
5201 <table><tr><td> </td><td><pre class="example">cache:<var>URL</var>
5202 </pre></td></tr></table>
5204 <a name="concat-3"></a>
5205 <h2 class="section"><a href="ffplay-all.html#toc-concat-3">16.3 concat</a></h2>
5207 <p>Physical concatenation protocol.
5209 <p>Allow to read and seek from many resource in sequence as if they were
5212 <p>A URL accepted by this protocol has the syntax:
5213 </p><table><tr><td> </td><td><pre class="example">concat:<var>URL1</var>|<var>URL2</var>|...|<var>URLN</var>
5214 </pre></td></tr></table>
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
5220 <p>For example to read a sequence of files ‘<tt>split1.mpeg</tt>’,
5221 ‘<tt>split2.mpeg</tt>’, ‘<tt>split3.mpeg</tt>’ with <code>ffplay</code> use the
5223 </p><table><tr><td> </td><td><pre class="example">ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
5224 </pre></td></tr></table>
5226 <p>Note that you may need to escape the character "|" which is special for
5229 <a name="crypto"></a>
5230 <h2 class="section"><a href="ffplay-all.html#toc-crypto">16.4 crypto</a></h2>
5232 <p>AES-encrypted stream reading protocol.
5234 <p>The accepted options are:
5235 </p><dl compact="compact">
5236 <dt> ‘<samp>key</samp>’</dt>
5237 <dd><p>Set the AES decryption key binary block from given hexadecimal representation.
5240 <dt> ‘<samp>iv</samp>’</dt>
5241 <dd><p>Set the AES decryption initialization vector binary block from given hexadecimal representation.
5245 <p>Accepted URL formats:
5246 </p><table><tr><td> </td><td><pre class="example">crypto:<var>URL</var>
5247 crypto+<var>URL</var>
5248 </pre></td></tr></table>
5251 <h2 class="section"><a href="ffplay-all.html#toc-data">16.5 data</a></h2>
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>.
5255 <p>For example, to convert a GIF file given inline with <code>ffmpeg</code>:
5256 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i "data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=" smiley.png
5257 </pre></td></tr></table>
5260 <h2 class="section"><a href="ffplay-all.html#toc-file">16.6 file</a></h2>
5262 <p>File access protocol.
5264 <p>Allow to read from or write to a file.
5266 <p>A file URL can have the form:
5267 </p><table><tr><td> </td><td><pre class="example">file:<var>filename</var>
5268 </pre></td></tr></table>
5270 <p>where <var>filename</var> is the path of the file to read.
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).
5277 <p>For example to read from a file ‘<tt>input.mpeg</tt>’ with <code>ffmpeg</code>
5279 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i file:input.mpeg output.mpeg
5280 </pre></td></tr></table>
5282 <p>This protocol accepts the following options:
5284 <dl compact="compact">
5285 <dt> ‘<samp>truncate</samp>’</dt>
5286 <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
5287 truncating. Default value is 1.
5290 <dt> ‘<samp>blocksize</samp>’</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.
5299 <h2 class="section"><a href="ffplay-all.html#toc-ftp">16.7 ftp</a></h2>
5301 <p>FTP (File Transfer Protocol).
5303 <p>Allow to read from or write to remote resources using FTP protocol.
5305 <p>Following syntax is required.
5306 </p><table><tr><td> </td><td><pre class="example">ftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
5307 </pre></td></tr></table>
5309 <p>This protocol accepts the following options.
5311 <dl compact="compact">
5312 <dt> ‘<samp>timeout</samp>’</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
5318 <dt> ‘<samp>ftp-anonymous-password</samp>’</dt>
5319 <dd><p>Password used when login as anonymous user. Typically an e-mail address
5323 <dt> ‘<samp>ftp-write-seekable</samp>’</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.
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.
5335 <a name="gopher"></a>
5336 <h2 class="section"><a href="ffplay-all.html#toc-gopher">16.8 gopher</a></h2>
5341 <h2 class="section"><a href="ffplay-all.html#toc-hls">16.9 hls</a></h2>
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
5347 The nested protocol is declared by specifying
5348 "+<var>proto</var>" after the hls URI scheme name, where <var>proto</var>
5349 is either "file" or "http".
5351 <table><tr><td> </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>
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
5361 <h2 class="section"><a href="ffplay-all.html#toc-http">16.10 http</a></h2>
5363 <p>HTTP (Hyper Text Transfer Protocol).
5365 <p>This protocol accepts the following options:
5367 <dl compact="compact">
5368 <dt> ‘<samp>seekable</samp>’</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
5375 <dt> ‘<samp>chunked_post</samp>’</dt>
5376 <dd><p>If set to 1 use chunked Transfer-Encoding for posts, default is 1.
5379 <dt> ‘<samp>content_type</samp>’</dt>
5380 <dd><p>Set a specific content type for the POST messages.
5383 <dt> ‘<samp>headers</samp>’</dt>
5384 <dd><p>Set custom HTTP headers, can override built in default headers. The
5385 value must be a string encoding the headers.
5388 <dt> ‘<samp>multiple_requests</samp>’</dt>
5389 <dd><p>Use persistent connections if set to 1, default is 0.
5392 <dt> ‘<samp>post_data</samp>’</dt>
5393 <dd><p>Set custom HTTP post data.
5396 <dt> ‘<samp>user-agent</samp>’</dt>
5397 <dt> ‘<samp>user_agent</samp>’</dt>
5398 <dd><p>Override the User-Agent header. If not specified the protocol will use a
5399 string describing the libavformat build. ("Lavf/<version>")
5402 <dt> ‘<samp>timeout</samp>’</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
5408 <dt> ‘<samp>mime_type</samp>’</dt>
5409 <dd><p>Export the MIME type.
5412 <dt> ‘<samp>icy</samp>’</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 ‘<samp>icy_metadata_headers</samp>’ and ‘<samp>icy_metadata_packet</samp>’ options.
5419 <dt> ‘<samp>icy_metadata_headers</samp>’</dt>
5420 <dd><p>If the server supports ICY metadata, this contains the ICY-specific HTTP reply
5421 headers, separated by newline characters.
5424 <dt> ‘<samp>icy_metadata_packet</samp>’</dt>
5425 <dd><p>If the server supports ICY metadata, and ‘<samp>icy</samp>’ 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
5431 <dt> ‘<samp>cookies</samp>’</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.
5437 <dt> ‘<samp>offset</samp>’</dt>
5438 <dd><p>Set initial byte offset.
5441 <dt> ‘<samp>end_offset</samp>’</dt>
5442 <dd><p>Try to limit the request to bytes preceding this offset.
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>
5449 <p>Some HTTP requests will be denied unless cookie values are passed in with the
5450 request. The ‘<samp>cookies</samp>’ 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
5456 <p>The required syntax to play a stream specifying a cookie is:
5457 </p><table><tr><td> </td><td><pre class="example">ffplay -cookies "nlqptid=nltid=tsn; path=/; domain=somedomain.com;" http://somedomain.com/somestream.m3u8
5458 </pre></td></tr></table>
5461 <h2 class="section"><a href="ffplay-all.html#toc-mmst">16.11 mmst</a></h2>
5463 <p>MMS (Microsoft Media Server) protocol over TCP.
5466 <h2 class="section"><a href="ffplay-all.html#toc-mmsh">16.12 mmsh</a></h2>
5468 <p>MMS (Microsoft Media Server) protocol over HTTP.
5470 <p>The required syntax is:
5471 </p><table><tr><td> </td><td><pre class="example">mmsh://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
5472 </pre></td></tr></table>
5475 <h2 class="section"><a href="ffplay-all.html#toc-md5">16.13 md5</a></h2>
5477 <p>MD5 output protocol.
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.
5483 <p>Some examples follow.
5484 </p><table><tr><td> </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
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>
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.
5495 <h2 class="section"><a href="ffplay-all.html#toc-pipe">16.14 pipe</a></h2>
5497 <p>UNIX pipe access protocol.
5499 <p>Allow to read and write from UNIX pipes.
5501 <p>The accepted syntax is:
5502 </p><table><tr><td> </td><td><pre class="example">pipe:[<var>number</var>]
5503 </pre></td></tr></table>
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.
5510 <p>For example to read from stdin with <code>ffmpeg</code>:
5511 </p><table><tr><td> </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>
5516 <p>For writing to stdout with <code>ffmpeg</code>:
5517 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi
5518 # ...this is the same as...
5519 ffmpeg -i test.wav -f avi pipe: | cat > test.avi
5520 </pre></td></tr></table>
5522 <p>This protocol accepts the following options:
5524 <dl compact="compact">
5525 <dt> ‘<samp>blocksize</samp>’</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.
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.
5537 <h2 class="section"><a href="ffplay-all.html#toc-rtmp">16.15 rtmp</a></h2>
5539 <p>Real-Time Messaging Protocol.
5541 <p>The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
5542 content across a TCP/IP network.
5544 <p>The required syntax is:
5545 </p><table><tr><td> </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>
5548 <p>The accepted parameters are:
5549 </p><dl compact="compact">
5550 <dt> ‘<samp>username</samp>’</dt>
5551 <dd><p>An optional username (mostly for publishing).
5554 <dt> ‘<samp>password</samp>’</dt>
5555 <dd><p>An optional password (mostly for publishing).
5558 <dt> ‘<samp>server</samp>’</dt>
5559 <dd><p>The address of the RTMP server.
5562 <dt> ‘<samp>port</samp>’</dt>
5563 <dd><p>The number of the TCP port to use (by default is 1935).
5566 <dt> ‘<samp>app</samp>’</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. ‘<tt>/ondemand/</tt>’, ‘<tt>/flash/live/</tt>’, etc.). You can override
5570 the value parsed from the URI through the <code>rtmp_app</code> option, too.
5573 <dt> ‘<samp>playpath</samp>’</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 "mp4:". You
5576 can override the value parsed from the URI through the <code>rtmp_playpath</code>
5580 <dt> ‘<samp>listen</samp>’</dt>
5581 <dd><p>Act as a server, listening for an incoming connection.
5584 <dt> ‘<samp>timeout</samp>’</dt>
5585 <dd><p>Maximum time to wait for the incoming connection. Implies listen.
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> ‘<samp>rtmp_app</samp>’</dt>
5593 <dd><p>Name of application to connect on the RTMP server. This option
5594 overrides the parameter specified in the URI.
5597 <dt> ‘<samp>rtmp_buffer</samp>’</dt>
5598 <dd><p>Set the client buffer time in milliseconds. The default is 3000.
5601 <dt> ‘<samp>rtmp_conn</samp>’</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 ’N’ 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.
5614 <dt> ‘<samp>rtmp_flashver</samp>’</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 <libavformat version>).)
5620 <dt> ‘<samp>rtmp_flush_interval</samp>’</dt>
5621 <dd><p>Number of packets flushed in the same request (RTMPT only). The default
5625 <dt> ‘<samp>rtmp_live</samp>’</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>.
5634 <dt> ‘<samp>rtmp_pageurl</samp>’</dt>
5635 <dd><p>URL of the web page in which the media was embedded. By default no
5639 <dt> ‘<samp>rtmp_playpath</samp>’</dt>
5640 <dd><p>Stream identifier to play or to publish. This option overrides the
5641 parameter specified in the URI.
5644 <dt> ‘<samp>rtmp_subscribe</samp>’</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
5650 <dt> ‘<samp>rtmp_swfhash</samp>’</dt>
5651 <dd><p>SHA256 hash of the decompressed SWF file (32 bytes).
5654 <dt> ‘<samp>rtmp_swfsize</samp>’</dt>
5655 <dd><p>Size of the decompressed SWF file, required for SWFVerification.
5658 <dt> ‘<samp>rtmp_swfurl</samp>’</dt>
5659 <dd><p>URL of the SWF player for the media. By default no value will be sent.
5662 <dt> ‘<samp>rtmp_swfverify</samp>’</dt>
5663 <dd><p>URL to player swf file, compute hash/size automatically.
5666 <dt> ‘<samp>rtmp_tcurl</samp>’</dt>
5667 <dd><p>URL of the target stream. Defaults to proto://host[:port]/app.
5672 <p>For example to read with <code>ffplay</code> a multimedia resource named
5673 "sample" from the application "vod" from an RTMP server "myserver":
5674 </p><table><tr><td> </td><td><pre class="example">ffplay rtmp://myserver/vod/sample
5675 </pre></td></tr></table>
5677 <p>To publish to a password protected server, passing the playpath and
5678 app names separately:
5679 </p><table><tr><td> </td><td><pre class="example">ffmpeg -re -i <input> -f flv -rtmp_playpath some/long/path -rtmp_app long/app/name rtmp://username:password@myserver/
5680 </pre></td></tr></table>
5682 <a name="rtmpe"></a>
5683 <h2 class="section"><a href="ffplay-all.html#toc-rtmpe">16.16 rtmpe</a></h2>
5685 <p>Encrypted Real-Time Messaging Protocol.
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
5692 <a name="rtmps"></a>
5693 <h2 class="section"><a href="ffplay-all.html#toc-rtmps">16.17 rtmps</a></h2>
5695 <p>Real-Time Messaging Protocol over a secure SSL connection.
5697 <p>The Real-Time Messaging Protocol (RTMPS) is used for streaming
5698 multimedia content across an encrypted connection.
5700 <a name="rtmpt"></a>
5701 <h2 class="section"><a href="ffplay-all.html#toc-rtmpt">16.18 rtmpt</a></h2>
5703 <p>Real-Time Messaging Protocol tunneled through HTTP.
5705 <p>The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used
5706 for streaming multimedia content within HTTP requests to traverse
5709 <a name="rtmpte"></a>
5710 <h2 class="section"><a href="ffplay-all.html#toc-rtmpte">16.19 rtmpte</a></h2>
5712 <p>Encrypted Real-Time Messaging Protocol tunneled through HTTP.
5714 <p>The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE)
5715 is used for streaming multimedia content within HTTP requests to traverse
5718 <a name="rtmpts"></a>
5719 <h2 class="section"><a href="ffplay-all.html#toc-rtmpts">16.20 rtmpts</a></h2>
5721 <p>Real-Time Messaging Protocol tunneled through HTTPS.
5723 <p>The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used
5724 for streaming multimedia content within HTTPS requests to traverse
5727 <a name="libssh"></a>
5728 <h2 class="section"><a href="ffplay-all.html#toc-libssh">16.21 libssh</a></h2>
5730 <p>Secure File Transfer Protocol via libssh
5732 <p>Allow to read from or write to remote resources using SFTP protocol.
5734 <p>Following syntax is required.
5736 <table><tr><td> </td><td><pre class="example">sftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
5737 </pre></td></tr></table>
5739 <p>This protocol accepts the following options.
5741 <dl compact="compact">
5742 <dt> ‘<samp>timeout</samp>’</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
5748 <dt> ‘<samp>truncate</samp>’</dt>
5749 <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
5750 truncating. Default value is 1.
5753 <dt> ‘<samp>private_key</samp>’</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 ‘<tt>~/.ssh/</tt>’ directory.
5760 <p>Example: Play a file stored on remote server.
5762 <table><tr><td> </td><td><pre class="example">ffplay sftp://user:password@server_address:22/home/user/resource.mpeg
5763 </pre></td></tr></table>
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>
5768 <p>Real-Time Messaging Protocol and its variants supported through
5771 <p>Requires the presence of the librtmp headers and library during
5772 configuration. You need to explicitly configure the build with
5773 "–enable-librtmp". If enabled this will replace the native RTMP
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).
5781 <p>The required syntax is:
5782 </p><table><tr><td> </td><td><pre class="example"><var>rtmp_proto</var>://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>] <var>options</var>
5783 </pre></td></tr></table>
5785 <p>where <var>rtmp_proto</var> is one of the strings "rtmp", "rtmpt", "rtmpe",
5786 "rtmps", "rtmpte", "rtmpts" 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>.
5792 <p>See the librtmp manual page (man 3 librtmp) for more information.
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> </td><td><pre class="example">ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
5797 </pre></td></tr></table>
5799 <p>To play the same stream using <code>ffplay</code>:
5800 </p><table><tr><td> </td><td><pre class="example">ffplay "rtmp://myserver/live/mystream live=1"
5801 </pre></td></tr></table>
5804 <h2 class="section"><a href="ffplay-all.html#toc-rtp">16.23 rtp</a></h2>
5806 <p>Real-time Transport Protocol.
5808 <p>The required syntax for an RTP URL is:
5809 rtp://<var>hostname</var>[:<var>port</var>][?<var>option</var>=<var>val</var>...]
5811 <p><var>port</var> specifies the RTP port to use.
5813 <p>The following URL options are supported:
5815 <dl compact="compact">
5816 <dt> ‘<samp>ttl=<var>n</var></samp>’</dt>
5817 <dd><p>Set the TTL (Time-To-Live) value (for multicast only).
5820 <dt> ‘<samp>rtcpport=<var>n</var></samp>’</dt>
5821 <dd><p>Set the remote RTCP port to <var>n</var>.
5824 <dt> ‘<samp>localrtpport=<var>n</var></samp>’</dt>
5825 <dd><p>Set the local RTP port to <var>n</var>.
5828 <dt> ‘<samp>localrtcpport=<var>n</var>'</samp>’</dt>
5829 <dd><p>Set the local RTCP port to <var>n</var>.
5832 <dt> ‘<samp>pkt_size=<var>n</var></samp>’</dt>
5833 <dd><p>Set max packet size (in bytes) to <var>n</var>.
5836 <dt> ‘<samp>connect=0|1</samp>’</dt>
5837 <dd><p>Do a <code>connect()</code> on the UDP socket (if set to 1) or not (if set
5841 <dt> ‘<samp>sources=<var>ip</var>[,<var>ip</var>]</samp>’</dt>
5842 <dd><p>List allowed source IP addresses.
5845 <dt> ‘<samp>block=<var>ip</var>[,<var>ip</var>]</samp>’</dt>
5846 <dd><p>List disallowed (blocked) source IP addresses.
5849 <dt> ‘<samp>write_to_source=0|1</samp>’</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).
5854 <dt> ‘<samp>localport=<var>n</var></samp>’</dt>
5855 <dd><p>Set the local RTP port to <var>n</var>.
5857 <p>This is a deprecated option. Instead, ‘<samp>localrtpport</samp>’ should be
5867 If ‘<samp>rtcpport</samp>’ is not set the RTCP port will be set to the RTP
5871 If ‘<samp>localrtpport</samp>’ (the local RTP port) is not set any available
5872 port will be used for the local RTP and RTCP ports.
5875 If ‘<samp>localrtcpport</samp>’ (the local RTCP port) is not set it will be
5876 set to the the local RTP port value plus 1.
5880 <h2 class="section"><a href="ffplay-all.html#toc-rtsp">16.24 rtsp</a></h2>
5882 <p>Real-Time Streaming Protocol.
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).
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’s
5891 <a href="http://github.com/revmischa/rtsp-server">RTSP server</a>).
5893 <p>The required syntax for a RTSP url is:
5894 </p><table><tr><td> </td><td><pre class="example">rtsp://<var>hostname</var>[:<var>port</var>]/<var>path</var>
5895 </pre></td></tr></table>
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>.
5901 <p>The following options are supported.
5903 <dl compact="compact">
5904 <dt> ‘<samp>initial_pause</samp>’</dt>
5905 <dd><p>Do not start playing the stream immediately if set to 1. Default value
5909 <dt> ‘<samp>rtsp_transport</samp>’</dt>
5910 <dd><p>Set RTSP trasport protocols.
5912 <p>It accepts the following values:
5913 </p><dl compact="compact">
5914 <dt> ‘<samp>udp</samp>’</dt>
5915 <dd><p>Use UDP as lower transport protocol.
5918 <dt> ‘<samp>tcp</samp>’</dt>
5919 <dd><p>Use TCP (interleaving within the RTSP control channel) as lower
5923 <dt> ‘<samp>udp_multicast</samp>’</dt>
5924 <dd><p>Use UDP multicast as lower transport protocol.
5927 <dt> ‘<samp>http</samp>’</dt>
5928 <dd><p>Use HTTP tunneling as lower transport protocol, which is useful for
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 ‘<samp>tcp</samp>’ and ‘<samp>udp</samp>’ options are supported.
5938 <dt> ‘<samp>rtsp_flags</samp>’</dt>
5939 <dd><p>Set RTSP flags.
5941 <p>The following values are accepted:
5942 </p><dl compact="compact">
5943 <dt> ‘<samp>filter_src</samp>’</dt>
5944 <dd><p>Accept packets only from negotiated peer address and port.
5946 <dt> ‘<samp>listen</samp>’</dt>
5947 <dd><p>Act as a server, listening for an incoming connection.
5951 <p>Default value is ‘<samp>none</samp>’.
5954 <dt> ‘<samp>allowed_media_types</samp>’</dt>
5955 <dd><p>Set media types to accept from the server.
5957 <p>The following flags are accepted:
5958 </p><dl compact="compact">
5959 <dt> ‘<samp>video</samp>’</dt>
5960 <dt> ‘<samp>audio</samp>’</dt>
5961 <dt> ‘<samp>data</samp>’</dt>
5964 <p>By default it accepts all media types.
5967 <dt> ‘<samp>min_port</samp>’</dt>
5968 <dd><p>Set minimum local UDP port. Default value is 5000.
5971 <dt> ‘<samp>max_port</samp>’</dt>
5972 <dd><p>Set maximum local UDP port. Default value is 65000.
5975 <dt> ‘<samp>timeout</samp>’</dt>
5976 <dd><p>Set maximum timeout (in seconds) to wait for incoming connections.
5978 <p>A value of -1 mean infinite (default). This option implies the
5979 ‘<samp>rtsp_flags</samp>’ set to ‘<samp>listen</samp>’.
5982 <dt> ‘<samp>reorder_queue_size</samp>’</dt>
5983 <dd><p>Set number of packets to buffer for handling of reordered packets.
5986 <dt> ‘<samp>stimeout</samp>’</dt>
5987 <dd><p>Set socket TCP I/O timeout in micro seconds.
5990 <dt> ‘<samp>user-agent</samp>’</dt>
5991 <dd><p>Override User-Agent header. If not specified, it default to the
5992 libavformat identifier string.
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).
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>.
6006 <a name="Examples-78"></a>
6007 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-78">16.24.1 Examples</a></h3>
6009 <p>The following examples all make use of the <code>ffplay</code> and
6010 <code>ffmpeg</code> tools.
6014 Watch a stream over UDP, with a max reordering delay of 0.5 seconds:
6015 <table><tr><td> </td><td><pre class="example">ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
6016 </pre></td></tr></table>
6019 Watch a stream tunneled over HTTP:
6020 <table><tr><td> </td><td><pre class="example">ffplay -rtsp_transport http rtsp://server/video.mp4
6021 </pre></td></tr></table>
6024 Send a stream in realtime to a RTSP server, for others to watch:
6025 <table><tr><td> </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>
6029 Receive a stream in realtime:
6030 <table><tr><td> </td><td><pre class="example">ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp <var>output</var>
6031 </pre></td></tr></table>
6035 <h2 class="section"><a href="ffplay-all.html#toc-sap">16.25 sap</a></h2>
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.
6042 <a name="Muxer"></a>
6043 <h3 class="subsection"><a href="ffplay-all.html#toc-Muxer">16.25.1 Muxer</a></h3>
6045 <p>The syntax for a SAP url given to the muxer is:
6046 </p><table><tr><td> </td><td><pre class="example">sap://<var>destination</var>[:<var>port</var>][?<var>options</var>]
6047 </pre></td></tr></table>
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>&</code>-separated list. The following options
6054 <dl compact="compact">
6055 <dt> ‘<samp>announce_addr=<var>address</var></samp>’</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.
6062 <dt> ‘<samp>announce_port=<var>port</var></samp>’</dt>
6063 <dd><p>Specify the port to send the announcements on, defaults to
6064 9875 if not specified.
6067 <dt> ‘<samp>ttl=<var>ttl</var></samp>’</dt>
6068 <dd><p>Specify the time to live value for the announcements and RTP packets,
6072 <dt> ‘<samp>same_port=<var>0|1</var></samp>’</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
6082 <p>Example command lines follow.
6084 <p>To broadcast a stream on the local subnet, for watching in VLC:
6086 <table><tr><td> </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>
6089 <p>Similarly, for watching in <code>ffplay</code>:
6091 <table><tr><td> </td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255
6092 </pre></td></tr></table>
6094 <p>And for watching in <code>ffplay</code>, over IPv6:
6096 <table><tr><td> </td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://[ff0e::1:2:3:4]
6097 </pre></td></tr></table>
6099 <a name="Demuxer"></a>
6100 <h3 class="subsection"><a href="ffplay-all.html#toc-Demuxer">16.25.2 Demuxer</a></h3>
6102 <p>The syntax for a SAP url given to the demuxer is:
6103 </p><table><tr><td> </td><td><pre class="example">sap://[<var>address</var>][:<var>port</var>]
6104 </pre></td></tr></table>
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.
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.
6113 <p>Example command lines follow.
6115 <p>To play back the first stream announced on the normal SAP multicast address:
6117 <table><tr><td> </td><td><pre class="example">ffplay sap://
6118 </pre></td></tr></table>
6120 <p>To play back the first stream announced on one the default IPv6 SAP multicast address:
6122 <table><tr><td> </td><td><pre class="example">ffplay sap://[ff0e::2:7ffe]
6123 </pre></td></tr></table>
6126 <h2 class="section"><a href="ffplay-all.html#toc-sctp">16.26 sctp</a></h2>
6128 <p>Stream Control Transmission Protocol.
6130 <p>The accepted URL syntax is:
6131 </p><table><tr><td> </td><td><pre class="example">sctp://<var>host</var>:<var>port</var>[?<var>options</var>]
6132 </pre></td></tr></table>
6134 <p>The protocol accepts the following options:
6135 </p><dl compact="compact">
6136 <dt> ‘<samp>listen</samp>’</dt>
6137 <dd><p>If set to any value, listen for an incoming connection. Outgoing connection is done by default.
6140 <dt> ‘<samp>max_streams</samp>’</dt>
6141 <dd><p>Set the maximum number of streams. By default no limit is set.
6146 <h2 class="section"><a href="ffplay-all.html#toc-srtp">16.27 srtp</a></h2>
6148 <p>Secure Real-time Transport Protocol.
6150 <p>The accepted options are:
6151 </p><dl compact="compact">
6152 <dt> ‘<samp>srtp_in_suite</samp>’</dt>
6153 <dt> ‘<samp>srtp_out_suite</samp>’</dt>
6154 <dd><p>Select input and output encoding suites.
6156 <p>Supported values:
6157 </p><dl compact="compact">
6158 <dt> ‘<samp>AES_CM_128_HMAC_SHA1_80</samp>’</dt>
6159 <dt> ‘<samp>SRTP_AES128_CM_HMAC_SHA1_80</samp>’</dt>
6160 <dt> ‘<samp>AES_CM_128_HMAC_SHA1_32</samp>’</dt>
6161 <dt> ‘<samp>SRTP_AES128_CM_HMAC_SHA1_32</samp>’</dt>
6165 <dt> ‘<samp>srtp_in_params</samp>’</dt>
6166 <dt> ‘<samp>srtp_out_params</samp>’</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.
6175 <h2 class="section"><a href="ffplay-all.html#toc-tcp">16.28 tcp</a></h2>
6177 <p>Transmission Control Protocol.
6179 <p>The required syntax for a TCP url is:
6180 </p><table><tr><td> </td><td><pre class="example">tcp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
6181 </pre></td></tr></table>
6183 <p><var>options</var> contains a list of &-separated options of the form
6184 <var>key</var>=<var>val</var>.
6186 <p>The list of supported options follows.
6188 <dl compact="compact">
6189 <dt> ‘<samp>listen=<var>1|0</var></samp>’</dt>
6190 <dd><p>Listen for an incoming connection. Default value is 0.
6193 <dt> ‘<samp>timeout=<var>microseconds</var></samp>’</dt>
6194 <dd><p>Set raise error timeout, expressed in microseconds.
6196 <p>This option is only relevant in read mode: if no data arrived in more
6197 than this time interval, raise error.
6200 <dt> ‘<samp>listen_timeout=<var>microseconds</var></samp>’</dt>
6201 <dd><p>Set listen timeout, expressed in microseconds.
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> </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>
6212 <h2 class="section"><a href="ffplay-all.html#toc-tls">16.29 tls</a></h2>
6214 <p>Transport Layer Security (TLS) / Secure Sockets Layer (SSL)
6216 <p>The required syntax for a TLS/SSL url is:
6217 </p><table><tr><td> </td><td><pre class="example">tls://<var>hostname</var>:<var>port</var>[?<var>options</var>]
6218 </pre></td></tr></table>
6220 <p>The following parameters can be set via command line options
6221 (or in code via <code>AVOption</code>s):
6223 <dl compact="compact">
6224 <dt> ‘<samp>ca_file, cafile=<var>filename</var></samp>’</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.
6232 <dt> ‘<samp>tls_verify=<var>1|0</var></samp>’</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.)
6240 <p>This is disabled by default since it requires a CA database to be
6241 provided by the caller in many cases.
6244 <dt> ‘<samp>cert_file, cert=<var>filename</var></samp>’</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
6251 <dt> ‘<samp>key_file, key=<var>filename</var></samp>’</dt>
6252 <dd><p>A file containing the private key for the certificate.
6255 <dt> ‘<samp>listen=<var>1|0</var></samp>’</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.
6262 <p>Example command lines:
6264 <p>To create a TLS/SSL server that serves an input stream.
6266 <table><tr><td> </td><td><pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> tls://<var>hostname</var>:<var>port</var>?listen&cert=<var>server.crt</var>&key=<var>server.key</var>
6267 </pre></td></tr></table>
6269 <p>To play back a stream from the TLS/SSL server using <code>ffplay</code>:
6271 <table><tr><td> </td><td><pre class="example">ffplay tls://<var>hostname</var>:<var>port</var>
6272 </pre></td></tr></table>
6275 <h2 class="section"><a href="ffplay-all.html#toc-udp">16.30 udp</a></h2>
6277 <p>User Datagram Protocol.
6279 <p>The required syntax for an UDP URL is:
6280 </p><table><tr><td> </td><td><pre class="example">udp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
6281 </pre></td></tr></table>
6283 <p><var>options</var> contains a list of &-separated options of the form <var>key</var>=<var>val</var>.
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.
6290 <p>The list of supported options follows.
6292 <dl compact="compact">
6293 <dt> ‘<samp>buffer_size=<var>size</var></samp>’</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.
6298 <dt> ‘<samp>localport=<var>port</var></samp>’</dt>
6299 <dd><p>Override the local UDP port to bind with.
6302 <dt> ‘<samp>localaddr=<var>addr</var></samp>’</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.
6308 <dt> ‘<samp>pkt_size=<var>size</var></samp>’</dt>
6309 <dd><p>Set the size in bytes of UDP packets.
6312 <dt> ‘<samp>reuse=<var>1|0</var></samp>’</dt>
6313 <dd><p>Explicitly allow or disallow reusing UDP sockets.
6316 <dt> ‘<samp>ttl=<var>ttl</var></samp>’</dt>
6317 <dd><p>Set the time to live value (for multicast only).
6320 <dt> ‘<samp>connect=<var>1|0</var></samp>’</dt>
6321 <dd><p>Initialize the UDP socket with <code>connect()</code>. In this case, the
6322 destination address can’t be changed with ff_udp_set_remote_url later.
6323 If the destination address isn’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 "destination
6327 unreachable" is received.
6328 For receiving, this gives the benefit of only receiving packets from
6329 the specified peer address/port.
6332 <dt> ‘<samp>sources=<var>address</var>[,<var>address</var>]</samp>’</dt>
6333 <dd><p>Only receive packets sent to the multicast group from one of the
6334 specified sender IP addresses.
6337 <dt> ‘<samp>block=<var>address</var>[,<var>address</var>]</samp>’</dt>
6338 <dd><p>Ignore packets sent to the multicast group from the specified
6339 sender IP addresses.
6342 <dt> ‘<samp>fifo_size=<var>units</var></samp>’</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.
6347 <dt> ‘<samp>overrun_nonfatal=<var>1|0</var></samp>’</dt>
6348 <dd><p>Survive in case of UDP receiving circular buffer overrun. Default
6352 <dt> ‘<samp>timeout=<var>microseconds</var></samp>’</dt>
6353 <dd><p>Set raise error timeout, expressed in microseconds.
6355 <p>This option is only relevant in read mode: if no data arrived in more
6356 than this time interval, raise error.
6360 <a name="Examples-53"></a>
6361 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-53">16.30.1 Examples</a></h3>
6365 Use <code>ffmpeg</code> to stream over UDP to a remote endpoint:
6366 <table><tr><td> </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>
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> </td><td><pre class="example">ffmpeg -i <var>input</var> -f mpegts udp://<var>hostname</var>:<var>port</var>?pkt_size=188&buffer_size=65535
6373 </pre></td></tr></table>
6376 Use <code>ffmpeg</code> to receive over UDP from a remote endpoint:
6377 <table><tr><td> </td><td><pre class="example">ffmpeg -i udp://[<var>multicast-address</var>]:<var>port</var> ...
6378 </pre></td></tr></table>
6382 <h2 class="section"><a href="ffplay-all.html#toc-unix">16.31 unix</a></h2>
6384 <p>Unix local socket
6386 <p>The required syntax for a Unix socket URL is:
6388 <table><tr><td> </td><td><pre class="example">unix://<var>filepath</var>
6389 </pre></td></tr></table>
6391 <p>The following parameters can be set via command line options
6392 (or in code via <code>AVOption</code>s):
6394 <dl compact="compact">
6395 <dt> ‘<samp>timeout</samp>’</dt>
6396 <dd><p>Timeout in ms.
6398 <dt> ‘<samp>listen</samp>’</dt>
6399 <dd><p>Create the Unix socket in listening mode.
6403 <a name="Device-Options"></a>
6404 <h1 class="chapter"><a href="ffplay-all.html#toc-Device-Options">17. Device Options</a></h1>
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
6412 <p>In addition each input or output device may support so-called private
6413 options, which are specific for that component.
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 ‘<tt>libavutil/opt.h</tt>’ API
6418 for programmatic use.
6421 <a name="Input-Devices"></a>
6422 <h1 class="chapter"><a href="ffplay-all.html#toc-Input-Devices">18. Input Devices</a></h1>
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.
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 "–list-indevs".
6431 <p>You can disable all the input devices using the configure option
6432 "–disable-indevs", and selectively enable an input device using the
6433 option "–enable-indev=<var>INDEV</var>", or you can disable a particular
6434 input device using the option "–disable-indev=<var>INDEV</var>".
6436 <p>The option "-formats" of the ff* tools will display the list of
6437 supported input devices (amongst the demuxers).
6439 <p>A description of the currently available input devices follows.
6442 <h2 class="section"><a href="ffplay-all.html#toc-alsa">18.1 alsa</a></h2>
6444 <p>ALSA (Advanced Linux Sound Architecture) input device.
6446 <p>To enable this input device during configuration you need libasound
6447 installed on your system.
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.
6452 <p>An ALSA identifier has the syntax:
6453 </p><table><tr><td> </td><td><pre class="example">hw:<var>CARD</var>[,<var>DEV</var>[,<var>SUBDEV</var>]]
6454 </pre></td></tr></table>
6456 <p>where the <var>DEV</var> and <var>SUBDEV</var> components are optional.
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
6462 <p>To see the list of cards currently recognized by your system check the
6463 files ‘<tt>/proc/asound/cards</tt>’ and ‘<tt>/proc/asound/devices</tt>’.
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> </td><td><pre class="example">ffmpeg -f alsa -i hw:0 alsaout.wav
6468 </pre></td></tr></table>
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>
6474 <h2 class="section"><a href="ffplay-all.html#toc-bktr">18.2 bktr</a></h2>
6476 <p>BSD video input device.
6478 <a name="dshow"></a>
6479 <h2 class="section"><a href="ffplay-all.html#toc-dshow">18.3 dshow</a></h2>
6481 <p>Windows DirectShow input device.
6483 <p>DirectShow support is enabled when FFmpeg is built with the mingw-w64 project.
6484 Currently only audio and video devices are supported.
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.
6489 <p>The input name should be in the format:
6491 <table><tr><td> </td><td><pre class="example"><var>TYPE</var>=<var>NAME</var>[:<var>TYPE</var>=<var>NAME</var>]
6492 </pre></td></tr></table>
6494 <p>where <var>TYPE</var> can be either <var>audio</var> or <var>video</var>,
6495 and <var>NAME</var> is the device’s name.
6497 <a name="Options-1"></a>
6498 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-1">18.3.1 Options</a></h3>
6500 <p>If no options are specified, the device’s defaults are used.
6501 If the device does not support the requested options, it will
6504 <dl compact="compact">
6505 <dt> ‘<samp>video_size</samp>’</dt>
6506 <dd><p>Set the video size in the captured video.
6509 <dt> ‘<samp>framerate</samp>’</dt>
6510 <dd><p>Set the frame rate in the captured video.
6513 <dt> ‘<samp>sample_rate</samp>’</dt>
6514 <dd><p>Set the sample rate (in Hz) of the captured audio.
6517 <dt> ‘<samp>sample_size</samp>’</dt>
6518 <dd><p>Set the sample size (in bits) of the captured audio.
6521 <dt> ‘<samp>channels</samp>’</dt>
6522 <dd><p>Set the number of channels in the captured audio.
6525 <dt> ‘<samp>list_devices</samp>’</dt>
6526 <dd><p>If set to ‘<samp>true</samp>’, print a list of devices and exit.
6529 <dt> ‘<samp>list_options</samp>’</dt>
6530 <dd><p>If set to ‘<samp>true</samp>’, print a list of selected device’s options
6534 <dt> ‘<samp>video_device_number</samp>’</dt>
6535 <dd><p>Set video device number for devices with same name (starts at 0,
6539 <dt> ‘<samp>audio_device_number</samp>’</dt>
6540 <dd><p>Set audio device number for devices with same name (starts at 0,
6544 <dt> ‘<samp>pixel_format</samp>’</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.
6549 <dt> ‘<samp>audio_buffer_size</samp>’</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’s
6553 default buffer size (typically some multiple of 500ms).
6554 Setting this value too low can degrade performance.
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>
6561 <a name="Examples-23"></a>
6562 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-23">18.3.2 Examples</a></h3>
6566 Print the list of DirectShow supported devices and exit:
6567 <table><tr><td> </td><td><pre class="example">$ ffmpeg -list_devices true -f dshow -i dummy
6568 </pre></td></tr></table>
6571 Open video device <var>Camera</var>:
6572 <table><tr><td> </td><td><pre class="example">$ ffmpeg -f dshow -i video="Camera"
6573 </pre></td></tr></table>
6576 Open second video device with name <var>Camera</var>:
6577 <table><tr><td> </td><td><pre class="example">$ ffmpeg -f dshow -video_device_number 1 -i video="Camera"
6578 </pre></td></tr></table>
6581 Open video device <var>Camera</var> and audio device <var>Microphone</var>:
6582 <table><tr><td> </td><td><pre class="example">$ ffmpeg -f dshow -i video="Camera":audio="Microphone"
6583 </pre></td></tr></table>
6586 Print the list of supported options in selected device and exit:
6587 <table><tr><td> </td><td><pre class="example">$ ffmpeg -list_options true -f dshow -i video="Camera"
6588 </pre></td></tr></table>
6592 <a name="dv1394"></a>
6593 <h2 class="section"><a href="ffplay-all.html#toc-dv1394">18.4 dv1394</a></h2>
6595 <p>Linux DV 1394 input device.
6597 <a name="fbdev"></a>
6598 <h2 class="section"><a href="ffplay-all.html#toc-fbdev">18.5 fbdev</a></h2>
6600 <p>Linux framebuffer input device.
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 ‘<tt>/dev/fb0</tt>’.
6607 <p>For more detailed information read the file
6608 Documentation/fb/framebuffer.txt included in the Linux source tree.
6610 <p>To record from the framebuffer device ‘<tt>/dev/fb0</tt>’ with
6611 <code>ffmpeg</code>:
6612 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
6613 </pre></td></tr></table>
6615 <p>You can take a single screenshot image with the command:
6616 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f fbdev -frames:v 1 -r 1 -i /dev/fb0 screenshot.jpeg
6617 </pre></td></tr></table>
6619 <p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
6621 <a name="iec61883"></a>
6622 <h2 class="section"><a href="ffplay-all.html#toc-iec61883">18.6 iec61883</a></h2>
6624 <p>FireWire DV/HDV input device using libiec61883.
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.
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.
6635 <p>Specify the FireWire port to be used as input file, or "auto"
6636 to choose the first port connected.
6638 <a name="Options-12"></a>
6639 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-12">18.6.1 Options</a></h3>
6641 <dl compact="compact">
6642 <dt> ‘<samp>dvtype</samp>’</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 ‘<samp>auto</samp>’, ‘<samp>dv</samp>’ and ‘<samp>hdv</samp>’ are supported.
6650 <dt> ‘<samp>dvbuffer</samp>’</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.
6656 <dt> ‘<samp>dvguid</samp>’</dt>
6657 <dd><p>Select the capture device by specifying it’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.
6666 <a name="Examples-26"></a>
6667 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-26">18.6.2 Examples</a></h3>
6671 Grab and show the input of a FireWire DV/HDV device.
6672 <table><tr><td> </td><td><pre class="example">ffplay -f iec61883 -i auto
6673 </pre></td></tr></table>
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> </td><td><pre class="example">ffmpeg -f iec61883 -i auto -hdvbuffer 100000 out.mpg
6679 </pre></td></tr></table>
6684 <h2 class="section"><a href="ffplay-all.html#toc-jack">18.7 jack</a></h2>
6686 <p>JACK input device.
6688 <p>To enable this input device during configuration you need libjack
6689 installed on your system.
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
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.
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>.
6705 <p>To list the JACK clients and their properties you can invoke the command
6706 <code>jack_lsp</code>.
6708 <p>Follows an example which shows how to capture a JACK readable client
6709 with <code>ffmpeg</code>.
6710 </p><table><tr><td> </td><td><pre class="example"># Create a JACK writable client with name "ffmpeg".
6711 $ ffmpeg -f jack -i ffmpeg -y out.wav
6713 # Start the sample jack_metro readable client.
6714 $ jack_metro -b 120 -d 0.2 -f 4000
6716 # List the current JACK clients.
6725 # Connect metro to the ffmpeg writable client.
6726 $ jack_connect metro:120_bpm ffmpeg:input_1
6727 </pre></td></tr></table>
6729 <p>For more information read:
6730 <a href="http://jackaudio.org/">http://jackaudio.org/</a>
6732 <a name="lavfi"></a>
6733 <h2 class="section"><a href="ffplay-all.html#toc-lavfi">18.8 lavfi</a></h2>
6735 <p>Libavfilter input virtual device.
6737 <p>This input device reads data from the open output pads of a libavfilter
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 ‘<samp>graph</samp>’.
6745 <a name="Options-13"></a>
6746 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-13">18.8.1 Options</a></h3>
6748 <dl compact="compact">
6749 <dt> ‘<samp>graph</samp>’</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 "out<var>N</var>", 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 "out0"
6755 label, but all the others need to be specified explicitly.
6757 <p>If not specified defaults to the filename specified for the input
6761 <dt> ‘<samp>graph_file</samp>’</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>.
6769 <a name="Examples-27"></a>
6770 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-27">18.8.2 Examples</a></h3>
6774 Create a color video stream and play it back with <code>ffplay</code>:
6775 <table><tr><td> </td><td><pre class="example">ffplay -f lavfi -graph "color=c=pink [out0]" dummy
6776 </pre></td></tr></table>
6779 As the previous example, but use filename for specifying the graph
6780 description, and omit the "out0" label:
6781 <table><tr><td> </td><td><pre class="example">ffplay -f lavfi color=c=pink
6782 </pre></td></tr></table>
6785 Create three different video test filtered sources and play them:
6786 <table><tr><td> </td><td><pre class="example">ffplay -f lavfi -graph "testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]" test3
6787 </pre></td></tr></table>
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> </td><td><pre class="example">ffplay -f lavfi "amovie=test.wav"
6793 </pre></td></tr></table>
6796 Read an audio stream and a video stream and play it back with
6797 <code>ffplay</code>:
6798 <table><tr><td> </td><td><pre class="example">ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
6799 </pre></td></tr></table>
6803 <a name="libdc1394"></a>
6804 <h2 class="section"><a href="ffplay-all.html#toc-libdc1394">18.9 libdc1394</a></h2>
6806 <p>IIDC1394 input device, based on libdc1394 and libraw1394.
6808 <a name="openal"></a>
6809 <h2 class="section"><a href="ffplay-all.html#toc-openal">18.10 openal</a></h2>
6811 <p>The OpenAL input device provides audio capture on all systems with a
6812 working OpenAL 1.1 implementation.
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>.
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.
6824 <p>An incomplete list of OpenAL implementations follows:
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>.
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>.
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>
6844 <p>This device allows one to capture from an audio input device handled
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>.
6852 <a name="Options-14"></a>
6853 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-14">18.10.1 Options</a></h3>
6855 <dl compact="compact">
6856 <dt> ‘<samp>channels</samp>’</dt>
6857 <dd><p>Set the number of channels in the captured audio. Only the values
6858 ‘<samp>1</samp>’ (monaural) and ‘<samp>2</samp>’ (stereo) are currently supported.
6859 Defaults to ‘<samp>2</samp>’.
6862 <dt> ‘<samp>sample_size</samp>’</dt>
6863 <dd><p>Set the sample size (in bits) of the captured audio. Only the values
6864 ‘<samp>8</samp>’ and ‘<samp>16</samp>’ are currently supported. Defaults to
6865 ‘<samp>16</samp>’.
6868 <dt> ‘<samp>sample_rate</samp>’</dt>
6869 <dd><p>Set the sample rate (in Hz) of the captured audio.
6870 Defaults to ‘<samp>44.1k</samp>’.
6873 <dt> ‘<samp>list_devices</samp>’</dt>
6874 <dd><p>If set to ‘<samp>true</samp>’, print a list of devices and exit.
6875 Defaults to ‘<samp>false</samp>’.
6880 <a name="Examples-42"></a>
6881 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-42">18.10.2 Examples</a></h3>
6883 <p>Print the list of OpenAL supported devices and exit:
6884 </p><table><tr><td> </td><td><pre class="example">$ ffmpeg -list_devices true -f openal -i dummy out.ogg
6885 </pre></td></tr></table>
6887 <p>Capture from the OpenAL device ‘<tt>DR-BT101 via PulseAudio</tt>’:
6888 </p><table><tr><td> </td><td><pre class="example">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
6889 </pre></td></tr></table>
6891 <p>Capture from the default device (note the empty string ” as filename):
6892 </p><table><tr><td> </td><td><pre class="example">$ ffmpeg -f openal -i '' out.ogg
6893 </pre></td></tr></table>
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> </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.
6903 <h2 class="section"><a href="ffplay-all.html#toc-oss">18.11 oss</a></h2>
6905 <p>Open Sound System input device.
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 ‘<tt>/dev/dsp</tt>’.
6911 <p>For example to grab from ‘<tt>/dev/dsp</tt>’ using <code>ffmpeg</code> use the
6913 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
6914 </pre></td></tr></table>
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>
6919 <a name="pulse"></a>
6920 <h2 class="section"><a href="ffplay-all.html#toc-pulse">18.12 pulse</a></h2>
6922 <p>PulseAudio input device.
6924 <p>To enable this output device you need to configure FFmpeg with <code>--enable-libpulse</code>.
6926 <p>The filename to provide to the input device is a source device or the
6927 string "default"
6929 <p>To list the PulseAudio source devices and their properties you can invoke
6930 the command <code>pactl list sources</code>.
6932 <p>More information about PulseAudio can be found on <a href="http://www.pulseaudio.org">http://www.pulseaudio.org</a>.
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> ‘<samp>server</samp>’</dt>
6938 <dd><p>Connect to a specific PulseAudio server, specified by an IP address.
6939 Default server is used when not provided.
6942 <dt> ‘<samp>name</samp>’</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.
6947 <dt> ‘<samp>stream_name</samp>’</dt>
6948 <dd><p>Specify the stream name PulseAudio will use when showing active streams,
6949 by default it is "record".
6952 <dt> ‘<samp>sample_rate</samp>’</dt>
6953 <dd><p>Specify the samplerate in Hz, by default 48kHz is used.
6956 <dt> ‘<samp>channels</samp>’</dt>
6957 <dd><p>Specify the channels in use, by default 2 (stereo) is set.
6960 <dt> ‘<samp>frame_size</samp>’</dt>
6961 <dd><p>Specify the number of bytes per frame, by default it is set to 1024.
6964 <dt> ‘<samp>fragment_size</samp>’</dt>
6965 <dd><p>Specify the minimal buffering fragment in PulseAudio, it will affect the
6966 audio latency. By default it is unset.
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> </td><td><pre class="example">ffmpeg -f pulse -i default /tmp/pulse.wav
6974 </pre></td></tr></table>
6976 <a name="sndio"></a>
6977 <h2 class="section"><a href="ffplay-all.html#toc-sndio">18.13 sndio</a></h2>
6979 <p>sndio input device.
6981 <p>To enable this input device during configuration you need libsndio
6982 installed on your system.
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 ‘<tt>/dev/audio0</tt>’.
6988 <p>For example to grab from ‘<tt>/dev/audio0</tt>’ using <code>ffmpeg</code> use the
6990 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
6991 </pre></td></tr></table>
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>
6996 <p>Video4Linux2 input video device.
6998 <p>"v4l2" can be used as alias for "video4linux2".
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.
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 ‘<tt>/dev/video<var>N</var></tt>’, where <var>N</var> is a number associated to
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>.
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 ‘<samp>-timestamps abs</samp>’ or ‘<samp>-ts abs</samp>’ option can be used to force
7021 conversion into the real time clock.
7023 <p>Some usage examples of the video4linux2 device with <code>ffmpeg</code>
7024 and <code>ffplay</code>:
7027 Grab and show the input of a video4linux2 device:
7028 <table><tr><td> </td><td><pre class="example">ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
7029 </pre></td></tr></table>
7032 Grab and record the input of a video4linux2 device, leave the
7033 frame rate and size as previously set:
7034 <table><tr><td> </td><td><pre class="example">ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
7035 </pre></td></tr></table>
7038 <p>For more information about Video4Linux, check <a href="http://linuxtv.org/">http://linuxtv.org/</a>.
7040 <a name="Options-9"></a>
7041 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-9">18.14.1 Options</a></h3>
7043 <dl compact="compact">
7044 <dt> ‘<samp>standard</samp>’</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 ‘<samp>list_standards</samp>’
7050 <dt> ‘<samp>channel</samp>’</dt>
7051 <dd><p>Set the input channel number. Default to -1, which means using the
7052 previously selected channel.
7055 <dt> ‘<samp>video_size</samp>’</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.
7060 <dt> ‘<samp>pixel_format</samp>’</dt>
7061 <dd><p>Select the pixel format (only valid for raw video input).
7064 <dt> ‘<samp>input_format</samp>’</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
7070 <dt> ‘<samp>framerate</samp>’</dt>
7071 <dd><p>Set the preferred video frame rate.
7074 <dt> ‘<samp>list_formats</samp>’</dt>
7075 <dd><p>List available formats (supported pixel formats, codecs, and frame
7078 <p>Available values are:
7079 </p><dl compact="compact">
7080 <dt> ‘<samp>all</samp>’</dt>
7081 <dd><p>Show all available (compressed and non-compressed) formats.
7084 <dt> ‘<samp>raw</samp>’</dt>
7085 <dd><p>Show only raw video (non-compressed) formats.
7088 <dt> ‘<samp>compressed</samp>’</dt>
7089 <dd><p>Show only compressed formats.
7094 <dt> ‘<samp>list_standards</samp>’</dt>
7095 <dd><p>List supported standards and exit.
7097 <p>Available values are:
7098 </p><dl compact="compact">
7099 <dt> ‘<samp>all</samp>’</dt>
7100 <dd><p>Show all supported standards.
7105 <dt> ‘<samp>timestamps, ts</samp>’</dt>
7106 <dd><p>Set type of timestamps for grabbed frames.
7108 <p>Available values are:
7109 </p><dl compact="compact">
7110 <dt> ‘<samp>default</samp>’</dt>
7111 <dd><p>Use timestamps from the kernel.
7114 <dt> ‘<samp>abs</samp>’</dt>
7115 <dd><p>Use absolute timestamps (wall clock).
7118 <dt> ‘<samp>mono2abs</samp>’</dt>
7119 <dd><p>Force conversion from monotonic to absolute timestamps.
7123 <p>Default value is <code>default</code>.
7127 <a name="vfwcap"></a>
7128 <h2 class="section"><a href="ffplay-all.html#toc-vfwcap">18.15 vfwcap</a></h2>
7130 <p>VfW (Video for Windows) capture input device.
7132 <p>The filename passed as input is the capture driver number, ranging from
7133 0 to 9. You may use "list" as filename to print a list of drivers. Any
7134 other filename will be interpreted as device number 0.
7136 <a name="x11grab"></a>
7137 <h2 class="section"><a href="ffplay-all.html#toc-x11grab">18.16 x11grab</a></h2>
7139 <p>X11 video input device.
7141 <p>This device allows one to capture a region of an X11 display.
7143 <p>The filename passed as input has the syntax:
7144 </p><table><tr><td> </td><td><pre class="example">[<var>hostname</var>]:<var>display_number</var>.<var>screen_number</var>[+<var>x_offset</var>,<var>y_offset</var>]
7145 </pre></td></tr></table>
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 "localhost". The environment variable
7150 <code>DISPLAY</code> contains the default display name.
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
7156 <p>Check the X11 documentation (e.g. man X) for more detailed information.
7158 <p>Use the <code>dpyinfo</code> program for getting basic information about the
7159 properties of your X11 display (e.g. grep for "name" or "dimensions").
7161 <p>For example to grab from ‘<tt>:0.0</tt>’ using <code>ffmpeg</code>:
7162 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0 out.mpg
7163 </pre></td></tr></table>
7165 <p>Grab at position <code>10,20</code>:
7166 </p><table><tr><td> </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>
7169 <a name="Options-8"></a>
7170 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-8">18.16.1 Options</a></h3>
7172 <dl compact="compact">
7173 <dt> ‘<samp>draw_mouse</samp>’</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>.
7178 <dt> ‘<samp>follow_mouse</samp>’</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>.
7182 <p>When it is specified with "centered", 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.
7188 </p><table><tr><td> </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>
7191 <p>To follow only when the mouse pointer reaches within 100 pixels to edge:
7192 </p><table><tr><td> </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>
7196 <dt> ‘<samp>framerate</samp>’</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>.
7201 <dt> ‘<samp>show_region</samp>’</dt>
7202 <dd><p>Show grabbed region on screen.
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.
7209 </p><table><tr><td> </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>
7212 <p>With <var>follow_mouse</var>:
7213 </p><table><tr><td> </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>
7217 <dt> ‘<samp>video_size</samp>’</dt>
7218 <dd><p>Set the video frame size. Default value is <code>vga</code>.
7222 <a name="Resampler-Options"></a>
7223 <h1 class="chapter"><a href="ffplay-all.html#toc-Resampler-Options">19. Resampler Options</a></h1>
7225 <p>The audio resampler supports the following named options.
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 ‘<tt>libavutil/opt.h</tt>’ API for
7233 <dl compact="compact">
7234 <dt> ‘<samp>ich, in_channel_count</samp>’</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 ‘<samp>in_channel_layout</samp>’ is set.
7240 <dt> ‘<samp>och, out_channel_count</samp>’</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 ‘<samp>out_channel_layout</samp>’ is set.
7246 <dt> ‘<samp>uch, used_channel_count</samp>’</dt>
7247 <dd><p>Set the number of used input channels. Default value is 0. This option is
7248 only used for special remapping.
7251 <dt> ‘<samp>isr, in_sample_rate</samp>’</dt>
7252 <dd><p>Set the input sample rate. Default value is 0.
7255 <dt> ‘<samp>osr, out_sample_rate</samp>’</dt>
7256 <dd><p>Set the output sample rate. Default value is 0.
7259 <dt> ‘<samp>isf, in_sample_fmt</samp>’</dt>
7260 <dd><p>Specify the input sample format. It is set by default to <code>none</code>.
7263 <dt> ‘<samp>osf, out_sample_fmt</samp>’</dt>
7264 <dd><p>Specify the output sample format. It is set by default to <code>none</code>.
7267 <dt> ‘<samp>tsf, internal_sample_fmt</samp>’</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.
7272 <dt> ‘<samp>icl, in_channel_layout</samp>’</dt>
7273 <dt> ‘<samp>ocl, out_channel_layout</samp>’</dt>
7274 <dd><p>Set the input/output channel layout.
7276 <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)channel layout syntax</a>
7277 for the required syntax.
7280 <dt> ‘<samp>clev, center_mix_level</samp>’</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].
7285 <dt> ‘<samp>slev, surround_mix_level</samp>’</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].
7290 <dt> ‘<samp>lfe_mix_level</samp>’</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].
7296 <dt> ‘<samp>rmvol, rematrix_volume</samp>’</dt>
7297 <dd><p>Set rematrix volume. Default value is 1.0.
7300 <dt> ‘<samp>rematrix_maxval</samp>’</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.
7306 <dt> ‘<samp>flags, swr_flags</samp>’</dt>
7307 <dd><p>Set flags used by the converter. Default value is 0.
7309 <p>It supports the following individual flags:
7310 </p><dl compact="compact">
7311 <dt> ‘<samp>res</samp>’</dt>
7312 <dd><p>force resampling, this flag forces resampling to be used even when the
7313 input and output sample rates match.
7318 <dt> ‘<samp>dither_scale</samp>’</dt>
7319 <dd><p>Set the dither scale. Default value is 1.
7322 <dt> ‘<samp>dither_method</samp>’</dt>
7323 <dd><p>Set dither method. Default value is 0.
7325 <p>Supported values:
7326 </p><dl compact="compact">
7327 <dt> ‘<samp>rectangular</samp>’</dt>
7328 <dd><p>select rectangular dither
7330 <dt> ‘<samp>triangular</samp>’</dt>
7331 <dd><p>select triangular dither
7333 <dt> ‘<samp>triangular_hp</samp>’</dt>
7334 <dd><p>select triangular dither with high pass
7336 <dt> ‘<samp>lipshitz</samp>’</dt>
7337 <dd><p>select lipshitz noise shaping dither
7339 <dt> ‘<samp>shibata</samp>’</dt>
7340 <dd><p>select shibata noise shaping dither
7342 <dt> ‘<samp>low_shibata</samp>’</dt>
7343 <dd><p>select low shibata noise shaping dither
7345 <dt> ‘<samp>high_shibata</samp>’</dt>
7346 <dd><p>select high shibata noise shaping dither
7348 <dt> ‘<samp>f_weighted</samp>’</dt>
7349 <dd><p>select f-weighted noise shaping dither
7351 <dt> ‘<samp>modified_e_weighted</samp>’</dt>
7352 <dd><p>select modified-e-weighted noise shaping dither
7354 <dt> ‘<samp>improved_e_weighted</samp>’</dt>
7355 <dd><p>select improved-e-weighted noise shaping dither
7361 <dt> ‘<samp>resampler</samp>’</dt>
7362 <dd><p>Set resampling engine. Default value is swr.
7364 <p>Supported values:
7365 </p><dl compact="compact">
7366 <dt> ‘<samp>swr</samp>’</dt>
7367 <dd><p>select the native SW Resampler; filter options precision and cheby are not
7368 applicable in this case.
7370 <dt> ‘<samp>soxr</samp>’</dt>
7371 <dd><p>select the SoX Resampler (where available); compensation, and filter options
7372 filter_size, phase_shift, filter_type & kaiser_beta, are not applicable in this
7378 <dt> ‘<samp>filter_size</samp>’</dt>
7379 <dd><p>For swr only, set resampling filter size, default value is 32.
7382 <dt> ‘<samp>phase_shift</samp>’</dt>
7383 <dd><p>For swr only, set resampling phase shift, default value is 10, and must be in
7384 the interval [0,30].
7387 <dt> ‘<samp>linear_interp</samp>’</dt>
7388 <dd><p>Use Linear Interpolation if set to 1, default value is 0.
7391 <dt> ‘<samp>cutoff</samp>’</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).
7397 <dt> ‘<samp>precision</samp>’</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’s ’High Quality’; a
7401 value of 28 gives SoX’s ’Very High Quality’.
7404 <dt> ‘<samp>cheby</samp>’</dt>
7405 <dd><p>For soxr only, selects passband rolloff none (Chebyshev) & higher-precision
7406 approximation for ’irrational’ ratios. Default value is 0.
7409 <dt> ‘<samp>async</samp>’</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.
7418 <dt> ‘<samp>first_pts</samp>’</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’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.
7427 <dt> ‘<samp>min_comp</samp>’</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 (‘<samp>min_comp</samp>’ = <code>FLT_MAX</code>).
7435 <dt> ‘<samp>min_hard_comp</samp>’</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 ‘<samp>min_comp</samp>’.
7444 <dt> ‘<samp>comp_duration</samp>’</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.
7450 <dt> ‘<samp>max_soft_comp</samp>’</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
7456 <dt> ‘<samp>matrix_encoding</samp>’</dt>
7457 <dd><p>Select matrixed stereo encoding.
7459 <p>It accepts the following values:
7460 </p><dl compact="compact">
7461 <dt> ‘<samp>none</samp>’</dt>
7464 <dt> ‘<samp>dolby</samp>’</dt>
7467 <dt> ‘<samp>dplii</samp>’</dt>
7468 <dd><p>select Dolby Pro Logic II
7472 <p>Default value is <code>none</code>.
7475 <dt> ‘<samp>filter_type</samp>’</dt>
7476 <dd><p>For swr only, select resampling filter type. This only affects resampling
7479 <p>It accepts the following values:
7480 </p><dl compact="compact">
7481 <dt> ‘<samp>cubic</samp>’</dt>
7484 <dt> ‘<samp>blackman_nuttall</samp>’</dt>
7485 <dd><p>select Blackman Nuttall Windowed Sinc
7487 <dt> ‘<samp>kaiser</samp>’</dt>
7488 <dd><p>select Kaiser Windowed Sinc
7493 <dt> ‘<samp>kaiser_beta</samp>’</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.
7498 <dt> ‘<samp>output_sample_bits</samp>’</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’s not used.
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>
7509 <p>The video scaler supports the following named options.
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 ‘<tt>libavutil/opt.h</tt>’ API.
7515 <dl compact="compact">
7517 <p><a name="sws_005fflags"></a>
7519 <dt> ‘<samp>sws_flags</samp>’</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.
7523 <p>It accepts the following values:
7524 </p><dl compact="compact">
7525 <dt> ‘<samp>fast_bilinear</samp>’</dt>
7526 <dd><p>Select fast bilinear scaling algorithm.
7529 <dt> ‘<samp>bilinear</samp>’</dt>
7530 <dd><p>Select bilinear scaling algorithm.
7533 <dt> ‘<samp>bicubic</samp>’</dt>
7534 <dd><p>Select bicubic scaling algorithm.
7537 <dt> ‘<samp>experimental</samp>’</dt>
7538 <dd><p>Select experimental scaling algorithm.
7541 <dt> ‘<samp>neighbor</samp>’</dt>
7542 <dd><p>Select nearest neighbor rescaling algorithm.
7545 <dt> ‘<samp>area</samp>’</dt>
7546 <dd><p>Select averaging area rescaling algorithm.
7549 <dt> ‘<samp>bicublin</samp>’</dt>
7550 <dd><p>Select bicubic scaling algorithm for the luma component, bilinear for
7554 <dt> ‘<samp>gauss</samp>’</dt>
7555 <dd><p>Select Gaussian rescaling algorithm.
7558 <dt> ‘<samp>sinc</samp>’</dt>
7559 <dd><p>Select sinc rescaling algorithm.
7562 <dt> ‘<samp>lanczos</samp>’</dt>
7563 <dd><p>Select lanczos rescaling algorithm.
7566 <dt> ‘<samp>spline</samp>’</dt>
7567 <dd><p>Select natural bicubic spline rescaling algorithm.
7570 <dt> ‘<samp>print_info</samp>’</dt>
7571 <dd><p>Enable printing/debug logging.
7574 <dt> ‘<samp>accurate_rnd</samp>’</dt>
7575 <dd><p>Enable accurate rounding.
7578 <dt> ‘<samp>full_chroma_int</samp>’</dt>
7579 <dd><p>Enable full chroma interpolation.
7582 <dt> ‘<samp>full_chroma_inp</samp>’</dt>
7583 <dd><p>Select full chroma input.
7586 <dt> ‘<samp>bitexact</samp>’</dt>
7587 <dd><p>Enable bitexact output.
7592 <dt> ‘<samp>srcw</samp>’</dt>
7593 <dd><p>Set source width.
7596 <dt> ‘<samp>srch</samp>’</dt>
7597 <dd><p>Set source height.
7600 <dt> ‘<samp>dstw</samp>’</dt>
7601 <dd><p>Set destination width.
7604 <dt> ‘<samp>dsth</samp>’</dt>
7605 <dd><p>Set destination height.
7608 <dt> ‘<samp>src_format</samp>’</dt>
7609 <dd><p>Set source pixel format (must be expressed as an integer).
7612 <dt> ‘<samp>dst_format</samp>’</dt>
7613 <dd><p>Set destination pixel format (must be expressed as an integer).
7616 <dt> ‘<samp>src_range</samp>’</dt>
7617 <dd><p>Select source range.
7620 <dt> ‘<samp>dst_range</samp>’</dt>
7621 <dd><p>Select destination range.
7624 <dt> ‘<samp>param0, param1</samp>’</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.
7630 <dt> ‘<samp>sws_dither</samp>’</dt>
7631 <dd><p>Set the dithering algorithm. Accepts one of the following
7632 values. Default value is ‘<samp>auto</samp>’.
7634 <dl compact="compact">
7635 <dt> ‘<samp>auto</samp>’</dt>
7636 <dd><p>automatic choice
7639 <dt> ‘<samp>none</samp>’</dt>
7643 <dt> ‘<samp>bayer</samp>’</dt>
7647 <dt> ‘<samp>ed</samp>’</dt>
7648 <dd><p>error diffusion dither
7655 <a name="Filtering-Introduction"></a>
7656 <h1 class="chapter"><a href="ffplay-all.html#toc-Filtering-Introduction">21. Filtering Introduction</a></h1>
7658 <p>Filtering in FFmpeg is enabled through the libavfilter library.
7660 <p>In libavfilter, a filter can have multiple inputs and multiple
7662 To illustrate the sorts of things that are possible, we consider the
7663 following filtergraph.
7665 <table><tr><td> </td><td><pre class="example"> [main]
7666 input --> split ---------------------> overlay --> output
7669 +-----> crop --> vflip -------+
7670 </pre></td></tr></table>
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:
7677 <table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -vf "split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2" OUTPUT
7678 </pre></td></tr></table>
7680 <p>The result will be that in output the top half of the video is mirrored
7681 onto the bottom half.
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>.
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.
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
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
7707 <a name="graph2dot"></a>
7708 <h1 class="chapter"><a href="ffplay-all.html#toc-graph2dot">22. graph2dot</a></h1>
7710 <p>The ‘<tt>graph2dot</tt>’ program included in the FFmpeg ‘<tt>tools</tt>’
7711 directory can be used to parse a filtergraph description and issue a
7712 corresponding textual representation in the dot language.
7714 <p>Invoke the command:
7715 </p><table><tr><td> </td><td><pre class="example">graph2dot -h
7716 </pre></td></tr></table>
7718 <p>to see how to use ‘<tt>graph2dot</tt>’.
7720 <p>You can then pass the dot description to the ‘<tt>dot</tt>’ program (from
7721 the graphviz suite of programs) and obtain a graphical representation
7724 <p>For example the sequence of commands:
7725 </p><table><tr><td> </td><td><pre class="example">echo <var>GRAPH_DESCRIPTION</var> | \
7726 tools/graph2dot -o graph.tmp && \
7727 dot -Tpng graph.tmp -o graph.png && \
7729 </pre></td></tr></table>
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> </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> </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.
7744 <a name="Filtergraph-description"></a>
7745 <h1 class="chapter"><a href="ffplay-all.html#toc-Filtergraph-description">23. Filtergraph description</a></h1>
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.
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.
7757 <p>A filter with no input pads is called a "source", a filter with no
7758 output pads is called a "sink".
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>
7764 <p>A filtergraph can be represented using a textual representation, which is
7765 recognized by the ‘<samp>-filter</samp>’/‘<samp>-vf</samp>’ and ‘<samp>-filter_complex</samp>’
7766 options in <code>ffmpeg</code> and ‘<samp>-vf</samp>’ in <code>ffplay</code>, and by the
7767 <code>avfilter_graph_parse()</code>/<code>avfilter_graph_parse2()</code> function defined in
7768 ‘<tt>libavfilter/avfilter.h</tt>’.
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 ","-separated filter descriptions.
7774 <p>A filtergraph consists of a sequence of filterchains. A sequence of
7775 filterchains is represented by a list of ";"-separated filterchain
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>]
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 "=<var>arguments</var>".
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:
7791 A ’:’-separated list of <var>key=value</var> pairs.
7794 A ’:’-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 – ‘<samp>type</samp>’, ‘<samp>start_frame</samp>’ and
7797 ‘<samp>nb_frames</samp>’. Then the parameter list <var>in:0:30</var> means that the value
7798 <var>in</var> is assigned to the option ‘<samp>type</samp>’, <var>0</var> to
7799 ‘<samp>start_frame</samp>’ and <var>30</var> to ‘<samp>nb_frames</samp>’.
7802 A ’:’-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.
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
7813 <p>The list of arguments can be quoted using the character "’" as initial
7814 and ending mark, and the character ’\’ 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 "[]=;,") is encountered.
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.
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
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> </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 "L1", the first input pad of overlay is labelled "L2", and the second
7839 output pad of split is linked to the second input pad of overlay,
7840 which are both unlabelled.
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.
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.
7852 <p>Follows a BNF description for the filtergraph syntax:
7853 </p><table><tr><td> </td><td><pre class="example"><var>NAME</var> ::= sequence of alphanumeric characters and '_'
7854 <var>LINKLABEL</var> ::= "[" <var>NAME</var> "]"
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> ["=" <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>
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>
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.
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>.
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.
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.
7881 <p>For example, consider the following string to be embedded in
7882 the <a href="#drawtext">drawtext</a> filter description ‘<samp>text</samp>’ value:
7883 </p><table><tr><td> </td><td><pre class="example">this is a 'string': may contain one, or more, special characters
7884 </pre></td></tr></table>
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> </td><td><pre class="example">text=this is a \'string\'\: may contain one, or more, special characters
7889 </pre></td></tr></table>
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> </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).
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> </td><td><pre class="example">-vf "drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters"
7905 </pre></td></tr></table>
7907 <a name="Timeline-editing"></a>
7908 <h1 class="chapter"><a href="ffplay-all.html#toc-Timeline-editing">24. Timeline editing</a></h1>
7910 <p>Some filters support a generic ‘<samp>enable</samp>’ 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.
7916 <p>The expression accepts the following values:
7917 </p><dl compact="compact">
7918 <dt> ‘<samp>t</samp>’</dt>
7919 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
7922 <dt> ‘<samp>n</samp>’</dt>
7923 <dd><p>sequential number of the input frame, starting from 0
7926 <dt> ‘<samp>pos</samp>’</dt>
7927 <dd><p>the position in the file of the input frame, NAN if unknown
7931 <p>Additionally, these filters support an ‘<samp>enable</samp>’ command that can be used
7932 to re-define the expression.
7934 <p>Like any other filtering option, the ‘<samp>enable</samp>’ option follows the same
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> </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>
7944 <a name="Audio-Filters"></a>
7945 <h1 class="chapter"><a href="ffplay-all.html#toc-Audio-Filters">25. Audio Filters</a></h1>
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
7952 <p>Below is a description of the currently available audio filters.
7954 <a name="aconvert"></a>
7955 <h2 class="section"><a href="ffplay-all.html#toc-aconvert">25.1 aconvert</a></h2>
7957 <p>Convert the input audio format to the specified formats.
7959 <p><em>This filter is deprecated. Use <a href="#aformat">aformat</a> instead.</em>
7961 <p>The filter accepts a string of the form:
7962 "<var>sample_format</var>:<var>channel_layout</var>".
7964 <p><var>sample_format</var> specifies the sample format, and can be a string or the
7965 corresponding numeric value defined in ‘<tt>libavutil/samplefmt.h</tt>’. Use ’p’
7966 suffix for a planar sample format.
7968 <p><var>channel_layout</var> specifies the channel layout, and can be a string
7969 or the corresponding number value defined in ‘<tt>libavutil/channel_layout.h</tt>’.
7971 <p>The special parameter "auto", signifies that the filter will
7972 automatically select the output format depending on the output filter.
7974 <a name="Examples-18"></a>
7975 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-18">25.1.1 Examples</a></h3>
7979 Convert input to float, planar, stereo:
7980 <table><tr><td> </td><td><pre class="example">aconvert=fltp:stereo
7981 </pre></td></tr></table>
7984 Convert input to unsigned 8-bit, automatically select out channel layout:
7985 <table><tr><td> </td><td><pre class="example">aconvert=u8:auto
7986 </pre></td></tr></table>
7989 <a name="adelay"></a>
7990 <h2 class="section"><a href="ffplay-all.html#toc-adelay">25.2 adelay</a></h2>
7992 <p>Delay one or more audio channels.
7994 <p>Samples in delayed channel are filled with silence.
7996 <p>The filter accepts the following option:
7998 <dl compact="compact">
7999 <dt> ‘<samp>delays</samp>’</dt>
8000 <dd><p>Set list of delays in milliseconds for each channel separated by ’|’.
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.
8007 <a name="Examples-30"></a>
8008 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-30">25.2.1 Examples</a></h3>
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> </td><td><pre class="example">adelay=1500|0|500
8015 </pre></td></tr></table>
8018 <a name="aecho"></a>
8019 <h2 class="section"><a href="ffplay-all.html#toc-aecho">25.3 aecho</a></h2>
8021 <p>Apply echoing to the input audio.
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.
8031 <p>A description of the accepted parameters follows.
8033 <dl compact="compact">
8034 <dt> ‘<samp>in_gain</samp>’</dt>
8035 <dd><p>Set input gain of reflected signal. Default is <code>0.6</code>.
8038 <dt> ‘<samp>out_gain</samp>’</dt>
8039 <dd><p>Set output gain of reflected signal. Default is <code>0.3</code>.
8042 <dt> ‘<samp>delays</samp>’</dt>
8043 <dd><p>Set list of time intervals in milliseconds between original signal and reflections
8044 separated by ’|’. Allowed range for each <code>delay</code> is <code>(0 - 90000.0]</code>.
8045 Default is <code>1000</code>.
8048 <dt> ‘<samp>decays</samp>’</dt>
8049 <dd><p>Set list of loudnesses of reflected signals separated by ’|’.
8050 Allowed range for each <code>decay</code> is <code>(0 - 1.0]</code>.
8051 Default is <code>0.5</code>.
8055 <a name="Examples-41"></a>
8056 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-41">25.3.1 Examples</a></h3>
8060 Make it sound as if there are twice as many instruments as are actually playing:
8061 <table><tr><td> </td><td><pre class="example">aecho=0.8:0.88:60:0.4
8062 </pre></td></tr></table>
8065 If delay is very short, then it sound like a (metallic) robot playing music:
8066 <table><tr><td> </td><td><pre class="example">aecho=0.8:0.88:6:0.4
8067 </pre></td></tr></table>
8070 A longer delay will sound like an open air concert in the mountains:
8071 <table><tr><td> </td><td><pre class="example">aecho=0.8:0.9:1000:0.3
8072 </pre></td></tr></table>
8075 Same as above but with one more mountain:
8076 <table><tr><td> </td><td><pre class="example">aecho=0.8:0.9:1000|1800:0.3|0.25
8077 </pre></td></tr></table>
8080 <a name="aeval"></a>
8081 <h2 class="section"><a href="ffplay-all.html#toc-aeval">25.4 aeval</a></h2>
8083 <p>Modify an audio signal according to the specified expressions.
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.
8088 <p>This filter accepts the following options:
8090 <dl compact="compact">
8091 <dt> ‘<samp>exprs</samp>’</dt>
8092 <dd><p>Set the ’|’-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
8098 <dt> ‘<samp>channel_layout, c</samp>’</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 ‘<samp>same</samp>’, it will
8101 use by default the same input channel layout.
8105 <p>Each expression in <var>exprs</var> can contain the following constants and functions:
8107 <dl compact="compact">
8108 <dt> ‘<samp>ch</samp>’</dt>
8109 <dd><p>channel number of the current expression
8112 <dt> ‘<samp>n</samp>’</dt>
8113 <dd><p>number of the evaluated sample, starting from 0
8116 <dt> ‘<samp>s</samp>’</dt>
8120 <dt> ‘<samp>t</samp>’</dt>
8121 <dd><p>time of the evaluated sample expressed in seconds
8124 <dt> ‘<samp>nb_in_channels</samp>’</dt>
8125 <dt> ‘<samp>nb_out_channels</samp>’</dt>
8126 <dd><p>input and output number of channels
8129 <dt> ‘<samp>val(CH)</samp>’</dt>
8130 <dd><p>the value of input channel with number <var>CH</var>
8134 <p>Note: this filter is slow. For faster processing you should use a
8137 <a name="Examples-21"></a>
8138 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-21">25.4.1 Examples</a></h3>
8143 <table><tr><td> </td><td><pre class="example">aeval=val(ch)/2:c=same
8144 </pre></td></tr></table>
8147 Invert phase of the second channel:
8148 <table><tr><td> </td><td><pre class="example">eval=val(0)|-val(1)
8149 </pre></td></tr></table>
8152 <a name="afade"></a>
8153 <h2 class="section"><a href="ffplay-all.html#toc-afade">25.5 afade</a></h2>
8155 <p>Apply fade-in/out effect to input audio.
8157 <p>A description of the accepted parameters follows.
8159 <dl compact="compact">
8160 <dt> ‘<samp>type, t</samp>’</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>.
8165 <dt> ‘<samp>start_sample, ss</samp>’</dt>
8166 <dd><p>Specify the number of the start sample for starting to apply the fade
8167 effect. Default is 0.
8170 <dt> ‘<samp>nb_samples, ns</samp>’</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.
8177 <dt> ‘<samp>start_time, st</samp>’</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> </td><td><pre class="example">[-]HH[:MM[:SS[.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.
8187 <dt> ‘<samp>duration, d</samp>’</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> </td><td><pre class="example">[-]HH[:MM[:SS[.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.
8200 <dt> ‘<samp>curve</samp>’</dt>
8201 <dd><p>Set curve for fade transition.
8203 <p>It accepts the following values:
8204 </p><dl compact="compact">
8205 <dt> ‘<samp>tri</samp>’</dt>
8206 <dd><p>select triangular, linear slope (default)
8208 <dt> ‘<samp>qsin</samp>’</dt>
8209 <dd><p>select quarter of sine wave
8211 <dt> ‘<samp>hsin</samp>’</dt>
8212 <dd><p>select half of sine wave
8214 <dt> ‘<samp>esin</samp>’</dt>
8215 <dd><p>select exponential sine wave
8217 <dt> ‘<samp>log</samp>’</dt>
8218 <dd><p>select logarithmic
8220 <dt> ‘<samp>par</samp>’</dt>
8221 <dd><p>select inverted parabola
8223 <dt> ‘<samp>qua</samp>’</dt>
8224 <dd><p>select quadratic
8226 <dt> ‘<samp>cub</samp>’</dt>
8229 <dt> ‘<samp>squ</samp>’</dt>
8230 <dd><p>select square root
8232 <dt> ‘<samp>cbr</samp>’</dt>
8233 <dd><p>select cubic root
8239 <a name="Examples-72"></a>
8240 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-72">25.5.1 Examples</a></h3>
8244 Fade in first 15 seconds of audio:
8245 <table><tr><td> </td><td><pre class="example">afade=t=in:ss=0:d=15
8246 </pre></td></tr></table>
8249 Fade out last 25 seconds of a 900 seconds audio:
8250 <table><tr><td> </td><td><pre class="example">afade=t=out:st=875:d=25
8251 </pre></td></tr></table>
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>
8258 <p>Set output format constraints for the input audio. The framework will
8259 negotiate the most appropriate format to minimize conversions.
8261 <p>The filter accepts the following named parameters:
8262 </p><dl compact="compact">
8263 <dt> ‘<samp>sample_fmts</samp>’</dt>
8264 <dd><p>A ’|’-separated list of requested sample formats.
8267 <dt> ‘<samp>sample_rates</samp>’</dt>
8268 <dd><p>A ’|’-separated list of requested sample rates.
8271 <dt> ‘<samp>channel_layouts</samp>’</dt>
8272 <dd><p>A ’|’-separated list of requested channel layouts.
8274 <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)channel layout syntax</a>
8275 for the required syntax.
8279 <p>If a parameter is omitted, all values are allowed.
8281 <p>For example to force the output to either unsigned 8-bit or signed 16-bit stereo:
8282 </p><table><tr><td> </td><td><pre class="example">aformat=sample_fmts=u8|s16:channel_layouts=stereo
8283 </pre></td></tr></table>
8285 <a name="allpass"></a>
8286 <h2 class="section"><a href="ffplay-all.html#toc-allpass">25.7 allpass</a></h2>
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’s frequency to phase relationship
8291 without changing its frequency to amplitude relationship.
8293 <p>The filter accepts the following options:
8295 <dl compact="compact">
8296 <dt> ‘<samp>frequency, f</samp>’</dt>
8297 <dd><p>Set frequency in Hz.
8300 <dt> ‘<samp>width_type</samp>’</dt>
8301 <dd><p>Set method to specify band-width of filter.
8302 </p><dl compact="compact">
8303 <dt> ‘<samp>h</samp>’</dt>
8306 <dt> ‘<samp>q</samp>’</dt>
8309 <dt> ‘<samp>o</samp>’</dt>
8312 <dt> ‘<samp>s</samp>’</dt>
8318 <dt> ‘<samp>width, w</samp>’</dt>
8319 <dd><p>Specify the band-width of a filter in width_type units.
8323 <a name="amerge"></a>
8324 <h2 class="section"><a href="ffplay-all.html#toc-amerge">25.8 amerge</a></h2>
8326 <p>Merge two or more audio streams into a single multi-channel stream.
8328 <p>The filter accepts the following options:
8330 <dl compact="compact">
8331 <dt> ‘<samp>inputs</samp>’</dt>
8332 <dd><p>Set the number of inputs. Default is 2.
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
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).
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.
8354 <p>All inputs must have the same sample rate, and format.
8356 <p>If inputs do not have the same duration, the output will stop with the
8359 <a name="Examples-28"></a>
8360 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-28">25.8.1 Examples</a></h3>
8364 Merge two mono files into a stereo stream:
8365 <table><tr><td> </td><td><pre class="example">amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
8366 </pre></td></tr></table>
8369 Multiple merges assuming 1 video stream and 6 audio streams in ‘<tt>input.mkv</tt>’:
8370 <table><tr><td> </td><td><pre class="example">ffmpeg -i input.mkv -filter_complex "[0:1][0:2][0:3][0:4][0:5][0:6] amerge=inputs=6" -c:a pcm_s16le output.mkv
8371 </pre></td></tr></table>
8375 <h2 class="section"><a href="ffplay-all.html#toc-amix">25.9 amix</a></h2>
8377 <p>Mixes multiple audio inputs into a single output.
8380 </p><table><tr><td> </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.
8385 <p>The filter accepts the following named parameters:
8386 </p><dl compact="compact">
8387 <dt> ‘<samp>inputs</samp>’</dt>
8388 <dd><p>Number of inputs. If unspecified, it defaults to 2.
8391 <dt> ‘<samp>duration</samp>’</dt>
8392 <dd><p>How to determine the end-of-stream.
8393 </p><dl compact="compact">
8394 <dt> ‘<samp>longest</samp>’</dt>
8395 <dd><p>Duration of longest input. (default)
8398 <dt> ‘<samp>shortest</samp>’</dt>
8399 <dd><p>Duration of shortest input.
8402 <dt> ‘<samp>first</samp>’</dt>
8403 <dd><p>Duration of first input.
8409 <dt> ‘<samp>dropout_transition</samp>’</dt>
8410 <dd><p>Transition time, in seconds, for volume renormalization when an input
8411 stream ends. The default value is 2 seconds.
8416 <a name="anull"></a>
8417 <h2 class="section"><a href="ffplay-all.html#toc-anull">25.10 anull</a></h2>
8419 <p>Pass the audio source unchanged to the output.
8422 <h2 class="section"><a href="ffplay-all.html#toc-apad">25.11 apad</a></h2>
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.
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.
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.
8434 <p>A description of the accepted parameters follows.
8436 <dl compact="compact">
8437 <dt> ‘<samp>in_gain</samp>’</dt>
8438 <dd><p>Set input gain. Default is 0.4.
8441 <dt> ‘<samp>out_gain</samp>’</dt>
8442 <dd><p>Set output gain. Default is 0.74
8445 <dt> ‘<samp>delay</samp>’</dt>
8446 <dd><p>Set delay in milliseconds. Default is 3.0.
8449 <dt> ‘<samp>decay</samp>’</dt>
8450 <dd><p>Set decay. Default is 0.4.
8453 <dt> ‘<samp>speed</samp>’</dt>
8454 <dd><p>Set modulation speed in Hz. Default is 0.5.
8457 <dt> ‘<samp>type</samp>’</dt>
8458 <dd><p>Set modulation type. Default is triangular.
8460 <p>It accepts the following values:
8461 </p><dl compact="compact">
8462 <dt> ‘<samp>triangular, t</samp>’</dt>
8463 <dt> ‘<samp>sinusoidal, s</samp>’</dt>
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>
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.
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.
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 ":". See the
8484 ffmpeg-resampler manual for the complete list of supported options.
8486 <a name="Examples-84"></a>
8487 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-84">25.13.1 Examples</a></h3>
8491 Resample the input audio to 44100Hz:
8492 <table><tr><td> </td><td><pre class="example">aresample=44100
8493 </pre></td></tr></table>
8496 Stretch/squeeze samples to the given timestamps, with a maximum of 1000
8497 samples per second compensation:
8498 <table><tr><td> </td><td><pre class="example">aresample=async=1000
8499 </pre></td></tr></table>
8502 <a name="asetnsamples"></a>
8503 <h2 class="section"><a href="ffplay-all.html#toc-asetnsamples">25.14 asetnsamples</a></h2>
8505 <p>Set the number of samples per each output audio frame.
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
8511 <p>The filter accepts the following options:
8513 <dl compact="compact">
8514 <dt> ‘<samp>nb_out_samples, n</samp>’</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.
8520 <dt> ‘<samp>pad, p</samp>’</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.
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> </td><td><pre class="example">asetnsamples=n=1234:p=0
8530 </pre></td></tr></table>
8532 <a name="asetrate"></a>
8533 <h2 class="section"><a href="ffplay-all.html#toc-asetrate">25.15 asetrate</a></h2>
8535 <p>Set the sample rate without altering the PCM data.
8536 This will result in a change of speed and pitch.
8538 <p>The filter accepts the following options:
8540 <dl compact="compact">
8541 <dt> ‘<samp>sample_rate, r</samp>’</dt>
8542 <dd><p>Set the output sample rate. Default is 44100 Hz.
8546 <a name="ashowinfo"></a>
8547 <h2 class="section"><a href="ffplay-all.html#toc-ashowinfo">25.16 ashowinfo</a></h2>
8549 <p>Show a line containing various information for each input audio frame.
8550 The input audio is not modified.
8552 <p>The shown line contains a sequence of key/value pairs of the form
8553 <var>key</var>:<var>value</var>.
8555 <p>A description of each shown parameter follows:
8557 <dl compact="compact">
8558 <dt> ‘<samp>n</samp>’</dt>
8559 <dd><p>sequential number of the input frame, starting from 0
8562 <dt> ‘<samp>pts</samp>’</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>.
8567 <dt> ‘<samp>pts_time</samp>’</dt>
8568 <dd><p>presentation timestamp of the input frame in seconds
8571 <dt> ‘<samp>pos</samp>’</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)
8576 <dt> ‘<samp>fmt</samp>’</dt>
8577 <dd><p>sample format
8580 <dt> ‘<samp>chlayout</samp>’</dt>
8581 <dd><p>channel layout
8584 <dt> ‘<samp>rate</samp>’</dt>
8585 <dd><p>sample rate for the audio frame
8588 <dt> ‘<samp>nb_samples</samp>’</dt>
8589 <dd><p>number of samples (per channel) in the frame
8592 <dt> ‘<samp>checksum</samp>’</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.
8597 <dt> ‘<samp>plane_checksums</samp>’</dt>
8598 <dd><p>A list of Adler-32 checksums for each data plane.
8602 <a name="astats"></a>
8603 <h2 class="section"><a href="ffplay-all.html#toc-astats">25.17 astats</a></h2>
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.
8609 <p>The filter accepts the following option:
8610 </p><dl compact="compact">
8611 <dt> ‘<samp>length</samp>’</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>.
8617 <p>A description of each shown parameter follows:
8619 <dl compact="compact">
8620 <dt> ‘<samp>DC offset</samp>’</dt>
8621 <dd><p>Mean amplitude displacement from zero.
8624 <dt> ‘<samp>Min level</samp>’</dt>
8625 <dd><p>Minimal sample level.
8628 <dt> ‘<samp>Max level</samp>’</dt>
8629 <dd><p>Maximal sample level.
8632 <dt> ‘<samp>Peak level dB</samp>’</dt>
8633 <dt> ‘<samp>RMS level dB</samp>’</dt>
8634 <dd><p>Standard peak and RMS level measured in dBFS.
8637 <dt> ‘<samp>RMS peak dB</samp>’</dt>
8638 <dt> ‘<samp>RMS trough dB</samp>’</dt>
8639 <dd><p>Peak and trough values for RMS level measured over a short window.
8642 <dt> ‘<samp>Crest factor</samp>’</dt>
8643 <dd><p>Standard ratio of peak to RMS level (note: not in dB).
8646 <dt> ‘<samp>Flat factor</samp>’</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>).
8651 <dt> ‘<samp>Peak count</samp>’</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>.
8657 <a name="astreamsync"></a>
8658 <h2 class="section"><a href="ffplay-all.html#toc-astreamsync">25.18 astreamsync</a></h2>
8660 <p>Forward two audio streams and control the order the buffers are forwarded.
8662 <p>The filter accepts the following options:
8664 <dl compact="compact">
8665 <dt> ‘<samp>expr, e</samp>’</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:
8671 <dl compact="compact">
8672 <dt> <var>b1 b2</var></dt>
8673 <dd><p>number of buffers forwarded so far on each stream
8675 <dt> <var>s1 s2</var></dt>
8676 <dd><p>number of samples forwarded so far on each stream
8678 <dt> <var>t1 t2</var></dt>
8679 <dd><p>current timestamp of each stream
8683 <p>The default value is <code>t1-t2</code>, which means to always forward the stream
8684 that has a smaller timestamp.
8688 <a name="Examples-35"></a>
8689 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-35">25.18.1 Examples</a></h3>
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> </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] ;
8696 </pre></td></tr></table>
8698 <a name="asyncts"></a>
8699 <h2 class="section"><a href="ffplay-all.html#toc-asyncts">25.19 asyncts</a></h2>
8701 <p>Synchronize audio data with timestamps by squeezing/stretching it and/or
8702 dropping samples/adding silence when needed.
8704 <p>This filter is not built by default, please use <a href="#aresample">aresample</a> to do squeezing/stretching.
8706 <p>The filter accepts the following named parameters:
8707 </p><dl compact="compact">
8708 <dt> ‘<samp>compensate</samp>’</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.
8713 <dt> ‘<samp>min_delta</samp>’</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.
8719 <dt> ‘<samp>max_comp</samp>’</dt>
8720 <dd><p>Maximum compensation in samples per second. Relevant only with compensate=1.
8724 <dt> ‘<samp>first_pts</samp>’</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’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.
8735 <a name="atempo"></a>
8736 <h2 class="section"><a href="ffplay-all.html#toc-atempo">25.20 atempo</a></h2>
8738 <p>Adjust audio tempo.
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.
8744 <a name="Examples-57"></a>
8745 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-57">25.20.1 Examples</a></h3>
8749 Slow down audio to 80% tempo:
8750 <table><tr><td> </td><td><pre class="example">atempo=0.8
8751 </pre></td></tr></table>
8754 To speed up audio to 125% tempo:
8755 <table><tr><td> </td><td><pre class="example">atempo=1.25
8756 </pre></td></tr></table>
8759 <a name="atrim"></a>
8760 <h2 class="section"><a href="ffplay-all.html#toc-atrim">25.21 atrim</a></h2>
8762 <p>Trim the input so that the output contains one continuous subpart of the input.
8764 <p>This filter accepts the following options:
8765 </p><dl compact="compact">
8766 <dt> ‘<samp>start</samp>’</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.
8771 <dt> ‘<samp>end</samp>’</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.
8777 <dt> ‘<samp>start_pts</samp>’</dt>
8778 <dd><p>Same as <var>start</var>, except this option sets the start timestamp in samples
8782 <dt> ‘<samp>end_pts</samp>’</dt>
8783 <dd><p>Same as <var>end</var>, except this option sets the end timestamp in samples instead
8787 <dt> ‘<samp>duration</samp>’</dt>
8788 <dd><p>Specify maximum duration of the output.
8791 <dt> ‘<samp>start_sample</samp>’</dt>
8792 <dd><p>Number of the first sample that should be passed to output.
8795 <dt> ‘<samp>end_sample</samp>’</dt>
8796 <dd><p>Number of the first sample that should be dropped.
8800 <p>‘<samp>start</samp>’, ‘<samp>end</samp>’, ‘<samp>duration</samp>’ are expressed as time
8801 duration specifications, check the "Time duration" section in the
8802 ffmpeg-utils manual.
8804 <p>Note that the first two sets of the start/end options and the ‘<samp>duration</samp>’
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
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
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.
8823 drop everything except the second minute of input
8824 <table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -af atrim=60:120
8825 </pre></td></tr></table>
8828 keep only the first 1000 samples
8829 <table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -af atrim=end_sample=1000
8830 </pre></td></tr></table>
8834 <a name="bandpass"></a>
8835 <h2 class="section"><a href="ffplay-all.html#toc-bandpass">25.22 bandpass</a></h2>
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).
8843 <p>The filter accepts the following options:
8845 <dl compact="compact">
8846 <dt> ‘<samp>frequency, f</samp>’</dt>
8847 <dd><p>Set the filter’s central frequency. Default is <code>3000</code>.
8850 <dt> ‘<samp>csg</samp>’</dt>
8851 <dd><p>Constant skirt gain if set to 1. Defaults to 0.
8854 <dt> ‘<samp>width_type</samp>’</dt>
8855 <dd><p>Set method to specify band-width of filter.
8856 </p><dl compact="compact">
8857 <dt> ‘<samp>h</samp>’</dt>
8860 <dt> ‘<samp>q</samp>’</dt>
8863 <dt> ‘<samp>o</samp>’</dt>
8866 <dt> ‘<samp>s</samp>’</dt>
8872 <dt> ‘<samp>width, w</samp>’</dt>
8873 <dd><p>Specify the band-width of a filter in width_type units.
8877 <a name="bandreject"></a>
8878 <h2 class="section"><a href="ffplay-all.html#toc-bandreject">25.23 bandreject</a></h2>
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).
8884 <p>The filter accepts the following options:
8886 <dl compact="compact">
8887 <dt> ‘<samp>frequency, f</samp>’</dt>
8888 <dd><p>Set the filter’s central frequency. Default is <code>3000</code>.
8891 <dt> ‘<samp>width_type</samp>’</dt>
8892 <dd><p>Set method to specify band-width of filter.
8893 </p><dl compact="compact">
8894 <dt> ‘<samp>h</samp>’</dt>
8897 <dt> ‘<samp>q</samp>’</dt>
8900 <dt> ‘<samp>o</samp>’</dt>
8903 <dt> ‘<samp>s</samp>’</dt>
8909 <dt> ‘<samp>width, w</samp>’</dt>
8910 <dd><p>Specify the band-width of a filter in width_type units.
8915 <h2 class="section"><a href="ffplay-all.html#toc-bass">25.24 bass</a></h2>
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’s tone-controls. This is also known as shelving equalisation (EQ).
8921 <p>The filter accepts the following options:
8923 <dl compact="compact">
8924 <dt> ‘<samp>gain, g</samp>’</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.
8930 <dt> ‘<samp>frequency, f</samp>’</dt>
8931 <dd><p>Set the filter’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.
8936 <dt> ‘<samp>width_type</samp>’</dt>
8937 <dd><p>Set method to specify band-width of filter.
8938 </p><dl compact="compact">
8939 <dt> ‘<samp>h</samp>’</dt>
8942 <dt> ‘<samp>q</samp>’</dt>
8945 <dt> ‘<samp>o</samp>’</dt>
8948 <dt> ‘<samp>s</samp>’</dt>
8954 <dt> ‘<samp>width, w</samp>’</dt>
8955 <dd><p>Determine how steep is the filter’s shelf transition.
8959 <a name="biquad"></a>
8960 <h2 class="section"><a href="ffplay-all.html#toc-biquad">25.25 biquad</a></h2>
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.
8966 <a name="channelmap"></a>
8967 <h2 class="section"><a href="ffplay-all.html#toc-channelmap">25.26 channelmap</a></h2>
8969 <p>Remap input channels to new locations.
8971 <p>This filter accepts the following named parameters:
8972 </p><dl compact="compact">
8973 <dt> ‘<samp>channel_layout</samp>’</dt>
8974 <dd><p>Channel layout of the output stream.
8977 <dt> ‘<samp>map</samp>’</dt>
8978 <dd><p>Map channels from input to output. The argument is a ’|’-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.
8988 <p>If no mapping is present, the filter will implicitly map input channels to
8989 output channels preserving index.
8991 <p>For example, assuming a 5.1+downmix input MOV file
8992 </p><table><tr><td> </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
8997 <p>To fix a 5.1 WAV improperly encoded in AAC’s native channel order
8998 </p><table><tr><td> </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>
9001 <a name="channelsplit"></a>
9002 <h2 class="section"><a href="ffplay-all.html#toc-channelsplit">25.27 channelsplit</a></h2>
9004 <p>Split each channel in input audio stream into a separate output stream.
9006 <p>This filter accepts the following named parameters:
9007 </p><dl compact="compact">
9008 <dt> ‘<samp>channel_layout</samp>’</dt>
9009 <dd><p>Channel layout of the input stream. Default is "stereo".
9013 <p>For example, assuming a stereo input MP3 file
9014 </p><table><tr><td> </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.
9019 <p>To split a 5.1 WAV file into per-channel files
9020 </p><table><tr><td> </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]'
9025 </pre></td></tr></table>
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.
9031 <p>A description of the accepted options follows.
9033 <dl compact="compact">
9034 <dt> ‘<samp>attacks</samp>’</dt>
9035 <dt> ‘<samp>decays</samp>’</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.
9045 <dt> ‘<samp>points</samp>’</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>
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>.
9057 <dt> ‘<samp>soft-knee</samp>’</dt>
9058 <dd><p>Set the curve radius in dB for all joints. Defaults to 0.01.
9061 <dt> ‘<samp>gain</samp>’</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.
9066 <dt> ‘<samp>volume</samp>’</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.
9074 <dt> ‘<samp>delay</samp>’</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.
9083 <a name="Examples-37"></a>
9084 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-37">25.28.1 Examples</a></h3>
9088 Make music with both quiet and loud passages suitable for listening in a noisy
9090 <table><tr><td> </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>
9094 Noise gate for when the noise is at a lower level than the signal:
9095 <table><tr><td> </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>
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> </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>
9105 <a name="earwax"></a>
9106 <h2 class="section"><a href="ffplay-all.html#toc-earwax">25.29 earwax</a></h2>
9108 <p>Make audio easier to listen to on headphones.
9110 <p>This filter adds ‘cues’ 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).
9117 <a name="equalizer"></a>
9118 <h2 class="section"><a href="ffplay-all.html#toc-equalizer">25.30 equalizer</a></h2>
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.
9125 <p>In order to produce complex equalisation curves, this filter can
9126 be given several times, each with a different central frequency.
9128 <p>The filter accepts the following options:
9130 <dl compact="compact">
9131 <dt> ‘<samp>frequency, f</samp>’</dt>
9132 <dd><p>Set the filter’s central frequency in Hz.
9135 <dt> ‘<samp>width_type</samp>’</dt>
9136 <dd><p>Set method to specify band-width of filter.
9137 </p><dl compact="compact">
9138 <dt> ‘<samp>h</samp>’</dt>
9141 <dt> ‘<samp>q</samp>’</dt>
9144 <dt> ‘<samp>o</samp>’</dt>
9147 <dt> ‘<samp>s</samp>’</dt>
9153 <dt> ‘<samp>width, w</samp>’</dt>
9154 <dd><p>Specify the band-width of a filter in width_type units.
9157 <dt> ‘<samp>gain, g</samp>’</dt>
9158 <dd><p>Set the required gain or attenuation in dB.
9159 Beware of clipping when using a positive gain.
9163 <a name="Examples-69"></a>
9164 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-69">25.30.1 Examples</a></h3>
9167 Attenuate 10 dB at 1000 Hz, with a bandwidth of 200 Hz:
9168 <table><tr><td> </td><td><pre class="example">equalizer=f=1000:width_type=h:width=200:g=-10
9169 </pre></td></tr></table>
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> </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>
9177 <a name="highpass"></a>
9178 <h2 class="section"><a href="ffplay-all.html#toc-highpass">25.31 highpass</a></h2>
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).
9184 <p>The filter accepts the following options:
9186 <dl compact="compact">
9187 <dt> ‘<samp>frequency, f</samp>’</dt>
9188 <dd><p>Set frequency in Hz. Default is 3000.
9191 <dt> ‘<samp>poles, p</samp>’</dt>
9192 <dd><p>Set number of poles. Default is 2.
9195 <dt> ‘<samp>width_type</samp>’</dt>
9196 <dd><p>Set method to specify band-width of filter.
9197 </p><dl compact="compact">
9198 <dt> ‘<samp>h</samp>’</dt>
9201 <dt> ‘<samp>q</samp>’</dt>
9204 <dt> ‘<samp>o</samp>’</dt>
9207 <dt> ‘<samp>s</samp>’</dt>
9213 <dt> ‘<samp>width, w</samp>’</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.
9221 <h2 class="section"><a href="ffplay-all.html#toc-join">25.32 join</a></h2>
9223 <p>Join multiple input streams into one multi-channel stream.
9225 <p>The filter accepts the following named parameters:
9226 </p><dl compact="compact">
9227 <dt> ‘<samp>inputs</samp>’</dt>
9228 <dd><p>Number of input streams. Defaults to 2.
9231 <dt> ‘<samp>channel_layout</samp>’</dt>
9232 <dd><p>Desired output channel layout. Defaults to stereo.
9235 <dt> ‘<samp>map</samp>’</dt>
9236 <dd><p>Map channels from inputs to output. The argument is a ’|’-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
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.
9249 <p>E.g. to join 3 inputs (with properly set channel layouts)
9250 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
9251 </pre></td></tr></table>
9253 <p>To build a 5.1 output from 6 single-channel streams:
9254 </p><table><tr><td> </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'
9257 </pre></td></tr></table>
9259 <a name="ladspa"></a>
9260 <h2 class="section"><a href="ffplay-all.html#toc-ladspa">25.33 ladspa</a></h2>
9262 <p>Load a LADSPA (Linux Audio Developer’s Simple Plugin API) plugin.
9264 <p>To enable compilation of this filter you need to configure FFmpeg with
9265 <code>--enable-ladspa</code>.
9267 <dl compact="compact">
9268 <dt> ‘<samp>file, f</samp>’</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: ‘<tt>HOME/.ladspa/lib/</tt>’, ‘<tt>/usr/local/lib/ladspa/</tt>’,
9274 ‘<tt>/usr/lib/ladspa/</tt>’.
9277 <dt> ‘<samp>plugin, p</samp>’</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.
9283 <dt> ‘<samp>controls, c</samp>’</dt>
9284 <dd><p>Set the ’|’ separated list of controls which are zero or more floating point
9285 values that determine the behavior of the loaded plugin (for example delay,
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 ‘<samp>controls</samp>’ is set to <code>help</code>, all available controls and
9291 their valid ranges are printed.
9294 <dt> ‘<samp>sample_rate, s</samp>’</dt>
9295 <dd><p>Specify the sample rate, default to 44100. Only used if plugin have
9299 <dt> ‘<samp>nb_samples, n</samp>’</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.
9304 <dt> ‘<samp>duration, d</samp>’</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 "Time duration"
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.
9317 <a name="Examples-54"></a>
9318 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-54">25.33.1 Examples</a></h3>
9322 List all available plugins within amp (LADSPA example plugin) library:
9323 <table><tr><td> </td><td><pre class="example">ladspa=file=amp
9324 </pre></td></tr></table>
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> </td><td><pre class="example">ladspa=f=vcf:p=vcf_notch:c=help
9330 </pre></td></tr></table>
9333 Simulate low quality audio equipment using <code>Computer Music Toolkit</code> (CMT)
9335 <table><tr><td> </td><td><pre class="example">ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12
9336 </pre></td></tr></table>
9339 Add reverberation to the audio using TAP-plugins
9340 (Tom’s Audio Processing plugins):
9341 <table><tr><td> </td><td><pre class="example">ladspa=file=tap_reverb:tap_reverb
9342 </pre></td></tr></table>
9345 Generate white noise, with 0.2 amplitude:
9346 <table><tr><td> </td><td><pre class="example">ladspa=file=cmt:noise_source_white:c=c0=.2
9347 </pre></td></tr></table>
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> </td><td><pre class="example">ladspa=file=caps:Click:c=c1=20'
9353 </pre></td></tr></table>
9356 Apply <code>C* Eq10X2 - Stereo 10-band equaliser</code> effect:
9357 <table><tr><td> </td><td><pre class="example">ladspa=caps:Eq10X2:c=c0=-48|c9=-24|c3=12|c4=2
9358 </pre></td></tr></table>
9361 <a name="Commands-1"></a>
9362 <h3 class="subsection"><a href="ffplay-all.html#toc-Commands-1">25.33.2 Commands</a></h3>
9364 <p>This filter supports the following commands:
9365 </p><dl compact="compact">
9366 <dt> ‘<samp>cN</samp>’</dt>
9367 <dd><p>Modify the <var>N</var>-th control value.
9369 <p>If the specified value is not valid, it is ignored and prior one is kept.
9373 <a name="lowpass"></a>
9374 <h2 class="section"><a href="ffplay-all.html#toc-lowpass">25.34 lowpass</a></h2>
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).
9380 <p>The filter accepts the following options:
9382 <dl compact="compact">
9383 <dt> ‘<samp>frequency, f</samp>’</dt>
9384 <dd><p>Set frequency in Hz. Default is 500.
9387 <dt> ‘<samp>poles, p</samp>’</dt>
9388 <dd><p>Set number of poles. Default is 2.
9391 <dt> ‘<samp>width_type</samp>’</dt>
9392 <dd><p>Set method to specify band-width of filter.
9393 </p><dl compact="compact">
9394 <dt> ‘<samp>h</samp>’</dt>
9397 <dt> ‘<samp>q</samp>’</dt>
9400 <dt> ‘<samp>o</samp>’</dt>
9403 <dt> ‘<samp>s</samp>’</dt>
9409 <dt> ‘<samp>width, w</samp>’</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.
9417 <h2 class="section"><a href="ffplay-all.html#toc-pan">25.35 pan</a></h2>
9419 <p>Mix channels with specific gain levels. The filter accepts the output
9420 channel layout followed by a set of channels definitions.
9422 <p>This filter is also designed to remap efficiently the channels of an audio
9425 <p>The filter accepts parameters of the form:
9426 "<var>l</var>:<var>outdef</var>:<var>outdef</var>:..."
9428 <dl compact="compact">
9429 <dt> ‘<samp>l</samp>’</dt>
9430 <dd><p>output channel layout or number of channels
9433 <dt> ‘<samp>outdef</samp>’</dt>
9434 <dd><p>output channel specification, of the form:
9435 "<var>out_name</var>=[<var>gain</var>*]<var>in_name</var>[+[<var>gain</var>*]<var>in_name</var>...]"
9438 <dt> ‘<samp>out_name</samp>’</dt>
9439 <dd><p>output channel to define, either a channel name (FL, FR, etc.) or a channel
9440 number (c0, c1, etc.)
9443 <dt> ‘<samp>gain</samp>’</dt>
9444 <dd><p>multiplicative coefficient for the channel, 1 leaving the volume unchanged
9447 <dt> ‘<samp>in_name</samp>’</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
9453 <p>If the ‘=’ in a channel specification is replaced by ‘<’, then the gains for
9454 that specification will be renormalized so that the total is 1, thus
9455 avoiding clipping noise.
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>
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> </td><td><pre class="example">pan=1:c0=0.9*c0+0.1*c1
9463 </pre></td></tr></table>
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> </td><td><pre class="example">pan=stereo: FL < FL + 0.5*FC + 0.6*BL + 0.6*SL : FR < FR + 0.5*FC + 0.6*BR + 0.6*SR
9468 </pre></td></tr></table>
9470 <p>Note that <code>ffmpeg</code> integrates a default down-mix (and up-mix) system
9471 that should be preferred (see "-ac" option) unless you have very specific
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>
9477 <p>The channel remapping will be effective if, and only if:
9480 <li> gain coefficients are zeroes or ones,
9481 </li><li> only one input per channel output,
9484 <p>If all these conditions are satisfied, the filter will notify the user ("Pure
9485 channel mapping detected"), and use an optimized and lossless method to do the
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> </td><td><pre class="example">pan="stereo: c0=FL : c1=FR"
9491 </pre></td></tr></table>
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> </td><td><pre class="example">pan="5.1: c0=c1 : c1=c0 : c2=c2 : c3=c3 : c4=c4 : c5=c5"
9496 </pre></td></tr></table>
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> </td><td><pre class="example">pan="stereo:c1=c1"
9501 </pre></td></tr></table>
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> </td><td><pre class="example">pan="stereo: c0=FR : c1=FR"
9506 </pre></td></tr></table>
9508 <a name="replaygain"></a>
9509 <h2 class="section"><a href="ffplay-all.html#toc-replaygain">25.36 replaygain</a></h2>
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>.
9515 <a name="resample"></a>
9516 <h2 class="section"><a href="ffplay-all.html#toc-resample">25.37 resample</a></h2>
9518 <p>Convert the audio sample format, sample rate and channel layout. This filter is
9519 not meant to be used directly.
9521 <a name="silencedetect"></a>
9522 <h2 class="section"><a href="ffplay-all.html#toc-silencedetect">25.38 silencedetect</a></h2>
9524 <p>Detect silence in an audio stream.
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.
9530 <p>The printed times and duration are expressed in seconds.
9532 <p>The filter accepts the following options:
9534 <dl compact="compact">
9535 <dt> ‘<samp>duration, d</samp>’</dt>
9536 <dd><p>Set silence duration until notification (default is 2 seconds).
9539 <dt> ‘<samp>noise, n</samp>’</dt>
9540 <dd><p>Set noise tolerance. Can be specified in dB (in case "dB" is appended to the
9541 specified value) or amplitude ratio. Default is -60dB, or 0.001.
9545 <a name="Examples-14"></a>
9546 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-14">25.38.1 Examples</a></h3>
9550 Detect 5 seconds of silence with -50dB noise tolerance:
9551 <table><tr><td> </td><td><pre class="example">silencedetect=n=-50dB:d=5
9552 </pre></td></tr></table>
9555 Complete example with <code>ffmpeg</code> to detect silence with 0.0001 noise
9556 tolerance in ‘<tt>silence.mp3</tt>’:
9557 <table><tr><td> </td><td><pre class="example">ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
9558 </pre></td></tr></table>
9561 <a name="treble"></a>
9562 <h2 class="section"><a href="ffplay-all.html#toc-treble">25.39 treble</a></h2>
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’s tone-controls. This is also known as shelving equalisation (EQ).
9568 <p>The filter accepts the following options:
9570 <dl compact="compact">
9571 <dt> ‘<samp>gain, g</samp>’</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.
9577 <dt> ‘<samp>frequency, f</samp>’</dt>
9578 <dd><p>Set the filter’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.
9583 <dt> ‘<samp>width_type</samp>’</dt>
9584 <dd><p>Set method to specify band-width of filter.
9585 </p><dl compact="compact">
9586 <dt> ‘<samp>h</samp>’</dt>
9589 <dt> ‘<samp>q</samp>’</dt>
9592 <dt> ‘<samp>o</samp>’</dt>
9595 <dt> ‘<samp>s</samp>’</dt>
9601 <dt> ‘<samp>width, w</samp>’</dt>
9602 <dd><p>Determine how steep is the filter’s shelf transition.
9606 <a name="volume"></a>
9607 <h2 class="section"><a href="ffplay-all.html#toc-volume">25.40 volume</a></h2>
9609 <p>Adjust the input audio volume.
9611 <p>The filter accepts the following options:
9613 <dl compact="compact">
9614 <dt> ‘<samp>volume</samp>’</dt>
9615 <dd><p>Set audio volume expression.
9617 <p>Output values are clipped to the maximum value.
9619 <p>The output audio volume is given by the relation:
9620 </p><table><tr><td> </td><td><pre class="example"><var>output_volume</var> = <var>volume</var> * <var>input_volume</var>
9621 </pre></td></tr></table>
9623 <p>Default value for <var>volume</var> is "1.0".
9626 <dt> ‘<samp>precision</samp>’</dt>
9627 <dd><p>Set the mathematical precision.
9629 <p>This determines which input sample formats will be allowed, which affects the
9630 precision of the volume scaling.
9632 <dl compact="compact">
9633 <dt> ‘<samp>fixed</samp>’</dt>
9634 <dd><p>8-bit fixed-point; limits input sample format to U8, S16, and S32.
9636 <dt> ‘<samp>float</samp>’</dt>
9637 <dd><p>32-bit floating-point; limits input sample format to FLT. (default)
9639 <dt> ‘<samp>double</samp>’</dt>
9640 <dd><p>64-bit floating-point; limits input sample format to DBL.
9645 <dt> ‘<samp>eval</samp>’</dt>
9646 <dd><p>Set when the volume expression is evaluated.
9648 <p>It accepts the following values:
9649 </p><dl compact="compact">
9650 <dt> ‘<samp>once</samp>’</dt>
9651 <dd><p>only evaluate expression once during the filter initialization, or
9652 when the ‘<samp>volume</samp>’ command is sent
9655 <dt> ‘<samp>frame</samp>’</dt>
9656 <dd><p>evaluate expression for each incoming frame
9660 <p>Default value is ‘<samp>once</samp>’.
9664 <p>The volume expression can contain the following parameters.
9666 <dl compact="compact">
9667 <dt> ‘<samp>n</samp>’</dt>
9668 <dd><p>frame number (starting at zero)
9670 <dt> ‘<samp>nb_channels</samp>’</dt>
9671 <dd><p>number of channels
9673 <dt> ‘<samp>nb_consumed_samples</samp>’</dt>
9674 <dd><p>number of samples consumed by the filter
9676 <dt> ‘<samp>nb_samples</samp>’</dt>
9677 <dd><p>number of samples in the current frame
9679 <dt> ‘<samp>pos</samp>’</dt>
9680 <dd><p>original frame position in the file
9682 <dt> ‘<samp>pts</samp>’</dt>
9685 <dt> ‘<samp>sample_rate</samp>’</dt>
9688 <dt> ‘<samp>startpts</samp>’</dt>
9689 <dd><p>PTS at start of stream
9691 <dt> ‘<samp>startt</samp>’</dt>
9692 <dd><p>time at start of stream
9694 <dt> ‘<samp>t</samp>’</dt>
9697 <dt> ‘<samp>tb</samp>’</dt>
9698 <dd><p>timestamp timebase
9700 <dt> ‘<samp>volume</samp>’</dt>
9701 <dd><p>last set volume value
9705 <p>Note that when ‘<samp>eval</samp>’ is set to ‘<samp>once</samp>’ only the
9706 <var>sample_rate</var> and <var>tb</var> variables are available, all other
9707 variables will evaluate to NAN.
9709 <a name="Commands-3"></a>
9710 <h3 class="subsection"><a href="ffplay-all.html#toc-Commands-3">25.40.1 Commands</a></h3>
9712 <p>This filter supports the following commands:
9713 </p><dl compact="compact">
9714 <dt> ‘<samp>volume</samp>’</dt>
9715 <dd><p>Modify the volume expression.
9716 The command accepts the same syntax of the corresponding option.
9718 <p>If the specified expression is not valid, it is kept at its current
9723 <a name="Examples-51"></a>
9724 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-51">25.40.2 Examples</a></h3>
9728 Halve the input audio volume:
9729 <table><tr><td> </td><td><pre class="example">volume=volume=0.5
9731 volume=volume=-6.0206dB
9732 </pre></td></tr></table>
9734 <p>In all the above example the named key for ‘<samp>volume</samp>’ can be
9735 omitted, for example like in:
9736 </p><table><tr><td> </td><td><pre class="example">volume=0.5
9737 </pre></td></tr></table>
9740 Increase input audio power by 6 decibels using fixed-point precision:
9741 <table><tr><td> </td><td><pre class="example">volume=volume=6dB:precision=fixed
9742 </pre></td></tr></table>
9745 Fade volume after time 10 with an annihilation period of 5 seconds:
9746 <table><tr><td> </td><td><pre class="example">volume='if(lt(t,10),1,max(1-(t-10)/5,0))':eval=frame
9747 </pre></td></tr></table>
9750 <a name="volumedetect"></a>
9751 <h2 class="section"><a href="ffplay-all.html#toc-volumedetect">25.41 volumedetect</a></h2>
9753 <p>Detect the volume of the input video.
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.
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
9763 <p>All volumes are in decibels relative to the maximum PCM value.
9765 <a name="Examples-63"></a>
9766 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-63">25.41.1 Examples</a></h3>
9768 <p>Here is an excerpt of the output:
9769 </p><table><tr><td> </td><td><pre class="example">[Parsed_volumedetect_0 0xa23120] mean_volume: -27 dB
9770 [Parsed_volumedetect_0 0xa23120] max_volume: -4 dB
9771 [Parsed_volumedetect_0 0xa23120] histogram_4db: 6
9772 [Parsed_volumedetect_0 0xa23120] histogram_5db: 62
9773 [Parsed_volumedetect_0 0xa23120] histogram_6db: 286
9774 [Parsed_volumedetect_0 0xa23120] histogram_7db: 1042
9775 [Parsed_volumedetect_0 0xa23120] histogram_8db: 2551
9776 [Parsed_volumedetect_0 0xa23120] histogram_9db: 4609
9777 [Parsed_volumedetect_0 0xa23120] histogram_10db: 8409
9778 </pre></td></tr></table>
9783 The mean square energy is approximately -27 dB, or 10^-2.7.
9785 The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB.
9787 There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc.
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.
9794 <a name="Audio-Sources"></a>
9795 <h1 class="chapter"><a href="ffplay-all.html#toc-Audio-Sources">26. Audio Sources</a></h1>
9797 <p>Below is a description of the currently available audio sources.
9799 <a name="abuffer"></a>
9800 <h2 class="section"><a href="ffplay-all.html#toc-abuffer">26.1 abuffer</a></h2>
9802 <p>Buffer audio frames, and make them available to the filter chain.
9804 <p>This source is mainly intended for a programmatic use, in particular
9805 through the interface defined in ‘<tt>libavfilter/asrc_abuffer.h</tt>’.
9807 <p>It accepts the following named parameters:
9809 <dl compact="compact">
9810 <dt> ‘<samp>time_base</samp>’</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.
9815 <dt> ‘<samp>sample_rate</samp>’</dt>
9816 <dd><p>The sample rate of the incoming audio buffers.
9819 <dt> ‘<samp>sample_fmt</samp>’</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 ‘<tt>libavutil/samplefmt.h</tt>’
9825 <dt> ‘<samp>channel_layout</samp>’</dt>
9826 <dd><p>The channel layout of the incoming audio buffers.
9827 Either a channel layout name from channel_layout_map in
9828 ‘<tt>libavutil/channel_layout.c</tt>’ or its corresponding integer representation
9829 from the AV_CH_LAYOUT_* macros in ‘<tt>libavutil/channel_layout.h</tt>’
9832 <dt> ‘<samp>channels</samp>’</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
9840 <a name="Examples-6"></a>
9841 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-6">26.1.1 Examples</a></h3>
9843 <table><tr><td> </td><td><pre class="example">abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
9844 </pre></td></tr></table>
9846 <p>will instruct the source to accept planar 16bit signed stereo at 44100Hz.
9847 Since the sample format with name "s16p" corresponds to the number
9848 6 and the "stereo" channel layout corresponds to the value 0x3, this is
9850 </p><table><tr><td> </td><td><pre class="example">abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
9851 </pre></td></tr></table>
9853 <a name="aevalsrc"></a>
9854 <h2 class="section"><a href="ffplay-all.html#toc-aevalsrc">26.2 aevalsrc</a></h2>
9856 <p>Generate an audio signal specified by an expression.
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
9862 <p>This source accepts the following options:
9864 <dl compact="compact">
9865 <dt> ‘<samp>exprs</samp>’</dt>
9866 <dd><p>Set the ’|’-separated expressions list for each separate channel. In case the
9867 ‘<samp>channel_layout</samp>’ 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.
9872 <dt> ‘<samp>channel_layout, c</samp>’</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.
9877 <dt> ‘<samp>duration, d</samp>’</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
9884 <p>If not specified, or the expressed duration is negative, the audio is
9885 supposed to be generated forever.
9888 <dt> ‘<samp>nb_samples, n</samp>’</dt>
9889 <dd><p>Set the number of samples per channel per each output frame,
9893 <dt> ‘<samp>sample_rate, s</samp>’</dt>
9894 <dd><p>Specify the sample rate, default to 44100.
9898 <p>Each expression in <var>exprs</var> can contain the following constants:
9900 <dl compact="compact">
9901 <dt> ‘<samp>n</samp>’</dt>
9902 <dd><p>number of the evaluated sample, starting from 0
9905 <dt> ‘<samp>t</samp>’</dt>
9906 <dd><p>time of the evaluated sample expressed in seconds, starting from 0
9909 <dt> ‘<samp>s</samp>’</dt>
9915 <a name="Examples-56"></a>
9916 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-56">26.2.1 Examples</a></h3>
9921 <table><tr><td> </td><td><pre class="example">aevalsrc=0
9922 </pre></td></tr></table>
9925 Generate a sin signal with frequency of 440 Hz, set sample rate to
9927 <table><tr><td> </td><td><pre class="example">aevalsrc="sin(440*2*PI*t):s=8000"
9928 </pre></td></tr></table>
9931 Generate a two channels signal, specify the channel layout (Front
9932 Center + Back Center) explicitly:
9933 <table><tr><td> </td><td><pre class="example">aevalsrc="sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC"
9934 </pre></td></tr></table>
9937 Generate white noise:
9938 <table><tr><td> </td><td><pre class="example">aevalsrc="-2+random(0)"
9939 </pre></td></tr></table>
9942 Generate an amplitude modulated signal:
9943 <table><tr><td> </td><td><pre class="example">aevalsrc="sin(10*2*PI*t)*sin(880*2*PI*t)"
9944 </pre></td></tr></table>
9947 Generate 2.5 Hz binaural beats on a 360 Hz carrier:
9948 <table><tr><td> </td><td><pre class="example">aevalsrc="0.1*sin(2*PI*(360-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)"
9949 </pre></td></tr></table>
9953 <a name="anullsrc"></a>
9954 <h2 class="section"><a href="ffplay-all.html#toc-anullsrc">26.3 anullsrc</a></h2>
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
9961 <p>This source accepts the following options:
9963 <dl compact="compact">
9964 <dt> ‘<samp>channel_layout, cl</samp>’</dt>
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 "stereo".
9970 <p>Check the channel_layout_map definition in
9971 ‘<tt>libavutil/channel_layout.c</tt>’ for the mapping between strings and
9972 channel layout values.
9975 <dt> ‘<samp>sample_rate, r</samp>’</dt>
9976 <dd><p>Specify the sample rate, and defaults to 44100.
9979 <dt> ‘<samp>nb_samples, n</samp>’</dt>
9980 <dd><p>Set the number of samples per requested frames.
9985 <a name="Examples-38"></a>
9986 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-38">26.3.1 Examples</a></h3>
9990 Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO.
9991 <table><tr><td> </td><td><pre class="example">anullsrc=r=48000:cl=4
9992 </pre></td></tr></table>
9995 Do the same operation with a more obvious syntax:
9996 <table><tr><td> </td><td><pre class="example">anullsrc=r=48000:cl=mono
9997 </pre></td></tr></table>
10000 <p>All the parameters need to be explicitly defined.
10002 <a name="flite"></a>
10003 <h2 class="section"><a href="ffplay-all.html#toc-flite">26.4 flite</a></h2>
10005 <p>Synthesize a voice utterance using the libflite library.
10007 <p>To enable compilation of this filter you need to configure FFmpeg with
10008 <code>--enable-libflite</code>.
10010 <p>Note that the flite library is not thread-safe.
10012 <p>The filter accepts the following options:
10014 <dl compact="compact">
10015 <dt> ‘<samp>list_voices</samp>’</dt>
10016 <dd><p>If set to 1, list the names of the available voices and exit
10017 immediately. Default value is 0.
10020 <dt> ‘<samp>nb_samples, n</samp>’</dt>
10021 <dd><p>Set the maximum number of samples per frame. Default value is 512.
10024 <dt> ‘<samp>textfile</samp>’</dt>
10025 <dd><p>Set the filename containing the text to speak.
10028 <dt> ‘<samp>text</samp>’</dt>
10029 <dd><p>Set the text to speak.
10032 <dt> ‘<samp>voice, v</samp>’</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.
10038 <a name="Examples-80"></a>
10039 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-80">26.4.1 Examples</a></h3>
10043 Read from file ‘<tt>speech.txt</tt>’, and synthetize the text using the
10044 standard flite voice:
10045 <table><tr><td> </td><td><pre class="example">flite=textfile=speech.txt
10046 </pre></td></tr></table>
10049 Read the specified text selecting the <code>slt</code> voice:
10050 <table><tr><td> </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>
10054 Input text to ffmpeg:
10055 <table><tr><td> </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>
10059 Make ‘<tt>ffplay</tt>’ speak the specified text, using <code>flite</code> and
10060 the <code>lavfi</code> device:
10061 <table><tr><td> </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>
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>
10068 <a name="sine"></a>
10069 <h2 class="section"><a href="ffplay-all.html#toc-sine">26.5 sine</a></h2>
10071 <p>Generate an audio signal made of a sine wave with amplitude 1/8.
10073 <p>The audio signal is bit-exact.
10075 <p>The filter accepts the following options:
10077 <dl compact="compact">
10078 <dt> ‘<samp>frequency, f</samp>’</dt>
10079 <dd><p>Set the carrier frequency. Default is 440 Hz.
10082 <dt> ‘<samp>beep_factor, b</samp>’</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.
10087 <dt> ‘<samp>sample_rate, r</samp>’</dt>
10088 <dd><p>Specify the sample rate, default is 44100.
10091 <dt> ‘<samp>duration, d</samp>’</dt>
10092 <dd><p>Specify the duration of the generated audio stream.
10095 <dt> ‘<samp>samples_per_frame</samp>’</dt>
10096 <dd><p>Set the number of samples per output frame, default is 1024.
10100 <a name="Examples-50"></a>
10101 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-50">26.5.1 Examples</a></h3>
10105 Generate a simple 440 Hz sine wave:
10106 <table><tr><td> </td><td><pre class="example">sine
10107 </pre></td></tr></table>
10110 Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds:
10111 <table><tr><td> </td><td><pre class="example">sine=220:4:d=5
10113 sine=frequency=220:beep_factor=4:duration=5
10114 </pre></td></tr></table>
10119 <a name="Audio-Sinks"></a>
10120 <h1 class="chapter"><a href="ffplay-all.html#toc-Audio-Sinks">27. Audio Sinks</a></h1>
10122 <p>Below is a description of the currently available audio sinks.
10124 <a name="abuffersink"></a>
10125 <h2 class="section"><a href="ffplay-all.html#toc-abuffersink">27.1 abuffersink</a></h2>
10127 <p>Buffer audio frames, and make them available to the end of filter chain.
10129 <p>This sink is mainly intended for programmatic use, in particular
10130 through the interface defined in ‘<tt>libavfilter/buffersink.h</tt>’
10131 or the options system.
10133 <p>It accepts a pointer to an AVABufferSinkContext structure, which
10134 defines the incoming buffers’ formats, to be passed as the opaque
10135 parameter to <code>avfilter_init_filter</code> for initialization.
10137 <a name="anullsink"></a>
10138 <h2 class="section"><a href="ffplay-all.html#toc-anullsink">27.2 anullsink</a></h2>
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
10145 <a name="Video-Filters"></a>
10146 <h1 class="chapter"><a href="ffplay-all.html#toc-Video-Filters">28. Video Filters</a></h1>
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
10153 <p>Below is a description of the currently available video filters.
10155 <a name="alphaextract"></a>
10156 <h2 class="section"><a href="ffplay-all.html#toc-alphaextract">28.1 alphaextract</a></h2>
10158 <p>Extract the alpha component from the input as a grayscale video. This
10159 is especially useful with the <var>alphamerge</var> filter.
10161 <a name="alphamerge"></a>
10162 <h2 class="section"><a href="ffplay-all.html#toc-alphamerge">28.2 alphamerge</a></h2>
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’t support an alpha
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> </td><td><pre class="example">movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
10173 </pre></td></tr></table>
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’re trying to apply an image as an
10179 overlay to a video stream, consider the <var>overlay</var> filter instead.
10182 <h2 class="section"><a href="ffplay-all.html#toc-ass">28.3 ass</a></h2>
10184 <p>Same as the <a href="#subtitles">subtitles</a> filter, except that it doesn’t require libavcodec
10185 and libavformat to work. On the other hand, it is limited to ASS (Advanced
10186 Substation Alpha) subtitles files.
10188 <a name="bbox"></a>
10189 <h2 class="section"><a href="ffplay-all.html#toc-bbox">28.4 bbox</a></h2>
10191 <p>Compute the bounding box for the non-black pixels in the input frame
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
10199 <p>The filter accepts the following option:
10201 <dl compact="compact">
10202 <dt> ‘<samp>min_val</samp>’</dt>
10203 <dd><p>Set the minimal luminance value. Default is <code>16</code>.
10207 <a name="blackdetect"></a>
10208 <h2 class="section"><a href="ffplay-all.html#toc-blackdetect">28.5 blackdetect</a></h2>
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.
10215 <p>In order to display the output lines, you need to set the loglevel at
10216 least to the AV_LOG_INFO value.
10218 <p>The filter accepts the following options:
10220 <dl compact="compact">
10221 <dt> ‘<samp>black_min_duration, d</samp>’</dt>
10222 <dd><p>Set the minimum detected black duration expressed in seconds. It must
10223 be a non-negative floating point number.
10225 <p>Default value is 2.0.
10228 <dt> ‘<samp>picture_black_ratio_th, pic_th</samp>’</dt>
10229 <dd><p>Set the threshold for considering a picture "black".
10230 Express the minimum value for the ratio:
10231 </p><table><tr><td> </td><td><pre class="example"><var>nb_black_pixels</var> / <var>nb_pixels</var>
10232 </pre></td></tr></table>
10234 <p>for which a picture is considered black.
10235 Default value is 0.98.
10238 <dt> ‘<samp>pixel_black_th, pix_th</samp>’</dt>
10239 <dd><p>Set the threshold for considering a pixel "black".
10241 <p>The threshold expresses the maximum pixel luminance value for which a
10242 pixel is considered "black". The provided value is scaled according to
10243 the following equation:
10244 </p><table><tr><td> </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>
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.
10251 <p>Default value is 0.10.
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> </td><td><pre class="example">blackdetect=d=2:pix_th=0.00
10258 </pre></td></tr></table>
10260 <a name="blackframe"></a>
10261 <h2 class="section"><a href="ffplay-all.html#toc-blackframe">28.6 blackframe</a></h2>
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.
10268 <p>In order to display the output lines, you need to set the loglevel at
10269 least to the AV_LOG_INFO value.
10271 <p>The filter accepts the following options:
10273 <dl compact="compact">
10274 <dt> ‘<samp>amount</samp>’</dt>
10275 <dd><p>Set the percentage of the pixels that have to be below the threshold, defaults
10276 to <code>98</code>.
10279 <dt> ‘<samp>threshold, thresh</samp>’</dt>
10280 <dd><p>Set the threshold below which a pixel value is considered black, defaults to
10286 <a name="blend"></a>
10287 <h2 class="section"><a href="ffplay-all.html#toc-blend">28.7 blend</a></h2>
10289 <p>Blend two video frames into each other.
10291 <p>It takes two input streams and outputs one stream, the first input is the
10292 "top" layer and second input is "bottom" layer.
10293 Output terminates when shortest input terminates.
10295 <p>A description of the accepted options follows.
10297 <dl compact="compact">
10298 <dt> ‘<samp>c0_mode</samp>’</dt>
10299 <dt> ‘<samp>c1_mode</samp>’</dt>
10300 <dt> ‘<samp>c2_mode</samp>’</dt>
10301 <dt> ‘<samp>c3_mode</samp>’</dt>
10302 <dt> ‘<samp>all_mode</samp>’</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>.
10306 <p>Available values for component modes are:
10307 </p><dl compact="compact">
10308 <dt> ‘<samp>addition</samp>’</dt>
10309 <dt> ‘<samp>and</samp>’</dt>
10310 <dt> ‘<samp>average</samp>’</dt>
10311 <dt> ‘<samp>burn</samp>’</dt>
10312 <dt> ‘<samp>darken</samp>’</dt>
10313 <dt> ‘<samp>difference</samp>’</dt>
10314 <dt> ‘<samp>divide</samp>’</dt>
10315 <dt> ‘<samp>dodge</samp>’</dt>
10316 <dt> ‘<samp>exclusion</samp>’</dt>
10317 <dt> ‘<samp>hardlight</samp>’</dt>
10318 <dt> ‘<samp>lighten</samp>’</dt>
10319 <dt> ‘<samp>multiply</samp>’</dt>
10320 <dt> ‘<samp>negation</samp>’</dt>
10321 <dt> ‘<samp>normal</samp>’</dt>
10322 <dt> ‘<samp>or</samp>’</dt>
10323 <dt> ‘<samp>overlay</samp>’</dt>
10324 <dt> ‘<samp>phoenix</samp>’</dt>
10325 <dt> ‘<samp>pinlight</samp>’</dt>
10326 <dt> ‘<samp>reflect</samp>’</dt>
10327 <dt> ‘<samp>screen</samp>’</dt>
10328 <dt> ‘<samp>softlight</samp>’</dt>
10329 <dt> ‘<samp>subtract</samp>’</dt>
10330 <dt> ‘<samp>vividlight</samp>’</dt>
10331 <dt> ‘<samp>xor</samp>’</dt>
10335 <dt> ‘<samp>c0_opacity</samp>’</dt>
10336 <dt> ‘<samp>c1_opacity</samp>’</dt>
10337 <dt> ‘<samp>c2_opacity</samp>’</dt>
10338 <dt> ‘<samp>c3_opacity</samp>’</dt>
10339 <dt> ‘<samp>all_opacity</samp>’</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.
10344 <dt> ‘<samp>c0_expr</samp>’</dt>
10345 <dt> ‘<samp>c1_expr</samp>’</dt>
10346 <dt> ‘<samp>c2_expr</samp>’</dt>
10347 <dt> ‘<samp>c3_expr</samp>’</dt>
10348 <dt> ‘<samp>all_expr</samp>’</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.
10352 <p>The expressions can use the following variables:
10354 <dl compact="compact">
10355 <dt> ‘<samp>N</samp>’</dt>
10356 <dd><p>The sequential number of the filtered frame, starting from <code>0</code>.
10359 <dt> ‘<samp>X</samp>’</dt>
10360 <dt> ‘<samp>Y</samp>’</dt>
10361 <dd><p>the coordinates of the current sample
10364 <dt> ‘<samp>W</samp>’</dt>
10365 <dt> ‘<samp>H</samp>’</dt>
10366 <dd><p>the width and height of currently filtered plane
10369 <dt> ‘<samp>SW</samp>’</dt>
10370 <dt> ‘<samp>SH</samp>’</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.
10377 <dt> ‘<samp>T</samp>’</dt>
10378 <dd><p>Time of the current frame, expressed in seconds.
10381 <dt> ‘<samp>TOP, A</samp>’</dt>
10382 <dd><p>Value of pixel component at current location for first video frame (top layer).
10385 <dt> ‘<samp>BOTTOM, B</samp>’</dt>
10386 <dd><p>Value of pixel component at current location for second video frame (bottom layer).
10391 <dt> ‘<samp>shortest</samp>’</dt>
10392 <dd><p>Force termination when the shortest input terminates. Default is <code>0</code>.
10394 <dt> ‘<samp>repeatlast</samp>’</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>.
10401 <a name="Examples-62"></a>
10402 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-62">28.7.1 Examples</a></h3>
10406 Apply transition from bottom layer to top layer in first 10 seconds:
10407 <table><tr><td> </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>
10411 Apply 1x1 checkerboard effect:
10412 <table><tr><td> </td><td><pre class="example">blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
10413 </pre></td></tr></table>
10416 Apply uncover left effect:
10417 <table><tr><td> </td><td><pre class="example">blend=all_expr='if(gte(N*SW+X,W),A,B)'
10418 </pre></td></tr></table>
10421 Apply uncover down effect:
10422 <table><tr><td> </td><td><pre class="example">blend=all_expr='if(gte(Y-N*SH,0),A,B)'
10423 </pre></td></tr></table>
10426 Apply uncover up-left effect:
10427 <table><tr><td> </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>
10431 <a name="boxblur"></a>
10432 <h2 class="section"><a href="ffplay-all.html#toc-boxblur">28.8 boxblur</a></h2>
10434 <p>Apply boxblur algorithm to the input video.
10436 <p>The filter accepts the following options:
10438 <dl compact="compact">
10439 <dt> ‘<samp>luma_radius, lr</samp>’</dt>
10440 <dt> ‘<samp>luma_power, lp</samp>’</dt>
10441 <dt> ‘<samp>chroma_radius, cr</samp>’</dt>
10442 <dt> ‘<samp>chroma_power, cp</samp>’</dt>
10443 <dt> ‘<samp>alpha_radius, ar</samp>’</dt>
10444 <dt> ‘<samp>alpha_power, ap</samp>’</dt>
10447 <p>A description of the accepted options follows.
10449 <dl compact="compact">
10450 <dt> ‘<samp>luma_radius, lr</samp>’</dt>
10451 <dt> ‘<samp>chroma_radius, cr</samp>’</dt>
10452 <dt> ‘<samp>alpha_radius, ar</samp>’</dt>
10453 <dd><p>Set an expression for the box radius in pixels used for blurring the
10454 corresponding input plane.
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
10461 <p>Default value for ‘<samp>luma_radius</samp>’ is "2". If not specified,
10462 ‘<samp>chroma_radius</samp>’ and ‘<samp>alpha_radius</samp>’ default to the
10463 corresponding value set for ‘<samp>luma_radius</samp>’.
10465 <p>The expressions can contain the following constants:
10466 </p><dl compact="compact">
10467 <dt> ‘<samp>w</samp>’</dt>
10468 <dt> ‘<samp>h</samp>’</dt>
10469 <dd><p>the input width and height in pixels
10472 <dt> ‘<samp>cw</samp>’</dt>
10473 <dt> ‘<samp>ch</samp>’</dt>
10474 <dd><p>the input chroma image width and height in pixels
10477 <dt> ‘<samp>hsub</samp>’</dt>
10478 <dt> ‘<samp>vsub</samp>’</dt>
10479 <dd><p>horizontal and vertical chroma subsample values. For example for the
10480 pixel format "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
10485 <dt> ‘<samp>luma_power, lp</samp>’</dt>
10486 <dt> ‘<samp>chroma_power, cp</samp>’</dt>
10487 <dt> ‘<samp>alpha_power, ap</samp>’</dt>
10488 <dd><p>Specify how many times the boxblur filter is applied to the
10489 corresponding plane.
10491 <p>Default value for ‘<samp>luma_power</samp>’ is 2. If not specified,
10492 ‘<samp>chroma_power</samp>’ and ‘<samp>alpha_power</samp>’ default to the
10493 corresponding value set for ‘<samp>luma_power</samp>’.
10495 <p>A value of 0 will disable the effect.
10499 <a name="Examples-12"></a>
10500 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-12">28.8.1 Examples</a></h3>
10504 Apply a boxblur filter with luma, chroma, and alpha radius
10506 <table><tr><td> </td><td><pre class="example">boxblur=luma_radius=2:luma_power=1
10508 </pre></td></tr></table>
10511 Set luma radius to 2, alpha and chroma radius to 0:
10512 <table><tr><td> </td><td><pre class="example">boxblur=2:1:cr=0:ar=0
10513 </pre></td></tr></table>
10516 Set luma and chroma radius to a fraction of the video dimension:
10517 <table><tr><td> </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>
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.
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.
10528 <p>A positive adjustment value shifts the balance towards the primary color, a negative
10529 value towards the complementary color.
10531 <p>The filter accepts the following options:
10533 <dl compact="compact">
10534 <dt> ‘<samp>rs</samp>’</dt>
10535 <dt> ‘<samp>gs</samp>’</dt>
10536 <dt> ‘<samp>bs</samp>’</dt>
10537 <dd><p>Adjust red, green and blue shadows (darkest pixels).
10540 <dt> ‘<samp>rm</samp>’</dt>
10541 <dt> ‘<samp>gm</samp>’</dt>
10542 <dt> ‘<samp>bm</samp>’</dt>
10543 <dd><p>Adjust red, green and blue midtones (medium pixels).
10546 <dt> ‘<samp>rh</samp>’</dt>
10547 <dt> ‘<samp>gh</samp>’</dt>
10548 <dt> ‘<samp>bh</samp>’</dt>
10549 <dd><p>Adjust red, green and blue highlights (brightest pixels).
10551 <p>Allowed ranges for options are <code>[-1.0, 1.0]</code>. Defaults are <code>0</code>.
10555 <a name="Examples-68"></a>
10556 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-68">28.9.1 Examples</a></h3>
10560 Add red color cast to shadows:
10561 <table><tr><td> </td><td><pre class="example">colorbalance=rs=.3
10562 </pre></td></tr></table>
10565 <a name="colorchannelmixer"></a>
10566 <h2 class="section"><a href="ffplay-all.html#toc-colorchannelmixer">28.10 colorchannelmixer</a></h2>
10568 <p>Adjust video input frames by re-mixing color channels.
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> </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>
10576 <p>The filter accepts the following options:
10578 <dl compact="compact">
10579 <dt> ‘<samp>rr</samp>’</dt>
10580 <dt> ‘<samp>rg</samp>’</dt>
10581 <dt> ‘<samp>rb</samp>’</dt>
10582 <dt> ‘<samp>ra</samp>’</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>.
10587 <dt> ‘<samp>gr</samp>’</dt>
10588 <dt> ‘<samp>gg</samp>’</dt>
10589 <dt> ‘<samp>gb</samp>’</dt>
10590 <dt> ‘<samp>ga</samp>’</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>.
10595 <dt> ‘<samp>br</samp>’</dt>
10596 <dt> ‘<samp>bg</samp>’</dt>
10597 <dt> ‘<samp>bb</samp>’</dt>
10598 <dt> ‘<samp>ba</samp>’</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>.
10603 <dt> ‘<samp>ar</samp>’</dt>
10604 <dt> ‘<samp>ag</samp>’</dt>
10605 <dt> ‘<samp>ab</samp>’</dt>
10606 <dt> ‘<samp>aa</samp>’</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>.
10610 <p>Allowed ranges for options are <code>[-2.0, 2.0]</code>.
10614 <a name="Examples-33"></a>
10615 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-33">28.10.1 Examples</a></h3>
10619 Convert source to grayscale:
10620 <table><tr><td> </td><td><pre class="example">colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
10621 </pre></td></tr></table>
10623 Simulate sepia tones:
10624 <table><tr><td> </td><td><pre class="example">colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131
10625 </pre></td></tr></table>
10628 <a name="colormatrix"></a>
10629 <h2 class="section"><a href="ffplay-all.html#toc-colormatrix">28.11 colormatrix</a></h2>
10631 <p>Convert color matrix.
10633 <p>The filter accepts the following options:
10635 <dl compact="compact">
10636 <dt> ‘<samp>src</samp>’</dt>
10637 <dt> ‘<samp>dst</samp>’</dt>
10638 <dd><p>Specify the source and destination color matrix. Both values must be
10641 <p>The accepted values are:
10642 </p><dl compact="compact">
10643 <dt> ‘<samp>bt709</samp>’</dt>
10647 <dt> ‘<samp>bt601</samp>’</dt>
10651 <dt> ‘<samp>smpte240m</samp>’</dt>
10655 <dt> ‘<samp>fcc</samp>’</dt>
10662 <p>For example to convert from BT.601 to SMPTE-240M, use the command:
10663 </p><table><tr><td> </td><td><pre class="example">colormatrix=bt601:smpte240m
10664 </pre></td></tr></table>
10666 <a name="copy"></a>
10667 <h2 class="section"><a href="ffplay-all.html#toc-copy">28.12 copy</a></h2>
10669 <p>Copy the input source unchanged to the output. Mainly useful for
10672 <a name="crop"></a>
10673 <h2 class="section"><a href="ffplay-all.html#toc-crop">28.13 crop</a></h2>
10675 <p>Crop the input video to given dimensions.
10677 <p>The filter accepts the following options:
10679 <dl compact="compact">
10680 <dt> ‘<samp>w, out_w</samp>’</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
10686 <dt> ‘<samp>h, out_h</samp>’</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
10692 <dt> ‘<samp>x</samp>’</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.
10698 <dt> ‘<samp>y</samp>’</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.
10704 <dt> ‘<samp>keep_aspect</samp>’</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.
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:
10714 <dl compact="compact">
10715 <dt> ‘<samp>x</samp>’</dt>
10716 <dt> ‘<samp>y</samp>’</dt>
10717 <dd><p>the computed values for <var>x</var> and <var>y</var>. They are evaluated for
10721 <dt> ‘<samp>in_w</samp>’</dt>
10722 <dt> ‘<samp>in_h</samp>’</dt>
10723 <dd><p>the input width and height
10726 <dt> ‘<samp>iw</samp>’</dt>
10727 <dt> ‘<samp>ih</samp>’</dt>
10728 <dd><p>same as <var>in_w</var> and <var>in_h</var>
10731 <dt> ‘<samp>out_w</samp>’</dt>
10732 <dt> ‘<samp>out_h</samp>’</dt>
10733 <dd><p>the output (cropped) width and height
10736 <dt> ‘<samp>ow</samp>’</dt>
10737 <dt> ‘<samp>oh</samp>’</dt>
10738 <dd><p>same as <var>out_w</var> and <var>out_h</var>
10741 <dt> ‘<samp>a</samp>’</dt>
10742 <dd><p>same as <var>iw</var> / <var>ih</var>
10745 <dt> ‘<samp>sar</samp>’</dt>
10746 <dd><p>input sample aspect ratio
10749 <dt> ‘<samp>dar</samp>’</dt>
10750 <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
10753 <dt> ‘<samp>hsub</samp>’</dt>
10754 <dt> ‘<samp>vsub</samp>’</dt>
10755 <dd><p>horizontal and vertical chroma subsample values. For example for the
10756 pixel format "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
10759 <dt> ‘<samp>n</samp>’</dt>
10760 <dd><p>the number of input frame, starting from 0
10763 <dt> ‘<samp>pos</samp>’</dt>
10764 <dd><p>the position in the file of the input frame, NAN if unknown
10767 <dt> ‘<samp>t</samp>’</dt>
10768 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
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>.
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.
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>.
10786 <a name="Examples-64"></a>
10787 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-64">28.13.1 Examples</a></h3>
10791 Crop area with size 100x100 at position (12,34).
10792 <table><tr><td> </td><td><pre class="example">crop=100:100:12:34
10793 </pre></td></tr></table>
10795 <p>Using named options, the example above becomes:
10796 </p><table><tr><td> </td><td><pre class="example">crop=w=100:h=100:x=12:y=34
10797 </pre></td></tr></table>
10800 Crop the central input area with size 100x100:
10801 <table><tr><td> </td><td><pre class="example">crop=100:100
10802 </pre></td></tr></table>
10805 Crop the central input area with size 2/3 of the input video:
10806 <table><tr><td> </td><td><pre class="example">crop=2/3*in_w:2/3*in_h
10807 </pre></td></tr></table>
10810 Crop the input video central square:
10811 <table><tr><td> </td><td><pre class="example">crop=out_w=in_h
10813 </pre></td></tr></table>
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> </td><td><pre class="example">crop=in_w-100:in_h-100:100:100
10820 </pre></td></tr></table>
10823 Crop 10 pixels from the left and right borders, and 20 pixels from
10824 the top and bottom borders
10825 <table><tr><td> </td><td><pre class="example">crop=in_w-2*10:in_h-2*20
10826 </pre></td></tr></table>
10829 Keep only the bottom right quarter of the input image:
10830 <table><tr><td> </td><td><pre class="example">crop=in_w/2:in_h/2:in_w/2:in_h/2
10831 </pre></td></tr></table>
10834 Crop height for getting Greek harmony:
10835 <table><tr><td> </td><td><pre class="example">crop=in_w:1/PHI*in_w
10836 </pre></td></tr></table>
10839 Appply trembling effect:
10840 <table><tr><td> </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>
10844 Apply erratic camera effect depending on timestamp:
10845 <table><tr><td> </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)"
10846 </pre></td></tr></table>
10849 Set x depending on the value of y:
10850 <table><tr><td> </td><td><pre class="example">crop=in_w/2:in_h/2:y:10+10*sin(n/10)
10851 </pre></td></tr></table>
10854 <a name="cropdetect"></a>
10855 <h2 class="section"><a href="ffplay-all.html#toc-cropdetect">28.14 cropdetect</a></h2>
10857 <p>Auto-detect crop size.
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.
10863 <p>The filter accepts the following options:
10865 <dl compact="compact">
10866 <dt> ‘<samp>limit</samp>’</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.
10872 <dt> ‘<samp>round</samp>’</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.
10879 <dt> ‘<samp>reset_count, reset</samp>’</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.
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
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>
10894 <p>Apply color adjustments using curves.
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
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 "adjusted" to its own value, which means no change to the image.
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.
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.
10917 <p>The filter accepts the following options:
10919 <dl compact="compact">
10920 <dt> ‘<samp>preset</samp>’</dt>
10921 <dd><p>Select one of the available color presets. This option can be used in addition
10922 to the ‘<samp>r</samp>’, ‘<samp>g</samp>’, ‘<samp>b</samp>’ 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> ‘<samp>none</samp>’</dt>
10927 <dt> ‘<samp>color_negative</samp>’</dt>
10928 <dt> ‘<samp>cross_process</samp>’</dt>
10929 <dt> ‘<samp>darker</samp>’</dt>
10930 <dt> ‘<samp>increase_contrast</samp>’</dt>
10931 <dt> ‘<samp>lighter</samp>’</dt>
10932 <dt> ‘<samp>linear_contrast</samp>’</dt>
10933 <dt> ‘<samp>medium_contrast</samp>’</dt>
10934 <dt> ‘<samp>negative</samp>’</dt>
10935 <dt> ‘<samp>strong_contrast</samp>’</dt>
10936 <dt> ‘<samp>vintage</samp>’</dt>
10938 <p>Default is <code>none</code>.
10940 <dt> ‘<samp>master, m</samp>’</dt>
10941 <dd><p>Set the master key points. These points will define a second pass mapping. It
10942 is sometimes called a "luminance" or "value" mapping. It can be used with
10943 ‘<samp>r</samp>’, ‘<samp>g</samp>’, ‘<samp>b</samp>’ or ‘<samp>all</samp>’ since it acts like a
10944 post-processing LUT.
10946 <dt> ‘<samp>red, r</samp>’</dt>
10947 <dd><p>Set the key points for the red component.
10949 <dt> ‘<samp>green, g</samp>’</dt>
10950 <dd><p>Set the key points for the green component.
10952 <dt> ‘<samp>blue, b</samp>’</dt>
10953 <dd><p>Set the key points for the blue component.
10955 <dt> ‘<samp>all</samp>’</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 ‘<samp>all</samp>’ setting.
10961 <dt> ‘<samp>psfile</samp>’</dt>
10962 <dd><p>Specify a Photoshop curves file (<code>.asv</code>) to import the settings from.
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>.
10969 <a name="Examples-77"></a>
10970 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-77">28.15.1 Examples</a></h3>
10974 Increase slightly the middle level of blue:
10975 <table><tr><td> </td><td><pre class="example">curves=blue='0.5/0.58'
10976 </pre></td></tr></table>
10980 <table><tr><td> </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>
10987 <dt> <var>green</var></dt>
10988 <dd><p><code>(0;0) (0.50;0.48) (1;1)</code>
10990 <dt> <var>blue</var></dt>
10991 <dd><p><code>(0;0.22) (0.49;0.44) (1;0.80)</code>
10996 The previous example can also be achieved with the associated built-in preset:
10997 <table><tr><td> </td><td><pre class="example">curves=preset=vintage
10998 </pre></td></tr></table>
11002 <table><tr><td> </td><td><pre class="example">curves=vintage
11003 </pre></td></tr></table>
11006 Use a Photoshop preset and redefine the points of the green component:
11007 <table><tr><td> </td><td><pre class="example">curves=psfile='MyCurvesPresets/purple.asv':green='0.45/0.53'
11008 </pre></td></tr></table>
11011 <a name="dctdnoiz"></a>
11012 <h2 class="section"><a href="ffplay-all.html#toc-dctdnoiz">28.16 dctdnoiz</a></h2>
11014 <p>Denoise frames using 2D DCT (frequency domain filtering).
11016 <p>This filter is not designed for real time and can be extremely slow.
11018 <p>The filter accepts the following options:
11020 <dl compact="compact">
11021 <dt> ‘<samp>sigma, s</samp>’</dt>
11022 <dd><p>Set the noise sigma constant.
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.
11027 <p>If you need a more advanced filtering, see ‘<samp>expr</samp>’.
11029 <p>Default is <code>0</code>.
11032 <dt> ‘<samp>overlap</samp>’</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.
11037 <p>If the overlapping value doesn’t allow to process the whole input width or
11038 height, a warning will be displayed and according borders won’t be denoised.
11040 <p>Default value is <code>15</code>.
11043 <dt> ‘<samp>expr, e</samp>’</dt>
11044 <dd><p>Set the coefficient factor expression.
11046 <p>For each coefficient of a DCT block, this expression will be evaluated as a
11047 multiplier value for the coefficient.
11049 <p>If this is option is set, the ‘<samp>sigma</samp>’ option will be ignored.
11051 <p>The absolute value of the coefficient can be accessed through the <var>c</var>
11056 <a name="Examples-22"></a>
11057 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-22">28.16.1 Examples</a></h3>
11059 <p>Apply a denoise with a ‘<samp>sigma</samp>’ of <code>4.5</code>:
11060 </p><table><tr><td> </td><td><pre class="example">dctdnoiz=4.5
11061 </pre></td></tr></table>
11063 <p>The same operation can be achieved using the expression system:
11064 </p><table><tr><td> </td><td><pre class="example">dctdnoiz=e='gte(c, 4.5*3)'
11065 </pre></td></tr></table>
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>
11071 <p>Drop duplicated frames at regular intervals.
11073 <p>The filter accepts the following options:
11075 <dl compact="compact">
11076 <dt> ‘<samp>cycle</samp>’</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>.
11082 <dt> ‘<samp>dupthresh</samp>’</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>
11088 <dt> ‘<samp>scthresh</samp>’</dt>
11089 <dd><p>Set scene change threshold. Default is <code>15</code>.
11092 <dt> ‘<samp>blockx</samp>’</dt>
11093 <dt> ‘<samp>blocky</samp>’</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>.
11099 <dt> ‘<samp>ppsrc</samp>’</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
11108 <dt> ‘<samp>chroma</samp>’</dt>
11109 <dd><p>Set whether or not chroma is considered in the metric calculations. Default is
11114 <a name="dejudder"></a>
11115 <h2 class="section"><a href="ffplay-all.html#toc-dejudder">28.18 dejudder</a></h2>
11117 <p>Remove judder produced by partially interlaced telecined content.
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
11125 <p>The option available in this filter is:
11126 </p><dl compact="compact">
11127 <dt> ‘<samp>cycle</samp>’</dt>
11128 <dd><p>Specify the length of the window over which the judder repeats.
11130 <p>Accepts any interger greater than 1. Useful values are:
11131 </p><dl compact="compact">
11132 <dt> ‘<samp>4</samp>’</dt>
11133 <dd><p>If the original was telecined from 24 to 30 fps (Film to NTSC).
11136 <dt> ‘<samp>5</samp>’</dt>
11137 <dd><p>If the original was telecined from 25 to 30 fps (PAL to NTSC).
11140 <dt> ‘<samp>20</samp>’</dt>
11141 <dd><p>If a mixture of the two.
11145 <p>The default is ‘<samp>4</samp>’.
11149 <a name="delogo"></a>
11150 <h2 class="section"><a href="ffplay-all.html#toc-delogo">28.19 delogo</a></h2>
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).
11156 <p>This filter accepts the following options:
11157 </p><dl compact="compact">
11158 <dt> ‘<samp>x</samp>’</dt>
11159 <dt> ‘<samp>y</samp>’</dt>
11160 <dd><p>Specify the top left corner coordinates of the logo. They must be
11164 <dt> ‘<samp>w</samp>’</dt>
11165 <dt> ‘<samp>h</samp>’</dt>
11166 <dd><p>Specify the width and height of the logo to clear. They must be
11170 <dt> ‘<samp>band, t</samp>’</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.
11175 <dt> ‘<samp>show</samp>’</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.
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.
11188 <a name="Examples-32"></a>
11189 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-32">28.19.1 Examples</a></h3>
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> </td><td><pre class="example">delogo=x=0:y=0:w=100:h=77:band=10
11196 </pre></td></tr></table>
11200 <a name="deshake"></a>
11201 <h2 class="section"><a href="ffplay-all.html#toc-deshake">28.20 deshake</a></h2>
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.
11207 <p>The filter accepts the following options:
11209 <dl compact="compact">
11210 <dt> ‘<samp>x</samp>’</dt>
11211 <dt> ‘<samp>y</samp>’</dt>
11212 <dt> ‘<samp>w</samp>’</dt>
11213 <dt> ‘<samp>h</samp>’</dt>
11214 <dd><p>Specify a rectangular area where to limit the search for motion
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
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.
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.
11229 <p>Default - search the whole frame.
11232 <dt> ‘<samp>rx</samp>’</dt>
11233 <dt> ‘<samp>ry</samp>’</dt>
11234 <dd><p>Specify the maximum extent of movement in x and y directions in the
11235 range 0-64 pixels. Default 16.
11238 <dt> ‘<samp>edge</samp>’</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> ‘<samp>blank, 0</samp>’</dt>
11243 <dd><p>Fill zeroes at blank locations
11245 <dt> ‘<samp>original, 1</samp>’</dt>
11246 <dd><p>Original image at blank locations
11248 <dt> ‘<samp>clamp, 2</samp>’</dt>
11249 <dd><p>Extruded edge value at blank locations
11251 <dt> ‘<samp>mirror, 3</samp>’</dt>
11252 <dd><p>Mirrored edge at blank locations
11255 <p>Default value is ‘<samp>mirror</samp>’.
11258 <dt> ‘<samp>blocksize</samp>’</dt>
11259 <dd><p>Specify the blocksize to use for motion search. Range 4-128 pixels,
11263 <dt> ‘<samp>contrast</samp>’</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.
11269 <dt> ‘<samp>search</samp>’</dt>
11270 <dd><p>Specify the search strategy. Available values are:
11271 </p><dl compact="compact">
11272 <dt> ‘<samp>exhaustive, 0</samp>’</dt>
11273 <dd><p>Set exhaustive search
11275 <dt> ‘<samp>less, 1</samp>’</dt>
11276 <dd><p>Set less exhaustive search.
11279 <p>Default value is ‘<samp>exhaustive</samp>’.
11282 <dt> ‘<samp>filename</samp>’</dt>
11283 <dd><p>If set then a detailed log of the motion search is written to the
11287 <dt> ‘<samp>opencl</samp>’</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.
11294 <a name="drawbox"></a>
11295 <h2 class="section"><a href="ffplay-all.html#toc-drawbox">28.21 drawbox</a></h2>
11297 <p>Draw a colored box on the input image.
11299 <p>This filter accepts the following options:
11301 <dl compact="compact">
11302 <dt> ‘<samp>x</samp>’</dt>
11303 <dt> ‘<samp>y</samp>’</dt>
11304 <dd><p>The expressions which specify the top left corner coordinates of the box. Default to 0.
11307 <dt> ‘<samp>width, w</samp>’</dt>
11308 <dt> ‘<samp>height, h</samp>’</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.
11313 <dt> ‘<samp>color, c</samp>’</dt>
11314 <dd><p>Specify the color of the box to write. For the general syntax of this option,
11315 check the "Color" 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.
11320 <dt> ‘<samp>thickness, t</samp>’</dt>
11321 <dd><p>The expression which sets the thickness of the box edge. Default value is <code>3</code>.
11323 <p>See below for the list of accepted constants.
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:
11330 <dl compact="compact">
11331 <dt> ‘<samp>dar</samp>’</dt>
11332 <dd><p>The input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>.
11335 <dt> ‘<samp>hsub</samp>’</dt>
11336 <dt> ‘<samp>vsub</samp>’</dt>
11337 <dd><p>horizontal and vertical chroma subsample values. For example for the
11338 pixel format "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
11341 <dt> ‘<samp>in_h, ih</samp>’</dt>
11342 <dt> ‘<samp>in_w, iw</samp>’</dt>
11343 <dd><p>The input width and height.
11346 <dt> ‘<samp>sar</samp>’</dt>
11347 <dd><p>The input sample aspect ratio.
11350 <dt> ‘<samp>x</samp>’</dt>
11351 <dt> ‘<samp>y</samp>’</dt>
11352 <dd><p>The x and y offset coordinates where the box is drawn.
11355 <dt> ‘<samp>w</samp>’</dt>
11356 <dt> ‘<samp>h</samp>’</dt>
11357 <dd><p>The width and height of the drawn box.
11360 <dt> ‘<samp>t</samp>’</dt>
11361 <dd><p>The thickness of the drawn box.
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>.
11369 <a name="Examples-19"></a>
11370 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-19">28.21.1 Examples</a></h3>
11374 Draw a black box around the edge of the input image:
11375 <table><tr><td> </td><td><pre class="example">drawbox
11376 </pre></td></tr></table>
11379 Draw a box with color red and an opacity of 50%:
11380 <table><tr><td> </td><td><pre class="example">drawbox=10:20:200:60:red@0.5
11381 </pre></td></tr></table>
11383 <p>The previous example can be specified as:
11384 </p><table><tr><td> </td><td><pre class="example">drawbox=x=10:y=20:w=200:h=60:color=red@0.5
11385 </pre></td></tr></table>
11388 Fill the box with pink color:
11389 <table><tr><td> </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>
11393 Draw a 2-pixel red 2.40:1 mask:
11394 <table><tr><td> </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>
11398 <a name="drawgrid"></a>
11399 <h2 class="section"><a href="ffplay-all.html#toc-drawgrid">28.22 drawgrid</a></h2>
11401 <p>Draw a grid on the input image.
11403 <p>This filter accepts the following options:
11405 <dl compact="compact">
11406 <dt> ‘<samp>x</samp>’</dt>
11407 <dt> ‘<samp>y</samp>’</dt>
11408 <dd><p>The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0.
11411 <dt> ‘<samp>width, w</samp>’</dt>
11412 <dt> ‘<samp>height, h</samp>’</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.
11418 <dt> ‘<samp>color, c</samp>’</dt>
11419 <dd><p>Specify the color of the grid. For the general syntax of this option,
11420 check the "Color" 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.
11425 <dt> ‘<samp>thickness, t</samp>’</dt>
11426 <dd><p>The expression which sets the thickness of the grid line. Default value is <code>1</code>.
11428 <p>See below for the list of accepted constants.
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:
11435 <dl compact="compact">
11436 <dt> ‘<samp>dar</samp>’</dt>
11437 <dd><p>The input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>.
11440 <dt> ‘<samp>hsub</samp>’</dt>
11441 <dt> ‘<samp>vsub</samp>’</dt>
11442 <dd><p>horizontal and vertical chroma subsample values. For example for the
11443 pixel format "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
11446 <dt> ‘<samp>in_h, ih</samp>’</dt>
11447 <dt> ‘<samp>in_w, iw</samp>’</dt>
11448 <dd><p>The input grid cell width and height.
11451 <dt> ‘<samp>sar</samp>’</dt>
11452 <dd><p>The input sample aspect ratio.
11455 <dt> ‘<samp>x</samp>’</dt>
11456 <dt> ‘<samp>y</samp>’</dt>
11457 <dd><p>The x and y coordinates of some point of grid intersection (meant to configure offset).
11460 <dt> ‘<samp>w</samp>’</dt>
11461 <dt> ‘<samp>h</samp>’</dt>
11462 <dd><p>The width and height of the drawn cell.
11465 <dt> ‘<samp>t</samp>’</dt>
11466 <dd><p>The thickness of the drawn cell.
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>.
11474 <a name="Examples-40"></a>
11475 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-40">28.22.1 Examples</a></h3>
11479 Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an opacity of 50%:
11480 <table><tr><td> </td><td><pre class="example">drawgrid=width=100:height=100:thickness=2:color=red@0.5
11481 </pre></td></tr></table>
11484 Draw a white 3x3 grid with an opacity of 50%:
11485 <table><tr><td> </td><td><pre class="example">drawgrid=w=iw/3:h=ih/3:t=2:c=white@0.5
11486 </pre></td></tr></table>
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>
11493 <p>Draw text string or text from specified file on top of video using the
11494 libfreetype library.
11496 <p>To enable compilation of this filter you need to configure FFmpeg with
11497 <code>--enable-libfreetype</code>.
11499 <a name="Syntax-2"></a>
11500 <h3 class="subsection"><a href="ffplay-all.html#toc-Syntax-2">28.23.1 Syntax</a></h3>
11502 <p>The description of the accepted parameters follows.
11504 <dl compact="compact">
11505 <dt> ‘<samp>box</samp>’</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.
11511 <dt> ‘<samp>boxcolor</samp>’</dt>
11512 <dd><p>The color to be used for drawing box around text. For the syntax of this
11513 option, check the "Color" section in the ffmpeg-utils manual.
11515 <p>The default value of <var>boxcolor</var> is "white".
11518 <dt> ‘<samp>borderw</samp>’</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.
11523 <dt> ‘<samp>bordercolor</samp>’</dt>
11524 <dd><p>Set the color to be used for drawing border around text. For the syntax of this
11525 option, check the "Color" section in the ffmpeg-utils manual.
11527 <p>The default value of <var>bordercolor</var> is "black".
11530 <dt> ‘<samp>expansion</samp>’</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
11537 <dt> ‘<samp>fix_bounds</samp>’</dt>
11538 <dd><p>If true, check and fix text coords to avoid clipping.
11541 <dt> ‘<samp>fontcolor</samp>’</dt>
11542 <dd><p>The color to be used for drawing fonts. For the syntax of this option, check
11543 the "Color" section in the ffmpeg-utils manual.
11545 <p>The default value of <var>fontcolor</var> is "black".
11548 <dt> ‘<samp>fontfile</samp>’</dt>
11549 <dd><p>The font file to be used for drawing text. Path must be included.
11550 This parameter is mandatory.
11553 <dt> ‘<samp>fontsize</samp>’</dt>
11554 <dd><p>The font size to be used for drawing text.
11555 The default value of <var>fontsize</var> is 16.
11558 <dt> ‘<samp>ft_load_flags</samp>’</dt>
11559 <dd><p>Flags to be used for loading the fonts.
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>
11581 <p>Default value is "default".
11583 <p>For more information consult the documentation for the FT_LOAD_*
11587 <dt> ‘<samp>shadowcolor</samp>’</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 "Color" section in the ffmpeg-utils manual.
11591 <p>The default value of <var>shadowcolor</var> is "black".
11594 <dt> ‘<samp>shadowx</samp>’</dt>
11595 <dt> ‘<samp>shadowy</samp>’</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 "0".
11601 <dt> ‘<samp>start_number</samp>’</dt>
11602 <dd><p>The starting frame number for the n/frame_num variable. The default value
11606 <dt> ‘<samp>tabsize</samp>’</dt>
11607 <dd><p>The size in number of spaces to use for rendering the tab.
11608 Default value is 4.
11611 <dt> ‘<samp>timecode</samp>’</dt>
11612 <dd><p>Set the initial timecode representation in "hh:mm:ss[:;.]ff"
11613 format. It can be used with or without text parameter. <var>timecode_rate</var>
11614 option must be specified.
11617 <dt> ‘<samp>timecode_rate, rate, r</samp>’</dt>
11618 <dd><p>Set the timecode frame rate (timecode only).
11621 <dt> ‘<samp>text</samp>’</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>.
11628 <dt> ‘<samp>textfile</samp>’</dt>
11629 <dd><p>A text file containing text to be drawn. The text must be a sequence
11630 of UTF-8 encoded characters.
11632 <p>This parameter is mandatory if no text string is specified with the
11633 parameter <var>text</var>.
11635 <p>If both <var>text</var> and <var>textfile</var> are specified, an error is thrown.
11638 <dt> ‘<samp>reload</samp>’</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.
11643 <dt> ‘<samp>x</samp>’</dt>
11644 <dt> ‘<samp>y</samp>’</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
11649 <p>The default value of <var>x</var> and <var>y</var> is "0".
11651 <p>See below for the list of accepted constants and functions.
11655 <p>The parameters for <var>x</var> and <var>y</var> are expressions containing the
11656 following constants and functions:
11658 <dl compact="compact">
11659 <dt> ‘<samp>dar</samp>’</dt>
11660 <dd><p>input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>
11663 <dt> ‘<samp>hsub</samp>’</dt>
11664 <dt> ‘<samp>vsub</samp>’</dt>
11665 <dd><p>horizontal and vertical chroma subsample values. For example for the
11666 pixel format "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
11669 <dt> ‘<samp>line_h, lh</samp>’</dt>
11670 <dd><p>the height of each text line
11673 <dt> ‘<samp>main_h, h, H</samp>’</dt>
11674 <dd><p>the input height
11677 <dt> ‘<samp>main_w, w, W</samp>’</dt>
11678 <dd><p>the input width
11681 <dt> ‘<samp>max_glyph_a, ascent</samp>’</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
11685 It is a positive value, due to the grid’s orientation with the Y axis
11689 <dt> ‘<samp>max_glyph_d, descent</samp>’</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’s orientation, with the Y axis
11696 <dt> ‘<samp>max_glyph_h</samp>’</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>.
11702 <dt> ‘<samp>max_glyph_w</samp>’</dt>
11703 <dd><p>maximum glyph width, that is the maximum width for all the glyphs
11704 contained in the rendered text
11707 <dt> ‘<samp>n</samp>’</dt>
11708 <dd><p>the number of input frame, starting from 0
11711 <dt> ‘<samp>rand(min, max)</samp>’</dt>
11712 <dd><p>return a random number included between <var>min</var> and <var>max</var>
11715 <dt> ‘<samp>sar</samp>’</dt>
11716 <dd><p>input sample aspect ratio
11719 <dt> ‘<samp>t</samp>’</dt>
11720 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
11723 <dt> ‘<samp>text_h, th</samp>’</dt>
11724 <dd><p>the height of the rendered text
11727 <dt> ‘<samp>text_w, tw</samp>’</dt>
11728 <dd><p>the width of the rendered text
11731 <dt> ‘<samp>x</samp>’</dt>
11732 <dt> ‘<samp>y</samp>’</dt>
11733 <dd><p>the x and y offset coordinates where the text is drawn.
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>.
11740 <p>If libavfilter was built with <code>--enable-fontconfig</code>, then
11741 ‘<samp>fontfile</samp>’ can be a fontconfig pattern or omitted.
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>
11747 <p>If ‘<samp>expansion</samp>’ 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.
11752 <p>If ‘<samp>expansion</samp>’ is set to <code>none</code>, the text is printed verbatim.
11754 <p>If ‘<samp>expansion</samp>’ is set to <code>normal</code> (which is the default),
11755 the following expansion mechanism is used.
11757 <p>The backslash character ’\’, followed by any character, always expands to
11758 the second character.
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 ’:’.
11762 If the arguments contain special characters or delimiters (’:’ or ’}’),
11763 they should be escaped.
11765 <p>Note that they probably must also be escaped as the value for the
11766 ‘<samp>text</samp>’ 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
11771 <p>The following functions are available:
11773 <dl compact="compact">
11774 <dt> <code>expr, e</code></dt>
11775 <dd><p>The expression evaluation result.
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
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.
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.
11795 <dt> <code>metadata</code></dt>
11796 <dd><p>Frame metadata. It must take one argument specifying metadata key.
11799 <dt> <code>n, frame_num</code></dt>
11800 <dd><p>The frame number, starting from 0.
11803 <dt> <code>pict_type</code></dt>
11804 <dd><p>A 1 character description of the current picture type.
11807 <dt> <code>pts</code></dt>
11808 <dd><p>The timestamp of the current frame, in seconds, with microsecond accuracy.
11813 <a name="Examples-44"></a>
11814 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-44">28.23.3 Examples</a></h3>
11818 Draw "Test Text" with font FreeSerif, using the default values for the
11819 optional parameters.
11821 <table><tr><td> </td><td><pre class="example">drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'"
11822 </pre></td></tr></table>
11825 Draw ’Test Text’ 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
11830 <table><tr><td> </td><td><pre class="example">drawtext="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"
11832 </pre></td></tr></table>
11834 <p>Note that the double quotes are not necessary if spaces are not used
11835 within the parameter list.
11838 Show the text at the center of the video frame:
11839 <table><tr><td> </td><td><pre class="example">drawtext="fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h-line_h)/2"
11840 </pre></td></tr></table>
11843 Show a text line sliding from right to left in the last row of the video
11844 frame. The file ‘<tt>LONG_LINE</tt>’ is assumed to contain a single line
11846 <table><tr><td> </td><td><pre class="example">drawtext="fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t"
11847 </pre></td></tr></table>
11850 Show the content of file ‘<tt>CREDITS</tt>’ off the bottom of the frame and scroll up.
11851 <table><tr><td> </td><td><pre class="example">drawtext="fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t"
11852 </pre></td></tr></table>
11855 Draw a single green letter "g", at the center of the input video.
11856 The glyph baseline is placed at half screen height.
11857 <table><tr><td> </td><td><pre class="example">drawtext="fontsize=60:fontfile=FreeSerif.ttf:fontcolor=green:text=g:x=(w-max_glyph_w)/2:y=h/2-ascent"
11858 </pre></td></tr></table>
11861 Show text for 1 second every 3 seconds:
11862 <table><tr><td> </td><td><pre class="example">drawtext="fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:enable=lt(mod(t\,3)\,1):text='blink'"
11863 </pre></td></tr></table>
11866 Use fontconfig to set the font. Note that the colons need to be escaped.
11867 <table><tr><td> </td><td><pre class="example">drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg'
11868 </pre></td></tr></table>
11871 Print the date of a real-time encoding (see strftime(3)):
11872 <table><tr><td> </td><td><pre class="example">drawtext='fontfile=FreeSans.ttf:text=%{localtime:%a %b %d %Y}'
11873 </pre></td></tr></table>
11877 <p>For more information about libfreetype, check:
11878 <a href="http://www.freetype.org/">http://www.freetype.org/</a>.
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>.
11883 <a name="edgedetect"></a>
11884 <h2 class="section"><a href="ffplay-all.html#toc-edgedetect">28.24 edgedetect</a></h2>
11886 <p>Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
11888 <p>The filter accepts the following options:
11890 <dl compact="compact">
11891 <dt> ‘<samp>low</samp>’</dt>
11892 <dt> ‘<samp>high</samp>’</dt>
11893 <dd><p>Set low and high threshold values used by the Canny thresholding
11896 <p>The high threshold selects the "strong" edge pixels, which are then
11897 connected through 8-connectivity with the "weak" edge pixels selected
11898 by the low threshold.
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>.
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>.
11909 </p><table><tr><td> </td><td><pre class="example">edgedetect=low=0.1:high=0.4
11910 </pre></td></tr></table>
11912 <a name="extractplanes"></a>
11913 <h2 class="section"><a href="ffplay-all.html#toc-extractplanes">28.25 extractplanes</a></h2>
11915 <p>Extract color channel components from input video stream into
11916 separate grayscale video streams.
11918 <p>The filter accepts the following option:
11920 <dl compact="compact">
11921 <dt> ‘<samp>planes</samp>’</dt>
11922 <dd><p>Set plane(s) to extract.
11924 <p>Available values for planes are:
11925 </p><dl compact="compact">
11926 <dt> ‘<samp>y</samp>’</dt>
11927 <dt> ‘<samp>u</samp>’</dt>
11928 <dt> ‘<samp>v</samp>’</dt>
11929 <dt> ‘<samp>a</samp>’</dt>
11930 <dt> ‘<samp>r</samp>’</dt>
11931 <dt> ‘<samp>g</samp>’</dt>
11932 <dt> ‘<samp>b</samp>’</dt>
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.
11941 <a name="Examples-43"></a>
11942 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-43">28.25.1 Examples</a></h3>
11946 Extract luma, u and v color channel component from input video frame
11947 into 3 grayscale outputs:
11948 <table><tr><td> </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>
11952 <a name="elbg"></a>
11953 <h2 class="section"><a href="ffplay-all.html#toc-elbg">28.26 elbg</a></h2>
11955 <p>Apply a posterize effect using the ELBG (Enhanced LBG) algorithm.
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.
11961 <p>This filter accepts the following options.
11963 <dl compact="compact">
11964 <dt> ‘<samp>codebook_length, l</samp>’</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.
11969 <dt> ‘<samp>nb_steps, n</samp>’</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.
11975 <dt> ‘<samp>seed, s</samp>’</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.
11982 <a name="fade"></a>
11983 <h2 class="section"><a href="ffplay-all.html#toc-fade">28.27 fade</a></h2>
11985 <p>Apply fade-in/out effect to input video.
11987 <p>This filter accepts the following options:
11989 <dl compact="compact">
11990 <dt> ‘<samp>type, t</samp>’</dt>
11991 <dd><p>The effect type – can be either "in" for fade-in, or "out" for a fade-out
11993 Default is <code>in</code>.
11996 <dt> ‘<samp>start_frame, s</samp>’</dt>
11997 <dd><p>Specify the number of the start frame for starting to apply the fade
11998 effect. Default is 0.
12001 <dt> ‘<samp>nb_frames, n</samp>’</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 ‘<samp>color</samp>’.
12009 <dt> ‘<samp>alpha</samp>’</dt>
12010 <dd><p>If set to 1, fade only alpha channel, if one exists on the input.
12011 Default value is 0.
12014 <dt> ‘<samp>start_time, st</samp>’</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.
12020 <dt> ‘<samp>duration, d</samp>’</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 ‘<samp>color</samp>’.
12025 If both duration and nb_frames are specified, duration is used. Default is 0.
12028 <dt> ‘<samp>color, c</samp>’</dt>
12029 <dd><p>Specify the color of the fade. Default is "black".
12033 <a name="Examples-34"></a>
12034 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-34">28.27.1 Examples</a></h3>
12038 Fade in first 30 frames of video:
12039 <table><tr><td> </td><td><pre class="example">fade=in:0:30
12040 </pre></td></tr></table>
12042 <p>The command above is equivalent to:
12043 </p><table><tr><td> </td><td><pre class="example">fade=t=in:s=0:n=30
12044 </pre></td></tr></table>
12047 Fade out last 45 frames of a 200-frame video:
12048 <table><tr><td> </td><td><pre class="example">fade=out:155:45
12049 fade=type=out:start_frame=155:nb_frames=45
12050 </pre></td></tr></table>
12053 Fade in first 25 frames and fade out last 25 frames of a 1000-frame video:
12054 <table><tr><td> </td><td><pre class="example">fade=in:0:25, fade=out:975:25
12055 </pre></td></tr></table>
12058 Make first 5 frames yellow, then fade in from frame 5-24:
12059 <table><tr><td> </td><td><pre class="example">fade=in:5:20:color=yellow
12060 </pre></td></tr></table>
12063 Fade in alpha over first 25 frames of video:
12064 <table><tr><td> </td><td><pre class="example">fade=in:0:25:alpha=1
12065 </pre></td></tr></table>
12068 Make first 5.5 seconds black, then fade in for 0.5 seconds:
12069 <table><tr><td> </td><td><pre class="example">fade=t=in:st=5.5:d=0.5
12070 </pre></td></tr></table>
12074 <a name="field"></a>
12075 <h2 class="section"><a href="ffplay-all.html#toc-field">28.28 field</a></h2>
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
12081 <p>The filter accepts the following options:
12083 <dl compact="compact">
12084 <dt> ‘<samp>type</samp>’</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>).
12091 <a name="fieldmatch"></a>
12092 <h2 class="section"><a href="ffplay-all.html#toc-fieldmatch">28.29 fieldmatch</a></h2>
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.
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.
12106 <p>In addition to the various configuration options, <code>fieldmatch</code> can take an
12107 optional second stream, activated through the ‘<samp>ppsrc</samp>’ 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.
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.
12119 <p>The filter accepts the following options:
12121 <dl compact="compact">
12122 <dt> ‘<samp>order</samp>’</dt>
12123 <dd><p>Specify the assumed field order of the input stream. Available values are:
12125 <dl compact="compact">
12126 <dt> ‘<samp>auto</samp>’</dt>
12127 <dd><p>Auto detect parity (use FFmpeg’s internal parity value).
12129 <dt> ‘<samp>bff</samp>’</dt>
12130 <dd><p>Assume bottom field first.
12132 <dt> ‘<samp>tff</samp>’</dt>
12133 <dd><p>Assume top field first.
12137 <p>Note that it is sometimes recommended not to trust the parity announced by the
12140 <p>Default value is <var>auto</var>.
12143 <dt> ‘<samp>mode</samp>’</dt>
12144 <dd><p>Set the matching mode or strategy to use. ‘<samp>pc</samp>’ mode is the safest in the
12145 sense that it won’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, ‘<samp>pcn_ub</samp>’ 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 ‘<samp>pc</samp>’ and ‘<samp>pcn_ub</samp>’ 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.
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.
12156 <p>Available values are:
12158 <dl compact="compact">
12159 <dt> ‘<samp>pc</samp>’</dt>
12160 <dd><p>2-way matching (p/c)
12162 <dt> ‘<samp>pc_n</samp>’</dt>
12163 <dd><p>2-way matching, and trying 3rd match if still combed (p/c + n)
12165 <dt> ‘<samp>pc_u</samp>’</dt>
12166 <dd><p>2-way matching, and trying 3rd match (same order) if still combed (p/c + u)
12168 <dt> ‘<samp>pc_n_ub</samp>’</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)
12172 <dt> ‘<samp>pcn</samp>’</dt>
12173 <dd><p>3-way matching (p/c/n)
12175 <dt> ‘<samp>pcn_ub</samp>’</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)
12181 <p>The parenthesis at the end indicate the matches that would be used for that
12182 mode assuming ‘<samp>order</samp>’=<var>tff</var> (and ‘<samp>field</samp>’ on <var>auto</var> or
12185 <p>In terms of speed ‘<samp>pc</samp>’ mode is by far the fastest and ‘<samp>pcn_ub</samp>’ is
12188 <p>Default value is <var>pc_n</var>.
12191 <dt> ‘<samp>ppsrc</samp>’</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 ‘<samp>clip2</samp>’ feature from
12197 <p>Default value is <code>0</code> (disabled).
12200 <dt> ‘<samp>field</samp>’</dt>
12201 <dd><p>Set the field to match from. It is recommended to set this to the same value as
12202 ‘<samp>order</samp>’ 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:
12206 <dl compact="compact">
12207 <dt> ‘<samp>auto</samp>’</dt>
12208 <dd><p>Automatic (same value as ‘<samp>order</samp>’).
12210 <dt> ‘<samp>bottom</samp>’</dt>
12211 <dd><p>Match from the bottom field.
12213 <dt> ‘<samp>top</samp>’</dt>
12214 <dd><p>Match from the top field.
12218 <p>Default value is <var>auto</var>.
12221 <dt> ‘<samp>mchroma</samp>’</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.
12228 <p>Default value is <code>1</code>.
12231 <dt> ‘<samp>y0</samp>’</dt>
12232 <dt> ‘<samp>y1</samp>’</dt>
12233 <dd><p>These define an exclusion band which excludes the lines between ‘<samp>y0</samp>’ and
12234 ‘<samp>y1</samp>’ 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. ‘<samp>y0</samp>’ sets the starting scan line and
12237 ‘<samp>y1</samp>’ sets the ending line; all lines in between ‘<samp>y0</samp>’ and
12238 ‘<samp>y1</samp>’ (including ‘<samp>y0</samp>’ and ‘<samp>y1</samp>’) will be ignored. Setting
12239 ‘<samp>y0</samp>’ and ‘<samp>y1</samp>’ to the same value will disable the feature.
12240 ‘<samp>y0</samp>’ and ‘<samp>y1</samp>’ defaults to <code>0</code>.
12243 <dt> ‘<samp>scthresh</samp>’</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 ‘<samp>combmatch</samp>’=<var>sc</var>. The range for
12247 ‘<samp>scthresh</samp>’ is <code>[0.0, 100.0]</code>.
12249 <p>Default value is <code>12.0</code>.
12252 <dt> ‘<samp>combmatch</samp>’</dt>
12253 <dd><p>When ‘<samp>combatch</samp>’ 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:
12257 <dl compact="compact">
12258 <dt> ‘<samp>none</samp>’</dt>
12259 <dd><p>No final matching based on combed scores.
12261 <dt> ‘<samp>sc</samp>’</dt>
12262 <dd><p>Combed scores are only used when a scene change is detected.
12264 <dt> ‘<samp>full</samp>’</dt>
12265 <dd><p>Use combed scores all the time.
12269 <p>Default is <var>sc</var>.
12272 <dt> ‘<samp>combdbg</samp>’</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 ‘<samp>micout</samp>’ in TFM/VFM vocabulary.
12275 Available values are:
12277 <dl compact="compact">
12278 <dt> ‘<samp>none</samp>’</dt>
12279 <dd><p>No forced calculation.
12281 <dt> ‘<samp>pcn</samp>’</dt>
12282 <dd><p>Force p/c/n calculations.
12284 <dt> ‘<samp>pcnub</samp>’</dt>
12285 <dd><p>Force p/c/n/u/b calculations.
12289 <p>Default value is <var>none</var>.
12292 <dt> ‘<samp>cthresh</samp>’</dt>
12293 <dd><p>This is the area combing threshold used for combed frame detection. This
12294 essentially controls how "strong" or "visible" 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>.
12301 <p>Default value is <code>9</code>.
12304 <dt> ‘<samp>chroma</samp>’</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 ‘<samp>chroma</samp>’=<var>0</var> is usually more reliable, except for the case
12309 where there is chroma only combing in the source.
12311 <p>Default value is <code>0</code>.
12314 <dt> ‘<samp>blockx</samp>’</dt>
12315 <dt> ‘<samp>blocky</samp>’</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 ‘<samp>combpel</samp>’ pixels are required to be detected as combed for a frame to be
12319 declared combed. See the ‘<samp>combpel</samp>’ parameter description for more info.
12320 Possible values are any number that is a power of 2 starting at 4 and going up
12323 <p>Default value is <code>16</code>.
12326 <dt> ‘<samp>combpel</samp>’</dt>
12327 <dd><p>The number of combed pixels inside any of the ‘<samp>blocky</samp>’ by
12328 ‘<samp>blockx</samp>’ size blocks on the frame for the frame to be detected as
12329 combed. While ‘<samp>cthresh</samp>’ controls how "visible" the combing must be, this
12330 setting controls "how much" combing there must be in any localized area (a
12331 window defined by the ‘<samp>blockx</samp>’ and ‘<samp>blocky</samp>’ 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 ‘<samp>MI</samp>’ in TFM/VFM vocabulary.
12336 <p>Default value is <code>80</code>.
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>
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>
12347 <p>We assume the following telecined stream:
12349 <table><tr><td> </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>
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.
12356 <p>When <code>fieldmatch</code> is configured to run a matching from bottom
12357 (‘<samp>field</samp>’=<var>bottom</var>) this is how this input stream get transformed:
12359 <table><tr><td> </td><td><pre class="example">Input stream:
12361 B 1 2 3 4 4 <-- matching reference
12368 </pre></td></tr></table>
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.
12374 <p>The same operation now matching from top fields (‘<samp>field</samp>’=<var>top</var>)
12377 <table><tr><td> </td><td><pre class="example">Input stream:
12378 T 1 2 2 3 4 <-- matching reference
12386 </pre></td></tr></table>
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:
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
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>
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 ’x’ is placed above and below each matched fields.
12405 <p>With bottom matching (‘<samp>field</samp>’=<var>bottom</var>):
12406 </p><table><tr><td> </td><td><pre class="example">Match: c p n b u
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
12416 </pre></td></tr></table>
12418 <p>With top matching (‘<samp>field</samp>’=<var>top</var>):
12419 </p><table><tr><td> </td><td><pre class="example">Match: c p n b u
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
12429 </pre></td></tr></table>
12431 <a name="Examples-55"></a>
12432 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-55">28.29.2 Examples</a></h3>
12434 <p>Simple IVTC of a top field first telecined stream:
12435 </p><table><tr><td> </td><td><pre class="example">fieldmatch=order=tff:combmatch=none, decimate
12436 </pre></td></tr></table>
12438 <p>Advanced IVTC, with fallback on <a href="#yadif">yadif</a> for still combed frames:
12439 </p><table><tr><td> </td><td><pre class="example">fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
12440 </pre></td></tr></table>
12442 <a name="fieldorder"></a>
12443 <h2 class="section"><a href="ffplay-all.html#toc-fieldorder">28.30 fieldorder</a></h2>
12445 <p>Transform the field order of the input video.
12447 <p>This filter accepts the following options:
12449 <dl compact="compact">
12450 <dt> ‘<samp>order</samp>’</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.
12456 <p>Default value is ‘<samp>tff</samp>’.
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.
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.
12466 <p>This filter is very useful when converting to or from PAL DV material,
12467 which is bottom field first.
12470 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i in.vob -vf "fieldorder=bff" out.dv
12471 </pre></td></tr></table>
12473 <a name="fifo"></a>
12474 <h2 class="section"><a href="ffplay-all.html#toc-fifo">28.31 fifo</a></h2>
12476 <p>Buffer input images and send them when they are requested.
12478 <p>This filter is mainly useful when auto-inserted by the libavfilter
12481 <p>The filter does not take parameters.
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>
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
12491 <p>This filter accepts the following parameters:
12492 </p><dl compact="compact">
12493 <dt> ‘<samp>pix_fmts</samp>’</dt>
12494 <dd><p>A ’|’-separated list of pixel format names, for example
12495 "pix_fmts=yuv420p|monow|rgb24".
12500 <a name="Examples-17"></a>
12501 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-17">28.32.1 Examples</a></h3>
12505 Convert the input video to the format <var>yuv420p</var>
12506 <table><tr><td> </td><td><pre class="example">format=pix_fmts=yuv420p
12507 </pre></td></tr></table>
12509 <p>Convert the input video to any of the formats in the list
12510 </p><table><tr><td> </td><td><pre class="example">format=pix_fmts=yuv420p|yuv444p|yuv410p
12511 </pre></td></tr></table>
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>
12518 <p>Convert the video to specified constant frame rate by duplicating or dropping
12519 frames as necessary.
12521 <p>This filter accepts the following named parameters:
12522 </p><dl compact="compact">
12523 <dt> ‘<samp>fps</samp>’</dt>
12524 <dd><p>Desired output frame rate. The default is <code>25</code>.
12527 <dt> ‘<samp>round</samp>’</dt>
12528 <dd><p>Rounding method.
12530 <p>Possible values are:
12531 </p><dl compact="compact">
12532 <dt> ‘<samp>zero</samp>’</dt>
12533 <dd><p>zero round towards 0
12535 <dt> ‘<samp>inf</samp>’</dt>
12536 <dd><p>round away from 0
12538 <dt> ‘<samp>down</samp>’</dt>
12539 <dd><p>round towards -infinity
12541 <dt> ‘<samp>up</samp>’</dt>
12542 <dd><p>round towards +infinity
12544 <dt> ‘<samp>near</samp>’</dt>
12545 <dd><p>round to nearest
12548 <p>The default is <code>near</code>.
12551 <dt> ‘<samp>start_time</samp>’</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’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.
12562 <p>Alternatively, the options can be specified as a flat string:
12563 <var>fps</var>[:<var>round</var>].
12565 <p>See also the <a href="#setpts">setpts</a> filter.
12567 <a name="Examples-60"></a>
12568 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-60">28.33.1 Examples</a></h3>
12572 A typical usage in order to set the fps to 25:
12573 <table><tr><td> </td><td><pre class="example">fps=fps=25
12574 </pre></td></tr></table>
12577 Sets the fps to 24, using abbreviation and rounding method to round to nearest:
12578 <table><tr><td> </td><td><pre class="example">fps=fps=film:round=near
12579 </pre></td></tr></table>
12582 <a name="framepack"></a>
12583 <h2 class="section"><a href="ffplay-all.html#toc-framepack">28.34 framepack</a></h2>
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.
12591 <p>This filter accepts the following named parameters:
12592 </p><dl compact="compact">
12593 <dt> ‘<samp>format</samp>’</dt>
12594 <dd><p>Desired packing format. Supported values are:
12596 <dl compact="compact">
12597 <dt> ‘<samp>sbs</samp>’</dt>
12598 <dd><p>Views are next to each other (default).
12601 <dt> ‘<samp>tab</samp>’</dt>
12602 <dd><p>Views are on top of each other.
12605 <dt> ‘<samp>lines</samp>’</dt>
12606 <dd><p>Views are packed by line.
12609 <dt> ‘<samp>columns</samp>’</dt>
12610 <dd><p>Views are eacked by column.
12613 <dt> ‘<samp>frameseq</samp>’</dt>
12614 <dd><p>Views are temporally interleaved.
12622 <p>Some examples follow:
12624 <table><tr><td> </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
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>
12631 <a name="framestep"></a>
12632 <h2 class="section"><a href="ffplay-all.html#toc-framestep">28.35 framestep</a></h2>
12634 <p>Select one frame every N-th frame.
12636 <p>This filter accepts the following option:
12637 </p><dl compact="compact">
12638 <dt> ‘<samp>step</samp>’</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>.
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>
12648 <p>Apply a frei0r effect to the input video.
12650 <p>To enable compilation of this filter you need to install the frei0r
12651 header and configure FFmpeg with <code>--enable-frei0r</code>.
12653 <p>This filter accepts the following options:
12655 <dl compact="compact">
12656 <dt> ‘<samp>filter_name</samp>’</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 ‘<tt>HOME/.frei0r-1/lib/</tt>’, ‘<tt>/usr/local/lib/frei0r-1/</tt>’,
12662 ‘<tt>/usr/lib/frei0r-1/</tt>’.
12665 <dt> ‘<samp>filter_params</samp>’</dt>
12666 <dd><p>A ’|’-separated list of parameters to pass to the frei0r effect.
12671 <p>A frei0r effect parameter can be a boolean (whose values are specified
12672 with "y" and "n"), 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 "Color"
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.
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.
12681 <a name="Examples-1"></a>
12682 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-1">28.36.1 Examples</a></h3>
12686 Apply the distort0r effect, set the first two double parameters:
12687 <table><tr><td> </td><td><pre class="example">frei0r=filter_name=distort0r:filter_params=0.5|0.01
12688 </pre></td></tr></table>
12691 Apply the colordistance effect, take a color as first parameter:
12692 <table><tr><td> </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>
12698 Apply the perspective effect, specify the top left and top right image
12700 <table><tr><td> </td><td><pre class="example">frei0r=perspective:0.2/0.2|0.8/0.2
12701 </pre></td></tr></table>
12704 <p>For more information see:
12705 <a href="http://frei0r.dyne.org">http://frei0r.dyne.org</a>
12708 <h2 class="section"><a href="ffplay-all.html#toc-geq">28.37 geq</a></h2>
12710 <p>The filter accepts the following options:
12712 <dl compact="compact">
12713 <dt> ‘<samp>lum_expr, lum</samp>’</dt>
12714 <dd><p>Set the luminance expression.
12716 <dt> ‘<samp>cb_expr, cb</samp>’</dt>
12717 <dd><p>Set the chrominance blue expression.
12719 <dt> ‘<samp>cr_expr, cr</samp>’</dt>
12720 <dd><p>Set the chrominance red expression.
12722 <dt> ‘<samp>alpha_expr, a</samp>’</dt>
12723 <dd><p>Set the alpha expression.
12725 <dt> ‘<samp>red_expr, r</samp>’</dt>
12726 <dd><p>Set the red expression.
12728 <dt> ‘<samp>green_expr, g</samp>’</dt>
12729 <dd><p>Set the green expression.
12731 <dt> ‘<samp>blue_expr, b</samp>’</dt>
12732 <dd><p>Set the blue expression.
12736 <p>The colorspace is selected according to the specified options. If one
12737 of the ‘<samp>lum_expr</samp>’, ‘<samp>cb_expr</samp>’, or ‘<samp>cr_expr</samp>’
12738 options is specified, the filter will automatically select a YCbCr
12739 colorspace. If one of the ‘<samp>red_expr</samp>’, ‘<samp>green_expr</samp>’, or
12740 ‘<samp>blue_expr</samp>’ options is specified, it will select an RGB
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.
12748 <p>The expressions can use the following variables and functions:
12750 <dl compact="compact">
12751 <dt> ‘<samp>N</samp>’</dt>
12752 <dd><p>The sequential number of the filtered frame, starting from <code>0</code>.
12755 <dt> ‘<samp>X</samp>’</dt>
12756 <dt> ‘<samp>Y</samp>’</dt>
12757 <dd><p>The coordinates of the current sample.
12760 <dt> ‘<samp>W</samp>’</dt>
12761 <dt> ‘<samp>H</samp>’</dt>
12762 <dd><p>The width and height of the image.
12765 <dt> ‘<samp>SW</samp>’</dt>
12766 <dt> ‘<samp>SH</samp>’</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.
12773 <dt> ‘<samp>T</samp>’</dt>
12774 <dd><p>Time of the current frame, expressed in seconds.
12777 <dt> ‘<samp>p(x, y)</samp>’</dt>
12778 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the current
12782 <dt> ‘<samp>lum(x, y)</samp>’</dt>
12783 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the luminance
12787 <dt> ‘<samp>cb(x, y)</samp>’</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.
12792 <dt> ‘<samp>cr(x, y)</samp>’</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.
12797 <dt> ‘<samp>r(x, y)</samp>’</dt>
12798 <dt> ‘<samp>g(x, y)</samp>’</dt>
12799 <dt> ‘<samp>b(x, y)</samp>’</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.
12804 <dt> ‘<samp>alpha(x, y)</samp>’</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.
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.
12813 <a name="Examples-82"></a>
12814 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-82">28.37.1 Examples</a></h3>
12818 Flip the image horizontally:
12819 <table><tr><td> </td><td><pre class="example">geq=p(W-X\,Y)
12820 </pre></td></tr></table>
12823 Generate a bidimensional sine wave, with angle <code>PI/3</code> and a
12824 wavelength of 100 pixels:
12825 <table><tr><td> </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>
12829 Generate a fancy enigmatic moving light:
12830 <table><tr><td> </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>
12834 Generate a quick emboss effect:
12835 <table><tr><td> </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>
12839 Modify RGB components depending on pixel position:
12840 <table><tr><td> </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>
12844 <a name="gradfun"></a>
12845 <h2 class="section"><a href="ffplay-all.html#toc-gradfun">28.38 gradfun</a></h2>
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
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.
12856 <p>This filter accepts the following options:
12858 <dl compact="compact">
12859 <dt> ‘<samp>strength</samp>’</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
12866 <dt> ‘<samp>radius</samp>’</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.
12875 <p>Alternatively, the options can be specified as a flat string:
12876 <var>strength</var>[:<var>radius</var>]
12878 <a name="Examples"></a>
12879 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples">28.38.1 Examples</a></h3>
12883 Apply the filter with a <code>3.5</code> strength and radius of <code>8</code>:
12884 <table><tr><td> </td><td><pre class="example">gradfun=3.5:8
12885 </pre></td></tr></table>
12888 Specify radius, omitting the strength (which will fall-back to the default
12890 <table><tr><td> </td><td><pre class="example">gradfun=radius=8
12891 </pre></td></tr></table>
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>
12899 <p>Apply a Hald CLUT to a video stream.
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.
12904 <p>The filter accepts the following options:
12906 <dl compact="compact">
12907 <dt> ‘<samp>shortest</samp>’</dt>
12908 <dd><p>Force termination when the shortest input terminates. Default is <code>0</code>.
12910 <dt> ‘<samp>repeatlast</samp>’</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>.
12917 <p><code>haldclut</code> also has the same interpolation options as <a href="#lut3d">lut3d</a> (both
12918 filters share the same internals).
12920 <p>More information about the Hald CLUT can be found on Eskil Steenberg’s website
12921 (Hald CLUT author) at <a href="http://www.quelsolaar.com/technology/clut.html">http://www.quelsolaar.com/technology/clut.html</a>.
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>
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>
12929 <p>Generate an identity Hald CLUT stream altered with various effects:
12930 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f lavfi -i <a href="#haldclutsrc">haldclutsrc</a>=8 -vf "hue=H=2*PI*t:s=sin(2*PI*t)+1, curves=cross_process" -t 10 -c:v ffv1 clut.nut
12931 </pre></td></tr></table>
12933 <p>Note: make sure you use a lossless codec.
12935 <p>Then use it with <code>haldclut</code> to apply it on some random stream:
12936 </p><table><tr><td> </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>
12939 <p>The Hald CLUT will be applied to the 10 first seconds (duration of
12940 ‘<tt>clut.nut</tt>’), then the latest picture of that CLUT stream will be applied
12941 to the remaining frames of the <code>mandelbrot</code> stream.
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>
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.
12952 <p>Typically, the following generated Hald CLUT will be supported by the
12953 <code>haldclut</code> filter:
12955 <table><tr><td> </td><td><pre class="example">ffmpeg -f lavfi -i <a href="#haldclutsrc">haldclutsrc</a>=8 -vf "
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" -frames:v 1 clut.png
12960 </pre></td></tr></table>
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
12966 <p>Then, the effect of this Hald CLUT can be visualized with:
12967 </p><table><tr><td> </td><td><pre class="example">ffplay input.mkv -vf "movie=clut.png, [in] haldclut"
12968 </pre></td></tr></table>
12970 <a name="hflip"></a>
12971 <h2 class="section"><a href="ffplay-all.html#toc-hflip">28.40 hflip</a></h2>
12973 <p>Flip the input video horizontally.
12975 <p>For example to horizontally flip the input video with <code>ffmpeg</code>:
12976 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i in.avi -vf "hflip" out.avi
12977 </pre></td></tr></table>
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
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 "automatically adjusting contrast filter". This filter is
12988 useful only for correcting degraded or poorly captured source
12991 <p>The filter accepts the following options:
12993 <dl compact="compact">
12994 <dt> ‘<samp>strength</samp>’</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.
13001 <dt> ‘<samp>intensity</samp>’</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.
13008 <dt> ‘<samp>antibanding</samp>’</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>.
13016 <a name="histogram"></a>
13017 <h2 class="section"><a href="ffplay-all.html#toc-histogram">28.42 histogram</a></h2>
13019 <p>Compute and draw a color distribution histogram for the input video.
13021 <p>The computed histogram is a representation of the color component
13022 distribution in an image.
13024 <p>The filter accepts the following options:
13026 <dl compact="compact">
13027 <dt> ‘<samp>mode</samp>’</dt>
13028 <dd><p>Set histogram mode.
13030 <p>It accepts the following values:
13031 </p><dl compact="compact">
13032 <dt> ‘<samp>levels</samp>’</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.
13039 <dt> ‘<samp>color</samp>’</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.
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.
13058 <dt> ‘<samp>color2</samp>’</dt>
13059 <dd><p>Chroma values in vectorscope, similar as <code>color</code> but actual chroma values
13063 <dt> ‘<samp>waveform</samp>’</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.
13070 <p>Default value is <code>levels</code>.
13073 <dt> ‘<samp>level_height</samp>’</dt>
13074 <dd><p>Set height of level in <code>levels</code>. Default value is <code>200</code>.
13075 Allowed range is [50, 2048].
13078 <dt> ‘<samp>scale_height</samp>’</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].
13083 <dt> ‘<samp>step</samp>’</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].
13089 <dt> ‘<samp>waveform_mode</samp>’</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>.
13094 <dt> ‘<samp>waveform_mirror</samp>’</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).
13101 <dt> ‘<samp>display_mode</samp>’</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> ‘<samp>parade</samp>’</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.
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.
13120 <dt> ‘<samp>overlay</samp>’</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
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,
13131 <p>Default is <code>parade</code>.
13134 <dt> ‘<samp>levels_mode</samp>’</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>.
13140 <a name="Examples-74"></a>
13141 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-74">28.42.1 Examples</a></h3>
13145 Calculate and draw histogram:
13146 <table><tr><td> </td><td><pre class="example">ffplay -i input -vf histogram
13147 </pre></td></tr></table>
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>
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.
13159 <p>It accepts the following optional parameters:
13161 <dl compact="compact">
13162 <dt> ‘<samp>luma_spatial</samp>’</dt>
13163 <dd><p>a non-negative float number which specifies spatial luma strength,
13167 <dt> ‘<samp>chroma_spatial</samp>’</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
13172 <dt> ‘<samp>luma_tmp</samp>’</dt>
13173 <dd><p>a float number which specifies luma temporal strength, defaults to
13174 6.0*<var>luma_spatial</var>/4.0
13177 <dt> ‘<samp>chroma_tmp</samp>’</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>
13184 <h2 class="section"><a href="ffplay-all.html#toc-hue">28.44 hue</a></h2>
13186 <p>Modify the hue and/or the saturation of the input.
13188 <p>This filter accepts the following options:
13190 <dl compact="compact">
13191 <dt> ‘<samp>h</samp>’</dt>
13192 <dd><p>Specify the hue angle as a number of degrees. It accepts an expression,
13193 and defaults to "0".
13196 <dt> ‘<samp>s</samp>’</dt>
13197 <dd><p>Specify the saturation in the [-10,10] range. It accepts an expression and
13198 defaults to "1".
13201 <dt> ‘<samp>H</samp>’</dt>
13202 <dd><p>Specify the hue angle as a number of radians. It accepts an
13203 expression, and defaults to "0".
13206 <dt> ‘<samp>b</samp>’</dt>
13207 <dd><p>Specify the brightness in the [-10,10] range. It accepts an expression and
13208 defaults to "0".
13212 <p>‘<samp>h</samp>’ and ‘<samp>H</samp>’ are mutually exclusive, and can’t be
13213 specified at the same time.
13215 <p>The ‘<samp>b</samp>’, ‘<samp>h</samp>’, ‘<samp>H</samp>’ and ‘<samp>s</samp>’ option values are
13216 expressions containing the following constants:
13218 <dl compact="compact">
13219 <dt> ‘<samp>n</samp>’</dt>
13220 <dd><p>frame count of the input frame starting from 0
13223 <dt> ‘<samp>pts</samp>’</dt>
13224 <dd><p>presentation timestamp of the input frame expressed in time base units
13227 <dt> ‘<samp>r</samp>’</dt>
13228 <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
13231 <dt> ‘<samp>t</samp>’</dt>
13232 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
13235 <dt> ‘<samp>tb</samp>’</dt>
13236 <dd><p>time base of the input video
13240 <a name="Examples-39"></a>
13241 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-39">28.44.1 Examples</a></h3>
13245 Set the hue to 90 degrees and the saturation to 1.0:
13246 <table><tr><td> </td><td><pre class="example">hue=h=90:s=1
13247 </pre></td></tr></table>
13250 Same command but expressing the hue in radians:
13251 <table><tr><td> </td><td><pre class="example">hue=H=PI/2:s=1
13252 </pre></td></tr></table>
13255 Rotate hue and make the saturation swing between 0
13256 and 2 over a period of 1 second:
13257 <table><tr><td> </td><td><pre class="example">hue="H=2*PI*t: s=sin(2*PI*t)+1"
13258 </pre></td></tr></table>
13261 Apply a 3 seconds saturation fade-in effect starting at 0:
13262 <table><tr><td> </td><td><pre class="example">hue="s=min(t/3\,1)"
13263 </pre></td></tr></table>
13265 <p>The general fade-in expression can be written as:
13266 </p><table><tr><td> </td><td><pre class="example">hue="s=min(0\, max((t-START)/DURATION\, 1))"
13267 </pre></td></tr></table>
13270 Apply a 3 seconds saturation fade-out effect starting at 5 seconds:
13271 <table><tr><td> </td><td><pre class="example">hue="s=max(0\, min(1\, (8-t)/3))"
13272 </pre></td></tr></table>
13274 <p>The general fade-out expression can be written as:
13275 </p><table><tr><td> </td><td><pre class="example">hue="s=max(0\, min(1\, (START+DURATION-t)/DURATION))"
13276 </pre></td></tr></table>
13280 <a name="Commands"></a>
13281 <h3 class="subsection"><a href="ffplay-all.html#toc-Commands">28.44.2 Commands</a></h3>
13283 <p>This filter supports the following commands:
13284 </p><dl compact="compact">
13285 <dt> ‘<samp>b</samp>’</dt>
13286 <dt> ‘<samp>s</samp>’</dt>
13287 <dt> ‘<samp>h</samp>’</dt>
13288 <dt> ‘<samp>H</samp>’</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.
13292 <p>If the specified expression is not valid, it is kept at its current
13297 <a name="idet"></a>
13298 <h2 class="section"><a href="ffplay-all.html#toc-idet">28.45 idet</a></h2>
13300 <p>Detect video interlacing type.
13302 <p>This filter tries to detect if the input is interlaced or progressive,
13303 top or bottom field first.
13305 <p>The filter accepts the following options:
13307 <dl compact="compact">
13308 <dt> ‘<samp>intl_thres</samp>’</dt>
13309 <dd><p>Set interlacing threshold.
13311 <dt> ‘<samp>prog_thres</samp>’</dt>
13312 <dd><p>Set progressive threshold.
13317 <h2 class="section"><a href="ffplay-all.html#toc-il">28.46 il</a></h2>
13319 <p>Deinterleave or interleave fields.
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.
13327 <p>The filter accepts the following options:
13329 <dl compact="compact">
13330 <dt> ‘<samp>luma_mode, l</samp>’</dt>
13331 <dt> ‘<samp>chroma_mode, c</samp>’</dt>
13332 <dt> ‘<samp>alpha_mode, a</samp>’</dt>
13333 <dd><p>Available values for <var>luma_mode</var>, <var>chroma_mode</var> and
13334 <var>alpha_mode</var> are:
13336 <dl compact="compact">
13337 <dt> ‘<samp>none</samp>’</dt>
13341 <dt> ‘<samp>deinterleave, d</samp>’</dt>
13342 <dd><p>Deinterleave fields, placing one above the other.
13345 <dt> ‘<samp>interleave, i</samp>’</dt>
13346 <dd><p>Interleave fields. Reverse the effect of deinterleaving.
13349 <p>Default value is <code>none</code>.
13352 <dt> ‘<samp>luma_swap, ls</samp>’</dt>
13353 <dt> ‘<samp>chroma_swap, cs</samp>’</dt>
13354 <dt> ‘<samp>alpha_swap, as</samp>’</dt>
13355 <dd><p>Swap luma/chroma/alpha fields. Exchange even & odd lines. Default value is <code>0</code>.
13359 <a name="interlace"></a>
13360 <h2 class="section"><a href="ffplay-all.html#toc-interlace">28.47 interlace</a></h2>
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.
13367 <table><tr><td> </td><td><pre class="example"> Original Original New Frame
13368 Frame 'j' Frame 'j+1' (tff)
13369 ========== =========== ==================
13370 Line 0 --------------------> Frame 'j' Line 0
13371 Line 1 Line 1 ----> Frame 'j+1' Line 1
13372 Line 2 ---------------------> Frame 'j' Line 2
13373 Line 3 Line 3 ----> Frame 'j+1' Line 3
13375 New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on
13376 </pre></td></tr></table>
13378 <p>It accepts the following optional parameters:
13380 <dl compact="compact">
13381 <dt> ‘<samp>scan</samp>’</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.
13387 <a name="kerndeint"></a>
13388 <h2 class="section"><a href="ffplay-all.html#toc-kerndeint">28.48 kerndeint</a></h2>
13390 <p>Deinterlace input video by applying Donald Graft’s adaptive kernel
13391 deinterling. Work on interlaced parts of a video to produce
13392 progressive frames.
13394 <p>The description of the accepted parameters follows.
13396 <dl compact="compact">
13397 <dt> ‘<samp>thresh</samp>’</dt>
13398 <dd><p>Set the threshold which affects the filter’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.
13404 <dt> ‘<samp>map</samp>’</dt>
13405 <dd><p>Paint pixels exceeding the threshold value to white if set to 1.
13409 <dt> ‘<samp>order</samp>’</dt>
13410 <dd><p>Set the fields order. Swap fields if set to 1, leave fields alone if
13414 <dt> ‘<samp>sharp</samp>’</dt>
13415 <dd><p>Enable additional sharpening if set to 1. Default is 0.
13418 <dt> ‘<samp>twoway</samp>’</dt>
13419 <dd><p>Enable twoway sharpening if set to 1. Default is 0.
13423 <a name="Examples-45"></a>
13424 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-45">28.48.1 Examples</a></h3>
13428 Apply default values:
13429 <table><tr><td> </td><td><pre class="example">kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
13430 </pre></td></tr></table>
13433 Enable additional sharpening:
13434 <table><tr><td> </td><td><pre class="example">kerndeint=sharp=1
13435 </pre></td></tr></table>
13438 Paint processed pixels in white:
13439 <table><tr><td> </td><td><pre class="example">kerndeint=map=1
13440 </pre></td></tr></table>
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>
13447 <p>Apply a 3D LUT to an input video.
13449 <p>The filter accepts the following options:
13451 <dl compact="compact">
13452 <dt> ‘<samp>file</samp>’</dt>
13453 <dd><p>Set the 3D LUT file name.
13455 <p>Currently supported formats:
13456 </p><dl compact="compact">
13457 <dt> ‘<samp>3dl</samp>’</dt>
13458 <dd><p>AfterEffects
13460 <dt> ‘<samp>cube</samp>’</dt>
13463 <dt> ‘<samp>dat</samp>’</dt>
13466 <dt> ‘<samp>m3d</samp>’</dt>
13471 <dt> ‘<samp>interp</samp>’</dt>
13472 <dd><p>Select interpolation mode.
13474 <p>Available values are:
13476 <dl compact="compact">
13477 <dt> ‘<samp>nearest</samp>’</dt>
13478 <dd><p>Use values from the nearest defined point.
13480 <dt> ‘<samp>trilinear</samp>’</dt>
13481 <dd><p>Interpolate values using the 8 points defining a cube.
13483 <dt> ‘<samp>tetrahedral</samp>’</dt>
13484 <dd><p>Interpolate values using a tetrahedron.
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>
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.
13496 <p><var>lutyuv</var> applies a lookup table to a YUV input video, <var>lutrgb</var>
13497 to an RGB input video.
13499 <p>These filters accept the following options:
13500 </p><dl compact="compact">
13501 <dt> ‘<samp>c0</samp>’</dt>
13502 <dd><p>set first pixel component expression
13504 <dt> ‘<samp>c1</samp>’</dt>
13505 <dd><p>set second pixel component expression
13507 <dt> ‘<samp>c2</samp>’</dt>
13508 <dd><p>set third pixel component expression
13510 <dt> ‘<samp>c3</samp>’</dt>
13511 <dd><p>set fourth pixel component expression, corresponds to the alpha component
13514 <dt> ‘<samp>r</samp>’</dt>
13515 <dd><p>set red component expression
13517 <dt> ‘<samp>g</samp>’</dt>
13518 <dd><p>set green component expression
13520 <dt> ‘<samp>b</samp>’</dt>
13521 <dd><p>set blue component expression
13523 <dt> ‘<samp>a</samp>’</dt>
13524 <dd><p>alpha component expression
13527 <dt> ‘<samp>y</samp>’</dt>
13528 <dd><p>set Y/luminance component expression
13530 <dt> ‘<samp>u</samp>’</dt>
13531 <dd><p>set U/Cb component expression
13533 <dt> ‘<samp>v</samp>’</dt>
13534 <dd><p>set V/Cr component expression
13538 <p>Each of them specifies the expression to use for computing the lookup table for
13539 the corresponding pixel component values.
13541 <p>The exact component associated to each of the <var>c*</var> options depends on the
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.
13547 <p>The expressions can contain the following constants and functions:
13549 <dl compact="compact">
13550 <dt> ‘<samp>w</samp>’</dt>
13551 <dt> ‘<samp>h</samp>’</dt>
13552 <dd><p>the input width and height
13555 <dt> ‘<samp>val</samp>’</dt>
13556 <dd><p>input value for the pixel component
13559 <dt> ‘<samp>clipval</samp>’</dt>
13560 <dd><p>the input value clipped in the <var>minval</var>-<var>maxval</var> range
13563 <dt> ‘<samp>maxval</samp>’</dt>
13564 <dd><p>maximum value for the pixel component
13567 <dt> ‘<samp>minval</samp>’</dt>
13568 <dd><p>minimum value for the pixel component
13571 <dt> ‘<samp>negval</samp>’</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 "maxval-clipval+minval"
13577 <dt> ‘<samp>clip(val)</samp>’</dt>
13578 <dd><p>the computed value in <var>val</var> clipped in the
13579 <var>minval</var>-<var>maxval</var> range
13582 <dt> ‘<samp>gammaval(gamma)</samp>’</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
13586 "pow((clipval-minval)/(maxval-minval)\,<var>gamma</var>)*(maxval-minval)+minval"
13591 <p>All expressions default to "val".
13593 <a name="Examples-5"></a>
13594 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-5">28.50.1 Examples</a></h3>
13598 Negate input video:
13599 <table><tr><td> </td><td><pre class="example">lutrgb="r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val"
13600 lutyuv="y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val"
13601 </pre></td></tr></table>
13603 <p>The above is the same as:
13604 </p><table><tr><td> </td><td><pre class="example">lutrgb="r=negval:g=negval:b=negval"
13605 lutyuv="y=negval:u=negval:v=negval"
13606 </pre></td></tr></table>
13610 <table><tr><td> </td><td><pre class="example">lutyuv=y=negval
13611 </pre></td></tr></table>
13614 Remove chroma components, turns the video into a graytone image:
13615 <table><tr><td> </td><td><pre class="example">lutyuv="u=128:v=128"
13616 </pre></td></tr></table>
13619 Apply a luma burning effect:
13620 <table><tr><td> </td><td><pre class="example">lutyuv="y=2*val"
13621 </pre></td></tr></table>
13624 Remove green and blue components:
13625 <table><tr><td> </td><td><pre class="example">lutrgb="g=0:b=0"
13626 </pre></td></tr></table>
13629 Set a constant alpha channel value on input:
13630 <table><tr><td> </td><td><pre class="example">format=rgba,lutrgb=a="maxval-minval/2"
13631 </pre></td></tr></table>
13634 Correct luminance gamma by a 0.5 factor:
13635 <table><tr><td> </td><td><pre class="example">lutyuv=y=gammaval(0.5)
13636 </pre></td></tr></table>
13639 Discard least significant bits of luma:
13640 <table><tr><td> </td><td><pre class="example">lutyuv=y='bitand(val, 128+64+32)'
13641 </pre></td></tr></table>
13644 <a name="mergeplanes"></a>
13645 <h2 class="section"><a href="ffplay-all.html#toc-mergeplanes">28.51 mergeplanes</a></h2>
13647 <p>Merge color channel components from several video streams.
13649 <p>The filter accepts up to 4 input streams, and merge selected input
13650 planes to the output video.
13652 <p>This filter accepts the following options:
13653 </p><dl compact="compact">
13654 <dt> ‘<samp>mapping</samp>’</dt>
13655 <dd><p>Set input to output plane mapping. Default is <code>0</code>.
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]]]. ’Aa’ describes the
13659 mapping for the first plane of the output stream. ’A’ sets the number of
13660 the input stream to use (from 0 to 3), and ’a’ the plane number of the
13661 corresponding input to use (from 0 to 3). The rest of the mappings is
13662 similar, ’Bb’ describes the mapping for the output stream second
13663 plane, ’Cc’ describes the mapping for the output stream third plane and
13664 ’Dd’ describes the mapping for the output stream fourth plane.
13667 <dt> ‘<samp>format</samp>’</dt>
13668 <dd><p>Set output pixel format. Default is <code>yuva444p</code>.
13672 <a name="Examples-3"></a>
13673 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-3">28.51.1 Examples</a></h3>
13677 Merge three gray video streams of same width and height into single video stream:
13678 <table><tr><td> </td><td><pre class="example">[a0][a1][a2]mergeplanes=0x001020:yuv444p
13679 </pre></td></tr></table>
13682 Merge 1st yuv444p stream and 2nd gray video stream into yuva444p video stream:
13683 <table><tr><td> </td><td><pre class="example">[a0][a1]mergeplanes=0x00010210:yuva444p
13684 </pre></td></tr></table>
13687 Swap Y and A plane in yuva444p stream:
13688 <table><tr><td> </td><td><pre class="example">format=yuva444p,mergeplanes=0x03010200:yuva444p
13689 </pre></td></tr></table>
13692 Swap U and V plane in yuv420p stream:
13693 <table><tr><td> </td><td><pre class="example">format=yuv420p,mergeplanes=0x000201:yuv420p
13694 </pre></td></tr></table>
13697 Cast a rgb24 clip to yuv444p:
13698 <table><tr><td> </td><td><pre class="example">format=rgb24,mergeplanes=0x000102:yuv444p
13699 </pre></td></tr></table>
13702 <a name="mcdeint"></a>
13703 <h2 class="section"><a href="ffplay-all.html#toc-mcdeint">28.52 mcdeint</a></h2>
13705 <p>Apply motion-compensation deinterlacing.
13707 <p>It needs one field per frame as input and must thus be used together
13708 with yadif=1/3 or equivalent.
13710 <p>This filter accepts the following options:
13711 </p><dl compact="compact">
13712 <dt> ‘<samp>mode</samp>’</dt>
13713 <dd><p>Set the deinterlacing mode.
13715 <p>It accepts one of the following values:
13716 </p><dl compact="compact">
13717 <dt> ‘<samp>fast</samp>’</dt>
13718 <dt> ‘<samp>medium</samp>’</dt>
13719 <dt> ‘<samp>slow</samp>’</dt>
13720 <dd><p>use iterative motion estimation
13722 <dt> ‘<samp>extra_slow</samp>’</dt>
13723 <dd><p>like ‘<samp>slow</samp>’, but use multiple reference frames.
13726 <p>Default value is ‘<samp>fast</samp>’.
13729 <dt> ‘<samp>parity</samp>’</dt>
13730 <dd><p>Set the picture field parity assumed for the input video. It must be
13731 one of the following values:
13733 <dl compact="compact">
13734 <dt> ‘<samp>0, tff</samp>’</dt>
13735 <dd><p>assume top field first
13737 <dt> ‘<samp>1, bff</samp>’</dt>
13738 <dd><p>assume bottom field first
13742 <p>Default value is ‘<samp>bff</samp>’.
13745 <dt> ‘<samp>qp</samp>’</dt>
13746 <dd><p>Set per-block quantization parameter (QP) used by the internal
13749 <p>Higher values should result in a smoother motion vector field but less
13750 optimal individual vectors. Default value is 1.
13755 <h2 class="section"><a href="ffplay-all.html#toc-mp">28.53 mp</a></h2>
13757 <p>Apply an MPlayer filter to the input video.
13759 <p>This filter provides a wrapper around some of the filters of
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.
13767 <p>The filter accepts the parameters:
13768 <var>filter_name</var>[:=]<var>filter_params</var>
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
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>
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 "VIDEO FILTERS" section in the MPlayer manual.
13789 <a name="Examples-10"></a>
13790 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-10">28.53.1 Examples</a></h3>
13794 Adjust gamma, brightness, contrast:
13795 <table><tr><td> </td><td><pre class="example">mp=eq2=1.0:2:0.5
13796 </pre></td></tr></table>
13799 <p>See also mplayer(1), <a href="http://www.mplayerhq.hu/">http://www.mplayerhq.hu/</a>.
13801 <a name="mpdecimate"></a>
13802 <h2 class="section"><a href="ffplay-all.html#toc-mpdecimate">28.54 mpdecimate</a></h2>
13804 <p>Drop frames that do not differ greatly from the previous frame in
13805 order to reduce frame rate.
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.
13811 <p>A description of the accepted options follows.
13813 <dl compact="compact">
13814 <dt> ‘<samp>max</samp>’</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.
13820 <p>Default value is 0.
13823 <dt> ‘<samp>hi</samp>’</dt>
13824 <dt> ‘<samp>lo</samp>’</dt>
13825 <dt> ‘<samp>frac</samp>’</dt>
13826 <dd><p>Set the dropping threshold values.
13828 <p>Values for ‘<samp>hi</samp>’ and ‘<samp>lo</samp>’ 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.
13833 <p>A frame is a candidate for dropping if no 8x8 blocks differ by more
13834 than a threshold of ‘<samp>hi</samp>’, and if no more than ‘<samp>frac</samp>’ blocks (1
13835 meaning the whole image) differ by more than a threshold of ‘<samp>lo</samp>’.
13837 <p>Default value for ‘<samp>hi</samp>’ is 64*12, default value for ‘<samp>lo</samp>’ is
13838 64*5, and default value for ‘<samp>frac</samp>’ is 0.33.
13843 <a name="negate"></a>
13844 <h2 class="section"><a href="ffplay-all.html#toc-negate">28.55 negate</a></h2>
13846 <p>Negate input video.
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.
13851 <a name="noformat"></a>
13852 <h2 class="section"><a href="ffplay-all.html#toc-noformat">28.56 noformat</a></h2>
13854 <p>Force libavfilter not to use any of the specified pixel formats for the
13855 input to the next filter.
13857 <p>This filter accepts the following parameters:
13858 </p><dl compact="compact">
13859 <dt> ‘<samp>pix_fmts</samp>’</dt>
13860 <dd><p>A ’|’-separated list of pixel format names, for example
13861 "pix_fmts=yuv420p|monow|rgb24".
13866 <a name="Examples-65"></a>
13867 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-65">28.56.1 Examples</a></h3>
13871 Force libavfilter to use a format different from <var>yuv420p</var> for the
13872 input to the vflip filter:
13873 <table><tr><td> </td><td><pre class="example">noformat=pix_fmts=yuv420p,vflip
13874 </pre></td></tr></table>
13877 Convert the input video to any of the formats not contained in the list:
13878 <table><tr><td> </td><td><pre class="example">noformat=yuv420p|yuv444p|yuv410p
13879 </pre></td></tr></table>
13882 <a name="noise-1"></a>
13883 <h2 class="section"><a href="ffplay-all.html#toc-noise-1">28.57 noise</a></h2>
13885 <p>Add noise on video input frame.
13887 <p>The filter accepts the following options:
13889 <dl compact="compact">
13890 <dt> ‘<samp>all_seed</samp>’</dt>
13891 <dt> ‘<samp>c0_seed</samp>’</dt>
13892 <dt> ‘<samp>c1_seed</samp>’</dt>
13893 <dt> ‘<samp>c2_seed</samp>’</dt>
13894 <dt> ‘<samp>c3_seed</samp>’</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>.
13899 <dt> ‘<samp>all_strength, alls</samp>’</dt>
13900 <dt> ‘<samp>c0_strength, c0s</samp>’</dt>
13901 <dt> ‘<samp>c1_strength, c1s</samp>’</dt>
13902 <dt> ‘<samp>c2_strength, c2s</samp>’</dt>
13903 <dt> ‘<samp>c3_strength, c3s</samp>’</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].
13908 <dt> ‘<samp>all_flags, allf</samp>’</dt>
13909 <dt> ‘<samp>c0_flags, c0f</samp>’</dt>
13910 <dt> ‘<samp>c1_flags, c1f</samp>’</dt>
13911 <dt> ‘<samp>c2_flags, c2f</samp>’</dt>
13912 <dt> ‘<samp>c3_flags, c3f</samp>’</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> ‘<samp>a</samp>’</dt>
13917 <dd><p>averaged temporal noise (smoother)
13919 <dt> ‘<samp>p</samp>’</dt>
13920 <dd><p>mix random noise with a (semi)regular pattern
13922 <dt> ‘<samp>t</samp>’</dt>
13923 <dd><p>temporal noise (noise pattern changes between frames)
13925 <dt> ‘<samp>u</samp>’</dt>
13926 <dd><p>uniform noise (gaussian otherwise)
13932 <a name="Examples-58"></a>
13933 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-58">28.57.1 Examples</a></h3>
13935 <p>Add temporal and uniform noise to input video:
13936 </p><table><tr><td> </td><td><pre class="example">noise=alls=20:allf=t+u
13937 </pre></td></tr></table>
13939 <a name="null"></a>
13940 <h2 class="section"><a href="ffplay-all.html#toc-null">28.58 null</a></h2>
13942 <p>Pass the video source unchanged to the output.
13945 <h2 class="section"><a href="ffplay-all.html#toc-ocv">28.59 ocv</a></h2>
13947 <p>Apply video transform using libopencv.
13949 <p>To enable this filter install libopencv library and headers and
13950 configure FFmpeg with <code>--enable-libopencv</code>.
13952 <p>This filter accepts the following parameters:
13954 <dl compact="compact">
13955 <dt> ‘<samp>filter_name</samp>’</dt>
13956 <dd><p>The name of the libopencv filter to apply.
13959 <dt> ‘<samp>filter_params</samp>’</dt>
13960 <dd><p>The parameters to pass to the libopencv filter. If not specified the default
13961 values are assumed.
13966 <p>Refer to the official libopencv documentation for more precise
13968 <a href="http://opencv.willowgarage.com/documentation/c/image_filtering.html">http://opencv.willowgarage.com/documentation/c/image_filtering.html</a>
13970 <p>Follows the list of supported libopencv filters.
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>
13976 <p>Dilate an image by using a specific structuring element.
13977 This filter corresponds to the libopencv function <code>cvDilate</code>.
13979 <p>It accepts the parameters: <var>struct_el</var>|<var>nb_iterations</var>.
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>
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 "rect", "cross", "ellipse", "custom".
13989 <p>If the value for <var>shape</var> is "custom", it must be followed by a
13990 string of the form "=<var>filename</var>". 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.
13996 <p>The default value for <var>struct_el</var> is "3x3+0x0/rect".
13998 <p><var>nb_iterations</var> specifies the number of times the transform is
13999 applied to the image, and defaults to 1.
14001 <p>Follow some example:
14002 </p><table><tr><td> </td><td><pre class="example"># use the default values
14005 # dilate using a structuring element with a 5x5 cross, iterate two times
14006 ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
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:
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>
14019 <a name="erode"></a>
14020 <h3 class="subsection"><a href="ffplay-all.html#toc-erode">28.59.2 erode</a></h3>
14022 <p>Erode an image by using a specific structuring element.
14023 This filter corresponds to the libopencv function <code>cvErode</code>.
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.
14028 <a name="smooth"></a>
14029 <h3 class="subsection"><a href="ffplay-all.html#toc-smooth">28.59.3 smooth</a></h3>
14031 <p>Smooth the input video.
14033 <p>The filter takes the following parameters:
14034 <var>type</var>|<var>param1</var>|<var>param2</var>|<var>param3</var>|<var>param4</var>.
14036 <p><var>type</var> is the type of smooth filter to apply, and can be one of
14037 the following values: "blur", "blur_no_scale", "median", "gaussian",
14038 "bilateral". The default value is "gaussian".
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.
14045 <p>The default value for <var>param1</var> is 3, the default value for the
14046 other parameters is 0.
14048 <p>These parameters correspond to the parameters assigned to the
14049 libopencv function <code>cvSmooth</code>.
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>
14055 <p>Overlay one video on top of another.
14057 <p>It takes two inputs and one output, the first input is the "main"
14058 video on which the second input is overlayed.
14060 <p>This filter accepts the following parameters:
14062 <p>A description of the accepted options follows.
14064 <dl compact="compact">
14065 <dt> ‘<samp>x</samp>’</dt>
14066 <dt> ‘<samp>y</samp>’</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 "0" 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).
14073 <dt> ‘<samp>eof_action</samp>’</dt>
14074 <dd><p>The action to take when EOF is encountered on the secondary input, accepts one
14075 of the following values:
14077 <dl compact="compact">
14078 <dt> ‘<samp>repeat</samp>’</dt>
14079 <dd><p>repeat the last frame (the default)
14081 <dt> ‘<samp>endall</samp>’</dt>
14082 <dd><p>end both streams
14084 <dt> ‘<samp>pass</samp>’</dt>
14085 <dd><p>pass through the main input
14090 <dt> ‘<samp>eval</samp>’</dt>
14091 <dd><p>Set when the expressions for ‘<samp>x</samp>’, and ‘<samp>y</samp>’ are evaluated.
14093 <p>It accepts the following values:
14094 </p><dl compact="compact">
14095 <dt> ‘<samp>init</samp>’</dt>
14096 <dd><p>only evaluate expressions once during the filter initialization or
14097 when a command is processed
14100 <dt> ‘<samp>frame</samp>’</dt>
14101 <dd><p>evaluate expressions for each incoming frame
14105 <p>Default value is ‘<samp>frame</samp>’.
14108 <dt> ‘<samp>shortest</samp>’</dt>
14109 <dd><p>If set to 1, force the output to terminate when the shortest input
14110 terminates. Default value is 0.
14113 <dt> ‘<samp>format</samp>’</dt>
14114 <dd><p>Set the format for the output video.
14116 <p>It accepts the following values:
14117 </p><dl compact="compact">
14118 <dt> ‘<samp>yuv420</samp>’</dt>
14119 <dd><p>force YUV420 output
14122 <dt> ‘<samp>yuv422</samp>’</dt>
14123 <dd><p>force YUV422 output
14126 <dt> ‘<samp>yuv444</samp>’</dt>
14127 <dd><p>force YUV444 output
14130 <dt> ‘<samp>rgb</samp>’</dt>
14131 <dd><p>force RGB output
14135 <p>Default value is ‘<samp>yuv420</samp>’.
14138 <dt> ‘<samp>rgb <em>(deprecated)</em></samp>’</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 ‘<samp>format</samp>’ instead.
14144 <dt> ‘<samp>repeatlast</samp>’</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.
14151 <p>The ‘<samp>x</samp>’, and ‘<samp>y</samp>’ expressions can contain the following
14154 <dl compact="compact">
14155 <dt> ‘<samp>main_w, W</samp>’</dt>
14156 <dt> ‘<samp>main_h, H</samp>’</dt>
14157 <dd><p>main input width and height
14160 <dt> ‘<samp>overlay_w, w</samp>’</dt>
14161 <dt> ‘<samp>overlay_h, h</samp>’</dt>
14162 <dd><p>overlay input width and height
14165 <dt> ‘<samp>x</samp>’</dt>
14166 <dt> ‘<samp>y</samp>’</dt>
14167 <dd><p>the computed values for <var>x</var> and <var>y</var>. They are evaluated for
14171 <dt> ‘<samp>hsub</samp>’</dt>
14172 <dt> ‘<samp>vsub</samp>’</dt>
14173 <dd><p>horizontal and vertical chroma subsample values of the output
14174 format. For example for the pixel format "yuv422p" <var>hsub</var> is 2 and
14175 <var>vsub</var> is 1.
14178 <dt> ‘<samp>n</samp>’</dt>
14179 <dd><p>the number of input frame, starting from 0
14182 <dt> ‘<samp>pos</samp>’</dt>
14183 <dd><p>the position in the file of the input frame, NAN if unknown
14186 <dt> ‘<samp>t</samp>’</dt>
14187 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
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 ‘<samp>eval</samp>’ is set to ‘<samp>init</samp>’.
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.
14202 <p>You can chain together more overlays but you should test the
14203 efficiency of such approach.
14205 <a name="Commands-4"></a>
14206 <h3 class="subsection"><a href="ffplay-all.html#toc-Commands-4">28.60.1 Commands</a></h3>
14208 <p>This filter supports the following commands:
14209 </p><dl compact="compact">
14210 <dt> ‘<samp>x</samp>’</dt>
14211 <dt> ‘<samp>y</samp>’</dt>
14212 <dd><p>Modify the x and y of the overlay input.
14213 The command accepts the same syntax of the corresponding option.
14215 <p>If the specified expression is not valid, it is kept at its current
14220 <a name="Examples-15"></a>
14221 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-15">28.60.2 Examples</a></h3>
14225 Draw the overlay at 10 pixels from the bottom right corner of the main
14227 <table><tr><td> </td><td><pre class="example">overlay=main_w-overlay_w-10:main_h-overlay_h-10
14228 </pre></td></tr></table>
14230 <p>Using named options the example above becomes:
14231 </p><table><tr><td> </td><td><pre class="example">overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10
14232 </pre></td></tr></table>
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> </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>
14241 Insert 2 different transparent PNG logos (second logo on bottom
14242 right corner) using the <code>ffmpeg</code> tool:
14243 <table><tr><td> </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>
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> </td><td><pre class="example">color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
14250 </pre></td></tr></table>
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> </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>
14258 <p>The above command is the same as:
14259 </p><table><tr><td> </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>
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> </td><td><pre class="example">overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
14266 </pre></td></tr></table>
14269 Compose output by putting two input videos side to side:
14270 <table><tr><td> </td><td><pre class="example">ffmpeg -i left.avi -i right.avi -filter_complex "
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]
14277 </pre></td></tr></table>
14280 mask 10-20 seconds of a video by applying the delogo filter to a section
14281 <table><tr><td> </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]'
14284 </pre></td></tr></table>
14287 Chain several overlays in cascade:
14288 <table><tr><td> </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>
14298 <a name="owdenoise"></a>
14299 <h2 class="section"><a href="ffplay-all.html#toc-owdenoise">28.61 owdenoise</a></h2>
14301 <p>Apply Overcomplete Wavelet denoiser.
14303 <p>The filter accepts the following options:
14305 <dl compact="compact">
14306 <dt> ‘<samp>depth</samp>’</dt>
14309 <p>Larger depth values will denoise lower frequency components more, but
14310 slow down filtering.
14312 <p>Must be an int in the range 8-16, default is <code>8</code>.
14315 <dt> ‘<samp>luma_strength, ls</samp>’</dt>
14316 <dd><p>Set luma strength.
14318 <p>Must be a double value in the range 0-1000, default is <code>1.0</code>.
14321 <dt> ‘<samp>chroma_strength, cs</samp>’</dt>
14322 <dd><p>Set chroma strength.
14324 <p>Must be a double value in the range 0-1000, default is <code>1.0</code>.
14329 <h2 class="section"><a href="ffplay-all.html#toc-pad">28.62 pad</a></h2>
14331 <p>Add paddings to the input image, and place the original input at the
14332 given coordinates <var>x</var>, <var>y</var>.
14334 <p>This filter accepts the following parameters:
14336 <dl compact="compact">
14337 <dt> ‘<samp>width, w</samp>’</dt>
14338 <dt> ‘<samp>height, h</samp>’</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.
14343 <p>The <var>width</var> expression can reference the value set by the
14344 <var>height</var> expression, and vice versa.
14346 <p>The default value of <var>width</var> and <var>height</var> is 0.
14349 <dt> ‘<samp>x</samp>’</dt>
14350 <dt> ‘<samp>y</samp>’</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
14355 <p>The <var>x</var> expression can reference the value set by the <var>y</var>
14356 expression, and vice versa.
14358 <p>The default value of <var>x</var> and <var>y</var> is 0.
14361 <dt> ‘<samp>color</samp>’</dt>
14362 <dd><p>Specify the color of the padded area. For the syntax of this option,
14363 check the "Color" section in the ffmpeg-utils manual.
14365 <p>The default value of <var>color</var> is "black".
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:
14372 <dl compact="compact">
14373 <dt> ‘<samp>in_w</samp>’</dt>
14374 <dt> ‘<samp>in_h</samp>’</dt>
14375 <dd><p>the input video width and height
14378 <dt> ‘<samp>iw</samp>’</dt>
14379 <dt> ‘<samp>ih</samp>’</dt>
14380 <dd><p>same as <var>in_w</var> and <var>in_h</var>
14383 <dt> ‘<samp>out_w</samp>’</dt>
14384 <dt> ‘<samp>out_h</samp>’</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
14389 <dt> ‘<samp>ow</samp>’</dt>
14390 <dt> ‘<samp>oh</samp>’</dt>
14391 <dd><p>same as <var>out_w</var> and <var>out_h</var>
14394 <dt> ‘<samp>x</samp>’</dt>
14395 <dt> ‘<samp>y</samp>’</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
14400 <dt> ‘<samp>a</samp>’</dt>
14401 <dd><p>same as <var>iw</var> / <var>ih</var>
14404 <dt> ‘<samp>sar</samp>’</dt>
14405 <dd><p>input sample aspect ratio
14408 <dt> ‘<samp>dar</samp>’</dt>
14409 <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
14412 <dt> ‘<samp>hsub</samp>’</dt>
14413 <dt> ‘<samp>vsub</samp>’</dt>
14414 <dd><p>horizontal and vertical chroma subsample values. For example for the
14415 pixel format "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
14419 <a name="Examples-52"></a>
14420 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-52">28.62.1 Examples</a></h3>
14424 Add paddings with color "violet" to the input video. Output video
14425 size is 640x480, the top-left corner of the input video is placed at
14427 <table><tr><td> </td><td><pre class="example">pad=640:480:0:40:violet
14428 </pre></td></tr></table>
14430 <p>The example above is equivalent to the following command:
14431 </p><table><tr><td> </td><td><pre class="example">pad=width=640:height=480:x=0:y=40:color=violet
14432 </pre></td></tr></table>
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> </td><td><pre class="example">pad="3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2"
14438 </pre></td></tr></table>
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> </td><td><pre class="example">pad="max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2"
14445 </pre></td></tr></table>
14448 Pad the input to get a final w/h ratio of 16:9:
14449 <table><tr><td> </td><td><pre class="example">pad="ih*16/9:ih:(ow-iw)/2:(oh-ih)/2"
14450 </pre></td></tr></table>
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> </td><td><pre class="example">(ih * X / ih) * sar = output_dar
14457 X = output_dar / sar
14458 </pre></td></tr></table>
14460 <p>Thus the previous example needs to be modified to:
14461 </p><table><tr><td> </td><td><pre class="example">pad="ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2"
14462 </pre></td></tr></table>
14465 Double output size and put the input video in the bottom-right
14466 corner of the output padded area:
14467 <table><tr><td> </td><td><pre class="example">pad="2*iw:2*ih:ow-iw:oh-ih"
14468 </pre></td></tr></table>
14471 <a name="perspective"></a>
14472 <h2 class="section"><a href="ffplay-all.html#toc-perspective">28.63 perspective</a></h2>
14474 <p>Correct perspective of video not recorded perpendicular to the screen.
14476 <p>A description of the accepted parameters follows.
14478 <dl compact="compact">
14479 <dt> ‘<samp>x0</samp>’</dt>
14480 <dt> ‘<samp>y0</samp>’</dt>
14481 <dt> ‘<samp>x1</samp>’</dt>
14482 <dt> ‘<samp>y1</samp>’</dt>
14483 <dt> ‘<samp>x2</samp>’</dt>
14484 <dt> ‘<samp>y2</samp>’</dt>
14485 <dt> ‘<samp>x3</samp>’</dt>
14486 <dt> ‘<samp>y3</samp>’</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.
14490 <p>The expressions can use the following variables:
14492 <dl compact="compact">
14493 <dt> ‘<samp>W</samp>’</dt>
14494 <dt> ‘<samp>H</samp>’</dt>
14495 <dd><p>the width and height of video frame.
14500 <dt> ‘<samp>interpolation</samp>’</dt>
14501 <dd><p>Set interpolation for perspective correction.
14503 <p>It accepts the following values:
14504 </p><dl compact="compact">
14505 <dt> ‘<samp>linear</samp>’</dt>
14506 <dt> ‘<samp>cubic</samp>’</dt>
14509 <p>Default value is ‘<samp>linear</samp>’.
14513 <a name="phase"></a>
14514 <h2 class="section"><a href="ffplay-all.html#toc-phase">28.64 phase</a></h2>
14516 <p>Delay interlaced video by one field time so that the field order changes.
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.
14521 <p>A description of the accepted parameters follows.
14523 <dl compact="compact">
14524 <dt> ‘<samp>mode</samp>’</dt>
14525 <dd><p>Set phase mode.
14527 <p>It accepts the following values:
14528 </p><dl compact="compact">
14529 <dt> ‘<samp>t</samp>’</dt>
14530 <dd><p>Capture field order top-first, transfer bottom-first.
14531 Filter will delay the bottom field.
14534 <dt> ‘<samp>b</samp>’</dt>
14535 <dd><p>Capture field order bottom-first, transfer top-first.
14536 Filter will delay the top field.
14539 <dt> ‘<samp>p</samp>’</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.
14545 <dt> ‘<samp>a</samp>’</dt>
14546 <dd><p>Capture field order determined automatically by field flags, transfer
14548 Filter selects among ‘<samp>t</samp>’ and ‘<samp>b</samp>’ modes on a frame by frame
14549 basis using field flags. If no field information is available,
14550 then this works just like ‘<samp>u</samp>’.
14553 <dt> ‘<samp>u</samp>’</dt>
14554 <dd><p>Capture unknown or varying, transfer opposite.
14555 Filter selects among ‘<samp>t</samp>’ and ‘<samp>b</samp>’ on a frame by frame basis by
14556 analyzing the images and selecting the alternative that produces best
14557 match between the fields.
14560 <dt> ‘<samp>T</samp>’</dt>
14561 <dd><p>Capture top-first, transfer unknown or varying.
14562 Filter selects among ‘<samp>t</samp>’ and ‘<samp>p</samp>’ using image analysis.
14565 <dt> ‘<samp>B</samp>’</dt>
14566 <dd><p>Capture bottom-first, transfer unknown or varying.
14567 Filter selects among ‘<samp>b</samp>’ and ‘<samp>p</samp>’ using image analysis.
14570 <dt> ‘<samp>A</samp>’</dt>
14571 <dd><p>Capture determined by field flags, transfer unknown or varying.
14572 Filter selects among ‘<samp>t</samp>’, ‘<samp>b</samp>’ and ‘<samp>p</samp>’ using field flags and
14573 image analysis. If no field information is available, then this works just
14574 like ‘<samp>U</samp>’. This is the default mode.
14577 <dt> ‘<samp>U</samp>’</dt>
14578 <dd><p>Both capture and transfer unknown or varying.
14579 Filter selects among ‘<samp>t</samp>’, ‘<samp>b</samp>’ and ‘<samp>p</samp>’ using image analysis only.
14585 <a name="pixdesctest"></a>
14586 <h2 class="section"><a href="ffplay-all.html#toc-pixdesctest">28.65 pixdesctest</a></h2>
14588 <p>Pixel format descriptor test filter, mainly useful for internal
14589 testing. The output video should be equal to the input video.
14592 </p><table><tr><td> </td><td><pre class="example">format=monow, pixdesctest
14593 </pre></td></tr></table>
14595 <p>can be used to test the monowhite pixel format descriptor definition.
14598 <h2 class="section"><a href="ffplay-all.html#toc-pp">28.66 pp</a></h2>
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 ’/’ and can be disabled by prepending a ’-’.
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.
14606 <p>The filters accept the following options:
14608 <dl compact="compact">
14609 <dt> ‘<samp>subfilters</samp>’</dt>
14610 <dd><p>Set postprocessing subfilters string.
14614 <p>All subfilters share common options to determine their scope:
14616 <dl compact="compact">
14617 <dt> ‘<samp>a/autoq</samp>’</dt>
14618 <dd><p>Honor the quality commands for this subfilter.
14621 <dt> ‘<samp>c/chrom</samp>’</dt>
14622 <dd><p>Do chrominance filtering, too (default).
14625 <dt> ‘<samp>y/nochrom</samp>’</dt>
14626 <dd><p>Do luminance filtering only (no chrominance).
14629 <dt> ‘<samp>n/noluma</samp>’</dt>
14630 <dd><p>Do chrominance filtering only (no luminance).
14634 <p>These options can be appended after the subfilter name, separated by a ’|’.
14636 <p>Available subfilters are:
14638 <dl compact="compact">
14639 <dt> ‘<samp>hb/hdeblock[|difference[|flatness]]</samp>’</dt>
14640 <dd><p>Horizontal deblocking filter
14641 </p><dl compact="compact">
14642 <dt> ‘<samp>difference</samp>’</dt>
14643 <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
14645 <dt> ‘<samp>flatness</samp>’</dt>
14646 <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
14651 <dt> ‘<samp>vb/vdeblock[|difference[|flatness]]</samp>’</dt>
14652 <dd><p>Vertical deblocking filter
14653 </p><dl compact="compact">
14654 <dt> ‘<samp>difference</samp>’</dt>
14655 <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
14657 <dt> ‘<samp>flatness</samp>’</dt>
14658 <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
14663 <dt> ‘<samp>ha/hadeblock[|difference[|flatness]]</samp>’</dt>
14664 <dd><p>Accurate horizontal deblocking filter
14665 </p><dl compact="compact">
14666 <dt> ‘<samp>difference</samp>’</dt>
14667 <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
14669 <dt> ‘<samp>flatness</samp>’</dt>
14670 <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
14675 <dt> ‘<samp>va/vadeblock[|difference[|flatness]]</samp>’</dt>
14676 <dd><p>Accurate vertical deblocking filter
14677 </p><dl compact="compact">
14678 <dt> ‘<samp>difference</samp>’</dt>
14679 <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
14681 <dt> ‘<samp>flatness</samp>’</dt>
14682 <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
14688 <p>The horizontal and vertical deblocking filters share the difference and
14689 flatness values so you cannot set different horizontal and vertical
14692 <dl compact="compact">
14693 <dt> ‘<samp>h1/x1hdeblock</samp>’</dt>
14694 <dd><p>Experimental horizontal deblocking filter
14697 <dt> ‘<samp>v1/x1vdeblock</samp>’</dt>
14698 <dd><p>Experimental vertical deblocking filter
14701 <dt> ‘<samp>dr/dering</samp>’</dt>
14702 <dd><p>Deringing filter
14705 <dt> ‘<samp>tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer</samp>’</dt>
14706 <dd><dl compact="compact">
14707 <dt> ‘<samp>threshold1</samp>’</dt>
14708 <dd><p>larger -> stronger filtering
14710 <dt> ‘<samp>threshold2</samp>’</dt>
14711 <dd><p>larger -> stronger filtering
14713 <dt> ‘<samp>threshold3</samp>’</dt>
14714 <dd><p>larger -> stronger filtering
14719 <dt> ‘<samp>al/autolevels[:f/fullyrange], automatic brightness / contrast correction</samp>’</dt>
14720 <dd><dl compact="compact">
14721 <dt> ‘<samp>f/fullyrange</samp>’</dt>
14722 <dd><p>Stretch luminance to <code>0-255</code>.
14727 <dt> ‘<samp>lb/linblenddeint</samp>’</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.
14732 <dt> ‘<samp>li/linipoldeint</samp>’</dt>
14733 <dd><p>Linear interpolating deinterlacing filter that deinterlaces the given block by
14734 linearly interpolating every second line.
14737 <dt> ‘<samp>ci/cubicipoldeint</samp>’</dt>
14738 <dd><p>Cubic interpolating deinterlacing filter deinterlaces the given block by
14739 cubically interpolating every second line.
14742 <dt> ‘<samp>md/mediandeint</samp>’</dt>
14743 <dd><p>Median deinterlacing filter that deinterlaces the given block by applying a
14744 median filter to every second line.
14747 <dt> ‘<samp>fd/ffmpegdeint</samp>’</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.
14752 <dt> ‘<samp>l5/lowpass5</samp>’</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.
14757 <dt> ‘<samp>fq/forceQuant[|quantizer]</samp>’</dt>
14758 <dd><p>Overrides the quantizer table from the input with the constant quantizer you
14760 </p><dl compact="compact">
14761 <dt> ‘<samp>quantizer</samp>’</dt>
14762 <dd><p>Quantizer to use
14767 <dt> ‘<samp>de/default</samp>’</dt>
14768 <dd><p>Default pp filter combination (<code>hb|a,vb|a,dr|a</code>)
14771 <dt> ‘<samp>fa/fast</samp>’</dt>
14772 <dd><p>Fast pp filter combination (<code>h1|a,v1|a,dr|a</code>)
14775 <dt> ‘<samp>ac</samp>’</dt>
14776 <dd><p>High quality pp filter combination (<code>ha|a|128|7,va|a,dr|a</code>)
14780 <a name="Examples-11"></a>
14781 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-11">28.66.1 Examples</a></h3>
14785 Apply horizontal and vertical deblocking, deringing and automatic
14786 brightness/contrast:
14787 <table><tr><td> </td><td><pre class="example">pp=hb/vb/dr/al
14788 </pre></td></tr></table>
14791 Apply default filters without brightness/contrast correction:
14792 <table><tr><td> </td><td><pre class="example">pp=de/-al
14793 </pre></td></tr></table>
14796 Apply default filters and temporal denoiser:
14797 <table><tr><td> </td><td><pre class="example">pp=default/tmpnoise|1|2|3
14798 </pre></td></tr></table>
14801 Apply deblocking on luminance only, and switch vertical deblocking on or off
14802 automatically depending on available CPU time:
14803 <table><tr><td> </td><td><pre class="example">pp=hb|y/vb|a
14804 </pre></td></tr></table>
14807 <a name="psnr"></a>
14808 <h2 class="section"><a href="ffplay-all.html#toc-psnr">28.67 psnr</a></h2>
14810 <p>Obtain the average, maximum and minimum PSNR (Peak Signal to Noise
14811 Ratio) between two input videos.
14813 <p>This filter takes in input two input videos, the first input is
14814 considered the "main" source and is passed unchanged to the
14815 output. The second input is used as a "reference" video for computing
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.
14822 <p>The obtained average PSNR is printed through the logging system.
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:
14828 <table><tr><td> </td><td><pre class="example">PSNR = 10*log10(MAX^2/MSE)
14829 </pre></td></tr></table>
14831 <p>Where MAX is the average of the maximum values of each component of the
14834 <p>The description of the accepted parameters follows.
14836 <dl compact="compact">
14837 <dt> ‘<samp>stats_file, f</samp>’</dt>
14838 <dd><p>If specified the filter will use the named file to save the PSNR of
14839 each individual frame.
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
14847 <p>A description of each shown parameter follows:
14849 <dl compact="compact">
14850 <dt> ‘<samp>n</samp>’</dt>
14851 <dd><p>sequential number of the input frame, starting from 1
14854 <dt> ‘<samp>mse_avg</samp>’</dt>
14855 <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
14856 frames, averaged over all the image components.
14859 <dt> ‘<samp>mse_y, mse_u, mse_v, mse_r, mse_g, mse_g, mse_a</samp>’</dt>
14860 <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
14861 frames for the component specified by the suffix.
14864 <dt> ‘<samp>psnr_y, psnr_u, psnr_v, psnr_r, psnr_g, psnr_b, psnr_a</samp>’</dt>
14865 <dd><p>Peak Signal to Noise ratio of the compared frames for the component
14866 specified by the suffix.
14871 </p><table><tr><td> </td><td><pre class="example">movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
14872 [main][ref] psnr="stats_file=stats.log" [out]
14873 </pre></td></tr></table>
14875 <p>On this example the input file being processed is compared with the
14876 reference file ‘<tt>ref_movie.mpg</tt>’. The PSNR of each individual frame
14877 is stored in ‘<tt>stats.log</tt>’.
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>
14883 <p>Pulldown reversal (inverse telecine) filter, capable of handling mixed
14884 hard-telecine, 24000/1001 fps progressive, and 30000/1001 fps progressive
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.
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.
14896 <p>The filter accepts the following options:
14898 <dl compact="compact">
14899 <dt> ‘<samp>jl</samp>’</dt>
14900 <dt> ‘<samp>jr</samp>’</dt>
14901 <dt> ‘<samp>jt</samp>’</dt>
14902 <dt> ‘<samp>jb</samp>’</dt>
14903 <dd><p>These options set the amount of "junk" 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.
14909 <dt> ‘<samp>sb</samp>’</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>.
14919 <dt> ‘<samp>mp</samp>’</dt>
14920 <dd><p>Set the metric plane to use. It accepts the following values:
14921 </p><dl compact="compact">
14922 <dt> ‘<samp>l</samp>’</dt>
14923 <dd><p>Use luma plane.
14926 <dt> ‘<samp>u</samp>’</dt>
14927 <dd><p>Use chroma blue plane.
14930 <dt> ‘<samp>v</samp>’</dt>
14931 <dd><p>Use chroma red plane.
14935 <p>This option may be set to use chroma plane instead of the default luma plane
14936 for doing filter’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 ‘<samp>mp</samp>’ to a chroma plane is to reduce CPU
14940 load and make pullup usable in realtime on slow machines.
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> </td><td><pre class="example">ffmpeg -i input -vf pullup -r 24000/1001 ...
14948 </pre></td></tr></table>
14950 <a name="removelogo"></a>
14951 <h2 class="section"><a href="ffplay-all.html#toc-removelogo">28.69 removelogo</a></h2>
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.
14957 <p>The filter accepts the following options:
14959 <dl compact="compact">
14960 <dt> ‘<samp>filename, f</samp>’</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.
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.
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.
14982 <a name="rotate"></a>
14983 <h2 class="section"><a href="ffplay-all.html#toc-rotate">28.70 rotate</a></h2>
14985 <p>Rotate video by an arbitrary angle expressed in radians.
14987 <p>The filter accepts the following options:
14989 <p>A description of the optional parameters follows.
14990 </p><dl compact="compact">
14991 <dt> ‘<samp>angle, a</samp>’</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 "0".
14996 <p>This expression is evaluated for each frame.
14999 <dt> ‘<samp>out_w, ow</samp>’</dt>
15000 <dd><p>Set the output width expression, default value is "iw".
15001 This expression is evaluated just once during configuration.
15004 <dt> ‘<samp>out_h, oh</samp>’</dt>
15005 <dd><p>Set the output height expression, default value is "ih".
15006 This expression is evaluated just once during configuration.
15009 <dt> ‘<samp>bilinear</samp>’</dt>
15010 <dd><p>Enable bilinear interpolation if set to 1, a value of 0 disables
15011 it. Default value is 1.
15014 <dt> ‘<samp>fillcolor, c</samp>’</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 "Color" section in the
15017 ffmpeg-utils manual. If the special value "none" is selected then no
15018 background is printed (useful for example if the background is never shown).
15020 <p>Default value is "black".
15024 <p>The expressions for the angle and the output size can contain the
15025 following constants and functions:
15027 <dl compact="compact">
15028 <dt> ‘<samp>n</samp>’</dt>
15029 <dd><p>sequential number of the input frame, starting from 0. It is always NAN
15030 before the first frame is filtered.
15033 <dt> ‘<samp>t</samp>’</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.
15038 <dt> ‘<samp>hsub</samp>’</dt>
15039 <dt> ‘<samp>vsub</samp>’</dt>
15040 <dd><p>horizontal and vertical chroma subsample values. For example for the
15041 pixel format "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
15044 <dt> ‘<samp>in_w, iw</samp>’</dt>
15045 <dt> ‘<samp>in_h, ih</samp>’</dt>
15046 <dd><p>the input video width and height
15049 <dt> ‘<samp>out_w, ow</samp>’</dt>
15050 <dt> ‘<samp>out_h, oh</samp>’</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
15055 <dt> ‘<samp>rotw(a)</samp>’</dt>
15056 <dt> ‘<samp>roth(a)</samp>’</dt>
15057 <dd><p>the minimal width/height required for completely containing the input
15058 video rotated by <var>a</var> radians.
15060 <p>These are only available when computing the ‘<samp>out_w</samp>’ and
15061 ‘<samp>out_h</samp>’ expressions.
15065 <a name="Examples-79"></a>
15066 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-79">28.70.1 Examples</a></h3>
15070 Rotate the input by PI/6 radians clockwise:
15071 <table><tr><td> </td><td><pre class="example">rotate=PI/6
15072 </pre></td></tr></table>
15075 Rotate the input by PI/6 radians counter-clockwise:
15076 <table><tr><td> </td><td><pre class="example">rotate=-PI/6
15077 </pre></td></tr></table>
15080 Rotate the input by 45 degrees clockwise:
15081 <table><tr><td> </td><td><pre class="example">rotate=45*PI/180
15082 </pre></td></tr></table>
15085 Apply a constant rotation with period T, starting from an angle of PI/3:
15086 <table><tr><td> </td><td><pre class="example">rotate=PI/3+2*PI*t/T
15087 </pre></td></tr></table>
15090 Make the input video rotation oscillating with a period of T
15091 seconds and an amplitude of A radians:
15092 <table><tr><td> </td><td><pre class="example">rotate=A*sin(2*PI/T*t)
15093 </pre></td></tr></table>
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> </td><td><pre class="example">rotate='2*PI*t:ow=hypot(iw,ih):oh=ow'
15099 </pre></td></tr></table>
15102 Rotate the video, reduce the output size so that no background is ever
15104 <table><tr><td> </td><td><pre class="example">rotate=2*PI*t:ow='min(iw,ih)/sqrt(2)':oh=ow:c=none
15105 </pre></td></tr></table>
15108 <a name="Commands-5"></a>
15109 <h3 class="subsection"><a href="ffplay-all.html#toc-Commands-5">28.70.2 Commands</a></h3>
15111 <p>The filter supports the following commands:
15113 <dl compact="compact">
15114 <dt> ‘<samp>a, angle</samp>’</dt>
15115 <dd><p>Set the angle expression.
15116 The command accepts the same syntax of the corresponding option.
15118 <p>If the specified expression is not valid, it is kept at its current
15124 <h2 class="section"><a href="ffplay-all.html#toc-sab">28.71 sab</a></h2>
15126 <p>Apply Shape Adaptive Blur.
15128 <p>The filter accepts the following options:
15130 <dl compact="compact">
15131 <dt> ‘<samp>luma_radius, lr</samp>’</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.
15137 <dt> ‘<samp>luma_pre_filter_radius, lpfr</samp>’</dt>
15138 <dd><p>Set luma pre-filter radius, must be a value in the 0.1-2.0 range, default
15142 <dt> ‘<samp>luma_strength, ls</samp>’</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.
15147 <dt> ‘<samp>chroma_radius, cr</samp>’</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
15153 <dt> ‘<samp>chroma_pre_filter_radius, cpfr</samp>’</dt>
15154 <dd><p>Set chroma pre-filter radius, must be a value in the 0.1-2.0 range.
15157 <dt> ‘<samp>chroma_strength, cs</samp>’</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.
15163 <p>Each chroma option value, if not explicitly specified, is set to the
15164 corresponding luma option value.
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>
15170 <p>Scale (resize) the input video, using the libswscale library.
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.
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
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.
15184 <p>See <a href="ffmpeg-scaler.html#scaler_005foptions">(ffmpeg-scaler)scaler_options</a> for
15185 the complete list of scaler options.
15187 <dl compact="compact">
15188 <dt> ‘<samp>width, w</samp>’</dt>
15189 <dt> ‘<samp>height, h</samp>’</dt>
15190 <dd><p>Set the output video dimension expression. Default value is the input
15193 <p>If the value is 0, the input width is used for the output.
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
15200 <p>If one of the values is -n with n > 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.
15205 <p>See below for the list of accepted constants for use in the dimension
15209 <dt> ‘<samp>interl</samp>’</dt>
15210 <dd><p>Set the interlacing mode. It accepts the following values:
15212 <dl compact="compact">
15213 <dt> ‘<samp>1</samp>’</dt>
15214 <dd><p>Force interlaced aware scaling.
15217 <dt> ‘<samp>0</samp>’</dt>
15218 <dd><p>Do not apply interlaced scaling.
15221 <dt> ‘<samp>-1</samp>’</dt>
15222 <dd><p>Select interlaced aware scaling depending on whether the source frames
15223 are flagged as interlaced or not.
15227 <p>Default value is ‘<samp>0</samp>’.
15230 <dt> ‘<samp>flags</samp>’</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
15237 <dt> ‘<samp>size, s</samp>’</dt>
15238 <dd><p>Set the video size. For the syntax of this option, check the "Video size"
15239 section in the ffmpeg-utils manual.
15242 <dt> ‘<samp>in_color_matrix</samp>’</dt>
15243 <dt> ‘<samp>out_color_matrix</samp>’</dt>
15244 <dd><p>Set in/output YCbCr color space type.
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.
15249 <p>If not specified, the color space type depends on the pixel format.
15251 <p>Possible values:
15253 <dl compact="compact">
15254 <dt> ‘<samp>auto</samp>’</dt>
15255 <dd><p>Choose automatically.
15258 <dt> ‘<samp>bt709</samp>’</dt>
15259 <dd><p>Format conforming to International Telecommunication Union (ITU)
15260 Recommendation BT.709.
15263 <dt> ‘<samp>fcc</samp>’</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).
15268 <dt> ‘<samp>bt601</samp>’</dt>
15269 <dd><p>Set color space conforming to:
15273 ITU Radiocommunication Sector (ITU-R) Recommendation BT.601
15276 ITU-R Rec. BT.470-6 (1998) Systems B, B1, and G
15279 Society of Motion Picture and Television Engineers (SMPTE) ST 170:2004
15284 <dt> ‘<samp>smpte240m</samp>’</dt>
15285 <dd><p>Set color space conforming to SMPTE ST 240:1999.
15290 <dt> ‘<samp>in_range</samp>’</dt>
15291 <dt> ‘<samp>out_range</samp>’</dt>
15292 <dd><p>Set in/output YCbCr sample range.
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:
15298 <dl compact="compact">
15299 <dt> ‘<samp>auto</samp>’</dt>
15300 <dd><p>Choose automatically.
15303 <dt> ‘<samp>jpeg/full/pc</samp>’</dt>
15304 <dd><p>Set full range (0-255 in case of 8-bit luma).
15307 <dt> ‘<samp>mpeg/tv</samp>’</dt>
15308 <dd><p>Set "MPEG" range (16-235 in case of 8-bit luma).
15313 <dt> ‘<samp>force_original_aspect_ratio</samp>’</dt>
15314 <dd><p>Enable decreasing or increasing output video width or height if necessary to
15315 keep the original aspect ratio. Possible values:
15317 <dl compact="compact">
15318 <dt> ‘<samp>disable</samp>’</dt>
15319 <dd><p>Scale the video as specified and disable this feature.
15322 <dt> ‘<samp>decrease</samp>’</dt>
15323 <dd><p>The output video dimensions will automatically be decreased if needed.
15326 <dt> ‘<samp>increase</samp>’</dt>
15327 <dd><p>The output video dimensions will automatically be increased if needed.
15332 <p>One useful instance of this option is that when you know a specific device’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
15339 <p>Please note that this is a different thing than specifying -1 for ‘<samp>w</samp>’
15340 or ‘<samp>h</samp>’, you still need to specify the output resolution for this option
15346 <p>The values of the ‘<samp>w</samp>’ and ‘<samp>h</samp>’ options are expressions
15347 containing the following constants:
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
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>
15360 <dt> <var>out_w</var></dt>
15361 <dt> <var>out_h</var></dt>
15362 <dd><p>the output (scaled) width and height
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>
15370 <dt> <var>a</var></dt>
15371 <dd><p>same as <var>iw</var> / <var>ih</var>
15374 <dt> <var>sar</var></dt>
15375 <dd><p>input sample aspect ratio
15378 <dt> <var>dar</var></dt>
15379 <dd><p>input display aspect ratio. Calculated from <code>(iw / ih) * sar</code>.
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 "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
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 "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
15395 <a name="Examples-47"></a>
15396 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-47">28.72.2 Examples</a></h3>
15400 Scale the input video to a size of 200x100:
15401 <table><tr><td> </td><td><pre class="example">scale=w=200:h=100
15402 </pre></td></tr></table>
15404 <p>This is equivalent to:
15405 </p><table><tr><td> </td><td><pre class="example">scale=200:100
15406 </pre></td></tr></table>
15409 </p><table><tr><td> </td><td><pre class="example">scale=200x100
15410 </pre></td></tr></table>
15413 Specify a size abbreviation for the output size:
15414 <table><tr><td> </td><td><pre class="example">scale=qcif
15415 </pre></td></tr></table>
15417 <p>which can also be written as:
15418 </p><table><tr><td> </td><td><pre class="example">scale=size=qcif
15419 </pre></td></tr></table>
15422 Scale the input to 2x:
15423 <table><tr><td> </td><td><pre class="example">scale=w=2*iw:h=2*ih
15424 </pre></td></tr></table>
15427 The above is the same as:
15428 <table><tr><td> </td><td><pre class="example">scale=2*in_w:2*in_h
15429 </pre></td></tr></table>
15432 Scale the input to 2x with forced interlaced scaling:
15433 <table><tr><td> </td><td><pre class="example">scale=2*iw:2*ih:interl=1
15434 </pre></td></tr></table>
15437 Scale the input to half size:
15438 <table><tr><td> </td><td><pre class="example">scale=w=iw/2:h=ih/2
15439 </pre></td></tr></table>
15442 Increase the width, and set the height to the same size:
15443 <table><tr><td> </td><td><pre class="example">scale=3/2*iw:ow
15444 </pre></td></tr></table>
15447 Seek for Greek harmony:
15448 <table><tr><td> </td><td><pre class="example">scale=iw:1/PHI*iw
15450 </pre></td></tr></table>
15453 Increase the height, and set the width to 3/2 of the height:
15454 <table><tr><td> </td><td><pre class="example">scale=w=3/2*oh:h=3/5*ih
15455 </pre></td></tr></table>
15458 Increase the size, but make the size a multiple of the chroma
15460 <table><tr><td> </td><td><pre class="example">scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
15461 </pre></td></tr></table>
15464 Increase the width to a maximum of 500 pixels, keep the same input
15466 <table><tr><td> </td><td><pre class="example">scale=w='min(500\, iw*3/2):h=-1'
15467 </pre></td></tr></table>
15470 <a name="separatefields"></a>
15471 <h2 class="section"><a href="ffplay-all.html#toc-separatefields">28.73 separatefields</a></h2>
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.
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.
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>
15484 <p>The <code>setdar</code> filter sets the Display Aspect Ratio for the filter
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> </td><td><pre class="example"><var>DAR</var> = <var>HORIZONTAL_RESOLUTION</var> / <var>VERTICAL_RESOLUTION</var> * <var>SAR</var>
15490 </pre></td></tr></table>
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 "setdar" or a "setsar" filter is
15498 <p>The <code>setsar</code> filter sets the Sample (aka Pixel) Aspect Ratio for
15499 the filter output video.
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
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 "setsar" or a "setdar" filter is applied.
15509 <p>The filters accept the following options:
15511 <dl compact="compact">
15512 <dt> ‘<samp>r, ratio, dar (<code>setdar</code> only), sar (<code>setsar</code> only)</samp>’</dt>
15513 <dd><p>Set the aspect ratio used by the filter.
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 "0".
15519 In case the form "<var>num</var>:<var>den</var>" is used, the <code>:</code> character
15523 <dt> ‘<samp>max</samp>’</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>.
15531 <p>The parameter <var>sar</var> is an expression containing
15532 the following constants:
15534 <dl compact="compact">
15535 <dt> ‘<samp>E, PI, PHI</samp>’</dt>
15536 <dd><p>the corresponding mathematical approximated values for e
15537 (euler number), pi (greek PI), phi (golden ratio)
15540 <dt> ‘<samp>w, h</samp>’</dt>
15541 <dd><p>the input width and height
15544 <dt> ‘<samp>a</samp>’</dt>
15545 <dd><p>same as <var>w</var> / <var>h</var>
15548 <dt> ‘<samp>sar</samp>’</dt>
15549 <dd><p>input sample aspect ratio
15552 <dt> ‘<samp>dar</samp>’</dt>
15553 <dd><p>input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>
15556 <dt> ‘<samp>hsub, vsub</samp>’</dt>
15557 <dd><p>horizontal and vertical chroma subsample values. For example for the
15558 pixel format "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
15562 <a name="Examples-76"></a>
15563 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-76">28.74.1 Examples</a></h3>
15567 To change the display aspect ratio to 16:9, specify one of the following:
15568 <table><tr><td> </td><td><pre class="example">setdar=dar=1.77777
15571 </pre></td></tr></table>
15574 To change the sample aspect ratio to 10:11, specify:
15575 <table><tr><td> </td><td><pre class="example">setsar=sar=10/11
15576 </pre></td></tr></table>
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> </td><td><pre class="example">setdar=ratio=16/9:max=1000
15582 </pre></td></tr></table>
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>
15590 <p>Force field for the output video frame.
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>).
15597 <p>The filter accepts the following options:
15599 <dl compact="compact">
15600 <dt> ‘<samp>mode</samp>’</dt>
15601 <dd><p>Available values are:
15603 <dl compact="compact">
15604 <dt> ‘<samp>auto</samp>’</dt>
15605 <dd><p>Keep the same field property.
15608 <dt> ‘<samp>bff</samp>’</dt>
15609 <dd><p>Mark the frame as bottom-field-first.
15612 <dt> ‘<samp>tff</samp>’</dt>
15613 <dd><p>Mark the frame as top-field-first.
15616 <dt> ‘<samp>prog</samp>’</dt>
15617 <dd><p>Mark the frame as progressive.
15623 <a name="showinfo"></a>
15624 <h2 class="section"><a href="ffplay-all.html#toc-showinfo">28.76 showinfo</a></h2>
15626 <p>Show a line containing various information for each input video frame.
15627 The input video is not modified.
15629 <p>The shown line contains a sequence of key/value pairs of the form
15630 <var>key</var>:<var>value</var>.
15632 <p>A description of each shown parameter follows:
15634 <dl compact="compact">
15635 <dt> ‘<samp>n</samp>’</dt>
15636 <dd><p>sequential number of the input frame, starting from 0
15639 <dt> ‘<samp>pts</samp>’</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.
15644 <dt> ‘<samp>pts_time</samp>’</dt>
15645 <dd><p>Presentation TimeStamp of the input frame, expressed as a number of
15649 <dt> ‘<samp>pos</samp>’</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)
15654 <dt> ‘<samp>fmt</samp>’</dt>
15655 <dd><p>pixel format name
15658 <dt> ‘<samp>sar</samp>’</dt>
15659 <dd><p>sample aspect ratio of the input frame, expressed in the form
15660 <var>num</var>/<var>den</var>
15663 <dt> ‘<samp>s</samp>’</dt>
15664 <dd><p>size of the input frame. For the syntax of this option, check the "Video size"
15665 section in the ffmpeg-utils manual.
15668 <dt> ‘<samp>i</samp>’</dt>
15669 <dd><p>interlaced mode ("P" for "progressive", "T" for top field first, "B"
15670 for bottom field first)
15673 <dt> ‘<samp>iskey</samp>’</dt>
15674 <dd><p>1 if the frame is a key frame, 0 otherwise
15677 <dt> ‘<samp>type</samp>’</dt>
15678 <dd><p>picture type of the input frame ("I" for an I-frame, "P" for a
15679 P-frame, "B" for a B-frame, "?" 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 ‘<tt>libavutil/avutil.h</tt>’.
15685 <dt> ‘<samp>checksum</samp>’</dt>
15686 <dd><p>Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame
15689 <dt> ‘<samp>plane_checksum</samp>’</dt>
15690 <dd><p>Adler-32 checksum (printed in hexadecimal) of each plane of the input frame,
15691 expressed in the form "[<var>c0</var> <var>c1</var> <var>c2</var> <var>c3</var>]"
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>
15699 <p>Blur the input video without impacting the outlines.
15701 <p>The filter accepts the following options:
15703 <dl compact="compact">
15704 <dt> ‘<samp>luma_radius, lr</samp>’</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.
15710 <dt> ‘<samp>luma_strength, ls</samp>’</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.
15717 <dt> ‘<samp>luma_threshold, lt</samp>’</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.
15725 <dt> ‘<samp>chroma_radius, cr</samp>’</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.
15731 <dt> ‘<samp>chroma_strength, cs</samp>’</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.
15738 <dt> ‘<samp>chroma_threshold, ct</samp>’</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.
15747 <p>If a chroma option is not explicitly set, the corresponding luma value
15750 <a name="stereo3d"></a>
15751 <h2 class="section"><a href="ffplay-all.html#toc-stereo3d">28.78 stereo3d</a></h2>
15753 <p>Convert between different stereoscopic image formats.
15755 <p>The filters accept the following options:
15757 <dl compact="compact">
15758 <dt> ‘<samp>in</samp>’</dt>
15759 <dd><p>Set stereoscopic image format of input.
15761 <p>Available values for input image formats are:
15762 </p><dl compact="compact">
15763 <dt> ‘<samp>sbsl</samp>’</dt>
15764 <dd><p>side by side parallel (left eye left, right eye right)
15767 <dt> ‘<samp>sbsr</samp>’</dt>
15768 <dd><p>side by side crosseye (right eye left, left eye right)
15771 <dt> ‘<samp>sbs2l</samp>’</dt>
15772 <dd><p>side by side parallel with half width resolution
15773 (left eye left, right eye right)
15776 <dt> ‘<samp>sbs2r</samp>’</dt>
15777 <dd><p>side by side crosseye with half width resolution
15778 (right eye left, left eye right)
15781 <dt> ‘<samp>abl</samp>’</dt>
15782 <dd><p>above-below (left eye above, right eye below)
15785 <dt> ‘<samp>abr</samp>’</dt>
15786 <dd><p>above-below (right eye above, left eye below)
15789 <dt> ‘<samp>ab2l</samp>’</dt>
15790 <dd><p>above-below with half height resolution
15791 (left eye above, right eye below)
15794 <dt> ‘<samp>ab2r</samp>’</dt>
15795 <dd><p>above-below with half height resolution
15796 (right eye above, left eye below)
15799 <dt> ‘<samp>al</samp>’</dt>
15800 <dd><p>alternating frames (left eye first, right eye second)
15803 <dt> ‘<samp>ar</samp>’</dt>
15804 <dd><p>alternating frames (right eye first, left eye second)
15806 <p>Default value is ‘<samp>sbsl</samp>’.
15811 <dt> ‘<samp>out</samp>’</dt>
15812 <dd><p>Set stereoscopic image format of output.
15814 <p>Available values for output image formats are all the input formats as well as:
15815 </p><dl compact="compact">
15816 <dt> ‘<samp>arbg</samp>’</dt>
15817 <dd><p>anaglyph red/blue gray
15818 (red filter on left eye, blue filter on right eye)
15821 <dt> ‘<samp>argg</samp>’</dt>
15822 <dd><p>anaglyph red/green gray
15823 (red filter on left eye, green filter on right eye)
15826 <dt> ‘<samp>arcg</samp>’</dt>
15827 <dd><p>anaglyph red/cyan gray
15828 (red filter on left eye, cyan filter on right eye)
15831 <dt> ‘<samp>arch</samp>’</dt>
15832 <dd><p>anaglyph red/cyan half colored
15833 (red filter on left eye, cyan filter on right eye)
15836 <dt> ‘<samp>arcc</samp>’</dt>
15837 <dd><p>anaglyph red/cyan color
15838 (red filter on left eye, cyan filter on right eye)
15841 <dt> ‘<samp>arcd</samp>’</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)
15846 <dt> ‘<samp>agmg</samp>’</dt>
15847 <dd><p>anaglyph green/magenta gray
15848 (green filter on left eye, magenta filter on right eye)
15851 <dt> ‘<samp>agmh</samp>’</dt>
15852 <dd><p>anaglyph green/magenta half colored
15853 (green filter on left eye, magenta filter on right eye)
15856 <dt> ‘<samp>agmc</samp>’</dt>
15857 <dd><p>anaglyph green/magenta colored
15858 (green filter on left eye, magenta filter on right eye)
15861 <dt> ‘<samp>agmd</samp>’</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)
15866 <dt> ‘<samp>aybg</samp>’</dt>
15867 <dd><p>anaglyph yellow/blue gray
15868 (yellow filter on left eye, blue filter on right eye)
15871 <dt> ‘<samp>aybh</samp>’</dt>
15872 <dd><p>anaglyph yellow/blue half colored
15873 (yellow filter on left eye, blue filter on right eye)
15876 <dt> ‘<samp>aybc</samp>’</dt>
15877 <dd><p>anaglyph yellow/blue colored
15878 (yellow filter on left eye, blue filter on right eye)
15881 <dt> ‘<samp>aybd</samp>’</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)
15886 <dt> ‘<samp>irl</samp>’</dt>
15887 <dd><p>interleaved rows (left eye has top row, right eye starts on next row)
15890 <dt> ‘<samp>irr</samp>’</dt>
15891 <dd><p>interleaved rows (right eye has top row, left eye starts on next row)
15894 <dt> ‘<samp>ml</samp>’</dt>
15895 <dd><p>mono output (left eye only)
15898 <dt> ‘<samp>mr</samp>’</dt>
15899 <dd><p>mono output (right eye only)
15903 <p>Default value is ‘<samp>arcd</samp>’.
15907 <a name="Examples-2"></a>
15908 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-2">28.78.1 Examples</a></h3>
15912 Convert input video from side by side parallel to anaglyph yellow/blue dubois:
15913 <table><tr><td> </td><td><pre class="example">stereo3d=sbsl:aybd
15914 </pre></td></tr></table>
15917 Convert input video from above bellow (left eye above, right eye below) to side by side crosseye.
15918 <table><tr><td> </td><td><pre class="example">stereo3d=abl:sbsr
15919 </pre></td></tr></table>
15923 <h2 class="section"><a href="ffplay-all.html#toc-spp">28.79 spp</a></h2>
15925 <p>Apply a simple postprocessing filter that compresses and decompresses the image
15926 at several (or - in the case of ‘<samp>quality</samp>’ level <code>6</code> - all) shifts
15927 and average the results.
15929 <p>The filter accepts the following options:
15931 <dl compact="compact">
15932 <dt> ‘<samp>quality</samp>’</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
15940 <dt> ‘<samp>qp</samp>’</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).
15945 <dt> ‘<samp>mode</samp>’</dt>
15946 <dd><p>Set thresholding mode. Available modes are:
15948 <dl compact="compact">
15949 <dt> ‘<samp>hard</samp>’</dt>
15950 <dd><p>Set hard thresholding (default).
15952 <dt> ‘<samp>soft</samp>’</dt>
15953 <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
15958 <dt> ‘<samp>use_bframe_qp</samp>’</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).
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>
15969 <p>Draw subtitles on top of input video using the libass library.
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.
15976 <p>The filter accepts the following options:
15978 <dl compact="compact">
15979 <dt> ‘<samp>filename, f</samp>’</dt>
15980 <dd><p>Set the filename of the subtitle file to read. It must be specified.
15983 <dt> ‘<samp>original_size</samp>’</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 "Video size" 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
15991 <dt> ‘<samp>charenc</samp>’</dt>
15992 <dd><p>Set subtitles input character encoding. <code>subtitles</code> filter only. Only
15993 useful if not UTF-8.
15997 <p>If the first key is not specified, it is assumed that the first value
15998 specifies the ‘<samp>filename</samp>’.
16000 <p>For example, to render the file ‘<tt>sub.srt</tt>’ on top of the input
16001 video, use the command:
16002 </p><table><tr><td> </td><td><pre class="example">subtitles=sub.srt
16003 </pre></td></tr></table>
16005 <p>which is equivalent to:
16006 </p><table><tr><td> </td><td><pre class="example">subtitles=filename=sub.srt
16007 </pre></td></tr></table>
16009 <a name="super2xsai"></a>
16010 <h2 class="section"><a href="ffplay-all.html#toc-super2xsai">28.81 super2xsai</a></h2>
16012 <p>Scale the input by 2x and smooth using the Super2xSaI (Scale and
16013 Interpolate) pixel art scaling algorithm.
16015 <p>Useful for enlarging pixel art images without reducing sharpness.
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 & V plane.
16021 <a name="telecine"></a>
16022 <h2 class="section"><a href="ffplay-all.html#toc-telecine">28.83 telecine</a></h2>
16024 <p>Apply telecine process to the video.
16026 <p>This filter accepts the following options:
16028 <dl compact="compact">
16029 <dt> ‘<samp>first_field</samp>’</dt>
16030 <dd><dl compact="compact">
16031 <dt> ‘<samp>top, t</samp>’</dt>
16032 <dd><p>top field first
16034 <dt> ‘<samp>bottom, b</samp>’</dt>
16035 <dd><p>bottom field first
16036 The default value is <code>top</code>.
16041 <dt> ‘<samp>pattern</samp>’</dt>
16042 <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
16043 The default value is <code>23</code>.
16047 <table><tr><td> </td><td><pre class="example">Some typical patterns:
16052 24p: 2332 (preferred)
16059 24p: 222222222223 ("Euro pulldown")
16062 </pre></td></tr></table>
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.
16068 <p>The filter accepts the following options:
16070 <dl compact="compact">
16071 <dt> ‘<samp>n</samp>’</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>.
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.
16081 <a name="Examples-9"></a>
16082 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-9">28.84.1 Examples</a></h3>
16086 Extract one picture each 50 frames:
16087 <table><tr><td> </td><td><pre class="example">thumbnail=50
16088 </pre></td></tr></table>
16091 Complete example of a thumbnail creation with <code>ffmpeg</code>:
16092 <table><tr><td> </td><td><pre class="example">ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
16093 </pre></td></tr></table>
16096 <a name="tile"></a>
16097 <h2 class="section"><a href="ffplay-all.html#toc-tile">28.85 tile</a></h2>
16099 <p>Tile several successive frames together.
16101 <p>The filter accepts the following options:
16103 <dl compact="compact">
16104 <dt> ‘<samp>layout</samp>’</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 "Video size" section in the ffmpeg-utils manual.
16109 <dt> ‘<samp>nb_frames</samp>’</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.
16115 <dt> ‘<samp>margin</samp>’</dt>
16116 <dd><p>Set the outer border margin in pixels.
16119 <dt> ‘<samp>padding</samp>’</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.
16125 <dt> ‘<samp>color</samp>’</dt>
16126 <dd><p>Specify the color of the unused areaFor the syntax of this option, check the
16127 "Color" section in the ffmpeg-utils manual. The default value of <var>color</var>
16128 is "black".
16132 <a name="Examples-70"></a>
16133 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-70">28.85.1 Examples</a></h3>
16137 Produce 8x8 PNG tiles of all keyframes (‘<samp>-skip_frame nokey</samp>’) in a movie:
16138 <table><tr><td> </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 ‘<samp>-vsync 0</samp>’ is necessary to prevent <code>ffmpeg</code> from
16141 duplicating each output frame to accommodate the originally detected frame
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> </td><td><pre class="example">tile=3x2:nb_frames=5:padding=7:margin=2
16149 </pre></td></tr></table>
16152 <a name="tinterlace"></a>
16153 <h2 class="section"><a href="ffplay-all.html#toc-tinterlace">28.86 tinterlace</a></h2>
16155 <p>Perform various types of temporal field interlacing.
16157 <p>Frames are counted starting from 1, so the first input frame is
16160 <p>The filter accepts the following options:
16162 <dl compact="compact">
16163 <dt> ‘<samp>mode</samp>’</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.
16167 <p>Available values are:
16169 <dl compact="compact">
16170 <dt> ‘<samp>merge, 0</samp>’</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.
16175 <dt> ‘<samp>drop_odd, 1</samp>’</dt>
16176 <dd><p>Only output even frames, odd frames are dropped, generating a frame with
16177 unchanged height at half frame rate.
16180 <dt> ‘<samp>drop_even, 2</samp>’</dt>
16181 <dd><p>Only output odd frames, even frames are dropped, generating a frame with
16182 unchanged height at half frame rate.
16185 <dt> ‘<samp>pad, 3</samp>’</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.
16190 <dt> ‘<samp>interleave_top, 4</samp>’</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.
16195 <dt> ‘<samp>interleave_bottom, 5</samp>’</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.
16200 <dt> ‘<samp>interlacex2, 6</samp>’</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.
16209 <p>Numeric values are deprecated but are accepted for backward
16210 compatibility reasons.
16212 <p>Default mode is <code>merge</code>.
16215 <dt> ‘<samp>flags</samp>’</dt>
16216 <dd><p>Specify flags influencing the filter process.
16218 <p>Available value for <var>flags</var> is:
16220 <dl compact="compact">
16221 <dt> ‘<samp>low_pass_filter, vlfp</samp>’</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 ’twitter’ and Moire
16228 <p>Vertical low-pass filtering can only be enabled for ‘<samp>mode</samp>’
16229 <var>interleave_top</var> and <var>interleave_bottom</var>.
16236 <a name="transpose"></a>
16237 <h2 class="section"><a href="ffplay-all.html#toc-transpose">28.87 transpose</a></h2>
16239 <p>Transpose rows with columns in the input video and optionally flip it.
16241 <p>This filter accepts the following options:
16243 <dl compact="compact">
16244 <dt> ‘<samp>dir</samp>’</dt>
16245 <dd><p>Specify the transposition direction.
16247 <p>Can assume the following values:
16248 </p><dl compact="compact">
16249 <dt> ‘<samp>0, 4, cclock_flip</samp>’</dt>
16250 <dd><p>Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
16251 </p><table><tr><td> </td><td><pre class="example">L.R L.l
16254 </pre></td></tr></table>
16257 <dt> ‘<samp>1, 5, clock</samp>’</dt>
16258 <dd><p>Rotate by 90 degrees clockwise, that is:
16259 </p><table><tr><td> </td><td><pre class="example">L.R l.L
16262 </pre></td></tr></table>
16265 <dt> ‘<samp>2, 6, cclock</samp>’</dt>
16266 <dd><p>Rotate by 90 degrees counterclockwise, that is:
16267 </p><table><tr><td> </td><td><pre class="example">L.R R.r
16270 </pre></td></tr></table>
16273 <dt> ‘<samp>3, 7, clock_flip</samp>’</dt>
16274 <dd><p>Rotate by 90 degrees clockwise and vertically flip, that is:
16275 </p><table><tr><td> </td><td><pre class="example">L.R r.R
16278 </pre></td></tr></table>
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.
16286 <p>Numerical values are deprecated, and should be dropped in favor of
16287 symbolic constants.
16290 <dt> ‘<samp>passthrough</samp>’</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> ‘<samp>none</samp>’</dt>
16295 <dd><p>Always apply transposition.
16297 <dt> ‘<samp>portrait</samp>’</dt>
16298 <dd><p>Preserve portrait geometry (when <var>height</var> >= <var>width</var>).
16300 <dt> ‘<samp>landscape</samp>’</dt>
16301 <dd><p>Preserve landscape geometry (when <var>width</var> >= <var>height</var>).
16305 <p>Default value is <code>none</code>.
16309 <p>For example to rotate by 90 degrees clockwise and preserve portrait
16311 </p><table><tr><td> </td><td><pre class="example">transpose=dir=1:passthrough=portrait
16312 </pre></td></tr></table>
16314 <p>The command above can also be specified as:
16315 </p><table><tr><td> </td><td><pre class="example">transpose=1:portrait
16316 </pre></td></tr></table>
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.
16322 <p>This filter accepts the following options:
16323 </p><dl compact="compact">
16324 <dt> ‘<samp>start</samp>’</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.
16329 <dt> ‘<samp>end</samp>’</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.
16335 <dt> ‘<samp>start_pts</samp>’</dt>
16336 <dd><p>Same as <var>start</var>, except this option sets the start timestamp in timebase
16337 units instead of seconds.
16340 <dt> ‘<samp>end_pts</samp>’</dt>
16341 <dd><p>Same as <var>end</var>, except this option sets the end timestamp in timebase units
16342 instead of seconds.
16345 <dt> ‘<samp>duration</samp>’</dt>
16346 <dd><p>Specify maximum duration of the output.
16349 <dt> ‘<samp>start_frame</samp>’</dt>
16350 <dd><p>Number of the first frame that should be passed to output.
16353 <dt> ‘<samp>end_frame</samp>’</dt>
16354 <dd><p>Number of the first frame that should be dropped.
16358 <p>‘<samp>start</samp>’, ‘<samp>end</samp>’, ‘<samp>duration</samp>’ are expressed as time
16359 duration specifications, check the "Time duration" section in the
16360 ffmpeg-utils manual.
16362 <p>Note that the first two sets of the start/end options and the ‘<samp>duration</samp>’
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.
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
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.
16379 drop everything except the second minute of input
16380 <table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -vf trim=60:120
16381 </pre></td></tr></table>
16384 keep only the first second
16385 <table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -vf trim=duration=1
16386 </pre></td></tr></table>
16391 <a name="unsharp"></a>
16392 <h2 class="section"><a href="ffplay-all.html#toc-unsharp">28.89 unsharp</a></h2>
16394 <p>Sharpen or blur the input video.
16396 <p>It accepts the following parameters:
16398 <dl compact="compact">
16399 <dt> ‘<samp>luma_msize_x, lx</samp>’</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.
16404 <dt> ‘<samp>luma_msize_y, ly</samp>’</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.
16409 <dt> ‘<samp>luma_amount, la</samp>’</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.
16413 <p>Negative values will blur the input video, while positive values will
16414 sharpen it, a value of zero will disable the effect.
16416 <p>Default value is 1.0.
16419 <dt> ‘<samp>chroma_msize_x, cx</samp>’</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.
16424 <dt> ‘<samp>chroma_msize_y, cy</samp>’</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.
16429 <dt> ‘<samp>chroma_amount, ca</samp>’</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.
16433 <p>Negative values will blur the input video, while positive values will
16434 sharpen it, a value of zero will disable the effect.
16436 <p>Default value is 0.0.
16439 <dt> ‘<samp>opencl</samp>’</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.
16446 <p>All parameters are optional and default to the equivalent of the
16447 string ’5:5:1.0:5:5:0.0’.
16449 <a name="Examples-81"></a>
16450 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-81">28.89.1 Examples</a></h3>
16454 Apply strong luma sharpen effect:
16455 <table><tr><td> </td><td><pre class="example">unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
16456 </pre></td></tr></table>
16459 Apply strong blur of both luma and chroma parameters:
16460 <table><tr><td> </td><td><pre class="example">unsharp=7:7:-2:7:7:-2
16461 </pre></td></tr></table>
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>
16468 <p>Analyze video stabilization/deshaking. Perform pass 1 of 2, see
16469 <a href="#vidstabtransform">vidstabtransform</a> for pass 2.
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.
16475 <p>To enable compilation of this filter you need to configure FFmpeg with
16476 <code>--enable-libvidstab</code>.
16478 <p>This filter accepts the following options:
16480 <dl compact="compact">
16481 <dt> ‘<samp>result</samp>’</dt>
16482 <dd><p>Set the path to the file used to write the transforms information.
16483 Default value is ‘<tt>transforms.trf</tt>’.
16486 <dt> ‘<samp>shakiness</samp>’</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.
16492 <dt> ‘<samp>accuracy</samp>’</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.
16498 <dt> ‘<samp>stepsize</samp>’</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.
16503 <dt> ‘<samp>mincontrast</samp>’</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
16509 <dt> ‘<samp>tripod</samp>’</dt>
16510 <dd><p>Set reference frame number for tripod mode.
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.
16517 <p>If set to 0, it is disabled. The frames are counted starting from 1.
16520 <dt> ‘<samp>show</samp>’</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
16527 <a name="Examples-29"></a>
16528 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-29">28.90.1 Examples</a></h3>
16532 Use default values:
16533 <table><tr><td> </td><td><pre class="example">vidstabdetect
16534 </pre></td></tr></table>
16537 Analyze strongly shaky movie and put the results in file
16538 ‘<tt>mytransforms.trf</tt>’:
16539 <table><tr><td> </td><td><pre class="example">vidstabdetect=shakiness=10:accuracy=15:result="mytransforms.trf"
16540 </pre></td></tr></table>
16543 Visualize the result of internal transformations in the resulting
16545 <table><tr><td> </td><td><pre class="example">vidstabdetect=show=1
16546 </pre></td></tr></table>
16549 Analyze a video with medium shakiness using <code>ffmpeg</code>:
16550 <table><tr><td> </td><td><pre class="example">ffmpeg -i input -vf vidstabdetect=shakiness=5:show=1 dummy.avi
16551 </pre></td></tr></table>
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>
16558 <p>Video stabilization/deshaking: pass 2 of 2,
16559 see <a href="#vidstabdetect">vidstabdetect</a> for pass 1.
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.
16567 <p>To enable compilation of this filter you need to configure FFmpeg with
16568 <code>--enable-libvidstab</code>.
16570 <a name="Options-5"></a>
16571 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-5">28.91.1 Options</a></h3>
16573 <dl compact="compact">
16574 <dt> ‘<samp>input</samp>’</dt>
16575 <dd><p>Set path to the file used to read the transforms. Default value is
16576 ‘<tt>transforms.trf</tt>’).
16579 <dt> ‘<samp>smoothing</samp>’</dt>
16580 <dd><p>Set the number of frames (value*2 + 1) used for lowpass filtering the
16581 camera movements. Default value is 10.
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.
16590 <dt> ‘<samp>optalgo</samp>’</dt>
16591 <dd><p>Set the camera path optimization algorithm.
16593 <p>Accepted values are:
16594 </p><dl compact="compact">
16595 <dt> ‘<samp>gauss</samp>’</dt>
16596 <dd><p>gaussian kernel low-pass filter on camera motion (default)
16598 <dt> ‘<samp>avg</samp>’</dt>
16599 <dd><p>averaging on transformations
16604 <dt> ‘<samp>maxshift</samp>’</dt>
16605 <dd><p>Set maximal number of pixels to translate frames. Default value is -1,
16609 <dt> ‘<samp>maxangle</samp>’</dt>
16610 <dd><p>Set maximal angle in radians (degree*PI/180) to rotate frames. Default
16611 value is -1, meaning no limit.
16614 <dt> ‘<samp>crop</samp>’</dt>
16615 <dd><p>Specify how to deal with borders that may be visible due to movement
16618 <p>Available values are:
16619 </p><dl compact="compact">
16620 <dt> ‘<samp>keep</samp>’</dt>
16621 <dd><p>keep image information from previous frame (default)
16623 <dt> ‘<samp>black</samp>’</dt>
16624 <dd><p>fill the border black
16629 <dt> ‘<samp>invert</samp>’</dt>
16630 <dd><p>Invert transforms if set to 1. Default value is 0.
16633 <dt> ‘<samp>relative</samp>’</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.
16638 <dt> ‘<samp>zoom</samp>’</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
16644 <dt> ‘<samp>optzoom</samp>’</dt>
16645 <dd><p>Set optimal zooming to avoid borders.
16647 <p>Accepted values are:
16648 </p><dl compact="compact">
16649 <dt> ‘<samp>0</samp>’</dt>
16652 <dt> ‘<samp>1</samp>’</dt>
16653 <dd><p>optimal static zoom value is determined (only very strong movements
16654 will lead to visible borders) (default)
16656 <dt> ‘<samp>2</samp>’</dt>
16657 <dd><p>optimal adaptive zoom value is determined (no borders will be
16658 visible), see ‘<samp>zoomspeed</samp>’
16662 <p>Note that the value given at zoom is added to the one calculated here.
16665 <dt> ‘<samp>zoomspeed</samp>’</dt>
16666 <dd><p>Set percent to zoom maximally each frame (enabled when
16667 ‘<samp>optzoom</samp>’ is set to 2). Range is from 0 to 5, default value is
16671 <dt> ‘<samp>interpol</samp>’</dt>
16672 <dd><p>Specify type of interpolation.
16674 <p>Available values are:
16675 </p><dl compact="compact">
16676 <dt> ‘<samp>no</samp>’</dt>
16677 <dd><p>no interpolation
16679 <dt> ‘<samp>linear</samp>’</dt>
16680 <dd><p>linear only horizontal
16682 <dt> ‘<samp>bilinear</samp>’</dt>
16683 <dd><p>linear in both directions (default)
16685 <dt> ‘<samp>bicubic</samp>’</dt>
16686 <dd><p>cubic in both directions (slow)
16691 <dt> ‘<samp>tripod</samp>’</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.
16695 <p>Use also <code>tripod</code> option of <a href="#vidstabdetect">vidstabdetect</a>.
16698 <dt> ‘<samp>debug</samp>’</dt>
16699 <dd><p>Increase log verbosity if set to 1. Also the detected global motions
16700 are written to the temporary file ‘<tt>global_motions.trf</tt>’. Default
16705 <a name="Examples-25"></a>
16706 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-25">28.91.2 Examples</a></h3>
16710 Use <code>ffmpeg</code> for a typical stabilization with default values:
16711 <table><tr><td> </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>
16714 <p>Note the use of the unsharp filter which is always recommended.
16717 Zoom in a bit more and load transform data from a given file:
16718 <table><tr><td> </td><td><pre class="example">vidstabtransform=zoom=5:input="mytransforms.trf"
16719 </pre></td></tr></table>
16722 Smoothen the video even more:
16723 <table><tr><td> </td><td><pre class="example">vidstabtransform=smoothing=30
16724 </pre></td></tr></table>
16727 <a name="vflip"></a>
16728 <h2 class="section"><a href="ffplay-all.html#toc-vflip">28.92 vflip</a></h2>
16730 <p>Flip the input video vertically.
16732 <p>For example, to vertically flip a video with <code>ffmpeg</code>:
16733 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i in.avi -vf "vflip" out.avi
16734 </pre></td></tr></table>
16736 <a name="vignette"></a>
16737 <h2 class="section"><a href="ffplay-all.html#toc-vignette">28.93 vignette</a></h2>
16739 <p>Make or reverse a natural vignetting effect.
16741 <p>The filter accepts the following options:
16743 <dl compact="compact">
16744 <dt> ‘<samp>angle, a</samp>’</dt>
16745 <dd><p>Set lens angle expression as a number of radians.
16747 <p>The value is clipped in the <code>[0,PI/2]</code> range.
16749 <p>Default value: <code>"PI/5"</code>
16752 <dt> ‘<samp>x0</samp>’</dt>
16753 <dt> ‘<samp>y0</samp>’</dt>
16754 <dd><p>Set center coordinates expressions. Respectively <code>"w/2"</code> and <code>"h/2"</code>
16758 <dt> ‘<samp>mode</samp>’</dt>
16759 <dd><p>Set forward/backward mode.
16761 <p>Available modes are:
16762 </p><dl compact="compact">
16763 <dt> ‘<samp>forward</samp>’</dt>
16764 <dd><p>The larger the distance from the central point, the darker the image becomes.
16767 <dt> ‘<samp>backward</samp>’</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 ‘<samp>angle</samp>’ and other settings (yet). It can
16771 also be used to create a burning effect.
16775 <p>Default value is ‘<samp>forward</samp>’.
16778 <dt> ‘<samp>eval</samp>’</dt>
16779 <dd><p>Set evaluation mode for the expressions (‘<samp>angle</samp>’, ‘<samp>x0</samp>’, ‘<samp>y0</samp>’).
16781 <p>It accepts the following values:
16782 </p><dl compact="compact">
16783 <dt> ‘<samp>init</samp>’</dt>
16784 <dd><p>Evaluate expressions only once during the filter initialization.
16787 <dt> ‘<samp>frame</samp>’</dt>
16788 <dd><p>Evaluate expressions for each incoming frame. This is way slower than the
16789 ‘<samp>init</samp>’ mode since it requires all the scalers to be re-computed, but it
16790 allows advanced dynamic expressions.
16794 <p>Default value is ‘<samp>init</samp>’.
16797 <dt> ‘<samp>dither</samp>’</dt>
16798 <dd><p>Set dithering to reduce the circular banding effects. Default is <code>1</code>
16802 <dt> ‘<samp>aspect</samp>’</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.
16807 <p>Default is <code>1/1</code>.
16811 <a name="Expressions"></a>
16812 <h3 class="subsection"><a href="ffplay-all.html#toc-Expressions">28.93.1 Expressions</a></h3>
16814 <p>The ‘<samp>alpha</samp>’, ‘<samp>x0</samp>’ and ‘<samp>y0</samp>’ expressions can contain the
16815 following parameters.
16817 <dl compact="compact">
16818 <dt> ‘<samp>w</samp>’</dt>
16819 <dt> ‘<samp>h</samp>’</dt>
16820 <dd><p>input width and height
16823 <dt> ‘<samp>n</samp>’</dt>
16824 <dd><p>the number of input frame, starting from 0
16827 <dt> ‘<samp>pts</samp>’</dt>
16828 <dd><p>the PTS (Presentation TimeStamp) time of the filtered video frame, expressed in
16829 <var>TB</var> units, NAN if undefined
16832 <dt> ‘<samp>r</samp>’</dt>
16833 <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
16836 <dt> ‘<samp>t</samp>’</dt>
16837 <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
16838 expressed in seconds, NAN if undefined
16841 <dt> ‘<samp>tb</samp>’</dt>
16842 <dd><p>time base of the input video
16847 <a name="Examples-49"></a>
16848 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-49">28.93.2 Examples</a></h3>
16852 Apply simple strong vignetting effect:
16853 <table><tr><td> </td><td><pre class="example">vignette=PI/4
16854 </pre></td></tr></table>
16857 Make a flickering vignetting:
16858 <table><tr><td> </td><td><pre class="example">vignette='PI/4+random(1)*PI/50':eval=frame
16859 </pre></td></tr></table>
16863 <a name="w3fdif"></a>
16864 <h2 class="section"><a href="ffplay-all.html#toc-w3fdif">28.94 w3fdif</a></h2>
16866 <p>Deinterlace the input video ("w3fdif" stands for "Weston 3 Field
16867 Deinterlacing Filter").
16869 <p>Based on the process described by Martin Weston for BBC R&D, and
16870 implemented based on the de-interlace algorithm written by Jim
16871 Easterbrook for BBC R&D, the Weston 3 field deinterlacing filter
16872 uses filter coefficients calculated by BBC R&D.
16874 <p>There are two sets of filter coefficients, so called "simple":
16875 and "complex". Which set of filter coefficients is used can
16876 be set by passing an optional parameter:
16878 <dl compact="compact">
16879 <dt> ‘<samp>filter</samp>’</dt>
16880 <dd><p>Set the interlacing filter coefficients. Accepts one of the following values:
16882 <dl compact="compact">
16883 <dt> ‘<samp>simple</samp>’</dt>
16884 <dd><p>Simple filter coefficient set.
16886 <dt> ‘<samp>complex</samp>’</dt>
16887 <dd><p>More-complex filter coefficient set.
16890 <p>Default value is ‘<samp>complex</samp>’.
16893 <dt> ‘<samp>deint</samp>’</dt>
16894 <dd><p>Specify which frames to deinterlace. Accept one of the following values:
16896 <dl compact="compact">
16897 <dt> ‘<samp>all</samp>’</dt>
16898 <dd><p>Deinterlace all frames,
16900 <dt> ‘<samp>interlaced</samp>’</dt>
16901 <dd><p>Only deinterlace frames marked as interlaced.
16905 <p>Default value is ‘<samp>all</samp>’.
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>
16913 <p>Deinterlace the input video ("yadif" means "yet another deinterlacing
16916 <p>This filter accepts the following options:
16919 <dl compact="compact">
16920 <dt> ‘<samp>mode</samp>’</dt>
16921 <dd><p>The interlacing mode to adopt, accepts one of the following values:
16923 <dl compact="compact">
16924 <dt> ‘<samp>0, send_frame</samp>’</dt>
16925 <dd><p>output 1 frame for each frame
16927 <dt> ‘<samp>1, send_field</samp>’</dt>
16928 <dd><p>output 1 frame for each field
16930 <dt> ‘<samp>2, send_frame_nospatial</samp>’</dt>
16931 <dd><p>like <code>send_frame</code> but skip spatial interlacing check
16933 <dt> ‘<samp>3, send_field_nospatial</samp>’</dt>
16934 <dd><p>like <code>send_field</code> but skip spatial interlacing check
16938 <p>Default value is <code>send_frame</code>.
16941 <dt> ‘<samp>parity</samp>’</dt>
16942 <dd><p>The picture field parity assumed for the input interlaced video, accepts one of
16943 the following values:
16945 <dl compact="compact">
16946 <dt> ‘<samp>0, tff</samp>’</dt>
16947 <dd><p>assume top field first
16949 <dt> ‘<samp>1, bff</samp>’</dt>
16950 <dd><p>assume bottom field first
16952 <dt> ‘<samp>-1, auto</samp>’</dt>
16953 <dd><p>enable automatic detection
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.
16962 <dt> ‘<samp>deint</samp>’</dt>
16963 <dd><p>Specify which frames to deinterlace. Accept one of the following
16966 <dl compact="compact">
16967 <dt> ‘<samp>0, all</samp>’</dt>
16968 <dd><p>deinterlace all frames
16970 <dt> ‘<samp>1, interlaced</samp>’</dt>
16971 <dd><p>only deinterlace frames marked as interlaced
16975 <p>Default value is <code>all</code>.
16980 <a name="Video-Sources"></a>
16981 <h1 class="chapter"><a href="ffplay-all.html#toc-Video-Sources">29. Video Sources</a></h1>
16983 <p>Below is a description of the currently available video sources.
16985 <a name="buffer"></a>
16986 <h2 class="section"><a href="ffplay-all.html#toc-buffer">29.1 buffer</a></h2>
16988 <p>Buffer video frames, and make them available to the filter chain.
16990 <p>This source is mainly intended for a programmatic use, in particular
16991 through the interface defined in ‘<tt>libavfilter/vsrc_buffer.h</tt>’.
16993 <p>This source accepts the following options:
16995 <dl compact="compact">
16996 <dt> ‘<samp>video_size</samp>’</dt>
16997 <dd><p>Specify the size (width and height) of the buffered video frames. For the
16998 syntax of this option, check the "Video size" section in the ffmpeg-utils
17002 <dt> ‘<samp>width</samp>’</dt>
17003 <dd><p>Input video width.
17006 <dt> ‘<samp>height</samp>’</dt>
17007 <dd><p>Input video height.
17010 <dt> ‘<samp>pix_fmt</samp>’</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
17016 <dt> ‘<samp>time_base</samp>’</dt>
17017 <dd><p>Specify the timebase assumed by the timestamps of the buffered frames.
17020 <dt> ‘<samp>frame_rate</samp>’</dt>
17021 <dd><p>Specify the frame rate expected for the video stream.
17024 <dt> ‘<samp>pixel_aspect, sar</samp>’</dt>
17025 <dd><p>Specify the sample aspect ratio assumed by the video frames.
17028 <dt> ‘<samp>sws_param</samp>’</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.
17036 </p><table><tr><td> </td><td><pre class="example">buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
17037 </pre></td></tr></table>
17039 <p>will instruct the source to accept video frames with size 320x240 and
17040 with format "yuv410p", assuming 1/24 as the timestamps timebase and
17041 square pixels (1:1 sample aspect ratio).
17042 Since the pixel format with name "yuv410p" corresponds to the number 6
17043 (check the enum AVPixelFormat definition in ‘<tt>libavutil/pixfmt.h</tt>’),
17044 this example corresponds to:
17045 </p><table><tr><td> </td><td><pre class="example">buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
17046 </pre></td></tr></table>
17048 <p>Alternatively, the options can be specified as a flat string, but this
17049 syntax is deprecated:
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>]
17053 <a name="cellauto"></a>
17054 <h2 class="section"><a href="ffplay-all.html#toc-cellauto">29.2 cellauto</a></h2>
17056 <p>Create a pattern generated by an elementary cellular automaton.
17058 <p>The initial state of the cellular automaton can be defined through the
17059 ‘<samp>filename</samp>’, and ‘<samp>pattern</samp>’ options. If such options are
17060 not specified an initial state is created randomly.
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 ‘<samp>scroll</samp>’ option.
17066 <p>This source accepts the following options:
17068 <dl compact="compact">
17069 <dt> ‘<samp>filename, f</samp>’</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.
17077 <dt> ‘<samp>pattern, p</samp>’</dt>
17078 <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
17079 the specified string.
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.
17086 <dt> ‘<samp>rate, r</samp>’</dt>
17087 <dd><p>Set the video rate, that is the number of frames generated per second.
17091 <dt> ‘<samp>random_fill_ratio, ratio</samp>’</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
17096 <p>This option is ignored when a file or a pattern is specified.
17099 <dt> ‘<samp>random_seed, seed</samp>’</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
17106 <dt> ‘<samp>rule</samp>’</dt>
17107 <dd><p>Set the cellular automaton rule, it is a number ranging from 0 to 255.
17108 Default value is 110.
17111 <dt> ‘<samp>size, s</samp>’</dt>
17112 <dd><p>Set the size of the output video. For the syntax of this option, check
17113 the "Video size" section in the ffmpeg-utils manual.
17115 <p>If ‘<samp>filename</samp>’ or ‘<samp>pattern</samp>’ 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.
17119 <p>If ‘<samp>size</samp>’ is set, it must contain the width of the specified
17120 pattern string, and the specified pattern will be centered in the
17123 <p>If a filename or a pattern string is not specified, the size value
17124 defaults to "320x518" (used for a randomly generated initial state).
17127 <dt> ‘<samp>scroll</samp>’</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.
17134 <dt> ‘<samp>start_full, full</samp>’</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.
17140 <dt> ‘<samp>stitch</samp>’</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.
17146 <a name="Examples-16"></a>
17147 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-16">29.2.1 Examples</a></h3>
17151 Read the initial state from ‘<tt>pattern</tt>’, and specify an output of
17153 <table><tr><td> </td><td><pre class="example">cellauto=f=pattern:s=200x400
17154 </pre></td></tr></table>
17157 Generate a random initial row with a width of 200 cells, with a fill
17159 <table><tr><td> </td><td><pre class="example">cellauto=ratio=2/3:s=200x200
17160 </pre></td></tr></table>
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> </td><td><pre class="example">cellauto=p=@:s=100x400:full=0:rule=18
17166 </pre></td></tr></table>
17169 Specify a more elaborated initial pattern:
17170 <table><tr><td> </td><td><pre class="example">cellauto=p='@@ @ @@':s=100x400:full=0:rule=18
17171 </pre></td></tr></table>
17175 <a name="mandelbrot"></a>
17176 <h2 class="section"><a href="ffplay-all.html#toc-mandelbrot">29.3 mandelbrot</a></h2>
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>.
17181 <p>This source accepts the following options:
17183 <dl compact="compact">
17184 <dt> ‘<samp>end_pts</samp>’</dt>
17185 <dd><p>Set the terminal pts value. Default value is 400.
17188 <dt> ‘<samp>end_scale</samp>’</dt>
17189 <dd><p>Set the terminal scale value.
17190 Must be a floating point value. Default value is 0.3.
17193 <dt> ‘<samp>inner</samp>’</dt>
17194 <dd><p>Set the inner coloring mode, that is the algorithm used to draw the
17195 Mandelbrot fractal internal region.
17197 <p>It shall assume one of the following values:
17198 </p><dl compact="compact">
17199 <dt> ‘<samp>black</samp>’</dt>
17200 <dd><p>Set black mode.
17202 <dt> ‘<samp>convergence</samp>’</dt>
17203 <dd><p>Show time until convergence.
17205 <dt> ‘<samp>mincol</samp>’</dt>
17206 <dd><p>Set color based on point closest to the origin of the iterations.
17208 <dt> ‘<samp>period</samp>’</dt>
17209 <dd><p>Set period mode.
17213 <p>Default value is <var>mincol</var>.
17216 <dt> ‘<samp>bailout</samp>’</dt>
17217 <dd><p>Set the bailout value. Default value is 10.0.
17220 <dt> ‘<samp>maxiter</samp>’</dt>
17221 <dd><p>Set the maximum of iterations performed by the rendering
17222 algorithm. Default value is 7189.
17225 <dt> ‘<samp>outer</samp>’</dt>
17226 <dd><p>Set outer coloring mode.
17227 It shall assume one of following values:
17228 </p><dl compact="compact">
17229 <dt> ‘<samp>iteration_count</samp>’</dt>
17230 <dd><p>Set iteration cound mode.
17232 <dt> ‘<samp>normalized_iteration_count</samp>’</dt>
17233 <dd><p>set normalized iteration count mode.
17236 <p>Default value is <var>normalized_iteration_count</var>.
17239 <dt> ‘<samp>rate, r</samp>’</dt>
17240 <dd><p>Set frame rate, expressed as number of frames per second. Default
17241 value is "25".
17244 <dt> ‘<samp>size, s</samp>’</dt>
17245 <dd><p>Set frame size. For the syntax of this option, check the "Video
17246 size" section in the ffmpeg-utils manual. Default value is "640x480".
17249 <dt> ‘<samp>start_scale</samp>’</dt>
17250 <dd><p>Set the initial scale value. Default value is 3.0.
17253 <dt> ‘<samp>start_x</samp>’</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.
17258 <dt> ‘<samp>start_y</samp>’</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.
17264 <a name="mptestsrc"></a>
17265 <h2 class="section"><a href="ffplay-all.html#toc-mptestsrc">29.4 mptestsrc</a></h2>
17267 <p>Generate various test patterns, as generated by the MPlayer test filter.
17269 <p>The size of the generated video is fixed, and is 256x256.
17270 This source is useful in particular for testing encoding features.
17272 <p>This source accepts the following options:
17274 <dl compact="compact">
17275 <dt> ‘<samp>rate, r</samp>’</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
17283 <dt> ‘<samp>duration, d</samp>’</dt>
17284 <dd><p>Set the video duration of the sourced video. The accepted syntax is:
17285 </p><table><tr><td> </td><td><pre class="example">[-]HH:MM:SS[.m...]
17287 </pre></td></tr></table>
17288 <p>See also the function <code>av_parse_time()</code>.
17290 <p>If not specified, or the expressed duration is negative, the video is
17291 supposed to be generated forever.
17294 <dt> ‘<samp>test, t</samp>’</dt>
17296 <p>Set the number or the name of the test to perform. Supported tests are:
17297 </p><dl compact="compact">
17298 <dt> ‘<samp>dc_luma</samp>’</dt>
17299 <dt> ‘<samp>dc_chroma</samp>’</dt>
17300 <dt> ‘<samp>freq_luma</samp>’</dt>
17301 <dt> ‘<samp>freq_chroma</samp>’</dt>
17302 <dt> ‘<samp>amp_luma</samp>’</dt>
17303 <dt> ‘<samp>amp_chroma</samp>’</dt>
17304 <dt> ‘<samp>cbp</samp>’</dt>
17305 <dt> ‘<samp>mv</samp>’</dt>
17306 <dt> ‘<samp>ring1</samp>’</dt>
17307 <dt> ‘<samp>ring2</samp>’</dt>
17308 <dt> ‘<samp>all</samp>’</dt>
17311 <p>Default value is "all", which will cycle through the list of all tests.
17315 <p>For example the following:
17316 </p><table><tr><td> </td><td><pre class="example">testsrc=t=dc_luma
17317 </pre></td></tr></table>
17319 <p>will generate a "dc_luma" test pattern.
17321 <a name="frei0r_005fsrc"></a>
17322 <h2 class="section"><a href="ffplay-all.html#toc-frei0r_005fsrc">29.5 frei0r_src</a></h2>
17324 <p>Provide a frei0r source.
17326 <p>To enable compilation of this filter you need to install the frei0r
17327 header and configure FFmpeg with <code>--enable-frei0r</code>.
17329 <p>This source accepts the following options:
17331 <dl compact="compact">
17332 <dt> ‘<samp>size</samp>’</dt>
17333 <dd><p>The size of the video to generate. For the syntax of this option, check the
17334 "Video size" section in the ffmpeg-utils manual.
17337 <dt> ‘<samp>framerate</samp>’</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.
17342 <dt> ‘<samp>filter_name</samp>’</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
17348 <dt> ‘<samp>filter_params</samp>’</dt>
17349 <dd><p>A ’|’-separated list of parameters to pass to the frei0r source.
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> </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>
17359 <a name="life"></a>
17360 <h2 class="section"><a href="ffplay-all.html#toc-life">29.6 life</a></h2>
17362 <p>Generate a life pattern.
17364 <p>This source is based on a generalization of John Conway’s life game.
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.
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 ‘<samp>rule</samp>’ option allows one to specify
17376 <p>This source accepts the following options:
17378 <dl compact="compact">
17379 <dt> ‘<samp>filename, f</samp>’</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.
17384 <p>If this option is not specified, the initial grid is generated
17388 <dt> ‘<samp>rate, r</samp>’</dt>
17389 <dd><p>Set the video rate, that is the number of frames generated per second.
17393 <dt> ‘<samp>random_fill_ratio, ratio</samp>’</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.
17399 <dt> ‘<samp>random_seed, seed</samp>’</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
17406 <dt> ‘<samp>rule</samp>’</dt>
17407 <dd><p>Set the life rule.
17409 <p>A rule can be specified with a code of the kind "S<var>NS</var>/B<var>NB</var>",
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 "born").
17414 "s" and "b" can be used in place of "S" and "B", respectively.
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 "borning" new cells. Higher order bits encode for an
17420 higher number of neighbor cells.
17421 For example the number 6153 = <code>(12<<9)+9</code> specifies a stay alive
17422 rule of 12 and a born rule of 9, which corresponds to "S23/B03".
17424 <p>Default value is "S23/B3", which is the original Conway’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
17430 <dt> ‘<samp>size, s</samp>’</dt>
17431 <dd><p>Set the size of the output video. For the syntax of this option, check the
17432 "Video size" section in the ffmpeg-utils manual.
17434 <p>If ‘<samp>filename</samp>’ is specified, the size is set by default to the
17435 same size of the input file. If ‘<samp>size</samp>’ 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.
17439 <p>If a filename is not specified, the size value defaults to "320x240"
17440 (used for a randomly generated initial grid).
17443 <dt> ‘<samp>stitch</samp>’</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.
17448 <dt> ‘<samp>mold</samp>’</dt>
17449 <dd><p>Set cell mold speed. If set, a dead cell will go from ‘<samp>death_color</samp>’ to
17450 ‘<samp>mold_color</samp>’ with a step of ‘<samp>mold</samp>’. ‘<samp>mold</samp>’ can have a
17451 value from 0 to 255.
17454 <dt> ‘<samp>life_color</samp>’</dt>
17455 <dd><p>Set the color of living (or new born) cells.
17458 <dt> ‘<samp>death_color</samp>’</dt>
17459 <dd><p>Set the color of dead cells. If ‘<samp>mold</samp>’ is set, this is the first color
17460 used to represent a dead cell.
17463 <dt> ‘<samp>mold_color</samp>’</dt>
17464 <dd><p>Set mold color, for definitely dead and moldy cells.
17466 <p>For the syntax of these 3 color options, check the "Color" section in the
17467 ffmpeg-utils manual.
17471 <a name="Examples-73"></a>
17472 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-73">29.6.1 Examples</a></h3>
17476 Read a grid from ‘<tt>pattern</tt>’, and center it on a grid of size
17478 <table><tr><td> </td><td><pre class="example">life=f=pattern:s=300x300
17479 </pre></td></tr></table>
17482 Generate a random grid of size 200x200, with a fill ratio of 2/3:
17483 <table><tr><td> </td><td><pre class="example">life=ratio=2/3:s=200x200
17484 </pre></td></tr></table>
17487 Specify a custom rule for evolving a randomly generated grid:
17488 <table><tr><td> </td><td><pre class="example">life=rule=S14/B34
17489 </pre></td></tr></table>
17492 Full example with slow death effect (mold) using <code>ffplay</code>:
17493 <table><tr><td> </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>
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>
17507 <p>The <code>color</code> source provides an uniformly colored input.
17509 <p>The <code>haldclutsrc</code> source provides an identity Hald CLUT. See also
17510 <a href="#haldclut">haldclut</a> filter.
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.
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.
17520 <p>The <code>smptebars</code> source generates a color bars pattern, based on
17521 the SMPTE Engineering Guideline EG 1-1990.
17523 <p>The <code>smptehdbars</code> source generates a color bars pattern, based on
17524 the SMPTE RP 219-2002.
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.
17530 <p>The sources accept the following options:
17532 <dl compact="compact">
17533 <dt> ‘<samp>color, c</samp>’</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 "Color" section in the
17536 ffmpeg-utils manual.
17539 <dt> ‘<samp>level</samp>’</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.
17546 <dt> ‘<samp>size, s</samp>’</dt>
17547 <dd><p>Specify the size of the sourced video. For the syntax of this option, check the
17548 "Video size" section in the ffmpeg-utils manual. The default value is
17549 "320x240".
17551 <p>This option is not available with the <code>haldclutsrc</code> filter.
17554 <dt> ‘<samp>rate, r</samp>’</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
17562 <dt> ‘<samp>sar</samp>’</dt>
17563 <dd><p>Set the sample aspect ratio of the sourced video.
17566 <dt> ‘<samp>duration, d</samp>’</dt>
17567 <dd><p>Set the video duration of the sourced video. The accepted syntax is:
17568 </p><table><tr><td> </td><td><pre class="example">[-]HH[:MM[:SS[.m...]]]
17570 </pre></td></tr></table>
17571 <p>See also the function <code>av_parse_time()</code>.
17573 <p>If not specified, or the expressed duration is negative, the video is
17574 supposed to be generated forever.
17577 <dt> ‘<samp>decimals, n</samp>’</dt>
17578 <dd><p>Set the number of decimals to show in the timestamp, only available in the
17579 <code>testsrc</code> source.
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.
17587 <p>For example the following:
17588 </p><table><tr><td> </td><td><pre class="example">testsrc=duration=5.3:size=qcif:rate=10
17589 </pre></td></tr></table>
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.
17594 <p>The following graph description will generate a red source
17595 with an opacity of 0.2, with size "qcif" and a frame rate of 10
17597 </p><table><tr><td> </td><td><pre class="example">color=c=red@0.2:s=qcif:r=10
17598 </pre></td></tr></table>
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> </td><td><pre class="example">nullsrc=s=256x256, geq=random(1)*255:128:128
17604 </pre></td></tr></table>
17606 <a name="Commands-2"></a>
17607 <h3 class="subsection"><a href="ffplay-all.html#toc-Commands-2">29.7.1 Commands</a></h3>
17609 <p>The <code>color</code> source supports the following commands:
17611 <dl compact="compact">
17612 <dt> ‘<samp>c, color</samp>’</dt>
17613 <dd><p>Set the color of the created image. Accepts the same syntax of the
17614 corresponding ‘<samp>color</samp>’ option.
17619 <a name="Video-Sinks"></a>
17620 <h1 class="chapter"><a href="ffplay-all.html#toc-Video-Sinks">30. Video Sinks</a></h1>
17622 <p>Below is a description of the currently available video sinks.
17624 <a name="buffersink"></a>
17625 <h2 class="section"><a href="ffplay-all.html#toc-buffersink">30.1 buffersink</a></h2>
17627 <p>Buffer video frames, and make them available to the end of the filter
17630 <p>This sink is mainly intended for a programmatic use, in particular
17631 through the interface defined in ‘<tt>libavfilter/buffersink.h</tt>’
17632 or the options system.
17634 <p>It accepts a pointer to an AVBufferSinkContext structure, which
17635 defines the incoming buffers’ formats, to be passed as the opaque
17636 parameter to <code>avfilter_init_filter</code> for initialization.
17638 <a name="nullsink"></a>
17639 <h2 class="section"><a href="ffplay-all.html#toc-nullsink">30.2 nullsink</a></h2>
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
17646 <a name="Multimedia-Filters"></a>
17647 <h1 class="chapter"><a href="ffplay-all.html#toc-Multimedia-Filters">31. Multimedia Filters</a></h1>
17649 <p>Below is a description of the currently available multimedia filters.
17651 <a name="avectorscope"></a>
17652 <h2 class="section"><a href="ffplay-all.html#toc-avectorscope">31.1 avectorscope</a></h2>
17654 <p>Convert input audio to a video output, representing the audio vector
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.
17664 <p>The filter accepts the following options:
17666 <dl compact="compact">
17667 <dt> ‘<samp>mode, m</samp>’</dt>
17668 <dd><p>Set the vectorscope mode.
17670 <p>Available values are:
17671 </p><dl compact="compact">
17672 <dt> ‘<samp>lissajous</samp>’</dt>
17673 <dd><p>Lissajous rotated by 45 degrees.
17676 <dt> ‘<samp>lissajous_xy</samp>’</dt>
17677 <dd><p>Same as above but not rotated.
17681 <p>Default value is ‘<samp>lissajous</samp>’.
17684 <dt> ‘<samp>size, s</samp>’</dt>
17685 <dd><p>Set the video size for the output. For the syntax of this option, check the "Video size"
17686 section in the ffmpeg-utils manual. Default value is <code>400x400</code>.
17689 <dt> ‘<samp>rate, r</samp>’</dt>
17690 <dd><p>Set the output frame rate. Default value is <code>25</code>.
17693 <dt> ‘<samp>rc</samp>’</dt>
17694 <dt> ‘<samp>gc</samp>’</dt>
17695 <dt> ‘<samp>bc</samp>’</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>.
17700 <dt> ‘<samp>rf</samp>’</dt>
17701 <dt> ‘<samp>gf</samp>’</dt>
17702 <dt> ‘<samp>bf</samp>’</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>.
17707 <dt> ‘<samp>zoom</samp>’</dt>
17708 <dd><p>Set the zoom factor. Default value is <code>1</code>. Allowed range is <code>[1, 10]</code>.
17712 <a name="Examples-48"></a>
17713 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-48">31.1.1 Examples</a></h3>
17717 Complete example using <code>ffplay</code>:
17718 <table><tr><td> </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>
17723 <a name="concat-2"></a>
17724 <h2 class="section"><a href="ffplay-all.html#toc-concat-2">31.2 concat</a></h2>
17726 <p>Concatenate audio and video streams, joining them together one after the
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.
17733 <p>The filter accepts the following options:
17735 <dl compact="compact">
17736 <dt> ‘<samp>n</samp>’</dt>
17737 <dd><p>Set the number of segments. Default is 2.
17740 <dt> ‘<samp>v</samp>’</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.
17745 <dt> ‘<samp>a</samp>’</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.
17750 <dt> ‘<samp>unsafe</samp>’</dt>
17751 <dd><p>Activate unsafe mode: do not fail if segments have a different format.
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.
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
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.
17770 <p>For this filter to work correctly, all segments must start at timestamp 0.
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.
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.
17781 <a name="Examples-24"></a>
17782 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-24">31.2.1 Examples</a></h3>
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> </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>
17795 Concatenate two parts, handling audio and video separately, using the
17796 (a)movie sources, and adjusting the resolution:
17797 <table><tr><td> </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.
17806 <a name="ebur128"></a>
17807 <h2 class="section"><a href="ffplay-all.html#toc-ebur128">31.3 ebur128</a></h2>
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>).
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).
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>.
17824 <p>The filter accepts the following options:
17826 <dl compact="compact">
17827 <dt> ‘<samp>video</samp>’</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>.
17833 <dt> ‘<samp>size</samp>’</dt>
17834 <dd><p>Set the video size. This option is for video only. For the syntax of this
17835 option, check the "Video size" section in the ffmpeg-utils manual. Default
17836 and minimum resolution is <code>640x480</code>.
17839 <dt> ‘<samp>meter</samp>’</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.
17845 <dt> ‘<samp>metadata</samp>’</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>.
17850 <p>Default is <code>0</code>.
17853 <dt> ‘<samp>framelog</samp>’</dt>
17854 <dd><p>Force the frame logging level.
17856 <p>Available values are:
17857 </p><dl compact="compact">
17858 <dt> ‘<samp>info</samp>’</dt>
17859 <dd><p>information logging level
17861 <dt> ‘<samp>verbose</samp>’</dt>
17862 <dd><p>verbose logging level
17866 <p>By default, the logging level is set to <var>info</var>. If the ‘<samp>video</samp>’ or
17867 the ‘<samp>metadata</samp>’ options are set, it switches to <var>verbose</var>.
17870 <dt> ‘<samp>peak</samp>’</dt>
17871 <dd><p>Set peak mode(s).
17873 <p>Available modes can be cumulated (the option is a <code>flag</code> type). Possible
17875 </p><dl compact="compact">
17876 <dt> ‘<samp>none</samp>’</dt>
17877 <dd><p>Disable any peak mode (default).
17879 <dt> ‘<samp>sample</samp>’</dt>
17880 <dd><p>Enable sample-peak mode.
17882 <p>Simple peak mode looking for the higher sample value. It logs a message
17883 for sample-peak (identified by <code>SPK</code>).
17885 <dt> ‘<samp>true</samp>’</dt>
17886 <dd><p>Enable true-peak mode.
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>.
17898 <a name="Examples-13"></a>
17899 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-13">31.3.1 Examples</a></h3>
17903 Real-time graph using <code>ffplay</code>, with a EBU scale meter +18:
17904 <table><tr><td> </td><td><pre class="example">ffplay -f lavfi -i "amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]"
17905 </pre></td></tr></table>
17908 Run an analysis with <code>ffmpeg</code>:
17909 <table><tr><td> </td><td><pre class="example">ffmpeg -nostats -i input.mp3 -filter_complex ebur128 -f null -
17910 </pre></td></tr></table>
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>
17916 <p>Temporally interleave frames from several inputs.
17918 <p><code>interleave</code> works with video inputs, <code>ainterleave</code> with audio.
17920 <p>These filters read frames from several inputs and send the oldest
17921 queued frame to the output.
17923 <p>Input streams must have a well defined, monotonically increasing frame
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.
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.
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.
17939 <p>These filters accept the following options:
17941 <dl compact="compact">
17942 <dt> ‘<samp>nb_inputs, n</samp>’</dt>
17943 <dd><p>Set the number of different inputs, it is 2 by default.
17947 <a name="Examples-7"></a>
17948 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-7">31.4.1 Examples</a></h3>
17952 Interleave frames belonging to different streams using <code>ffmpeg</code>:
17953 <table><tr><td> </td><td><pre class="example">ffmpeg -i bambi.avi -i pr0n.mkv -filter_complex "[0:v][1:v] interleave" out.avi
17954 </pre></td></tr></table>
17957 Add flickering blur effect:
17958 <table><tr><td> </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>
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>
17965 <p>Set read/write permissions for the output frames.
17967 <p>These filters are mainly aimed at developers to test direct path in the
17968 following filter in the filtergraph.
17970 <p>The filters accept the following options:
17972 <dl compact="compact">
17973 <dt> ‘<samp>mode</samp>’</dt>
17974 <dd><p>Select the permissions mode.
17976 <p>It accepts the following values:
17977 </p><dl compact="compact">
17978 <dt> ‘<samp>none</samp>’</dt>
17979 <dd><p>Do nothing. This is the default.
17981 <dt> ‘<samp>ro</samp>’</dt>
17982 <dd><p>Set all the output frames read-only.
17984 <dt> ‘<samp>rw</samp>’</dt>
17985 <dd><p>Set all the output frames directly writable.
17987 <dt> ‘<samp>toggle</samp>’</dt>
17988 <dd><p>Make the frame read-only if writable, and writable if read-only.
17990 <dt> ‘<samp>random</samp>’</dt>
17991 <dd><p>Set each output frame read-only or writable randomly.
17996 <dt> ‘<samp>seed</samp>’</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
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.
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>
18012 <p>Select frames to pass in output.
18014 <p>This filter accepts the following options:
18016 <dl compact="compact">
18017 <dt> ‘<samp>expr, e</samp>’</dt>
18018 <dd><p>Set expression, which is evaluated for each input frame.
18020 <p>If the expression is evaluated to zero, the frame is discarded.
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.
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.
18030 <dt> ‘<samp>outputs, n</samp>’</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.
18036 <p>The expression can contain the following constants:
18038 <dl compact="compact">
18039 <dt> ‘<samp>n</samp>’</dt>
18040 <dd><p>the sequential number of the filtered frame, starting from 0
18043 <dt> ‘<samp>selected_n</samp>’</dt>
18044 <dd><p>the sequential number of the selected frame, starting from 0
18047 <dt> ‘<samp>prev_selected_n</samp>’</dt>
18048 <dd><p>the sequential number of the last selected frame, NAN if undefined
18051 <dt> ‘<samp>TB</samp>’</dt>
18052 <dd><p>timebase of the input timestamps
18055 <dt> ‘<samp>pts</samp>’</dt>
18056 <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
18057 expressed in <var>TB</var> units, NAN if undefined
18060 <dt> ‘<samp>t</samp>’</dt>
18061 <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
18062 expressed in seconds, NAN if undefined
18065 <dt> ‘<samp>prev_pts</samp>’</dt>
18066 <dd><p>the PTS of the previously filtered video frame, NAN if undefined
18069 <dt> ‘<samp>prev_selected_pts</samp>’</dt>
18070 <dd><p>the PTS of the last previously filtered video frame, NAN if undefined
18073 <dt> ‘<samp>prev_selected_t</samp>’</dt>
18074 <dd><p>the PTS of the last previously selected video frame, NAN if undefined
18077 <dt> ‘<samp>start_pts</samp>’</dt>
18078 <dd><p>the PTS of the first video frame in the video, NAN if undefined
18081 <dt> ‘<samp>start_t</samp>’</dt>
18082 <dd><p>the time of the first video frame in the video, NAN if undefined
18085 <dt> ‘<samp>pict_type <em>(video only)</em></samp>’</dt>
18086 <dd><p>the type of the filtered frame, can assume one of the following
18088 </p><dl compact="compact">
18089 <dt> ‘<samp>I</samp>’</dt>
18090 <dt> ‘<samp>P</samp>’</dt>
18091 <dt> ‘<samp>B</samp>’</dt>
18092 <dt> ‘<samp>S</samp>’</dt>
18093 <dt> ‘<samp>SI</samp>’</dt>
18094 <dt> ‘<samp>SP</samp>’</dt>
18095 <dt> ‘<samp>BI</samp>’</dt>
18099 <dt> ‘<samp>interlace_type <em>(video only)</em></samp>’</dt>
18100 <dd><p>the frame interlace type, can assume one of the following values:
18101 </p><dl compact="compact">
18102 <dt> ‘<samp>PROGRESSIVE</samp>’</dt>
18103 <dd><p>the frame is progressive (not interlaced)
18105 <dt> ‘<samp>TOPFIRST</samp>’</dt>
18106 <dd><p>the frame is top-field-first
18108 <dt> ‘<samp>BOTTOMFIRST</samp>’</dt>
18109 <dd><p>the frame is bottom-field-first
18114 <dt> ‘<samp>consumed_sample_n <em>(audio only)</em></samp>’</dt>
18115 <dd><p>the number of selected samples before the current frame
18118 <dt> ‘<samp>samples_n <em>(audio only)</em></samp>’</dt>
18119 <dd><p>the number of samples in the current frame
18122 <dt> ‘<samp>sample_rate <em>(audio only)</em></samp>’</dt>
18123 <dd><p>the input sample rate
18126 <dt> ‘<samp>key</samp>’</dt>
18127 <dd><p>1 if the filtered frame is a key-frame, 0 otherwise
18130 <dt> ‘<samp>pos</samp>’</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)
18135 <dt> ‘<samp>scene <em>(video only)</em></samp>’</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)
18143 <p>The default value of the select expression is "1".
18145 <a name="Examples-20"></a>
18146 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-20">31.6.1 Examples</a></h3>
18150 Select all frames in input:
18151 <table><tr><td> </td><td><pre class="example">select
18152 </pre></td></tr></table>
18154 <p>The example above is the same as:
18155 </p><table><tr><td> </td><td><pre class="example">select=1
18156 </pre></td></tr></table>
18160 <table><tr><td> </td><td><pre class="example">select=0
18161 </pre></td></tr></table>
18164 Select only I-frames:
18165 <table><tr><td> </td><td><pre class="example">select='eq(pict_type\,I)'
18166 </pre></td></tr></table>
18169 Select one frame every 100:
18170 <table><tr><td> </td><td><pre class="example">select='not(mod(n\,100))'
18171 </pre></td></tr></table>
18174 Select only frames contained in the 10-20 time interval:
18175 <table><tr><td> </td><td><pre class="example">select=between(t\,10\,20)
18176 </pre></td></tr></table>
18179 Select only I frames contained in the 10-20 time interval:
18180 <table><tr><td> </td><td><pre class="example">select=between(t\,10\,20)*eq(pict_type\,I)
18181 </pre></td></tr></table>
18184 Select frames with a minimum distance of 10 seconds:
18185 <table><tr><td> </td><td><pre class="example">select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
18186 </pre></td></tr></table>
18189 Use aselect to select only audio frames with samples number > 100:
18190 <table><tr><td> </td><td><pre class="example">aselect='gt(samples_n\,100)'
18191 </pre></td></tr></table>
18194 Create a mosaic of the first scenes:
18195 <table><tr><td> </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>
18198 <p>Comparing <var>scene</var> against a value between 0.3 and 0.5 is generally a sane
18202 Send even and odd frames to separate outputs, and compose them:
18203 <table><tr><td> </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>
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>
18210 <p>Send commands to filters in the filtergraph.
18212 <p>These filters read commands to be sent to other filters in the
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.
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.
18223 <p>These filters accept the following options:
18224 </p><dl compact="compact">
18225 <dt> ‘<samp>commands, c</samp>’</dt>
18226 <dd><p>Set the commands to be read and sent to the other filters.
18228 <dt> ‘<samp>filename, f</samp>’</dt>
18229 <dd><p>Set the filename of the commands to be read and sent to the other
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>
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
18243 <p>An interval is specified by the following syntax:
18244 </p><table><tr><td> </td><td><pre class="example"><var>START</var>[-<var>END</var>] <var>COMMANDS</var>;
18245 </pre></td></tr></table>
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.
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
18255 <p><var>COMMANDS</var> consists of a sequence of one or more command
18256 specifications, separated by ",", relating to that interval. The
18257 syntax of a command specification is given by:
18258 </p><table><tr><td> </td><td><pre class="example">[<var>FLAGS</var>] <var>TARGET</var> <var>COMMAND</var> <var>ARG</var>
18259 </pre></td></tr></table>
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 "+" or "|" and
18264 enclosed between "[" and "]".
18266 <p>The following flags are recognized:
18267 </p><dl compact="compact">
18268 <dt> ‘<samp>enter</samp>’</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
18275 <dt> ‘<samp>leave</samp>’</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
18283 <p>If <var>FLAGS</var> is not specified, a default value of <code>[enter]</code> is
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.
18289 <p><var>COMMAND</var> specifies the name of the command for the target filter.
18291 <p><var>ARG</var> is optional and specifies the optional list of argument for
18292 the given <var>COMMAND</var>.
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.
18298 <p>A simplified BNF description of the commands specification syntax
18300 </p><table><tr><td> </td><td><pre class="example"><var>COMMAND_FLAG</var> ::= "enter" | "leave"
18301 <var>COMMAND_FLAGS</var> ::= <var>COMMAND_FLAG</var> [(+|"|")<var>COMMAND_FLAG</var>]
18302 <var>COMMAND</var> ::= ["[" <var>COMMAND_FLAGS</var> "]"] <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>
18308 <a name="Examples-36"></a>
18309 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-36">31.7.2 Examples</a></h3>
18313 Specify audio tempo change at second 4:
18314 <table><tr><td> </td><td><pre class="example">asendcmd=c='4.0 atempo tempo 1.5',atempo
18315 </pre></td></tr></table>
18318 Specify a list of drawtext and hue commands in a file.
18319 <table><tr><td> </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=';
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',
18327 [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color';
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>
18333 <p>A filtergraph allowing to read and process the above command list
18334 stored in a file ‘<tt>test.cmd</tt>’, can be specified with:
18335 </p><table><tr><td> </td><td><pre class="example">sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue
18336 </pre></td></tr></table>
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>
18343 <p>Change the PTS (presentation timestamp) of the input frames.
18345 <p><code>setpts</code> works on video frames, <code>asetpts</code> on audio frames.
18347 <p>This filter accepts the following options:
18349 <dl compact="compact">
18350 <dt> ‘<samp>expr</samp>’</dt>
18351 <dd><p>The expression which is evaluated for each frame to construct its timestamp.
18356 <p>The expression is evaluated through the eval API and can contain the following
18359 <dl compact="compact">
18360 <dt> ‘<samp>FRAME_RATE</samp>’</dt>
18361 <dd><p>frame rate, only defined for constant frame-rate video
18364 <dt> ‘<samp>PTS</samp>’</dt>
18365 <dd><p>the presentation timestamp in input
18368 <dt> ‘<samp>N</samp>’</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.
18373 <dt> ‘<samp>NB_CONSUMED_SAMPLES</samp>’</dt>
18374 <dd><p>the number of consumed samples, not including the current frame (only
18378 <dt> ‘<samp>NB_SAMPLES, S</samp>’</dt>
18379 <dd><p>the number of samples in the current frame (only audio)
18382 <dt> ‘<samp>SAMPLE_RATE, SR</samp>’</dt>
18383 <dd><p>audio sample rate
18386 <dt> ‘<samp>STARTPTS</samp>’</dt>
18387 <dd><p>the PTS of the first frame
18390 <dt> ‘<samp>STARTT</samp>’</dt>
18391 <dd><p>the time in seconds of the first frame
18394 <dt> ‘<samp>INTERLACED</samp>’</dt>
18395 <dd><p>tell if the current frame is interlaced
18398 <dt> ‘<samp>T</samp>’</dt>
18399 <dd><p>the time in seconds of the current frame
18402 <dt> ‘<samp>POS</samp>’</dt>
18403 <dd><p>original position in the file of the frame, or undefined if undefined
18404 for the current frame
18407 <dt> ‘<samp>PREV_INPTS</samp>’</dt>
18408 <dd><p>previous input PTS
18411 <dt> ‘<samp>PREV_INT</samp>’</dt>
18412 <dd><p>previous input time in seconds
18415 <dt> ‘<samp>PREV_OUTPTS</samp>’</dt>
18416 <dd><p>previous output PTS
18419 <dt> ‘<samp>PREV_OUTT</samp>’</dt>
18420 <dd><p>previous output time in seconds
18423 <dt> ‘<samp>RTCTIME</samp>’</dt>
18424 <dd><p>wallclock (RTC) time in microseconds. This is deprecated, use time(0)
18428 <dt> ‘<samp>RTCSTART</samp>’</dt>
18429 <dd><p>wallclock (RTC) time at the start of the movie in microseconds
18432 <dt> ‘<samp>TB</samp>’</dt>
18433 <dd><p>timebase of the input timestamps
18438 <a name="Examples-59"></a>
18439 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-59">31.8.1 Examples</a></h3>
18443 Start counting PTS from zero
18444 <table><tr><td> </td><td><pre class="example">setpts=PTS-STARTPTS
18445 </pre></td></tr></table>
18448 Apply fast motion effect:
18449 <table><tr><td> </td><td><pre class="example">setpts=0.5*PTS
18450 </pre></td></tr></table>
18453 Apply slow motion effect:
18454 <table><tr><td> </td><td><pre class="example">setpts=2.0*PTS
18455 </pre></td></tr></table>
18458 Set fixed rate of 25 frames per second:
18459 <table><tr><td> </td><td><pre class="example">setpts=N/(25*TB)
18460 </pre></td></tr></table>
18463 Set fixed rate 25 fps with some jitter:
18464 <table><tr><td> </td><td><pre class="example">setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
18465 </pre></td></tr></table>
18468 Apply an offset of 10 seconds to the input PTS:
18469 <table><tr><td> </td><td><pre class="example">setpts=PTS+10/TB
18470 </pre></td></tr></table>
18473 Generate timestamps from a "live source" and rebase onto the current timebase:
18474 <table><tr><td> </td><td><pre class="example">setpts='(RTCTIME - RTCSTART) / (TB * 1000000)'
18475 </pre></td></tr></table>
18478 Generate timestamps by counting samples:
18479 <table><tr><td> </td><td><pre class="example">asetpts=N/SR/TB
18480 </pre></td></tr></table>
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>
18487 <p>Set the timebase to use for the output frames timestamps.
18488 It is mainly useful for testing timebase configuration.
18490 <p>This filter accepts the following options:
18492 <dl compact="compact">
18493 <dt> ‘<samp>expr, tb</samp>’</dt>
18494 <dd><p>The expression which is evaluated into the output timebase.
18499 <p>The value for ‘<samp>tb</samp>’ is an arithmetic expression representing a
18500 rational. The expression can contain the constants "AVTB" (the default
18501 timebase), "intb" (the input timebase) and "sr" (the sample rate,
18502 audio only). Default value is "intb".
18504 <a name="Examples-8"></a>
18505 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-8">31.9.1 Examples</a></h3>
18509 Set the timebase to 1/25:
18510 <table><tr><td> </td><td><pre class="example">settb=expr=1/25
18511 </pre></td></tr></table>
18514 Set the timebase to 1/10:
18515 <table><tr><td> </td><td><pre class="example">settb=expr=0.1
18516 </pre></td></tr></table>
18519 Set the timebase to 1001/1000:
18520 <table><tr><td> </td><td><pre class="example">settb=1+0.001
18521 </pre></td></tr></table>
18524 Set the timebase to 2*intb:
18525 <table><tr><td> </td><td><pre class="example">settb=2*intb
18526 </pre></td></tr></table>
18529 Set the default timebase value:
18530 <table><tr><td> </td><td><pre class="example">settb=AVTB
18531 </pre></td></tr></table>
18534 <a name="showspectrum"></a>
18535 <h2 class="section"><a href="ffplay-all.html#toc-showspectrum">31.10 showspectrum</a></h2>
18537 <p>Convert input audio to a video output, representing the audio frequency
18540 <p>The filter accepts the following options:
18542 <dl compact="compact">
18543 <dt> ‘<samp>size, s</samp>’</dt>
18544 <dd><p>Specify the video size for the output. For the syntax of this option, check
18545 the "Video size" section in the ffmpeg-utils manual. Default value is
18546 <code>640x512</code>.
18549 <dt> ‘<samp>slide</samp>’</dt>
18550 <dd><p>Specify if the spectrum should slide along the window. Default value is
18554 <dt> ‘<samp>mode</samp>’</dt>
18555 <dd><p>Specify display mode.
18557 <p>It accepts the following values:
18558 </p><dl compact="compact">
18559 <dt> ‘<samp>combined</samp>’</dt>
18560 <dd><p>all channels are displayed in the same row
18562 <dt> ‘<samp>separate</samp>’</dt>
18563 <dd><p>all channels are displayed in separate rows
18567 <p>Default value is ‘<samp>combined</samp>’.
18570 <dt> ‘<samp>color</samp>’</dt>
18571 <dd><p>Specify display color mode.
18573 <p>It accepts the following values:
18574 </p><dl compact="compact">
18575 <dt> ‘<samp>channel</samp>’</dt>
18576 <dd><p>each channel is displayed in a separate color
18578 <dt> ‘<samp>intensity</samp>’</dt>
18579 <dd><p>each channel is is displayed using the same color scheme
18583 <p>Default value is ‘<samp>channel</samp>’.
18586 <dt> ‘<samp>scale</samp>’</dt>
18587 <dd><p>Specify scale used for calculating intensity color values.
18589 <p>It accepts the following values:
18590 </p><dl compact="compact">
18591 <dt> ‘<samp>lin</samp>’</dt>
18594 <dt> ‘<samp>sqrt</samp>’</dt>
18595 <dd><p>square root, default
18597 <dt> ‘<samp>cbrt</samp>’</dt>
18600 <dt> ‘<samp>log</samp>’</dt>
18605 <p>Default value is ‘<samp>sqrt</samp>’.
18608 <dt> ‘<samp>saturation</samp>’</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>.
18615 <dt> ‘<samp>win_func</samp>’</dt>
18616 <dd><p>Set window function.
18618 <p>It accepts the following values:
18619 </p><dl compact="compact">
18620 <dt> ‘<samp>none</samp>’</dt>
18621 <dd><p>No samples pre-processing (do not expect this to be faster)
18623 <dt> ‘<samp>hann</samp>’</dt>
18626 <dt> ‘<samp>hamming</samp>’</dt>
18627 <dd><p>Hamming window
18629 <dt> ‘<samp>blackman</samp>’</dt>
18630 <dd><p>Blackman window
18634 <p>Default value is <code>hann</code>.
18638 <p>The usage is very similar to the showwaves filter; see the examples in that
18641 <a name="Examples-67"></a>
18642 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-67">31.10.1 Examples</a></h3>
18646 Large window with logarithmic color scaling:
18647 <table><tr><td> </td><td><pre class="example">showspectrum=s=1280x480:scale=log
18648 </pre></td></tr></table>
18651 Complete example for a colored and sliding spectrum per channel using <code>ffplay</code>:
18652 <table><tr><td> </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>
18657 <a name="showwaves"></a>
18658 <h2 class="section"><a href="ffplay-all.html#toc-showwaves">31.11 showwaves</a></h2>
18660 <p>Convert input audio to a video output, representing the samples waves.
18662 <p>The filter accepts the following options:
18664 <dl compact="compact">
18665 <dt> ‘<samp>size, s</samp>’</dt>
18666 <dd><p>Specify the video size for the output. For the syntax of this option, check
18667 the "Video size" section in the ffmpeg-utils manual. Default value
18668 is "600x240".
18671 <dt> ‘<samp>mode</samp>’</dt>
18672 <dd><p>Set display mode.
18674 <p>Available values are:
18675 </p><dl compact="compact">
18676 <dt> ‘<samp>point</samp>’</dt>
18677 <dd><p>Draw a point for each sample.
18680 <dt> ‘<samp>line</samp>’</dt>
18681 <dd><p>Draw a vertical line for each sample.
18685 <p>Default value is <code>point</code>.
18688 <dt> ‘<samp>n</samp>’</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.
18695 <dt> ‘<samp>rate, r</samp>’</dt>
18696 <dd><p>Set the (approximate) output frame rate. This is done by setting the
18697 option <var>n</var>. Default value is "25".
18702 <a name="Examples-83"></a>
18703 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-83">31.11.1 Examples</a></h3>
18707 Output the input file audio and the corresponding video representation
18709 <table><tr><td> </td><td><pre class="example">amovie=a.mp3,asplit[out0],showwaves[out1]
18710 </pre></td></tr></table>
18713 Create a synthetic signal and show it with showwaves, forcing a
18714 frame rate of 30 frames per second:
18715 <table><tr><td> </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>
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>
18722 <p>Split input into several identical outputs.
18724 <p><code>asplit</code> works with audio input, <code>split</code> with video.
18726 <p>The filter accepts a single parameter which specifies the number of outputs. If
18727 unspecified, it defaults to 2.
18729 <a name="Examples-46"></a>
18730 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-46">31.12.1 Examples</a></h3>
18734 Create two separate outputs from the same input:
18735 <table><tr><td> </td><td><pre class="example">[in] split [out0][out1]
18736 </pre></td></tr></table>
18739 To create 3 or more outputs, you need to specify the number of
18741 <table><tr><td> </td><td><pre class="example">[in] asplit=3 [out0][out1][out2]
18742 </pre></td></tr></table>
18745 Create two separate outputs from the same input, one cropped and
18747 <table><tr><td> </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>
18753 Create 5 copies of the input audio with <code>ffmpeg</code>:
18754 <table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT
18755 </pre></td></tr></table>
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>
18761 <p>Receive commands sent through a libzmq client, and forward them to
18762 filters in the filtergraph.
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
18768 <p>To enable these filters you need to install the libzmq library and
18769 headers and configure FFmpeg with <code>--enable-libzmq</code>.
18771 <p>For more information about libzmq see:
18772 <a href="http://www.zeromq.org/">http://www.zeromq.org/</a>
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 ‘<samp>bind_address</samp>’ option.
18778 <p>The received message must be in the form:
18779 </p><table><tr><td> </td><td><pre class="example"><var>TARGET</var> <var>COMMAND</var> [<var>ARG</var>]
18780 </pre></td></tr></table>
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.
18785 <p><var>COMMAND</var> specifies the name of the command for the target filter.
18787 <p><var>ARG</var> is optional and specifies the optional argument list for the
18788 given <var>COMMAND</var>.
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> </td><td><pre class="example"><var>ERROR_CODE</var> <var>ERROR_REASON</var>
18795 </pre></td></tr></table>
18797 <p><var>MESSAGE</var> is optional.
18799 <a name="Examples-31"></a>
18800 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-31">31.13.1 Examples</a></h3>
18802 <p>Look at ‘<tt>tools/zmqsend</tt>’ for an example of a zmq client which can
18803 be used to send commands processed by these filters.
18805 <p>Consider the following filtergraph generated by <code>ffplay</code>
18806 </p><table><tr><td> </td><td><pre class="example">ffplay -dumpgraph 1 -f lavfi "
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 "
18812 </pre></td></tr></table>
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> </td><td><pre class="example">echo Parsed_color_0 c yellow | tools/zmqsend
18817 </pre></td></tr></table>
18819 <p>To change the right side:
18820 </p><table><tr><td> </td><td><pre class="example">echo Parsed_color_1 c pink | tools/zmqsend
18821 </pre></td></tr></table>
18824 <a name="Multimedia-Sources"></a>
18825 <h1 class="chapter"><a href="ffplay-all.html#toc-Multimedia-Sources">32. Multimedia Sources</a></h1>
18827 <p>Below is a description of the currently available multimedia sources.
18829 <a name="amovie"></a>
18830 <h2 class="section"><a href="ffplay-all.html#toc-amovie">32.1 amovie</a></h2>
18832 <p>This is the same as <a href="#movie">movie</a> source, except it selects an audio
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>
18839 <p>Read audio and/or video stream(s) from a movie container.
18841 <p>This filter accepts the following options:
18843 <dl compact="compact">
18844 <dt> ‘<samp>filename</samp>’</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).
18849 <dt> ‘<samp>format_name, f</samp>’</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.
18855 <dt> ‘<samp>seek_point, sp</samp>’</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 "0".
18862 <dt> ‘<samp>streams, s</samp>’</dt>
18863 <dd><p>Specifies the streams to read. Several streams can be specified,
18864 separated by "+". The source will then have as many outputs, in the
18865 same order. The syntax is explained in the “Stream specifiers”
18866 section in the ffmpeg manual. Two special names, "dv" and "da" specify
18867 respectively the default (best suited) video and audio stream. Default
18868 is "dv", or "da" if the filter is called as "amovie".
18871 <dt> ‘<samp>stream_index, si</samp>’</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 "-1". Deprecated. If the filter is called "amovie", it will select
18875 audio instead of video.
18878 <dt> ‘<samp>loop</samp>’</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 "1".
18883 <p>Note that when the movie is looped the source timestamps are not
18884 changed, so it will generate non monotonically increasing timestamps.
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> </td><td><pre class="example">input -----------> deltapts0 --> overlay --> output
18893 movie --> scale--> deltapts1 -------+
18894 </pre></td></tr></table>
18896 <a name="Examples-61"></a>
18897 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-61">32.2.1 Examples</a></h3>
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 "in":
18903 <table><tr><td> </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>
18909 Read from a video4linux2 device, and overlay it on top of the input
18910 labelled as "in":
18911 <table><tr><td> </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>
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 "video" and the audio is
18919 connected to the pad named "audio":
18920 <table><tr><td> </td><td><pre class="example">movie=dvd.vob:s=v:0+#0x81 [video] [audio]
18921 </pre></td></tr></table>
18925 <a name="See-Also"></a>
18926 <h1 class="chapter"><a href="ffplay-all.html#toc-See-Also">33. See Also</a></h1>
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>
18941 <a name="Authors"></a>
18942 <h1 class="chapter"><a href="ffplay-all.html#toc-Authors">34. Authors</a></h1>
18944 <p>The FFmpeg developers.
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>.
18951 <p>Maintainers for the specific components are listed in the file
18952 ‘<tt>MAINTAINERS</tt>’ in the source code tree.
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>