3 <!-- Created on December 14, 2013 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-25" href="#Options-25">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-2" href="#Syntax-2">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-13" href="#Examples-13">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-31" href="#Examples-31">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-9" href="#Options-9">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-ffwavesynth" href="#ffwavesynth">10.1 ffwavesynth</a></li>
80 <li><a name="toc-libcelt" href="#libcelt">10.2 libcelt</a></li>
81 <li><a name="toc-libgsm" href="#libgsm">10.3 libgsm</a></li>
82 <li><a name="toc-libilbc" href="#libilbc">10.4 libilbc</a>
84 <li><a name="toc-Options" href="#Options">10.4.1 Options</a></li>
86 <li><a name="toc-libopencore_002damrnb-1" href="#libopencore_002damrnb-1">10.5 libopencore-amrnb</a></li>
87 <li><a name="toc-libopencore_002damrwb" href="#libopencore_002damrwb">10.6 libopencore-amrwb</a></li>
88 <li><a name="toc-libopus" href="#libopus">10.7 libopus</a></li>
90 <li><a name="toc-Subtitles-Decoders" href="#Subtitles-Decoders">11. Subtitles Decoders</a>
92 <li><a name="toc-dvdsub" href="#dvdsub">11.1 dvdsub</a>
94 <li><a name="toc-Options-24" href="#Options-24">11.1.1 Options</a></li>
96 <li><a name="toc-libzvbi_002dteletext" href="#libzvbi_002dteletext">11.2 libzvbi-teletext</a>
98 <li><a name="toc-Options-7" href="#Options-7">11.2.1 Options</a></li>
102 <li><a name="toc-Encoders" href="#Encoders">12. Encoders</a></li>
103 <li><a name="toc-Audio-Encoders" href="#Audio-Encoders">13. Audio Encoders</a>
105 <li><a name="toc-aac" href="#aac">13.1 aac</a>
107 <li><a name="toc-Options-27" href="#Options-27">13.1.1 Options</a></li>
109 <li><a name="toc-ac3-and-ac3_005ffixed" href="#ac3-and-ac3_005ffixed">13.2 ac3 and ac3_fixed</a>
111 <li><a name="toc-AC_002d3-Metadata" href="#AC_002d3-Metadata">13.2.1 AC-3 Metadata</a>
113 <li><a name="toc-Metadata-Control-Options" href="#Metadata-Control-Options">13.2.1.1 Metadata Control Options</a></li>
114 <li><a name="toc-Downmix-Levels" href="#Downmix-Levels">13.2.1.2 Downmix Levels</a></li>
115 <li><a name="toc-Audio-Production-Information" href="#Audio-Production-Information">13.2.1.3 Audio Production Information</a></li>
116 <li><a name="toc-Other-Metadata-Options" href="#Other-Metadata-Options">13.2.1.4 Other Metadata Options</a></li>
118 <li><a name="toc-Extended-Bitstream-Information" href="#Extended-Bitstream-Information">13.2.2 Extended Bitstream Information</a>
120 <li><a name="toc-Extended-Bitstream-Information-_002d-Part-1" href="#Extended-Bitstream-Information-_002d-Part-1">13.2.2.1 Extended Bitstream Information - Part 1</a></li>
121 <li><a name="toc-Extended-Bitstream-Information-_002d-Part-2" href="#Extended-Bitstream-Information-_002d-Part-2">13.2.2.2 Extended Bitstream Information - Part 2</a></li>
123 <li><a name="toc-Other-AC_002d3-Encoding-Options" href="#Other-AC_002d3-Encoding-Options">13.2.3 Other AC-3 Encoding Options</a></li>
124 <li><a name="toc-Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options" href="#Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options">13.2.4 Floating-Point-Only AC-3 Encoding Options</a></li>
126 <li><a name="toc-libfaac-1" href="#libfaac-1">13.3 libfaac</a>
128 <li><a name="toc-Options-28" href="#Options-28">13.3.1 Options</a></li>
129 <li><a name="toc-Examples-43" href="#Examples-43">13.3.2 Examples</a></li>
131 <li><a name="toc-libfdk_005faac" href="#libfdk_005faac">13.4 libfdk_aac</a>
133 <li><a name="toc-Options-8" href="#Options-8">13.4.1 Options</a></li>
134 <li><a name="toc-Examples-59" href="#Examples-59">13.4.2 Examples</a></li>
136 <li><a name="toc-libmp3lame-1" href="#libmp3lame-1">13.5 libmp3lame</a>
138 <li><a name="toc-Options-17" href="#Options-17">13.5.1 Options</a></li>
140 <li><a name="toc-libopencore_002damrnb" href="#libopencore_002damrnb">13.6 libopencore-amrnb</a>
142 <li><a name="toc-Options-29" href="#Options-29">13.6.1 Options</a></li>
144 <li><a name="toc-libshine-1" href="#libshine-1">13.7 libshine</a>
146 <li><a name="toc-Options-16" href="#Options-16">13.7.1 Options</a></li>
148 <li><a name="toc-libtwolame" href="#libtwolame">13.8 libtwolame</a>
150 <li><a name="toc-Options-22" href="#Options-22">13.8.1 Options</a></li>
152 <li><a name="toc-libvo_002daacenc-1" href="#libvo_002daacenc-1">13.9 libvo-aacenc</a>
154 <li><a name="toc-Options-11" href="#Options-11">13.9.1 Options</a></li>
156 <li><a name="toc-libvo_002damrwbenc" href="#libvo_002damrwbenc">13.10 libvo-amrwbenc</a>
158 <li><a name="toc-Options-23" href="#Options-23">13.10.1 Options</a></li>
160 <li><a name="toc-libopus-1" href="#libopus-1">13.11 libopus</a>
162 <li><a name="toc-Option-Mapping" href="#Option-Mapping">13.11.1 Option Mapping</a></li>
164 <li><a name="toc-libvorbis" href="#libvorbis">13.12 libvorbis</a>
166 <li><a name="toc-Options-32" href="#Options-32">13.12.1 Options</a></li>
168 <li><a name="toc-libwavpack" href="#libwavpack">13.13 libwavpack</a></li>
170 <li><a name="toc-Video-Encoders" href="#Video-Encoders">14. Video Encoders</a>
172 <li><a name="toc-libtheora" href="#libtheora">14.1 libtheora</a>
174 <li><a name="toc-Options-19" href="#Options-19">14.1.1 Options</a></li>
175 <li><a name="toc-Examples-28" href="#Examples-28">14.1.2 Examples</a></li>
177 <li><a name="toc-libvpx" href="#libvpx">14.2 libvpx</a>
179 <li><a name="toc-Options-1" href="#Options-1">14.2.1 Options</a></li>
181 <li><a name="toc-libx264" href="#libx264">14.3 libx264</a>
183 <li><a name="toc-Options-10" href="#Options-10">14.3.1 Options</a></li>
185 <li><a name="toc-libxvid" href="#libxvid">14.4 libxvid</a>
187 <li><a name="toc-Options-14" href="#Options-14">14.4.1 Options</a></li>
189 <li><a name="toc-png" href="#png">14.5 png</a>
191 <li><a name="toc-Private-options" href="#Private-options">14.5.1 Private options</a></li>
193 <li><a name="toc-ProRes" href="#ProRes">14.6 ProRes</a>
195 <li><a name="toc-Private-Options-for-prores_002dks" href="#Private-Options-for-prores_002dks">14.6.1 Private Options for prores-ks</a></li>
196 <li><a name="toc-Speed-considerations" href="#Speed-considerations">14.6.2 Speed considerations</a></li>
200 <li><a name="toc-Bitstream-Filters" href="#Bitstream-Filters">15. Bitstream Filters</a>
202 <li><a name="toc-aac_005fadtstoasc" href="#aac_005fadtstoasc">15.1 aac_adtstoasc</a></li>
203 <li><a name="toc-chomp" href="#chomp">15.2 chomp</a></li>
204 <li><a name="toc-dump_005fextra" href="#dump_005fextra">15.3 dump_extra</a></li>
205 <li><a name="toc-h264_005fmp4toannexb" href="#h264_005fmp4toannexb">15.4 h264_mp4toannexb</a></li>
206 <li><a name="toc-imx_005fdump_005fheader" href="#imx_005fdump_005fheader">15.5 imx_dump_header</a></li>
207 <li><a name="toc-mjpeg2jpeg" href="#mjpeg2jpeg">15.6 mjpeg2jpeg</a></li>
208 <li><a name="toc-mjpega_005fdump_005fheader" href="#mjpega_005fdump_005fheader">15.7 mjpega_dump_header</a></li>
209 <li><a name="toc-movsub" href="#movsub">15.8 movsub</a></li>
210 <li><a name="toc-mp3_005fheader_005fdecompress" href="#mp3_005fheader_005fdecompress">15.9 mp3_header_decompress</a></li>
211 <li><a name="toc-noise-1" href="#noise-1">15.10 noise</a></li>
212 <li><a name="toc-remove_005fextra" href="#remove_005fextra">15.11 remove_extra</a></li>
214 <li><a name="toc-Format-Options" href="#Format-Options">16. Format Options</a>
216 <li><a name="toc-Format-stream-specifiers-1" href="#Format-stream-specifiers-1">16.1 Format stream specifiers</a></li>
218 <li><a name="toc-Demuxers" href="#Demuxers">17. Demuxers</a>
220 <li><a name="toc-applehttp" href="#applehttp">17.1 applehttp</a></li>
221 <li><a name="toc-asf" href="#asf">17.2 asf</a></li>
222 <li><a name="toc-concat-3" href="#concat-3">17.3 concat</a>
224 <li><a name="toc-Syntax-1" href="#Syntax-1">17.3.1 Syntax</a></li>
225 <li><a name="toc-Options-13" href="#Options-13">17.3.2 Options</a></li>
227 <li><a name="toc-flv" href="#flv">17.4 flv</a></li>
228 <li><a name="toc-libgme" href="#libgme">17.5 libgme</a></li>
229 <li><a name="toc-libquvi" href="#libquvi">17.6 libquvi</a></li>
230 <li><a name="toc-image2-2" href="#image2-2">17.7 image2</a>
232 <li><a name="toc-Examples-88" href="#Examples-88">17.7.1 Examples</a></li>
234 <li><a name="toc-mpegts-1" href="#mpegts-1">17.8 mpegts</a></li>
235 <li><a name="toc-rawvideo" href="#rawvideo">17.9 rawvideo</a></li>
236 <li><a name="toc-sbg" href="#sbg">17.10 sbg</a></li>
237 <li><a name="toc-tedcaptions" href="#tedcaptions">17.11 tedcaptions</a></li>
239 <li><a name="toc-Muxers" href="#Muxers">18. Muxers</a>
241 <li><a name="toc-aiff-1" href="#aiff-1">18.1 aiff</a></li>
242 <li><a name="toc-crc-1" href="#crc-1">18.2 crc</a></li>
243 <li><a name="toc-framecrc-1" href="#framecrc-1">18.3 framecrc</a></li>
244 <li><a name="toc-framemd5-1" href="#framemd5-1">18.4 framemd5</a></li>
245 <li><a name="toc-gif-1" href="#gif-1">18.5 gif</a></li>
246 <li><a name="toc-hls-1" href="#hls-1">18.6 hls</a></li>
247 <li><a name="toc-ico-1" href="#ico-1">18.7 ico</a></li>
248 <li><a name="toc-image2-1" href="#image2-1">18.8 image2</a></li>
249 <li><a name="toc-matroska" href="#matroska">18.9 matroska</a></li>
250 <li><a name="toc-md5-1" href="#md5-1">18.10 md5</a></li>
251 <li><a name="toc-mov_002fmp4_002fismv" href="#mov_002fmp4_002fismv">18.11 mov/mp4/ismv</a></li>
252 <li><a name="toc-mp3" href="#mp3">18.12 mp3</a></li>
253 <li><a name="toc-mpegts" href="#mpegts">18.13 mpegts</a></li>
254 <li><a name="toc-null-1" href="#null-1">18.14 null</a></li>
255 <li><a name="toc-ogg" href="#ogg">18.15 ogg</a></li>
256 <li><a name="toc-segment_002c-stream_005fsegment_002c-ssegment" href="#segment_002c-stream_005fsegment_002c-ssegment">18.16 segment, stream_segment, ssegment</a>
258 <li><a name="toc-Examples-81" href="#Examples-81">18.16.1 Examples</a></li>
260 <li><a name="toc-tee" href="#tee">18.17 tee</a></li>
262 <li><a name="toc-Metadata" href="#Metadata">19. Metadata</a></li>
263 <li><a name="toc-Protocols" href="#Protocols">20. Protocols</a>
265 <li><a name="toc-bluray" href="#bluray">20.1 bluray</a></li>
266 <li><a name="toc-cache" href="#cache">20.2 cache</a></li>
267 <li><a name="toc-concat-1" href="#concat-1">20.3 concat</a></li>
268 <li><a name="toc-crypto" href="#crypto">20.4 crypto</a></li>
269 <li><a name="toc-data" href="#data">20.5 data</a></li>
270 <li><a name="toc-file" href="#file">20.6 file</a></li>
271 <li><a name="toc-ftp" href="#ftp">20.7 ftp</a></li>
272 <li><a name="toc-gopher" href="#gopher">20.8 gopher</a></li>
273 <li><a name="toc-hls-2" href="#hls-2">20.9 hls</a></li>
274 <li><a name="toc-http" href="#http">20.10 http</a>
276 <li><a name="toc-HTTP-Cookies" href="#HTTP-Cookies">20.10.1 HTTP Cookies</a></li>
278 <li><a name="toc-mmst" href="#mmst">20.11 mmst</a></li>
279 <li><a name="toc-mmsh" href="#mmsh">20.12 mmsh</a></li>
280 <li><a name="toc-md5-2" href="#md5-2">20.13 md5</a></li>
281 <li><a name="toc-pipe" href="#pipe">20.14 pipe</a></li>
282 <li><a name="toc-rtmp" href="#rtmp">20.15 rtmp</a></li>
283 <li><a name="toc-rtmpe" href="#rtmpe">20.16 rtmpe</a></li>
284 <li><a name="toc-rtmps" href="#rtmps">20.17 rtmps</a></li>
285 <li><a name="toc-rtmpt" href="#rtmpt">20.18 rtmpt</a></li>
286 <li><a name="toc-rtmpte" href="#rtmpte">20.19 rtmpte</a></li>
287 <li><a name="toc-rtmpts" href="#rtmpts">20.20 rtmpts</a></li>
288 <li><a name="toc-libssh" href="#libssh">20.21 libssh</a></li>
289 <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">20.22 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></li>
290 <li><a name="toc-rtp" href="#rtp">20.23 rtp</a></li>
291 <li><a name="toc-rtsp" href="#rtsp">20.24 rtsp</a></li>
292 <li><a name="toc-sap" href="#sap">20.25 sap</a>
294 <li><a name="toc-Muxer" href="#Muxer">20.25.1 Muxer</a></li>
295 <li><a name="toc-Demuxer" href="#Demuxer">20.25.2 Demuxer</a></li>
297 <li><a name="toc-sctp" href="#sctp">20.26 sctp</a></li>
298 <li><a name="toc-srtp" href="#srtp">20.27 srtp</a></li>
299 <li><a name="toc-tcp" href="#tcp">20.28 tcp</a></li>
300 <li><a name="toc-tls" href="#tls">20.29 tls</a></li>
301 <li><a name="toc-udp" href="#udp">20.30 udp</a></li>
302 <li><a name="toc-unix" href="#unix">20.31 unix</a></li>
304 <li><a name="toc-Device-Options" href="#Device-Options">21. Device Options</a></li>
305 <li><a name="toc-Input-Devices" href="#Input-Devices">22. Input Devices</a>
307 <li><a name="toc-alsa-1" href="#alsa-1">22.1 alsa</a></li>
308 <li><a name="toc-bktr" href="#bktr">22.2 bktr</a></li>
309 <li><a name="toc-dshow" href="#dshow">22.3 dshow</a>
311 <li><a name="toc-Options-18" href="#Options-18">22.3.1 Options</a></li>
312 <li><a name="toc-Examples-71" href="#Examples-71">22.3.2 Examples</a></li>
314 <li><a name="toc-dv1394" href="#dv1394">22.4 dv1394</a></li>
315 <li><a name="toc-fbdev-1" href="#fbdev-1">22.5 fbdev</a></li>
316 <li><a name="toc-iec61883" href="#iec61883">22.6 iec61883</a>
318 <li><a name="toc-Options-5" href="#Options-5">22.6.1 Options</a></li>
319 <li><a name="toc-Examples-37" href="#Examples-37">22.6.2 Examples</a></li>
321 <li><a name="toc-jack" href="#jack">22.7 jack</a></li>
322 <li><a name="toc-lavfi" href="#lavfi">22.8 lavfi</a>
324 <li><a name="toc-Options-31" href="#Options-31">22.8.1 Options</a></li>
325 <li><a name="toc-Examples-87" href="#Examples-87">22.8.2 Examples</a></li>
327 <li><a name="toc-libdc1394" href="#libdc1394">22.9 libdc1394</a></li>
328 <li><a name="toc-openal" href="#openal">22.10 openal</a>
330 <li><a name="toc-Options-26" href="#Options-26">22.10.1 Options</a></li>
331 <li><a name="toc-Examples-74" href="#Examples-74">22.10.2 Examples</a></li>
333 <li><a name="toc-oss" href="#oss">22.11 oss</a></li>
334 <li><a name="toc-pulse-1" href="#pulse-1">22.12 pulse</a>
336 <li><a name="toc-Options-30" href="#Options-30">22.12.1 Options</a></li>
337 <li><a name="toc-Examples-49" href="#Examples-49">22.12.2 Examples</a></li>
339 <li><a name="toc-sndio-1" href="#sndio-1">22.13 sndio</a></li>
340 <li><a name="toc-video4linux2_002c-v4l2" href="#video4linux2_002c-v4l2">22.14 video4linux2, v4l2</a>
342 <li><a name="toc-Options-2" href="#Options-2">22.14.1 Options</a></li>
344 <li><a name="toc-vfwcap" href="#vfwcap">22.15 vfwcap</a></li>
345 <li><a name="toc-x11grab" href="#x11grab">22.16 x11grab</a>
347 <li><a name="toc-Options-20" href="#Options-20">22.16.1 Options</a></li>
351 <li><a name="toc-Output-Devices" href="#Output-Devices">23. Output Devices</a>
353 <li><a name="toc-alsa" href="#alsa">23.1 alsa</a>
355 <li><a name="toc-Examples-33" href="#Examples-33">23.1.1 Examples</a></li>
357 <li><a name="toc-caca" href="#caca">23.2 caca</a>
359 <li><a name="toc-Options-4" href="#Options-4">23.2.1 Options</a></li>
360 <li><a name="toc-Examples-56" href="#Examples-56">23.2.2 Examples</a></li>
362 <li><a name="toc-fbdev" href="#fbdev">23.3 fbdev</a>
364 <li><a name="toc-Options-15" href="#Options-15">23.3.1 Options</a></li>
365 <li><a name="toc-Examples-66" href="#Examples-66">23.3.2 Examples</a></li>
367 <li><a name="toc-oss-1" href="#oss-1">23.4 oss</a></li>
368 <li><a name="toc-pulse" href="#pulse">23.5 pulse</a>
370 <li><a name="toc-Options-6" href="#Options-6">23.5.1 Options</a></li>
371 <li><a name="toc-Examples-23" href="#Examples-23">23.5.2 Examples</a></li>
373 <li><a name="toc-sdl" href="#sdl">23.6 sdl</a>
375 <li><a name="toc-Options-12" href="#Options-12">23.6.1 Options</a></li>
376 <li><a name="toc-Interactive-commands" href="#Interactive-commands">23.6.2 Interactive commands</a></li>
377 <li><a name="toc-Examples-82" href="#Examples-82">23.6.3 Examples</a></li>
379 <li><a name="toc-sndio" href="#sndio">23.7 sndio</a></li>
380 <li><a name="toc-xv" href="#xv">23.8 xv</a>
382 <li><a name="toc-Options-3" href="#Options-3">23.8.1 Options</a></li>
383 <li><a name="toc-Examples-48" href="#Examples-48">23.8.2 Examples</a></li>
387 <li><a name="toc-Resampler-Options" href="#Resampler-Options">24. Resampler Options</a></li>
388 <li><a name="toc-Scaler-Options" href="#Scaler-Options">25. Scaler Options</a></li>
389 <li><a name="toc-Filtering-Introduction" href="#Filtering-Introduction">26. Filtering Introduction</a></li>
390 <li><a name="toc-graph2dot" href="#graph2dot">27. graph2dot</a></li>
391 <li><a name="toc-Filtergraph-description" href="#Filtergraph-description">28. Filtergraph description</a>
393 <li><a name="toc-Filtergraph-syntax-1" href="#Filtergraph-syntax-1">28.1 Filtergraph syntax</a></li>
394 <li><a name="toc-Notes-on-filtergraph-escaping" href="#Notes-on-filtergraph-escaping">28.2 Notes on filtergraph escaping</a></li>
396 <li><a name="toc-Timeline-editing" href="#Timeline-editing">29. Timeline editing</a></li>
397 <li><a name="toc-Audio-Filters" href="#Audio-Filters">30. Audio Filters</a>
399 <li><a name="toc-aconvert" href="#aconvert">30.1 aconvert</a>
401 <li><a name="toc-Examples-47" href="#Examples-47">30.1.1 Examples</a></li>
403 <li><a name="toc-adelay" href="#adelay">30.2 adelay</a>
405 <li><a name="toc-Examples-41" href="#Examples-41">30.2.1 Examples</a></li>
407 <li><a name="toc-aecho" href="#aecho">30.3 aecho</a>
409 <li><a name="toc-Examples-19" href="#Examples-19">30.3.1 Examples</a></li>
411 <li><a name="toc-aeval" href="#aeval">30.4 aeval</a>
413 <li><a name="toc-Examples-34" href="#Examples-34">30.4.1 Examples</a></li>
415 <li><a name="toc-afade" href="#afade">30.5 afade</a>
417 <li><a name="toc-Examples-24" href="#Examples-24">30.5.1 Examples</a></li>
419 <li><a name="toc-aformat-1" href="#aformat-1">30.6 aformat</a></li>
420 <li><a name="toc-allpass" href="#allpass">30.7 allpass</a></li>
421 <li><a name="toc-amerge" href="#amerge">30.8 amerge</a>
423 <li><a name="toc-Examples-62" href="#Examples-62">30.8.1 Examples</a></li>
425 <li><a name="toc-amix" href="#amix">30.9 amix</a></li>
426 <li><a name="toc-anull" href="#anull">30.10 anull</a></li>
427 <li><a name="toc-apad" href="#apad">30.11 apad</a></li>
428 <li><a name="toc-aphaser" href="#aphaser">30.12 aphaser</a></li>
429 <li><a name="toc-aresample-1" href="#aresample-1">30.13 aresample</a>
431 <li><a name="toc-Examples-22" href="#Examples-22">30.13.1 Examples</a></li>
433 <li><a name="toc-asetnsamples" href="#asetnsamples">30.14 asetnsamples</a></li>
434 <li><a name="toc-asetrate" href="#asetrate">30.15 asetrate</a></li>
435 <li><a name="toc-ashowinfo" href="#ashowinfo">30.16 ashowinfo</a></li>
436 <li><a name="toc-astats" href="#astats">30.17 astats</a></li>
437 <li><a name="toc-astreamsync" href="#astreamsync">30.18 astreamsync</a>
439 <li><a name="toc-Examples-46" href="#Examples-46">30.18.1 Examples</a></li>
441 <li><a name="toc-asyncts" href="#asyncts">30.19 asyncts</a></li>
442 <li><a name="toc-atempo" href="#atempo">30.20 atempo</a>
444 <li><a name="toc-Examples-60" href="#Examples-60">30.20.1 Examples</a></li>
446 <li><a name="toc-atrim" href="#atrim">30.21 atrim</a></li>
447 <li><a name="toc-bandpass" href="#bandpass">30.22 bandpass</a></li>
448 <li><a name="toc-bandreject" href="#bandreject">30.23 bandreject</a></li>
449 <li><a name="toc-bass" href="#bass">30.24 bass</a></li>
450 <li><a name="toc-biquad" href="#biquad">30.25 biquad</a></li>
451 <li><a name="toc-channelmap" href="#channelmap">30.26 channelmap</a></li>
452 <li><a name="toc-channelsplit" href="#channelsplit">30.27 channelsplit</a></li>
453 <li><a name="toc-compand" href="#compand">30.28 compand</a>
455 <li><a name="toc-Examples-15" href="#Examples-15">30.28.1 Examples</a></li>
457 <li><a name="toc-earwax" href="#earwax">30.29 earwax</a></li>
458 <li><a name="toc-equalizer" href="#equalizer">30.30 equalizer</a></li>
459 <li><a name="toc-highpass" href="#highpass">30.31 highpass</a></li>
460 <li><a name="toc-join" href="#join">30.32 join</a></li>
461 <li><a name="toc-ladspa" href="#ladspa">30.33 ladspa</a>
463 <li><a name="toc-Examples-9" href="#Examples-9">30.33.1 Examples</a></li>
464 <li><a name="toc-Commands-3" href="#Commands-3">30.33.2 Commands</a></li>
466 <li><a name="toc-lowpass" href="#lowpass">30.34 lowpass</a></li>
467 <li><a name="toc-pan" href="#pan">30.35 pan</a>
469 <li><a name="toc-Mixing-examples" href="#Mixing-examples">30.35.1 Mixing examples</a></li>
470 <li><a name="toc-Remapping-examples" href="#Remapping-examples">30.35.2 Remapping examples</a></li>
472 <li><a name="toc-replaygain" href="#replaygain">30.36 replaygain</a></li>
473 <li><a name="toc-resample" href="#resample">30.37 resample</a></li>
474 <li><a name="toc-silencedetect" href="#silencedetect">30.38 silencedetect</a>
476 <li><a name="toc-Examples-64" href="#Examples-64">30.38.1 Examples</a></li>
478 <li><a name="toc-treble" href="#treble">30.39 treble</a></li>
479 <li><a name="toc-volume" href="#volume">30.40 volume</a>
481 <li><a name="toc-Examples-80" href="#Examples-80">30.40.1 Examples</a></li>
483 <li><a name="toc-volumedetect" href="#volumedetect">30.41 volumedetect</a>
485 <li><a name="toc-Examples-55" href="#Examples-55">30.41.1 Examples</a></li>
489 <li><a name="toc-Audio-Sources" href="#Audio-Sources">31. Audio Sources</a>
491 <li><a name="toc-abuffer" href="#abuffer">31.1 abuffer</a>
493 <li><a name="toc-Examples-27" href="#Examples-27">31.1.1 Examples</a></li>
495 <li><a name="toc-aevalsrc" href="#aevalsrc">31.2 aevalsrc</a>
497 <li><a name="toc-Examples-78" href="#Examples-78">31.2.1 Examples</a></li>
499 <li><a name="toc-anullsrc" href="#anullsrc">31.3 anullsrc</a>
501 <li><a name="toc-Examples-84" href="#Examples-84">31.3.1 Examples</a></li>
503 <li><a name="toc-flite" href="#flite">31.4 flite</a>
505 <li><a name="toc-Examples-85" href="#Examples-85">31.4.1 Examples</a></li>
507 <li><a name="toc-sine" href="#sine">31.5 sine</a>
509 <li><a name="toc-Examples-32" href="#Examples-32">31.5.1 Examples</a></li>
513 <li><a name="toc-Audio-Sinks" href="#Audio-Sinks">32. Audio Sinks</a>
515 <li><a name="toc-abuffersink" href="#abuffersink">32.1 abuffersink</a></li>
516 <li><a name="toc-anullsink" href="#anullsink">32.2 anullsink</a></li>
518 <li><a name="toc-Video-Filters" href="#Video-Filters">33. Video Filters</a>
520 <li><a name="toc-alphaextract" href="#alphaextract">33.1 alphaextract</a></li>
521 <li><a name="toc-alphamerge" href="#alphamerge">33.2 alphamerge</a></li>
522 <li><a name="toc-ass" href="#ass">33.3 ass</a></li>
523 <li><a name="toc-bbox" href="#bbox">33.4 bbox</a></li>
524 <li><a name="toc-blackdetect" href="#blackdetect">33.5 blackdetect</a></li>
525 <li><a name="toc-blackframe" href="#blackframe">33.6 blackframe</a></li>
526 <li><a name="toc-blend" href="#blend">33.7 blend</a>
528 <li><a name="toc-Examples-54" href="#Examples-54">33.7.1 Examples</a></li>
530 <li><a name="toc-boxblur" href="#boxblur">33.8 boxblur</a>
532 <li><a name="toc-Examples-4" href="#Examples-4">33.8.1 Examples</a></li>
534 <li><a name="toc-colorbalance" href="#colorbalance">33.9 colorbalance</a>
536 <li><a name="toc-Examples-89" href="#Examples-89">33.9.1 Examples</a></li>
538 <li><a name="toc-colorchannelmixer" href="#colorchannelmixer">33.10 colorchannelmixer</a>
540 <li><a name="toc-Examples-65" href="#Examples-65">33.10.1 Examples</a></li>
542 <li><a name="toc-colormatrix" href="#colormatrix">33.11 colormatrix</a></li>
543 <li><a name="toc-copy" href="#copy">33.12 copy</a></li>
544 <li><a name="toc-crop" href="#crop">33.13 crop</a>
546 <li><a name="toc-Examples-8" href="#Examples-8">33.13.1 Examples</a></li>
548 <li><a name="toc-cropdetect" href="#cropdetect">33.14 cropdetect</a></li>
549 <li><a name="toc-curves-1" href="#curves-1">33.15 curves</a>
551 <li><a name="toc-Examples-75" href="#Examples-75">33.15.1 Examples</a></li>
553 <li><a name="toc-dctdnoiz" href="#dctdnoiz">33.16 dctdnoiz</a>
555 <li><a name="toc-Examples-20" href="#Examples-20">33.16.1 Examples</a></li>
557 <li><a name="toc-decimate-1" href="#decimate-1">33.17 decimate</a></li>
558 <li><a name="toc-delogo" href="#delogo">33.18 delogo</a>
560 <li><a name="toc-Examples-44" href="#Examples-44">33.18.1 Examples</a></li>
562 <li><a name="toc-deshake" href="#deshake">33.19 deshake</a></li>
563 <li><a name="toc-drawbox" href="#drawbox">33.20 drawbox</a>
565 <li><a name="toc-Examples-86" href="#Examples-86">33.20.1 Examples</a></li>
567 <li><a name="toc-drawgrid" href="#drawgrid">33.21 drawgrid</a>
569 <li><a name="toc-Examples-36" href="#Examples-36">33.21.1 Examples</a></li>
571 <li><a name="toc-drawtext-1" href="#drawtext-1">33.22 drawtext</a>
573 <li><a name="toc-Syntax" href="#Syntax">33.22.1 Syntax</a></li>
574 <li><a name="toc-Text-expansion" href="#Text-expansion">33.22.2 Text expansion</a></li>
575 <li><a name="toc-Examples-58" href="#Examples-58">33.22.3 Examples</a></li>
577 <li><a name="toc-edgedetect" href="#edgedetect">33.23 edgedetect</a></li>
578 <li><a name="toc-extractplanes" href="#extractplanes">33.24 extractplanes</a>
580 <li><a name="toc-Examples-70" href="#Examples-70">33.24.1 Examples</a></li>
582 <li><a name="toc-elbg" href="#elbg">33.25 elbg</a></li>
583 <li><a name="toc-fade" href="#fade">33.26 fade</a>
585 <li><a name="toc-Examples-3" href="#Examples-3">33.26.1 Examples</a></li>
587 <li><a name="toc-field" href="#field">33.27 field</a></li>
588 <li><a name="toc-fieldmatch" href="#fieldmatch">33.28 fieldmatch</a>
590 <li><a name="toc-p_002fc_002fn_002fu_002fb-meaning-1" href="#p_002fc_002fn_002fu_002fb-meaning-1">33.28.1 p/c/n/u/b meaning</a>
592 <li><a name="toc-p_002fc_002fn" href="#p_002fc_002fn">33.28.1.1 p/c/n</a></li>
593 <li><a name="toc-u_002fb" href="#u_002fb">33.28.1.2 u/b</a></li>
595 <li><a name="toc-Examples-52" href="#Examples-52">33.28.2 Examples</a></li>
597 <li><a name="toc-fieldorder" href="#fieldorder">33.29 fieldorder</a></li>
598 <li><a name="toc-fifo" href="#fifo">33.30 fifo</a></li>
599 <li><a name="toc-format-1" href="#format-1">33.31 format</a>
601 <li><a name="toc-Examples-57" href="#Examples-57">33.31.1 Examples</a></li>
603 <li><a name="toc-fps-1" href="#fps-1">33.32 fps</a>
605 <li><a name="toc-Examples-25" href="#Examples-25">33.32.1 Examples</a></li>
607 <li><a name="toc-framestep" href="#framestep">33.33 framestep</a></li>
608 <li><a name="toc-frei0r-1" href="#frei0r-1">33.34 frei0r</a>
610 <li><a name="toc-Examples-12" href="#Examples-12">33.34.1 Examples</a></li>
612 <li><a name="toc-geq" href="#geq">33.35 geq</a>
614 <li><a name="toc-Examples-79" href="#Examples-79">33.35.1 Examples</a></li>
616 <li><a name="toc-gradfun" href="#gradfun">33.36 gradfun</a>
618 <li><a name="toc-Examples-72" href="#Examples-72">33.36.1 Examples</a></li>
620 <li><a name="toc-haldclut-1" href="#haldclut-1">33.37 haldclut</a>
622 <li><a name="toc-Workflow-examples" href="#Workflow-examples">33.37.1 Workflow examples</a>
624 <li><a name="toc-Hald-CLUT-video-stream" href="#Hald-CLUT-video-stream">33.37.1.1 Hald CLUT video stream</a></li>
625 <li><a name="toc-Hald-CLUT-with-preview" href="#Hald-CLUT-with-preview">33.37.1.2 Hald CLUT with preview</a></li>
629 <li><a name="toc-hflip" href="#hflip">33.38 hflip</a></li>
630 <li><a name="toc-histeq" href="#histeq">33.39 histeq</a></li>
631 <li><a name="toc-histogram" href="#histogram">33.40 histogram</a>
633 <li><a name="toc-Examples-16" href="#Examples-16">33.40.1 Examples</a></li>
635 <li><a name="toc-hqdn3d-1" href="#hqdn3d-1">33.41 hqdn3d</a></li>
636 <li><a name="toc-hue" href="#hue">33.42 hue</a>
638 <li><a name="toc-Examples-51" href="#Examples-51">33.42.1 Examples</a></li>
639 <li><a name="toc-Commands" href="#Commands">33.42.2 Commands</a></li>
641 <li><a name="toc-idet" href="#idet">33.43 idet</a></li>
642 <li><a name="toc-il" href="#il">33.44 il</a></li>
643 <li><a name="toc-interlace" href="#interlace">33.45 interlace</a></li>
644 <li><a name="toc-kerndeint" href="#kerndeint">33.46 kerndeint</a>
646 <li><a name="toc-Examples-50" href="#Examples-50">33.46.1 Examples</a></li>
648 <li><a name="toc-lut3d-1" href="#lut3d-1">33.47 lut3d</a></li>
649 <li><a name="toc-lut_002c-lutrgb_002c-lutyuv" href="#lut_002c-lutrgb_002c-lutyuv">33.48 lut, lutrgb, lutyuv</a>
651 <li><a name="toc-Examples-14" href="#Examples-14">33.48.1 Examples</a></li>
653 <li><a name="toc-mergeplanes" href="#mergeplanes">33.49 mergeplanes</a>
655 <li><a name="toc-Examples-67" href="#Examples-67">33.49.1 Examples</a></li>
657 <li><a name="toc-mcdeint" href="#mcdeint">33.50 mcdeint</a></li>
658 <li><a name="toc-mp" href="#mp">33.51 mp</a>
660 <li><a name="toc-Examples-7" href="#Examples-7">33.51.1 Examples</a></li>
662 <li><a name="toc-mpdecimate" href="#mpdecimate">33.52 mpdecimate</a></li>
663 <li><a name="toc-negate" href="#negate">33.53 negate</a></li>
664 <li><a name="toc-noformat" href="#noformat">33.54 noformat</a>
666 <li><a name="toc-Examples-53" href="#Examples-53">33.54.1 Examples</a></li>
668 <li><a name="toc-noise" href="#noise">33.55 noise</a>
670 <li><a name="toc-Examples-17" href="#Examples-17">33.55.1 Examples</a></li>
672 <li><a name="toc-null" href="#null">33.56 null</a></li>
673 <li><a name="toc-ocv" href="#ocv">33.57 ocv</a>
675 <li><a name="toc-dilate-1" href="#dilate-1">33.57.1 dilate</a></li>
676 <li><a name="toc-erode" href="#erode">33.57.2 erode</a></li>
677 <li><a name="toc-smooth" href="#smooth">33.57.3 smooth</a></li>
679 <li><a name="toc-overlay-1" href="#overlay-1">33.58 overlay</a>
681 <li><a name="toc-Commands-2" href="#Commands-2">33.58.1 Commands</a></li>
682 <li><a name="toc-Examples-73" href="#Examples-73">33.58.2 Examples</a></li>
684 <li><a name="toc-owdenoise" href="#owdenoise">33.59 owdenoise</a></li>
685 <li><a name="toc-pad" href="#pad">33.60 pad</a>
687 <li><a name="toc-Examples-63" href="#Examples-63">33.60.1 Examples</a></li>
689 <li><a name="toc-perspective" href="#perspective">33.61 perspective</a></li>
690 <li><a name="toc-phase" href="#phase">33.62 phase</a></li>
691 <li><a name="toc-pixdesctest" href="#pixdesctest">33.63 pixdesctest</a></li>
692 <li><a name="toc-pp" href="#pp">33.64 pp</a>
694 <li><a name="toc-Examples-26" href="#Examples-26">33.64.1 Examples</a></li>
696 <li><a name="toc-psnr" href="#psnr">33.65 psnr</a></li>
697 <li><a name="toc-pullup" href="#pullup">33.66 pullup</a></li>
698 <li><a name="toc-removelogo" href="#removelogo">33.67 removelogo</a></li>
699 <li><a name="toc-rotate" href="#rotate">33.68 rotate</a>
701 <li><a name="toc-Examples-61" href="#Examples-61">33.68.1 Examples</a></li>
702 <li><a name="toc-Commands-1" href="#Commands-1">33.68.2 Commands</a></li>
704 <li><a name="toc-sab" href="#sab">33.69 sab</a></li>
705 <li><a name="toc-scale-1" href="#scale-1">33.70 scale</a>
707 <li><a name="toc-Options-21" href="#Options-21">33.70.1 Options</a></li>
708 <li><a name="toc-Examples-1" href="#Examples-1">33.70.2 Examples</a></li>
710 <li><a name="toc-separatefields" href="#separatefields">33.71 separatefields</a></li>
711 <li><a name="toc-setdar_002c-setsar" href="#setdar_002c-setsar">33.72 setdar, setsar</a>
713 <li><a name="toc-Examples-91" href="#Examples-91">33.72.1 Examples</a></li>
715 <li><a name="toc-setfield-1" href="#setfield-1">33.73 setfield</a></li>
716 <li><a name="toc-showinfo" href="#showinfo">33.74 showinfo</a></li>
717 <li><a name="toc-smartblur-1" href="#smartblur-1">33.75 smartblur</a></li>
718 <li><a name="toc-stereo3d" href="#stereo3d">33.76 stereo3d</a>
720 <li><a name="toc-Examples-77" href="#Examples-77">33.76.1 Examples</a></li>
722 <li><a name="toc-spp" href="#spp">33.77 spp</a></li>
723 <li><a name="toc-subtitles-1" href="#subtitles-1">33.78 subtitles</a></li>
724 <li><a name="toc-super2xsai" href="#super2xsai">33.79 super2xsai</a></li>
725 <li><a name="toc-swapuv" href="#swapuv">33.80 swapuv</a></li>
726 <li><a name="toc-telecine" href="#telecine">33.81 telecine</a></li>
727 <li><a name="toc-thumbnail" href="#thumbnail">33.82 thumbnail</a>
729 <li><a name="toc-Examples-30" href="#Examples-30">33.82.1 Examples</a></li>
731 <li><a name="toc-tile" href="#tile">33.83 tile</a>
733 <li><a name="toc-Examples-11" href="#Examples-11">33.83.1 Examples</a></li>
735 <li><a name="toc-tinterlace" href="#tinterlace">33.84 tinterlace</a></li>
736 <li><a name="toc-transpose" href="#transpose">33.85 transpose</a></li>
737 <li><a name="toc-trim" href="#trim">33.86 trim</a></li>
738 <li><a name="toc-unsharp" href="#unsharp">33.87 unsharp</a>
740 <li><a name="toc-Examples-6" href="#Examples-6">33.87.1 Examples</a></li>
742 <li><a name="toc-vidstabdetect-1" href="#vidstabdetect-1">33.88 vidstabdetect</a>
744 <li><a name="toc-Examples-5" href="#Examples-5">33.88.1 Examples</a></li>
746 <li><a name="toc-vidstabtransform-1" href="#vidstabtransform-1">33.89 vidstabtransform</a>
748 <li><a name="toc-Examples-10" href="#Examples-10">33.89.1 Examples</a></li>
750 <li><a name="toc-vflip" href="#vflip">33.90 vflip</a></li>
751 <li><a name="toc-vignette" href="#vignette">33.91 vignette</a>
753 <li><a name="toc-Expressions" href="#Expressions">33.91.1 Expressions</a></li>
754 <li><a name="toc-Examples-45" href="#Examples-45">33.91.2 Examples</a></li>
756 <li><a name="toc-w3fdif" href="#w3fdif">33.92 w3fdif</a></li>
757 <li><a name="toc-yadif-1" href="#yadif-1">33.93 yadif</a></li>
759 <li><a name="toc-Video-Sources" href="#Video-Sources">34. Video Sources</a>
761 <li><a name="toc-buffer" href="#buffer">34.1 buffer</a></li>
762 <li><a name="toc-cellauto" href="#cellauto">34.2 cellauto</a>
764 <li><a name="toc-Examples-38" href="#Examples-38">34.2.1 Examples</a></li>
766 <li><a name="toc-mandelbrot" href="#mandelbrot">34.3 mandelbrot</a></li>
767 <li><a name="toc-mptestsrc" href="#mptestsrc">34.4 mptestsrc</a></li>
768 <li><a name="toc-frei0r_005fsrc" href="#frei0r_005fsrc">34.5 frei0r_src</a></li>
769 <li><a name="toc-life" href="#life">34.6 life</a>
771 <li><a name="toc-Examples-21" href="#Examples-21">34.6.1 Examples</a></li>
773 <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">34.7 color, haldclutsrc, nullsrc, rgbtestsrc, smptebars, smptehdbars, testsrc</a>
775 <li><a name="toc-Commands-4" href="#Commands-4">34.7.1 Commands</a></li>
779 <li><a name="toc-Video-Sinks" href="#Video-Sinks">35. Video Sinks</a>
781 <li><a name="toc-buffersink" href="#buffersink">35.1 buffersink</a></li>
782 <li><a name="toc-nullsink" href="#nullsink">35.2 nullsink</a></li>
784 <li><a name="toc-Multimedia-Filters" href="#Multimedia-Filters">36. Multimedia Filters</a>
786 <li><a name="toc-avectorscope" href="#avectorscope">36.1 avectorscope</a>
788 <li><a name="toc-Examples" href="#Examples">36.1.1 Examples</a></li>
790 <li><a name="toc-concat-2" href="#concat-2">36.2 concat</a>
792 <li><a name="toc-Examples-40" href="#Examples-40">36.2.1 Examples</a></li>
794 <li><a name="toc-ebur128" href="#ebur128">36.3 ebur128</a>
796 <li><a name="toc-Examples-18" href="#Examples-18">36.3.1 Examples</a></li>
798 <li><a name="toc-interleave_002c-ainterleave" href="#interleave_002c-ainterleave">36.4 interleave, ainterleave</a>
800 <li><a name="toc-Examples-35" href="#Examples-35">36.4.1 Examples</a></li>
802 <li><a name="toc-perms_002c-aperms" href="#perms_002c-aperms">36.5 perms, aperms</a></li>
803 <li><a name="toc-select_002c-aselect" href="#select_002c-aselect">36.6 select, aselect</a>
805 <li><a name="toc-Examples-76" href="#Examples-76">36.6.1 Examples</a></li>
807 <li><a name="toc-sendcmd_002c-asendcmd" href="#sendcmd_002c-asendcmd">36.7 sendcmd, asendcmd</a>
809 <li><a name="toc-Commands-syntax" href="#Commands-syntax">36.7.1 Commands syntax</a></li>
810 <li><a name="toc-Examples-39" href="#Examples-39">36.7.2 Examples</a></li>
812 <li><a name="toc-setpts_002c-asetpts" href="#setpts_002c-asetpts">36.8 setpts, asetpts</a>
814 <li><a name="toc-Examples-42" href="#Examples-42">36.8.1 Examples</a></li>
816 <li><a name="toc-settb_002c-asettb" href="#settb_002c-asettb">36.9 settb, asettb</a>
818 <li><a name="toc-Examples-68" href="#Examples-68">36.9.1 Examples</a></li>
820 <li><a name="toc-showspectrum" href="#showspectrum">36.10 showspectrum</a>
822 <li><a name="toc-Examples-2" href="#Examples-2">36.10.1 Examples</a></li>
824 <li><a name="toc-showwaves" href="#showwaves">36.11 showwaves</a>
826 <li><a name="toc-Examples-90" href="#Examples-90">36.11.1 Examples</a></li>
828 <li><a name="toc-split_002c-asplit" href="#split_002c-asplit">36.12 split, asplit</a>
830 <li><a name="toc-Examples-83" href="#Examples-83">36.12.1 Examples</a></li>
832 <li><a name="toc-zmq_002c-azmq" href="#zmq_002c-azmq">36.13 zmq, azmq</a>
834 <li><a name="toc-Examples-29" href="#Examples-29">36.13.1 Examples</a></li>
838 <li><a name="toc-Multimedia-Sources" href="#Multimedia-Sources">37. Multimedia Sources</a>
840 <li><a name="toc-amovie" href="#amovie">37.1 amovie</a></li>
841 <li><a name="toc-movie-1" href="#movie-1">37.2 movie</a>
843 <li><a name="toc-Examples-69" href="#Examples-69">37.2.1 Examples</a></li>
847 <li><a name="toc-See-Also" href="#See-Also">38. See Also</a></li>
848 <li><a name="toc-Authors" href="#Authors">39. Authors</a></li>
852 <a name="Synopsis"></a>
853 <h1 class="chapter"><a href="ffplay-all.html#toc-Synopsis">1. Synopsis</a></h1>
855 <p>ffplay [<var>options</var>] [‘<tt>input_file</tt>’]
857 <a name="Description"></a>
858 <h1 class="chapter"><a href="ffplay-all.html#toc-Description">2. Description</a></h1>
860 <p>FFplay is a very simple and portable media player using the FFmpeg
861 libraries and the SDL library. It is mostly used as a testbed for the
864 <a name="Options-25"></a>
865 <h1 class="chapter"><a href="ffplay-all.html#toc-Options-25">3. Options</a></h1>
867 <p>All the numerical options, if not specified otherwise, accept a string
868 representing a number as input, which may be followed by one of the SI
869 unit prefixes, for example: ’K’, ’M’, or ’G’.
871 <p>If ’i’ is appended to the SI unit prefix, the complete prefix will be
872 interpreted as a unit prefix for binary multiplies, which are based on
873 powers of 1024 instead of powers of 1000. Appending ’B’ to the SI unit
874 prefix multiplies the value by 8. This allows using, for example:
875 ’KB’, ’MiB’, ’G’ and ’B’ as number suffixes.
877 <p>Options which do not take arguments are boolean options, and set the
878 corresponding value to true. They can be set to false by prefixing
879 the option name with "no". For example using "-nofoo"
880 will set the boolean option with name "foo" to false.
882 <p><a name="Stream-specifiers"></a>
883 </p><a name="Stream-specifiers-1"></a>
884 <h2 class="section"><a href="ffplay-all.html#toc-Stream-specifiers-1">3.1 Stream specifiers</a></h2>
885 <p>Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
886 are used to precisely specify which stream(s) a given option belongs to.
888 <p>A stream specifier is a string generally appended to the option name and
889 separated from it by a colon. E.g. <code>-codec:a:1 ac3</code> contains the
890 <code>a:1</code> stream specifier, which matches the second audio stream. Therefore, it
891 would select the ac3 codec for the second audio stream.
893 <p>A stream specifier can match several streams, so that the option is applied to all
894 of them. E.g. the stream specifier in <code>-b:a 128k</code> matches all audio
897 <p>An empty stream specifier matches all streams. For example, <code>-codec copy</code>
898 or <code>-codec: copy</code> would copy all the streams without reencoding.
900 <p>Possible forms of stream specifiers are:
901 </p><dl compact="compact">
902 <dt> ‘<samp><var>stream_index</var></samp>’</dt>
903 <dd><p>Matches the stream with this index. E.g. <code>-threads:1 4</code> would set the
904 thread count for the second stream to 4.
906 <dt> ‘<samp><var>stream_type</var>[:<var>stream_index</var>]</samp>’</dt>
907 <dd><p><var>stream_type</var> is one of following: ’v’ for video, ’a’ for audio, ’s’ for subtitle,
908 ’d’ for data, and ’t’ for attachments. If <var>stream_index</var> is given, then it matches
909 stream number <var>stream_index</var> of this type. Otherwise, it matches all
910 streams of this type.
912 <dt> ‘<samp>p:<var>program_id</var>[:<var>stream_index</var>]</samp>’</dt>
913 <dd><p>If <var>stream_index</var> is given, then it matches the stream with number <var>stream_index</var>
914 in the program with the id <var>program_id</var>. Otherwise, it matches all streams in the
917 <dt> ‘<samp>#<var>stream_id</var></samp>’</dt>
918 <dd><p>Matches the stream by a format-specific ID.
922 <a name="Generic-options"></a>
923 <h2 class="section"><a href="ffplay-all.html#toc-Generic-options">3.2 Generic options</a></h2>
925 <p>These options are shared amongst the ff* tools.
927 <dl compact="compact">
928 <dt> ‘<samp>-L</samp>’</dt>
932 <dt> ‘<samp>-h, -?, -help, --help [<var>arg</var>]</samp>’</dt>
933 <dd><p>Show help. An optional parameter may be specified to print help about a specific
934 item. If no argument is specified, only basic (non advanced) tool
937 <p>Possible values of <var>arg</var> are:
938 </p><dl compact="compact">
939 <dt> ‘<samp>long</samp>’</dt>
940 <dd><p>Print advanced tool options in addition to the basic tool options.
943 <dt> ‘<samp>full</samp>’</dt>
944 <dd><p>Print complete list of options, including shared and private options
945 for encoders, decoders, demuxers, muxers, filters, etc.
948 <dt> ‘<samp>decoder=<var>decoder_name</var></samp>’</dt>
949 <dd><p>Print detailed information about the decoder named <var>decoder_name</var>. Use the
950 ‘<samp>-decoders</samp>’ option to get a list of all decoders.
953 <dt> ‘<samp>encoder=<var>encoder_name</var></samp>’</dt>
954 <dd><p>Print detailed information about the encoder named <var>encoder_name</var>. Use the
955 ‘<samp>-encoders</samp>’ option to get a list of all encoders.
958 <dt> ‘<samp>demuxer=<var>demuxer_name</var></samp>’</dt>
959 <dd><p>Print detailed information about the demuxer named <var>demuxer_name</var>. Use the
960 ‘<samp>-formats</samp>’ option to get a list of all demuxers and muxers.
963 <dt> ‘<samp>muxer=<var>muxer_name</var></samp>’</dt>
964 <dd><p>Print detailed information about the muxer named <var>muxer_name</var>. Use the
965 ‘<samp>-formats</samp>’ option to get a list of all muxers and demuxers.
968 <dt> ‘<samp>filter=<var>filter_name</var></samp>’</dt>
969 <dd><p>Print detailed information about the filter name <var>filter_name</var>. Use the
970 ‘<samp>-filters</samp>’ option to get a list of all filters.
975 <dt> ‘<samp>-version</samp>’</dt>
979 <dt> ‘<samp>-formats</samp>’</dt>
980 <dd><p>Show available formats.
983 <dt> ‘<samp>-codecs</samp>’</dt>
984 <dd><p>Show all codecs known to libavcodec.
986 <p>Note that the term ’codec’ is used throughout this documentation as a shortcut
987 for what is more correctly called a media bitstream format.
990 <dt> ‘<samp>-decoders</samp>’</dt>
991 <dd><p>Show available decoders.
994 <dt> ‘<samp>-encoders</samp>’</dt>
995 <dd><p>Show all available encoders.
998 <dt> ‘<samp>-bsfs</samp>’</dt>
999 <dd><p>Show available bitstream filters.
1002 <dt> ‘<samp>-protocols</samp>’</dt>
1003 <dd><p>Show available protocols.
1006 <dt> ‘<samp>-filters</samp>’</dt>
1007 <dd><p>Show available libavfilter filters.
1010 <dt> ‘<samp>-pix_fmts</samp>’</dt>
1011 <dd><p>Show available pixel formats.
1014 <dt> ‘<samp>-sample_fmts</samp>’</dt>
1015 <dd><p>Show available sample formats.
1018 <dt> ‘<samp>-layouts</samp>’</dt>
1019 <dd><p>Show channel names and standard channel layouts.
1022 <dt> ‘<samp>-colors</samp>’</dt>
1023 <dd><p>Show recognized color names.
1026 <dt> ‘<samp>-loglevel [repeat+]<var>loglevel</var> | -v [repeat+]<var>loglevel</var></samp>’</dt>
1027 <dd><p>Set the logging level used by the library.
1028 Adding "repeat+" indicates that repeated log output should not be compressed
1029 to the first line and the "Last message repeated n times" line will be
1030 omitted. "repeat" can also be used alone.
1031 If "repeat" is used alone, and with no prior loglevel set, the default
1032 loglevel will be used. If multiple loglevel parameters are given, using
1033 ’repeat’ will not change the loglevel.
1034 <var>loglevel</var> is a number or a string containing one of the following values:
1035 </p><dl compact="compact">
1036 <dt> ‘<samp>quiet</samp>’</dt>
1037 <dd><p>Show nothing at all; be silent.
1039 <dt> ‘<samp>panic</samp>’</dt>
1040 <dd><p>Only show fatal errors which could lead the process to crash, such as
1041 and assert failure. This is not currently used for anything.
1043 <dt> ‘<samp>fatal</samp>’</dt>
1044 <dd><p>Only show fatal errors. These are errors after which the process absolutely
1045 cannot continue after.
1047 <dt> ‘<samp>error</samp>’</dt>
1048 <dd><p>Show all errors, including ones which can be recovered from.
1050 <dt> ‘<samp>warning</samp>’</dt>
1051 <dd><p>Show all warnings and errors. Any message related to possibly
1052 incorrect or unexpected events will be shown.
1054 <dt> ‘<samp>info</samp>’</dt>
1055 <dd><p>Show informative messages during processing. This is in addition to
1056 warnings and errors. This is the default value.
1058 <dt> ‘<samp>verbose</samp>’</dt>
1059 <dd><p>Same as <code>info</code>, except more verbose.
1061 <dt> ‘<samp>debug</samp>’</dt>
1062 <dd><p>Show everything, including debugging information.
1066 <p>By default the program logs to stderr, if coloring is supported by the
1067 terminal, colors are used to mark errors and warnings. Log coloring
1068 can be disabled setting the environment variable
1069 <code>AV_LOG_FORCE_NOCOLOR</code> or <code>NO_COLOR</code>, or can be forced setting
1070 the environment variable <code>AV_LOG_FORCE_COLOR</code>.
1071 The use of the environment variable <code>NO_COLOR</code> is deprecated and
1072 will be dropped in a following FFmpeg version.
1075 <dt> ‘<samp>-report</samp>’</dt>
1076 <dd><p>Dump full command line and console output to a file named
1077 <code><var>program</var>-<var>YYYYMMDD</var>-<var>HHMMSS</var>.log</code> in the current
1079 This file can be useful for bug reports.
1080 It also implies <code>-loglevel verbose</code>.
1082 <p>Setting the environment variable <code>FFREPORT</code> to any value has the
1083 same effect. If the value is a ’:’-separated key=value sequence, these
1084 options will affect the report; options values must be escaped if they
1085 contain special characters or the options delimiter ’:’ (see the
1086 “Quoting and escaping” section in the ffmpeg-utils manual). The
1087 following option is recognized:
1088 </p><dl compact="compact">
1089 <dt> ‘<samp>file</samp>’</dt>
1090 <dd><p>set the file name to use for the report; <code>%p</code> is expanded to the name
1091 of the program, <code>%t</code> is expanded to a timestamp, <code>%%</code> is expanded
1092 to a plain <code>%</code>
1096 <p>Errors in parsing the environment variable are not fatal, and will not
1097 appear in the report.
1100 <dt> ‘<samp>-cpuflags flags (<em>global</em>)</samp>’</dt>
1101 <dd><p>Allows setting and clearing cpu flags. This option is intended
1102 for testing. Do not use it unless you know what you’re doing.
1103 </p><table><tr><td> </td><td><pre class="example">ffmpeg -cpuflags -sse+mmx ...
1104 ffmpeg -cpuflags mmx ...
1105 ffmpeg -cpuflags 0 ...
1106 </pre></td></tr></table>
1107 <p>Possible flags for this option are:
1108 </p><dl compact="compact">
1109 <dt> ‘<samp>x86</samp>’</dt>
1110 <dd><dl compact="compact">
1111 <dt> ‘<samp>mmx</samp>’</dt>
1112 <dt> ‘<samp>mmxext</samp>’</dt>
1113 <dt> ‘<samp>sse</samp>’</dt>
1114 <dt> ‘<samp>sse2</samp>’</dt>
1115 <dt> ‘<samp>sse2slow</samp>’</dt>
1116 <dt> ‘<samp>sse3</samp>’</dt>
1117 <dt> ‘<samp>sse3slow</samp>’</dt>
1118 <dt> ‘<samp>ssse3</samp>’</dt>
1119 <dt> ‘<samp>atom</samp>’</dt>
1120 <dt> ‘<samp>sse4.1</samp>’</dt>
1121 <dt> ‘<samp>sse4.2</samp>’</dt>
1122 <dt> ‘<samp>avx</samp>’</dt>
1123 <dt> ‘<samp>xop</samp>’</dt>
1124 <dt> ‘<samp>fma4</samp>’</dt>
1125 <dt> ‘<samp>3dnow</samp>’</dt>
1126 <dt> ‘<samp>3dnowext</samp>’</dt>
1127 <dt> ‘<samp>cmov</samp>’</dt>
1130 <dt> ‘<samp>ARM</samp>’</dt>
1131 <dd><dl compact="compact">
1132 <dt> ‘<samp>armv5te</samp>’</dt>
1133 <dt> ‘<samp>armv6</samp>’</dt>
1134 <dt> ‘<samp>armv6t2</samp>’</dt>
1135 <dt> ‘<samp>vfp</samp>’</dt>
1136 <dt> ‘<samp>vfpv3</samp>’</dt>
1137 <dt> ‘<samp>neon</samp>’</dt>
1140 <dt> ‘<samp>PowerPC</samp>’</dt>
1141 <dd><dl compact="compact">
1142 <dt> ‘<samp>altivec</samp>’</dt>
1145 <dt> ‘<samp>Specific Processors</samp>’</dt>
1146 <dd><dl compact="compact">
1147 <dt> ‘<samp>pentium2</samp>’</dt>
1148 <dt> ‘<samp>pentium3</samp>’</dt>
1149 <dt> ‘<samp>pentium4</samp>’</dt>
1150 <dt> ‘<samp>k6</samp>’</dt>
1151 <dt> ‘<samp>k62</samp>’</dt>
1152 <dt> ‘<samp>athlon</samp>’</dt>
1153 <dt> ‘<samp>athlonxp</samp>’</dt>
1154 <dt> ‘<samp>k8</samp>’</dt>
1160 <dt> ‘<samp>-opencl_bench</samp>’</dt>
1161 <dd><p>Benchmark all available OpenCL devices and show the results. This option
1162 is only available when FFmpeg has been compiled with <code>--enable-opencl</code>.
1165 <dt> ‘<samp>-opencl_options options (<em>global</em>)</samp>’</dt>
1166 <dd><p>Set OpenCL environment options. This option is only available when
1167 FFmpeg has been compiled with <code>--enable-opencl</code>.
1169 <p><var>options</var> must be a list of <var>key</var>=<var>value</var> option pairs
1170 separated by ’:’. See the “OpenCL Options” section in the
1171 ffmpeg-utils manual for the list of supported options.
1175 <a name="AVOptions"></a>
1176 <h2 class="section"><a href="ffplay-all.html#toc-AVOptions">3.3 AVOptions</a></h2>
1178 <p>These options are provided directly by the libavformat, libavdevice and
1179 libavcodec libraries. To see the list of available AVOptions, use the
1180 ‘<samp>-help</samp>’ option. They are separated into two categories:
1181 </p><dl compact="compact">
1182 <dt> ‘<samp>generic</samp>’</dt>
1183 <dd><p>These options can be set for any container, codec or device. Generic options
1184 are listed under AVFormatContext options for containers/devices and under
1185 AVCodecContext options for codecs.
1187 <dt> ‘<samp>private</samp>’</dt>
1188 <dd><p>These options are specific to the given container, device or codec. Private
1189 options are listed under their corresponding containers/devices/codecs.
1193 <p>For example to write an ID3v2.3 header instead of a default ID3v2.4 to
1194 an MP3 file, use the ‘<samp>id3v2_version</samp>’ private option of the MP3
1196 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i input.flac -id3v2_version 3 out.mp3
1197 </pre></td></tr></table>
1199 <p>All codec AVOptions are per-stream, and thus a stream specifier
1200 should be attached to them.
1202 <p>Note: the ‘<samp>-nooption</samp>’ syntax cannot be used for boolean
1203 AVOptions, use ‘<samp>-option 0</samp>’/‘<samp>-option 1</samp>’.
1205 <p>Note: the old undocumented way of specifying per-stream AVOptions by
1206 prepending v/a/s to the options name is now obsolete and will be
1209 <a name="Main-options"></a>
1210 <h2 class="section"><a href="ffplay-all.html#toc-Main-options">3.4 Main options</a></h2>
1212 <dl compact="compact">
1213 <dt> ‘<samp>-x <var>width</var></samp>’</dt>
1214 <dd><p>Force displayed width.
1216 <dt> ‘<samp>-y <var>height</var></samp>’</dt>
1217 <dd><p>Force displayed height.
1219 <dt> ‘<samp>-s <var>size</var></samp>’</dt>
1220 <dd><p>Set frame size (WxH or abbreviation), needed for videos which do
1221 not contain a header with the frame size like raw YUV. This option
1222 has been deprecated in favor of private options, try -video_size.
1224 <dt> ‘<samp>-an</samp>’</dt>
1225 <dd><p>Disable audio.
1227 <dt> ‘<samp>-vn</samp>’</dt>
1228 <dd><p>Disable video.
1230 <dt> ‘<samp>-ss <var>pos</var></samp>’</dt>
1231 <dd><p>Seek to a given position in seconds.
1233 <dt> ‘<samp>-t <var>duration</var></samp>’</dt>
1234 <dd><p>play <duration> seconds of audio/video
1236 <dt> ‘<samp>-bytes</samp>’</dt>
1237 <dd><p>Seek by bytes.
1239 <dt> ‘<samp>-nodisp</samp>’</dt>
1240 <dd><p>Disable graphical display.
1242 <dt> ‘<samp>-f <var>fmt</var></samp>’</dt>
1243 <dd><p>Force format.
1245 <dt> ‘<samp>-window_title <var>title</var></samp>’</dt>
1246 <dd><p>Set window title (default is the input filename).
1248 <dt> ‘<samp>-loop <var>number</var></samp>’</dt>
1249 <dd><p>Loops movie playback <number> times. 0 means forever.
1251 <dt> ‘<samp>-showmode <var>mode</var></samp>’</dt>
1252 <dd><p>Set the show mode to use.
1253 Available values for <var>mode</var> are:
1254 </p><dl compact="compact">
1255 <dt> ‘<samp>0, video</samp>’</dt>
1258 <dt> ‘<samp>1, waves</samp>’</dt>
1259 <dd><p>show audio waves
1261 <dt> ‘<samp>2, rdft</samp>’</dt>
1262 <dd><p>show audio frequency band using RDFT ((Inverse) Real Discrete Fourier Transform)
1266 <p>Default value is "video", if video is not present or cannot be played
1267 "rdft" is automatically selected.
1269 <p>You can interactively cycle through the available show modes by
1270 pressing the key <w>.
1273 <dt> ‘<samp>-vf <var>filtergraph</var></samp>’</dt>
1274 <dd><p>Create the filtergraph specified by <var>filtergraph</var> and use it to
1275 filter the video stream.
1277 <p><var>filtergraph</var> is a description of the filtergraph to apply to
1278 the stream, and must have a single video input and a single video
1279 output. In the filtergraph, the input is associated to the label
1280 <code>in</code>, and the output to the label <code>out</code>. See the
1281 ffmpeg-filters manual for more information about the filtergraph
1285 <dt> ‘<samp>-af <var>filtergraph</var></samp>’</dt>
1286 <dd><p><var>filtergraph</var> is a description of the filtergraph to apply to
1288 Use the option "-filters" to show all the available filters (including
1292 <dt> ‘<samp>-i <var>input_file</var></samp>’</dt>
1293 <dd><p>Read <var>input_file</var>.
1297 <a name="Advanced-options"></a>
1298 <h2 class="section"><a href="ffplay-all.html#toc-Advanced-options">3.5 Advanced options</a></h2>
1299 <dl compact="compact">
1300 <dt> ‘<samp>-pix_fmt <var>format</var></samp>’</dt>
1301 <dd><p>Set pixel format.
1302 This option has been deprecated in favor of private options, try -pixel_format.
1305 <dt> ‘<samp>-stats</samp>’</dt>
1306 <dd><p>Print several playback statistics, in particular show the stream
1307 duration, the codec parameters, the current position in the stream and
1308 the audio/video synchronisation drift. It is on by default, to
1309 explicitly disable it you need to specify <code>-nostats</code>.
1312 <dt> ‘<samp>-bug</samp>’</dt>
1313 <dd><p>Work around bugs.
1315 <dt> ‘<samp>-fast</samp>’</dt>
1316 <dd><p>Non-spec-compliant optimizations.
1318 <dt> ‘<samp>-genpts</samp>’</dt>
1319 <dd><p>Generate pts.
1321 <dt> ‘<samp>-rtp_tcp</samp>’</dt>
1322 <dd><p>Force RTP/TCP protocol usage instead of RTP/UDP. It is only meaningful
1323 if you are streaming with the RTSP protocol.
1325 <dt> ‘<samp>-sync <var>type</var></samp>’</dt>
1326 <dd><p>Set the master clock to audio (<code>type=audio</code>), video
1327 (<code>type=video</code>) or external (<code>type=ext</code>). Default is audio. The
1328 master clock is used to control audio-video synchronization. Most media
1329 players use audio as master clock, but in some cases (streaming or high
1330 quality broadcast) it is necessary to change that. This option is mainly
1331 used for debugging purposes.
1333 <dt> ‘<samp>-threads <var>count</var></samp>’</dt>
1334 <dd><p>Set the thread count.
1336 <dt> ‘<samp>-ast <var>audio_stream_number</var></samp>’</dt>
1337 <dd><p>Select the desired audio stream number, counting from 0. The number
1338 refers to the list of all the input audio streams. If it is greater
1339 than the number of audio streams minus one, then the last one is
1340 selected, if it is negative the audio playback is disabled.
1342 <dt> ‘<samp>-vst <var>video_stream_number</var></samp>’</dt>
1343 <dd><p>Select the desired video stream number, counting from 0. The number
1344 refers to the list of all the input video streams. If it is greater
1345 than the number of video streams minus one, then the last one is
1346 selected, if it is negative the video playback is disabled.
1348 <dt> ‘<samp>-sst <var>subtitle_stream_number</var></samp>’</dt>
1349 <dd><p>Select the desired subtitle stream number, counting from 0. The number
1350 refers to the list of all the input subtitle streams. If it is greater
1351 than the number of subtitle streams minus one, then the last one is
1352 selected, if it is negative the subtitle rendering is disabled.
1354 <dt> ‘<samp>-autoexit</samp>’</dt>
1355 <dd><p>Exit when video is done playing.
1357 <dt> ‘<samp>-exitonkeydown</samp>’</dt>
1358 <dd><p>Exit if any key is pressed.
1360 <dt> ‘<samp>-exitonmousedown</samp>’</dt>
1361 <dd><p>Exit if any mouse button is pressed.
1364 <dt> ‘<samp>-codec:<var>media_specifier</var> <var>codec_name</var></samp>’</dt>
1365 <dd><p>Force a specific decoder implementation for the stream identified by
1366 <var>media_specifier</var>, which can assume the values <code>a</code> (audio),
1367 <code>v</code> (video), and <code>s</code> subtitle.
1370 <dt> ‘<samp>-acodec <var>codec_name</var></samp>’</dt>
1371 <dd><p>Force a specific audio decoder.
1374 <dt> ‘<samp>-vcodec <var>codec_name</var></samp>’</dt>
1375 <dd><p>Force a specific video decoder.
1378 <dt> ‘<samp>-scodec <var>codec_name</var></samp>’</dt>
1379 <dd><p>Force a specific subtitle decoder.
1383 <a name="While-playing"></a>
1384 <h2 class="section"><a href="ffplay-all.html#toc-While-playing">3.6 While playing</a></h2>
1386 <dl compact="compact">
1387 <dt> <q, ESC></dt>
1392 <dd><p>Toggle full screen.
1395 <dt> <p, SPC></dt>
1400 <dd><p>Cycle audio channel in the curret program.
1404 <dd><p>Cycle video channel.
1408 <dd><p>Cycle subtitle channel in the current program.
1412 <dd><p>Cycle program.
1416 <dd><p>Show audio waves.
1419 <dt> <left/right></dt>
1420 <dd><p>Seek backward/forward 10 seconds.
1423 <dt> <down/up></dt>
1424 <dd><p>Seek backward/forward 1 minute.
1427 <dt> <page down/page up></dt>
1428 <dd><p>Seek backward/forward 10 minutes.
1431 <dt> <mouse click></dt>
1432 <dd><p>Seek to percentage in file corresponding to fraction of width.
1438 <a name="Syntax-2"></a>
1439 <h1 class="chapter"><a href="ffplay-all.html#toc-Syntax-2">4. Syntax</a></h1>
1441 <p>This section documents the syntax and formats employed by the FFmpeg
1442 libraries and tools.
1444 <p><a name="quoting_005fand_005fescaping"></a>
1445 </p><a name="Quoting-and-escaping"></a>
1446 <h2 class="section"><a href="ffplay-all.html#toc-Quoting-and-escaping">4.1 Quoting and escaping</a></h2>
1448 <p>FFmpeg adopts the following quoting and escaping mechanism, unless
1449 explicitly specified. The following rules are applied:
1453 <code>'</code> and <code>\</code> are special characters (respectively used for
1454 quoting and escaping). In addition to them, there might be other
1455 special characters depending on the specific syntax where the escaping
1456 and quoting are employed.
1459 A special character is escaped by prefixing it with a ’\’.
1462 All characters enclosed between ” are included literally in the
1463 parsed string. The quote character <code>'</code> itself cannot be quoted,
1464 so you may need to close the quote and escape it.
1467 Leading and trailing whitespaces, unless escaped or quoted, are
1468 removed from the parsed string.
1471 <p>Note that you may need to add a second level of escaping when using
1472 the command line or a script, which depends on the syntax of the
1473 adopted shell language.
1475 <p>The function <code>av_get_token</code> defined in
1476 ‘<tt>libavutil/avstring.h</tt>’ can be used to parse a token quoted or
1477 escaped according to the rules defined above.
1479 <p>The tool ‘<tt>tools/ffescape</tt>’ in the FFmpeg source tree can be used
1480 to automatically quote or escape a string in a script.
1482 <a name="Examples-13"></a>
1483 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-13">4.1.1 Examples</a></h3>
1487 Escape the string <code>Crime d'Amour</code> containing the <code>'</code> special
1489 <table><tr><td> </td><td><pre class="example">Crime d\'Amour
1490 </pre></td></tr></table>
1493 The string above contains a quote, so the <code>'</code> needs to be escaped
1495 <table><tr><td> </td><td><pre class="example">'Crime d'\''Amour'
1496 </pre></td></tr></table>
1499 Include leading or trailing whitespaces using quoting:
1500 <table><tr><td> </td><td><pre class="example">' this string starts and ends with whitespaces '
1501 </pre></td></tr></table>
1504 Escaping and quoting can be mixed together:
1505 <table><tr><td> </td><td><pre class="example">' The string '\'string\'' is a string '
1506 </pre></td></tr></table>
1509 To include a literal <code>\</code> you can use either escaping or quoting:
1510 <table><tr><td> </td><td><pre class="example">'c:\foo' can be written as c:\\foo
1511 </pre></td></tr></table>
1514 <p><a name="date-syntax"></a>
1515 </p><a name="Date"></a>
1516 <h2 class="section"><a href="ffplay-all.html#toc-Date">4.2 Date</a></h2>
1518 <p>The accepted syntax is:
1519 </p><table><tr><td> </td><td><pre class="example">[(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
1521 </pre></td></tr></table>
1523 <p>If the value is "now" it takes the current time.
1525 <p>Time is local time unless Z is appended, in which case it is
1527 If the year-month-day part is not specified it takes the current
1530 <p><a name="time-duration-syntax"></a>
1531 </p><a name="Time-duration"></a>
1532 <h2 class="section"><a href="ffplay-all.html#toc-Time-duration">4.3 Time duration</a></h2>
1534 <p>There are two accepted syntaxes for expressing time duration.
1536 <table><tr><td> </td><td><pre class="example">[-][<var>HH</var>:]<var>MM</var>:<var>SS</var>[.<var>m</var>...]
1537 </pre></td></tr></table>
1539 <p><var>HH</var> expresses the number of hours, <var>MM</var> the number of minutes
1540 for a maximum of 2 digits, and <var>SS</var> the number of seconds for a
1541 maximum of 2 digits. The <var>m</var> at the end expresses decimal value for
1546 <table><tr><td> </td><td><pre class="example">[-]<var>S</var>+[.<var>m</var>...]
1547 </pre></td></tr></table>
1549 <p><var>S</var> expresses the number of seconds, with the optional decimal part
1552 <p>In both expressions, the optional ‘<samp>-</samp>’ indicates negative duration.
1554 <a name="Examples-31"></a>
1555 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-31">4.3.1 Examples</a></h3>
1557 <p>The following examples are all valid time duration:
1559 <dl compact="compact">
1560 <dt> ‘<samp>55</samp>’</dt>
1564 <dt> ‘<samp>12:03:45</samp>’</dt>
1565 <dd><p>12 hours, 03 minutes and 45 seconds
1568 <dt> ‘<samp>23.189</samp>’</dt>
1569 <dd><p>23.189 seconds
1573 <p><a name="video-size-syntax"></a>
1574 </p><a name="Video-size"></a>
1575 <h2 class="section"><a href="ffplay-all.html#toc-Video-size">4.4 Video size</a></h2>
1576 <p>Specify the size of the sourced video, it may be a string of the form
1577 <var>width</var>x<var>height</var>, or the name of a size abbreviation.
1579 <p>The following abbreviations are recognized:
1580 </p><dl compact="compact">
1581 <dt> ‘<samp>ntsc</samp>’</dt>
1584 <dt> ‘<samp>pal</samp>’</dt>
1587 <dt> ‘<samp>qntsc</samp>’</dt>
1590 <dt> ‘<samp>qpal</samp>’</dt>
1593 <dt> ‘<samp>sntsc</samp>’</dt>
1596 <dt> ‘<samp>spal</samp>’</dt>
1599 <dt> ‘<samp>film</samp>’</dt>
1602 <dt> ‘<samp>ntsc-film</samp>’</dt>
1605 <dt> ‘<samp>sqcif</samp>’</dt>
1608 <dt> ‘<samp>qcif</samp>’</dt>
1611 <dt> ‘<samp>cif</samp>’</dt>
1614 <dt> ‘<samp>4cif</samp>’</dt>
1617 <dt> ‘<samp>16cif</samp>’</dt>
1620 <dt> ‘<samp>qqvga</samp>’</dt>
1623 <dt> ‘<samp>qvga</samp>’</dt>
1626 <dt> ‘<samp>vga</samp>’</dt>
1629 <dt> ‘<samp>svga</samp>’</dt>
1632 <dt> ‘<samp>xga</samp>’</dt>
1635 <dt> ‘<samp>uxga</samp>’</dt>
1638 <dt> ‘<samp>qxga</samp>’</dt>
1641 <dt> ‘<samp>sxga</samp>’</dt>
1644 <dt> ‘<samp>qsxga</samp>’</dt>
1647 <dt> ‘<samp>hsxga</samp>’</dt>
1650 <dt> ‘<samp>wvga</samp>’</dt>
1653 <dt> ‘<samp>wxga</samp>’</dt>
1656 <dt> ‘<samp>wsxga</samp>’</dt>
1659 <dt> ‘<samp>wuxga</samp>’</dt>
1662 <dt> ‘<samp>woxga</samp>’</dt>
1665 <dt> ‘<samp>wqsxga</samp>’</dt>
1668 <dt> ‘<samp>wquxga</samp>’</dt>
1671 <dt> ‘<samp>whsxga</samp>’</dt>
1674 <dt> ‘<samp>whuxga</samp>’</dt>
1677 <dt> ‘<samp>cga</samp>’</dt>
1680 <dt> ‘<samp>ega</samp>’</dt>
1683 <dt> ‘<samp>hd480</samp>’</dt>
1686 <dt> ‘<samp>hd720</samp>’</dt>
1689 <dt> ‘<samp>hd1080</samp>’</dt>
1692 <dt> ‘<samp>2k</samp>’</dt>
1695 <dt> ‘<samp>2kflat</samp>’</dt>
1698 <dt> ‘<samp>2kscope</samp>’</dt>
1701 <dt> ‘<samp>4k</samp>’</dt>
1704 <dt> ‘<samp>4kflat</samp>’</dt>
1707 <dt> ‘<samp>4kscope</samp>’</dt>
1710 <dt> ‘<samp>nhd</samp>’</dt>
1713 <dt> ‘<samp>hqvga</samp>’</dt>
1716 <dt> ‘<samp>wqvga</samp>’</dt>
1719 <dt> ‘<samp>fwqvga</samp>’</dt>
1722 <dt> ‘<samp>hvga</samp>’</dt>
1725 <dt> ‘<samp>qhd</samp>’</dt>
1730 <p><a name="video-rate-syntax"></a>
1731 </p><a name="Video-rate"></a>
1732 <h2 class="section"><a href="ffplay-all.html#toc-Video-rate">4.5 Video rate</a></h2>
1734 <p>Specify the frame rate of a video, expressed as the number of frames
1735 generated per second. It has to be a string in the format
1736 <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a float
1737 number or a valid video frame rate abbreviation.
1739 <p>The following abbreviations are recognized:
1740 </p><dl compact="compact">
1741 <dt> ‘<samp>ntsc</samp>’</dt>
1744 <dt> ‘<samp>pal</samp>’</dt>
1747 <dt> ‘<samp>qntsc</samp>’</dt>
1750 <dt> ‘<samp>qpal</samp>’</dt>
1753 <dt> ‘<samp>sntsc</samp>’</dt>
1756 <dt> ‘<samp>spal</samp>’</dt>
1759 <dt> ‘<samp>film</samp>’</dt>
1762 <dt> ‘<samp>ntsc-film</samp>’</dt>
1767 <p><a name="ratio-syntax"></a>
1768 </p><a name="Ratio"></a>
1769 <h2 class="section"><a href="ffplay-all.html#toc-Ratio">4.6 Ratio</a></h2>
1771 <p>A ratio can be expressed as an expression, or in the form
1772 <var>numerator</var>:<var>denominator</var>.
1774 <p>Note that a ratio with infinite (1/0) or negative value is
1775 considered valid, so you should check on the returned value if you
1776 want to exclude those values.
1778 <p>The undefined value can be expressed using the "0:0" string.
1780 <p><a name="color-syntax"></a>
1781 </p><a name="Color"></a>
1782 <h2 class="section"><a href="ffplay-all.html#toc-Color">4.7 Color</a></h2>
1784 <p>It can be the name of a color as defined below (case insensitive match) or a
1785 <code>[0x|#]RRGGBB[AA]</code> sequence, possibly followed by @ and a string
1786 representing the alpha component.
1788 <p>The alpha component may be a string composed by "0x" followed by an
1789 hexadecimal number or a decimal number between 0.0 and 1.0, which
1790 represents the opacity value (‘<samp>0x00</samp>’ or ‘<samp>0.0</samp>’ means completely
1791 transparent, ‘<samp>0xff</samp>’ or ‘<samp>1.0</samp>’ completely opaque). If the alpha
1792 component is not specified then ‘<samp>0xff</samp>’ is assumed.
1794 <p>The string ‘<samp>random</samp>’ will result in a random color.
1796 <p>The following names of colors are recognized:
1797 </p><dl compact="compact">
1798 <dt> ‘<samp>AliceBlue</samp>’</dt>
1801 <dt> ‘<samp>AntiqueWhite</samp>’</dt>
1804 <dt> ‘<samp>Aqua</samp>’</dt>
1807 <dt> ‘<samp>Aquamarine</samp>’</dt>
1810 <dt> ‘<samp>Azure</samp>’</dt>
1813 <dt> ‘<samp>Beige</samp>’</dt>
1816 <dt> ‘<samp>Bisque</samp>’</dt>
1819 <dt> ‘<samp>Black</samp>’</dt>
1822 <dt> ‘<samp>BlanchedAlmond</samp>’</dt>
1825 <dt> ‘<samp>Blue</samp>’</dt>
1828 <dt> ‘<samp>BlueViolet</samp>’</dt>
1831 <dt> ‘<samp>Brown</samp>’</dt>
1834 <dt> ‘<samp>BurlyWood</samp>’</dt>
1837 <dt> ‘<samp>CadetBlue</samp>’</dt>
1840 <dt> ‘<samp>Chartreuse</samp>’</dt>
1843 <dt> ‘<samp>Chocolate</samp>’</dt>
1846 <dt> ‘<samp>Coral</samp>’</dt>
1849 <dt> ‘<samp>CornflowerBlue</samp>’</dt>
1852 <dt> ‘<samp>Cornsilk</samp>’</dt>
1855 <dt> ‘<samp>Crimson</samp>’</dt>
1858 <dt> ‘<samp>Cyan</samp>’</dt>
1861 <dt> ‘<samp>DarkBlue</samp>’</dt>
1864 <dt> ‘<samp>DarkCyan</samp>’</dt>
1867 <dt> ‘<samp>DarkGoldenRod</samp>’</dt>
1870 <dt> ‘<samp>DarkGray</samp>’</dt>
1873 <dt> ‘<samp>DarkGreen</samp>’</dt>
1876 <dt> ‘<samp>DarkKhaki</samp>’</dt>
1879 <dt> ‘<samp>DarkMagenta</samp>’</dt>
1882 <dt> ‘<samp>DarkOliveGreen</samp>’</dt>
1885 <dt> ‘<samp>Darkorange</samp>’</dt>
1888 <dt> ‘<samp>DarkOrchid</samp>’</dt>
1891 <dt> ‘<samp>DarkRed</samp>’</dt>
1894 <dt> ‘<samp>DarkSalmon</samp>’</dt>
1897 <dt> ‘<samp>DarkSeaGreen</samp>’</dt>
1900 <dt> ‘<samp>DarkSlateBlue</samp>’</dt>
1903 <dt> ‘<samp>DarkSlateGray</samp>’</dt>
1906 <dt> ‘<samp>DarkTurquoise</samp>’</dt>
1909 <dt> ‘<samp>DarkViolet</samp>’</dt>
1912 <dt> ‘<samp>DeepPink</samp>’</dt>
1915 <dt> ‘<samp>DeepSkyBlue</samp>’</dt>
1918 <dt> ‘<samp>DimGray</samp>’</dt>
1921 <dt> ‘<samp>DodgerBlue</samp>’</dt>
1924 <dt> ‘<samp>FireBrick</samp>’</dt>
1927 <dt> ‘<samp>FloralWhite</samp>’</dt>
1930 <dt> ‘<samp>ForestGreen</samp>’</dt>
1933 <dt> ‘<samp>Fuchsia</samp>’</dt>
1936 <dt> ‘<samp>Gainsboro</samp>’</dt>
1939 <dt> ‘<samp>GhostWhite</samp>’</dt>
1942 <dt> ‘<samp>Gold</samp>’</dt>
1945 <dt> ‘<samp>GoldenRod</samp>’</dt>
1948 <dt> ‘<samp>Gray</samp>’</dt>
1951 <dt> ‘<samp>Green</samp>’</dt>
1954 <dt> ‘<samp>GreenYellow</samp>’</dt>
1957 <dt> ‘<samp>HoneyDew</samp>’</dt>
1960 <dt> ‘<samp>HotPink</samp>’</dt>
1963 <dt> ‘<samp>IndianRed</samp>’</dt>
1966 <dt> ‘<samp>Indigo</samp>’</dt>
1969 <dt> ‘<samp>Ivory</samp>’</dt>
1972 <dt> ‘<samp>Khaki</samp>’</dt>
1975 <dt> ‘<samp>Lavender</samp>’</dt>
1978 <dt> ‘<samp>LavenderBlush</samp>’</dt>
1981 <dt> ‘<samp>LawnGreen</samp>’</dt>
1984 <dt> ‘<samp>LemonChiffon</samp>’</dt>
1987 <dt> ‘<samp>LightBlue</samp>’</dt>
1990 <dt> ‘<samp>LightCoral</samp>’</dt>
1993 <dt> ‘<samp>LightCyan</samp>’</dt>
1996 <dt> ‘<samp>LightGoldenRodYellow</samp>’</dt>
1999 <dt> ‘<samp>LightGreen</samp>’</dt>
2002 <dt> ‘<samp>LightGrey</samp>’</dt>
2005 <dt> ‘<samp>LightPink</samp>’</dt>
2008 <dt> ‘<samp>LightSalmon</samp>’</dt>
2011 <dt> ‘<samp>LightSeaGreen</samp>’</dt>
2014 <dt> ‘<samp>LightSkyBlue</samp>’</dt>
2017 <dt> ‘<samp>LightSlateGray</samp>’</dt>
2020 <dt> ‘<samp>LightSteelBlue</samp>’</dt>
2023 <dt> ‘<samp>LightYellow</samp>’</dt>
2026 <dt> ‘<samp>Lime</samp>’</dt>
2029 <dt> ‘<samp>LimeGreen</samp>’</dt>
2032 <dt> ‘<samp>Linen</samp>’</dt>
2035 <dt> ‘<samp>Magenta</samp>’</dt>
2038 <dt> ‘<samp>Maroon</samp>’</dt>
2041 <dt> ‘<samp>MediumAquaMarine</samp>’</dt>
2044 <dt> ‘<samp>MediumBlue</samp>’</dt>
2047 <dt> ‘<samp>MediumOrchid</samp>’</dt>
2050 <dt> ‘<samp>MediumPurple</samp>’</dt>
2053 <dt> ‘<samp>MediumSeaGreen</samp>’</dt>
2056 <dt> ‘<samp>MediumSlateBlue</samp>’</dt>
2059 <dt> ‘<samp>MediumSpringGreen</samp>’</dt>
2062 <dt> ‘<samp>MediumTurquoise</samp>’</dt>
2065 <dt> ‘<samp>MediumVioletRed</samp>’</dt>
2068 <dt> ‘<samp>MidnightBlue</samp>’</dt>
2071 <dt> ‘<samp>MintCream</samp>’</dt>
2074 <dt> ‘<samp>MistyRose</samp>’</dt>
2077 <dt> ‘<samp>Moccasin</samp>’</dt>
2080 <dt> ‘<samp>NavajoWhite</samp>’</dt>
2083 <dt> ‘<samp>Navy</samp>’</dt>
2086 <dt> ‘<samp>OldLace</samp>’</dt>
2089 <dt> ‘<samp>Olive</samp>’</dt>
2092 <dt> ‘<samp>OliveDrab</samp>’</dt>
2095 <dt> ‘<samp>Orange</samp>’</dt>
2098 <dt> ‘<samp>OrangeRed</samp>’</dt>
2101 <dt> ‘<samp>Orchid</samp>’</dt>
2104 <dt> ‘<samp>PaleGoldenRod</samp>’</dt>
2107 <dt> ‘<samp>PaleGreen</samp>’</dt>
2110 <dt> ‘<samp>PaleTurquoise</samp>’</dt>
2113 <dt> ‘<samp>PaleVioletRed</samp>’</dt>
2116 <dt> ‘<samp>PapayaWhip</samp>’</dt>
2119 <dt> ‘<samp>PeachPuff</samp>’</dt>
2122 <dt> ‘<samp>Peru</samp>’</dt>
2125 <dt> ‘<samp>Pink</samp>’</dt>
2128 <dt> ‘<samp>Plum</samp>’</dt>
2131 <dt> ‘<samp>PowderBlue</samp>’</dt>
2134 <dt> ‘<samp>Purple</samp>’</dt>
2137 <dt> ‘<samp>Red</samp>’</dt>
2140 <dt> ‘<samp>RosyBrown</samp>’</dt>
2143 <dt> ‘<samp>RoyalBlue</samp>’</dt>
2146 <dt> ‘<samp>SaddleBrown</samp>’</dt>
2149 <dt> ‘<samp>Salmon</samp>’</dt>
2152 <dt> ‘<samp>SandyBrown</samp>’</dt>
2155 <dt> ‘<samp>SeaGreen</samp>’</dt>
2158 <dt> ‘<samp>SeaShell</samp>’</dt>
2161 <dt> ‘<samp>Sienna</samp>’</dt>
2164 <dt> ‘<samp>Silver</samp>’</dt>
2167 <dt> ‘<samp>SkyBlue</samp>’</dt>
2170 <dt> ‘<samp>SlateBlue</samp>’</dt>
2173 <dt> ‘<samp>SlateGray</samp>’</dt>
2176 <dt> ‘<samp>Snow</samp>’</dt>
2179 <dt> ‘<samp>SpringGreen</samp>’</dt>
2182 <dt> ‘<samp>SteelBlue</samp>’</dt>
2185 <dt> ‘<samp>Tan</samp>’</dt>
2188 <dt> ‘<samp>Teal</samp>’</dt>
2191 <dt> ‘<samp>Thistle</samp>’</dt>
2194 <dt> ‘<samp>Tomato</samp>’</dt>
2197 <dt> ‘<samp>Turquoise</samp>’</dt>
2200 <dt> ‘<samp>Violet</samp>’</dt>
2203 <dt> ‘<samp>Wheat</samp>’</dt>
2206 <dt> ‘<samp>White</samp>’</dt>
2209 <dt> ‘<samp>WhiteSmoke</samp>’</dt>
2212 <dt> ‘<samp>Yellow</samp>’</dt>
2215 <dt> ‘<samp>YellowGreen</samp>’</dt>
2220 <p><a name="channel-layout-syntax"></a>
2221 </p><a name="Channel-Layout"></a>
2222 <h2 class="section"><a href="ffplay-all.html#toc-Channel-Layout">4.8 Channel Layout</a></h2>
2224 <p>A channel layout specifies the spatial disposition of the channels in
2225 a multi-channel audio stream. To specify a channel layout, FFmpeg
2226 makes use of a special syntax.
2228 <p>Individual channels are identified by an id, as given by the table
2230 </p><dl compact="compact">
2231 <dt> ‘<samp>FL</samp>’</dt>
2234 <dt> ‘<samp>FR</samp>’</dt>
2237 <dt> ‘<samp>FC</samp>’</dt>
2240 <dt> ‘<samp>LFE</samp>’</dt>
2241 <dd><p>low frequency
2243 <dt> ‘<samp>BL</samp>’</dt>
2246 <dt> ‘<samp>BR</samp>’</dt>
2249 <dt> ‘<samp>FLC</samp>’</dt>
2250 <dd><p>front left-of-center
2252 <dt> ‘<samp>FRC</samp>’</dt>
2253 <dd><p>front right-of-center
2255 <dt> ‘<samp>BC</samp>’</dt>
2258 <dt> ‘<samp>SL</samp>’</dt>
2261 <dt> ‘<samp>SR</samp>’</dt>
2264 <dt> ‘<samp>TC</samp>’</dt>
2267 <dt> ‘<samp>TFL</samp>’</dt>
2268 <dd><p>top front left
2270 <dt> ‘<samp>TFC</samp>’</dt>
2271 <dd><p>top front center
2273 <dt> ‘<samp>TFR</samp>’</dt>
2274 <dd><p>top front right
2276 <dt> ‘<samp>TBL</samp>’</dt>
2277 <dd><p>top back left
2279 <dt> ‘<samp>TBC</samp>’</dt>
2280 <dd><p>top back center
2282 <dt> ‘<samp>TBR</samp>’</dt>
2283 <dd><p>top back right
2285 <dt> ‘<samp>DL</samp>’</dt>
2288 <dt> ‘<samp>DR</samp>’</dt>
2289 <dd><p>downmix right
2291 <dt> ‘<samp>WL</samp>’</dt>
2294 <dt> ‘<samp>WR</samp>’</dt>
2297 <dt> ‘<samp>SDL</samp>’</dt>
2298 <dd><p>surround direct left
2300 <dt> ‘<samp>SDR</samp>’</dt>
2301 <dd><p>surround direct right
2303 <dt> ‘<samp>LFE2</samp>’</dt>
2304 <dd><p>low frequency 2
2308 <p>Standard channel layout compositions can be specified by using the
2309 following identifiers:
2310 </p><dl compact="compact">
2311 <dt> ‘<samp>mono</samp>’</dt>
2314 <dt> ‘<samp>stereo</samp>’</dt>
2317 <dt> ‘<samp>2.1</samp>’</dt>
2320 <dt> ‘<samp>3.0</samp>’</dt>
2323 <dt> ‘<samp>3.0(back)</samp>’</dt>
2326 <dt> ‘<samp>4.0</samp>’</dt>
2329 <dt> ‘<samp>quad</samp>’</dt>
2332 <dt> ‘<samp>quad(side)</samp>’</dt>
2335 <dt> ‘<samp>3.1</samp>’</dt>
2338 <dt> ‘<samp>5.0</samp>’</dt>
2339 <dd><p>FL+FR+FC+BL+BR
2341 <dt> ‘<samp>5.0(side)</samp>’</dt>
2342 <dd><p>FL+FR+FC+SL+SR
2344 <dt> ‘<samp>4.1</samp>’</dt>
2345 <dd><p>FL+FR+FC+LFE+BC
2347 <dt> ‘<samp>5.1</samp>’</dt>
2348 <dd><p>FL+FR+FC+LFE+BL+BR
2350 <dt> ‘<samp>5.1(side)</samp>’</dt>
2351 <dd><p>FL+FR+FC+LFE+SL+SR
2353 <dt> ‘<samp>6.0</samp>’</dt>
2354 <dd><p>FL+FR+FC+BC+SL+SR
2356 <dt> ‘<samp>6.0(front)</samp>’</dt>
2357 <dd><p>FL+FR+FLC+FRC+SL+SR
2359 <dt> ‘<samp>hexagonal</samp>’</dt>
2360 <dd><p>FL+FR+FC+BL+BR+BC
2362 <dt> ‘<samp>6.1</samp>’</dt>
2363 <dd><p>FL+FR+FC+LFE+BC+SL+SR
2365 <dt> ‘<samp>6.1</samp>’</dt>
2366 <dd><p>FL+FR+FC+LFE+BL+BR+BC
2368 <dt> ‘<samp>6.1(front)</samp>’</dt>
2369 <dd><p>FL+FR+LFE+FLC+FRC+SL+SR
2371 <dt> ‘<samp>7.0</samp>’</dt>
2372 <dd><p>FL+FR+FC+BL+BR+SL+SR
2374 <dt> ‘<samp>7.0(front)</samp>’</dt>
2375 <dd><p>FL+FR+FC+FLC+FRC+SL+SR
2377 <dt> ‘<samp>7.1</samp>’</dt>
2378 <dd><p>FL+FR+FC+LFE+BL+BR+SL+SR
2380 <dt> ‘<samp>7.1(wide)</samp>’</dt>
2381 <dd><p>FL+FR+FC+LFE+BL+BR+FLC+FRC
2383 <dt> ‘<samp>7.1(wide-side)</samp>’</dt>
2384 <dd><p>FL+FR+FC+LFE+FLC+FRC+SL+SR
2386 <dt> ‘<samp>octagonal</samp>’</dt>
2387 <dd><p>FL+FR+FC+BL+BR+BC+SL+SR
2389 <dt> ‘<samp>downmix</samp>’</dt>
2394 <p>A custom channel layout can be specified as a sequence of terms, separated by
2395 ’+’ or ’|’. Each term can be:
2398 the name of a standard channel layout (e.g. ‘<samp>mono</samp>’,
2399 ‘<samp>stereo</samp>’, ‘<samp>4.0</samp>’, ‘<samp>quad</samp>’, ‘<samp>5.0</samp>’, etc.)
2402 the name of a single channel (e.g. ‘<samp>FL</samp>’, ‘<samp>FR</samp>’, ‘<samp>FC</samp>’, ‘<samp>LFE</samp>’, etc.)
2405 a number of channels, in decimal, optionally followed by ’c’, yielding
2406 the default channel layout for that number of channels (see the
2407 function <code>av_get_default_channel_layout</code>)
2410 a channel layout mask, in hexadecimal starting with "0x" (see the
2411 <code>AV_CH_*</code> macros in ‘<tt>libavutil/channel_layout.h</tt>’.
2414 <p>Starting from libavutil version 53 the trailing character "c" to
2415 specify a number of channels will be required, while a channel layout
2416 mask could also be specified as a decimal number (if and only if not
2417 followed by "c").
2419 <p>See also the function <code>av_get_channel_layout</code> defined in
2420 ‘<tt>libavutil/channel_layout.h</tt>’.
2422 <a name="Expression-Evaluation"></a>
2423 <h1 class="chapter"><a href="ffplay-all.html#toc-Expression-Evaluation">5. Expression Evaluation</a></h1>
2425 <p>When evaluating an arithmetic expression, FFmpeg uses an internal
2426 formula evaluator, implemented through the ‘<tt>libavutil/eval.h</tt>’
2429 <p>An expression may contain unary, binary operators, constants, and
2432 <p>Two expressions <var>expr1</var> and <var>expr2</var> can be combined to form
2433 another expression "<var>expr1</var>;<var>expr2</var>".
2434 <var>expr1</var> and <var>expr2</var> are evaluated in turn, and the new
2435 expression evaluates to the value of <var>expr2</var>.
2437 <p>The following binary operators are available: <code>+</code>, <code>-</code>,
2438 <code>*</code>, <code>/</code>, <code>^</code>.
2440 <p>The following unary operators are available: <code>+</code>, <code>-</code>.
2442 <p>The following functions are available:
2443 </p><dl compact="compact">
2444 <dt> ‘<samp>abs(x)</samp>’</dt>
2445 <dd><p>Compute absolute value of <var>x</var>.
2448 <dt> ‘<samp>acos(x)</samp>’</dt>
2449 <dd><p>Compute arccosine of <var>x</var>.
2452 <dt> ‘<samp>asin(x)</samp>’</dt>
2453 <dd><p>Compute arcsine of <var>x</var>.
2456 <dt> ‘<samp>atan(x)</samp>’</dt>
2457 <dd><p>Compute arctangent of <var>x</var>.
2460 <dt> ‘<samp>between(x, min, max)</samp>’</dt>
2461 <dd><p>Return 1 if <var>x</var> is greater than or equal to <var>min</var> and lesser than or
2462 equal to <var>max</var>, 0 otherwise.
2465 <dt> ‘<samp>bitand(x, y)</samp>’</dt>
2466 <dt> ‘<samp>bitor(x, y)</samp>’</dt>
2467 <dd><p>Compute bitwise and/or operation on <var>x</var> and <var>y</var>.
2469 <p>The results of the evaluation of <var>x</var> and <var>y</var> are converted to
2470 integers before executing the bitwise operation.
2472 <p>Note that both the conversion to integer and the conversion back to
2473 floating point can lose precision. Beware of unexpected results for
2474 large numbers (usually 2^53 and larger).
2477 <dt> ‘<samp>ceil(expr)</samp>’</dt>
2478 <dd><p>Round the value of expression <var>expr</var> upwards to the nearest
2479 integer. For example, "ceil(1.5)" is "2.0".
2482 <dt> ‘<samp>cos(x)</samp>’</dt>
2483 <dd><p>Compute cosine of <var>x</var>.
2486 <dt> ‘<samp>cosh(x)</samp>’</dt>
2487 <dd><p>Compute hyperbolic cosine of <var>x</var>.
2490 <dt> ‘<samp>eq(x, y)</samp>’</dt>
2491 <dd><p>Return 1 if <var>x</var> and <var>y</var> are equivalent, 0 otherwise.
2494 <dt> ‘<samp>exp(x)</samp>’</dt>
2495 <dd><p>Compute exponential of <var>x</var> (with base <code>e</code>, the Euler’s number).
2498 <dt> ‘<samp>floor(expr)</samp>’</dt>
2499 <dd><p>Round the value of expression <var>expr</var> downwards to the nearest
2500 integer. For example, "floor(-1.5)" is "-2.0".
2503 <dt> ‘<samp>gauss(x)</samp>’</dt>
2504 <dd><p>Compute Gauss function of <var>x</var>, corresponding to
2505 <code>exp(-x*x/2) / sqrt(2*PI)</code>.
2508 <dt> ‘<samp>gcd(x, y)</samp>’</dt>
2509 <dd><p>Return the greatest common divisor of <var>x</var> and <var>y</var>. If both <var>x</var> and
2510 <var>y</var> are 0 or either or both are less than zero then behavior is undefined.
2513 <dt> ‘<samp>gt(x, y)</samp>’</dt>
2514 <dd><p>Return 1 if <var>x</var> is greater than <var>y</var>, 0 otherwise.
2517 <dt> ‘<samp>gte(x, y)</samp>’</dt>
2518 <dd><p>Return 1 if <var>x</var> is greater than or equal to <var>y</var>, 0 otherwise.
2521 <dt> ‘<samp>hypot(x, y)</samp>’</dt>
2522 <dd><p>This function is similar to the C function with the same name; it returns
2523 "sqrt(<var>x</var>*<var>x</var> + <var>y</var>*<var>y</var>)", the length of the hypotenuse of a
2524 right triangle with sides of length <var>x</var> and <var>y</var>, or the distance of the
2525 point (<var>x</var>, <var>y</var>) from the origin.
2528 <dt> ‘<samp>if(x, y)</samp>’</dt>
2529 <dd><p>Evaluate <var>x</var>, and if the result is non-zero return the result of
2530 the evaluation of <var>y</var>, return 0 otherwise.
2533 <dt> ‘<samp>if(x, y, z)</samp>’</dt>
2534 <dd><p>Evaluate <var>x</var>, and if the result is non-zero return the evaluation
2535 result of <var>y</var>, otherwise the evaluation result of <var>z</var>.
2538 <dt> ‘<samp>ifnot(x, y)</samp>’</dt>
2539 <dd><p>Evaluate <var>x</var>, and if the result is zero return the result of the
2540 evaluation of <var>y</var>, return 0 otherwise.
2543 <dt> ‘<samp>ifnot(x, y, z)</samp>’</dt>
2544 <dd><p>Evaluate <var>x</var>, and if the result is zero return the evaluation
2545 result of <var>y</var>, otherwise the evaluation result of <var>z</var>.
2548 <dt> ‘<samp>isinf(x)</samp>’</dt>
2549 <dd><p>Return 1.0 if <var>x</var> is +/-INFINITY, 0.0 otherwise.
2552 <dt> ‘<samp>isnan(x)</samp>’</dt>
2553 <dd><p>Return 1.0 if <var>x</var> is NAN, 0.0 otherwise.
2556 <dt> ‘<samp>ld(var)</samp>’</dt>
2557 <dd><p>Allow to load the value of the internal variable with number
2558 <var>var</var>, which was previously stored with st(<var>var</var>, <var>expr</var>).
2559 The function returns the loaded value.
2562 <dt> ‘<samp>log(x)</samp>’</dt>
2563 <dd><p>Compute natural logarithm of <var>x</var>.
2566 <dt> ‘<samp>lt(x, y)</samp>’</dt>
2567 <dd><p>Return 1 if <var>x</var> is lesser than <var>y</var>, 0 otherwise.
2570 <dt> ‘<samp>lte(x, y)</samp>’</dt>
2571 <dd><p>Return 1 if <var>x</var> is lesser than or equal to <var>y</var>, 0 otherwise.
2574 <dt> ‘<samp>max(x, y)</samp>’</dt>
2575 <dd><p>Return the maximum between <var>x</var> and <var>y</var>.
2578 <dt> ‘<samp>min(x, y)</samp>’</dt>
2579 <dd><p>Return the maximum between <var>x</var> and <var>y</var>.
2582 <dt> ‘<samp>mod(x, y)</samp>’</dt>
2583 <dd><p>Compute the remainder of division of <var>x</var> by <var>y</var>.
2586 <dt> ‘<samp>not(expr)</samp>’</dt>
2587 <dd><p>Return 1.0 if <var>expr</var> is zero, 0.0 otherwise.
2590 <dt> ‘<samp>pow(x, y)</samp>’</dt>
2591 <dd><p>Compute the power of <var>x</var> elevated <var>y</var>, it is equivalent to
2592 "(<var>x</var>)^(<var>y</var>)".
2595 <dt> ‘<samp>print(t)</samp>’</dt>
2596 <dt> ‘<samp>print(t, l)</samp>’</dt>
2597 <dd><p>Print the value of expression <var>t</var> with loglevel <var>l</var>. If
2598 <var>l</var> is not specified then a default log level is used.
2599 Returns the value of the expression printed.
2601 <p>Prints t with loglevel l
2604 <dt> ‘<samp>random(x)</samp>’</dt>
2605 <dd><p>Return a pseudo random value between 0.0 and 1.0. <var>x</var> is the index of the
2606 internal variable which will be used to save the seed/state.
2609 <dt> ‘<samp>root(expr, max)</samp>’</dt>
2610 <dd><p>Find an input value for which the function represented by <var>expr</var>
2611 with argument <var>ld(0)</var> is 0 in the interval 0..<var>max</var>.
2613 <p>The expression in <var>expr</var> must denote a continuous function or the
2614 result is undefined.
2616 <p><var>ld(0)</var> is used to represent the function input value, which means
2617 that the given expression will be evaluated multiple times with
2618 various input values that the expression can access through
2619 <code>ld(0)</code>. When the expression evaluates to 0 then the
2620 corresponding input value will be returned.
2623 <dt> ‘<samp>sin(x)</samp>’</dt>
2624 <dd><p>Compute sine of <var>x</var>.
2627 <dt> ‘<samp>sinh(x)</samp>’</dt>
2628 <dd><p>Compute hyperbolic sine of <var>x</var>.
2631 <dt> ‘<samp>sqrt(expr)</samp>’</dt>
2632 <dd><p>Compute the square root of <var>expr</var>. This is equivalent to
2633 "(<var>expr</var>)^.5".
2636 <dt> ‘<samp>squish(x)</samp>’</dt>
2637 <dd><p>Compute expression <code>1/(1 + exp(4*x))</code>.
2640 <dt> ‘<samp>st(var, expr)</samp>’</dt>
2641 <dd><p>Allow to store the value of the expression <var>expr</var> in an internal
2642 variable. <var>var</var> specifies the number of the variable where to
2643 store the value, and it is a value ranging from 0 to 9. The function
2644 returns the value stored in the internal variable.
2645 Note, Variables are currently not shared between expressions.
2648 <dt> ‘<samp>tan(x)</samp>’</dt>
2649 <dd><p>Compute tangent of <var>x</var>.
2652 <dt> ‘<samp>tanh(x)</samp>’</dt>
2653 <dd><p>Compute hyperbolic tangent of <var>x</var>.
2656 <dt> ‘<samp>taylor(expr, x)</samp>’</dt>
2657 <dt> ‘<samp>taylor(expr, x, id)</samp>’</dt>
2658 <dd><p>Evaluate a Taylor series at <var>x</var>, given an expression representing
2659 the <code>ld(id)</code>-th derivative of a function at 0.
2661 <p>When the series does not converge the result is undefined.
2663 <p><var>ld(id)</var> is used to represent the derivative order in <var>expr</var>,
2664 which means that the given expression will be evaluated multiple times
2665 with various input values that the expression can access through
2666 <code>ld(id)</code>. If <var>id</var> is not specified then 0 is assumed.
2668 <p>Note, when you have the derivatives at y instead of 0,
2669 <code>taylor(expr, x-y)</code> can be used.
2672 <dt> ‘<samp>time(0)</samp>’</dt>
2673 <dd><p>Return the current (wallclock) time in seconds.
2676 <dt> ‘<samp>trunc(expr)</samp>’</dt>
2677 <dd><p>Round the value of expression <var>expr</var> towards zero to the nearest
2678 integer. For example, "trunc(-1.5)" is "-1.0".
2681 <dt> ‘<samp>while(cond, expr)</samp>’</dt>
2682 <dd><p>Evaluate expression <var>expr</var> while the expression <var>cond</var> is
2683 non-zero, and returns the value of the last <var>expr</var> evaluation, or
2684 NAN if <var>cond</var> was always false.
2688 <p>The following constants are available:
2689 </p><dl compact="compact">
2690 <dt> ‘<samp>PI</samp>’</dt>
2691 <dd><p>area of the unit disc, approximately 3.14
2693 <dt> ‘<samp>E</samp>’</dt>
2694 <dd><p>exp(1) (Euler’s number), approximately 2.718
2696 <dt> ‘<samp>PHI</samp>’</dt>
2697 <dd><p>golden ratio (1+sqrt(5))/2, approximately 1.618
2701 <p>Assuming that an expression is considered "true" if it has a non-zero
2704 <p><code>*</code> works like AND
2706 <p><code>+</code> works like OR
2708 <p>For example the construct:
2709 </p><table><tr><td> </td><td><pre class="example">if (A AND B) then C
2710 </pre></td></tr></table>
2711 <p>is equivalent to:
2712 </p><table><tr><td> </td><td><pre class="example">if(A*B, C)
2713 </pre></td></tr></table>
2715 <p>In your C code, you can extend the list of unary and binary functions,
2716 and define recognized constants, so that they are available for your
2719 <p>The evaluator also recognizes the International System unit prefixes.
2720 If ’i’ is appended after the prefix, binary prefixes are used, which
2721 are based on powers of 1024 instead of powers of 1000.
2722 The ’B’ postfix multiplies the value by 8, and can be appended after a
2723 unit prefix or used alone. This allows using for example ’KB’, ’MiB’,
2724 ’G’ and ’B’ as number postfix.
2726 <p>The list of available International System prefixes follows, with
2727 indication of the corresponding powers of 10 and of 2.
2728 </p><dl compact="compact">
2729 <dt> ‘<samp>y</samp>’</dt>
2730 <dd><p>10^-24 / 2^-80
2732 <dt> ‘<samp>z</samp>’</dt>
2733 <dd><p>10^-21 / 2^-70
2735 <dt> ‘<samp>a</samp>’</dt>
2736 <dd><p>10^-18 / 2^-60
2738 <dt> ‘<samp>f</samp>’</dt>
2739 <dd><p>10^-15 / 2^-50
2741 <dt> ‘<samp>p</samp>’</dt>
2742 <dd><p>10^-12 / 2^-40
2744 <dt> ‘<samp>n</samp>’</dt>
2745 <dd><p>10^-9 / 2^-30
2747 <dt> ‘<samp>u</samp>’</dt>
2748 <dd><p>10^-6 / 2^-20
2750 <dt> ‘<samp>m</samp>’</dt>
2751 <dd><p>10^-3 / 2^-10
2753 <dt> ‘<samp>c</samp>’</dt>
2756 <dt> ‘<samp>d</samp>’</dt>
2759 <dt> ‘<samp>h</samp>’</dt>
2762 <dt> ‘<samp>k</samp>’</dt>
2765 <dt> ‘<samp>K</samp>’</dt>
2768 <dt> ‘<samp>M</samp>’</dt>
2771 <dt> ‘<samp>G</samp>’</dt>
2774 <dt> ‘<samp>T</samp>’</dt>
2777 <dt> ‘<samp>P</samp>’</dt>
2780 <dt> ‘<samp>E</samp>’</dt>
2783 <dt> ‘<samp>Z</samp>’</dt>
2786 <dt> ‘<samp>Y</samp>’</dt>
2792 <a name="OpenCL-Options"></a>
2793 <h1 class="chapter"><a href="ffplay-all.html#toc-OpenCL-Options">6. OpenCL Options</a></h1>
2795 <p>When FFmpeg is configured with <code>--enable-opencl</code>, it is possible
2796 to set the options for the global OpenCL context.
2798 <p>The list of supported options follows:
2800 <dl compact="compact">
2801 <dt> ‘<samp>build_options</samp>’</dt>
2802 <dd><p>Set build options used to compile the registered kernels.
2804 <p>See reference "OpenCL Specification Version: 1.2 chapter 5.6.4".
2807 <dt> ‘<samp>platform_idx</samp>’</dt>
2808 <dd><p>Select the index of the platform to run OpenCL code.
2810 <p>The specified index must be one of the indexes in the device list
2811 which can be obtained with <code>ffmpeg -opencl_bench</code> or <code>av_opencl_get_device_list()</code>.
2814 <dt> ‘<samp>device_idx</samp>’</dt>
2815 <dd><p>Select the index of the device used to run OpenCL code.
2817 <p>The specifed index must be one of the indexes in the device list which
2818 can be obtained with <code>ffmpeg -opencl_bench</code> or <code>av_opencl_get_device_list()</code>.
2823 <p><a name="codec_002doptions"></a>
2824 </p><a name="Codec-Options"></a>
2825 <h1 class="chapter"><a href="ffplay-all.html#toc-Codec-Options">7. Codec Options</a></h1>
2827 <p>libavcodec provides some generic global options, which can be set on
2828 all the encoders and decoders. In addition each codec may support
2829 so-called private options, which are specific for a given codec.
2831 <p>Sometimes, a global option may only affect a specific kind of codec,
2832 and may be unsensical or ignored by another, so you need to be aware
2833 of the meaning of the specified options. Also some options are
2834 meant only for decoding or encoding.
2836 <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
2837 FFmpeg tools, or by setting the value explicitly in the
2838 <code>AVCodecContext</code> options or using the ‘<tt>libavutil/opt.h</tt>’ API
2839 for programmatic use.
2841 <p>The list of supported options follow:
2843 <dl compact="compact">
2844 <dt> ‘<samp>b <var>integer</var> (<em>encoding,audio,video</em>)</samp>’</dt>
2845 <dd><p>Set bitrate in bits/s. Default value is 200K.
2848 <dt> ‘<samp>ab <var>integer</var> (<em>encoding,audio</em>)</samp>’</dt>
2849 <dd><p>Set audio bitrate (in bits/s). Default value is 128K.
2852 <dt> ‘<samp>bt <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
2853 <dd><p>Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate
2854 tolerance specifies how far ratecontrol is willing to deviate from the
2855 target average bitrate value. This is not related to min/max
2856 bitrate. Lowering tolerance too much has an adverse effect on quality.
2859 <dt> ‘<samp>flags <var>flags</var> (<em>decoding/encoding,audio,video,subtitles</em>)</samp>’</dt>
2860 <dd><p>Set generic flags.
2863 </p><dl compact="compact">
2864 <dt> ‘<samp>mv4</samp>’</dt>
2865 <dd><p>Use four motion vector by macroblock (mpeg4).
2867 <dt> ‘<samp>qpel</samp>’</dt>
2868 <dd><p>Use 1/4 pel motion compensation.
2870 <dt> ‘<samp>loop</samp>’</dt>
2871 <dd><p>Use loop filter.
2873 <dt> ‘<samp>qscale</samp>’</dt>
2874 <dd><p>Use fixed qscale.
2876 <dt> ‘<samp>gmc</samp>’</dt>
2879 <dt> ‘<samp>mv0</samp>’</dt>
2880 <dd><p>Always try a mb with mv=<0,0>.
2882 <dt> ‘<samp>input_preserved</samp>’</dt>
2883 <dt> ‘<samp>pass1</samp>’</dt>
2884 <dd><p>Use internal 2pass ratecontrol in first pass mode.
2886 <dt> ‘<samp>pass2</samp>’</dt>
2887 <dd><p>Use internal 2pass ratecontrol in second pass mode.
2889 <dt> ‘<samp>gray</samp>’</dt>
2890 <dd><p>Only decode/encode grayscale.
2892 <dt> ‘<samp>emu_edge</samp>’</dt>
2893 <dd><p>Do not draw edges.
2895 <dt> ‘<samp>psnr</samp>’</dt>
2896 <dd><p>Set error[?] variables during encoding.
2898 <dt> ‘<samp>truncated</samp>’</dt>
2899 <dt> ‘<samp>naq</samp>’</dt>
2900 <dd><p>Normalize adaptive quantization.
2902 <dt> ‘<samp>ildct</samp>’</dt>
2903 <dd><p>Use interlaced DCT.
2905 <dt> ‘<samp>low_delay</samp>’</dt>
2906 <dd><p>Force low delay.
2908 <dt> ‘<samp>global_header</samp>’</dt>
2909 <dd><p>Place global headers in extradata instead of every keyframe.
2911 <dt> ‘<samp>bitexact</samp>’</dt>
2912 <dd><p>Use only bitexact stuff (except (I)DCT).
2914 <dt> ‘<samp>aic</samp>’</dt>
2915 <dd><p>Apply H263 advanced intra coding / mpeg4 ac prediction.
2917 <dt> ‘<samp>cbp</samp>’</dt>
2918 <dd><p>Deprecated, use mpegvideo private options instead.
2920 <dt> ‘<samp>qprd</samp>’</dt>
2921 <dd><p>Deprecated, use mpegvideo private options instead.
2923 <dt> ‘<samp>ilme</samp>’</dt>
2924 <dd><p>Apply interlaced motion estimation.
2926 <dt> ‘<samp>cgop</samp>’</dt>
2927 <dd><p>Use closed gop.
2932 <dt> ‘<samp>me_method <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
2933 <dd><p>Set motion estimation method.
2936 </p><dl compact="compact">
2937 <dt> ‘<samp>zero</samp>’</dt>
2938 <dd><p>zero motion estimation (fastest)
2940 <dt> ‘<samp>full</samp>’</dt>
2941 <dd><p>full motion estimation (slowest)
2943 <dt> ‘<samp>epzs</samp>’</dt>
2944 <dd><p>EPZS motion estimation (default)
2946 <dt> ‘<samp>esa</samp>’</dt>
2947 <dd><p>esa motion estimation (alias for full)
2949 <dt> ‘<samp>tesa</samp>’</dt>
2950 <dd><p>tesa motion estimation
2952 <dt> ‘<samp>dia</samp>’</dt>
2953 <dd><p>dia motion estimation (alias for epzs)
2955 <dt> ‘<samp>log</samp>’</dt>
2956 <dd><p>log motion estimation
2958 <dt> ‘<samp>phods</samp>’</dt>
2959 <dd><p>phods motion estimation
2961 <dt> ‘<samp>x1</samp>’</dt>
2962 <dd><p>X1 motion estimation
2964 <dt> ‘<samp>hex</samp>’</dt>
2965 <dd><p>hex motion estimation
2967 <dt> ‘<samp>umh</samp>’</dt>
2968 <dd><p>umh motion estimation
2970 <dt> ‘<samp>iter</samp>’</dt>
2971 <dd><p>iter motion estimation
2976 <dt> ‘<samp>extradata_size <var>integer</var></samp>’</dt>
2977 <dd><p>Set extradata size.
2980 <dt> ‘<samp>time_base <var>rational number</var></samp>’</dt>
2981 <dd><p>Set codec time base.
2983 <p>It is the fundamental unit of time (in seconds) in terms of which
2984 frame timestamps are represented. For fixed-fps content, timebase
2985 should be <code>1 / frame_rate</code> and timestamp increments should be
2989 <dt> ‘<samp>g <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
2990 <dd><p>Set the group of picture size. Default value is 12.
2993 <dt> ‘<samp>ar <var>integer</var> (<em>decoding/encoding,audio</em>)</samp>’</dt>
2994 <dd><p>Set audio sampling rate (in Hz).
2997 <dt> ‘<samp>ac <var>integer</var> (<em>decoding/encoding,audio</em>)</samp>’</dt>
2998 <dd><p>Set number of audio channels.
3001 <dt> ‘<samp>cutoff <var>integer</var> (<em>encoding,audio</em>)</samp>’</dt>
3002 <dd><p>Set cutoff bandwidth.
3005 <dt> ‘<samp>frame_size <var>integer</var> (<em>encoding,audio</em>)</samp>’</dt>
3006 <dd><p>Set audio frame size.
3008 <p>Each submitted frame except the last must contain exactly frame_size
3009 samples per channel. May be 0 when the codec has
3010 CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not
3011 restricted. It is set by some decoders to indicate constant frame
3015 <dt> ‘<samp>frame_number <var>integer</var></samp>’</dt>
3016 <dd><p>Set the frame number.
3019 <dt> ‘<samp>delay <var>integer</var></samp>’</dt>
3020 <dt> ‘<samp>qcomp <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3021 <dd><p>Set video quantizer scale compression (VBR). It is used as a constant
3022 in the ratecontrol equation. Recommended range for default rc_eq:
3026 <dt> ‘<samp>qblur <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3027 <dd><p>Set video quantizer scale blur (VBR).
3030 <dt> ‘<samp>qmin <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3031 <dd><p>Set min video quantizer scale (VBR). Must be included between -1 and
3032 69, default value is 2.
3035 <dt> ‘<samp>qmax <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3036 <dd><p>Set max video quantizer scale (VBR). Must be included between -1 and
3037 1024, default value is 31.
3040 <dt> ‘<samp>qdiff <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3041 <dd><p>Set max difference between the quantizer scale (VBR).
3044 <dt> ‘<samp>bf <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3045 <dd><p>Set max number of B frames between non-B-frames.
3047 <p>Must be an integer between -1 and 16. 0 means that B-frames are
3048 disabled. If a value of -1 is used, it will choose an automatic value
3049 depending on the encoder.
3051 <p>Default value is 0.
3054 <dt> ‘<samp>b_qfactor <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3055 <dd><p>Set qp factor between P and B frames.
3058 <dt> ‘<samp>rc_strategy <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3059 <dd><p>Set ratecontrol method.
3062 <dt> ‘<samp>b_strategy <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3063 <dd><p>Set strategy to choose between I/P/B-frames.
3066 <dt> ‘<samp>ps <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3067 <dd><p>Set RTP payload size in bytes.
3070 <dt> ‘<samp>mv_bits <var>integer</var></samp>’</dt>
3071 <dt> ‘<samp>header_bits <var>integer</var></samp>’</dt>
3072 <dt> ‘<samp>i_tex_bits <var>integer</var></samp>’</dt>
3073 <dt> ‘<samp>p_tex_bits <var>integer</var></samp>’</dt>
3074 <dt> ‘<samp>i_count <var>integer</var></samp>’</dt>
3075 <dt> ‘<samp>p_count <var>integer</var></samp>’</dt>
3076 <dt> ‘<samp>skip_count <var>integer</var></samp>’</dt>
3077 <dt> ‘<samp>misc_bits <var>integer</var></samp>’</dt>
3078 <dt> ‘<samp>frame_bits <var>integer</var></samp>’</dt>
3079 <dt> ‘<samp>codec_tag <var>integer</var></samp>’</dt>
3080 <dt> ‘<samp>bug <var>flags</var> (<em>decoding,video</em>)</samp>’</dt>
3081 <dd><p>Workaround not auto detected encoder bugs.
3084 </p><dl compact="compact">
3085 <dt> ‘<samp>autodetect</samp>’</dt>
3086 <dt> ‘<samp>old_msmpeg4</samp>’</dt>
3087 <dd><p>some old lavc generated msmpeg4v3 files (no autodetection)
3089 <dt> ‘<samp>xvid_ilace</samp>’</dt>
3090 <dd><p>Xvid interlacing bug (autodetected if fourcc==XVIX)
3092 <dt> ‘<samp>ump4</samp>’</dt>
3093 <dd><p>(autodetected if fourcc==UMP4)
3095 <dt> ‘<samp>no_padding</samp>’</dt>
3096 <dd><p>padding bug (autodetected)
3098 <dt> ‘<samp>amv</samp>’</dt>
3099 <dt> ‘<samp>ac_vlc</samp>’</dt>
3100 <dd><p>illegal vlc bug (autodetected per fourcc)
3102 <dt> ‘<samp>qpel_chroma</samp>’</dt>
3103 <dt> ‘<samp>std_qpel</samp>’</dt>
3104 <dd><p>old standard qpel (autodetected per fourcc/version)
3106 <dt> ‘<samp>qpel_chroma2</samp>’</dt>
3107 <dt> ‘<samp>direct_blocksize</samp>’</dt>
3108 <dd><p>direct-qpel-blocksize bug (autodetected per fourcc/version)
3110 <dt> ‘<samp>edge</samp>’</dt>
3111 <dd><p>edge padding bug (autodetected per fourcc/version)
3113 <dt> ‘<samp>hpel_chroma</samp>’</dt>
3114 <dt> ‘<samp>dc_clip</samp>’</dt>
3115 <dt> ‘<samp>ms</samp>’</dt>
3116 <dd><p>Workaround various bugs in microsoft broken decoders.
3118 <dt> ‘<samp>trunc</samp>’</dt>
3119 <dd><p>trancated frames
3124 <dt> ‘<samp>lelim <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3125 <dd><p>Set single coefficient elimination threshold for luminance (negative
3126 values also consider DC coefficient).
3129 <dt> ‘<samp>celim <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3130 <dd><p>Set single coefficient elimination threshold for chrominance (negative
3131 values also consider dc coefficient)
3134 <dt> ‘<samp>strict <var>integer</var> (<em>decoding/encoding,audio,video</em>)</samp>’</dt>
3135 <dd><p>Specify how strictly to follow the standards.
3138 </p><dl compact="compact">
3139 <dt> ‘<samp>very</samp>’</dt>
3140 <dd><p>strictly conform to a older more strict version of the spec or reference software
3142 <dt> ‘<samp>strict</samp>’</dt>
3143 <dd><p>strictly conform to all the things in the spec no matter what consequences
3145 <dt> ‘<samp>normal</samp>’</dt>
3146 <dt> ‘<samp>unofficial</samp>’</dt>
3147 <dd><p>allow unofficial extensions
3149 <dt> ‘<samp>experimental</samp>’</dt>
3150 <dd><p>allow non standardized experimental things, experimental
3151 (unfinished/work in progress/not well tested) decoders and encoders.
3152 Note: experimental decoders can pose a security risk, do not use this for
3153 decoding untrusted input.
3158 <dt> ‘<samp>b_qoffset <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3159 <dd><p>Set QP offset between P and B frames.
3162 <dt> ‘<samp>err_detect <var>flags</var> (<em>decoding,audio,video</em>)</samp>’</dt>
3163 <dd><p>Set error detection flags.
3166 </p><dl compact="compact">
3167 <dt> ‘<samp>crccheck</samp>’</dt>
3168 <dd><p>verify embedded CRCs
3170 <dt> ‘<samp>bitstream</samp>’</dt>
3171 <dd><p>detect bitstream specification deviations
3173 <dt> ‘<samp>buffer</samp>’</dt>
3174 <dd><p>detect improper bitstream length
3176 <dt> ‘<samp>explode</samp>’</dt>
3177 <dd><p>abort decoding on minor error detection
3179 <dt> ‘<samp>careful</samp>’</dt>
3180 <dd><p>consider things that violate the spec and have not been seen in the wild as errors
3182 <dt> ‘<samp>compliant</samp>’</dt>
3183 <dd><p>consider all spec non compliancies as errors
3185 <dt> ‘<samp>aggressive</samp>’</dt>
3186 <dd><p>consider things that a sane encoder should not do as an error
3191 <dt> ‘<samp>has_b_frames <var>integer</var></samp>’</dt>
3192 <dt> ‘<samp>block_align <var>integer</var></samp>’</dt>
3193 <dt> ‘<samp>mpeg_quant <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3194 <dd><p>Use MPEG quantizers instead of H.263.
3197 <dt> ‘<samp>qsquish <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3198 <dd><p>How to keep quantizer between qmin and qmax (0 = clip, 1 = use
3199 differentiable function).
3202 <dt> ‘<samp>rc_qmod_amp <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3203 <dd><p>Set experimental quantizer modulation.
3206 <dt> ‘<samp>rc_qmod_freq <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3207 <dd><p>Set experimental quantizer modulation.
3210 <dt> ‘<samp>rc_override_count <var>integer</var></samp>’</dt>
3211 <dt> ‘<samp>rc_eq <var>string</var> (<em>encoding,video</em>)</samp>’</dt>
3212 <dd><p>Set rate control equation. When computing the expression, besides the
3213 standard functions defined in the section ’Expression Evaluation’, the
3214 following functions are available: bits2qp(bits), qp2bits(qp). Also
3215 the following constants are available: iTex pTex tex mv fCode iCount
3216 mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex
3220 <dt> ‘<samp>maxrate <var>integer</var> (<em>encoding,audio,video</em>)</samp>’</dt>
3221 <dd><p>Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
3224 <dt> ‘<samp>minrate <var>integer</var> (<em>encoding,audio,video</em>)</samp>’</dt>
3225 <dd><p>Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR
3226 encode. It is of little use elsewise.
3229 <dt> ‘<samp>bufsize <var>integer</var> (<em>encoding,audio,video</em>)</samp>’</dt>
3230 <dd><p>Set ratecontrol buffer size (in bits).
3233 <dt> ‘<samp>rc_buf_aggressivity <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3234 <dd><p>Currently useless.
3237 <dt> ‘<samp>i_qfactor <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3238 <dd><p>Set QP factor between P and I frames.
3241 <dt> ‘<samp>i_qoffset <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3242 <dd><p>Set QP offset between P and I frames.
3245 <dt> ‘<samp>rc_init_cplx <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3246 <dd><p>Set initial complexity for 1-pass encoding.
3249 <dt> ‘<samp>dct <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3250 <dd><p>Set DCT algorithm.
3253 </p><dl compact="compact">
3254 <dt> ‘<samp>auto</samp>’</dt>
3255 <dd><p>autoselect a good one (default)
3257 <dt> ‘<samp>fastint</samp>’</dt>
3260 <dt> ‘<samp>int</samp>’</dt>
3261 <dd><p>accurate integer
3263 <dt> ‘<samp>mmx</samp>’</dt>
3264 <dt> ‘<samp>altivec</samp>’</dt>
3265 <dt> ‘<samp>faan</samp>’</dt>
3266 <dd><p>floating point AAN DCT
3271 <dt> ‘<samp>lumi_mask <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3272 <dd><p>Compress bright areas stronger than medium ones.
3275 <dt> ‘<samp>tcplx_mask <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3276 <dd><p>Set temporal complexity masking.
3279 <dt> ‘<samp>scplx_mask <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3280 <dd><p>Set spatial complexity masking.
3283 <dt> ‘<samp>p_mask <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3284 <dd><p>Set inter masking.
3287 <dt> ‘<samp>dark_mask <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3288 <dd><p>Compress dark areas stronger than medium ones.
3291 <dt> ‘<samp>idct <var>integer</var> (<em>decoding/encoding,video</em>)</samp>’</dt>
3292 <dd><p>Select IDCT implementation.
3295 </p><dl compact="compact">
3296 <dt> ‘<samp>auto</samp>’</dt>
3297 <dt> ‘<samp>int</samp>’</dt>
3298 <dt> ‘<samp>simple</samp>’</dt>
3299 <dt> ‘<samp>simplemmx</samp>’</dt>
3300 <dt> ‘<samp>arm</samp>’</dt>
3301 <dt> ‘<samp>altivec</samp>’</dt>
3302 <dt> ‘<samp>sh4</samp>’</dt>
3303 <dt> ‘<samp>simplearm</samp>’</dt>
3304 <dt> ‘<samp>simplearmv5te</samp>’</dt>
3305 <dt> ‘<samp>simplearmv6</samp>’</dt>
3306 <dt> ‘<samp>simpleneon</samp>’</dt>
3307 <dt> ‘<samp>simplealpha</samp>’</dt>
3308 <dt> ‘<samp>ipp</samp>’</dt>
3309 <dt> ‘<samp>xvidmmx</samp>’</dt>
3310 <dt> ‘<samp>faani</samp>’</dt>
3311 <dd><p>floating point AAN IDCT
3316 <dt> ‘<samp>slice_count <var>integer</var></samp>’</dt>
3317 <dt> ‘<samp>ec <var>flags</var> (<em>decoding,video</em>)</samp>’</dt>
3318 <dd><p>Set error concealment strategy.
3321 </p><dl compact="compact">
3322 <dt> ‘<samp>guess_mvs</samp>’</dt>
3323 <dd><p>iterative motion vector (MV) search (slow)
3325 <dt> ‘<samp>deblock</samp>’</dt>
3326 <dd><p>use strong deblock filter for damaged MBs
3331 <dt> ‘<samp>bits_per_coded_sample <var>integer</var></samp>’</dt>
3332 <dt> ‘<samp>pred <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3333 <dd><p>Set prediction method.
3336 </p><dl compact="compact">
3337 <dt> ‘<samp>left</samp>’</dt>
3338 <dt> ‘<samp>plane</samp>’</dt>
3339 <dt> ‘<samp>median</samp>’</dt>
3343 <dt> ‘<samp>aspect <var>rational number</var> (<em>encoding,video</em>)</samp>’</dt>
3344 <dd><p>Set sample aspect ratio.
3347 <dt> ‘<samp>debug <var>flags</var> (<em>decoding/encoding,audio,video,subtitles</em>)</samp>’</dt>
3348 <dd><p>Print specific debug info.
3351 </p><dl compact="compact">
3352 <dt> ‘<samp>pict</samp>’</dt>
3355 <dt> ‘<samp>rc</samp>’</dt>
3358 <dt> ‘<samp>bitstream</samp>’</dt>
3359 <dt> ‘<samp>mb_type</samp>’</dt>
3360 <dd><p>macroblock (MB) type
3362 <dt> ‘<samp>qp</samp>’</dt>
3363 <dd><p>per-block quantization parameter (QP)
3365 <dt> ‘<samp>mv</samp>’</dt>
3366 <dd><p>motion vector
3368 <dt> ‘<samp>dct_coeff</samp>’</dt>
3369 <dt> ‘<samp>skip</samp>’</dt>
3370 <dt> ‘<samp>startcode</samp>’</dt>
3371 <dt> ‘<samp>pts</samp>’</dt>
3372 <dt> ‘<samp>er</samp>’</dt>
3373 <dd><p>error recognition
3375 <dt> ‘<samp>mmco</samp>’</dt>
3376 <dd><p>memory management control operations (H.264)
3378 <dt> ‘<samp>bugs</samp>’</dt>
3379 <dt> ‘<samp>vis_qp</samp>’</dt>
3380 <dd><p>visualize quantization parameter (QP), lower QP are tinted greener
3382 <dt> ‘<samp>vis_mb_type</samp>’</dt>
3383 <dd><p>visualize block types
3385 <dt> ‘<samp>buffers</samp>’</dt>
3386 <dd><p>picture buffer allocations
3388 <dt> ‘<samp>thread_ops</samp>’</dt>
3389 <dd><p>threading operations
3394 <dt> ‘<samp>vismv <var>integer</var> (<em>decoding,video</em>)</samp>’</dt>
3395 <dd><p>Visualize motion vectors (MVs).
3398 </p><dl compact="compact">
3399 <dt> ‘<samp>pf</samp>’</dt>
3400 <dd><p>forward predicted MVs of P-frames
3402 <dt> ‘<samp>bf</samp>’</dt>
3403 <dd><p>forward predicted MVs of B-frames
3405 <dt> ‘<samp>bb</samp>’</dt>
3406 <dd><p>backward predicted MVs of B-frames
3411 <dt> ‘<samp>cmp <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3412 <dd><p>Set full pel me compare function.
3415 </p><dl compact="compact">
3416 <dt> ‘<samp>sad</samp>’</dt>
3417 <dd><p>sum of absolute differences, fast (default)
3419 <dt> ‘<samp>sse</samp>’</dt>
3420 <dd><p>sum of squared errors
3422 <dt> ‘<samp>satd</samp>’</dt>
3423 <dd><p>sum of absolute Hadamard transformed differences
3425 <dt> ‘<samp>dct</samp>’</dt>
3426 <dd><p>sum of absolute DCT transformed differences
3428 <dt> ‘<samp>psnr</samp>’</dt>
3429 <dd><p>sum of squared quantization errors (avoid, low quality)
3431 <dt> ‘<samp>bit</samp>’</dt>
3432 <dd><p>number of bits needed for the block
3434 <dt> ‘<samp>rd</samp>’</dt>
3435 <dd><p>rate distortion optimal, slow
3437 <dt> ‘<samp>zero</samp>’</dt>
3440 <dt> ‘<samp>vsad</samp>’</dt>
3441 <dd><p>sum of absolute vertical differences
3443 <dt> ‘<samp>vsse</samp>’</dt>
3444 <dd><p>sum of squared vertical differences
3446 <dt> ‘<samp>nsse</samp>’</dt>
3447 <dd><p>noise preserving sum of squared differences
3449 <dt> ‘<samp>w53</samp>’</dt>
3450 <dd><p>5/3 wavelet, only used in snow
3452 <dt> ‘<samp>w97</samp>’</dt>
3453 <dd><p>9/7 wavelet, only used in snow
3455 <dt> ‘<samp>dctmax</samp>’</dt>
3456 <dt> ‘<samp>chroma</samp>’</dt>
3460 <dt> ‘<samp>subcmp <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3461 <dd><p>Set sub pel me compare function.
3464 </p><dl compact="compact">
3465 <dt> ‘<samp>sad</samp>’</dt>
3466 <dd><p>sum of absolute differences, fast (default)
3468 <dt> ‘<samp>sse</samp>’</dt>
3469 <dd><p>sum of squared errors
3471 <dt> ‘<samp>satd</samp>’</dt>
3472 <dd><p>sum of absolute Hadamard transformed differences
3474 <dt> ‘<samp>dct</samp>’</dt>
3475 <dd><p>sum of absolute DCT transformed differences
3477 <dt> ‘<samp>psnr</samp>’</dt>
3478 <dd><p>sum of squared quantization errors (avoid, low quality)
3480 <dt> ‘<samp>bit</samp>’</dt>
3481 <dd><p>number of bits needed for the block
3483 <dt> ‘<samp>rd</samp>’</dt>
3484 <dd><p>rate distortion optimal, slow
3486 <dt> ‘<samp>zero</samp>’</dt>
3489 <dt> ‘<samp>vsad</samp>’</dt>
3490 <dd><p>sum of absolute vertical differences
3492 <dt> ‘<samp>vsse</samp>’</dt>
3493 <dd><p>sum of squared vertical differences
3495 <dt> ‘<samp>nsse</samp>’</dt>
3496 <dd><p>noise preserving sum of squared differences
3498 <dt> ‘<samp>w53</samp>’</dt>
3499 <dd><p>5/3 wavelet, only used in snow
3501 <dt> ‘<samp>w97</samp>’</dt>
3502 <dd><p>9/7 wavelet, only used in snow
3504 <dt> ‘<samp>dctmax</samp>’</dt>
3505 <dt> ‘<samp>chroma</samp>’</dt>
3509 <dt> ‘<samp>mbcmp <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3510 <dd><p>Set macroblock compare function.
3513 </p><dl compact="compact">
3514 <dt> ‘<samp>sad</samp>’</dt>
3515 <dd><p>sum of absolute differences, fast (default)
3517 <dt> ‘<samp>sse</samp>’</dt>
3518 <dd><p>sum of squared errors
3520 <dt> ‘<samp>satd</samp>’</dt>
3521 <dd><p>sum of absolute Hadamard transformed differences
3523 <dt> ‘<samp>dct</samp>’</dt>
3524 <dd><p>sum of absolute DCT transformed differences
3526 <dt> ‘<samp>psnr</samp>’</dt>
3527 <dd><p>sum of squared quantization errors (avoid, low quality)
3529 <dt> ‘<samp>bit</samp>’</dt>
3530 <dd><p>number of bits needed for the block
3532 <dt> ‘<samp>rd</samp>’</dt>
3533 <dd><p>rate distortion optimal, slow
3535 <dt> ‘<samp>zero</samp>’</dt>
3538 <dt> ‘<samp>vsad</samp>’</dt>
3539 <dd><p>sum of absolute vertical differences
3541 <dt> ‘<samp>vsse</samp>’</dt>
3542 <dd><p>sum of squared vertical differences
3544 <dt> ‘<samp>nsse</samp>’</dt>
3545 <dd><p>noise preserving sum of squared differences
3547 <dt> ‘<samp>w53</samp>’</dt>
3548 <dd><p>5/3 wavelet, only used in snow
3550 <dt> ‘<samp>w97</samp>’</dt>
3551 <dd><p>9/7 wavelet, only used in snow
3553 <dt> ‘<samp>dctmax</samp>’</dt>
3554 <dt> ‘<samp>chroma</samp>’</dt>
3558 <dt> ‘<samp>ildctcmp <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3559 <dd><p>Set interlaced dct compare function.
3562 </p><dl compact="compact">
3563 <dt> ‘<samp>sad</samp>’</dt>
3564 <dd><p>sum of absolute differences, fast (default)
3566 <dt> ‘<samp>sse</samp>’</dt>
3567 <dd><p>sum of squared errors
3569 <dt> ‘<samp>satd</samp>’</dt>
3570 <dd><p>sum of absolute Hadamard transformed differences
3572 <dt> ‘<samp>dct</samp>’</dt>
3573 <dd><p>sum of absolute DCT transformed differences
3575 <dt> ‘<samp>psnr</samp>’</dt>
3576 <dd><p>sum of squared quantization errors (avoid, low quality)
3578 <dt> ‘<samp>bit</samp>’</dt>
3579 <dd><p>number of bits needed for the block
3581 <dt> ‘<samp>rd</samp>’</dt>
3582 <dd><p>rate distortion optimal, slow
3584 <dt> ‘<samp>zero</samp>’</dt>
3587 <dt> ‘<samp>vsad</samp>’</dt>
3588 <dd><p>sum of absolute vertical differences
3590 <dt> ‘<samp>vsse</samp>’</dt>
3591 <dd><p>sum of squared vertical differences
3593 <dt> ‘<samp>nsse</samp>’</dt>
3594 <dd><p>noise preserving sum of squared differences
3596 <dt> ‘<samp>w53</samp>’</dt>
3597 <dd><p>5/3 wavelet, only used in snow
3599 <dt> ‘<samp>w97</samp>’</dt>
3600 <dd><p>9/7 wavelet, only used in snow
3602 <dt> ‘<samp>dctmax</samp>’</dt>
3603 <dt> ‘<samp>chroma</samp>’</dt>
3607 <dt> ‘<samp>dia_size <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3608 <dd><p>Set diamond type & size for motion estimation.
3611 <dt> ‘<samp>last_pred <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3612 <dd><p>Set amount of motion predictors from the previous frame.
3615 <dt> ‘<samp>preme <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3616 <dd><p>Set pre motion estimation.
3619 <dt> ‘<samp>precmp <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3620 <dd><p>Set pre motion estimation compare function.
3623 </p><dl compact="compact">
3624 <dt> ‘<samp>sad</samp>’</dt>
3625 <dd><p>sum of absolute differences, fast (default)
3627 <dt> ‘<samp>sse</samp>’</dt>
3628 <dd><p>sum of squared errors
3630 <dt> ‘<samp>satd</samp>’</dt>
3631 <dd><p>sum of absolute Hadamard transformed differences
3633 <dt> ‘<samp>dct</samp>’</dt>
3634 <dd><p>sum of absolute DCT transformed differences
3636 <dt> ‘<samp>psnr</samp>’</dt>
3637 <dd><p>sum of squared quantization errors (avoid, low quality)
3639 <dt> ‘<samp>bit</samp>’</dt>
3640 <dd><p>number of bits needed for the block
3642 <dt> ‘<samp>rd</samp>’</dt>
3643 <dd><p>rate distortion optimal, slow
3645 <dt> ‘<samp>zero</samp>’</dt>
3648 <dt> ‘<samp>vsad</samp>’</dt>
3649 <dd><p>sum of absolute vertical differences
3651 <dt> ‘<samp>vsse</samp>’</dt>
3652 <dd><p>sum of squared vertical differences
3654 <dt> ‘<samp>nsse</samp>’</dt>
3655 <dd><p>noise preserving sum of squared differences
3657 <dt> ‘<samp>w53</samp>’</dt>
3658 <dd><p>5/3 wavelet, only used in snow
3660 <dt> ‘<samp>w97</samp>’</dt>
3661 <dd><p>9/7 wavelet, only used in snow
3663 <dt> ‘<samp>dctmax</samp>’</dt>
3664 <dt> ‘<samp>chroma</samp>’</dt>
3668 <dt> ‘<samp>pre_dia_size <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3669 <dd><p>Set diamond type & size for motion estimation pre-pass.
3672 <dt> ‘<samp>subq <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3673 <dd><p>Set sub pel motion estimation quality.
3676 <dt> ‘<samp>dtg_active_format <var>integer</var></samp>’</dt>
3677 <dt> ‘<samp>me_range <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3678 <dd><p>Set limit motion vectors range (1023 for DivX player).
3681 <dt> ‘<samp>ibias <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3682 <dd><p>Set intra quant bias.
3685 <dt> ‘<samp>pbias <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3686 <dd><p>Set inter quant bias.
3689 <dt> ‘<samp>color_table_id <var>integer</var></samp>’</dt>
3690 <dt> ‘<samp>global_quality <var>integer</var> (<em>encoding,audio,video</em>)</samp>’</dt>
3691 <dt> ‘<samp>coder <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3694 </p><dl compact="compact">
3695 <dt> ‘<samp>vlc</samp>’</dt>
3696 <dd><p>variable length coder / huffman coder
3698 <dt> ‘<samp>ac</samp>’</dt>
3699 <dd><p>arithmetic coder
3701 <dt> ‘<samp>raw</samp>’</dt>
3702 <dd><p>raw (no encoding)
3704 <dt> ‘<samp>rle</samp>’</dt>
3705 <dd><p>run-length coder
3707 <dt> ‘<samp>deflate</samp>’</dt>
3708 <dd><p>deflate-based coder
3713 <dt> ‘<samp>context <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3714 <dd><p>Set context model.
3717 <dt> ‘<samp>slice_flags <var>integer</var></samp>’</dt>
3718 <dt> ‘<samp>xvmc_acceleration <var>integer</var></samp>’</dt>
3719 <dt> ‘<samp>mbd <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3720 <dd><p>Set macroblock decision algorithm (high quality mode).
3723 </p><dl compact="compact">
3724 <dt> ‘<samp>simple</samp>’</dt>
3725 <dd><p>use mbcmp (default)
3727 <dt> ‘<samp>bits</samp>’</dt>
3728 <dd><p>use fewest bits
3730 <dt> ‘<samp>rd</samp>’</dt>
3731 <dd><p>use best rate distortion
3736 <dt> ‘<samp>stream_codec_tag <var>integer</var></samp>’</dt>
3737 <dt> ‘<samp>sc_threshold <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3738 <dd><p>Set scene change threshold.
3741 <dt> ‘<samp>lmin <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3742 <dd><p>Set min lagrange factor (VBR).
3745 <dt> ‘<samp>lmax <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3746 <dd><p>Set max lagrange factor (VBR).
3749 <dt> ‘<samp>nr <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3750 <dd><p>Set noise reduction.
3753 <dt> ‘<samp>rc_init_occupancy <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3754 <dd><p>Set number of bits which should be loaded into the rc buffer before
3758 <dt> ‘<samp>flags2 <var>flags</var> (<em>decoding/encoding,audio,video</em>)</samp>’</dt>
3761 </p><dl compact="compact">
3762 <dt> ‘<samp>fast</samp>’</dt>
3763 <dd><p>Allow non spec compliant speedup tricks.
3765 <dt> ‘<samp>sgop</samp>’</dt>
3766 <dd><p>Deprecated, use mpegvideo private options instead.
3768 <dt> ‘<samp>noout</samp>’</dt>
3769 <dd><p>Skip bitstream encoding.
3771 <dt> ‘<samp>ignorecrop</samp>’</dt>
3772 <dd><p>Ignore cropping information from sps.
3774 <dt> ‘<samp>local_header</samp>’</dt>
3775 <dd><p>Place global headers at every keyframe instead of in extradata.
3777 <dt> ‘<samp>chunks</samp>’</dt>
3778 <dd><p>Frame data might be split into multiple chunks.
3780 <dt> ‘<samp>showall</samp>’</dt>
3781 <dd><p>Show all frames before the first keyframe.
3783 <dt> ‘<samp>skiprd</samp>’</dt>
3784 <dd><p>Deprecated, use mpegvideo private options instead.
3789 <dt> ‘<samp>error <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3790 <dt> ‘<samp>qns <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3791 <dd><p>Deprecated, use mpegvideo private options instead.
3794 <dt> ‘<samp>threads <var>integer</var> (<em>decoding/encoding,video</em>)</samp>’</dt>
3797 </p><dl compact="compact">
3798 <dt> ‘<samp>auto</samp>’</dt>
3799 <dd><p>detect a good number of threads
3804 <dt> ‘<samp>me_threshold <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3805 <dd><p>Set motion estimation threshold.
3808 <dt> ‘<samp>mb_threshold <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3809 <dd><p>Set macroblock threshold.
3812 <dt> ‘<samp>dc <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3813 <dd><p>Set intra_dc_precision.
3816 <dt> ‘<samp>nssew <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3817 <dd><p>Set nsse weight.
3820 <dt> ‘<samp>skip_top <var>integer</var> (<em>decoding,video</em>)</samp>’</dt>
3821 <dd><p>Set number of macroblock rows at the top which are skipped.
3824 <dt> ‘<samp>skip_bottom <var>integer</var> (<em>decoding,video</em>)</samp>’</dt>
3825 <dd><p>Set number of macroblock rows at the bottom which are skipped.
3828 <dt> ‘<samp>profile <var>integer</var> (<em>encoding,audio,video</em>)</samp>’</dt>
3831 </p><dl compact="compact">
3832 <dt> ‘<samp>unknown</samp>’</dt>
3833 <dt> ‘<samp>aac_main</samp>’</dt>
3834 <dt> ‘<samp>aac_low</samp>’</dt>
3835 <dt> ‘<samp>aac_ssr</samp>’</dt>
3836 <dt> ‘<samp>aac_ltp</samp>’</dt>
3837 <dt> ‘<samp>aac_he</samp>’</dt>
3838 <dt> ‘<samp>aac_he_v2</samp>’</dt>
3839 <dt> ‘<samp>aac_ld</samp>’</dt>
3840 <dt> ‘<samp>aac_eld</samp>’</dt>
3841 <dt> ‘<samp>mpeg2_aac_low</samp>’</dt>
3842 <dt> ‘<samp>mpeg2_aac_he</samp>’</dt>
3843 <dt> ‘<samp>dts</samp>’</dt>
3844 <dt> ‘<samp>dts_es</samp>’</dt>
3845 <dt> ‘<samp>dts_96_24</samp>’</dt>
3846 <dt> ‘<samp>dts_hd_hra</samp>’</dt>
3847 <dt> ‘<samp>dts_hd_ma</samp>’</dt>
3851 <dt> ‘<samp>level <var>integer</var> (<em>encoding,audio,video</em>)</samp>’</dt>
3854 </p><dl compact="compact">
3855 <dt> ‘<samp>unknown</samp>’</dt>
3859 <dt> ‘<samp>lowres <var>integer</var> (<em>decoding,audio,video</em>)</samp>’</dt>
3860 <dd><p>Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
3863 <dt> ‘<samp>skip_threshold <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3864 <dd><p>Set frame skip threshold.
3867 <dt> ‘<samp>skip_factor <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3868 <dd><p>Set frame skip factor.
3871 <dt> ‘<samp>skip_exp <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3872 <dd><p>Set frame skip exponent.
3875 <dt> ‘<samp>skipcmp <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3876 <dd><p>Set frame skip compare function.
3879 </p><dl compact="compact">
3880 <dt> ‘<samp>sad</samp>’</dt>
3881 <dd><p>sum of absolute differences, fast (default)
3883 <dt> ‘<samp>sse</samp>’</dt>
3884 <dd><p>sum of squared errors
3886 <dt> ‘<samp>satd</samp>’</dt>
3887 <dd><p>sum of absolute Hadamard transformed differences
3889 <dt> ‘<samp>dct</samp>’</dt>
3890 <dd><p>sum of absolute DCT transformed differences
3892 <dt> ‘<samp>psnr</samp>’</dt>
3893 <dd><p>sum of squared quantization errors (avoid, low quality)
3895 <dt> ‘<samp>bit</samp>’</dt>
3896 <dd><p>number of bits needed for the block
3898 <dt> ‘<samp>rd</samp>’</dt>
3899 <dd><p>rate distortion optimal, slow
3901 <dt> ‘<samp>zero</samp>’</dt>
3904 <dt> ‘<samp>vsad</samp>’</dt>
3905 <dd><p>sum of absolute vertical differences
3907 <dt> ‘<samp>vsse</samp>’</dt>
3908 <dd><p>sum of squared vertical differences
3910 <dt> ‘<samp>nsse</samp>’</dt>
3911 <dd><p>noise preserving sum of squared differences
3913 <dt> ‘<samp>w53</samp>’</dt>
3914 <dd><p>5/3 wavelet, only used in snow
3916 <dt> ‘<samp>w97</samp>’</dt>
3917 <dd><p>9/7 wavelet, only used in snow
3919 <dt> ‘<samp>dctmax</samp>’</dt>
3920 <dt> ‘<samp>chroma</samp>’</dt>
3924 <dt> ‘<samp>border_mask <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
3925 <dd><p>Increase the quantizer for macroblocks close to borders.
3928 <dt> ‘<samp>mblmin <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3929 <dd><p>Set min macroblock lagrange factor (VBR).
3932 <dt> ‘<samp>mblmax <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3933 <dd><p>Set max macroblock lagrange factor (VBR).
3936 <dt> ‘<samp>mepc <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3937 <dd><p>Set motion estimation bitrate penalty compensation (1.0 = 256).
3940 <dt> ‘<samp>skip_loop_filter <var>integer</var> (<em>decoding,video</em>)</samp>’</dt>
3941 <dt> ‘<samp>skip_idct <var>integer</var> (<em>decoding,video</em>)</samp>’</dt>
3942 <dt> ‘<samp>skip_frame <var>integer</var> (<em>decoding,video</em>)</samp>’</dt>
3944 <p>Make decoder discard processing depending on the frame type selected
3945 by the option value.
3947 <p>‘<samp>skip_loop_filter</samp>’ skips frame loop filtering, ‘<samp>skip_idct</samp>’
3948 skips frame IDCT/dequantization, ‘<samp>skip_frame</samp>’ skips decoding.
3951 </p><dl compact="compact">
3952 <dt> ‘<samp>none</samp>’</dt>
3953 <dd><p>Discard no frame.
3956 <dt> ‘<samp>default</samp>’</dt>
3957 <dd><p>Discard useless frames like 0-sized frames.
3960 <dt> ‘<samp>noref</samp>’</dt>
3961 <dd><p>Discard all non-reference frames.
3964 <dt> ‘<samp>bidir</samp>’</dt>
3965 <dd><p>Discard all bidirectional frames.
3968 <dt> ‘<samp>nokey</samp>’</dt>
3969 <dd><p>Discard all frames excepts keyframes.
3972 <dt> ‘<samp>all</samp>’</dt>
3973 <dd><p>Discard all frames.
3977 <p>Default value is ‘<samp>default</samp>’.
3980 <dt> ‘<samp>bidir_refine <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3981 <dd><p>Refine the two motion vectors used in bidirectional macroblocks.
3984 <dt> ‘<samp>brd_scale <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3985 <dd><p>Downscale frames for dynamic B-frame decision.
3988 <dt> ‘<samp>keyint_min <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3989 <dd><p>Set minimum interval between IDR-frames.
3992 <dt> ‘<samp>refs <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3993 <dd><p>Set reference frames to consider for motion compensation.
3996 <dt> ‘<samp>chromaoffset <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
3997 <dd><p>Set chroma qp offset from luma.
4000 <dt> ‘<samp>trellis <var>integer</var> (<em>encoding,audio,video</em>)</samp>’</dt>
4001 <dd><p>Set rate-distortion optimal quantization.
4004 <dt> ‘<samp>sc_factor <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
4005 <dd><p>Set value multiplied by qscale for each frame and added to
4009 <dt> ‘<samp>mv0_threshold <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
4010 <dt> ‘<samp>b_sensitivity <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
4011 <dd><p>Adjust sensitivity of b_frame_strategy 1.
4014 <dt> ‘<samp>compression_level <var>integer</var> (<em>encoding,audio,video</em>)</samp>’</dt>
4015 <dt> ‘<samp>min_prediction_order <var>integer</var> (<em>encoding,audio</em>)</samp>’</dt>
4016 <dt> ‘<samp>max_prediction_order <var>integer</var> (<em>encoding,audio</em>)</samp>’</dt>
4017 <dt> ‘<samp>timecode_frame_start <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
4018 <dd><p>Set GOP timecode frame start number, in non drop frame format.
4021 <dt> ‘<samp>request_channels <var>integer</var> (<em>decoding,audio</em>)</samp>’</dt>
4022 <dd><p>Set desired number of audio channels.
4025 <dt> ‘<samp>bits_per_raw_sample <var>integer</var></samp>’</dt>
4026 <dt> ‘<samp>channel_layout <var>integer</var> (<em>decoding/encoding,audio</em>)</samp>’</dt>
4030 <dt> ‘<samp>request_channel_layout <var>integer</var> (<em>decoding,audio</em>)</samp>’</dt>
4034 <dt> ‘<samp>rc_max_vbv_use <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
4035 <dt> ‘<samp>rc_min_vbv_use <var>float</var> (<em>encoding,video</em>)</samp>’</dt>
4036 <dt> ‘<samp>ticks_per_frame <var>integer</var> (<em>decoding/encoding,audio,video</em>)</samp>’</dt>
4037 <dt> ‘<samp>color_primaries <var>integer</var> (<em>decoding/encoding,video</em>)</samp>’</dt>
4038 <dt> ‘<samp>color_trc <var>integer</var> (<em>decoding/encoding,video</em>)</samp>’</dt>
4039 <dt> ‘<samp>colorspace <var>integer</var> (<em>decoding/encoding,video</em>)</samp>’</dt>
4040 <dt> ‘<samp>color_range <var>integer</var> (<em>decoding/encoding,video</em>)</samp>’</dt>
4041 <dt> ‘<samp>chroma_sample_location <var>integer</var> (<em>decoding/encoding,video</em>)</samp>’</dt>
4042 <dt> ‘<samp>log_level_offset <var>integer</var></samp>’</dt>
4043 <dd><p>Set the log level offset.
4046 <dt> ‘<samp>slices <var>integer</var> (<em>encoding,video</em>)</samp>’</dt>
4047 <dd><p>Number of slices, used in parallelized encoding.
4050 <dt> ‘<samp>thread_type <var>flags</var> (<em>decoding/encoding,video</em>)</samp>’</dt>
4051 <dd><p>Select multithreading type.
4054 </p><dl compact="compact">
4055 <dt> ‘<samp>slice</samp>’</dt>
4056 <dt> ‘<samp>frame</samp>’</dt>
4059 <dt> ‘<samp>audio_service_type <var>integer</var> (<em>encoding,audio</em>)</samp>’</dt>
4060 <dd><p>Set audio service type.
4063 </p><dl compact="compact">
4064 <dt> ‘<samp>ma</samp>’</dt>
4065 <dd><p>Main Audio Service
4067 <dt> ‘<samp>ef</samp>’</dt>
4070 <dt> ‘<samp>vi</samp>’</dt>
4071 <dd><p>Visually Impaired
4073 <dt> ‘<samp>hi</samp>’</dt>
4074 <dd><p>Hearing Impaired
4076 <dt> ‘<samp>di</samp>’</dt>
4079 <dt> ‘<samp>co</samp>’</dt>
4082 <dt> ‘<samp>em</samp>’</dt>
4085 <dt> ‘<samp>vo</samp>’</dt>
4088 <dt> ‘<samp>ka</samp>’</dt>
4094 <dt> ‘<samp>request_sample_fmt <var>sample_fmt</var> (<em>decoding,audio</em>)</samp>’</dt>
4095 <dd><p>Set sample format audio decoders should prefer. Default value is
4099 <dt> ‘<samp>pkt_timebase <var>rational number</var></samp>’</dt>
4100 <dt> ‘<samp>sub_charenc <var>encoding</var> (<em>decoding,subtitles</em>)</samp>’</dt>
4101 <dd><p>Set the input subtitles character encoding.
4104 <dt> ‘<samp>field_order <var>field_order</var> (<em>video</em>)</samp>’</dt>
4105 <dd><p>Set/override the field order of the video.
4107 </p><dl compact="compact">
4108 <dt> ‘<samp>progressive</samp>’</dt>
4109 <dd><p>Progressive video
4111 <dt> ‘<samp>tt</samp>’</dt>
4112 <dd><p>Interlaced video, top field coded and displayed first
4114 <dt> ‘<samp>bb</samp>’</dt>
4115 <dd><p>Interlaced video, bottom field coded and displayed first
4117 <dt> ‘<samp>tb</samp>’</dt>
4118 <dd><p>Interlaced video, top coded first, bottom displayed first
4120 <dt> ‘<samp>bt</samp>’</dt>
4121 <dd><p>Interlaced video, bottom coded first, top displayed first
4126 <dt> ‘<samp>skip_alpha <var>integer</var> (<em>decoding,video</em>)</samp>’</dt>
4127 <dd><p>Set to 1 to disable processing alpha (transparency). This works like the
4128 ‘<samp>gray</samp>’ flag in the ‘<samp>flags</samp>’ option which skips chroma information
4129 instead of alpha. Default is 0.
4134 <a name="Decoders"></a>
4135 <h1 class="chapter"><a href="ffplay-all.html#toc-Decoders">8. Decoders</a></h1>
4137 <p>Decoders are configured elements in FFmpeg which allow the decoding of
4140 <p>When you configure your FFmpeg build, all the supported native decoders
4141 are enabled by default. Decoders requiring an external library must be enabled
4142 manually via the corresponding <code>--enable-lib</code> option. You can list all
4143 available decoders using the configure option <code>--list-decoders</code>.
4145 <p>You can disable all the decoders with the configure option
4146 <code>--disable-decoders</code> and selectively enable / disable single decoders
4147 with the options <code>--enable-decoder=<var>DECODER</var></code> /
4148 <code>--disable-decoder=<var>DECODER</var></code>.
4150 <p>The option <code>-codecs</code> of the ff* tools will display the list of
4154 <a name="Video-Decoders"></a>
4155 <h1 class="chapter"><a href="ffplay-all.html#toc-Video-Decoders">9. Video Decoders</a></h1>
4157 <p>A description of some of the currently available video decoders
4160 <a name="rawvideo-1"></a>
4161 <h2 class="section"><a href="ffplay-all.html#toc-rawvideo-1">9.1 rawvideo</a></h2>
4163 <p>Raw video decoder.
4165 <p>This decoder decodes rawvideo streams.
4167 <a name="Options-9"></a>
4168 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-9">9.1.1 Options</a></h3>
4170 <dl compact="compact">
4171 <dt> ‘<samp>top <var>top_field_first</var></samp>’</dt>
4172 <dd><p>Specify the assumed field type of the input video.
4173 </p><dl compact="compact">
4174 <dt> ‘<samp>-1</samp>’</dt>
4175 <dd><p>the video is assumed to be progressive (default)
4177 <dt> ‘<samp>0</samp>’</dt>
4178 <dd><p>bottom-field-first is assumed
4180 <dt> ‘<samp>1</samp>’</dt>
4181 <dd><p>top-field-first is assumed
4189 <a name="Audio-Decoders"></a>
4190 <h1 class="chapter"><a href="ffplay-all.html#toc-Audio-Decoders">10. Audio Decoders</a></h1>
4192 <a name="ffwavesynth"></a>
4193 <h2 class="section"><a href="ffplay-all.html#toc-ffwavesynth">10.1 ffwavesynth</a></h2>
4195 <p>Internal wave synthetizer.
4197 <p>This decoder generates wave patterns according to predefined sequences. Its
4198 use is purely internal and the format of the data it accepts is not publicly
4201 <a name="libcelt"></a>
4202 <h2 class="section"><a href="ffplay-all.html#toc-libcelt">10.2 libcelt</a></h2>
4204 <p>libcelt decoder wrapper.
4206 <p>libcelt allows libavcodec to decode the Xiph CELT ultra-low delay audio codec.
4207 Requires the presence of the libcelt headers and library during configuration.
4208 You need to explicitly configure the build with <code>--enable-libcelt</code>.
4210 <a name="libgsm"></a>
4211 <h2 class="section"><a href="ffplay-all.html#toc-libgsm">10.3 libgsm</a></h2>
4213 <p>libgsm decoder wrapper.
4215 <p>libgsm allows libavcodec to decode the GSM full rate audio codec. Requires
4216 the presence of the libgsm headers and library during configuration. You need
4217 to explicitly configure the build with <code>--enable-libgsm</code>.
4219 <p>This decoder supports both the ordinary GSM and the Microsoft variant.
4221 <a name="libilbc"></a>
4222 <h2 class="section"><a href="ffplay-all.html#toc-libilbc">10.4 libilbc</a></h2>
4224 <p>libilbc decoder wrapper.
4226 <p>libilbc allows libavcodec to decode the Internet Low Bitrate Codec (iLBC)
4227 audio codec. Requires the presence of the libilbc headers and library during
4228 configuration. You need to explicitly configure the build with
4229 <code>--enable-libilbc</code>.
4231 <a name="Options"></a>
4232 <h3 class="subsection"><a href="ffplay-all.html#toc-Options">10.4.1 Options</a></h3>
4234 <p>The following option is supported by the libilbc wrapper.
4236 <dl compact="compact">
4237 <dt> ‘<samp>enhance</samp>’</dt>
4239 <p>Enable the enhancement of the decoded audio when set to 1. The default
4240 value is 0 (disabled).
4245 <a name="libopencore_002damrnb-1"></a>
4246 <h2 class="section"><a href="ffplay-all.html#toc-libopencore_002damrnb-1">10.5 libopencore-amrnb</a></h2>
4248 <p>libopencore-amrnb decoder wrapper.
4250 <p>libopencore-amrnb allows libavcodec to decode the Adaptive Multi-Rate
4251 Narrowband audio codec. Using it requires the presence of the
4252 libopencore-amrnb headers and library during configuration. You need to
4253 explicitly configure the build with <code>--enable-libopencore-amrnb</code>.
4255 <p>An FFmpeg native decoder for AMR-NB exists, so users can decode AMR-NB
4256 without this library.
4258 <a name="libopencore_002damrwb"></a>
4259 <h2 class="section"><a href="ffplay-all.html#toc-libopencore_002damrwb">10.6 libopencore-amrwb</a></h2>
4261 <p>libopencore-amrwb decoder wrapper.
4263 <p>libopencore-amrwb allows libavcodec to decode the Adaptive Multi-Rate
4264 Wideband audio codec. Using it requires the presence of the
4265 libopencore-amrwb headers and library during configuration. You need to
4266 explicitly configure the build with <code>--enable-libopencore-amrwb</code>.
4268 <p>An FFmpeg native decoder for AMR-WB exists, so users can decode AMR-WB
4269 without this library.
4271 <a name="libopus"></a>
4272 <h2 class="section"><a href="ffplay-all.html#toc-libopus">10.7 libopus</a></h2>
4274 <p>libopus decoder wrapper.
4276 <p>libopus allows libavcodec to decode the Opus Interactive Audio Codec.
4277 Requires the presence of the libopus headers and library during
4278 configuration. You need to explicitly configure the build with
4279 <code>--enable-libopus</code>.
4282 <a name="Subtitles-Decoders"></a>
4283 <h1 class="chapter"><a href="ffplay-all.html#toc-Subtitles-Decoders">11. Subtitles Decoders</a></h1>
4285 <a name="dvdsub"></a>
4286 <h2 class="section"><a href="ffplay-all.html#toc-dvdsub">11.1 dvdsub</a></h2>
4288 <p>This codec decodes the bitmap subtitles used in DVDs; the same subtitles can
4289 also be found in VobSub file pairs and in some Matroska files.
4291 <a name="Options-24"></a>
4292 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-24">11.1.1 Options</a></h3>
4294 <dl compact="compact">
4295 <dt> ‘<samp>palette</samp>’</dt>
4296 <dd><p>Specify the global palette used by the bitmaps. When stored in VobSub, the
4297 palette is normally specified in the index file; in Matroska, the palette is
4298 stored in the codec extra-data in the same format as in VobSub. In DVDs, the
4299 palette is stored in the IFO file, and therefore not available when reading
4300 from dumped VOB files.
4302 <p>The format for this option is a string containing 16 24-bits hexadecimal
4303 numbers (without 0x prefix) separated by comas, for example <code>0d00ee,
4304 ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
4305 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b</code>.
4309 <a name="libzvbi_002dteletext"></a>
4310 <h2 class="section"><a href="ffplay-all.html#toc-libzvbi_002dteletext">11.2 libzvbi-teletext</a></h2>
4312 <p>Libzvbi allows libavcodec to decode DVB teletext pages and DVB teletext
4313 subtitles. Requires the presence of the libzvbi headers and library during
4314 configuration. You need to explicitly configure the build with
4315 <code>--enable-libzvbi</code>.
4317 <a name="Options-7"></a>
4318 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-7">11.2.1 Options</a></h3>
4320 <dl compact="compact">
4321 <dt> ‘<samp>txt_page</samp>’</dt>
4322 <dd><p>List of teletext page numbers to decode. You may use the special * string to
4323 match all pages. Pages that do not match the specified list are dropped.
4326 <dt> ‘<samp>txt_chop_top</samp>’</dt>
4327 <dd><p>Discards the top teletext line. Default value is 1.
4329 <dt> ‘<samp>txt_format</samp>’</dt>
4330 <dd><p>Specifies the format of the decoded subtitles. The teletext decoder is capable
4331 of decoding the teletext pages to bitmaps or to simple text, you should use
4332 "bitmap" for teletext pages, because certain graphics and colors cannot be
4333 expressed in simple text. You might use "text" for teletext based subtitles if
4334 your application can handle simple text based subtitles. Default value is
4337 <dt> ‘<samp>txt_left</samp>’</dt>
4338 <dd><p>X offset of generated bitmaps, default is 0.
4340 <dt> ‘<samp>txt_top</samp>’</dt>
4341 <dd><p>Y offset of generated bitmaps, default is 0.
4343 <dt> ‘<samp>txt_chop_spaces</samp>’</dt>
4344 <dd><p>Chops leading and trailing spaces and removes empty lines from the generated
4345 text. This option is useful for teletext based subtitles where empty spaces may
4346 be present at the start or at the end of the lines or empty lines may be
4347 present between the subtitle lines because of double-sized teletext charactes.
4350 <dt> ‘<samp>txt_duration</samp>’</dt>
4351 <dd><p>Sets the display duration of the decoded teletext pages or subtitles in
4352 miliseconds. Default value is 30000 which is 30 seconds.
4354 <dt> ‘<samp>txt_transparent</samp>’</dt>
4355 <dd><p>Force transparent background of the generated teletext bitmaps. Default value
4356 is 0 which means an opaque (black) background.
4360 <a name="Encoders"></a>
4361 <h1 class="chapter"><a href="ffplay-all.html#toc-Encoders">12. Encoders</a></h1>
4363 <p>Encoders are configured elements in FFmpeg which allow the encoding of
4366 <p>When you configure your FFmpeg build, all the supported native encoders
4367 are enabled by default. Encoders requiring an external library must be enabled
4368 manually via the corresponding <code>--enable-lib</code> option. You can list all
4369 available encoders using the configure option <code>--list-encoders</code>.
4371 <p>You can disable all the encoders with the configure option
4372 <code>--disable-encoders</code> and selectively enable / disable single encoders
4373 with the options <code>--enable-encoder=<var>ENCODER</var></code> /
4374 <code>--disable-encoder=<var>ENCODER</var></code>.
4376 <p>The option <code>-codecs</code> of the ff* tools will display the list of
4380 <a name="Audio-Encoders"></a>
4381 <h1 class="chapter"><a href="ffplay-all.html#toc-Audio-Encoders">13. Audio Encoders</a></h1>
4383 <p>A description of some of the currently available audio encoders
4386 <p><a name="aacenc"></a>
4387 </p><a name="aac"></a>
4388 <h2 class="section"><a href="ffplay-all.html#toc-aac">13.1 aac</a></h2>
4390 <p>Advanced Audio Coding (AAC) encoder.
4392 <p>This encoder is an experimental FFmpeg-native AAC encoder. Currently only the
4393 low complexity (AAC-LC) profile is supported. To use this encoder, you must set
4394 ‘<samp>strict</samp>’ option to ‘<samp>experimental</samp>’ or lower.
4396 <p>As this encoder is experimental, unexpected behavior may exist from time to
4397 time. For a more stable AAC encoder, see <a href="#libvo_002daacenc">libvo-aacenc</a>. However, be warned
4398 that it has a worse quality reported by some users.
4400 <p>See also <a href="#libfdk_002daac_002denc">libfdk_aac</a> and <a href="#libfaac">libfaac</a>.
4402 <a name="Options-27"></a>
4403 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-27">13.1.1 Options</a></h3>
4405 <dl compact="compact">
4406 <dt> ‘<samp>b</samp>’</dt>
4407 <dd><p>Set bit rate in bits/s. Setting this automatically activates constant bit rate
4411 <dt> ‘<samp>q</samp>’</dt>
4412 <dd><p>Set quality for variable bit rate (VBR) mode. This option is valid only using
4413 the <code>ffmpeg</code> command-line tool. For library interface users, use
4414 ‘<samp>global_quality</samp>’.
4417 <dt> ‘<samp>stereo_mode</samp>’</dt>
4418 <dd><p>Set stereo encoding mode. Possible values:
4420 <dl compact="compact">
4421 <dt> ‘<samp>auto</samp>’</dt>
4422 <dd><p>Automatically selected by the encoder.
4425 <dt> ‘<samp>ms_off</samp>’</dt>
4426 <dd><p>Disable middle/side encoding. This is the default.
4429 <dt> ‘<samp>ms_force</samp>’</dt>
4430 <dd><p>Force middle/side encoding.
4435 <dt> ‘<samp>aac_coder</samp>’</dt>
4436 <dd><p>Set AAC encoder coding method. Possible values:
4438 <dl compact="compact">
4439 <dt> ‘<samp>faac</samp>’</dt>
4440 <dd><p>FAAC-inspired method.
4442 <p>This method is a simplified reimplementation of the method used in FAAC, which
4443 sets thresholds proportional to the band energies, and then decreases all the
4444 thresholds with quantizer steps to find the appropriate quantization with
4445 distortion below threshold band by band.
4447 <p>The quality of this method is comparable to the two loop searching method
4448 descibed below, but somewhat a little better and slower.
4451 <dt> ‘<samp>anmr</samp>’</dt>
4452 <dd><p>Average noise to mask ratio (ANMR) trellis-based solution.
4454 <p>This has a theoretic best quality out of all the coding methods, but at the
4455 cost of the slowest speed.
4458 <dt> ‘<samp>twoloop</samp>’</dt>
4459 <dd><p>Two loop searching (TLS) method.
4461 <p>This method first sets quantizers depending on band thresholds and then tries
4462 to find an optimal combination by adding or subtracting a specific value from
4463 all quantizers and adjusting some individual quantizer a little.
4465 <p>This method produces similar quality with the FAAC method and is the default.
4468 <dt> ‘<samp>fast</samp>’</dt>
4469 <dd><p>Constant quantizer method.
4471 <p>This method sets a constant quantizer for all bands. This is the fastest of all
4472 the methods, yet produces the worst quality.
4480 <a name="ac3-and-ac3_005ffixed"></a>
4481 <h2 class="section"><a href="ffplay-all.html#toc-ac3-and-ac3_005ffixed">13.2 ac3 and ac3_fixed</a></h2>
4483 <p>AC-3 audio encoders.
4485 <p>These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
4486 the undocumented RealAudio 3 (a.k.a. dnet).
4488 <p>The <var>ac3</var> encoder uses floating-point math, while the <var>ac3_fixed</var>
4489 encoder only uses fixed-point integer math. This does not mean that one is
4490 always faster, just that one or the other may be better suited to a
4491 particular system. The floating-point encoder will generally produce better
4492 quality audio for a given bitrate. The <var>ac3_fixed</var> encoder is not the
4493 default codec for any of the output formats, so it must be specified explicitly
4494 using the option <code>-acodec ac3_fixed</code> in order to use it.
4496 <a name="AC_002d3-Metadata"></a>
4497 <h3 class="subsection"><a href="ffplay-all.html#toc-AC_002d3-Metadata">13.2.1 AC-3 Metadata</a></h3>
4499 <p>The AC-3 metadata options are used to set parameters that describe the audio,
4500 but in most cases do not affect the audio encoding itself. Some of the options
4501 do directly affect or influence the decoding and playback of the resulting
4502 bitstream, while others are just for informational purposes. A few of the
4503 options will add bits to the output stream that could otherwise be used for
4504 audio data, and will thus affect the quality of the output. Those will be
4505 indicated accordingly with a note in the option list below.
4507 <p>These parameters are described in detail in several publicly-available
4510 <li> <a href="http://www.atsc.org/cms/standards/a_52-2010.pdf">A/52:2010 - Digital Audio Compression (AC-3) (E-AC-3) Standard</a>
4511 </li><li> <a href="http://www.atsc.org/cms/standards/a_54a_with_corr_1.pdf">A/54 - Guide to the Use of the ATSC Digital Television Standard</a>
4512 </li><li> <a href="http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf">Dolby Metadata Guide</a>
4513 </li><li> <a href="http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf">Dolby Digital Professional Encoding Guidelines</a>
4516 <a name="Metadata-Control-Options"></a>
4517 <h4 class="subsubsection"><a href="ffplay-all.html#toc-Metadata-Control-Options">13.2.1.1 Metadata Control Options</a></h4>
4519 <dl compact="compact">
4520 <dt> ‘<samp>-per_frame_metadata <var>boolean</var></samp>’</dt>
4521 <dd><p>Allow Per-Frame Metadata. Specifies if the encoder should check for changing
4522 metadata for each frame.
4523 </p><dl compact="compact">
4524 <dt> ‘<samp>0</samp>’</dt>
4525 <dd><p>The metadata values set at initialization will be used for every frame in the
4528 <dt> ‘<samp>1</samp>’</dt>
4529 <dd><p>Metadata values can be changed before encoding each frame.
4536 <a name="Downmix-Levels"></a>
4537 <h4 class="subsubsection"><a href="ffplay-all.html#toc-Downmix-Levels">13.2.1.2 Downmix Levels</a></h4>
4539 <dl compact="compact">
4540 <dt> ‘<samp>-center_mixlev <var>level</var></samp>’</dt>
4541 <dd><p>Center Mix Level. The amount of gain the decoder should apply to the center
4542 channel when downmixing to stereo. This field will only be written to the
4543 bitstream if a center channel is present. The value is specified as a scale
4544 factor. There are 3 valid values:
4545 </p><dl compact="compact">
4546 <dt> ‘<samp>0.707</samp>’</dt>
4547 <dd><p>Apply -3dB gain
4549 <dt> ‘<samp>0.595</samp>’</dt>
4550 <dd><p>Apply -4.5dB gain (default)
4552 <dt> ‘<samp>0.500</samp>’</dt>
4553 <dd><p>Apply -6dB gain
4558 <dt> ‘<samp>-surround_mixlev <var>level</var></samp>’</dt>
4559 <dd><p>Surround Mix Level. The amount of gain the decoder should apply to the surround
4560 channel(s) when downmixing to stereo. This field will only be written to the
4561 bitstream if one or more surround channels are present. The value is specified
4562 as a scale factor. There are 3 valid values:
4563 </p><dl compact="compact">
4564 <dt> ‘<samp>0.707</samp>’</dt>
4565 <dd><p>Apply -3dB gain
4567 <dt> ‘<samp>0.500</samp>’</dt>
4568 <dd><p>Apply -6dB gain (default)
4570 <dt> ‘<samp>0.000</samp>’</dt>
4571 <dd><p>Silence Surround Channel(s)
4578 <a name="Audio-Production-Information"></a>
4579 <h4 class="subsubsection"><a href="ffplay-all.html#toc-Audio-Production-Information">13.2.1.3 Audio Production Information</a></h4>
4580 <p>Audio Production Information is optional information describing the mixing
4581 environment. Either none or both of the fields are written to the bitstream.
4583 <dl compact="compact">
4584 <dt> ‘<samp>-mixing_level <var>number</var></samp>’</dt>
4585 <dd><p>Mixing Level. Specifies peak sound pressure level (SPL) in the production
4586 environment when the mix was mastered. Valid values are 80 to 111, or -1 for
4587 unknown or not indicated. The default value is -1, but that value cannot be
4588 used if the Audio Production Information is written to the bitstream. Therefore,
4589 if the <code>room_type</code> option is not the default value, the <code>mixing_level</code>
4590 option must not be -1.
4593 <dt> ‘<samp>-room_type <var>type</var></samp>’</dt>
4594 <dd><p>Room Type. Describes the equalization used during the final mixing session at
4595 the studio or on the dubbing stage. A large room is a dubbing stage with the
4596 industry standard X-curve equalization; a small room has flat equalization.
4597 This field will not be written to the bitstream if both the <code>mixing_level</code>
4598 option and the <code>room_type</code> option have the default values.
4599 </p><dl compact="compact">
4600 <dt> ‘<samp>0</samp>’</dt>
4601 <dt> ‘<samp>notindicated</samp>’</dt>
4602 <dd><p>Not Indicated (default)
4604 <dt> ‘<samp>1</samp>’</dt>
4605 <dt> ‘<samp>large</samp>’</dt>
4608 <dt> ‘<samp>2</samp>’</dt>
4609 <dt> ‘<samp>small</samp>’</dt>
4617 <a name="Other-Metadata-Options"></a>
4618 <h4 class="subsubsection"><a href="ffplay-all.html#toc-Other-Metadata-Options">13.2.1.4 Other Metadata Options</a></h4>
4620 <dl compact="compact">
4621 <dt> ‘<samp>-copyright <var>boolean</var></samp>’</dt>
4622 <dd><p>Copyright Indicator. Specifies whether a copyright exists for this audio.
4623 </p><dl compact="compact">
4624 <dt> ‘<samp>0</samp>’</dt>
4625 <dt> ‘<samp>off</samp>’</dt>
4626 <dd><p>No Copyright Exists (default)
4628 <dt> ‘<samp>1</samp>’</dt>
4629 <dt> ‘<samp>on</samp>’</dt>
4630 <dd><p>Copyright Exists
4635 <dt> ‘<samp>-dialnorm <var>value</var></samp>’</dt>
4636 <dd><p>Dialogue Normalization. Indicates how far the average dialogue level of the
4637 program is below digital 100% full scale (0 dBFS). This parameter determines a
4638 level shift during audio reproduction that sets the average volume of the
4639 dialogue to a preset level. The goal is to match volume level between program
4640 sources. A value of -31dB will result in no volume level change, relative to
4641 the source volume, during audio reproduction. Valid values are whole numbers in
4642 the range -31 to -1, with -31 being the default.
4645 <dt> ‘<samp>-dsur_mode <var>mode</var></samp>’</dt>
4646 <dd><p>Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
4647 (Pro Logic). This field will only be written to the bitstream if the audio
4648 stream is stereo. Using this option does <b>NOT</b> mean the encoder will actually
4649 apply Dolby Surround processing.
4650 </p><dl compact="compact">
4651 <dt> ‘<samp>0</samp>’</dt>
4652 <dt> ‘<samp>notindicated</samp>’</dt>
4653 <dd><p>Not Indicated (default)
4655 <dt> ‘<samp>1</samp>’</dt>
4656 <dt> ‘<samp>off</samp>’</dt>
4657 <dd><p>Not Dolby Surround Encoded
4659 <dt> ‘<samp>2</samp>’</dt>
4660 <dt> ‘<samp>on</samp>’</dt>
4661 <dd><p>Dolby Surround Encoded
4666 <dt> ‘<samp>-original <var>boolean</var></samp>’</dt>
4667 <dd><p>Original Bit Stream Indicator. Specifies whether this audio is from the
4668 original source and not a copy.
4669 </p><dl compact="compact">
4670 <dt> ‘<samp>0</samp>’</dt>
4671 <dt> ‘<samp>off</samp>’</dt>
4672 <dd><p>Not Original Source
4674 <dt> ‘<samp>1</samp>’</dt>
4675 <dt> ‘<samp>on</samp>’</dt>
4676 <dd><p>Original Source (default)
4683 <a name="Extended-Bitstream-Information"></a>
4684 <h3 class="subsection"><a href="ffplay-all.html#toc-Extended-Bitstream-Information">13.2.2 Extended Bitstream Information</a></h3>
4685 <p>The extended bitstream options are part of the Alternate Bit Stream Syntax as
4686 specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
4687 If any one parameter in a group is specified, all values in that group will be
4688 written to the bitstream. Default values are used for those that are written
4689 but have not been specified. If the mixing levels are written, the decoder
4690 will use these values instead of the ones specified in the <code>center_mixlev</code>
4691 and <code>surround_mixlev</code> options if it supports the Alternate Bit Stream
4694 <a name="Extended-Bitstream-Information-_002d-Part-1"></a>
4695 <h4 class="subsubsection"><a href="ffplay-all.html#toc-Extended-Bitstream-Information-_002d-Part-1">13.2.2.1 Extended Bitstream Information - Part 1</a></h4>
4697 <dl compact="compact">
4698 <dt> ‘<samp>-dmix_mode <var>mode</var></samp>’</dt>
4699 <dd><p>Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
4700 (Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
4701 </p><dl compact="compact">
4702 <dt> ‘<samp>0</samp>’</dt>
4703 <dt> ‘<samp>notindicated</samp>’</dt>
4704 <dd><p>Not Indicated (default)
4706 <dt> ‘<samp>1</samp>’</dt>
4707 <dt> ‘<samp>ltrt</samp>’</dt>
4708 <dd><p>Lt/Rt Downmix Preferred
4710 <dt> ‘<samp>2</samp>’</dt>
4711 <dt> ‘<samp>loro</samp>’</dt>
4712 <dd><p>Lo/Ro Downmix Preferred
4717 <dt> ‘<samp>-ltrt_cmixlev <var>level</var></samp>’</dt>
4718 <dd><p>Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
4719 center channel when downmixing to stereo in Lt/Rt mode.
4720 </p><dl compact="compact">
4721 <dt> ‘<samp>1.414</samp>’</dt>
4722 <dd><p>Apply +3dB gain
4724 <dt> ‘<samp>1.189</samp>’</dt>
4725 <dd><p>Apply +1.5dB gain
4727 <dt> ‘<samp>1.000</samp>’</dt>
4728 <dd><p>Apply 0dB gain
4730 <dt> ‘<samp>0.841</samp>’</dt>
4731 <dd><p>Apply -1.5dB gain
4733 <dt> ‘<samp>0.707</samp>’</dt>
4734 <dd><p>Apply -3.0dB gain
4736 <dt> ‘<samp>0.595</samp>’</dt>
4737 <dd><p>Apply -4.5dB gain (default)
4739 <dt> ‘<samp>0.500</samp>’</dt>
4740 <dd><p>Apply -6.0dB gain
4742 <dt> ‘<samp>0.000</samp>’</dt>
4743 <dd><p>Silence Center Channel
4748 <dt> ‘<samp>-ltrt_surmixlev <var>level</var></samp>’</dt>
4749 <dd><p>Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
4750 surround channel(s) when downmixing to stereo in Lt/Rt mode.
4751 </p><dl compact="compact">
4752 <dt> ‘<samp>0.841</samp>’</dt>
4753 <dd><p>Apply -1.5dB gain
4755 <dt> ‘<samp>0.707</samp>’</dt>
4756 <dd><p>Apply -3.0dB gain
4758 <dt> ‘<samp>0.595</samp>’</dt>
4759 <dd><p>Apply -4.5dB gain
4761 <dt> ‘<samp>0.500</samp>’</dt>
4762 <dd><p>Apply -6.0dB gain (default)
4764 <dt> ‘<samp>0.000</samp>’</dt>
4765 <dd><p>Silence Surround Channel(s)
4770 <dt> ‘<samp>-loro_cmixlev <var>level</var></samp>’</dt>
4771 <dd><p>Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
4772 center channel when downmixing to stereo in Lo/Ro mode.
4773 </p><dl compact="compact">
4774 <dt> ‘<samp>1.414</samp>’</dt>
4775 <dd><p>Apply +3dB gain
4777 <dt> ‘<samp>1.189</samp>’</dt>
4778 <dd><p>Apply +1.5dB gain
4780 <dt> ‘<samp>1.000</samp>’</dt>
4781 <dd><p>Apply 0dB gain
4783 <dt> ‘<samp>0.841</samp>’</dt>
4784 <dd><p>Apply -1.5dB gain
4786 <dt> ‘<samp>0.707</samp>’</dt>
4787 <dd><p>Apply -3.0dB gain
4789 <dt> ‘<samp>0.595</samp>’</dt>
4790 <dd><p>Apply -4.5dB gain (default)
4792 <dt> ‘<samp>0.500</samp>’</dt>
4793 <dd><p>Apply -6.0dB gain
4795 <dt> ‘<samp>0.000</samp>’</dt>
4796 <dd><p>Silence Center Channel
4801 <dt> ‘<samp>-loro_surmixlev <var>level</var></samp>’</dt>
4802 <dd><p>Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
4803 surround channel(s) when downmixing to stereo in Lo/Ro mode.
4804 </p><dl compact="compact">
4805 <dt> ‘<samp>0.841</samp>’</dt>
4806 <dd><p>Apply -1.5dB gain
4808 <dt> ‘<samp>0.707</samp>’</dt>
4809 <dd><p>Apply -3.0dB gain
4811 <dt> ‘<samp>0.595</samp>’</dt>
4812 <dd><p>Apply -4.5dB gain
4814 <dt> ‘<samp>0.500</samp>’</dt>
4815 <dd><p>Apply -6.0dB gain (default)
4817 <dt> ‘<samp>0.000</samp>’</dt>
4818 <dd><p>Silence Surround Channel(s)
4825 <a name="Extended-Bitstream-Information-_002d-Part-2"></a>
4826 <h4 class="subsubsection"><a href="ffplay-all.html#toc-Extended-Bitstream-Information-_002d-Part-2">13.2.2.2 Extended Bitstream Information - Part 2</a></h4>
4828 <dl compact="compact">
4829 <dt> ‘<samp>-dsurex_mode <var>mode</var></samp>’</dt>
4830 <dd><p>Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
4831 (7.1 matrixed to 5.1). Using this option does <b>NOT</b> mean the encoder will actually
4832 apply Dolby Surround EX processing.
4833 </p><dl compact="compact">
4834 <dt> ‘<samp>0</samp>’</dt>
4835 <dt> ‘<samp>notindicated</samp>’</dt>
4836 <dd><p>Not Indicated (default)
4838 <dt> ‘<samp>1</samp>’</dt>
4839 <dt> ‘<samp>on</samp>’</dt>
4840 <dd><p>Dolby Surround EX Off
4842 <dt> ‘<samp>2</samp>’</dt>
4843 <dt> ‘<samp>off</samp>’</dt>
4844 <dd><p>Dolby Surround EX On
4849 <dt> ‘<samp>-dheadphone_mode <var>mode</var></samp>’</dt>
4850 <dd><p>Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
4851 encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
4852 option does <b>NOT</b> mean the encoder will actually apply Dolby Headphone
4854 </p><dl compact="compact">
4855 <dt> ‘<samp>0</samp>’</dt>
4856 <dt> ‘<samp>notindicated</samp>’</dt>
4857 <dd><p>Not Indicated (default)
4859 <dt> ‘<samp>1</samp>’</dt>
4860 <dt> ‘<samp>on</samp>’</dt>
4861 <dd><p>Dolby Headphone Off
4863 <dt> ‘<samp>2</samp>’</dt>
4864 <dt> ‘<samp>off</samp>’</dt>
4865 <dd><p>Dolby Headphone On
4870 <dt> ‘<samp>-ad_conv_type <var>type</var></samp>’</dt>
4871 <dd><p>A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
4873 </p><dl compact="compact">
4874 <dt> ‘<samp>0</samp>’</dt>
4875 <dt> ‘<samp>standard</samp>’</dt>
4876 <dd><p>Standard A/D Converter (default)
4878 <dt> ‘<samp>1</samp>’</dt>
4879 <dt> ‘<samp>hdcd</samp>’</dt>
4880 <dd><p>HDCD A/D Converter
4887 <a name="Other-AC_002d3-Encoding-Options"></a>
4888 <h3 class="subsection"><a href="ffplay-all.html#toc-Other-AC_002d3-Encoding-Options">13.2.3 Other AC-3 Encoding Options</a></h3>
4890 <dl compact="compact">
4891 <dt> ‘<samp>-stereo_rematrixing <var>boolean</var></samp>’</dt>
4892 <dd><p>Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
4893 is an optional AC-3 feature that increases quality by selectively encoding
4894 the left/right channels as mid/side. This option is enabled by default, and it
4895 is highly recommended that it be left as enabled except for testing purposes.
4900 <a name="Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options"></a>
4901 <h3 class="subsection"><a href="ffplay-all.html#toc-Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options">13.2.4 Floating-Point-Only AC-3 Encoding Options</a></h3>
4903 <p>These options are only valid for the floating-point encoder and do not exist
4904 for the fixed-point encoder due to the corresponding features not being
4905 implemented in fixed-point.
4907 <dl compact="compact">
4908 <dt> ‘<samp>-channel_coupling <var>boolean</var></samp>’</dt>
4909 <dd><p>Enables/Disables use of channel coupling, which is an optional AC-3 feature
4910 that increases quality by combining high frequency information from multiple
4911 channels into a single channel. The per-channel high frequency information is
4912 sent with less accuracy in both the frequency and time domains. This allows
4913 more bits to be used for lower frequencies while preserving enough information
4914 to reconstruct the high frequencies. This option is enabled by default for the
4915 floating-point encoder and should generally be left as enabled except for
4916 testing purposes or to increase encoding speed.
4917 </p><dl compact="compact">
4918 <dt> ‘<samp>-1</samp>’</dt>
4919 <dt> ‘<samp>auto</samp>’</dt>
4920 <dd><p>Selected by Encoder (default)
4922 <dt> ‘<samp>0</samp>’</dt>
4923 <dt> ‘<samp>off</samp>’</dt>
4924 <dd><p>Disable Channel Coupling
4926 <dt> ‘<samp>1</samp>’</dt>
4927 <dt> ‘<samp>on</samp>’</dt>
4928 <dd><p>Enable Channel Coupling
4933 <dt> ‘<samp>-cpl_start_band <var>number</var></samp>’</dt>
4934 <dd><p>Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
4935 value higher than the bandwidth is used, it will be reduced to 1 less than the
4936 coupling end band. If <var>auto</var> is used, the start band will be determined by
4937 the encoder based on the bit rate, sample rate, and channel layout. This option
4938 has no effect if channel coupling is disabled.
4939 </p><dl compact="compact">
4940 <dt> ‘<samp>-1</samp>’</dt>
4941 <dt> ‘<samp>auto</samp>’</dt>
4942 <dd><p>Selected by Encoder (default)
4949 <p><a name="libfaac"></a>
4950 </p><a name="libfaac-1"></a>
4951 <h2 class="section"><a href="ffplay-all.html#toc-libfaac-1">13.3 libfaac</a></h2>
4953 <p>libfaac AAC (Advanced Audio Coding) encoder wrapper.
4955 <p>Requires the presence of the libfaac headers and library during
4956 configuration. You need to explicitly configure the build with
4957 <code>--enable-libfaac --enable-nonfree</code>.
4959 <p>This encoder is considered to be of higher quality with respect to the
4960 <a href="#aacenc">the native experimental FFmpeg AAC encoder</a>.
4962 <p>For more information see the libfaac project at
4963 <a href="http://www.audiocoding.com/faac.html/">http://www.audiocoding.com/faac.html/</a>.
4965 <a name="Options-28"></a>
4966 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-28">13.3.1 Options</a></h3>
4968 <p>The following shared FFmpeg codec options are recognized.
4970 <p>The following options are supported by the libfaac wrapper. The
4971 <code>faac</code>-equivalent of the options are listed in parentheses.
4973 <dl compact="compact">
4974 <dt> ‘<samp>b (<em>-b</em>)</samp>’</dt>
4975 <dd><p>Set bit rate in bits/s for ABR (Average Bit Rate) mode. If the bit rate
4976 is not explicitly specified, it is automatically set to a suitable
4977 value depending on the selected profile. <code>faac</code> bitrate is
4978 expressed in kilobits/s.
4980 <p>Note that libfaac does not support CBR (Constant Bit Rate) but only
4981 ABR (Average Bit Rate).
4983 <p>If VBR mode is enabled this option is ignored.
4986 <dt> ‘<samp>ar (<em>-R</em>)</samp>’</dt>
4987 <dd><p>Set audio sampling rate (in Hz).
4990 <dt> ‘<samp>ac (<em>-c</em>)</samp>’</dt>
4991 <dd><p>Set the number of audio channels.
4994 <dt> ‘<samp>cutoff (<em>-C</em>)</samp>’</dt>
4995 <dd><p>Set cutoff frequency. If not specified (or explicitly set to 0) it
4996 will use a value automatically computed by the library. Default value
5000 <dt> ‘<samp>profile</samp>’</dt>
5001 <dd><p>Set audio profile.
5003 <p>The following profiles are recognized:
5004 </p><dl compact="compact">
5005 <dt> ‘<samp>aac_main</samp>’</dt>
5006 <dd><p>Main AAC (Main)
5009 <dt> ‘<samp>aac_low</samp>’</dt>
5010 <dd><p>Low Complexity AAC (LC)
5013 <dt> ‘<samp>aac_ssr</samp>’</dt>
5014 <dd><p>Scalable Sample Rate (SSR)
5017 <dt> ‘<samp>aac_ltp</samp>’</dt>
5018 <dd><p>Long Term Prediction (LTP)
5022 <p>If not specified it is set to ‘<samp>aac_low</samp>’.
5025 <dt> ‘<samp>flags +qscale</samp>’</dt>
5026 <dd><p>Set constant quality VBR (Variable Bit Rate) mode.
5029 <dt> ‘<samp>global_quality</samp>’</dt>
5030 <dd><p>Set quality in VBR mode as an integer number of lambda units.
5032 <p>Only relevant when VBR mode is enabled with <code>flags +qscale</code>. The
5033 value is converted to QP units by dividing it by <code>FF_QP2LAMBDA</code>,
5034 and used to set the quality value used by libfaac. A reasonable range
5035 for the option value in QP units is [10-500], the higher the value the
5039 <dt> ‘<samp>q (<em>-q</em>)</samp>’</dt>
5040 <dd><p>Enable VBR mode when set to a non-negative value, and set constant
5041 quality value as a double floating point value in QP units.
5043 <p>The value sets the quality value used by libfaac. A reasonable range
5044 for the option value is [10-500], the higher the value the higher the
5047 <p>This option is valid only using the <code>ffmpeg</code> command-line
5048 tool. For library interface users, use ‘<samp>global_quality</samp>’.
5052 <a name="Examples-43"></a>
5053 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-43">13.3.2 Examples</a></h3>
5057 Use <code>ffmpeg</code> to convert an audio file to ABR 128 kbps AAC in an M4A (MP4)
5059 <table><tr><td> </td><td><pre class="example">ffmpeg -i input.wav -codec:a libfaac -b:a 128k -output.m4a
5060 </pre></td></tr></table>
5063 Use <code>ffmpeg</code> to convert an audio file to VBR AAC, using the
5065 <table><tr><td> </td><td><pre class="example">ffmpeg -i input.wav -c:a libfaac -profile:a aac_ltp -q:a 100 output.m4a
5066 </pre></td></tr></table>
5069 <p><a name="libfdk_002daac_002denc"></a>
5070 </p><a name="libfdk_005faac"></a>
5071 <h2 class="section"><a href="ffplay-all.html#toc-libfdk_005faac">13.4 libfdk_aac</a></h2>
5073 <p>libfdk-aac AAC (Advanced Audio Coding) encoder wrapper.
5075 <p>The libfdk-aac library is based on the Fraunhofer FDK AAC code from
5076 the Android project.
5078 <p>Requires the presence of the libfdk-aac headers and library during
5079 configuration. You need to explicitly configure the build with
5080 <code>--enable-libfdk-aac</code>. The library is also incompatible with GPL,
5081 so if you allow the use of GPL, you should configure with
5082 <code>--enable-gpl --enable-nonfree --enable-libfdk-aac</code>.
5084 <p>This encoder is considered to be of higher quality with respect to
5085 both <a href="#aacenc">the native experimental FFmpeg AAC encoder</a> and
5086 <a href="#libfaac">libfaac</a>.
5088 <p>VBR encoding, enabled through the ‘<samp>vbr</samp>’ or ‘<samp>flags
5089 +qscale</samp>’ options, is experimental and only works with some
5090 combinations of parameters.
5092 <p>For more information see the fdk-aac project at
5093 <a href="http://sourceforge.net/p/opencore-amr/fdk-aac/">http://sourceforge.net/p/opencore-amr/fdk-aac/</a>.
5095 <a name="Options-8"></a>
5096 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-8">13.4.1 Options</a></h3>
5098 <p>The following options are mapped on the shared FFmpeg codec options.
5100 <dl compact="compact">
5101 <dt> ‘<samp>b</samp>’</dt>
5102 <dd><p>Set bit rate in bits/s. If the bitrate is not explicitly specified, it
5103 is automatically set to a suitable value depending on the selected
5106 <p>In case VBR mode is enabled the option is ignored.
5109 <dt> ‘<samp>ar</samp>’</dt>
5110 <dd><p>Set audio sampling rate (in Hz).
5113 <dt> ‘<samp>channels</samp>’</dt>
5114 <dd><p>Set the number of audio channels.
5117 <dt> ‘<samp>flags +qscale</samp>’</dt>
5118 <dd><p>Enable fixed quality, VBR (Variable Bit Rate) mode.
5119 Note that VBR is implicitly enabled when the ‘<samp>vbr</samp>’ value is
5123 <dt> ‘<samp>cutoff</samp>’</dt>
5124 <dd><p>Set cutoff frequency. If not specified (or explicitly set to 0) it
5125 will use a value automatically computed by the library. Default value
5129 <dt> ‘<samp>profile</samp>’</dt>
5130 <dd><p>Set audio profile.
5132 <p>The following profiles are recognized:
5133 </p><dl compact="compact">
5134 <dt> ‘<samp>aac_low</samp>’</dt>
5135 <dd><p>Low Complexity AAC (LC)
5138 <dt> ‘<samp>aac_he</samp>’</dt>
5139 <dd><p>High Efficiency AAC (HE-AAC)
5142 <dt> ‘<samp>aac_he_v2</samp>’</dt>
5143 <dd><p>High Efficiency AAC version 2 (HE-AACv2)
5146 <dt> ‘<samp>aac_ld</samp>’</dt>
5147 <dd><p>Low Delay AAC (LD)
5150 <dt> ‘<samp>aac_eld</samp>’</dt>
5151 <dd><p>Enhanced Low Delay AAC (ELD)
5155 <p>If not specified it is set to ‘<samp>aac_low</samp>’.
5159 <p>The following are private options of the libfdk_aac encoder.
5161 <dl compact="compact">
5162 <dt> ‘<samp>afterburner</samp>’</dt>
5163 <dd><p>Enable afterburner feature if set to 1, disabled if set to 0. This
5164 improves the quality but also the required processing power.
5166 <p>Default value is 1.
5169 <dt> ‘<samp>eld_sbr</samp>’</dt>
5170 <dd><p>Enable SBR (Spectral Band Replication) for ELD if set to 1, disabled
5173 <p>Default value is 0.
5176 <dt> ‘<samp>signaling</samp>’</dt>
5177 <dd><p>Set SBR/PS signaling style.
5179 <p>It can assume one of the following values:
5180 </p><dl compact="compact">
5181 <dt> ‘<samp>default</samp>’</dt>
5182 <dd><p>choose signaling implicitly (explicit hierarchical by default,
5183 implicit if global header is disabled)
5186 <dt> ‘<samp>implicit</samp>’</dt>
5187 <dd><p>implicit backwards compatible signaling
5190 <dt> ‘<samp>explicit_sbr</samp>’</dt>
5191 <dd><p>explicit SBR, implicit PS signaling
5194 <dt> ‘<samp>explicit_hierarchical</samp>’</dt>
5195 <dd><p>explicit hierarchical signaling
5199 <p>Default value is ‘<samp>default</samp>’.
5202 <dt> ‘<samp>latm</samp>’</dt>
5203 <dd><p>Output LATM/LOAS encapsulated data if set to 1, disabled if set to 0.
5205 <p>Default value is 0.
5208 <dt> ‘<samp>header_period</samp>’</dt>
5209 <dd><p>Set StreamMuxConfig and PCE repetition period (in frames) for sending
5210 in-band configuration buffers within LATM/LOAS transport layer.
5212 <p>Must be a 16-bits non-negative integer.
5214 <p>Default value is 0.
5217 <dt> ‘<samp>vbr</samp>’</dt>
5218 <dd><p>Set VBR mode, from 1 to 5. 1 is lowest quality (though still pretty
5219 good) and 5 is highest quality. A value of 0 will disable VBR, and CBR
5220 (Constant Bit Rate) is enabled.
5222 <p>Currently only the ‘<samp>aac_low</samp>’ profile supports VBR encoding.
5224 <p>VBR modes 1-5 correspond to roughly the following average bit rates:
5226 <dl compact="compact">
5227 <dt> ‘<samp>1</samp>’</dt>
5228 <dd><p>32 kbps/channel
5230 <dt> ‘<samp>2</samp>’</dt>
5231 <dd><p>40 kbps/channel
5233 <dt> ‘<samp>3</samp>’</dt>
5234 <dd><p>48-56 kbps/channel
5236 <dt> ‘<samp>4</samp>’</dt>
5237 <dd><p>64 kbps/channel
5239 <dt> ‘<samp>5</samp>’</dt>
5240 <dd><p>about 80-96 kbps/channel
5244 <p>Default value is 0.
5248 <a name="Examples-59"></a>
5249 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-59">13.4.2 Examples</a></h3>
5253 Use <code>ffmpeg</code> to convert an audio file to VBR AAC in an M4A (MP4)
5255 <table><tr><td> </td><td><pre class="example">ffmpeg -i input.wav -codec:a libfdk_aac -vbr 3 output.m4a
5256 </pre></td></tr></table>
5259 Use <code>ffmpeg</code> to convert an audio file to CBR 64k kbps AAC, using the
5260 High-Efficiency AAC profile:
5261 <table><tr><td> </td><td><pre class="example">ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he -b:a 64k output.m4a
5262 </pre></td></tr></table>
5265 <p><a name="libmp3lame"></a>
5266 </p><a name="libmp3lame-1"></a>
5267 <h2 class="section"><a href="ffplay-all.html#toc-libmp3lame-1">13.5 libmp3lame</a></h2>
5269 <p>LAME (Lame Ain’t an MP3 Encoder) MP3 encoder wrapper.
5271 <p>Requires the presence of the libmp3lame headers and library during
5272 configuration. You need to explicitly configure the build with
5273 <code>--enable-libmp3lame</code>.
5275 <p>See <a href="#libshine">libshine</a> for a fixed-point MP3 encoder, although with a
5278 <a name="Options-17"></a>
5279 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-17">13.5.1 Options</a></h3>
5281 <p>The following options are supported by the libmp3lame wrapper. The
5282 <code>lame</code>-equivalent of the options are listed in parentheses.
5284 <dl compact="compact">
5285 <dt> ‘<samp>b (<em>-b</em>)</samp>’</dt>
5286 <dd><p>Set bitrate expressed in bits/s for CBR or ABR. LAME <code>bitrate</code> is
5287 expressed in kilobits/s.
5290 <dt> ‘<samp>q (<em>-V</em>)</samp>’</dt>
5291 <dd><p>Set constant quality setting for VBR. This option is valid only
5292 using the <code>ffmpeg</code> command-line tool. For library interface
5293 users, use ‘<samp>global_quality</samp>’.
5296 <dt> ‘<samp>compression_level (<em>-q</em>)</samp>’</dt>
5297 <dd><p>Set algorithm quality. Valid arguments are integers in the 0-9 range,
5298 with 0 meaning highest quality but slowest, and 9 meaning fastest
5299 while producing the worst quality.
5302 <dt> ‘<samp>reservoir</samp>’</dt>
5303 <dd><p>Enable use of bit reservoir when set to 1. Default value is 1. LAME
5304 has this enabled by default, but can be overriden by use
5305 ‘<samp>--nores</samp>’ option.
5308 <dt> ‘<samp>joint_stereo (<em>-m j</em>)</samp>’</dt>
5309 <dd><p>Enable the encoder to use (on a frame by frame basis) either L/R
5310 stereo or mid/side stereo. Default value is 1.
5313 <dt> ‘<samp>abr (<em>--abr</em>)</samp>’</dt>
5314 <dd><p>Enable the encoder to use ABR when set to 1. The <code>lame</code>
5315 ‘<samp>--abr</samp>’ sets the target bitrate, while this options only
5316 tells FFmpeg to use ABR still relies on ‘<samp>b</samp>’ to set bitrate.
5321 <a name="libopencore_002damrnb"></a>
5322 <h2 class="section"><a href="ffplay-all.html#toc-libopencore_002damrnb">13.6 libopencore-amrnb</a></h2>
5324 <p>OpenCORE Adaptive Multi-Rate Narrowband encoder.
5326 <p>Requires the presence of the libopencore-amrnb headers and library during
5327 configuration. You need to explicitly configure the build with
5328 <code>--enable-libopencore-amrnb --enable-version3</code>.
5330 <p>This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
5331 but you can override it by setting ‘<samp>strict</samp>’ to ‘<samp>unofficial</samp>’ or
5334 <a name="Options-29"></a>
5335 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-29">13.6.1 Options</a></h3>
5337 <dl compact="compact">
5338 <dt> ‘<samp>b</samp>’</dt>
5339 <dd><p>Set bitrate in bits per second. Only the following bitrates are supported,
5340 otherwise libavcodec will round to the nearest valid bitrate.
5342 <dl compact="compact">
5343 <dt> ‘<samp>4750</samp>’</dt>
5344 <dt> ‘<samp>5150</samp>’</dt>
5345 <dt> ‘<samp>5900</samp>’</dt>
5346 <dt> ‘<samp>6700</samp>’</dt>
5347 <dt> ‘<samp>7400</samp>’</dt>
5348 <dt> ‘<samp>7950</samp>’</dt>
5349 <dt> ‘<samp>10200</samp>’</dt>
5350 <dt> ‘<samp>12200</samp>’</dt>
5354 <dt> ‘<samp>dtx</samp>’</dt>
5355 <dd><p>Allow discontinuous transmission (generate comfort noise) when set to 1. The
5356 default value is 0 (disabled).
5361 <p><a name="libshine"></a>
5362 </p><a name="libshine-1"></a>
5363 <h2 class="section"><a href="ffplay-all.html#toc-libshine-1">13.7 libshine</a></h2>
5365 <p>Shine Fixed-Point MP3 encoder wrapper.
5367 <p>Shine is a fixed-point MP3 encoder. It has a far better performance on
5368 platforms without an FPU, e.g. armel CPUs, and some phones and tablets.
5369 However, as it is more targeted on performance than quality, it is not on par
5370 with LAME and other production-grade encoders quality-wise. Also, according to
5371 the project’s homepage, this encoder may not be free of bugs as the code was
5372 written a long time ago and the project was dead for at least 5 years.
5374 <p>This encoder only supports stereo and mono input. This is also CBR-only.
5376 <p>The original project (last updated in early 2007) is at
5377 <a href="http://sourceforge.net/projects/libshine-fxp/">http://sourceforge.net/projects/libshine-fxp/</a>. We only support the
5378 updated fork by the Savonet/Liquidsoap project at <a href="https://github.com/savonet/shine">https://github.com/savonet/shine</a>.
5380 <p>Requires the presence of the libshine headers and library during
5381 configuration. You need to explicitly configure the build with
5382 <code>--enable-libshine</code>.
5384 <p>See also <a href="#libmp3lame">libmp3lame</a>.
5386 <a name="Options-16"></a>
5387 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-16">13.7.1 Options</a></h3>
5389 <p>The following options are supported by the libshine wrapper. The
5390 <code>shineenc</code>-equivalent of the options are listed in parentheses.
5392 <dl compact="compact">
5393 <dt> ‘<samp>b (<em>-b</em>)</samp>’</dt>
5394 <dd><p>Set bitrate expressed in bits/s for CBR. <code>shineenc</code> ‘<samp>-b</samp>’ option
5395 is expressed in kilobits/s.
5400 <a name="libtwolame"></a>
5401 <h2 class="section"><a href="ffplay-all.html#toc-libtwolame">13.8 libtwolame</a></h2>
5403 <p>TwoLAME MP2 encoder wrapper.
5405 <p>Requires the presence of the libtwolame headers and library during
5406 configuration. You need to explicitly configure the build with
5407 <code>--enable-libtwolame</code>.
5409 <a name="Options-22"></a>
5410 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-22">13.8.1 Options</a></h3>
5412 <p>The following options are supported by the libtwolame wrapper. The
5413 <code>twolame</code>-equivalent options follow the FFmpeg ones and are in
5416 <dl compact="compact">
5417 <dt> ‘<samp>b (<em>-b</em>)</samp>’</dt>
5418 <dd><p>Set bitrate expressed in bits/s for CBR. <code>twolame</code> ‘<samp>b</samp>’
5419 option is expressed in kilobits/s. Default value is 128k.
5422 <dt> ‘<samp>q (<em>-V</em>)</samp>’</dt>
5423 <dd><p>Set quality for experimental VBR support. Maximum value range is
5424 from -50 to 50, useful range is from -10 to 10. The higher the
5425 value, the better the quality. This option is valid only using the
5426 <code>ffmpeg</code> command-line tool. For library interface users,
5427 use ‘<samp>global_quality</samp>’.
5430 <dt> ‘<samp>mode (<em>--mode</em>)</samp>’</dt>
5431 <dd><p>Set the mode of the resulting audio. Possible values:
5433 <dl compact="compact">
5434 <dt> ‘<samp>auto</samp>’</dt>
5435 <dd><p>Choose mode automatically based on the input. This is the default.
5437 <dt> ‘<samp>stereo</samp>’</dt>
5440 <dt> ‘<samp>joint_stereo</samp>’</dt>
5443 <dt> ‘<samp>dual_channel</samp>’</dt>
5446 <dt> ‘<samp>mono</samp>’</dt>
5452 <dt> ‘<samp>psymodel (<em>--psyc-mode</em>)</samp>’</dt>
5453 <dd><p>Set psychoacoustic model to use in encoding. The argument must be
5454 an integer between -1 and 4, inclusive. The higher the value, the
5455 better the quality. The default value is 3.
5458 <dt> ‘<samp>energy_levels (<em>--energy</em>)</samp>’</dt>
5459 <dd><p>Enable energy levels extensions when set to 1. The default value is
5463 <dt> ‘<samp>error_protection (<em>--protect</em>)</samp>’</dt>
5464 <dd><p>Enable CRC error protection when set to 1. The default value is 0
5468 <dt> ‘<samp>copyright (<em>--copyright</em>)</samp>’</dt>
5469 <dd><p>Set MPEG audio copyright flag when set to 1. The default value is 0
5473 <dt> ‘<samp>original (<em>--original</em>)</samp>’</dt>
5474 <dd><p>Set MPEG audio original flag when set to 1. The default value is 0
5480 <p><a name="libvo_002daacenc"></a>
5481 </p><a name="libvo_002daacenc-1"></a>
5482 <h2 class="section"><a href="ffplay-all.html#toc-libvo_002daacenc-1">13.9 libvo-aacenc</a></h2>
5484 <p>VisualOn AAC encoder.
5486 <p>Requires the presence of the libvo-aacenc headers and library during
5487 configuration. You need to explicitly configure the build with
5488 <code>--enable-libvo-aacenc --enable-version3</code>.
5490 <p>This encoder is considered to be worse than the
5491 <a href="#aacenc">native experimental FFmpeg AAC encoder</a>, according to
5494 <a name="Options-11"></a>
5495 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-11">13.9.1 Options</a></h3>
5497 <p>The VisualOn AAC encoder only support encoding AAC-LC and up to 2
5498 channels. It is also CBR-only.
5500 <dl compact="compact">
5501 <dt> ‘<samp>b</samp>’</dt>
5502 <dd><p>Set bit rate in bits/s.
5507 <a name="libvo_002damrwbenc"></a>
5508 <h2 class="section"><a href="ffplay-all.html#toc-libvo_002damrwbenc">13.10 libvo-amrwbenc</a></h2>
5510 <p>VisualOn Adaptive Multi-Rate Wideband encoder.
5512 <p>Requires the presence of the libvo-amrwbenc headers and library during
5513 configuration. You need to explicitly configure the build with
5514 <code>--enable-libvo-amrwbenc --enable-version3</code>.
5516 <p>This is a mono-only encoder. Officially it only supports 16000Hz sample
5517 rate, but you can override it by setting ‘<samp>strict</samp>’ to
5518 ‘<samp>unofficial</samp>’ or lower.
5520 <a name="Options-23"></a>
5521 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-23">13.10.1 Options</a></h3>
5523 <dl compact="compact">
5524 <dt> ‘<samp>b</samp>’</dt>
5525 <dd><p>Set bitrate in bits/s. Only the following bitrates are supported, otherwise
5526 libavcodec will round to the nearest valid bitrate.
5528 <dl compact="compact">
5529 <dt> ‘<samp>6600</samp>’</dt>
5530 <dt> ‘<samp>8850</samp>’</dt>
5531 <dt> ‘<samp>12650</samp>’</dt>
5532 <dt> ‘<samp>14250</samp>’</dt>
5533 <dt> ‘<samp>15850</samp>’</dt>
5534 <dt> ‘<samp>18250</samp>’</dt>
5535 <dt> ‘<samp>19850</samp>’</dt>
5536 <dt> ‘<samp>23050</samp>’</dt>
5537 <dt> ‘<samp>23850</samp>’</dt>
5541 <dt> ‘<samp>dtx</samp>’</dt>
5542 <dd><p>Allow discontinuous transmission (generate comfort noise) when set to 1. The
5543 default value is 0 (disabled).
5548 <a name="libopus-1"></a>
5549 <h2 class="section"><a href="ffplay-all.html#toc-libopus-1">13.11 libopus</a></h2>
5551 <p>libopus Opus Interactive Audio Codec encoder wrapper.
5553 <p>Requires the presence of the libopus headers and library during
5554 configuration. You need to explicitly configure the build with
5555 <code>--enable-libopus</code>.
5557 <a name="Option-Mapping"></a>
5558 <h3 class="subsection"><a href="ffplay-all.html#toc-Option-Mapping">13.11.1 Option Mapping</a></h3>
5560 <p>Most libopus options are modeled after the <code>opusenc</code> utility from
5561 opus-tools. The following is an option mapping chart describing options
5562 supported by the libopus wrapper, and their <code>opusenc</code>-equivalent
5565 <dl compact="compact">
5566 <dt> ‘<samp>b (<em>bitrate</em>)</samp>’</dt>
5567 <dd><p>Set the bit rate in bits/s. FFmpeg’s ‘<samp>b</samp>’ option is
5568 expressed in bits/s, while <code>opusenc</code>’s ‘<samp>bitrate</samp>’ in
5572 <dt> ‘<samp>vbr (<em>vbr</em>, <em>hard-cbr</em>, and <em>cvbr</em>)</samp>’</dt>
5573 <dd><p>Set VBR mode. The FFmpeg ‘<samp>vbr</samp>’ option has the following
5574 valid arguments, with the their <code>opusenc</code> equivalent options
5577 <dl compact="compact">
5578 <dt> ‘<samp>off (<em>hard-cbr</em>)</samp>’</dt>
5579 <dd><p>Use constant bit rate encoding.
5582 <dt> ‘<samp>on (<em>vbr</em>)</samp>’</dt>
5583 <dd><p>Use variable bit rate encoding (the default).
5586 <dt> ‘<samp>constrained (<em>cvbr</em>)</samp>’</dt>
5587 <dd><p>Use constrained variable bit rate encoding.
5592 <dt> ‘<samp>compression_level (<em>comp</em>)</samp>’</dt>
5593 <dd><p>Set encoding algorithm complexity. Valid options are integers in
5594 the 0-10 range. 0 gives the fastest encodes but lower quality, while 10
5595 gives the highest quality but slowest encoding. The default is 10.
5598 <dt> ‘<samp>frame_duration (<em>framesize</em>)</samp>’</dt>
5599 <dd><p>Set maximum frame size, or duration of a frame in milliseconds. The
5600 argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller
5601 frame sizes achieve lower latency but less quality at a given bitrate.
5602 Sizes greater than 20ms are only interesting at fairly low bitrates.
5603 The default is 20ms.
5606 <dt> ‘<samp>packet_loss (<em>expect-loss</em>)</samp>’</dt>
5607 <dd><p>Set expected packet loss percentage. The default is 0.
5610 <dt> ‘<samp>application (N.A.)</samp>’</dt>
5611 <dd><p>Set intended application type. Valid options are listed below:
5613 <dl compact="compact">
5614 <dt> ‘<samp>voip</samp>’</dt>
5615 <dd><p>Favor improved speech intelligibility.
5617 <dt> ‘<samp>audio</samp>’</dt>
5618 <dd><p>Favor faithfulness to the input (the default).
5620 <dt> ‘<samp>lowdelay</samp>’</dt>
5621 <dd><p>Restrict to only the lowest delay modes.
5626 <dt> ‘<samp>cutoff (N.A.)</samp>’</dt>
5627 <dd><p>Set cutoff bandwidth in Hz. The argument must be exactly one of the
5628 following: 4000, 6000, 8000, 12000, or 20000, corresponding to
5629 narrowband, mediumband, wideband, super wideband, and fullband
5630 respectively. The default is 0 (cutoff disabled).
5635 <a name="libvorbis"></a>
5636 <h2 class="section"><a href="ffplay-all.html#toc-libvorbis">13.12 libvorbis</a></h2>
5638 <p>libvorbis encoder wrapper.
5640 <p>Requires the presence of the libvorbisenc headers and library during
5641 configuration. You need to explicitly configure the build with
5642 <code>--enable-libvorbis</code>.
5644 <a name="Options-32"></a>
5645 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-32">13.12.1 Options</a></h3>
5647 <p>The following options are supported by the libvorbis wrapper. The
5648 <code>oggenc</code>-equivalent of the options are listed in parentheses.
5650 <p>To get a more accurate and extensive documentation of the libvorbis
5651 options, consult the libvorbisenc’s and <code>oggenc</code>’s documentations.
5652 See <a href="http://xiph.org/vorbis/">http://xiph.org/vorbis/</a>,
5653 <a href="http://wiki.xiph.org/Vorbis-tools">http://wiki.xiph.org/Vorbis-tools</a>, and oggenc(1).
5655 <dl compact="compact">
5656 <dt> ‘<samp>b (<em>-b</em>)</samp>’</dt>
5657 <dd><p>Set bitrate expressed in bits/s for ABR. <code>oggenc</code> ‘<samp>-b</samp>’ is
5658 expressed in kilobits/s.
5661 <dt> ‘<samp>q (<em>-q</em>)</samp>’</dt>
5662 <dd><p>Set constant quality setting for VBR. The value should be a float
5663 number in the range of -1.0 to 10.0. The higher the value, the better
5664 the quality. The default value is ‘<samp>3.0</samp>’.
5666 <p>This option is valid only using the <code>ffmpeg</code> command-line tool.
5667 For library interface users, use ‘<samp>global_quality</samp>’.
5670 <dt> ‘<samp>cutoff (<em>--advanced-encode-option lowpass_frequency=N</em>)</samp>’</dt>
5671 <dd><p>Set cutoff bandwidth in Hz, a value of 0 disables cutoff. <code>oggenc</code>’s
5672 related option is expressed in kHz. The default value is ‘<samp>0</samp>’ (cutoff
5676 <dt> ‘<samp>minrate (<em>-m</em>)</samp>’</dt>
5677 <dd><p>Set minimum bitrate expressed in bits/s. <code>oggenc</code> ‘<samp>-m</samp>’ is
5678 expressed in kilobits/s.
5681 <dt> ‘<samp>maxrate (<em>-M</em>)</samp>’</dt>
5682 <dd><p>Set maximum bitrate expressed in bits/s. <code>oggenc</code> ‘<samp>-M</samp>’ is
5683 expressed in kilobits/s. This only has effect on ABR mode.
5686 <dt> ‘<samp>iblock (<em>--advanced-encode-option impulse_noisetune=N</em>)</samp>’</dt>
5687 <dd><p>Set noise floor bias for impulse blocks. The value is a float number from
5688 -15.0 to 0.0. A negative bias instructs the encoder to pay special attention
5689 to the crispness of transients in the encoded audio. The tradeoff for better
5690 transient response is a higher bitrate.
5695 <a name="libwavpack"></a>
5696 <h2 class="section"><a href="ffplay-all.html#toc-libwavpack">13.13 libwavpack</a></h2>
5698 <p>A wrapper providing WavPack encoding through libwavpack.
5700 <p>Only lossless mode using 32-bit integer samples is supported currently.
5701 The ‘<samp>compression_level</samp>’ option can be used to control speed vs.
5702 compression tradeoff, with the values mapped to libwavpack as follows:
5704 <dl compact="compact">
5705 <dt> ‘<samp>0</samp>’</dt>
5706 <dd><p>Fast mode - corresponding to the wavpack ‘<samp>-f</samp>’ option.
5709 <dt> ‘<samp>1</samp>’</dt>
5710 <dd><p>Normal (default) settings.
5713 <dt> ‘<samp>2</samp>’</dt>
5714 <dd><p>High quality - corresponding to the wavpack ‘<samp>-h</samp>’ option.
5717 <dt> ‘<samp>3</samp>’</dt>
5718 <dd><p>Very high quality - corresponding to the wavpack ‘<samp>-hh</samp>’ option.
5721 <dt> ‘<samp>4-8</samp>’</dt>
5722 <dd><p>Same as 3, but with extra processing enabled - corresponding to the wavpack
5723 ‘<samp>-x</samp>’ option. I.e. 4 is the same as ‘<samp>-x2</samp>’ and 8 is the same as
5724 ‘<samp>-x6</samp>’.
5730 <a name="Video-Encoders"></a>
5731 <h1 class="chapter"><a href="ffplay-all.html#toc-Video-Encoders">14. Video Encoders</a></h1>
5733 <p>A description of some of the currently available video encoders
5736 <a name="libtheora"></a>
5737 <h2 class="section"><a href="ffplay-all.html#toc-libtheora">14.1 libtheora</a></h2>
5739 <p>libtheora Theora encoder wrapper.
5741 <p>Requires the presence of the libtheora headers and library during
5742 configuration. You need to explicitly configure the build with
5743 <code>--enable-libtheora</code>.
5745 <p>For more informations about the libtheora project see
5746 <a href="http://www.theora.org/">http://www.theora.org/</a>.
5748 <a name="Options-19"></a>
5749 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-19">14.1.1 Options</a></h3>
5751 <p>The following global options are mapped to internal libtheora options
5752 which affect the quality and the bitrate of the encoded stream.
5754 <dl compact="compact">
5755 <dt> ‘<samp>b</samp>’</dt>
5756 <dd><p>Set the video bitrate in bit/s for CBR (Constant Bit Rate) mode. In
5757 case VBR (Variable Bit Rate) mode is enabled this option is ignored.
5760 <dt> ‘<samp>flags</samp>’</dt>
5761 <dd><p>Used to enable constant quality mode (VBR) encoding through the
5762 ‘<samp>qscale</samp>’ flag, and to enable the <code>pass1</code> and <code>pass2</code>
5766 <dt> ‘<samp>g</samp>’</dt>
5767 <dd><p>Set the GOP size.
5770 <dt> ‘<samp>global_quality</samp>’</dt>
5771 <dd><p>Set the global quality as an integer in lambda units.
5773 <p>Only relevant when VBR mode is enabled with <code>flags +qscale</code>. The
5774 value is converted to QP units by dividing it by <code>FF_QP2LAMBDA</code>,
5775 clipped in the [0 - 10] range, and then multiplied by 6.3 to get a
5776 value in the native libtheora range [0-63]. A higher value corresponds
5777 to a higher quality.
5780 <dt> ‘<samp>q</samp>’</dt>
5781 <dd><p>Enable VBR mode when set to a non-negative value, and set constant
5782 quality value as a double floating point value in QP units.
5784 <p>The value is clipped in the [0-10] range, and then multiplied by 6.3
5785 to get a value in the native libtheora range [0-63].
5787 <p>This option is valid only using the <code>ffmpeg</code> command-line
5788 tool. For library interface users, use ‘<samp>global_quality</samp>’.
5792 <a name="Examples-28"></a>
5793 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-28">14.1.2 Examples</a></h3>
5797 Set maximum constant quality (VBR) encoding with <code>ffmpeg</code>:
5798 <table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -codec:v libtheora -q:v 10 OUTPUT.ogg
5799 </pre></td></tr></table>
5802 Use <code>ffmpeg</code> to convert a CBR 1000 kbps Theora video stream:
5803 <table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -codec:v libtheora -b:v 1000k OUTPUT.ogg
5804 </pre></td></tr></table>
5807 <a name="libvpx"></a>
5808 <h2 class="section"><a href="ffplay-all.html#toc-libvpx">14.2 libvpx</a></h2>
5810 <p>VP8 format supported through libvpx.
5812 <p>Requires the presence of the libvpx headers and library during configuration.
5813 You need to explicitly configure the build with <code>--enable-libvpx</code>.
5815 <a name="Options-1"></a>
5816 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-1">14.2.1 Options</a></h3>
5818 <p>Mapping from FFmpeg to libvpx options with conversion notes in parentheses.
5820 <dl compact="compact">
5821 <dt> ‘<samp>threads</samp>’</dt>
5825 <dt> ‘<samp>profile</samp>’</dt>
5829 <dt> ‘<samp>vb</samp>’</dt>
5830 <dd><p>rc_target_bitrate
5833 <dt> ‘<samp>g</samp>’</dt>
5837 <dt> ‘<samp>keyint_min</samp>’</dt>
5841 <dt> ‘<samp>qmin</samp>’</dt>
5842 <dd><p>rc_min_quantizer
5845 <dt> ‘<samp>qmax</samp>’</dt>
5846 <dd><p>rc_max_quantizer
5849 <dt> ‘<samp>bufsize, vb</samp>’</dt>
5851 <code>(bufsize * 1000 / vb)</code>
5853 <p>rc_buf_optimal_sz
5854 <code>(bufsize * 1000 / vb * 5 / 6)</code>
5857 <dt> ‘<samp>rc_init_occupancy, vb</samp>’</dt>
5858 <dd><p>rc_buf_initial_sz
5859 <code>(rc_init_occupancy * 1000 / vb)</code>
5862 <dt> ‘<samp>rc_buffer_aggressivity</samp>’</dt>
5863 <dd><p>rc_undershoot_pct
5866 <dt> ‘<samp>skip_threshold</samp>’</dt>
5867 <dd><p>rc_dropframe_thresh
5870 <dt> ‘<samp>qcomp</samp>’</dt>
5871 <dd><p>rc_2pass_vbr_bias_pct
5874 <dt> ‘<samp>maxrate, vb</samp>’</dt>
5875 <dd><p>rc_2pass_vbr_maxsection_pct
5876 <code>(maxrate * 100 / vb)</code>
5879 <dt> ‘<samp>minrate, vb</samp>’</dt>
5880 <dd><p>rc_2pass_vbr_minsection_pct
5881 <code>(minrate * 100 / vb)</code>
5884 <dt> ‘<samp>minrate, maxrate, vb</samp>’</dt>
5885 <dd><p><code>VPX_CBR</code>
5886 <code>(minrate == maxrate == vb)</code>
5889 <dt> ‘<samp>crf</samp>’</dt>
5890 <dd><p><code>VPX_CQ</code>, <code>VP8E_SET_CQ_LEVEL</code>
5893 <dt> ‘<samp>quality</samp>’</dt>
5894 <dd><dl compact="compact">
5895 <dt> ‘<samp><var>best</var></samp>’</dt>
5896 <dd><p><code>VPX_DL_BEST_QUALITY</code>
5898 <dt> ‘<samp><var>good</var></samp>’</dt>
5899 <dd><p><code>VPX_DL_GOOD_QUALITY</code>
5901 <dt> ‘<samp><var>realtime</var></samp>’</dt>
5902 <dd><p><code>VPX_DL_REALTIME</code>
5907 <dt> ‘<samp>speed</samp>’</dt>
5908 <dd><p><code>VP8E_SET_CPUUSED</code>
5911 <dt> ‘<samp>nr</samp>’</dt>
5912 <dd><p><code>VP8E_SET_NOISE_SENSITIVITY</code>
5915 <dt> ‘<samp>mb_threshold</samp>’</dt>
5916 <dd><p><code>VP8E_SET_STATIC_THRESHOLD</code>
5919 <dt> ‘<samp>slices</samp>’</dt>
5920 <dd><p><code>VP8E_SET_TOKEN_PARTITIONS</code>
5923 <dt> ‘<samp>max-intra-rate</samp>’</dt>
5924 <dd><p><code>VP8E_SET_MAX_INTRA_BITRATE_PCT</code>
5927 <dt> ‘<samp>force_key_frames</samp>’</dt>
5928 <dd><p><code>VPX_EFLAG_FORCE_KF</code>
5931 <dt> ‘<samp>Alternate reference frame related</samp>’</dt>
5932 <dd><dl compact="compact">
5933 <dt> ‘<samp>vp8flags altref</samp>’</dt>
5934 <dd><p><code>VP8E_SET_ENABLEAUTOALTREF</code>
5936 <dt> ‘<samp><var>arnr_max_frames</var></samp>’</dt>
5937 <dd><p><code>VP8E_SET_ARNR_MAXFRAMES</code>
5939 <dt> ‘<samp><var>arnr_type</var></samp>’</dt>
5940 <dd><p><code>VP8E_SET_ARNR_TYPE</code>
5942 <dt> ‘<samp><var>arnr_strength</var></samp>’</dt>
5943 <dd><p><code>VP8E_SET_ARNR_STRENGTH</code>
5945 <dt> ‘<samp><var>rc_lookahead</var></samp>’</dt>
5946 <dd><p>g_lag_in_frames
5951 <dt> ‘<samp>vp8flags error_resilient</samp>’</dt>
5952 <dd><p>g_error_resilient
5957 <p>For more information about libvpx see:
5958 <a href="http://www.webmproject.org/">http://www.webmproject.org/</a>
5960 <a name="libx264"></a>
5961 <h2 class="section"><a href="ffplay-all.html#toc-libx264">14.3 libx264</a></h2>
5963 <p>x264 H.264/MPEG-4 AVC encoder wrapper.
5965 <p>This encoder requires the presence of the libx264 headers and library
5966 during configuration. You need to explicitly configure the build with
5967 <code>--enable-libx264</code>.
5969 <p>libx264 supports an impressive number of features, including 8x8 and
5970 4x4 adaptive spatial transform, adaptive B-frame placement, CAVLC/CABAC
5971 entropy coding, interlacing (MBAFF), lossless mode, psy optimizations
5972 for detail retention (adaptive quantization, psy-RD, psy-trellis).
5974 <p>Many libx264 encoder options are mapped to FFmpeg global codec
5975 options, while unique encoder options are provided through private
5976 options. Additionally the ‘<samp>x264opts</samp>’ and ‘<samp>x264-params</samp>’
5977 private options allows to pass a list of key=value tuples as accepted
5978 by the libx264 <code>x264_param_parse</code> function.
5980 <p>The x264 project website is at
5981 <a href="http://www.videolan.org/developers/x264.html">http://www.videolan.org/developers/x264.html</a>.
5983 <a name="Options-10"></a>
5984 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-10">14.3.1 Options</a></h3>
5986 <p>The following options are supported by the libx264 wrapper. The
5987 <code>x264</code>-equivalent options or values are listed in parentheses
5990 <p>To reduce the duplication of documentation, only the private options
5991 and some others requiring special attention are documented here. For
5992 the documentation of the undocumented generic options, see
5993 <a href="#codec_002doptions">the Codec Options chapter</a>.
5995 <p>To get a more accurate and extensive documentation of the libx264
5996 options, invoke the command <code>x264 --full-help</code> or consult
5997 the libx264 documentation.
5999 <dl compact="compact">
6000 <dt> ‘<samp>b (<em>bitrate</em>)</samp>’</dt>
6001 <dd><p>Set bitrate in bits/s. Note that FFmpeg’s ‘<samp>b</samp>’ option is
6002 expressed in bits/s, while <code>x264</code>’s ‘<samp>bitrate</samp>’ is in
6006 <dt> ‘<samp>bf (<em>bframes</em>)</samp>’</dt>
6007 <dt> ‘<samp>g (<em>keyint</em>)</samp>’</dt>
6008 <dt> ‘<samp>qmax (<em>qpmax</em>)</samp>’</dt>
6009 <dt> ‘<samp>qmin (<em>qpmin</em>)</samp>’</dt>
6010 <dt> ‘<samp>qdiff (<em>qpstep</em>)</samp>’</dt>
6011 <dt> ‘<samp>qblur (<em>qblur</em>)</samp>’</dt>
6012 <dt> ‘<samp>qcomp (<em>qcomp</em>)</samp>’</dt>
6013 <dt> ‘<samp>refs (<em>ref</em>)</samp>’</dt>
6014 <dt> ‘<samp>sc_threshold (<em>scenecut</em>)</samp>’</dt>
6015 <dt> ‘<samp>trellis (<em>trellis</em>)</samp>’</dt>
6016 <dt> ‘<samp>nr (<em>nr</em>)</samp>’</dt>
6017 <dt> ‘<samp>me_range (<em>merange</em>)</samp>’</dt>
6018 <dt> ‘<samp>me_method (<em>me</em>)</samp>’</dt>
6019 <dd><p>Set motion estimation method. Possible values in the decreasing order
6022 <dl compact="compact">
6023 <dt> ‘<samp>dia (<em>dia</em>)</samp>’</dt>
6024 <dt> ‘<samp>epzs (<em>dia</em>)</samp>’</dt>
6025 <dd><p>Diamond search with radius 1 (fastest). ‘<samp>epzs</samp>’ is an alias for
6026 ‘<samp>dia</samp>’.
6028 <dt> ‘<samp>hex (<em>hex</em>)</samp>’</dt>
6029 <dd><p>Hexagonal search with radius 2.
6031 <dt> ‘<samp>umh (<em>umh</em>)</samp>’</dt>
6032 <dd><p>Uneven multi-hexagon search.
6034 <dt> ‘<samp>esa (<em>esa</em>)</samp>’</dt>
6035 <dd><p>Exhaustive search.
6037 <dt> ‘<samp>tesa (<em>tesa</em>)</samp>’</dt>
6038 <dd><p>Hadamard exhaustive search (slowest).
6043 <dt> ‘<samp>subq (<em>subme</em>)</samp>’</dt>
6044 <dt> ‘<samp>b_strategy (<em>b-adapt</em>)</samp>’</dt>
6045 <dt> ‘<samp>keyint_min (<em>min-keyint</em>)</samp>’</dt>
6046 <dt> ‘<samp>coder</samp>’</dt>
6047 <dd><p>Set entropy encoder. Possible values:
6049 <dl compact="compact">
6050 <dt> ‘<samp>ac</samp>’</dt>
6051 <dd><p>Enable CABAC.
6054 <dt> ‘<samp>vlc</samp>’</dt>
6055 <dd><p>Enable CAVLC and disable CABAC. It generates the same effect as
6056 <code>x264</code>’s ‘<samp>--no-cabac</samp>’ option.
6061 <dt> ‘<samp>cmp</samp>’</dt>
6062 <dd><p>Set full pixel motion estimation comparation algorithm. Possible values:
6064 <dl compact="compact">
6065 <dt> ‘<samp>chroma</samp>’</dt>
6066 <dd><p>Enable chroma in motion estimation.
6069 <dt> ‘<samp>sad</samp>’</dt>
6070 <dd><p>Ignore chroma in motion estimation. It generates the same effect as
6071 <code>x264</code>’s ‘<samp>--no-chroma-me</samp>’ option.
6076 <dt> ‘<samp>threads (<em>threads</em>)</samp>’</dt>
6077 <dt> ‘<samp>thread_type</samp>’</dt>
6078 <dd><p>Set multithreading technique. Possible values:
6080 <dl compact="compact">
6081 <dt> ‘<samp>slice</samp>’</dt>
6082 <dd><p>Slice-based multithreading. It generates the same effect as
6083 <code>x264</code>’s ‘<samp>--sliced-threads</samp>’ option.
6085 <dt> ‘<samp>frame</samp>’</dt>
6086 <dd><p>Frame-based multithreading.
6091 <dt> ‘<samp>flags</samp>’</dt>
6092 <dd><p>Set encoding flags. It can be used to disable closed GOP and enable
6093 open GOP by setting it to <code>-cgop</code>. The result is similar to
6094 the behavior of <code>x264</code>’s ‘<samp>--open-gop</samp>’ option.
6097 <dt> ‘<samp>rc_init_occupancy (<em>vbv-init</em>)</samp>’</dt>
6098 <dt> ‘<samp>preset (<em>preset</em>)</samp>’</dt>
6099 <dd><p>Set the encoding preset.
6102 <dt> ‘<samp>tune (<em>tune</em>)</samp>’</dt>
6103 <dd><p>Set tuning of the encoding params.
6106 <dt> ‘<samp>profile (<em>profile</em>)</samp>’</dt>
6107 <dd><p>Set profile restrictions.
6110 <dt> ‘<samp>fastfirstpass</samp>’</dt>
6111 <dd><p>Enable fast settings when encoding first pass, when set to 1. When set
6112 to 0, it has the same effect of <code>x264</code>’s
6113 ‘<samp>--slow-firstpass</samp>’ option.
6116 <dt> ‘<samp>crf (<em>crf</em>)</samp>’</dt>
6117 <dd><p>Set the quality for constant quality mode.
6120 <dt> ‘<samp>crf_max (<em>crf-max</em>)</samp>’</dt>
6121 <dd><p>In CRF mode, prevents VBV from lowering quality beyond this point.
6124 <dt> ‘<samp>qp (<em>qp</em>)</samp>’</dt>
6125 <dd><p>Set constant quantization rate control method parameter.
6128 <dt> ‘<samp>aq-mode (<em>aq-mode</em>)</samp>’</dt>
6129 <dd><p>Set AQ method. Possible values:
6131 <dl compact="compact">
6132 <dt> ‘<samp>none (<em>0</em>)</samp>’</dt>
6136 <dt> ‘<samp>variance (<em>1</em>)</samp>’</dt>
6137 <dd><p>Variance AQ (complexity mask).
6140 <dt> ‘<samp>autovariance (<em>2</em>)</samp>’</dt>
6141 <dd><p>Auto-variance AQ (experimental).
6146 <dt> ‘<samp>aq-strength (<em>aq-strength</em>)</samp>’</dt>
6147 <dd><p>Set AQ strength, reduce blocking and blurring in flat and textured areas.
6150 <dt> ‘<samp>psy</samp>’</dt>
6151 <dd><p>Use psychovisual optimizations when set to 1. When set to 0, it has the
6152 same effect as <code>x264</code>’s ‘<samp>--no-psy</samp>’ option.
6155 <dt> ‘<samp>psy-rd (<em>psy-rd</em>)</samp>’</dt>
6156 <dd><p>Set strength of psychovisual optimization, in
6157 <var>psy-rd</var>:<var>psy-trellis</var> format.
6160 <dt> ‘<samp>rc-lookahead (<em>rc-lookahead</em>)</samp>’</dt>
6161 <dd><p>Set number of frames to look ahead for frametype and ratecontrol.
6164 <dt> ‘<samp>weightb</samp>’</dt>
6165 <dd><p>Enable weighted prediction for B-frames when set to 1. When set to 0,
6166 it has the same effect as <code>x264</code>’s ‘<samp>--no-weightb</samp>’ option.
6169 <dt> ‘<samp>weightp (<em>weightp</em>)</samp>’</dt>
6170 <dd><p>Set weighted prediction method for P-frames. Possible values:
6172 <dl compact="compact">
6173 <dt> ‘<samp>none (<em>0</em>)</samp>’</dt>
6176 <dt> ‘<samp>simple (<em>1</em>)</samp>’</dt>
6177 <dd><p>Enable only weighted refs
6179 <dt> ‘<samp>smart (<em>2</em>)</samp>’</dt>
6180 <dd><p>Enable both weighted refs and duplicates
6185 <dt> ‘<samp>ssim (<em>ssim</em>)</samp>’</dt>
6186 <dd><p>Enable calculation and printing SSIM stats after the encoding.
6189 <dt> ‘<samp>intra-refresh (<em>intra-refresh</em>)</samp>’</dt>
6190 <dd><p>Enable the use of Periodic Intra Refresh instead of IDR frames when set
6194 <dt> ‘<samp>bluray-compat (<em>bluray-compat</em>)</samp>’</dt>
6195 <dd><p>Configure the encoder to be compatible with the bluray standard.
6196 It is a shorthand for setting "bluray-compat=1 force-cfr=1".
6199 <dt> ‘<samp>b-bias (<em>b-bias</em>)</samp>’</dt>
6200 <dd><p>Set the influence on how often B-frames are used.
6203 <dt> ‘<samp>b-pyramid (<em>b-pyramid</em>)</samp>’</dt>
6204 <dd><p>Set method for keeping of some B-frames as references. Possible values:
6206 <dl compact="compact">
6207 <dt> ‘<samp>none (<em>none</em>)</samp>’</dt>
6210 <dt> ‘<samp>strict (<em>strict</em>)</samp>’</dt>
6211 <dd><p>Strictly hierarchical pyramid.
6213 <dt> ‘<samp>normal (<em>normal</em>)</samp>’</dt>
6214 <dd><p>Non-strict (not Blu-ray compatible).
6219 <dt> ‘<samp>mixed-refs</samp>’</dt>
6220 <dd><p>Enable the use of one reference per partition, as opposed to one
6221 reference per macroblock when set to 1. When set to 0, it has the
6222 same effect as <code>x264</code>’s ‘<samp>--no-mixed-refs</samp>’ option.
6225 <dt> ‘<samp>8x8dct</samp>’</dt>
6226 <dd><p>Enable adaptive spatial transform (high profile 8x8 transform)
6227 when set to 1. When set to 0, it has the same effect as
6228 <code>x264</code>’s ‘<samp>--no-8x8dct</samp>’ option.
6231 <dt> ‘<samp>fast-pskip</samp>’</dt>
6232 <dd><p>Enable early SKIP detection on P-frames when set to 1. When set
6233 to 0, it has the same effect as <code>x264</code>’s
6234 ‘<samp>--no-fast-pskip</samp>’ option.
6237 <dt> ‘<samp>aud (<em>aud</em>)</samp>’</dt>
6238 <dd><p>Enable use of access unit delimiters when set to 1.
6241 <dt> ‘<samp>mbtree</samp>’</dt>
6242 <dd><p>Enable use macroblock tree ratecontrol when set to 1. When set
6243 to 0, it has the same effect as <code>x264</code>’s
6244 ‘<samp>--no-mbtree</samp>’ option.
6247 <dt> ‘<samp>deblock (<em>deblock</em>)</samp>’</dt>
6248 <dd><p>Set loop filter parameters, in <var>alpha</var>:<var>beta</var> form.
6251 <dt> ‘<samp>cplxblur (<em>cplxblur</em>)</samp>’</dt>
6252 <dd><p>Set fluctuations reduction in QP (before curve compression).
6255 <dt> ‘<samp>partitions (<em>partitions</em>)</samp>’</dt>
6256 <dd><p>Set partitions to consider as a comma-separated list of. Possible
6259 <dl compact="compact">
6260 <dt> ‘<samp>p8x8</samp>’</dt>
6261 <dd><p>8x8 P-frame partition.
6263 <dt> ‘<samp>p4x4</samp>’</dt>
6264 <dd><p>4x4 P-frame partition.
6266 <dt> ‘<samp>b8x8</samp>’</dt>
6267 <dd><p>4x4 B-frame partition.
6269 <dt> ‘<samp>i8x8</samp>’</dt>
6270 <dd><p>8x8 I-frame partition.
6272 <dt> ‘<samp>i4x4</samp>’</dt>
6273 <dd><p>4x4 I-frame partition.
6274 (Enabling ‘<samp>p4x4</samp>’ requires ‘<samp>p8x8</samp>’ to be enabled. Enabling
6275 ‘<samp>i8x8</samp>’ requires adaptive spatial transform (‘<samp>8x8dct</samp>’
6276 option) to be enabled.)
6278 <dt> ‘<samp>none (<em>none</em>)</samp>’</dt>
6279 <dd><p>Do not consider any partitions.
6281 <dt> ‘<samp>all (<em>all</em>)</samp>’</dt>
6282 <dd><p>Consider every partition.
6287 <dt> ‘<samp>direct-pred (<em>direct</em>)</samp>’</dt>
6288 <dd><p>Set direct MV prediction mode. Possible values:
6290 <dl compact="compact">
6291 <dt> ‘<samp>none (<em>none</em>)</samp>’</dt>
6292 <dd><p>Disable MV prediction.
6294 <dt> ‘<samp>spatial (<em>spatial</em>)</samp>’</dt>
6295 <dd><p>Enable spatial predicting.
6297 <dt> ‘<samp>temporal (<em>temporal</em>)</samp>’</dt>
6298 <dd><p>Enable temporal predicting.
6300 <dt> ‘<samp>auto (<em>auto</em>)</samp>’</dt>
6301 <dd><p>Automatically decided.
6306 <dt> ‘<samp>slice-max-size (<em>slice-max-size</em>)</samp>’</dt>
6307 <dd><p>Set the limit of the size of each slice in bytes. If not specified
6308 but RTP payload size (‘<samp>ps</samp>’) is specified, that is used.
6311 <dt> ‘<samp>stats (<em>stats</em>)</samp>’</dt>
6312 <dd><p>Set the file name for multi-pass stats.
6315 <dt> ‘<samp>nal-hrd (<em>nal-hrd</em>)</samp>’</dt>
6316 <dd><p>Set signal HRD information (requires ‘<samp>vbv-bufsize</samp>’ to be set).
6319 <dl compact="compact">
6320 <dt> ‘<samp>none (<em>none</em>)</samp>’</dt>
6321 <dd><p>Disable HRD information signaling.
6323 <dt> ‘<samp>vbr (<em>vbr</em>)</samp>’</dt>
6324 <dd><p>Variable bit rate.
6326 <dt> ‘<samp>cbr (<em>cbr</em>)</samp>’</dt>
6327 <dd><p>Constant bit rate (not allowed in MP4 container).
6332 <dt> ‘<samp>x264opts (N.A.)</samp>’</dt>
6333 <dd><p>Set any x264 option, see <code>x264 --fullhelp</code> for a list.
6335 <p>Argument is a list of <var>key</var>=<var>value</var> couples separated by
6336 ":". In <var>filter</var> and <var>psy-rd</var> options that use ":" as a separator
6337 themselves, use "," instead. They accept it as well since long ago but this
6338 is kept undocumented for some reason.
6340 <p>For example to specify libx264 encoding options with <code>ffmpeg</code>:
6341 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
6342 </pre></td></tr></table>
6345 <dt> ‘<samp>x264-params (N.A.)</samp>’</dt>
6346 <dd><p>Override the x264 configuration using a :-separated list of key=value
6349 <p>This option is functionally the same as the ‘<samp>x264opts</samp>’, but is
6350 duplicated for compability with the Libav fork.
6352 <p>For example to specify libx264 encoding options with <code>ffmpeg</code>:
6353 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -c:v libx264 -x264-params level=30:bframes=0:weightp=0:\
6354 cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:\
6355 no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
6356 </pre></td></tr></table>
6360 <p>Encoding ffpresets for common usages are provided so they can be used with the
6361 general presets system (e.g. passing the ‘<samp>pre</samp>’ option).
6363 <a name="libxvid"></a>
6364 <h2 class="section"><a href="ffplay-all.html#toc-libxvid">14.4 libxvid</a></h2>
6366 <p>Xvid MPEG-4 Part 2 encoder wrapper.
6368 <p>This encoder requires the presence of the libxvidcore headers and library
6369 during configuration. You need to explicitly configure the build with
6370 <code>--enable-libxvid --enable-gpl</code>.
6372 <p>The native <code>mpeg4</code> encoder supports the MPEG-4 Part 2 format, so
6373 users can encode to this format without this library.
6375 <a name="Options-14"></a>
6376 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-14">14.4.1 Options</a></h3>
6378 <p>The following options are supported by the libxvid wrapper. Some of
6379 the following options are listed but are not documented, and
6380 correspond to shared codec options. See <a href="#codec_002doptions">the Codec Options chapter</a> for their documentation. The other shared options
6381 which are not listed have no effect for the libxvid encoder.
6383 <dl compact="compact">
6384 <dt> ‘<samp>b</samp>’</dt>
6385 <dt> ‘<samp>g</samp>’</dt>
6386 <dt> ‘<samp>qmin</samp>’</dt>
6387 <dt> ‘<samp>qmax</samp>’</dt>
6388 <dt> ‘<samp>mpeg_quant</samp>’</dt>
6389 <dt> ‘<samp>threads</samp>’</dt>
6390 <dt> ‘<samp>bf</samp>’</dt>
6391 <dt> ‘<samp>b_qfactor</samp>’</dt>
6392 <dt> ‘<samp>b_qoffset</samp>’</dt>
6393 <dt> ‘<samp>flags</samp>’</dt>
6394 <dd><p>Set specific encoding flags. Possible values:
6396 <dl compact="compact">
6397 <dt> ‘<samp>mv4</samp>’</dt>
6398 <dd><p>Use four motion vector by macroblock.
6401 <dt> ‘<samp>aic</samp>’</dt>
6402 <dd><p>Enable high quality AC prediction.
6405 <dt> ‘<samp>gray</samp>’</dt>
6406 <dd><p>Only encode grayscale.
6409 <dt> ‘<samp>gmc</samp>’</dt>
6410 <dd><p>Enable the use of global motion compensation (GMC).
6413 <dt> ‘<samp>qpel</samp>’</dt>
6414 <dd><p>Enable quarter-pixel motion compensation.
6417 <dt> ‘<samp>cgop</samp>’</dt>
6418 <dd><p>Enable closed GOP.
6421 <dt> ‘<samp>global_header</samp>’</dt>
6422 <dd><p>Place global headers in extradata instead of every keyframe.
6428 <dt> ‘<samp>trellis</samp>’</dt>
6429 <dt> ‘<samp>me_method</samp>’</dt>
6430 <dd><p>Set motion estimation method. Possible values in decreasing order of
6431 speed and increasing order of quality:
6433 <dl compact="compact">
6434 <dt> ‘<samp>zero</samp>’</dt>
6435 <dd><p>Use no motion estimation (default).
6438 <dt> ‘<samp>phods</samp>’</dt>
6439 <dt> ‘<samp>x1</samp>’</dt>
6440 <dt> ‘<samp>log</samp>’</dt>
6441 <dd><p>Enable advanced diamond zonal search for 16x16 blocks and half-pixel
6442 refinement for 16x16 blocks. ‘<samp>x1</samp>’ and ‘<samp>log</samp>’ are aliases for
6443 ‘<samp>phods</samp>’.
6446 <dt> ‘<samp>epzs</samp>’</dt>
6447 <dd><p>Enable all of the things described above, plus advanced diamond zonal
6448 search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion
6449 estimation on chroma planes.
6452 <dt> ‘<samp>full</samp>’</dt>
6453 <dd><p>Enable all of the things described above, plus extended 16x16 and 8x8
6459 <dt> ‘<samp>mbd</samp>’</dt>
6460 <dd><p>Set macroblock decision algorithm. Possible values in the increasing
6463 <dl compact="compact">
6464 <dt> ‘<samp>simple</samp>’</dt>
6465 <dd><p>Use macroblock comparing function algorithm (default).
6468 <dt> ‘<samp>bits</samp>’</dt>
6469 <dd><p>Enable rate distortion-based half pixel and quarter pixel refinement for
6473 <dt> ‘<samp>rd</samp>’</dt>
6474 <dd><p>Enable all of the things described above, plus rate distortion-based
6475 half pixel and quarter pixel refinement for 8x8 blocks, and rate
6476 distortion-based search using square pattern.
6481 <dt> ‘<samp>lumi_aq</samp>’</dt>
6482 <dd><p>Enable lumi masking adaptive quantization when set to 1. Default is 0
6486 <dt> ‘<samp>variance_aq</samp>’</dt>
6487 <dd><p>Enable variance adaptive quantization when set to 1. Default is 0
6490 <p>When combined with ‘<samp>lumi_aq</samp>’, the resulting quality will not
6491 be better than any of the two specified individually. In other
6492 words, the resulting quality will be the worse one of the two
6496 <dt> ‘<samp>ssim</samp>’</dt>
6497 <dd><p>Set structural similarity (SSIM) displaying method. Possible values:
6499 <dl compact="compact">
6500 <dt> ‘<samp>off</samp>’</dt>
6501 <dd><p>Disable displaying of SSIM information.
6504 <dt> ‘<samp>avg</samp>’</dt>
6505 <dd><p>Output average SSIM at the end of encoding to stdout. The format of
6506 showing the average SSIM is:
6508 <table><tr><td> </td><td><pre class="example">Average SSIM: %f
6509 </pre></td></tr></table>
6511 <p>For users who are not familiar with C, %f means a float number, or
6512 a decimal (e.g. 0.939232).
6515 <dt> ‘<samp>frame</samp>’</dt>
6516 <dd><p>Output both per-frame SSIM data during encoding and average SSIM at
6517 the end of encoding to stdout. The format of per-frame information
6520 <table><tr><td> </td><td><pre class="example"> SSIM: avg: %1.3f min: %1.3f max: %1.3f
6521 </pre></td></tr></table>
6523 <p>For users who are not familiar with C, %1.3f means a float number
6524 rounded to 3 digits after the dot (e.g. 0.932).
6530 <dt> ‘<samp>ssim_acc</samp>’</dt>
6531 <dd><p>Set SSIM accuracy. Valid options are integers within the range of
6532 0-4, while 0 gives the most accurate result and 4 computes the
6539 <h2 class="section"><a href="ffplay-all.html#toc-png">14.5 png</a></h2>
6541 <p>PNG image encoder.
6543 <a name="Private-options"></a>
6544 <h3 class="subsection"><a href="ffplay-all.html#toc-Private-options">14.5.1 Private options</a></h3>
6546 <dl compact="compact">
6547 <dt> ‘<samp>dpi <var>integer</var></samp>’</dt>
6548 <dd><p>Set physical density of pixels, in dots per inch, unset by default
6550 <dt> ‘<samp>dpm <var>integer</var></samp>’</dt>
6551 <dd><p>Set physical density of pixels, in dots per meter, unset by default
6555 <a name="ProRes"></a>
6556 <h2 class="section"><a href="ffplay-all.html#toc-ProRes">14.6 ProRes</a></h2>
6558 <p>Apple ProRes encoder.
6560 <p>FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
6561 The used encoder can be choosen with the <code>-vcodec</code> option.
6563 <a name="Private-Options-for-prores_002dks"></a>
6564 <h3 class="subsection"><a href="ffplay-all.html#toc-Private-Options-for-prores_002dks">14.6.1 Private Options for prores-ks</a></h3>
6566 <dl compact="compact">
6567 <dt> ‘<samp>profile <var>integer</var></samp>’</dt>
6568 <dd><p>Select the ProRes profile to encode
6569 </p><dl compact="compact">
6570 <dt> ‘<samp>proxy</samp>’</dt>
6571 <dt> ‘<samp>lt</samp>’</dt>
6572 <dt> ‘<samp>standard</samp>’</dt>
6573 <dt> ‘<samp>hq</samp>’</dt>
6574 <dt> ‘<samp>4444</samp>’</dt>
6578 <dt> ‘<samp>quant_mat <var>integer</var></samp>’</dt>
6579 <dd><p>Select quantization matrix.
6580 </p><dl compact="compact">
6581 <dt> ‘<samp>auto</samp>’</dt>
6582 <dt> ‘<samp>default</samp>’</dt>
6583 <dt> ‘<samp>proxy</samp>’</dt>
6584 <dt> ‘<samp>lt</samp>’</dt>
6585 <dt> ‘<samp>standard</samp>’</dt>
6586 <dt> ‘<samp>hq</samp>’</dt>
6588 <p>If set to <var>auto</var>, the matrix matching the profile will be picked.
6589 If not set, the matrix providing the highest quality, <var>default</var>, will be
6593 <dt> ‘<samp>bits_per_mb <var>integer</var></samp>’</dt>
6594 <dd><p>How many bits to allot for coding one macroblock. Different profiles use
6595 between 200 and 2400 bits per macroblock, the maximum is 8000.
6598 <dt> ‘<samp>mbs_per_slice <var>integer</var></samp>’</dt>
6599 <dd><p>Number of macroblocks in each slice (1-8); the default value (8)
6600 should be good in almost all situations.
6603 <dt> ‘<samp>vendor <var>string</var></samp>’</dt>
6604 <dd><p>Override the 4-byte vendor ID.
6605 A custom vendor ID like <var>apl0</var> would claim the stream was produced by
6609 <dt> ‘<samp>alpha_bits <var>integer</var></samp>’</dt>
6610 <dd><p>Specify number of bits for alpha component.
6611 Possible values are <var>0</var>, <var>8</var> and <var>16</var>.
6612 Use <var>0</var> to disable alpha plane coding.
6617 <a name="Speed-considerations"></a>
6618 <h3 class="subsection"><a href="ffplay-all.html#toc-Speed-considerations">14.6.2 Speed considerations</a></h3>
6620 <p>In the default mode of operation the encoder has to honor frame constraints
6621 (i.e. not produc frames with size bigger than requested) while still making
6622 output picture as good as possible.
6623 A frame containing a lot of small details is harder to compress and the encoder
6624 would spend more time searching for appropriate quantizers for each slice.
6626 <p>Setting a higher ‘<samp>bits_per_mb</samp>’ limit will improve the speed.
6628 <p>For the fastest encoding speed set the ‘<samp>qscale</samp>’ parameter (4 is the
6629 recommended value) and do not set a size constraint.
6631 <a name="Bitstream-Filters"></a>
6632 <h1 class="chapter"><a href="ffplay-all.html#toc-Bitstream-Filters">15. Bitstream Filters</a></h1>
6634 <p>When you configure your FFmpeg build, all the supported bitstream
6635 filters are enabled by default. You can list all available ones using
6636 the configure option <code>--list-bsfs</code>.
6638 <p>You can disable all the bitstream filters using the configure option
6639 <code>--disable-bsfs</code>, and selectively enable any bitstream filter using
6640 the option <code>--enable-bsf=BSF</code>, or you can disable a particular
6641 bitstream filter using the option <code>--disable-bsf=BSF</code>.
6643 <p>The option <code>-bsfs</code> of the ff* tools will display the list of
6644 all the supported bitstream filters included in your build.
6646 <p>Below is a description of the currently available bitstream filters.
6648 <a name="aac_005fadtstoasc"></a>
6649 <h2 class="section"><a href="ffplay-all.html#toc-aac_005fadtstoasc">15.1 aac_adtstoasc</a></h2>
6651 <p>Convert MPEG-2/4 AAC ADTS to MPEG-4 Audio Specific Configuration
6654 <p>This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4
6655 ADTS header and removes the ADTS header.
6657 <p>This is required for example when copying an AAC stream from a raw
6658 ADTS AAC container to a FLV or a MOV/MP4 file.
6660 <a name="chomp"></a>
6661 <h2 class="section"><a href="ffplay-all.html#toc-chomp">15.2 chomp</a></h2>
6663 <p>Remove zero padding at the end of a packet.
6665 <a name="dump_005fextra"></a>
6666 <h2 class="section"><a href="ffplay-all.html#toc-dump_005fextra">15.3 dump_extra</a></h2>
6668 <p>Add extradata to the beginning of the filtered packets.
6670 <p>The additional argument specifies which packets should be filtered.
6671 It accepts the values:
6672 </p><dl compact="compact">
6673 <dt> ‘<samp>a</samp>’</dt>
6674 <dd><p>add extradata to all key packets, but only if <var>local_header</var> is
6675 set in the ‘<samp>flags2</samp>’ codec context field
6678 <dt> ‘<samp>k</samp>’</dt>
6679 <dd><p>add extradata to all key packets
6682 <dt> ‘<samp>e</samp>’</dt>
6683 <dd><p>add extradata to all packets
6687 <p>If not specified it is assumed ‘<samp>k</samp>’.
6689 <p>For example the following <code>ffmpeg</code> command forces a global
6690 header (thus disabling individual packet headers) in the H.264 packets
6691 generated by the <code>libx264</code> encoder, but corrects them by adding
6692 the header stored in extradata to the key packets:
6693 </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
6694 </pre></td></tr></table>
6696 <a name="h264_005fmp4toannexb"></a>
6697 <h2 class="section"><a href="ffplay-all.html#toc-h264_005fmp4toannexb">15.4 h264_mp4toannexb</a></h2>
6699 <p>Convert an H.264 bitstream from length prefixed mode to start code
6700 prefixed mode (as defined in the Annex B of the ITU-T H.264
6703 <p>This is required by some streaming formats, typically the MPEG-2
6704 transport stream format ("mpegts").
6706 <p>For example to remux an MP4 file containing an H.264 stream to mpegts
6707 format with <code>ffmpeg</code>, you can use the command:
6709 <table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
6710 </pre></td></tr></table>
6712 <a name="imx_005fdump_005fheader"></a>
6713 <h2 class="section"><a href="ffplay-all.html#toc-imx_005fdump_005fheader">15.5 imx_dump_header</a></h2>
6715 <a name="mjpeg2jpeg"></a>
6716 <h2 class="section"><a href="ffplay-all.html#toc-mjpeg2jpeg">15.6 mjpeg2jpeg</a></h2>
6718 <p>Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
6720 <p>MJPEG is a video codec wherein each video frame is essentially a
6721 JPEG image. The individual frames can be extracted without loss,
6724 <table><tr><td> </td><td><pre class="example">ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
6725 </pre></td></tr></table>
6727 <p>Unfortunately, these chunks are incomplete JPEG images, because
6728 they lack the DHT segment required for decoding. Quoting from
6729 <a href="http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml">http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml</a>:
6731 <p>Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
6732 commented that "MJPEG, or at least the MJPEG in AVIs having the
6733 MJPG fourcc, is restricted JPEG with a fixed – and *omitted* –
6734 Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2,
6735 and it must use basic Huffman encoding, not arithmetic or
6736 progressive. . . . You can indeed extract the MJPEG frames and
6737 decode them with a regular JPEG decoder, but you have to prepend
6738 the DHT segment to them, or else the decoder won’t have any idea
6739 how to decompress the data. The exact table necessary is given in
6740 the OpenDML spec."
6742 <p>This bitstream filter patches the header of frames extracted from an MJPEG
6743 stream (carrying the AVI1 header ID and lacking a DHT segment) to
6744 produce fully qualified JPEG images.
6746 <table><tr><td> </td><td><pre class="example">ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
6747 exiftran -i -9 frame*.jpg
6748 ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
6749 </pre></td></tr></table>
6751 <a name="mjpega_005fdump_005fheader"></a>
6752 <h2 class="section"><a href="ffplay-all.html#toc-mjpega_005fdump_005fheader">15.7 mjpega_dump_header</a></h2>
6754 <a name="movsub"></a>
6755 <h2 class="section"><a href="ffplay-all.html#toc-movsub">15.8 movsub</a></h2>
6757 <a name="mp3_005fheader_005fdecompress"></a>
6758 <h2 class="section"><a href="ffplay-all.html#toc-mp3_005fheader_005fdecompress">15.9 mp3_header_decompress</a></h2>
6760 <a name="noise-1"></a>
6761 <h2 class="section"><a href="ffplay-all.html#toc-noise-1">15.10 noise</a></h2>
6763 <a name="remove_005fextra"></a>
6764 <h2 class="section"><a href="ffplay-all.html#toc-remove_005fextra">15.11 remove_extra</a></h2>
6766 <a name="Format-Options"></a>
6767 <h1 class="chapter"><a href="ffplay-all.html#toc-Format-Options">16. Format Options</a></h1>
6769 <p>The libavformat library provides some generic global options, which
6770 can be set on all the muxers and demuxers. In addition each muxer or
6771 demuxer may support so-called private options, which are specific for
6774 <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
6775 FFmpeg tools, or by setting the value explicitly in the
6776 <code>AVFormatContext</code> options or using the ‘<tt>libavutil/opt.h</tt>’ API
6777 for programmatic use.
6779 <p>The list of supported options follows:
6781 <dl compact="compact">
6782 <dt> ‘<samp>avioflags <var>flags</var> (<em>input/output</em>)</samp>’</dt>
6783 <dd><p>Possible values:
6784 </p><dl compact="compact">
6785 <dt> ‘<samp>direct</samp>’</dt>
6786 <dd><p>Reduce buffering.
6791 <dt> ‘<samp>probesize <var>integer</var> (<em>input</em>)</samp>’</dt>
6792 <dd><p>Set probing size in bytes, i.e. the size of the data to analyze to get
6793 stream information. A higher value will allow to detect more
6794 information in case it is dispersed into the stream, but will increase
6795 latency. Must be an integer not lesser than 32. It is 5000000 by default.
6798 <dt> ‘<samp>packetsize <var>integer</var> (<em>output</em>)</samp>’</dt>
6799 <dd><p>Set packet size.
6802 <dt> ‘<samp>fflags <var>flags</var> (<em>input/output</em>)</samp>’</dt>
6803 <dd><p>Set format flags.
6806 </p><dl compact="compact">
6807 <dt> ‘<samp>ignidx</samp>’</dt>
6808 <dd><p>Ignore index.
6810 <dt> ‘<samp>genpts</samp>’</dt>
6811 <dd><p>Generate PTS.
6813 <dt> ‘<samp>nofillin</samp>’</dt>
6814 <dd><p>Do not fill in missing values that can be exactly calculated.
6816 <dt> ‘<samp>noparse</samp>’</dt>
6817 <dd><p>Disable AVParsers, this needs <code>+nofillin</code> too.
6819 <dt> ‘<samp>igndts</samp>’</dt>
6822 <dt> ‘<samp>discardcorrupt</samp>’</dt>
6823 <dd><p>Discard corrupted frames.
6825 <dt> ‘<samp>sortdts</samp>’</dt>
6826 <dd><p>Try to interleave output packets by DTS.
6828 <dt> ‘<samp>keepside</samp>’</dt>
6829 <dd><p>Do not merge side data.
6831 <dt> ‘<samp>latm</samp>’</dt>
6832 <dd><p>Enable RTP MP4A-LATM payload.
6834 <dt> ‘<samp>nobuffer</samp>’</dt>
6835 <dd><p>Reduce the latency introduced by optional buffering
6840 <dt> ‘<samp>seek2any <var>integer</var> (<em>input</em>)</samp>’</dt>
6841 <dd><p>Allow seeking to non-keyframes on demuxer level when supported if set to 1.
6845 <dt> ‘<samp>analyzeduration <var>integer</var> (<em>input</em>)</samp>’</dt>
6846 <dd><p>Specify how many microseconds are analyzed to probe the input. A
6847 higher value will allow to detect more accurate information, but will
6848 increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
6851 <dt> ‘<samp>cryptokey <var>hexadecimal string</var> (<em>input</em>)</samp>’</dt>
6852 <dd><p>Set decryption key.
6855 <dt> ‘<samp>indexmem <var>integer</var> (<em>input</em>)</samp>’</dt>
6856 <dd><p>Set max memory used for timestamp index (per stream).
6859 <dt> ‘<samp>rtbufsize <var>integer</var> (<em>input</em>)</samp>’</dt>
6860 <dd><p>Set max memory used for buffering real-time frames.
6863 <dt> ‘<samp>fdebug <var>flags</var> (<em>input/output</em>)</samp>’</dt>
6864 <dd><p>Print specific debug info.
6867 </p><dl compact="compact">
6868 <dt> ‘<samp>ts</samp>’</dt>
6872 <dt> ‘<samp>max_delay <var>integer</var> (<em>input/output</em>)</samp>’</dt>
6873 <dd><p>Set maximum muxing or demuxing delay in microseconds.
6876 <dt> ‘<samp>fpsprobesize <var>integer</var> (<em>input</em>)</samp>’</dt>
6877 <dd><p>Set number of frames used to probe fps.
6880 <dt> ‘<samp>audio_preload <var>integer</var> (<em>output</em>)</samp>’</dt>
6881 <dd><p>Set microseconds by which audio packets should be interleaved earlier.
6884 <dt> ‘<samp>chunk_duration <var>integer</var> (<em>output</em>)</samp>’</dt>
6885 <dd><p>Set microseconds for each chunk.
6888 <dt> ‘<samp>chunk_size <var>integer</var> (<em>output</em>)</samp>’</dt>
6889 <dd><p>Set size in bytes for each chunk.
6892 <dt> ‘<samp>err_detect, f_err_detect <var>flags</var> (<em>input</em>)</samp>’</dt>
6893 <dd><p>Set error detection flags. <code>f_err_detect</code> is deprecated and
6894 should be used only via the <code>ffmpeg</code> tool.
6897 </p><dl compact="compact">
6898 <dt> ‘<samp>crccheck</samp>’</dt>
6899 <dd><p>Verify embedded CRCs.
6901 <dt> ‘<samp>bitstream</samp>’</dt>
6902 <dd><p>Detect bitstream specification deviations.
6904 <dt> ‘<samp>buffer</samp>’</dt>
6905 <dd><p>Detect improper bitstream length.
6907 <dt> ‘<samp>explode</samp>’</dt>
6908 <dd><p>Abort decoding on minor error detection.
6910 <dt> ‘<samp>careful</samp>’</dt>
6911 <dd><p>Consider things that violate the spec and have not been seen in the
6914 <dt> ‘<samp>compliant</samp>’</dt>
6915 <dd><p>Consider all spec non compliancies as errors.
6917 <dt> ‘<samp>aggressive</samp>’</dt>
6918 <dd><p>Consider things that a sane encoder should not do as an error.
6923 <dt> ‘<samp>use_wallclock_as_timestamps <var>integer</var> (<em>input</em>)</samp>’</dt>
6924 <dd><p>Use wallclock as timestamps.
6927 <dt> ‘<samp>avoid_negative_ts <var>integer</var> (<em>output</em>)</samp>’</dt>
6928 <dd><p>Shift timestamps to make them non-negative. A value of 1 enables shifting,
6929 a value of 0 disables it, the default value of -1 enables shifting
6930 when required by the target format.
6932 <p>When shifting is enabled, all output timestamps are shifted by the
6933 same amount. Audio, video, and subtitles desynching and relative
6934 timestamp differences are preserved compared to how they would have
6935 been without shifting.
6937 <p>Also note that this affects only leading negative timestamps, and not
6938 non-monotonic negative timestamps.
6941 <dt> ‘<samp>skip_initial_bytes <var>integer</var> (<em>input</em>)</samp>’</dt>
6942 <dd><p>Set number of bytes to skip before reading header and frames if set to 1.
6946 <dt> ‘<samp>correct_ts_overflow <var>integer</var> (<em>input</em>)</samp>’</dt>
6947 <dd><p>Correct single timestamp overflows if set to 1. Default is 1.
6950 <dt> ‘<samp>flush_packets <var>integer</var> (<em>output</em>)</samp>’</dt>
6951 <dd><p>Flush the underlying I/O stream after each packet. Default 1 enables it, and
6952 has the effect of reducing the latency; 0 disables it and may slightly
6953 increase performance in some cases.
6958 <p><a name="Format-stream-specifiers"></a>
6959 </p><a name="Format-stream-specifiers-1"></a>
6960 <h2 class="section"><a href="ffplay-all.html#toc-Format-stream-specifiers-1">16.1 Format stream specifiers</a></h2>
6962 <p>Format stream specifiers allow selection of one or more streams that
6963 match specific properties.
6965 <p>Possible forms of stream specifiers are:
6966 </p><dl compact="compact">
6967 <dt> ‘<samp><var>stream_index</var></samp>’</dt>
6968 <dd><p>Matches the stream with this index.
6971 <dt> ‘<samp><var>stream_type</var>[:<var>stream_index</var>]</samp>’</dt>
6972 <dd><p><var>stream_type</var> is one of following: ’v’ for video, ’a’ for audio,
6973 ’s’ for subtitle, ’d’ for data, and ’t’ for attachments. If
6974 <var>stream_index</var> is given, then it matches the stream number
6975 <var>stream_index</var> of this type. Otherwise, it matches all streams of
6979 <dt> ‘<samp>p:<var>program_id</var>[:<var>stream_index</var>]</samp>’</dt>
6980 <dd><p>If <var>stream_index</var> is given, then it matches the stream with number
6981 <var>stream_index</var> in the program with the id
6982 <var>program_id</var>. Otherwise, it matches all streams in the program.
6985 <dt> ‘<samp>#<var>stream_id</var></samp>’</dt>
6986 <dd><p>Matches the stream by a format-specific ID.
6990 <p>The exact semantics of stream specifiers is defined by the
6991 <code>avformat_match_stream_specifier()</code> function declared in the
6992 ‘<tt>libavformat/avformat.h</tt>’ header.
6994 <a name="Demuxers"></a>
6995 <h1 class="chapter"><a href="ffplay-all.html#toc-Demuxers">17. Demuxers</a></h1>
6997 <p>Demuxers are configured elements in FFmpeg that can read the
6998 multimedia streams from a particular type of file.
7000 <p>When you configure your FFmpeg build, all the supported demuxers
7001 are enabled by default. You can list all available ones using the
7002 configure option <code>--list-demuxers</code>.
7004 <p>You can disable all the demuxers using the configure option
7005 <code>--disable-demuxers</code>, and selectively enable a single demuxer with
7006 the option <code>--enable-demuxer=<var>DEMUXER</var></code>, or disable it
7007 with the option <code>--disable-demuxer=<var>DEMUXER</var></code>.
7009 <p>The option <code>-formats</code> of the ff* tools will display the list of
7012 <p>The description of some of the currently available demuxers follows.
7014 <a name="applehttp"></a>
7015 <h2 class="section"><a href="ffplay-all.html#toc-applehttp">17.1 applehttp</a></h2>
7017 <p>Apple HTTP Live Streaming demuxer.
7019 <p>This demuxer presents all AVStreams from all variant streams.
7020 The id field is set to the bitrate variant index number. By setting
7021 the discard flags on AVStreams (by pressing ’a’ or ’v’ in ffplay),
7022 the caller can decide which variant streams to actually receive.
7023 The total bitrate of the variant that the stream belongs to is
7024 available in a metadata key named "variant_bitrate".
7027 <h2 class="section"><a href="ffplay-all.html#toc-asf">17.2 asf</a></h2>
7029 <p>Advanced Systems Format demuxer.
7031 <p>This demuxer is used to demux ASF files and MMS network streams.
7033 <dl compact="compact">
7034 <dt> ‘<samp>-no_resync_search <var>bool</var></samp>’</dt>
7035 <dd><p>Do not try to resynchronize by looking for a certain optional start code.
7039 <p><a name="concat"></a>
7040 </p><a name="concat-3"></a>
7041 <h2 class="section"><a href="ffplay-all.html#toc-concat-3">17.3 concat</a></h2>
7043 <p>Virtual concatenation script demuxer.
7045 <p>This demuxer reads a list of files and other directives from a text file and
7046 demuxes them one after the other, as if all their packet had been muxed
7049 <p>The timestamps in the files are adjusted so that the first file starts at 0
7050 and each next file starts where the previous one finishes. Note that it is
7051 done globally and may cause gaps if all streams do not have exactly the same
7054 <p>All files must have the same streams (same codecs, same time base, etc.).
7056 <p>The duration of each file is used to adjust the timestamps of the next file:
7057 if the duration is incorrect (because it was computed using the bit-rate or
7058 because the file is truncated, for example), it can cause artifacts. The
7059 <code>duration</code> directive can be used to override the duration stored in
7062 <a name="Syntax-1"></a>
7063 <h3 class="subsection"><a href="ffplay-all.html#toc-Syntax-1">17.3.1 Syntax</a></h3>
7065 <p>The script is a text file in extended-ASCII, with one directive per line.
7066 Empty lines, leading spaces and lines starting with ’#’ are ignored. The
7067 following directive is recognized:
7069 <dl compact="compact">
7070 <dt> ‘<samp><code>file <var>path</var></code></samp>’</dt>
7071 <dd><p>Path to a file to read; special characters and spaces must be escaped with
7072 backslash or single quotes.
7074 <p>All subsequent directives apply to that file.
7077 <dt> ‘<samp><code>ffconcat version 1.0</code></samp>’</dt>
7078 <dd><p>Identify the script type and version. It also sets the ‘<samp>safe</samp>’ option
7079 to 1 if it was to its default -1.
7081 <p>To make FFmpeg recognize the format automatically, this directive must
7082 appears exactly as is (no extra space or byte-order-mark) on the very first
7086 <dt> ‘<samp><code>duration <var>dur</var></code></samp>’</dt>
7087 <dd><p>Duration of the file. This information can be specified from the file;
7088 specifying it here may be more efficient or help if the information from the
7089 file is not available or accurate.
7091 <p>If the duration is set for all files, then it is possible to seek in the
7092 whole concatenated video.
7097 <a name="Options-13"></a>
7098 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-13">17.3.2 Options</a></h3>
7100 <p>This demuxer accepts the following option:
7102 <dl compact="compact">
7103 <dt> ‘<samp>safe</samp>’</dt>
7104 <dd><p>If set to 1, reject unsafe file paths. A file path is considered safe if it
7105 does not contain a protocol specification and is relative and all components
7106 only contain characters from the portable character set (letters, digits,
7107 period, underscore and hyphen) and have no period at the beginning of a
7110 <p>If set to 0, any file name is accepted.
7112 <p>The default is -1, it is equivalent to 1 if the format was automatically
7113 probed and 0 otherwise.
7119 <h2 class="section"><a href="ffplay-all.html#toc-flv">17.4 flv</a></h2>
7121 <p>Adobe Flash Video Format demuxer.
7123 <p>This demuxer is used to demux FLV files and RTMP network streams.
7125 <dl compact="compact">
7126 <dt> ‘<samp>-flv_metadata <var>bool</var></samp>’</dt>
7127 <dd><p>Allocate the streams according to the onMetaData array content.
7131 <a name="libgme"></a>
7132 <h2 class="section"><a href="ffplay-all.html#toc-libgme">17.5 libgme</a></h2>
7134 <p>The Game Music Emu library is a collection of video game music file emulators.
7136 <p>See <a href="http://code.google.com/p/game-music-emu/">http://code.google.com/p/game-music-emu/</a> for more information.
7138 <p>Some files have multiple tracks. The demuxer will pick the first track by
7139 default. The ‘<samp>track_index</samp>’ option can be used to select a different
7140 track. Track indexes start at 0. The demuxer exports the number of tracks as
7141 <var>tracks</var> meta data entry.
7143 <p>For very large files, the ‘<samp>max_size</samp>’ option may have to be adjusted.
7145 <a name="libquvi"></a>
7146 <h2 class="section"><a href="ffplay-all.html#toc-libquvi">17.6 libquvi</a></h2>
7148 <p>Play media from Internet services using the quvi project.
7150 <p>The demuxer accepts a ‘<samp>format</samp>’ option to request a specific quality. It
7151 is by default set to <var>best</var>.
7153 <p>See <a href="http://quvi.sourceforge.net/">http://quvi.sourceforge.net/</a> for more information.
7155 <p>FFmpeg needs to be built with <code>--enable-libquvi</code> for this demuxer to be
7158 <a name="image2-2"></a>
7159 <h2 class="section"><a href="ffplay-all.html#toc-image2-2">17.7 image2</a></h2>
7161 <p>Image file demuxer.
7163 <p>This demuxer reads from a list of image files specified by a pattern.
7164 The syntax and meaning of the pattern is specified by the
7165 option <var>pattern_type</var>.
7167 <p>The pattern may contain a suffix which is used to automatically
7168 determine the format of the images contained in the files.
7170 <p>The size, the pixel format, and the format of each image must be the
7171 same for all the files in the sequence.
7173 <p>This demuxer accepts the following options:
7174 </p><dl compact="compact">
7175 <dt> ‘<samp>framerate</samp>’</dt>
7176 <dd><p>Set the frame rate for the video stream. It defaults to 25.
7178 <dt> ‘<samp>loop</samp>’</dt>
7179 <dd><p>If set to 1, loop over the input. Default value is 0.
7181 <dt> ‘<samp>pattern_type</samp>’</dt>
7182 <dd><p>Select the pattern type used to interpret the provided filename.
7184 <p><var>pattern_type</var> accepts one of the following values.
7185 </p><dl compact="compact">
7186 <dt> ‘<samp>sequence</samp>’</dt>
7187 <dd><p>Select a sequence pattern type, used to specify a sequence of files
7188 indexed by sequential numbers.
7190 <p>A sequence pattern may contain the string "%d" or "%0<var>N</var>d", which
7191 specifies the position of the characters representing a sequential
7192 number in each filename matched by the pattern. If the form
7193 "%d0<var>N</var>d" is used, the string representing the number in each
7194 filename is 0-padded and <var>N</var> is the total number of 0-padded
7195 digits representing the number. The literal character ’%’ can be
7196 specified in the pattern with the string "%%".
7198 <p>If the sequence pattern contains "%d" or "%0<var>N</var>d", the first filename of
7199 the file list specified by the pattern must contain a number
7200 inclusively contained between <var>start_number</var> and
7201 <var>start_number</var>+<var>start_number_range</var>-1, and all the following
7202 numbers must be sequential.
7204 <p>For example the pattern "img-%03d.bmp" will match a sequence of
7205 filenames of the form ‘<tt>img-001.bmp</tt>’, ‘<tt>img-002.bmp</tt>’, ...,
7206 ‘<tt>img-010.bmp</tt>’, etc.; the pattern "i%%m%%g-%d.jpg" will match a
7207 sequence of filenames of the form ‘<tt>i%m%g-1.jpg</tt>’,
7208 ‘<tt>i%m%g-2.jpg</tt>’, ..., ‘<tt>i%m%g-10.jpg</tt>’, etc.
7210 <p>Note that the pattern must not necessarily contain "%d" or
7211 "%0<var>N</var>d", for example to convert a single image file
7212 ‘<tt>img.jpeg</tt>’ you can employ the command:
7213 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i img.jpeg img.png
7214 </pre></td></tr></table>
7217 <dt> ‘<samp>glob</samp>’</dt>
7218 <dd><p>Select a glob wildcard pattern type.
7220 <p>The pattern is interpreted like a <code>glob()</code> pattern. This is only
7221 selectable if libavformat was compiled with globbing support.
7224 <dt> ‘<samp>glob_sequence <em>(deprecated, will be removed)</em></samp>’</dt>
7225 <dd><p>Select a mixed glob wildcard/sequence pattern.
7227 <p>If your version of libavformat was compiled with globbing support, and
7228 the provided pattern contains at least one glob meta character among
7229 <code>%*?[]{}</code> that is preceded by an unescaped "%", the pattern is
7230 interpreted like a <code>glob()</code> pattern, otherwise it is interpreted
7231 like a sequence pattern.
7233 <p>All glob special characters <code>%*?[]{}</code> must be prefixed
7234 with "%". To escape a literal "%" you shall use "%%".
7236 <p>For example the pattern <code>foo-%*.jpeg</code> will match all the
7237 filenames prefixed by "foo-" and terminating with ".jpeg", and
7238 <code>foo-%?%?%?.jpeg</code> will match all the filenames prefixed with
7239 "foo-", followed by a sequence of three characters, and terminating
7240 with ".jpeg".
7242 <p>This pattern type is deprecated in favor of <var>glob</var> and
7243 <var>sequence</var>.
7247 <p>Default value is <var>glob_sequence</var>.
7249 <dt> ‘<samp>pixel_format</samp>’</dt>
7250 <dd><p>Set the pixel format of the images to read. If not specified the pixel
7251 format is guessed from the first image file in the sequence.
7253 <dt> ‘<samp>start_number</samp>’</dt>
7254 <dd><p>Set the index of the file matched by the image file pattern to start
7255 to read from. Default value is 0.
7257 <dt> ‘<samp>start_number_range</samp>’</dt>
7258 <dd><p>Set the index interval range to check when looking for the first image
7259 file in the sequence, starting from <var>start_number</var>. Default value
7262 <dt> ‘<samp>ts_from_file</samp>’</dt>
7263 <dd><p>If set to 1, will set frame timestamp to modification time of image file. Note
7264 that monotonity of timestamps is not provided: images go in the same order as
7265 without this option. Default value is 0.
7267 <dt> ‘<samp>video_size</samp>’</dt>
7268 <dd><p>Set the video size of the images to read. If not specified the video
7269 size is guessed from the first image file in the sequence.
7273 <a name="Examples-88"></a>
7274 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-88">17.7.1 Examples</a></h3>
7278 Use <code>ffmpeg</code> for creating a video from the images in the file
7279 sequence ‘<tt>img-001.jpeg</tt>’, ‘<tt>img-002.jpeg</tt>’, ..., assuming an
7280 input frame rate of 10 frames per second:
7281 <table><tr><td> </td><td><pre class="example">ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
7282 </pre></td></tr></table>
7285 As above, but start by reading from a file with index 100 in the sequence:
7286 <table><tr><td> </td><td><pre class="example">ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
7287 </pre></td></tr></table>
7290 Read images matching the "*.png" glob pattern , that is all the files
7291 terminating with the ".png" suffix:
7292 <table><tr><td> </td><td><pre class="example">ffmpeg -framerate 10 -pattern_type glob -i "*.png" out.mkv
7293 </pre></td></tr></table>
7296 <a name="mpegts-1"></a>
7297 <h2 class="section"><a href="ffplay-all.html#toc-mpegts-1">17.8 mpegts</a></h2>
7299 <p>MPEG-2 transport stream demuxer.
7301 <dl compact="compact">
7302 <dt> ‘<samp>fix_teletext_pts</samp>’</dt>
7303 <dd><p>Overrides teletext packet PTS and DTS values with the timestamps calculated
7304 from the PCR of the first program which the teletext stream is part of and is
7305 not discarded. Default value is 1, set this option to 0 if you want your
7306 teletext packet PTS and DTS values untouched.
7310 <a name="rawvideo"></a>
7311 <h2 class="section"><a href="ffplay-all.html#toc-rawvideo">17.9 rawvideo</a></h2>
7313 <p>Raw video demuxer.
7315 <p>This demuxer allows to read raw video data. Since there is no header
7316 specifying the assumed video parameters, the user must specify them
7317 in order to be able to decode the data correctly.
7319 <p>This demuxer accepts the following options:
7320 </p><dl compact="compact">
7321 <dt> ‘<samp>framerate</samp>’</dt>
7322 <dd><p>Set input video frame rate. Default value is 25.
7325 <dt> ‘<samp>pixel_format</samp>’</dt>
7326 <dd><p>Set the input video pixel format. Default value is <code>yuv420p</code>.
7329 <dt> ‘<samp>video_size</samp>’</dt>
7330 <dd><p>Set the input video size. This value must be specified explicitly.
7334 <p>For example to read a rawvideo file ‘<tt>input.raw</tt>’ with
7335 <code>ffplay</code>, assuming a pixel format of <code>rgb24</code>, a video
7336 size of <code>320x240</code>, and a frame rate of 10 images per second, use
7338 </p><table><tr><td> </td><td><pre class="example">ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
7339 </pre></td></tr></table>
7342 <h2 class="section"><a href="ffplay-all.html#toc-sbg">17.10 sbg</a></h2>
7344 <p>SBaGen script demuxer.
7346 <p>This demuxer reads the script language used by SBaGen
7347 <a href="http://uazu.net/sbagen/">http://uazu.net/sbagen/</a> to generate binaural beats sessions. A SBG
7348 script looks like that:
7349 </p><table><tr><td> </td><td><pre class="example">-SE
7350 a: 300-2.5/3 440+4.5/0
7351 b: 300-2.5/0 440+4.5/3
7358 </pre></td></tr></table>
7360 <p>A SBG script can mix absolute and relative timestamps. If the script uses
7361 either only absolute timestamps (including the script start time) or only
7362 relative ones, then its layout is fixed, and the conversion is
7363 straightforward. On the other hand, if the script mixes both kind of
7364 timestamps, then the <var>NOW</var> reference for relative timestamps will be
7365 taken from the current time of day at the time the script is read, and the
7366 script layout will be frozen according to that reference. That means that if
7367 the script is directly played, the actual times will match the absolute
7368 timestamps up to the sound controller’s clock accuracy, but if the user
7369 somehow pauses the playback or seeks, all times will be shifted accordingly.
7371 <a name="tedcaptions"></a>
7372 <h2 class="section"><a href="ffplay-all.html#toc-tedcaptions">17.11 tedcaptions</a></h2>
7374 <p>JSON captions used for <a href="http://www.ted.com/">TED Talks</a>.
7376 <p>TED does not provide links to the captions, but they can be guessed from the
7377 page. The file ‘<tt>tools/bookmarklets.html</tt>’ from the FFmpeg source tree
7378 contains a bookmarklet to expose them.
7380 <p>This demuxer accepts the following option:
7381 </p><dl compact="compact">
7382 <dt> ‘<samp>start_time</samp>’</dt>
7383 <dd><p>Set the start time of the TED talk, in milliseconds. The default is 15000
7384 (15s). It is used to sync the captions with the downloadable videos, because
7385 they include a 15s intro.
7389 <p>Example: convert the captions to a format most players understand:
7390 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
7391 </pre></td></tr></table>
7393 <a name="Muxers"></a>
7394 <h1 class="chapter"><a href="ffplay-all.html#toc-Muxers">18. Muxers</a></h1>
7396 <p>Muxers are configured elements in FFmpeg which allow writing
7397 multimedia streams to a particular type of file.
7399 <p>When you configure your FFmpeg build, all the supported muxers
7400 are enabled by default. You can list all available muxers using the
7401 configure option <code>--list-muxers</code>.
7403 <p>You can disable all the muxers with the configure option
7404 <code>--disable-muxers</code> and selectively enable / disable single muxers
7405 with the options <code>--enable-muxer=<var>MUXER</var></code> /
7406 <code>--disable-muxer=<var>MUXER</var></code>.
7408 <p>The option <code>-formats</code> of the ff* tools will display the list of
7411 <p>A description of some of the currently available muxers follows.
7413 <p><a name="aiff"></a>
7414 </p><a name="aiff-1"></a>
7415 <h2 class="section"><a href="ffplay-all.html#toc-aiff-1">18.1 aiff</a></h2>
7417 <p>Audio Interchange File Format muxer.
7419 <p>It accepts the following options:
7421 <dl compact="compact">
7422 <dt> ‘<samp>write_id3v2</samp>’</dt>
7423 <dd><p>Enable ID3v2 tags writing when set to 1. Default is 0 (disabled).
7426 <dt> ‘<samp>id3v2_version</samp>’</dt>
7427 <dd><p>Select ID3v2 version to write. Currently only version 3 and 4 (aka.
7428 ID3v2.3 and ID3v2.4) are supported. The default is version 4.
7433 <p><a name="crc"></a>
7434 </p><a name="crc-1"></a>
7435 <h2 class="section"><a href="ffplay-all.html#toc-crc-1">18.2 crc</a></h2>
7437 <p>CRC (Cyclic Redundancy Check) testing format.
7439 <p>This muxer computes and prints the Adler-32 CRC of all the input audio
7440 and video frames. By default audio frames are converted to signed
7441 16-bit raw audio and video frames to raw video before computing the
7444 <p>The output of the muxer consists of a single line of the form:
7445 CRC=0x<var>CRC</var>, where <var>CRC</var> is a hexadecimal number 0-padded to
7446 8 digits containing the CRC for all the decoded input frames.
7448 <p>For example to compute the CRC of the input, and store it in the file
7449 ‘<tt>out.crc</tt>’:
7450 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -f crc out.crc
7451 </pre></td></tr></table>
7453 <p>You can print the CRC to stdout with the command:
7454 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -f crc -
7455 </pre></td></tr></table>
7457 <p>You can select the output format of each frame with <code>ffmpeg</code> by
7458 specifying the audio and video codec and format. For example to
7459 compute the CRC of the input audio converted to PCM unsigned 8-bit
7460 and the input video converted to MPEG-2 video, use the command:
7461 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
7462 </pre></td></tr></table>
7464 <p>See also the <a href="#framecrc">framecrc</a> muxer.
7466 <p><a name="framecrc"></a>
7467 </p><a name="framecrc-1"></a>
7468 <h2 class="section"><a href="ffplay-all.html#toc-framecrc-1">18.3 framecrc</a></h2>
7470 <p>Per-packet CRC (Cyclic Redundancy Check) testing format.
7472 <p>This muxer computes and prints the Adler-32 CRC for each audio
7473 and video packet. By default audio frames are converted to signed
7474 16-bit raw audio and video frames to raw video before computing the
7477 <p>The output of the muxer consists of a line for each audio and video
7479 </p><table><tr><td> </td><td><pre class="example"><var>stream_index</var>, <var>packet_dts</var>, <var>packet_pts</var>, <var>packet_duration</var>, <var>packet_size</var>, 0x<var>CRC</var>
7480 </pre></td></tr></table>
7482 <p><var>CRC</var> is a hexadecimal number 0-padded to 8 digits containing the
7485 <p>For example to compute the CRC of the audio and video frames in
7486 ‘<tt>INPUT</tt>’, converted to raw audio and video packets, and store it
7487 in the file ‘<tt>out.crc</tt>’:
7488 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -f framecrc out.crc
7489 </pre></td></tr></table>
7491 <p>To print the information to stdout, use the command:
7492 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -f framecrc -
7493 </pre></td></tr></table>
7495 <p>With <code>ffmpeg</code>, you can select the output format to which the
7496 audio and video frames are encoded before computing the CRC for each
7497 packet by specifying the audio and video codec. For example, to
7498 compute the CRC of each decoded input audio frame converted to PCM
7499 unsigned 8-bit and of each decoded input video frame converted to
7500 MPEG-2 video, use the command:
7501 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
7502 </pre></td></tr></table>
7504 <p>See also the <a href="#crc">crc</a> muxer.
7506 <p><a name="framemd5"></a>
7507 </p><a name="framemd5-1"></a>
7508 <h2 class="section"><a href="ffplay-all.html#toc-framemd5-1">18.4 framemd5</a></h2>
7510 <p>Per-packet MD5 testing format.
7512 <p>This muxer computes and prints the MD5 hash for each audio
7513 and video packet. By default audio frames are converted to signed
7514 16-bit raw audio and video frames to raw video before computing the
7517 <p>The output of the muxer consists of a line for each audio and video
7519 </p><table><tr><td> </td><td><pre class="example"><var>stream_index</var>, <var>packet_dts</var>, <var>packet_pts</var>, <var>packet_duration</var>, <var>packet_size</var>, <var>MD5</var>
7520 </pre></td></tr></table>
7522 <p><var>MD5</var> is a hexadecimal number representing the computed MD5 hash
7525 <p>For example to compute the MD5 of the audio and video frames in
7526 ‘<tt>INPUT</tt>’, converted to raw audio and video packets, and store it
7527 in the file ‘<tt>out.md5</tt>’:
7528 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -f framemd5 out.md5
7529 </pre></td></tr></table>
7531 <p>To print the information to stdout, use the command:
7532 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -f framemd5 -
7533 </pre></td></tr></table>
7535 <p>See also the <a href="#md5">md5</a> muxer.
7537 <p><a name="gif"></a>
7538 </p><a name="gif-1"></a>
7539 <h2 class="section"><a href="ffplay-all.html#toc-gif-1">18.5 gif</a></h2>
7541 <p>Animated GIF muxer.
7543 <p>It accepts the following options:
7545 <dl compact="compact">
7546 <dt> ‘<samp>loop</samp>’</dt>
7547 <dd><p>Set the number of times to loop the output. Use <code>-1</code> for no loop, <code>0</code>
7548 for looping indefinitely (default).
7551 <dt> ‘<samp>final_delay</samp>’</dt>
7552 <dd><p>Force the delay (expressed in centiseconds) after the last frame. Each frame
7553 ends with a delay until the next frame. The default is <code>-1</code>, which is a
7554 special value to tell the muxer to re-use the previous delay. In case of a
7555 loop, you might want to customize this value to mark a pause for instance.
7559 <p>For example, to encode a gif looping 10 times, with a 5 seconds delay between
7561 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -loop 10 -final_delay 500 out.gif
7562 </pre></td></tr></table>
7564 <p>Note 1: if you wish to extract the frames in separate GIF files, you need to
7565 force the <a href="#image2">image2</a> muxer:
7566 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -c:v gif -f image2 "out%d.gif"
7567 </pre></td></tr></table>
7569 <p>Note 2: the GIF format has a very small time base: the delay between two frames
7570 can not be smaller than one centi second.
7572 <p><a name="hls"></a>
7573 </p><a name="hls-1"></a>
7574 <h2 class="section"><a href="ffplay-all.html#toc-hls-1">18.6 hls</a></h2>
7576 <p>Apple HTTP Live Streaming muxer that segments MPEG-TS according to
7577 the HTTP Live Streaming specification.
7579 <p>It creates a playlist file and numbered segment files. The output
7580 filename specifies the playlist filename; the segment filenames
7581 receive the same basename as the playlist, a sequential number and
7584 <table><tr><td> </td><td><pre class="example">ffmpeg -i in.nut out.m3u8
7585 </pre></td></tr></table>
7587 <dl compact="compact">
7588 <dt> ‘<samp>-hls_time <var>seconds</var></samp>’</dt>
7589 <dd><p>Set the segment length in seconds.
7591 <dt> ‘<samp>-hls_list_size <var>size</var></samp>’</dt>
7592 <dd><p>Set the maximum number of playlist entries.
7594 <dt> ‘<samp>-hls_wrap <var>wrap</var></samp>’</dt>
7595 <dd><p>Set the number after which index wraps.
7597 <dt> ‘<samp>-start_number <var>number</var></samp>’</dt>
7598 <dd><p>Start the sequence from <var>number</var>.
7602 <p><a name="ico"></a>
7603 </p><a name="ico-1"></a>
7604 <h2 class="section"><a href="ffplay-all.html#toc-ico-1">18.7 ico</a></h2>
7608 <p>Microsoft’s icon file format (ICO) has some strict limitations that should be noted:
7612 Size cannot exceed 256 pixels in any dimension
7615 Only BMP and PNG images can be stored
7618 If a BMP image is used, it must be one of the following pixel formats:
7619 <table><tr><td> </td><td><pre class="example">BMP Bit Depth FFmpeg Pixel Format
7626 </pre></td></tr></table>
7629 If a BMP image is used, it must use the BITMAPINFOHEADER DIB header
7632 If a PNG image is used, it must use the rgba pixel format
7635 <p><a name="image2"></a>
7636 </p><a name="image2-1"></a>
7637 <h2 class="section"><a href="ffplay-all.html#toc-image2-1">18.8 image2</a></h2>
7639 <p>Image file muxer.
7641 <p>The image file muxer writes video frames to image files.
7643 <p>The output filenames are specified by a pattern, which can be used to
7644 produce sequentially numbered series of files.
7645 The pattern may contain the string "%d" or "%0<var>N</var>d", this string
7646 specifies the position of the characters representing a numbering in
7647 the filenames. If the form "%0<var>N</var>d" is used, the string
7648 representing the number in each filename is 0-padded to <var>N</var>
7649 digits. The literal character ’%’ can be specified in the pattern with
7650 the string "%%".
7652 <p>If the pattern contains "%d" or "%0<var>N</var>d", the first filename of
7653 the file list specified will contain the number 1, all the following
7654 numbers will be sequential.
7656 <p>The pattern may contain a suffix which is used to automatically
7657 determine the format of the image files to write.
7659 <p>For example the pattern "img-%03d.bmp" will specify a sequence of
7660 filenames of the form ‘<tt>img-001.bmp</tt>’, ‘<tt>img-002.bmp</tt>’, ...,
7661 ‘<tt>img-010.bmp</tt>’, etc.
7662 The pattern "img%%-%d.jpg" will specify a sequence of filenames of the
7663 form ‘<tt>img%-1.jpg</tt>’, ‘<tt>img%-2.jpg</tt>’, ..., ‘<tt>img%-10.jpg</tt>’,
7666 <p>The following example shows how to use <code>ffmpeg</code> for creating a
7667 sequence of files ‘<tt>img-001.jpeg</tt>’, ‘<tt>img-002.jpeg</tt>’, ...,
7668 taking one image every second from the input video:
7669 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i in.avi -vsync 1 -r 1 -f image2 'img-%03d.jpeg'
7670 </pre></td></tr></table>
7672 <p>Note that with <code>ffmpeg</code>, if the format is not specified with the
7673 <code>-f</code> option and the output filename specifies an image file
7674 format, the image2 muxer is automatically selected, so the previous
7675 command can be written as:
7676 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i in.avi -vsync 1 -r 1 'img-%03d.jpeg'
7677 </pre></td></tr></table>
7679 <p>Note also that the pattern must not necessarily contain "%d" or
7680 "%0<var>N</var>d", for example to create a single image file
7681 ‘<tt>img.jpeg</tt>’ from the input video you can employ the command:
7682 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
7683 </pre></td></tr></table>
7685 <dl compact="compact">
7686 <dt> ‘<samp>start_number <var>number</var></samp>’</dt>
7687 <dd><p>Start the sequence from <var>number</var>. Default value is 1. Must be a
7688 non-negative number.
7691 <dt> ‘<samp>-update <var>number</var></samp>’</dt>
7692 <dd><p>If <var>number</var> is nonzero, the filename will always be interpreted as just a
7693 filename, not a pattern, and this file will be continuously overwritten with new
7699 <p>The image muxer supports the .Y.U.V image file format. This format is
7700 special in that that each image frame consists of three files, for
7701 each of the YUV420P components. To read or write this image file format,
7702 specify the name of the ’.Y’ file. The muxer will automatically open the
7703 ’.U’ and ’.V’ files as required.
7705 <a name="matroska"></a>
7706 <h2 class="section"><a href="ffplay-all.html#toc-matroska">18.9 matroska</a></h2>
7708 <p>Matroska container muxer.
7710 <p>This muxer implements the matroska and webm container specs.
7712 <p>The recognized metadata settings in this muxer are:
7714 <dl compact="compact">
7715 <dt> ‘<samp>title=<var>title name</var></samp>’</dt>
7716 <dd><p>Name provided to a single track
7720 <dl compact="compact">
7721 <dt> ‘<samp>language=<var>language name</var></samp>’</dt>
7722 <dd><p>Specifies the language of the track in the Matroska languages form
7726 <dl compact="compact">
7727 <dt> ‘<samp>stereo_mode=<var>mode</var></samp>’</dt>
7728 <dd><p>Stereo 3D video layout of two views in a single video track
7729 </p><dl compact="compact">
7730 <dt> ‘<samp>mono</samp>’</dt>
7731 <dd><p>video is not stereo
7733 <dt> ‘<samp>left_right</samp>’</dt>
7734 <dd><p>Both views are arranged side by side, Left-eye view is on the left
7736 <dt> ‘<samp>bottom_top</samp>’</dt>
7737 <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is at bottom
7739 <dt> ‘<samp>top_bottom</samp>’</dt>
7740 <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is on top
7742 <dt> ‘<samp>checkerboard_rl</samp>’</dt>
7743 <dd><p>Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
7745 <dt> ‘<samp>checkerboard_lr</samp>’</dt>
7746 <dd><p>Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
7748 <dt> ‘<samp>row_interleaved_rl</samp>’</dt>
7749 <dd><p>Each view is constituted by a row based interleaving, Right-eye view is first row
7751 <dt> ‘<samp>row_interleaved_lr</samp>’</dt>
7752 <dd><p>Each view is constituted by a row based interleaving, Left-eye view is first row
7754 <dt> ‘<samp>col_interleaved_rl</samp>’</dt>
7755 <dd><p>Both views are arranged in a column based interleaving manner, Right-eye view is first column
7757 <dt> ‘<samp>col_interleaved_lr</samp>’</dt>
7758 <dd><p>Both views are arranged in a column based interleaving manner, Left-eye view is first column
7760 <dt> ‘<samp>anaglyph_cyan_red</samp>’</dt>
7761 <dd><p>All frames are in anaglyph format viewable through red-cyan filters
7763 <dt> ‘<samp>right_left</samp>’</dt>
7764 <dd><p>Both views are arranged side by side, Right-eye view is on the left
7766 <dt> ‘<samp>anaglyph_green_magenta</samp>’</dt>
7767 <dd><p>All frames are in anaglyph format viewable through green-magenta filters
7769 <dt> ‘<samp>block_lr</samp>’</dt>
7770 <dd><p>Both eyes laced in one Block, Left-eye view is first
7772 <dt> ‘<samp>block_rl</samp>’</dt>
7773 <dd><p>Both eyes laced in one Block, Right-eye view is first
7779 <p>For example a 3D WebM clip can be created using the following command line:
7780 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
7781 </pre></td></tr></table>
7783 <p>This muxer supports the following options:
7785 <dl compact="compact">
7786 <dt> ‘<samp>reserve_index_space</samp>’</dt>
7787 <dd><p>By default, this muxer writes the index for seeking (called cues in Matroska
7788 terms) at the end of the file, because it cannot know in advance how much space
7789 to leave for the index at the beginning of the file. However for some use cases
7790 – e.g. streaming where seeking is possible but slow – it is useful to put the
7791 index at the beginning of the file.
7793 <p>If this option is set to a non-zero value, the muxer will reserve a given amount
7794 of space in the file header and then try to write the cues there when the muxing
7795 finishes. If the available space does not suffice, muxing will fail. A safe size
7796 for most use cases should be about 50kB per hour of video.
7798 <p>Note that cues are only written if the output is seekable and this option will
7799 have no effect if it is not.
7804 <p><a name="md5"></a>
7805 </p><a name="md5-1"></a>
7806 <h2 class="section"><a href="ffplay-all.html#toc-md5-1">18.10 md5</a></h2>
7808 <p>MD5 testing format.
7810 <p>This muxer computes and prints the MD5 hash of all the input audio
7811 and video frames. By default audio frames are converted to signed
7812 16-bit raw audio and video frames to raw video before computing the
7815 <p>The output of the muxer consists of a single line of the form:
7816 MD5=<var>MD5</var>, where <var>MD5</var> is a hexadecimal number representing
7817 the computed MD5 hash.
7819 <p>For example to compute the MD5 hash of the input converted to raw
7820 audio and video, and store it in the file ‘<tt>out.md5</tt>’:
7821 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -f md5 out.md5
7822 </pre></td></tr></table>
7824 <p>You can print the MD5 to stdout with the command:
7825 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -f md5 -
7826 </pre></td></tr></table>
7828 <p>See also the <a href="#framemd5">framemd5</a> muxer.
7830 <a name="mov_002fmp4_002fismv"></a>
7831 <h2 class="section"><a href="ffplay-all.html#toc-mov_002fmp4_002fismv">18.11 mov/mp4/ismv</a></h2>
7833 <p>MOV/MP4/ISMV (Smooth Streaming) muxer.
7835 <p>The mov/mp4/ismv muxer supports fragmentation. Normally, a MOV/MP4
7836 file has all the metadata about all packets stored in one location
7837 (written at the end of the file, it can be moved to the start for
7838 better playback by adding <var>faststart</var> to the <var>movflags</var>, or
7839 using the <code>qt-faststart</code> tool). A fragmented
7840 file consists of a number of fragments, where packets and metadata
7841 about these packets are stored together. Writing a fragmented
7842 file has the advantage that the file is decodable even if the
7843 writing is interrupted (while a normal MOV/MP4 is undecodable if
7844 it is not properly finished), and it requires less memory when writing
7845 very long files (since writing normal MOV/MP4 files stores info about
7846 every single packet in memory until the file is closed). The downside
7847 is that it is less compatible with other applications.
7849 <p>Fragmentation is enabled by setting one of the AVOptions that define
7850 how to cut the file into fragments:
7852 <dl compact="compact">
7853 <dt> ‘<samp>-moov_size <var>bytes</var></samp>’</dt>
7854 <dd><p>Reserves space for the moov atom at the beginning of the file instead of placing the
7855 moov atom at the end. If the space reserved is insufficient, muxing will fail.
7857 <dt> ‘<samp>-movflags frag_keyframe</samp>’</dt>
7858 <dd><p>Start a new fragment at each video keyframe.
7860 <dt> ‘<samp>-frag_duration <var>duration</var></samp>’</dt>
7861 <dd><p>Create fragments that are <var>duration</var> microseconds long.
7863 <dt> ‘<samp>-frag_size <var>size</var></samp>’</dt>
7864 <dd><p>Create fragments that contain up to <var>size</var> bytes of payload data.
7866 <dt> ‘<samp>-movflags frag_custom</samp>’</dt>
7867 <dd><p>Allow the caller to manually choose when to cut fragments, by
7868 calling <code>av_write_frame(ctx, NULL)</code> to write a fragment with
7869 the packets written so far. (This is only useful with other
7870 applications integrating libavformat, not from <code>ffmpeg</code>.)
7872 <dt> ‘<samp>-min_frag_duration <var>duration</var></samp>’</dt>
7873 <dd><p>Don’t create fragments that are shorter than <var>duration</var> microseconds long.
7877 <p>If more than one condition is specified, fragments are cut when
7878 one of the specified conditions is fulfilled. The exception to this is
7879 <code>-min_frag_duration</code>, which has to be fulfilled for any of the other
7880 conditions to apply.
7882 <p>Additionally, the way the output file is written can be adjusted
7883 through a few other options:
7885 <dl compact="compact">
7886 <dt> ‘<samp>-movflags empty_moov</samp>’</dt>
7887 <dd><p>Write an initial moov atom directly at the start of the file, without
7888 describing any samples in it. Generally, an mdat/moov pair is written
7889 at the start of the file, as a normal MOV/MP4 file, containing only
7890 a short portion of the file. With this option set, there is no initial
7891 mdat atom, and the moov atom only describes the tracks but has
7894 <p>Files written with this option set do not work in QuickTime.
7895 This option is implicitly set when writing ismv (Smooth Streaming) files.
7897 <dt> ‘<samp>-movflags separate_moof</samp>’</dt>
7898 <dd><p>Write a separate moof (movie fragment) atom for each track. Normally,
7899 packets for all tracks are written in a moof atom (which is slightly
7900 more efficient), but with this option set, the muxer writes one moof/mdat
7901 pair for each track, making it easier to separate tracks.
7903 <p>This option is implicitly set when writing ismv (Smooth Streaming) files.
7905 <dt> ‘<samp>-movflags faststart</samp>’</dt>
7906 <dd><p>Run a second pass moving the index (moov atom) to the beginning of the file.
7907 This operation can take a while, and will not work in various situations such
7908 as fragmented output, thus it is not enabled by default.
7910 <dt> ‘<samp>-movflags rtphint</samp>’</dt>
7911 <dd><p>Add RTP hinting tracks to the output file.
7915 <p>Smooth Streaming content can be pushed in real time to a publishing
7916 point on IIS with this muxer. Example:
7917 </p><table><tr><td> </td><td><pre class="example">ffmpeg -re <var><normal input/transcoding options></var> -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1)
7918 </pre></td></tr></table>
7921 <h2 class="section"><a href="ffplay-all.html#toc-mp3">18.12 mp3</a></h2>
7923 <p>The MP3 muxer writes a raw MP3 stream with an ID3v2 header at the beginning and
7924 optionally an ID3v1 tag at the end. ID3v2.3 and ID3v2.4 are supported, the
7925 <code>id3v2_version</code> option controls which one is used. The legacy ID3v1 tag is
7926 not written by default, but may be enabled with the <code>write_id3v1</code> option.
7928 <p>For seekable output the muxer also writes a Xing frame at the beginning, which
7929 contains the number of frames in the file. It is useful for computing duration
7932 <p>The muxer supports writing ID3v2 attached pictures (APIC frames). The pictures
7933 are supplied to the muxer in form of a video stream with a single packet. There
7934 can be any number of those streams, each will correspond to a single APIC frame.
7935 The stream metadata tags <var>title</var> and <var>comment</var> map to APIC
7936 <var>description</var> and <var>picture type</var> respectively. See
7937 <a href="http://id3.org/id3v2.4.0-frames">http://id3.org/id3v2.4.0-frames</a> for allowed picture types.
7939 <p>Note that the APIC frames must be written at the beginning, so the muxer will
7940 buffer the audio frames until it gets all the pictures. It is therefore advised
7941 to provide the pictures as soon as possible to avoid excessive buffering.
7945 <p>Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
7946 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
7947 </pre></td></tr></table>
7949 <p>To attach a picture to an mp3 file select both the audio and the picture stream
7950 with <code>map</code>:
7951 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
7952 -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" out.mp3
7953 </pre></td></tr></table>
7955 <a name="mpegts"></a>
7956 <h2 class="section"><a href="ffplay-all.html#toc-mpegts">18.13 mpegts</a></h2>
7958 <p>MPEG transport stream muxer.
7960 <p>This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
7962 <p>The muxer options are:
7964 <dl compact="compact">
7965 <dt> ‘<samp>-mpegts_original_network_id <var>number</var></samp>’</dt>
7966 <dd><p>Set the original_network_id (default 0x0001). This is unique identifier
7967 of a network in DVB. Its main use is in the unique identification of a
7968 service through the path Original_Network_ID, Transport_Stream_ID.
7970 <dt> ‘<samp>-mpegts_transport_stream_id <var>number</var></samp>’</dt>
7971 <dd><p>Set the transport_stream_id (default 0x0001). This identifies a
7974 <dt> ‘<samp>-mpegts_service_id <var>number</var></samp>’</dt>
7975 <dd><p>Set the service_id (default 0x0001) also known as program in DVB.
7977 <dt> ‘<samp>-mpegts_pmt_start_pid <var>number</var></samp>’</dt>
7978 <dd><p>Set the first PID for PMT (default 0x1000, max 0x1f00).
7980 <dt> ‘<samp>-mpegts_start_pid <var>number</var></samp>’</dt>
7981 <dd><p>Set the first PID for data packets (default 0x0100, max 0x0f00).
7983 <dt> ‘<samp>-mpegts_m2ts_mode <var>number</var></samp>’</dt>
7984 <dd><p>Enable m2ts mode if set to 1. Default value is -1 which disables m2ts mode.
7986 <dt> ‘<samp>-muxrate <var>number</var></samp>’</dt>
7989 <dt> ‘<samp>-pes_payload_size <var>number</var></samp>’</dt>
7990 <dd><p>Set minimum PES packet payload in bytes.
7992 <dt> ‘<samp>-mpegts_flags <var>flags</var></samp>’</dt>
7993 <dd><p>Set flags (see below).
7995 <dt> ‘<samp>-mpegts_copyts <var>number</var></samp>’</dt>
7996 <dd><p>Preserve original timestamps, if value is set to 1. Default value is -1, which
7997 results in shifting timestamps so that they start from 0.
7999 <dt> ‘<samp>-tables_version <var>number</var></samp>’</dt>
8000 <dd><p>Set PAT, PMT and SDT version (default 0, valid values are from 0 to 31, inclusively).
8001 This option allows updating stream structure so that standard consumer may
8002 detect the change. To do so, reopen output AVFormatContext (in case of API
8003 usage) or restart ffmpeg instance, cyclically changing tables_version value:
8004 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
8005 ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
8007 ffmpeg -i source3.ts -codec copy -f mpegts -tables_version 31 udp://1.1.1.1:1111
8008 ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
8009 ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
8011 </pre></td></tr></table>
8015 <p>Option mpegts_flags may take a set of such flags:
8017 <dl compact="compact">
8018 <dt> ‘<samp>resend_headers</samp>’</dt>
8019 <dd><p>Reemit PAT/PMT before writing the next packet.
8021 <dt> ‘<samp>latm</samp>’</dt>
8022 <dd><p>Use LATM packetization for AAC.
8026 <p>The recognized metadata settings in mpegts muxer are <code>service_provider</code>
8027 and <code>service_name</code>. If they are not set the default for
8028 <code>service_provider</code> is "FFmpeg" and the default for
8029 <code>service_name</code> is "Service01".
8031 <table><tr><td> </td><td><pre class="example">ffmpeg -i file.mpg -c copy \
8032 -mpegts_original_network_id 0x1122 \
8033 -mpegts_transport_stream_id 0x3344 \
8034 -mpegts_service_id 0x5566 \
8035 -mpegts_pmt_start_pid 0x1500 \
8036 -mpegts_start_pid 0x150 \
8037 -metadata service_provider="Some provider" \
8038 -metadata service_name="Some Channel" \
8040 </pre></td></tr></table>
8042 <a name="null-1"></a>
8043 <h2 class="section"><a href="ffplay-all.html#toc-null-1">18.14 null</a></h2>
8047 <p>This muxer does not generate any output file, it is mainly useful for
8048 testing or benchmarking purposes.
8050 <p>For example to benchmark decoding with <code>ffmpeg</code> you can use the
8052 </p><table><tr><td> </td><td><pre class="example">ffmpeg -benchmark -i INPUT -f null out.null
8053 </pre></td></tr></table>
8055 <p>Note that the above command does not read or write the ‘<tt>out.null</tt>’
8056 file, but specifying the output file is required by the <code>ffmpeg</code>
8059 <p>Alternatively you can write the command as:
8060 </p><table><tr><td> </td><td><pre class="example">ffmpeg -benchmark -i INPUT -f null -
8061 </pre></td></tr></table>
8064 <h2 class="section"><a href="ffplay-all.html#toc-ogg">18.15 ogg</a></h2>
8066 <p>Ogg container muxer.
8068 <dl compact="compact">
8069 <dt> ‘<samp>-page_duration <var>duration</var></samp>’</dt>
8070 <dd><p>Preferred page duration, in microseconds. The muxer will attempt to create
8071 pages that are approximately <var>duration</var> microseconds long. This allows the
8072 user to compromise between seek granularity and container overhead. The default
8073 is 1 second. A value of 0 will fill all segments, making pages as large as
8074 possible. A value of 1 will effectively use 1 packet-per-page in most
8075 situations, giving a small seek granularity at the cost of additional container
8080 <a name="segment_002c-stream_005fsegment_002c-ssegment"></a>
8081 <h2 class="section"><a href="ffplay-all.html#toc-segment_002c-stream_005fsegment_002c-ssegment">18.16 segment, stream_segment, ssegment</a></h2>
8083 <p>Basic stream segmenter.
8085 <p>The segmenter muxer outputs streams to a number of separate files of nearly
8086 fixed duration. Output filename pattern can be set in a fashion similar to
8087 <a href="#image2">image2</a>.
8089 <p><code>stream_segment</code> is a variant of the muxer used to write to
8090 streaming output formats, i.e. which do not require global headers,
8091 and is recommended for outputting e.g. to MPEG transport stream segments.
8092 <code>ssegment</code> is a shorter alias for <code>stream_segment</code>.
8094 <p>Every segment starts with a keyframe of the selected reference stream,
8095 which is set through the ‘<samp>reference_stream</samp>’ option.
8097 <p>Note that if you want accurate splitting for a video file, you need to
8098 make the input key frames correspond to the exact splitting times
8099 expected by the segmenter, or the segment muxer will start the new
8100 segment with the key frame found next after the specified start
8103 <p>The segment muxer works best with a single constant frame rate video.
8105 <p>Optionally it can generate a list of the created segments, by setting
8106 the option <var>segment_list</var>. The list type is specified by the
8107 <var>segment_list_type</var> option. The entry filenames in the segment
8108 list are set by default to the basename of the corresponding segment
8111 <p>The segment muxer supports the following options:
8113 <dl compact="compact">
8114 <dt> ‘<samp>reference_stream <var>specifier</var></samp>’</dt>
8115 <dd><p>Set the reference stream, as specified by the string <var>specifier</var>.
8116 If <var>specifier</var> is set to <code>auto</code>, the reference is choosen
8117 automatically. Otherwise it must be a stream specifier (see the “Stream
8118 specifiers” chapter in the ffmpeg manual) which specifies the
8119 reference stream. The default value is <code>auto</code>.
8122 <dt> ‘<samp>segment_format <var>format</var></samp>’</dt>
8123 <dd><p>Override the inner container format, by default it is guessed by the filename
8127 <dt> ‘<samp>segment_list <var>name</var></samp>’</dt>
8128 <dd><p>Generate also a listfile named <var>name</var>. If not specified no
8129 listfile is generated.
8132 <dt> ‘<samp>segment_list_flags <var>flags</var></samp>’</dt>
8133 <dd><p>Set flags affecting the segment list generation.
8135 <p>It currently supports the following flags:
8136 </p><dl compact="compact">
8137 <dt> ‘<samp>cache</samp>’</dt>
8138 <dd><p>Allow caching (only affects M3U8 list files).
8141 <dt> ‘<samp>live</samp>’</dt>
8142 <dd><p>Allow live-friendly file generation.
8147 <dt> ‘<samp>segment_list_size <var>size</var></samp>’</dt>
8148 <dd><p>Update the list file so that it contains at most the last <var>size</var>
8149 segments. If 0 the list file will contain all the segments. Default
8153 <dt> ‘<samp>segment_list_entry_prefix <var>prefix</var></samp>’</dt>
8154 <dd><p>Set <var>prefix</var> to prepend to the name of each entry filename. By
8155 default no prefix is applied.
8158 <dt> ‘<samp>segment_list_type <var>type</var></samp>’</dt>
8159 <dd><p>Specify the format for the segment list file.
8161 <p>The following values are recognized:
8162 </p><dl compact="compact">
8163 <dt> ‘<samp>flat</samp>’</dt>
8164 <dd><p>Generate a flat list for the created segments, one segment per line.
8167 <dt> ‘<samp>csv, ext</samp>’</dt>
8168 <dd><p>Generate a list for the created segments, one segment per line,
8169 each line matching the format (comma-separated values):
8170 </p><table><tr><td> </td><td><pre class="example"><var>segment_filename</var>,<var>segment_start_time</var>,<var>segment_end_time</var>
8171 </pre></td></tr></table>
8173 <p><var>segment_filename</var> is the name of the output file generated by the
8174 muxer according to the provided pattern. CSV escaping (according to
8175 RFC4180) is applied if required.
8177 <p><var>segment_start_time</var> and <var>segment_end_time</var> specify
8178 the segment start and end time expressed in seconds.
8180 <p>A list file with the suffix <code>".csv"</code> or <code>".ext"</code> will
8181 auto-select this format.
8183 <p>‘<samp>ext</samp>’ is deprecated in favor or ‘<samp>csv</samp>’.
8186 <dt> ‘<samp>ffconcat</samp>’</dt>
8187 <dd><p>Generate an ffconcat file for the created segments. The resulting file
8188 can be read using the FFmpeg <a href="#concat">concat</a> demuxer.
8190 <p>A list file with the suffix <code>".ffcat"</code> or <code>".ffconcat"</code> will
8191 auto-select this format.
8194 <dt> ‘<samp>m3u8</samp>’</dt>
8195 <dd><p>Generate an extended M3U8 file, version 3, compliant with
8196 <a href="http://tools.ietf.org/id/draft-pantos-http-live-streaming">http://tools.ietf.org/id/draft-pantos-http-live-streaming</a>.
8198 <p>A list file with the suffix <code>".m3u8"</code> will auto-select this format.
8202 <p>If not specified the type is guessed from the list file name suffix.
8205 <dt> ‘<samp>segment_time <var>time</var></samp>’</dt>
8206 <dd><p>Set segment duration to <var>time</var>, the value must be a duration
8207 specification. Default value is "2". See also the
8208 ‘<samp>segment_times</samp>’ option.
8210 <p>Note that splitting may not be accurate, unless you force the
8211 reference stream key-frames at the given time. See the introductory
8212 notice and the examples below.
8215 <dt> ‘<samp>segment_time_delta <var>delta</var></samp>’</dt>
8216 <dd><p>Specify the accuracy time when selecting the start time for a
8217 segment, expressed as a duration specification. Default value is "0".
8219 <p>When delta is specified a key-frame will start a new segment if its
8220 PTS satisfies the relation:
8221 </p><table><tr><td> </td><td><pre class="example">PTS >= start_time - time_delta
8222 </pre></td></tr></table>
8224 <p>This option is useful when splitting video content, which is always
8225 split at GOP boundaries, in case a key frame is found just before the
8226 specified split time.
8228 <p>In particular may be used in combination with the ‘<tt>ffmpeg</tt>’ option
8229 <var>force_key_frames</var>. The key frame times specified by
8230 <var>force_key_frames</var> may not be set accurately because of rounding
8231 issues, with the consequence that a key frame time may result set just
8232 before the specified time. For constant frame rate videos a value of
8233 1/2*<var>frame_rate</var> should address the worst case mismatch between
8234 the specified time and the time set by <var>force_key_frames</var>.
8237 <dt> ‘<samp>segment_times <var>times</var></samp>’</dt>
8238 <dd><p>Specify a list of split points. <var>times</var> contains a list of comma
8239 separated duration specifications, in increasing order. See also
8240 the ‘<samp>segment_time</samp>’ option.
8243 <dt> ‘<samp>segment_frames <var>frames</var></samp>’</dt>
8244 <dd><p>Specify a list of split video frame numbers. <var>frames</var> contains a
8245 list of comma separated integer numbers, in increasing order.
8247 <p>This option specifies to start a new segment whenever a reference
8248 stream key frame is found and the sequential number (starting from 0)
8249 of the frame is greater or equal to the next value in the list.
8252 <dt> ‘<samp>segment_wrap <var>limit</var></samp>’</dt>
8253 <dd><p>Wrap around segment index once it reaches <var>limit</var>.
8256 <dt> ‘<samp>segment_start_number <var>number</var></samp>’</dt>
8257 <dd><p>Set the sequence number of the first segment. Defaults to <code>0</code>.
8260 <dt> ‘<samp>reset_timestamps <var>1|0</var></samp>’</dt>
8261 <dd><p>Reset timestamps at the begin of each segment, so that each segment
8262 will start with near-zero timestamps. It is meant to ease the playback
8263 of the generated segments. May not work with some combinations of
8264 muxers/codecs. It is set to <code>0</code> by default.
8267 <dt> ‘<samp>initial_offset <var>offset</var></samp>’</dt>
8268 <dd><p>Specify timestamp offset to apply to the output packet timestamps. The
8269 argument must be a time duration specification, and defaults to 0.
8273 <a name="Examples-81"></a>
8274 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-81">18.16.1 Examples</a></h3>
8278 To remux the content of file ‘<tt>in.mkv</tt>’ to a list of segments
8279 ‘<tt>out-000.nut</tt>’, ‘<tt>out-001.nut</tt>’, etc., and write the list of
8280 generated segments to ‘<tt>out.list</tt>’:
8281 <table><tr><td> </td><td><pre class="example">ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.list out%03d.nut
8282 </pre></td></tr></table>
8285 As the example above, but segment the input file according to the split
8286 points specified by the <var>segment_times</var> option:
8287 <table><tr><td> </td><td><pre class="example">ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 out%03d.nut
8288 </pre></td></tr></table>
8291 As the example above, but use the <code>ffmpeg</code> ‘<samp>force_key_frames</samp>’
8292 option to force key frames in the input at the specified location, together
8293 with the segment option ‘<samp>segment_time_delta</samp>’ to account for
8294 possible roundings operated when setting key frame times.
8295 <table><tr><td> </td><td><pre class="example">ffmpeg -i in.mkv -force_key_frames 1,2,3,5,8,13,21 -codec:v mpeg4 -codec:a pcm_s16le -map 0 \
8296 -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 -segment_time_delta 0.05 out%03d.nut
8297 </pre></td></tr></table>
8298 <p>In order to force key frames on the input file, transcoding is
8302 Segment the input file by splitting the input file according to the
8303 frame numbers sequence specified with the ‘<samp>segment_frames</samp>’ option:
8304 <table><tr><td> </td><td><pre class="example">ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_frames 100,200,300,500,800 out%03d.nut
8305 </pre></td></tr></table>
8308 To convert the ‘<tt>in.mkv</tt>’ to TS segments using the <code>libx264</code>
8309 and <code>libfaac</code> encoders:
8310 <table><tr><td> </td><td><pre class="example">ffmpeg -i in.mkv -map 0 -codec:v libx264 -codec:a libfaac -f ssegment -segment_list out.list out%03d.ts
8311 </pre></td></tr></table>
8314 Segment the input file, and create an M3U8 live playlist (can be used
8315 as live HLS source):
8316 <table><tr><td> </td><td><pre class="example">ffmpeg -re -i in.mkv -codec copy -map 0 -f segment -segment_list playlist.m3u8 \
8317 -segment_list_flags +live -segment_time 10 out%03d.mkv
8318 </pre></td></tr></table>
8322 <h2 class="section"><a href="ffplay-all.html#toc-tee">18.17 tee</a></h2>
8324 <p>The tee muxer can be used to write the same data to several files or any
8325 other kind of muxer. It can be used, for example, to both stream a video to
8326 the network and save it to disk at the same time.
8328 <p>It is different from specifying several outputs to the <code>ffmpeg</code>
8329 command-line tool because the audio and video data will be encoded only once
8330 with the tee muxer; encoding can be a very expensive process. It is not
8331 useful when using the libavformat API directly because it is then possible
8332 to feed the same packets to several muxers directly.
8334 <p>The slave outputs are specified in the file name given to the muxer,
8335 separated by ’|’. If any of the slave name contains the ’|’ separator,
8336 leading or trailing spaces or any special character, it must be
8337 escaped (see the “Quoting and escaping” section in the ffmpeg-utils
8340 <p>Muxer options can be specified for each slave by prepending them as a list of
8341 <var>key</var>=<var>value</var> pairs separated by ’:’, between square brackets. If
8342 the options values contain a special character or the ’:’ separator, they
8343 must be escaped; note that this is a second level escaping.
8345 <p>The following special options are also recognized:
8346 </p><dl compact="compact">
8347 <dt> ‘<samp>f</samp>’</dt>
8348 <dd><p>Specify the format name. Useful if it cannot be guessed from the
8352 <dt> ‘<samp>bsfs[/<var>spec</var>]</samp>’</dt>
8353 <dd><p>Specify a list of bitstream filters to apply to the specified
8354 output. It is possible to specify to which streams a given bitstream
8355 filter applies, by appending a stream specifier to the option
8356 separated by <code>/</code>. If the stream specifier is not specified, the
8357 bistream filters will be applied to all streams in the output.
8359 <p>Several bitstream filters can be specified, separated by ",".
8362 <dt> ‘<samp>select</samp>’</dt>
8363 <dd><p>Select the streams that should be mapped to the slave output,
8364 specified by a stream specifier. If not specified, this defaults to
8365 all the input streams.
8369 <p>Some examples follow.
8372 Encode something and both archive it in a WebM file and stream it
8373 as MPEG-TS over UDP (the streams need to be explicitly mapped):
8374 <table><tr><td> </td><td><pre class="example">ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
8375 "archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/"
8376 </pre></td></tr></table>
8379 Use <code>ffmpeg</code> to encode the input, and send the output
8380 to three different destinations. The <code>dump_extra</code> bitstream
8381 filter is used to add extradata information to all the output video
8382 keyframes packets, as requested by the MPEG-TS format. The select
8383 option is applied to ‘<tt>out.aac</tt>’ in order to make it contain only
8385 <table><tr><td> </td><td><pre class="example">ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac -strict experimental
8386 -f tee "[bsfs/v=dump_extra]out.ts|[movflags=+faststart]out.mp4|[select=a]out.aac"
8387 </pre></td></tr></table>
8390 <p>Note: some codecs may need different options depending on the output format;
8391 the auto-detection of this can not work with the tee muxer. The main example
8392 is the ‘<samp>global_header</samp>’ flag.
8394 <a name="Metadata"></a>
8395 <h1 class="chapter"><a href="ffplay-all.html#toc-Metadata">19. Metadata</a></h1>
8397 <p>FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded
8398 INI-like text file and then load it back using the metadata muxer/demuxer.
8400 <p>The file format is as follows:
8403 A file consists of a header and a number of metadata tags divided into sections,
8404 each on its own line.
8407 The header is a ’;FFMETADATA’ string, followed by a version number (now 1).
8410 Metadata tags are of the form ’key=value’
8413 Immediately after header follows global metadata
8416 After global metadata there may be sections with per-stream/per-chapter
8420 A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
8421 brackets (’[’, ’]’) and ends with next section or end of file.
8424 At the beginning of a chapter section there may be an optional timebase to be
8425 used for start/end values. It must be in form ’TIMEBASE=num/den’, where num and
8426 den are integers. If the timebase is missing then start/end times are assumed to
8428 Next a chapter section must contain chapter start and end times in form
8429 ’START=num’, ’END=num’, where num is a positive integer.
8432 Empty lines and lines starting with ’;’ or ’#’ are ignored.
8435 Metadata keys or values containing special characters (’=’, ’;’, ’#’, ’\’ and a
8436 newline) must be escaped with a backslash ’\’.
8439 Note that whitespace in metadata (e.g. foo = bar) is considered to be a part of
8440 the tag (in the example above key is ’foo ’, value is ’ bar’).
8443 <p>A ffmetadata file might look like this:
8444 </p><table><tr><td> </td><td><pre class="example">;FFMETADATA1
8447 artist=FFmpeg troll team
8452 #chapter ends at 0:01:00
8458 </pre></td></tr></table>
8460 <p>By using the ffmetadata muxer and demuxer it is possible to extract
8461 metadata from an input file to an ffmetadata file, and then transcode
8462 the file into an output file with the edited ffmetadata file.
8464 <p>Extracting an ffmetadata file with ‘<tt>ffmpeg</tt>’ goes as follows:
8465 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
8466 </pre></td></tr></table>
8468 <p>Reinserting edited metadata information from the FFMETADATAFILE file can
8470 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
8471 </pre></td></tr></table>
8473 <a name="Protocols"></a>
8474 <h1 class="chapter"><a href="ffplay-all.html#toc-Protocols">20. Protocols</a></h1>
8476 <p>Protocols are configured elements in FFmpeg that enable access to
8477 resources that require specific protocols.
8479 <p>When you configure your FFmpeg build, all the supported protocols are
8480 enabled by default. You can list all available ones using the
8481 configure option "–list-protocols".
8483 <p>You can disable all the protocols using the configure option
8484 "–disable-protocols", and selectively enable a protocol using the
8485 option "–enable-protocol=<var>PROTOCOL</var>", or you can disable a
8486 particular protocol using the option
8487 "–disable-protocol=<var>PROTOCOL</var>".
8489 <p>The option "-protocols" of the ff* tools will display the list of
8490 supported protocols.
8492 <p>A description of the currently available protocols follows.
8494 <a name="bluray"></a>
8495 <h2 class="section"><a href="ffplay-all.html#toc-bluray">20.1 bluray</a></h2>
8497 <p>Read BluRay playlist.
8499 <p>The accepted options are:
8500 </p><dl compact="compact">
8501 <dt> ‘<samp>angle</samp>’</dt>
8505 <dt> ‘<samp>chapter</samp>’</dt>
8506 <dd><p>Start chapter (1...N)
8509 <dt> ‘<samp>playlist</samp>’</dt>
8510 <dd><p>Playlist to read (BDMV/PLAYLIST/?????.mpls)
8517 <p>Read longest playlist from BluRay mounted to /mnt/bluray:
8518 </p><table><tr><td> </td><td><pre class="example">bluray:/mnt/bluray
8519 </pre></td></tr></table>
8521 <p>Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2:
8522 </p><table><tr><td> </td><td><pre class="example">-playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
8523 </pre></td></tr></table>
8525 <a name="cache"></a>
8526 <h2 class="section"><a href="ffplay-all.html#toc-cache">20.2 cache</a></h2>
8528 <p>Caching wrapper for input stream.
8530 <p>Cache the input stream to temporary file. It brings seeking capability to live streams.
8532 <table><tr><td> </td><td><pre class="example">cache:<var>URL</var>
8533 </pre></td></tr></table>
8535 <a name="concat-1"></a>
8536 <h2 class="section"><a href="ffplay-all.html#toc-concat-1">20.3 concat</a></h2>
8538 <p>Physical concatenation protocol.
8540 <p>Allow to read and seek from many resource in sequence as if they were
8543 <p>A URL accepted by this protocol has the syntax:
8544 </p><table><tr><td> </td><td><pre class="example">concat:<var>URL1</var>|<var>URL2</var>|...|<var>URLN</var>
8545 </pre></td></tr></table>
8547 <p>where <var>URL1</var>, <var>URL2</var>, ..., <var>URLN</var> are the urls of the
8548 resource to be concatenated, each one possibly specifying a distinct
8551 <p>For example to read a sequence of files ‘<tt>split1.mpeg</tt>’,
8552 ‘<tt>split2.mpeg</tt>’, ‘<tt>split3.mpeg</tt>’ with <code>ffplay</code> use the
8554 </p><table><tr><td> </td><td><pre class="example">ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
8555 </pre></td></tr></table>
8557 <p>Note that you may need to escape the character "|" which is special for
8560 <a name="crypto"></a>
8561 <h2 class="section"><a href="ffplay-all.html#toc-crypto">20.4 crypto</a></h2>
8563 <p>AES-encrypted stream reading protocol.
8565 <p>The accepted options are:
8566 </p><dl compact="compact">
8567 <dt> ‘<samp>key</samp>’</dt>
8568 <dd><p>Set the AES decryption key binary block from given hexadecimal representation.
8571 <dt> ‘<samp>iv</samp>’</dt>
8572 <dd><p>Set the AES decryption initialization vector binary block from given hexadecimal representation.
8576 <p>Accepted URL formats:
8577 </p><table><tr><td> </td><td><pre class="example">crypto:<var>URL</var>
8578 crypto+<var>URL</var>
8579 </pre></td></tr></table>
8582 <h2 class="section"><a href="ffplay-all.html#toc-data">20.5 data</a></h2>
8584 <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>.
8586 <p>For example, to convert a GIF file given inline with <code>ffmpeg</code>:
8587 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i "data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=" smiley.png
8588 </pre></td></tr></table>
8591 <h2 class="section"><a href="ffplay-all.html#toc-file">20.6 file</a></h2>
8593 <p>File access protocol.
8595 <p>Allow to read from or read to a file.
8597 <p>For example to read from a file ‘<tt>input.mpeg</tt>’ with <code>ffmpeg</code>
8599 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i file:input.mpeg output.mpeg
8600 </pre></td></tr></table>
8602 <p>The ff* tools default to the file protocol, that is a resource
8603 specified with the name "FILE.mpeg" is interpreted as the URL
8604 "file:FILE.mpeg".
8606 <p>This protocol accepts the following options:
8608 <dl compact="compact">
8609 <dt> ‘<samp>truncate</samp>’</dt>
8610 <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
8611 truncating. Default value is 1.
8614 <dt> ‘<samp>blocksize</samp>’</dt>
8615 <dd><p>Set I/O operation maximum block size, in bytes. Default value is
8616 <code>INT_MAX</code>, which results in not limiting the requested block size.
8617 Setting this value reasonably low improves user termination request reaction
8618 time, which is valuable for files on slow medium.
8623 <h2 class="section"><a href="ffplay-all.html#toc-ftp">20.7 ftp</a></h2>
8625 <p>FTP (File Transfer Protocol).
8627 <p>Allow to read from or write to remote resources using FTP protocol.
8629 <p>Following syntax is required.
8630 </p><table><tr><td> </td><td><pre class="example">ftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
8631 </pre></td></tr></table>
8633 <p>This protocol accepts the following options.
8635 <dl compact="compact">
8636 <dt> ‘<samp>timeout</samp>’</dt>
8637 <dd><p>Set timeout of socket I/O operations used by the underlying low level
8638 operation. By default it is set to -1, which means that the timeout is
8642 <dt> ‘<samp>ftp-anonymous-password</samp>’</dt>
8643 <dd><p>Password used when login as anonymous user. Typically an e-mail address
8647 <dt> ‘<samp>ftp-write-seekable</samp>’</dt>
8648 <dd><p>Control seekability of connection during encoding. If set to 1 the
8649 resource is supposed to be seekable, if set to 0 it is assumed not
8650 to be seekable. Default value is 0.
8654 <p>NOTE: Protocol can be used as output, but it is recommended to not do
8655 it, unless special care is taken (tests, customized server configuration
8656 etc.). Different FTP servers behave in different way during seek
8657 operation. ff* tools may produce incomplete content due to server limitations.
8659 <a name="gopher"></a>
8660 <h2 class="section"><a href="ffplay-all.html#toc-gopher">20.8 gopher</a></h2>
8664 <a name="hls-2"></a>
8665 <h2 class="section"><a href="ffplay-all.html#toc-hls-2">20.9 hls</a></h2>
8667 <p>Read Apple HTTP Live Streaming compliant segmented stream as
8668 a uniform one. The M3U8 playlists describing the segments can be
8669 remote HTTP resources or local files, accessed using the standard
8671 The nested protocol is declared by specifying
8672 "+<var>proto</var>" after the hls URI scheme name, where <var>proto</var>
8673 is either "file" or "http".
8675 <table><tr><td> </td><td><pre class="example">hls+http://host/path/to/remote/resource.m3u8
8676 hls+file://path/to/local/resource.m3u8
8677 </pre></td></tr></table>
8679 <p>Using this protocol is discouraged - the hls demuxer should work
8680 just as well (if not, please report the issues) and is more complete.
8681 To use the hls demuxer instead, simply use the direct URLs to the
8685 <h2 class="section"><a href="ffplay-all.html#toc-http">20.10 http</a></h2>
8687 <p>HTTP (Hyper Text Transfer Protocol).
8689 <p>This protocol accepts the following options.
8691 <dl compact="compact">
8692 <dt> ‘<samp>seekable</samp>’</dt>
8693 <dd><p>Control seekability of connection. If set to 1 the resource is
8694 supposed to be seekable, if set to 0 it is assumed not to be seekable,
8695 if set to -1 it will try to autodetect if it is seekable. Default
8699 <dt> ‘<samp>chunked_post</samp>’</dt>
8700 <dd><p>If set to 1 use chunked transfer-encoding for posts, default is 1.
8703 <dt> ‘<samp>headers</samp>’</dt>
8704 <dd><p>Set custom HTTP headers, can override built in default headers. The
8705 value must be a string encoding the headers.
8708 <dt> ‘<samp>content_type</samp>’</dt>
8709 <dd><p>Force a content type.
8712 <dt> ‘<samp>user-agent</samp>’</dt>
8713 <dd><p>Override User-Agent header. If not specified the protocol will use a
8714 string describing the libavformat build.
8717 <dt> ‘<samp>multiple_requests</samp>’</dt>
8718 <dd><p>Use persistent connections if set to 1. By default it is 0.
8721 <dt> ‘<samp>post_data</samp>’</dt>
8722 <dd><p>Set custom HTTP post data.
8725 <dt> ‘<samp>timeout</samp>’</dt>
8726 <dd><p>Set timeout of socket I/O operations used by the underlying low level
8727 operation. By default it is set to -1, which means that the timeout is
8731 <dt> ‘<samp>mime_type</samp>’</dt>
8732 <dd><p>Set MIME type.
8735 <dt> ‘<samp>icy</samp>’</dt>
8736 <dd><p>If set to 1 request ICY (SHOUTcast) metadata from the server. If the server
8737 supports this, the metadata has to be retrieved by the application by reading
8738 the ‘<samp>icy_metadata_headers</samp>’ and ‘<samp>icy_metadata_packet</samp>’ options.
8742 <dt> ‘<samp>icy_metadata_headers</samp>’</dt>
8743 <dd><p>If the server supports ICY metadata, this contains the ICY specific HTTP reply
8744 headers, separated with newline characters.
8747 <dt> ‘<samp>icy_metadata_packet</samp>’</dt>
8748 <dd><p>If the server supports ICY metadata, and ‘<samp>icy</samp>’ was set to 1, this
8749 contains the last non-empty metadata packet sent by the server.
8752 <dt> ‘<samp>cookies</samp>’</dt>
8753 <dd><p>Set the cookies to be sent in future requests. The format of each cookie is the
8754 same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
8755 delimited by a newline character.
8759 <a name="HTTP-Cookies"></a>
8760 <h3 class="subsection"><a href="ffplay-all.html#toc-HTTP-Cookies">20.10.1 HTTP Cookies</a></h3>
8762 <p>Some HTTP requests will be denied unless cookie values are passed in with the
8763 request. The ‘<samp>cookies</samp>’ option allows these cookies to be specified. At
8764 the very least, each cookie must specify a value along with a path and domain.
8765 HTTP requests that match both the domain and path will automatically include the
8766 cookie value in the HTTP Cookie header field. Multiple cookies can be delimited
8769 <p>The required syntax to play a stream specifying a cookie is:
8770 </p><table><tr><td> </td><td><pre class="example">ffplay -cookies "nlqptid=nltid=tsn; path=/; domain=somedomain.com;" http://somedomain.com/somestream.m3u8
8771 </pre></td></tr></table>
8774 <h2 class="section"><a href="ffplay-all.html#toc-mmst">20.11 mmst</a></h2>
8776 <p>MMS (Microsoft Media Server) protocol over TCP.
8779 <h2 class="section"><a href="ffplay-all.html#toc-mmsh">20.12 mmsh</a></h2>
8781 <p>MMS (Microsoft Media Server) protocol over HTTP.
8783 <p>The required syntax is:
8784 </p><table><tr><td> </td><td><pre class="example">mmsh://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
8785 </pre></td></tr></table>
8787 <a name="md5-2"></a>
8788 <h2 class="section"><a href="ffplay-all.html#toc-md5-2">20.13 md5</a></h2>
8790 <p>MD5 output protocol.
8792 <p>Computes the MD5 hash of the data to be written, and on close writes
8793 this to the designated output or stdout if none is specified. It can
8794 be used to test muxers without writing an actual file.
8796 <p>Some examples follow.
8797 </p><table><tr><td> </td><td><pre class="example"># Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
8798 ffmpeg -i input.flv -f avi -y md5:output.avi.md5
8800 # Write the MD5 hash of the encoded AVI file to stdout.
8801 ffmpeg -i input.flv -f avi -y md5:
8802 </pre></td></tr></table>
8804 <p>Note that some formats (typically MOV) require the output protocol to
8805 be seekable, so they will fail with the MD5 output protocol.
8808 <h2 class="section"><a href="ffplay-all.html#toc-pipe">20.14 pipe</a></h2>
8810 <p>UNIX pipe access protocol.
8812 <p>Allow to read and write from UNIX pipes.
8814 <p>The accepted syntax is:
8815 </p><table><tr><td> </td><td><pre class="example">pipe:[<var>number</var>]
8816 </pre></td></tr></table>
8818 <p><var>number</var> is the number corresponding to the file descriptor of the
8819 pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If <var>number</var>
8820 is not specified, by default the stdout file descriptor will be used
8821 for writing, stdin for reading.
8823 <p>For example to read from stdin with <code>ffmpeg</code>:
8824 </p><table><tr><td> </td><td><pre class="example">cat test.wav | ffmpeg -i pipe:0
8825 # ...this is the same as...
8826 cat test.wav | ffmpeg -i pipe:
8827 </pre></td></tr></table>
8829 <p>For writing to stdout with <code>ffmpeg</code>:
8830 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi
8831 # ...this is the same as...
8832 ffmpeg -i test.wav -f avi pipe: | cat > test.avi
8833 </pre></td></tr></table>
8835 <p>This protocol accepts the following options:
8837 <dl compact="compact">
8838 <dt> ‘<samp>blocksize</samp>’</dt>
8839 <dd><p>Set I/O operation maximum block size, in bytes. Default value is
8840 <code>INT_MAX</code>, which results in not limiting the requested block size.
8841 Setting this value reasonably low improves user termination request reaction
8842 time, which is valuable if data transmission is slow.
8846 <p>Note that some formats (typically MOV), require the output protocol to
8847 be seekable, so they will fail with the pipe output protocol.
8850 <h2 class="section"><a href="ffplay-all.html#toc-rtmp">20.15 rtmp</a></h2>
8852 <p>Real-Time Messaging Protocol.
8854 <p>The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
8855 content across a TCP/IP network.
8857 <p>The required syntax is:
8858 </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>]
8859 </pre></td></tr></table>
8861 <p>The accepted parameters are:
8862 </p><dl compact="compact">
8863 <dt> ‘<samp>username</samp>’</dt>
8864 <dd><p>An optional username (mostly for publishing).
8867 <dt> ‘<samp>password</samp>’</dt>
8868 <dd><p>An optional password (mostly for publishing).
8871 <dt> ‘<samp>server</samp>’</dt>
8872 <dd><p>The address of the RTMP server.
8875 <dt> ‘<samp>port</samp>’</dt>
8876 <dd><p>The number of the TCP port to use (by default is 1935).
8879 <dt> ‘<samp>app</samp>’</dt>
8880 <dd><p>It is the name of the application to access. It usually corresponds to
8881 the path where the application is installed on the RTMP server
8882 (e.g. ‘<tt>/ondemand/</tt>’, ‘<tt>/flash/live/</tt>’, etc.). You can override
8883 the value parsed from the URI through the <code>rtmp_app</code> option, too.
8886 <dt> ‘<samp>playpath</samp>’</dt>
8887 <dd><p>It is the path or name of the resource to play with reference to the
8888 application specified in <var>app</var>, may be prefixed by "mp4:". You
8889 can override the value parsed from the URI through the <code>rtmp_playpath</code>
8893 <dt> ‘<samp>listen</samp>’</dt>
8894 <dd><p>Act as a server, listening for an incoming connection.
8897 <dt> ‘<samp>timeout</samp>’</dt>
8898 <dd><p>Maximum time to wait for the incoming connection. Implies listen.
8902 <p>Additionally, the following parameters can be set via command line options
8903 (or in code via <code>AVOption</code>s):
8904 </p><dl compact="compact">
8905 <dt> ‘<samp>rtmp_app</samp>’</dt>
8906 <dd><p>Name of application to connect on the RTMP server. This option
8907 overrides the parameter specified in the URI.
8910 <dt> ‘<samp>rtmp_buffer</samp>’</dt>
8911 <dd><p>Set the client buffer time in milliseconds. The default is 3000.
8914 <dt> ‘<samp>rtmp_conn</samp>’</dt>
8915 <dd><p>Extra arbitrary AMF connection parameters, parsed from a string,
8916 e.g. like <code>B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0</code>.
8917 Each value is prefixed by a single character denoting the type,
8918 B for Boolean, N for number, S for string, O for object, or Z for null,
8919 followed by a colon. For Booleans the data must be either 0 or 1 for
8920 FALSE or TRUE, respectively. Likewise for Objects the data must be 0 or
8921 1 to end or begin an object, respectively. Data items in subobjects may
8922 be named, by prefixing the type with ’N’ and specifying the name before
8923 the value (i.e. <code>NB:myFlag:1</code>). This option may be used multiple
8924 times to construct arbitrary AMF sequences.
8927 <dt> ‘<samp>rtmp_flashver</samp>’</dt>
8928 <dd><p>Version of the Flash plugin used to run the SWF player. The default
8929 is LNX 9,0,124,2. (When publishing, the default is FMLE/3.0 (compatible;
8930 <libavformat version>).)
8933 <dt> ‘<samp>rtmp_flush_interval</samp>’</dt>
8934 <dd><p>Number of packets flushed in the same request (RTMPT only). The default
8938 <dt> ‘<samp>rtmp_live</samp>’</dt>
8939 <dd><p>Specify that the media is a live stream. No resuming or seeking in
8940 live streams is possible. The default value is <code>any</code>, which means the
8941 subscriber first tries to play the live stream specified in the
8942 playpath. If a live stream of that name is not found, it plays the
8943 recorded stream. The other possible values are <code>live</code> and
8944 <code>recorded</code>.
8947 <dt> ‘<samp>rtmp_pageurl</samp>’</dt>
8948 <dd><p>URL of the web page in which the media was embedded. By default no
8952 <dt> ‘<samp>rtmp_playpath</samp>’</dt>
8953 <dd><p>Stream identifier to play or to publish. This option overrides the
8954 parameter specified in the URI.
8957 <dt> ‘<samp>rtmp_subscribe</samp>’</dt>
8958 <dd><p>Name of live stream to subscribe to. By default no value will be sent.
8959 It is only sent if the option is specified or if rtmp_live
8963 <dt> ‘<samp>rtmp_swfhash</samp>’</dt>
8964 <dd><p>SHA256 hash of the decompressed SWF file (32 bytes).
8967 <dt> ‘<samp>rtmp_swfsize</samp>’</dt>
8968 <dd><p>Size of the decompressed SWF file, required for SWFVerification.
8971 <dt> ‘<samp>rtmp_swfurl</samp>’</dt>
8972 <dd><p>URL of the SWF player for the media. By default no value will be sent.
8975 <dt> ‘<samp>rtmp_swfverify</samp>’</dt>
8976 <dd><p>URL to player swf file, compute hash/size automatically.
8979 <dt> ‘<samp>rtmp_tcurl</samp>’</dt>
8980 <dd><p>URL of the target stream. Defaults to proto://host[:port]/app.
8985 <p>For example to read with <code>ffplay</code> a multimedia resource named
8986 "sample" from the application "vod" from an RTMP server "myserver":
8987 </p><table><tr><td> </td><td><pre class="example">ffplay rtmp://myserver/vod/sample
8988 </pre></td></tr></table>
8990 <p>To publish to a password protected server, passing the playpath and
8991 app names separately:
8992 </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/
8993 </pre></td></tr></table>
8995 <a name="rtmpe"></a>
8996 <h2 class="section"><a href="ffplay-all.html#toc-rtmpe">20.16 rtmpe</a></h2>
8998 <p>Encrypted Real-Time Messaging Protocol.
9000 <p>The Encrypted Real-Time Messaging Protocol (RTMPE) is used for
9001 streaming multimedia content within standard cryptographic primitives,
9002 consisting of Diffie-Hellman key exchange and HMACSHA256, generating
9005 <a name="rtmps"></a>
9006 <h2 class="section"><a href="ffplay-all.html#toc-rtmps">20.17 rtmps</a></h2>
9008 <p>Real-Time Messaging Protocol over a secure SSL connection.
9010 <p>The Real-Time Messaging Protocol (RTMPS) is used for streaming
9011 multimedia content across an encrypted connection.
9013 <a name="rtmpt"></a>
9014 <h2 class="section"><a href="ffplay-all.html#toc-rtmpt">20.18 rtmpt</a></h2>
9016 <p>Real-Time Messaging Protocol tunneled through HTTP.
9018 <p>The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used
9019 for streaming multimedia content within HTTP requests to traverse
9022 <a name="rtmpte"></a>
9023 <h2 class="section"><a href="ffplay-all.html#toc-rtmpte">20.19 rtmpte</a></h2>
9025 <p>Encrypted Real-Time Messaging Protocol tunneled through HTTP.
9027 <p>The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE)
9028 is used for streaming multimedia content within HTTP requests to traverse
9031 <a name="rtmpts"></a>
9032 <h2 class="section"><a href="ffplay-all.html#toc-rtmpts">20.20 rtmpts</a></h2>
9034 <p>Real-Time Messaging Protocol tunneled through HTTPS.
9036 <p>The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used
9037 for streaming multimedia content within HTTPS requests to traverse
9040 <a name="libssh"></a>
9041 <h2 class="section"><a href="ffplay-all.html#toc-libssh">20.21 libssh</a></h2>
9043 <p>Secure File Transfer Protocol via libssh
9045 <p>Allow to read from or write to remote resources using SFTP protocol.
9047 <p>Following syntax is required.
9049 <table><tr><td> </td><td><pre class="example">sftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
9050 </pre></td></tr></table>
9052 <p>This protocol accepts the following options.
9054 <dl compact="compact">
9055 <dt> ‘<samp>timeout</samp>’</dt>
9056 <dd><p>Set timeout of socket I/O operations used by the underlying low level
9057 operation. By default it is set to -1, which means that the timeout
9061 <dt> ‘<samp>truncate</samp>’</dt>
9062 <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
9063 truncating. Default value is 1.
9068 <p>Example: Play a file stored on remote server.
9070 <table><tr><td> </td><td><pre class="example">ffplay sftp://user:password@server_address:22/home/user/resource.mpeg
9071 </pre></td></tr></table>
9073 <a name="librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte"></a>
9074 <h2 class="section"><a href="ffplay-all.html#toc-librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">20.22 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></h2>
9076 <p>Real-Time Messaging Protocol and its variants supported through
9079 <p>Requires the presence of the librtmp headers and library during
9080 configuration. You need to explicitly configure the build with
9081 "–enable-librtmp". If enabled this will replace the native RTMP
9084 <p>This protocol provides most client functions and a few server
9085 functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
9086 encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
9087 variants of these encrypted types (RTMPTE, RTMPTS).
9089 <p>The required syntax is:
9090 </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>
9091 </pre></td></tr></table>
9093 <p>where <var>rtmp_proto</var> is one of the strings "rtmp", "rtmpt", "rtmpe",
9094 "rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and
9095 <var>server</var>, <var>port</var>, <var>app</var> and <var>playpath</var> have the same
9096 meaning as specified for the RTMP native protocol.
9097 <var>options</var> contains a list of space-separated options of the form
9098 <var>key</var>=<var>val</var>.
9100 <p>See the librtmp manual page (man 3 librtmp) for more information.
9102 <p>For example, to stream a file in real-time to an RTMP server using
9103 <code>ffmpeg</code>:
9104 </p><table><tr><td> </td><td><pre class="example">ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
9105 </pre></td></tr></table>
9107 <p>To play the same stream using <code>ffplay</code>:
9108 </p><table><tr><td> </td><td><pre class="example">ffplay "rtmp://myserver/live/mystream live=1"
9109 </pre></td></tr></table>
9112 <h2 class="section"><a href="ffplay-all.html#toc-rtp">20.23 rtp</a></h2>
9114 <p>Real-time Transport Protocol.
9116 <p>The required syntax for an RTP URL is:
9117 rtp://<var>hostname</var>[:<var>port</var>][?<var>option</var>=<var>val</var>...]
9119 <p><var>port</var> specifies the RTP port to use.
9121 <p>The following URL options are supported:
9123 <dl compact="compact">
9124 <dt> ‘<samp>ttl=<var>n</var></samp>’</dt>
9125 <dd><p>Set the TTL (Time-To-Live) value (for multicast only).
9128 <dt> ‘<samp>rtcpport=<var>n</var></samp>’</dt>
9129 <dd><p>Set the remote RTCP port to <var>n</var>.
9132 <dt> ‘<samp>localrtpport=<var>n</var></samp>’</dt>
9133 <dd><p>Set the local RTP port to <var>n</var>.
9136 <dt> ‘<samp>localrtcpport=<var>n</var>'</samp>’</dt>
9137 <dd><p>Set the local RTCP port to <var>n</var>.
9140 <dt> ‘<samp>pkt_size=<var>n</var></samp>’</dt>
9141 <dd><p>Set max packet size (in bytes) to <var>n</var>.
9144 <dt> ‘<samp>connect=0|1</samp>’</dt>
9145 <dd><p>Do a <code>connect()</code> on the UDP socket (if set to 1) or not (if set
9149 <dt> ‘<samp>sources=<var>ip</var>[,<var>ip</var>]</samp>’</dt>
9150 <dd><p>List allowed source IP addresses.
9153 <dt> ‘<samp>block=<var>ip</var>[,<var>ip</var>]</samp>’</dt>
9154 <dd><p>List disallowed (blocked) source IP addresses.
9157 <dt> ‘<samp>write_to_source=0|1</samp>’</dt>
9158 <dd><p>Send packets to the source address of the latest received packet (if
9159 set to 1) or to a default remote address (if set to 0).
9162 <dt> ‘<samp>localport=<var>n</var></samp>’</dt>
9163 <dd><p>Set the local RTP port to <var>n</var>.
9165 <p>This is a deprecated option. Instead, ‘<samp>localrtpport</samp>’ should be
9175 If ‘<samp>rtcpport</samp>’ is not set the RTCP port will be set to the RTP
9179 If ‘<samp>localrtpport</samp>’ (the local RTP port) is not set any available
9180 port will be used for the local RTP and RTCP ports.
9183 If ‘<samp>localrtcpport</samp>’ (the local RTCP port) is not set it will be
9184 set to the the local RTP port value plus 1.
9188 <h2 class="section"><a href="ffplay-all.html#toc-rtsp">20.24 rtsp</a></h2>
9190 <p>RTSP is not technically a protocol handler in libavformat, it is a demuxer
9191 and muxer. The demuxer supports both normal RTSP (with data transferred
9192 over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
9193 data transferred over RDT).
9195 <p>The muxer can be used to send a stream using RTSP ANNOUNCE to a server
9196 supporting it (currently Darwin Streaming Server and Mischa Spiegelmock’s
9197 <a href="http://github.com/revmischa/rtsp-server">RTSP server</a>).
9199 <p>The required syntax for a RTSP url is:
9200 </p><table><tr><td> </td><td><pre class="example">rtsp://<var>hostname</var>[:<var>port</var>]/<var>path</var>
9201 </pre></td></tr></table>
9203 <p>The following options (set on the <code>ffmpeg</code>/<code>ffplay</code> command
9204 line, or set in code via <code>AVOption</code>s or in <code>avformat_open_input</code>),
9207 <p>Flags for <code>rtsp_transport</code>:
9209 <dl compact="compact">
9210 <dt> ‘<samp>udp</samp>’</dt>
9211 <dd><p>Use UDP as lower transport protocol.
9214 <dt> ‘<samp>tcp</samp>’</dt>
9215 <dd><p>Use TCP (interleaving within the RTSP control channel) as lower
9219 <dt> ‘<samp>udp_multicast</samp>’</dt>
9220 <dd><p>Use UDP multicast as lower transport protocol.
9223 <dt> ‘<samp>http</samp>’</dt>
9224 <dd><p>Use HTTP tunneling as lower transport protocol, which is useful for
9229 <p>Multiple lower transport protocols may be specified, in that case they are
9230 tried one at a time (if the setup of one fails, the next one is tried).
9231 For the muxer, only the <code>tcp</code> and <code>udp</code> options are supported.
9233 <p>Flags for <code>rtsp_flags</code>:
9235 <dl compact="compact">
9236 <dt> ‘<samp>filter_src</samp>’</dt>
9237 <dd><p>Accept packets only from negotiated peer address and port.
9239 <dt> ‘<samp>listen</samp>’</dt>
9240 <dd><p>Act as a server, listening for an incoming connection.
9244 <p>When receiving data over UDP, the demuxer tries to reorder received packets
9245 (since they may arrive out of order, or packets may get lost totally). This
9246 can be disabled by setting the maximum demuxing delay to zero (via
9247 the <code>max_delay</code> field of AVFormatContext).
9249 <p>When watching multi-bitrate Real-RTSP streams with <code>ffplay</code>, the
9250 streams to display can be chosen with <code>-vst</code> <var>n</var> and
9251 <code>-ast</code> <var>n</var> for video and audio respectively, and can be switched
9252 on the fly by pressing <code>v</code> and <code>a</code>.
9254 <p>Example command lines:
9256 <p>To watch a stream over UDP, with a max reordering delay of 0.5 seconds:
9258 <table><tr><td> </td><td><pre class="example">ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
9259 </pre></td></tr></table>
9261 <p>To watch a stream tunneled over HTTP:
9263 <table><tr><td> </td><td><pre class="example">ffplay -rtsp_transport http rtsp://server/video.mp4
9264 </pre></td></tr></table>
9266 <p>To send a stream in realtime to a RTSP server, for others to watch:
9268 <table><tr><td> </td><td><pre class="example">ffmpeg -re -i <var>input</var> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
9269 </pre></td></tr></table>
9271 <p>To receive a stream in realtime:
9273 <table><tr><td> </td><td><pre class="example">ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp <var>output</var>
9274 </pre></td></tr></table>
9276 <dl compact="compact">
9277 <dt> ‘<samp>stimeout</samp>’</dt>
9278 <dd><p>Socket IO timeout in micro seconds.
9283 <h2 class="section"><a href="ffplay-all.html#toc-sap">20.25 sap</a></h2>
9285 <p>Session Announcement Protocol (RFC 2974). This is not technically a
9286 protocol handler in libavformat, it is a muxer and demuxer.
9287 It is used for signalling of RTP streams, by announcing the SDP for the
9288 streams regularly on a separate port.
9290 <a name="Muxer"></a>
9291 <h3 class="subsection"><a href="ffplay-all.html#toc-Muxer">20.25.1 Muxer</a></h3>
9293 <p>The syntax for a SAP url given to the muxer is:
9294 </p><table><tr><td> </td><td><pre class="example">sap://<var>destination</var>[:<var>port</var>][?<var>options</var>]
9295 </pre></td></tr></table>
9297 <p>The RTP packets are sent to <var>destination</var> on port <var>port</var>,
9298 or to port 5004 if no port is specified.
9299 <var>options</var> is a <code>&</code>-separated list. The following options
9302 <dl compact="compact">
9303 <dt> ‘<samp>announce_addr=<var>address</var></samp>’</dt>
9304 <dd><p>Specify the destination IP address for sending the announcements to.
9305 If omitted, the announcements are sent to the commonly used SAP
9306 announcement multicast address 224.2.127.254 (sap.mcast.net), or
9307 ff0e::2:7ffe if <var>destination</var> is an IPv6 address.
9310 <dt> ‘<samp>announce_port=<var>port</var></samp>’</dt>
9311 <dd><p>Specify the port to send the announcements on, defaults to
9312 9875 if not specified.
9315 <dt> ‘<samp>ttl=<var>ttl</var></samp>’</dt>
9316 <dd><p>Specify the time to live value for the announcements and RTP packets,
9320 <dt> ‘<samp>same_port=<var>0|1</var></samp>’</dt>
9321 <dd><p>If set to 1, send all RTP streams on the same port pair. If zero (the
9322 default), all streams are sent on unique ports, with each stream on a
9323 port 2 numbers higher than the previous.
9324 VLC/Live555 requires this to be set to 1, to be able to receive the stream.
9325 The RTP stack in libavformat for receiving requires all streams to be sent
9330 <p>Example command lines follow.
9332 <p>To broadcast a stream on the local subnet, for watching in VLC:
9334 <table><tr><td> </td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255?same_port=1
9335 </pre></td></tr></table>
9337 <p>Similarly, for watching in <code>ffplay</code>:
9339 <table><tr><td> </td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255
9340 </pre></td></tr></table>
9342 <p>And for watching in <code>ffplay</code>, over IPv6:
9344 <table><tr><td> </td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://[ff0e::1:2:3:4]
9345 </pre></td></tr></table>
9347 <a name="Demuxer"></a>
9348 <h3 class="subsection"><a href="ffplay-all.html#toc-Demuxer">20.25.2 Demuxer</a></h3>
9350 <p>The syntax for a SAP url given to the demuxer is:
9351 </p><table><tr><td> </td><td><pre class="example">sap://[<var>address</var>][:<var>port</var>]
9352 </pre></td></tr></table>
9354 <p><var>address</var> is the multicast address to listen for announcements on,
9355 if omitted, the default 224.2.127.254 (sap.mcast.net) is used. <var>port</var>
9356 is the port that is listened on, 9875 if omitted.
9358 <p>The demuxers listens for announcements on the given address and port.
9359 Once an announcement is received, it tries to receive that particular stream.
9361 <p>Example command lines follow.
9363 <p>To play back the first stream announced on the normal SAP multicast address:
9365 <table><tr><td> </td><td><pre class="example">ffplay sap://
9366 </pre></td></tr></table>
9368 <p>To play back the first stream announced on one the default IPv6 SAP multicast address:
9370 <table><tr><td> </td><td><pre class="example">ffplay sap://[ff0e::2:7ffe]
9371 </pre></td></tr></table>
9374 <h2 class="section"><a href="ffplay-all.html#toc-sctp">20.26 sctp</a></h2>
9376 <p>Stream Control Transmission Protocol.
9378 <p>The accepted URL syntax is:
9379 </p><table><tr><td> </td><td><pre class="example">sctp://<var>host</var>:<var>port</var>[?<var>options</var>]
9380 </pre></td></tr></table>
9382 <p>The protocol accepts the following options:
9383 </p><dl compact="compact">
9384 <dt> ‘<samp>listen</samp>’</dt>
9385 <dd><p>If set to any value, listen for an incoming connection. Outgoing connection is done by default.
9388 <dt> ‘<samp>max_streams</samp>’</dt>
9389 <dd><p>Set the maximum number of streams. By default no limit is set.
9394 <h2 class="section"><a href="ffplay-all.html#toc-srtp">20.27 srtp</a></h2>
9396 <p>Secure Real-time Transport Protocol.
9398 <p>The accepted options are:
9399 </p><dl compact="compact">
9400 <dt> ‘<samp>srtp_in_suite</samp>’</dt>
9401 <dt> ‘<samp>srtp_out_suite</samp>’</dt>
9402 <dd><p>Select input and output encoding suites.
9404 <p>Supported values:
9405 </p><dl compact="compact">
9406 <dt> ‘<samp>AES_CM_128_HMAC_SHA1_80</samp>’</dt>
9407 <dt> ‘<samp>SRTP_AES128_CM_HMAC_SHA1_80</samp>’</dt>
9408 <dt> ‘<samp>AES_CM_128_HMAC_SHA1_32</samp>’</dt>
9409 <dt> ‘<samp>SRTP_AES128_CM_HMAC_SHA1_32</samp>’</dt>
9413 <dt> ‘<samp>srtp_in_params</samp>’</dt>
9414 <dt> ‘<samp>srtp_out_params</samp>’</dt>
9415 <dd><p>Set input and output encoding parameters, which are expressed by a
9416 base64-encoded representation of a binary block. The first 16 bytes of
9417 this binary block are used as master key, the following 14 bytes are
9418 used as master salt.
9423 <h2 class="section"><a href="ffplay-all.html#toc-tcp">20.28 tcp</a></h2>
9425 <p>Trasmission Control Protocol.
9427 <p>The required syntax for a TCP url is:
9428 </p><table><tr><td> </td><td><pre class="example">tcp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
9429 </pre></td></tr></table>
9431 <dl compact="compact">
9432 <dt> ‘<samp>listen</samp>’</dt>
9433 <dd><p>Listen for an incoming connection
9436 <dt> ‘<samp>timeout=<var>microseconds</var></samp>’</dt>
9437 <dd><p>In read mode: if no data arrived in more than this time interval, raise error.
9438 In write mode: if socket cannot be written in more than this time interval, raise error.
9439 This also sets timeout on TCP connection establishing.
9441 <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
9442 ffplay tcp://<var>hostname</var>:<var>port</var>
9443 </pre></td></tr></table>
9449 <h2 class="section"><a href="ffplay-all.html#toc-tls">20.29 tls</a></h2>
9451 <p>Transport Layer Security (TLS) / Secure Sockets Layer (SSL)
9453 <p>The required syntax for a TLS/SSL url is:
9454 </p><table><tr><td> </td><td><pre class="example">tls://<var>hostname</var>:<var>port</var>[?<var>options</var>]
9455 </pre></td></tr></table>
9457 <p>The following parameters can be set via command line options
9458 (or in code via <code>AVOption</code>s):
9460 <dl compact="compact">
9461 <dt> ‘<samp>ca_file, cafile=<var>filename</var></samp>’</dt>
9462 <dd><p>A file containing certificate authority (CA) root certificates to treat
9463 as trusted. If the linked TLS library contains a default this might not
9464 need to be specified for verification to work, but not all libraries and
9465 setups have defaults built in.
9466 The file must be in OpenSSL PEM format.
9469 <dt> ‘<samp>tls_verify=<var>1|0</var></samp>’</dt>
9470 <dd><p>If enabled, try to verify the peer that we are communicating with.
9471 Note, if using OpenSSL, this currently only makes sure that the
9472 peer certificate is signed by one of the root certificates in the CA
9473 database, but it does not validate that the certificate actually
9474 matches the host name we are trying to connect to. (With GnuTLS,
9475 the host name is validated as well.)
9477 <p>This is disabled by default since it requires a CA database to be
9478 provided by the caller in many cases.
9481 <dt> ‘<samp>cert_file, cert=<var>filename</var></samp>’</dt>
9482 <dd><p>A file containing a certificate to use in the handshake with the peer.
9483 (When operating as server, in listen mode, this is more often required
9484 by the peer, while client certificates only are mandated in certain
9488 <dt> ‘<samp>key_file, key=<var>filename</var></samp>’</dt>
9489 <dd><p>A file containing the private key for the certificate.
9492 <dt> ‘<samp>listen=<var>1|0</var></samp>’</dt>
9493 <dd><p>If enabled, listen for connections on the provided port, and assume
9494 the server role in the handshake instead of the client role.
9499 <p>Example command lines:
9501 <p>To create a TLS/SSL server that serves an input stream.
9503 <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>
9504 </pre></td></tr></table>
9506 <p>To play back a stream from the TLS/SSL server using <code>ffplay</code>:
9508 <table><tr><td> </td><td><pre class="example">ffplay tls://<var>hostname</var>:<var>port</var>
9509 </pre></td></tr></table>
9512 <h2 class="section"><a href="ffplay-all.html#toc-udp">20.30 udp</a></h2>
9514 <p>User Datagram Protocol.
9516 <p>The required syntax for a UDP url is:
9517 </p><table><tr><td> </td><td><pre class="example">udp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
9518 </pre></td></tr></table>
9520 <p><var>options</var> contains a list of &-separated options of the form <var>key</var>=<var>val</var>.
9522 <p>In case threading is enabled on the system, a circular buffer is used
9523 to store the incoming data, which allows to reduce loss of data due to
9524 UDP socket buffer overruns. The <var>fifo_size</var> and
9525 <var>overrun_nonfatal</var> options are related to this buffer.
9527 <p>The list of supported options follows.
9529 <dl compact="compact">
9530 <dt> ‘<samp>buffer_size=<var>size</var></samp>’</dt>
9531 <dd><p>Set the UDP socket buffer size in bytes. This is used both for the
9532 receiving and the sending buffer size.
9535 <dt> ‘<samp>localport=<var>port</var></samp>’</dt>
9536 <dd><p>Override the local UDP port to bind with.
9539 <dt> ‘<samp>localaddr=<var>addr</var></samp>’</dt>
9540 <dd><p>Choose the local IP address. This is useful e.g. if sending multicast
9541 and the host has multiple interfaces, where the user can choose
9542 which interface to send on by specifying the IP address of that interface.
9545 <dt> ‘<samp>pkt_size=<var>size</var></samp>’</dt>
9546 <dd><p>Set the size in bytes of UDP packets.
9549 <dt> ‘<samp>reuse=<var>1|0</var></samp>’</dt>
9550 <dd><p>Explicitly allow or disallow reusing UDP sockets.
9553 <dt> ‘<samp>ttl=<var>ttl</var></samp>’</dt>
9554 <dd><p>Set the time to live value (for multicast only).
9557 <dt> ‘<samp>connect=<var>1|0</var></samp>’</dt>
9558 <dd><p>Initialize the UDP socket with <code>connect()</code>. In this case, the
9559 destination address can’t be changed with ff_udp_set_remote_url later.
9560 If the destination address isn’t known at the start, this option can
9561 be specified in ff_udp_set_remote_url, too.
9562 This allows finding out the source address for the packets with getsockname,
9563 and makes writes return with AVERROR(ECONNREFUSED) if "destination
9564 unreachable" is received.
9565 For receiving, this gives the benefit of only receiving packets from
9566 the specified peer address/port.
9569 <dt> ‘<samp>sources=<var>address</var>[,<var>address</var>]</samp>’</dt>
9570 <dd><p>Only receive packets sent to the multicast group from one of the
9571 specified sender IP addresses.
9574 <dt> ‘<samp>block=<var>address</var>[,<var>address</var>]</samp>’</dt>
9575 <dd><p>Ignore packets sent to the multicast group from the specified
9576 sender IP addresses.
9579 <dt> ‘<samp>fifo_size=<var>units</var></samp>’</dt>
9580 <dd><p>Set the UDP receiving circular buffer size, expressed as a number of
9581 packets with size of 188 bytes. If not specified defaults to 7*4096.
9584 <dt> ‘<samp>overrun_nonfatal=<var>1|0</var></samp>’</dt>
9585 <dd><p>Survive in case of UDP receiving circular buffer overrun. Default
9589 <dt> ‘<samp>timeout=<var>microseconds</var></samp>’</dt>
9590 <dd><p>In read mode: if no data arrived in more than this time interval, raise error.
9594 <p>Some usage examples of the UDP protocol with <code>ffmpeg</code> follow.
9596 <p>To stream over UDP to a remote endpoint:
9597 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> udp://<var>hostname</var>:<var>port</var>
9598 </pre></td></tr></table>
9600 <p>To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer:
9601 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i <var>input</var> -f mpegts udp://<var>hostname</var>:<var>port</var>?pkt_size=188&buffer_size=65535
9602 </pre></td></tr></table>
9604 <p>To receive over UDP from a remote endpoint:
9605 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i udp://[<var>multicast-address</var>]:<var>port</var>
9606 </pre></td></tr></table>
9609 <h2 class="section"><a href="ffplay-all.html#toc-unix">20.31 unix</a></h2>
9611 <p>Unix local socket
9613 <p>The required syntax for a Unix socket URL is:
9615 <table><tr><td> </td><td><pre class="example">unix://<var>filepath</var>
9616 </pre></td></tr></table>
9618 <p>The following parameters can be set via command line options
9619 (or in code via <code>AVOption</code>s):
9621 <dl compact="compact">
9622 <dt> ‘<samp>timeout</samp>’</dt>
9623 <dd><p>Timeout in ms.
9625 <dt> ‘<samp>listen</samp>’</dt>
9626 <dd><p>Create the Unix socket in listening mode.
9630 <a name="Device-Options"></a>
9631 <h1 class="chapter"><a href="ffplay-all.html#toc-Device-Options">21. Device Options</a></h1>
9633 <p>The libavdevice library provides the same interface as
9634 libavformat. Namely, an input device is considered like a demuxer, and
9635 an output device like a muxer, and the interface and generic device
9636 options are the same provided by libavformat (see the ffmpeg-formats
9639 <p>In addition each input or output device may support so-called private
9640 options, which are specific for that component.
9642 <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
9643 FFmpeg tools, or by setting the value explicitly in the device
9644 <code>AVFormatContext</code> options or using the ‘<tt>libavutil/opt.h</tt>’ API
9645 for programmatic use.
9648 <a name="Input-Devices"></a>
9649 <h1 class="chapter"><a href="ffplay-all.html#toc-Input-Devices">22. Input Devices</a></h1>
9651 <p>Input devices are configured elements in FFmpeg which allow to access
9652 the data coming from a multimedia device attached to your system.
9654 <p>When you configure your FFmpeg build, all the supported input devices
9655 are enabled by default. You can list all available ones using the
9656 configure option "–list-indevs".
9658 <p>You can disable all the input devices using the configure option
9659 "–disable-indevs", and selectively enable an input device using the
9660 option "–enable-indev=<var>INDEV</var>", or you can disable a particular
9661 input device using the option "–disable-indev=<var>INDEV</var>".
9663 <p>The option "-formats" of the ff* tools will display the list of
9664 supported input devices (amongst the demuxers).
9666 <p>A description of the currently available input devices follows.
9668 <a name="alsa-1"></a>
9669 <h2 class="section"><a href="ffplay-all.html#toc-alsa-1">22.1 alsa</a></h2>
9671 <p>ALSA (Advanced Linux Sound Architecture) input device.
9673 <p>To enable this input device during configuration you need libasound
9674 installed on your system.
9676 <p>This device allows capturing from an ALSA device. The name of the
9677 device to capture has to be an ALSA card identifier.
9679 <p>An ALSA identifier has the syntax:
9680 </p><table><tr><td> </td><td><pre class="example">hw:<var>CARD</var>[,<var>DEV</var>[,<var>SUBDEV</var>]]
9681 </pre></td></tr></table>
9683 <p>where the <var>DEV</var> and <var>SUBDEV</var> components are optional.
9685 <p>The three arguments (in order: <var>CARD</var>,<var>DEV</var>,<var>SUBDEV</var>)
9686 specify card number or identifier, device number and subdevice number
9689 <p>To see the list of cards currently recognized by your system check the
9690 files ‘<tt>/proc/asound/cards</tt>’ and ‘<tt>/proc/asound/devices</tt>’.
9692 <p>For example to capture with <code>ffmpeg</code> from an ALSA device with
9693 card id 0, you may run the command:
9694 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f alsa -i hw:0 alsaout.wav
9695 </pre></td></tr></table>
9697 <p>For more information see:
9698 <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>
9701 <h2 class="section"><a href="ffplay-all.html#toc-bktr">22.2 bktr</a></h2>
9703 <p>BSD video input device.
9705 <a name="dshow"></a>
9706 <h2 class="section"><a href="ffplay-all.html#toc-dshow">22.3 dshow</a></h2>
9708 <p>Windows DirectShow input device.
9710 <p>DirectShow support is enabled when FFmpeg is built with the mingw-w64 project.
9711 Currently only audio and video devices are supported.
9713 <p>Multiple devices may be opened as separate inputs, but they may also be
9714 opened on the same input, which should improve synchronism between them.
9716 <p>The input name should be in the format:
9718 <table><tr><td> </td><td><pre class="example"><var>TYPE</var>=<var>NAME</var>[:<var>TYPE</var>=<var>NAME</var>]
9719 </pre></td></tr></table>
9721 <p>where <var>TYPE</var> can be either <var>audio</var> or <var>video</var>,
9722 and <var>NAME</var> is the device’s name.
9724 <a name="Options-18"></a>
9725 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-18">22.3.1 Options</a></h3>
9727 <p>If no options are specified, the device’s defaults are used.
9728 If the device does not support the requested options, it will
9731 <dl compact="compact">
9732 <dt> ‘<samp>video_size</samp>’</dt>
9733 <dd><p>Set the video size in the captured video.
9736 <dt> ‘<samp>framerate</samp>’</dt>
9737 <dd><p>Set the frame rate in the captured video.
9740 <dt> ‘<samp>sample_rate</samp>’</dt>
9741 <dd><p>Set the sample rate (in Hz) of the captured audio.
9744 <dt> ‘<samp>sample_size</samp>’</dt>
9745 <dd><p>Set the sample size (in bits) of the captured audio.
9748 <dt> ‘<samp>channels</samp>’</dt>
9749 <dd><p>Set the number of channels in the captured audio.
9752 <dt> ‘<samp>list_devices</samp>’</dt>
9753 <dd><p>If set to ‘<samp>true</samp>’, print a list of devices and exit.
9756 <dt> ‘<samp>list_options</samp>’</dt>
9757 <dd><p>If set to ‘<samp>true</samp>’, print a list of selected device’s options
9761 <dt> ‘<samp>video_device_number</samp>’</dt>
9762 <dd><p>Set video device number for devices with same name (starts at 0,
9766 <dt> ‘<samp>audio_device_number</samp>’</dt>
9767 <dd><p>Set audio device number for devices with same name (starts at 0,
9771 <dt> ‘<samp>pixel_format</samp>’</dt>
9772 <dd><p>Select pixel format to be used by DirectShow. This may only be set when
9773 the video codec is not set or set to rawvideo.
9776 <dt> ‘<samp>audio_buffer_size</samp>’</dt>
9777 <dd><p>Set audio device buffer size in milliseconds (which can directly
9778 impact latency, depending on the device).
9779 Defaults to using the audio device’s
9780 default buffer size (typically some multiple of 500ms).
9781 Setting this value too low can degrade performance.
9783 <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>
9788 <a name="Examples-71"></a>
9789 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-71">22.3.2 Examples</a></h3>
9793 Print the list of DirectShow supported devices and exit:
9794 <table><tr><td> </td><td><pre class="example">$ ffmpeg -list_devices true -f dshow -i dummy
9795 </pre></td></tr></table>
9798 Open video device <var>Camera</var>:
9799 <table><tr><td> </td><td><pre class="example">$ ffmpeg -f dshow -i video="Camera"
9800 </pre></td></tr></table>
9803 Open second video device with name <var>Camera</var>:
9804 <table><tr><td> </td><td><pre class="example">$ ffmpeg -f dshow -video_device_number 1 -i video="Camera"
9805 </pre></td></tr></table>
9808 Open video device <var>Camera</var> and audio device <var>Microphone</var>:
9809 <table><tr><td> </td><td><pre class="example">$ ffmpeg -f dshow -i video="Camera":audio="Microphone"
9810 </pre></td></tr></table>
9813 Print the list of supported options in selected device and exit:
9814 <table><tr><td> </td><td><pre class="example">$ ffmpeg -list_options true -f dshow -i video="Camera"
9815 </pre></td></tr></table>
9819 <a name="dv1394"></a>
9820 <h2 class="section"><a href="ffplay-all.html#toc-dv1394">22.4 dv1394</a></h2>
9822 <p>Linux DV 1394 input device.
9824 <a name="fbdev-1"></a>
9825 <h2 class="section"><a href="ffplay-all.html#toc-fbdev-1">22.5 fbdev</a></h2>
9827 <p>Linux framebuffer input device.
9829 <p>The Linux framebuffer is a graphic hardware-independent abstraction
9830 layer to show graphics on a computer monitor, typically on the
9831 console. It is accessed through a file device node, usually
9832 ‘<tt>/dev/fb0</tt>’.
9834 <p>For more detailed information read the file
9835 Documentation/fb/framebuffer.txt included in the Linux source tree.
9837 <p>To record from the framebuffer device ‘<tt>/dev/fb0</tt>’ with
9838 <code>ffmpeg</code>:
9839 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
9840 </pre></td></tr></table>
9842 <p>You can take a single screenshot image with the command:
9843 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f fbdev -frames:v 1 -r 1 -i /dev/fb0 screenshot.jpeg
9844 </pre></td></tr></table>
9846 <p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
9848 <a name="iec61883"></a>
9849 <h2 class="section"><a href="ffplay-all.html#toc-iec61883">22.6 iec61883</a></h2>
9851 <p>FireWire DV/HDV input device using libiec61883.
9853 <p>To enable this input device, you need libiec61883, libraw1394 and
9854 libavc1394 installed on your system. Use the configure option
9855 <code>--enable-libiec61883</code> to compile with the device enabled.
9857 <p>The iec61883 capture device supports capturing from a video device
9858 connected via IEEE1394 (FireWire), using libiec61883 and the new Linux
9859 FireWire stack (juju). This is the default DV/HDV input method in Linux
9860 Kernel 2.6.37 and later, since the old FireWire stack was removed.
9862 <p>Specify the FireWire port to be used as input file, or "auto"
9863 to choose the first port connected.
9865 <a name="Options-5"></a>
9866 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-5">22.6.1 Options</a></h3>
9868 <dl compact="compact">
9869 <dt> ‘<samp>dvtype</samp>’</dt>
9870 <dd><p>Override autodetection of DV/HDV. This should only be used if auto
9871 detection does not work, or if usage of a different device type
9872 should be prohibited. Treating a DV device as HDV (or vice versa) will
9873 not work and result in undefined behavior.
9874 The values ‘<samp>auto</samp>’, ‘<samp>dv</samp>’ and ‘<samp>hdv</samp>’ are supported.
9877 <dt> ‘<samp>dvbuffer</samp>’</dt>
9878 <dd><p>Set maxiumum size of buffer for incoming data, in frames. For DV, this
9879 is an exact value. For HDV, it is not frame exact, since HDV does
9880 not have a fixed frame size.
9883 <dt> ‘<samp>dvguid</samp>’</dt>
9884 <dd><p>Select the capture device by specifying it’s GUID. Capturing will only
9885 be performed from the specified device and fails if no device with the
9886 given GUID is found. This is useful to select the input if multiple
9887 devices are connected at the same time.
9888 Look at /sys/bus/firewire/devices to find out the GUIDs.
9893 <a name="Examples-37"></a>
9894 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-37">22.6.2 Examples</a></h3>
9898 Grab and show the input of a FireWire DV/HDV device.
9899 <table><tr><td> </td><td><pre class="example">ffplay -f iec61883 -i auto
9900 </pre></td></tr></table>
9903 Grab and record the input of a FireWire DV/HDV device,
9904 using a packet buffer of 100000 packets if the source is HDV.
9905 <table><tr><td> </td><td><pre class="example">ffmpeg -f iec61883 -i auto -hdvbuffer 100000 out.mpg
9906 </pre></td></tr></table>
9911 <h2 class="section"><a href="ffplay-all.html#toc-jack">22.7 jack</a></h2>
9913 <p>JACK input device.
9915 <p>To enable this input device during configuration you need libjack
9916 installed on your system.
9918 <p>A JACK input device creates one or more JACK writable clients, one for
9919 each audio channel, with name <var>client_name</var>:input_<var>N</var>, where
9920 <var>client_name</var> is the name provided by the application, and <var>N</var>
9921 is a number which identifies the channel.
9922 Each writable client will send the acquired data to the FFmpeg input
9925 <p>Once you have created one or more JACK readable clients, you need to
9926 connect them to one or more JACK writable clients.
9928 <p>To connect or disconnect JACK clients you can use the <code>jack_connect</code>
9929 and <code>jack_disconnect</code> programs, or do it through a graphical interface,
9930 for example with <code>qjackctl</code>.
9932 <p>To list the JACK clients and their properties you can invoke the command
9933 <code>jack_lsp</code>.
9935 <p>Follows an example which shows how to capture a JACK readable client
9936 with <code>ffmpeg</code>.
9937 </p><table><tr><td> </td><td><pre class="example"># Create a JACK writable client with name "ffmpeg".
9938 $ ffmpeg -f jack -i ffmpeg -y out.wav
9940 # Start the sample jack_metro readable client.
9941 $ jack_metro -b 120 -d 0.2 -f 4000
9943 # List the current JACK clients.
9952 # Connect metro to the ffmpeg writable client.
9953 $ jack_connect metro:120_bpm ffmpeg:input_1
9954 </pre></td></tr></table>
9956 <p>For more information read:
9957 <a href="http://jackaudio.org/">http://jackaudio.org/</a>
9959 <a name="lavfi"></a>
9960 <h2 class="section"><a href="ffplay-all.html#toc-lavfi">22.8 lavfi</a></h2>
9962 <p>Libavfilter input virtual device.
9964 <p>This input device reads data from the open output pads of a libavfilter
9967 <p>For each filtergraph open output, the input device will create a
9968 corresponding stream which is mapped to the generated output. Currently
9969 only video data is supported. The filtergraph is specified through the
9970 option ‘<samp>graph</samp>’.
9972 <a name="Options-31"></a>
9973 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-31">22.8.1 Options</a></h3>
9975 <dl compact="compact">
9976 <dt> ‘<samp>graph</samp>’</dt>
9977 <dd><p>Specify the filtergraph to use as input. Each video open output must be
9978 labelled by a unique string of the form "out<var>N</var>", where <var>N</var> is a
9979 number starting from 0 corresponding to the mapped input stream
9980 generated by the device.
9981 The first unlabelled output is automatically assigned to the "out0"
9982 label, but all the others need to be specified explicitly.
9984 <p>If not specified defaults to the filename specified for the input
9988 <dt> ‘<samp>graph_file</samp>’</dt>
9989 <dd><p>Set the filename of the filtergraph to be read and sent to the other
9990 filters. Syntax of the filtergraph is the same as the one specified by
9991 the option <var>graph</var>.
9996 <a name="Examples-87"></a>
9997 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-87">22.8.2 Examples</a></h3>
10001 Create a color video stream and play it back with <code>ffplay</code>:
10002 <table><tr><td> </td><td><pre class="example">ffplay -f lavfi -graph "color=c=pink [out0]" dummy
10003 </pre></td></tr></table>
10006 As the previous example, but use filename for specifying the graph
10007 description, and omit the "out0" label:
10008 <table><tr><td> </td><td><pre class="example">ffplay -f lavfi color=c=pink
10009 </pre></td></tr></table>
10012 Create three different video test filtered sources and play them:
10013 <table><tr><td> </td><td><pre class="example">ffplay -f lavfi -graph "testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]" test3
10014 </pre></td></tr></table>
10017 Read an audio stream from a file using the amovie source and play it
10018 back with <code>ffplay</code>:
10019 <table><tr><td> </td><td><pre class="example">ffplay -f lavfi "amovie=test.wav"
10020 </pre></td></tr></table>
10023 Read an audio stream and a video stream and play it back with
10024 <code>ffplay</code>:
10025 <table><tr><td> </td><td><pre class="example">ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
10026 </pre></td></tr></table>
10030 <a name="libdc1394"></a>
10031 <h2 class="section"><a href="ffplay-all.html#toc-libdc1394">22.9 libdc1394</a></h2>
10033 <p>IIDC1394 input device, based on libdc1394 and libraw1394.
10035 <a name="openal"></a>
10036 <h2 class="section"><a href="ffplay-all.html#toc-openal">22.10 openal</a></h2>
10038 <p>The OpenAL input device provides audio capture on all systems with a
10039 working OpenAL 1.1 implementation.
10041 <p>To enable this input device during configuration, you need OpenAL
10042 headers and libraries installed on your system, and need to configure
10043 FFmpeg with <code>--enable-openal</code>.
10045 <p>OpenAL headers and libraries should be provided as part of your OpenAL
10046 implementation, or as an additional download (an SDK). Depending on your
10047 installation you may need to specify additional flags via the
10048 <code>--extra-cflags</code> and <code>--extra-ldflags</code> for allowing the build
10049 system to locate the OpenAL headers and libraries.
10051 <p>An incomplete list of OpenAL implementations follows:
10053 <dl compact="compact">
10054 <dt> <strong>Creative</strong></dt>
10055 <dd><p>The official Windows implementation, providing hardware acceleration
10056 with supported devices and software fallback.
10057 See <a href="http://openal.org/">http://openal.org/</a>.
10059 <dt> <strong>OpenAL Soft</strong></dt>
10060 <dd><p>Portable, open source (LGPL) software implementation. Includes
10061 backends for the most common sound APIs on the Windows, Linux,
10062 Solaris, and BSD operating systems.
10063 See <a href="http://kcat.strangesoft.net/openal.html">http://kcat.strangesoft.net/openal.html</a>.
10065 <dt> <strong>Apple</strong></dt>
10066 <dd><p>OpenAL is part of Core Audio, the official Mac OS X Audio interface.
10067 See <a href="http://developer.apple.com/technologies/mac/audio-and-video.html">http://developer.apple.com/technologies/mac/audio-and-video.html</a>
10071 <p>This device allows to capture from an audio input device handled
10074 <p>You need to specify the name of the device to capture in the provided
10075 filename. If the empty string is provided, the device will
10076 automatically select the default device. You can get the list of the
10077 supported devices by using the option <var>list_devices</var>.
10079 <a name="Options-26"></a>
10080 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-26">22.10.1 Options</a></h3>
10082 <dl compact="compact">
10083 <dt> ‘<samp>channels</samp>’</dt>
10084 <dd><p>Set the number of channels in the captured audio. Only the values
10085 ‘<samp>1</samp>’ (monaural) and ‘<samp>2</samp>’ (stereo) are currently supported.
10086 Defaults to ‘<samp>2</samp>’.
10089 <dt> ‘<samp>sample_size</samp>’</dt>
10090 <dd><p>Set the sample size (in bits) of the captured audio. Only the values
10091 ‘<samp>8</samp>’ and ‘<samp>16</samp>’ are currently supported. Defaults to
10092 ‘<samp>16</samp>’.
10095 <dt> ‘<samp>sample_rate</samp>’</dt>
10096 <dd><p>Set the sample rate (in Hz) of the captured audio.
10097 Defaults to ‘<samp>44.1k</samp>’.
10100 <dt> ‘<samp>list_devices</samp>’</dt>
10101 <dd><p>If set to ‘<samp>true</samp>’, print a list of devices and exit.
10102 Defaults to ‘<samp>false</samp>’.
10107 <a name="Examples-74"></a>
10108 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-74">22.10.2 Examples</a></h3>
10110 <p>Print the list of OpenAL supported devices and exit:
10111 </p><table><tr><td> </td><td><pre class="example">$ ffmpeg -list_devices true -f openal -i dummy out.ogg
10112 </pre></td></tr></table>
10114 <p>Capture from the OpenAL device ‘<tt>DR-BT101 via PulseAudio</tt>’:
10115 </p><table><tr><td> </td><td><pre class="example">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
10116 </pre></td></tr></table>
10118 <p>Capture from the default device (note the empty string ” as filename):
10119 </p><table><tr><td> </td><td><pre class="example">$ ffmpeg -f openal -i '' out.ogg
10120 </pre></td></tr></table>
10122 <p>Capture from two devices simultaneously, writing to two different files,
10123 within the same <code>ffmpeg</code> command:
10124 </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
10125 </pre></td></tr></table>
10126 <p>Note: not all OpenAL implementations support multiple simultaneous capture -
10127 try the latest OpenAL Soft if the above does not work.
10130 <h2 class="section"><a href="ffplay-all.html#toc-oss">22.11 oss</a></h2>
10132 <p>Open Sound System input device.
10134 <p>The filename to provide to the input device is the device node
10135 representing the OSS input device, and is usually set to
10136 ‘<tt>/dev/dsp</tt>’.
10138 <p>For example to grab from ‘<tt>/dev/dsp</tt>’ using <code>ffmpeg</code> use the
10140 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
10141 </pre></td></tr></table>
10143 <p>For more information about OSS see:
10144 <a href="http://manuals.opensound.com/usersguide/dsp.html">http://manuals.opensound.com/usersguide/dsp.html</a>
10146 <a name="pulse-1"></a>
10147 <h2 class="section"><a href="ffplay-all.html#toc-pulse-1">22.12 pulse</a></h2>
10149 <p>PulseAudio input device.
10151 <p>To enable this output device you need to configure FFmpeg with <code>--enable-libpulse</code>.
10153 <p>The filename to provide to the input device is a source device or the
10154 string "default"
10156 <p>To list the PulseAudio source devices and their properties you can invoke
10157 the command <code>pactl list sources</code>.
10159 <p>More information about PulseAudio can be found on <a href="http://www.pulseaudio.org">http://www.pulseaudio.org</a>.
10161 <a name="Options-30"></a>
10162 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-30">22.12.1 Options</a></h3>
10163 <dl compact="compact">
10164 <dt> ‘<samp>server</samp>’</dt>
10165 <dd><p>Connect to a specific PulseAudio server, specified by an IP address.
10166 Default server is used when not provided.
10169 <dt> ‘<samp>name</samp>’</dt>
10170 <dd><p>Specify the application name PulseAudio will use when showing active clients,
10171 by default it is the <code>LIBAVFORMAT_IDENT</code> string.
10174 <dt> ‘<samp>stream_name</samp>’</dt>
10175 <dd><p>Specify the stream name PulseAudio will use when showing active streams,
10176 by default it is "record".
10179 <dt> ‘<samp>sample_rate</samp>’</dt>
10180 <dd><p>Specify the samplerate in Hz, by default 48kHz is used.
10183 <dt> ‘<samp>channels</samp>’</dt>
10184 <dd><p>Specify the channels in use, by default 2 (stereo) is set.
10187 <dt> ‘<samp>frame_size</samp>’</dt>
10188 <dd><p>Specify the number of bytes per frame, by default it is set to 1024.
10191 <dt> ‘<samp>fragment_size</samp>’</dt>
10192 <dd><p>Specify the minimal buffering fragment in PulseAudio, it will affect the
10193 audio latency. By default it is unset.
10197 <a name="Examples-49"></a>
10198 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-49">22.12.2 Examples</a></h3>
10199 <p>Record a stream from default device:
10200 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f pulse -i default /tmp/pulse.wav
10201 </pre></td></tr></table>
10203 <a name="sndio-1"></a>
10204 <h2 class="section"><a href="ffplay-all.html#toc-sndio-1">22.13 sndio</a></h2>
10206 <p>sndio input device.
10208 <p>To enable this input device during configuration you need libsndio
10209 installed on your system.
10211 <p>The filename to provide to the input device is the device node
10212 representing the sndio input device, and is usually set to
10213 ‘<tt>/dev/audio0</tt>’.
10215 <p>For example to grab from ‘<tt>/dev/audio0</tt>’ using <code>ffmpeg</code> use the
10217 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
10218 </pre></td></tr></table>
10220 <a name="video4linux2_002c-v4l2"></a>
10221 <h2 class="section"><a href="ffplay-all.html#toc-video4linux2_002c-v4l2">22.14 video4linux2, v4l2</a></h2>
10223 <p>Video4Linux2 input video device.
10225 <p>"v4l2" can be used as alias for "video4linux2".
10227 <p>If FFmpeg is built with v4l-utils support (by using the
10228 <code>--enable-libv4l2</code> configure option), it is possible to use it with the
10229 <code>-use_libv4l2</code> input device option.
10231 <p>The name of the device to grab is a file device node, usually Linux
10232 systems tend to automatically create such nodes when the device
10233 (e.g. an USB webcam) is plugged into the system, and has a name of the
10234 kind ‘<tt>/dev/video<var>N</var></tt>’, where <var>N</var> is a number associated to
10237 <p>Video4Linux2 devices usually support a limited set of
10238 <var>width</var>x<var>height</var> sizes and frame rates. You can check which are
10239 supported using <code>-list_formats all</code> for Video4Linux2 devices.
10240 Some devices, like TV cards, support one or more standards. It is possible
10241 to list all the supported standards using <code>-list_standards all</code>.
10243 <p>The time base for the timestamps is 1 microsecond. Depending on the kernel
10244 version and configuration, the timestamps may be derived from the real time
10245 clock (origin at the Unix Epoch) or the monotonic clock (origin usually at
10246 boot time, unaffected by NTP or manual changes to the clock). The
10247 ‘<samp>-timestamps abs</samp>’ or ‘<samp>-ts abs</samp>’ option can be used to force
10248 conversion into the real time clock.
10250 <p>Some usage examples of the video4linux2 device with <code>ffmpeg</code>
10251 and <code>ffplay</code>:
10254 Grab and show the input of a video4linux2 device:
10255 <table><tr><td> </td><td><pre class="example">ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
10256 </pre></td></tr></table>
10259 Grab and record the input of a video4linux2 device, leave the
10260 frame rate and size as previously set:
10261 <table><tr><td> </td><td><pre class="example">ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
10262 </pre></td></tr></table>
10265 <p>For more information about Video4Linux, check <a href="http://linuxtv.org/">http://linuxtv.org/</a>.
10267 <a name="Options-2"></a>
10268 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-2">22.14.1 Options</a></h3>
10270 <dl compact="compact">
10271 <dt> ‘<samp>standard</samp>’</dt>
10272 <dd><p>Set the standard. Must be the name of a supported standard. To get a
10273 list of the supported standards, use the ‘<samp>list_standards</samp>’
10277 <dt> ‘<samp>channel</samp>’</dt>
10278 <dd><p>Set the input channel number. Default to -1, which means using the
10279 previously selected channel.
10282 <dt> ‘<samp>video_size</samp>’</dt>
10283 <dd><p>Set the video frame size. The argument must be a string in the form
10284 <var>WIDTH</var>x<var>HEIGHT</var> or a valid size abbreviation.
10287 <dt> ‘<samp>pixel_format</samp>’</dt>
10288 <dd><p>Select the pixel format (only valid for raw video input).
10291 <dt> ‘<samp>input_format</samp>’</dt>
10292 <dd><p>Set the preferred pixel format (for raw video) or a codec name.
10293 This option allows to select the input format, when several are
10297 <dt> ‘<samp>framerate</samp>’</dt>
10298 <dd><p>Set the preferred video frame rate.
10301 <dt> ‘<samp>list_formats</samp>’</dt>
10302 <dd><p>List available formats (supported pixel formats, codecs, and frame
10305 <p>Available values are:
10306 </p><dl compact="compact">
10307 <dt> ‘<samp>all</samp>’</dt>
10308 <dd><p>Show all available (compressed and non-compressed) formats.
10311 <dt> ‘<samp>raw</samp>’</dt>
10312 <dd><p>Show only raw video (non-compressed) formats.
10315 <dt> ‘<samp>compressed</samp>’</dt>
10316 <dd><p>Show only compressed formats.
10321 <dt> ‘<samp>list_standards</samp>’</dt>
10322 <dd><p>List supported standards and exit.
10324 <p>Available values are:
10325 </p><dl compact="compact">
10326 <dt> ‘<samp>all</samp>’</dt>
10327 <dd><p>Show all supported standards.
10332 <dt> ‘<samp>timestamps, ts</samp>’</dt>
10333 <dd><p>Set type of timestamps for grabbed frames.
10335 <p>Available values are:
10336 </p><dl compact="compact">
10337 <dt> ‘<samp>default</samp>’</dt>
10338 <dd><p>Use timestamps from the kernel.
10341 <dt> ‘<samp>abs</samp>’</dt>
10342 <dd><p>Use absolute timestamps (wall clock).
10345 <dt> ‘<samp>mono2abs</samp>’</dt>
10346 <dd><p>Force conversion from monotonic to absolute timestamps.
10350 <p>Default value is <code>default</code>.
10354 <a name="vfwcap"></a>
10355 <h2 class="section"><a href="ffplay-all.html#toc-vfwcap">22.15 vfwcap</a></h2>
10357 <p>VfW (Video for Windows) capture input device.
10359 <p>The filename passed as input is the capture driver number, ranging from
10360 0 to 9. You may use "list" as filename to print a list of drivers. Any
10361 other filename will be interpreted as device number 0.
10363 <a name="x11grab"></a>
10364 <h2 class="section"><a href="ffplay-all.html#toc-x11grab">22.16 x11grab</a></h2>
10366 <p>X11 video input device.
10368 <p>This device allows to capture a region of an X11 display.
10370 <p>The filename passed as input has the syntax:
10371 </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>]
10372 </pre></td></tr></table>
10374 <p><var>hostname</var>:<var>display_number</var>.<var>screen_number</var> specifies the
10375 X11 display name of the screen to grab from. <var>hostname</var> can be
10376 omitted, and defaults to "localhost". The environment variable
10377 <code>DISPLAY</code> contains the default display name.
10379 <p><var>x_offset</var> and <var>y_offset</var> specify the offsets of the grabbed
10380 area with respect to the top-left border of the X11 screen. They
10383 <p>Check the X11 documentation (e.g. man X) for more detailed information.
10385 <p>Use the <code>dpyinfo</code> program for getting basic information about the
10386 properties of your X11 display (e.g. grep for "name" or "dimensions").
10388 <p>For example to grab from ‘<tt>:0.0</tt>’ using <code>ffmpeg</code>:
10389 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0 out.mpg
10390 </pre></td></tr></table>
10392 <p>Grab at position <code>10,20</code>:
10393 </p><table><tr><td> </td><td><pre class="example">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
10394 </pre></td></tr></table>
10396 <a name="Options-20"></a>
10397 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-20">22.16.1 Options</a></h3>
10399 <dl compact="compact">
10400 <dt> ‘<samp>draw_mouse</samp>’</dt>
10401 <dd><p>Specify whether to draw the mouse pointer. A value of <code>0</code> specify
10402 not to draw the pointer. Default value is <code>1</code>.
10405 <dt> ‘<samp>follow_mouse</samp>’</dt>
10406 <dd><p>Make the grabbed area follow the mouse. The argument can be
10407 <code>centered</code> or a number of pixels <var>PIXELS</var>.
10409 <p>When it is specified with "centered", the grabbing region follows the mouse
10410 pointer and keeps the pointer at the center of region; otherwise, the region
10411 follows only when the mouse pointer reaches within <var>PIXELS</var> (greater than
10412 zero) to the edge of region.
10415 </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
10416 </pre></td></tr></table>
10418 <p>To follow only when the mouse pointer reaches within 100 pixels to edge:
10419 </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
10420 </pre></td></tr></table>
10423 <dt> ‘<samp>framerate</samp>’</dt>
10424 <dd><p>Set the grabbing frame rate. Default value is <code>ntsc</code>,
10425 corresponding to a frame rate of <code>30000/1001</code>.
10428 <dt> ‘<samp>show_region</samp>’</dt>
10429 <dd><p>Show grabbed region on screen.
10431 <p>If <var>show_region</var> is specified with <code>1</code>, then the grabbing
10432 region will be indicated on screen. With this option, it is easy to
10433 know what is being grabbed if only a portion of the screen is grabbed.
10436 </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
10437 </pre></td></tr></table>
10439 <p>With <var>follow_mouse</var>:
10440 </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
10441 </pre></td></tr></table>
10444 <dt> ‘<samp>video_size</samp>’</dt>
10445 <dd><p>Set the video frame size. Default value is <code>vga</code>.
10449 <a name="Output-Devices"></a>
10450 <h1 class="chapter"><a href="ffplay-all.html#toc-Output-Devices">23. Output Devices</a></h1>
10452 <p>Output devices are configured elements in FFmpeg that can write
10453 multimedia data to an output device attached to your system.
10455 <p>When you configure your FFmpeg build, all the supported output devices
10456 are enabled by default. You can list all available ones using the
10457 configure option "–list-outdevs".
10459 <p>You can disable all the output devices using the configure option
10460 "–disable-outdevs", and selectively enable an output device using the
10461 option "–enable-outdev=<var>OUTDEV</var>", or you can disable a particular
10462 input device using the option "–disable-outdev=<var>OUTDEV</var>".
10464 <p>The option "-formats" of the ff* tools will display the list of
10465 enabled output devices (amongst the muxers).
10467 <p>A description of the currently available output devices follows.
10469 <a name="alsa"></a>
10470 <h2 class="section"><a href="ffplay-all.html#toc-alsa">23.1 alsa</a></h2>
10472 <p>ALSA (Advanced Linux Sound Architecture) output device.
10474 <a name="Examples-33"></a>
10475 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-33">23.1.1 Examples</a></h3>
10479 Play a file on default ALSA device:
10480 <table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -f alsa default
10481 </pre></td></tr></table>
10484 Play a file on soundcard 1, audio device 7:
10485 <table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -f alsa hw:1,7
10486 </pre></td></tr></table>
10489 <a name="caca"></a>
10490 <h2 class="section"><a href="ffplay-all.html#toc-caca">23.2 caca</a></h2>
10492 <p>CACA output device.
10494 <p>This output device allows to show a video stream in CACA window.
10495 Only one CACA window is allowed per application, so you can
10496 have only one instance of this output device in an application.
10498 <p>To enable this output device you need to configure FFmpeg with
10499 <code>--enable-libcaca</code>.
10500 libcaca is a graphics library that outputs text instead of pixels.
10502 <p>For more information about libcaca, check:
10503 <a href="http://caca.zoy.org/wiki/libcaca">http://caca.zoy.org/wiki/libcaca</a>
10505 <a name="Options-4"></a>
10506 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-4">23.2.1 Options</a></h3>
10508 <dl compact="compact">
10509 <dt> ‘<samp>window_title</samp>’</dt>
10510 <dd><p>Set the CACA window title, if not specified default to the filename
10511 specified for the output device.
10514 <dt> ‘<samp>window_size</samp>’</dt>
10515 <dd><p>Set the CACA window size, can be a string of the form
10516 <var>width</var>x<var>height</var> or a video size abbreviation.
10517 If not specified it defaults to the size of the input video.
10520 <dt> ‘<samp>driver</samp>’</dt>
10521 <dd><p>Set display driver.
10524 <dt> ‘<samp>algorithm</samp>’</dt>
10525 <dd><p>Set dithering algorithm. Dithering is necessary
10526 because the picture being rendered has usually far more colours than
10527 the available palette.
10528 The accepted values are listed with <code>-list_dither algorithms</code>.
10531 <dt> ‘<samp>antialias</samp>’</dt>
10532 <dd><p>Set antialias method. Antialiasing smoothens the rendered
10533 image and avoids the commonly seen staircase effect.
10534 The accepted values are listed with <code>-list_dither antialiases</code>.
10537 <dt> ‘<samp>charset</samp>’</dt>
10538 <dd><p>Set which characters are going to be used when rendering text.
10539 The accepted values are listed with <code>-list_dither charsets</code>.
10542 <dt> ‘<samp>color</samp>’</dt>
10543 <dd><p>Set color to be used when rendering text.
10544 The accepted values are listed with <code>-list_dither colors</code>.
10547 <dt> ‘<samp>list_drivers</samp>’</dt>
10548 <dd><p>If set to ‘<samp>true</samp>’, print a list of available drivers and exit.
10551 <dt> ‘<samp>list_dither</samp>’</dt>
10552 <dd><p>List available dither options related to the argument.
10553 The argument must be one of <code>algorithms</code>, <code>antialiases</code>,
10554 <code>charsets</code>, <code>colors</code>.
10558 <a name="Examples-56"></a>
10559 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-56">23.2.2 Examples</a></h3>
10563 The following command shows the <code>ffmpeg</code> output is an
10564 CACA window, forcing its size to 80x25:
10565 <table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -vcodec rawvideo -pix_fmt rgb24 -window_size 80x25 -f caca -
10566 </pre></td></tr></table>
10569 Show the list of available drivers and exit:
10570 <table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_drivers true -
10571 </pre></td></tr></table>
10574 Show the list of available dither colors and exit:
10575 <table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_dither colors -
10576 </pre></td></tr></table>
10579 <a name="fbdev"></a>
10580 <h2 class="section"><a href="ffplay-all.html#toc-fbdev">23.3 fbdev</a></h2>
10582 <p>Linux framebuffer output device.
10584 <p>The Linux framebuffer is a graphic hardware-independent abstraction
10585 layer to show graphics on a computer monitor, typically on the
10586 console. It is accessed through a file device node, usually
10587 ‘<tt>/dev/fb0</tt>’.
10589 <p>For more detailed information read the file
10590 ‘<tt>Documentation/fb/framebuffer.txt</tt>’ included in the Linux source tree.
10592 <a name="Options-15"></a>
10593 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-15">23.3.1 Options</a></h3>
10594 <dl compact="compact">
10595 <dt> ‘<samp>xoffset</samp>’</dt>
10596 <dt> ‘<samp>yoffset</samp>’</dt>
10597 <dd><p>Set x/y coordinate of top left corner. Default is 0.
10601 <a name="Examples-66"></a>
10602 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-66">23.3.2 Examples</a></h3>
10603 <p>Play a file on framebuffer device ‘<tt>/dev/fb0</tt>’.
10604 Required pixel format depends on current framebuffer settings.
10605 </p><table><tr><td> </td><td><pre class="example">ffmpeg -re -i INPUT -vcodec rawvideo -pix_fmt bgra -f fbdev /dev/fb0
10606 </pre></td></tr></table>
10608 <p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
10610 <a name="oss-1"></a>
10611 <h2 class="section"><a href="ffplay-all.html#toc-oss-1">23.4 oss</a></h2>
10613 <p>OSS (Open Sound System) output device.
10615 <a name="pulse"></a>
10616 <h2 class="section"><a href="ffplay-all.html#toc-pulse">23.5 pulse</a></h2>
10618 <p>PulseAudio output device.
10620 <p>To enable this output device you need to configure FFmpeg with <code>--enable-libpulse</code>.
10622 <p>More information about PulseAudio can be found on <a href="http://www.pulseaudio.org">http://www.pulseaudio.org</a>
10624 <a name="Options-6"></a>
10625 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-6">23.5.1 Options</a></h3>
10626 <dl compact="compact">
10627 <dt> ‘<samp>server</samp>’</dt>
10628 <dd><p>Connect to a specific PulseAudio server, specified by an IP address.
10629 Default server is used when not provided.
10632 <dt> ‘<samp>name</samp>’</dt>
10633 <dd><p>Specify the application name PulseAudio will use when showing active clients,
10634 by default it is the <code>LIBAVFORMAT_IDENT</code> string.
10637 <dt> ‘<samp>stream_name</samp>’</dt>
10638 <dd><p>Specify the stream name PulseAudio will use when showing active streams,
10639 by default it is set to the specified output name.
10642 <dt> ‘<samp>device</samp>’</dt>
10643 <dd><p>Specify the device to use. Default device is used when not provided.
10644 List of output devices can be obtained with command <code>pactl list sinks</code>.
10647 <dt> ‘<samp>buffer_size</samp>’</dt>
10648 <dt> ‘<samp>buffer_duration</samp>’</dt>
10649 <dd><p>Control the size and duration of the PulseAudio buffer. A small buffer
10650 gives more control, but requires more frequent updates.
10652 <p>‘<samp>buffer_size</samp>’ specifies size in bytes while
10653 ‘<samp>buffer_duration</samp>’ specifies duration in milliseconds.
10655 <p>When both options are provided then the highest value is used
10656 (duration is recalculated to bytes using stream parameters). If they
10657 are set to 0 (which is default), the device will use the default
10658 PulseAudio duration value. By default PulseAudio set buffer duration
10659 to around 2 seconds.
10663 <a name="Examples-23"></a>
10664 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-23">23.5.2 Examples</a></h3>
10665 <p>Play a file on default device on default server:
10666 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -f pulse "stream name"
10667 </pre></td></tr></table>
10670 <h2 class="section"><a href="ffplay-all.html#toc-sdl">23.6 sdl</a></h2>
10672 <p>SDL (Simple DirectMedia Layer) output device.
10674 <p>This output device allows to show a video stream in an SDL
10675 window. Only one SDL window is allowed per application, so you can
10676 have only one instance of this output device in an application.
10678 <p>To enable this output device you need libsdl installed on your system
10679 when configuring your build.
10681 <p>For more information about SDL, check:
10682 <a href="http://www.libsdl.org/">http://www.libsdl.org/</a>
10684 <a name="Options-12"></a>
10685 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-12">23.6.1 Options</a></h3>
10687 <dl compact="compact">
10688 <dt> ‘<samp>window_title</samp>’</dt>
10689 <dd><p>Set the SDL window title, if not specified default to the filename
10690 specified for the output device.
10693 <dt> ‘<samp>icon_title</samp>’</dt>
10694 <dd><p>Set the name of the iconified SDL window, if not specified it is set
10695 to the same value of <var>window_title</var>.
10698 <dt> ‘<samp>window_size</samp>’</dt>
10699 <dd><p>Set the SDL window size, can be a string of the form
10700 <var>width</var>x<var>height</var> or a video size abbreviation.
10701 If not specified it defaults to the size of the input video,
10702 downscaled according to the aspect ratio.
10705 <dt> ‘<samp>window_fullscreen</samp>’</dt>
10706 <dd><p>Set fullscreen mode when non-zero value is provided.
10707 Default value is zero.
10711 <a name="Interactive-commands"></a>
10712 <h3 class="subsection"><a href="ffplay-all.html#toc-Interactive-commands">23.6.2 Interactive commands</a></h3>
10714 <p>The window created by the device can be controlled through the
10715 following interactive commands.
10717 <dl compact="compact">
10718 <dt> <q, ESC></dt>
10719 <dd><p>Quit the device immediately.
10723 <a name="Examples-82"></a>
10724 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-82">23.6.3 Examples</a></h3>
10726 <p>The following command shows the <code>ffmpeg</code> output is an
10727 SDL window, forcing its size to the qcif format:
10728 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -vcodec rawvideo -pix_fmt yuv420p -window_size qcif -f sdl "SDL output"
10729 </pre></td></tr></table>
10731 <a name="sndio"></a>
10732 <h2 class="section"><a href="ffplay-all.html#toc-sndio">23.7 sndio</a></h2>
10734 <p>sndio audio output device.
10737 <h2 class="section"><a href="ffplay-all.html#toc-xv">23.8 xv</a></h2>
10739 <p>XV (XVideo) output device.
10741 <p>This output device allows to show a video stream in a X Window System
10744 <a name="Options-3"></a>
10745 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-3">23.8.1 Options</a></h3>
10747 <dl compact="compact">
10748 <dt> ‘<samp>display_name</samp>’</dt>
10749 <dd><p>Specify the hardware display name, which determines the display and
10750 communications domain to be used.
10752 <p>The display name or DISPLAY environment variable can be a string in
10753 the format <var>hostname</var>[:<var>number</var>[.<var>screen_number</var>]].
10755 <p><var>hostname</var> specifies the name of the host machine on which the
10756 display is physically attached. <var>number</var> specifies the number of
10757 the display server on that host machine. <var>screen_number</var> specifies
10758 the screen to be used on that server.
10760 <p>If unspecified, it defaults to the value of the DISPLAY environment
10763 <p>For example, <code>dual-headed:0.1</code> would specify screen 1 of display
10764 0 on the machine named “dual-headed”.
10766 <p>Check the X11 specification for more detailed information about the
10767 display name format.
10770 <dt> ‘<samp>window_size</samp>’</dt>
10771 <dd><p>Set the created window size, can be a string of the form
10772 <var>width</var>x<var>height</var> or a video size abbreviation. If not
10773 specified it defaults to the size of the input video.
10776 <dt> ‘<samp>window_x</samp>’</dt>
10777 <dt> ‘<samp>window_y</samp>’</dt>
10778 <dd><p>Set the X and Y window offsets for the created window. They are both
10779 set to 0 by default. The values may be ignored by the window manager.
10782 <dt> ‘<samp>window_title</samp>’</dt>
10783 <dd><p>Set the window title, if not specified default to the filename
10784 specified for the output device.
10788 <p>For more information about XVideo see <a href="http://www.x.org/">http://www.x.org/</a>.
10790 <a name="Examples-48"></a>
10791 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-48">23.8.2 Examples</a></h3>
10795 Decode, display and encode video input with <code>ffmpeg</code> at the
10797 <table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT OUTPUT -f xv display
10798 </pre></td></tr></table>
10801 Decode and display the input video to multiple X11 windows:
10802 <table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -f xv normal -vf negate -f xv negated
10803 </pre></td></tr></table>
10806 <a name="Resampler-Options"></a>
10807 <h1 class="chapter"><a href="ffplay-all.html#toc-Resampler-Options">24. Resampler Options</a></h1>
10809 <p>The audio resampler supports the following named options.
10811 <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
10812 FFmpeg tools, <var>option</var>=<var>value</var> for the aresample filter,
10813 by setting the value explicitly in the
10814 <code>SwrContext</code> options or using the ‘<tt>libavutil/opt.h</tt>’ API for
10817 <dl compact="compact">
10818 <dt> ‘<samp>ich, in_channel_count</samp>’</dt>
10819 <dd><p>Set the number of input channels. Default value is 0. Setting this
10820 value is not mandatory if the corresponding channel layout
10821 ‘<samp>in_channel_layout</samp>’ is set.
10824 <dt> ‘<samp>och, out_channel_count</samp>’</dt>
10825 <dd><p>Set the number of output channels. Default value is 0. Setting this
10826 value is not mandatory if the corresponding channel layout
10827 ‘<samp>out_channel_layout</samp>’ is set.
10830 <dt> ‘<samp>uch, used_channel_count</samp>’</dt>
10831 <dd><p>Set the number of used input channels. Default value is 0. This option is
10832 only used for special remapping.
10835 <dt> ‘<samp>isr, in_sample_rate</samp>’</dt>
10836 <dd><p>Set the input sample rate. Default value is 0.
10839 <dt> ‘<samp>osr, out_sample_rate</samp>’</dt>
10840 <dd><p>Set the output sample rate. Default value is 0.
10843 <dt> ‘<samp>isf, in_sample_fmt</samp>’</dt>
10844 <dd><p>Specify the input sample format. It is set by default to <code>none</code>.
10847 <dt> ‘<samp>osf, out_sample_fmt</samp>’</dt>
10848 <dd><p>Specify the output sample format. It is set by default to <code>none</code>.
10851 <dt> ‘<samp>tsf, internal_sample_fmt</samp>’</dt>
10852 <dd><p>Set the internal sample format. Default value is <code>none</code>.
10853 This will automatically be chosen when it is not explicitly set.
10856 <dt> ‘<samp>icl, in_channel_layout</samp>’</dt>
10857 <dt> ‘<samp>ocl, out_channel_layout</samp>’</dt>
10858 <dd><p>Set the input/output channel layout.
10860 <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)channel layout syntax</a>
10861 for the required syntax.
10864 <dt> ‘<samp>clev, center_mix_level</samp>’</dt>
10865 <dd><p>Set the center mix level. It is a value expressed in deciBel, and must be
10866 in the interval [-32,32].
10869 <dt> ‘<samp>slev, surround_mix_level</samp>’</dt>
10870 <dd><p>Set the surround mix level. It is a value expressed in deciBel, and must
10871 be in the interval [-32,32].
10874 <dt> ‘<samp>lfe_mix_level</samp>’</dt>
10875 <dd><p>Set LFE mix into non LFE level. It is used when there is a LFE input but no
10876 LFE output. It is a value expressed in deciBel, and must
10877 be in the interval [-32,32].
10880 <dt> ‘<samp>rmvol, rematrix_volume</samp>’</dt>
10881 <dd><p>Set rematrix volume. Default value is 1.0.
10884 <dt> ‘<samp>rematrix_maxval</samp>’</dt>
10885 <dd><p>Set maximum output value for rematrixing.
10886 This can be used to prevent clipping vs. preventing volumn reduction
10887 A value of 1.0 prevents cliping.
10890 <dt> ‘<samp>flags, swr_flags</samp>’</dt>
10891 <dd><p>Set flags used by the converter. Default value is 0.
10893 <p>It supports the following individual flags:
10894 </p><dl compact="compact">
10895 <dt> ‘<samp>res</samp>’</dt>
10896 <dd><p>force resampling, this flag forces resampling to be used even when the
10897 input and output sample rates match.
10902 <dt> ‘<samp>dither_scale</samp>’</dt>
10903 <dd><p>Set the dither scale. Default value is 1.
10906 <dt> ‘<samp>dither_method</samp>’</dt>
10907 <dd><p>Set dither method. Default value is 0.
10909 <p>Supported values:
10910 </p><dl compact="compact">
10911 <dt> ‘<samp>rectangular</samp>’</dt>
10912 <dd><p>select rectangular dither
10914 <dt> ‘<samp>triangular</samp>’</dt>
10915 <dd><p>select triangular dither
10917 <dt> ‘<samp>triangular_hp</samp>’</dt>
10918 <dd><p>select triangular dither with high pass
10920 <dt> ‘<samp>lipshitz</samp>’</dt>
10921 <dd><p>select lipshitz noise shaping dither
10923 <dt> ‘<samp>shibata</samp>’</dt>
10924 <dd><p>select shibata noise shaping dither
10926 <dt> ‘<samp>low_shibata</samp>’</dt>
10927 <dd><p>select low shibata noise shaping dither
10929 <dt> ‘<samp>high_shibata</samp>’</dt>
10930 <dd><p>select high shibata noise shaping dither
10932 <dt> ‘<samp>f_weighted</samp>’</dt>
10933 <dd><p>select f-weighted noise shaping dither
10935 <dt> ‘<samp>modified_e_weighted</samp>’</dt>
10936 <dd><p>select modified-e-weighted noise shaping dither
10938 <dt> ‘<samp>improved_e_weighted</samp>’</dt>
10939 <dd><p>select improved-e-weighted noise shaping dither
10945 <dt> ‘<samp>resampler</samp>’</dt>
10946 <dd><p>Set resampling engine. Default value is swr.
10948 <p>Supported values:
10949 </p><dl compact="compact">
10950 <dt> ‘<samp>swr</samp>’</dt>
10951 <dd><p>select the native SW Resampler; filter options precision and cheby are not
10952 applicable in this case.
10954 <dt> ‘<samp>soxr</samp>’</dt>
10955 <dd><p>select the SoX Resampler (where available); compensation, and filter options
10956 filter_size, phase_shift, filter_type & kaiser_beta, are not applicable in this
10962 <dt> ‘<samp>filter_size</samp>’</dt>
10963 <dd><p>For swr only, set resampling filter size, default value is 32.
10966 <dt> ‘<samp>phase_shift</samp>’</dt>
10967 <dd><p>For swr only, set resampling phase shift, default value is 10, and must be in
10968 the interval [0,30].
10971 <dt> ‘<samp>linear_interp</samp>’</dt>
10972 <dd><p>Use Linear Interpolation if set to 1, default value is 0.
10975 <dt> ‘<samp>cutoff</samp>’</dt>
10976 <dd><p>Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
10977 value between 0 and 1. Default value is 0.97 with swr, and 0.91 with soxr
10978 (which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
10981 <dt> ‘<samp>precision</samp>’</dt>
10982 <dd><p>For soxr only, the precision in bits to which the resampled signal will be
10983 calculated. The default value of 20 (which, with suitable dithering, is
10984 appropriate for a destination bit-depth of 16) gives SoX’s ’High Quality’; a
10985 value of 28 gives SoX’s ’Very High Quality’.
10988 <dt> ‘<samp>cheby</samp>’</dt>
10989 <dd><p>For soxr only, selects passband rolloff none (Chebyshev) & higher-precision
10990 approximation for ’irrational’ ratios. Default value is 0.
10993 <dt> ‘<samp>async</samp>’</dt>
10994 <dd><p>For swr only, simple 1 parameter audio sync to timestamps using stretching,
10995 squeezing, filling and trimming. Setting this to 1 will enable filling and
10996 trimming, larger values represent the maximum amount in samples that the data
10997 may be stretched or squeezed for each second.
10998 Default value is 0, thus no compensation is applied to make the samples match
10999 the audio timestamps.
11002 <dt> ‘<samp>first_pts</samp>’</dt>
11003 <dd><p>For swr only, assume the first pts should be this value. The time unit is 1 / sample rate.
11004 This allows for padding/trimming at the start of stream. By default, no
11005 assumption is made about the first frame’s expected pts, so no padding or
11006 trimming is done. For example, this could be set to 0 to pad the beginning with
11007 silence if an audio stream starts after the video stream or to trim any samples
11008 with a negative pts due to encoder delay.
11011 <dt> ‘<samp>min_comp</samp>’</dt>
11012 <dd><p>For swr only, set the minimum difference between timestamps and audio data (in
11013 seconds) to trigger stretching/squeezing/filling or trimming of the
11014 data to make it match the timestamps. The default is that
11015 stretching/squeezing/filling and trimming is disabled
11016 (‘<samp>min_comp</samp>’ = <code>FLT_MAX</code>).
11019 <dt> ‘<samp>min_hard_comp</samp>’</dt>
11020 <dd><p>For swr only, set the minimum difference between timestamps and audio data (in
11021 seconds) to trigger adding/dropping samples to make it match the
11022 timestamps. This option effectively is a threshold to select between
11023 hard (trim/fill) and soft (squeeze/stretch) compensation. Note that
11024 all compensation is by default disabled through ‘<samp>min_comp</samp>’.
11025 The default is 0.1.
11028 <dt> ‘<samp>comp_duration</samp>’</dt>
11029 <dd><p>For swr only, set duration (in seconds) over which data is stretched/squeezed
11030 to make it match the timestamps. Must be a non-negative double float value,
11031 default value is 1.0.
11034 <dt> ‘<samp>max_soft_comp</samp>’</dt>
11035 <dd><p>For swr only, set maximum factor by which data is stretched/squeezed to make it
11036 match the timestamps. Must be a non-negative double float value, default value
11040 <dt> ‘<samp>matrix_encoding</samp>’</dt>
11041 <dd><p>Select matrixed stereo encoding.
11043 <p>It accepts the following values:
11044 </p><dl compact="compact">
11045 <dt> ‘<samp>none</samp>’</dt>
11048 <dt> ‘<samp>dolby</samp>’</dt>
11049 <dd><p>select Dolby
11051 <dt> ‘<samp>dplii</samp>’</dt>
11052 <dd><p>select Dolby Pro Logic II
11056 <p>Default value is <code>none</code>.
11059 <dt> ‘<samp>filter_type</samp>’</dt>
11060 <dd><p>For swr only, select resampling filter type. This only affects resampling
11063 <p>It accepts the following values:
11064 </p><dl compact="compact">
11065 <dt> ‘<samp>cubic</samp>’</dt>
11066 <dd><p>select cubic
11068 <dt> ‘<samp>blackman_nuttall</samp>’</dt>
11069 <dd><p>select Blackman Nuttall Windowed Sinc
11071 <dt> ‘<samp>kaiser</samp>’</dt>
11072 <dd><p>select Kaiser Windowed Sinc
11077 <dt> ‘<samp>kaiser_beta</samp>’</dt>
11078 <dd><p>For swr only, set Kaiser Window Beta value. Must be an integer in the
11079 interval [2,16], default value is 9.
11082 <dt> ‘<samp>output_sample_bits</samp>’</dt>
11083 <dd><p>For swr only, set number of used output sample bits for dithering. Must be an integer in the
11084 interval [0,64], default value is 0, which means it’s not used.
11089 <p><a name="scaler_005foptions"></a>
11090 </p><a name="Scaler-Options"></a>
11091 <h1 class="chapter"><a href="ffplay-all.html#toc-Scaler-Options">25. Scaler Options</a></h1>
11093 <p>The video scaler supports the following named options.
11095 <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
11096 FFmpeg tools. For programmatic use, they can be set explicitly in the
11097 <code>SwsContext</code> options or through the ‘<tt>libavutil/opt.h</tt>’ API.
11099 <dl compact="compact">
11101 <p><a name="sws_005fflags"></a>
11103 <dt> ‘<samp>sws_flags</samp>’</dt>
11104 <dd><p>Set the scaler flags. This is also used to set the scaling
11105 algorithm. Only a single algorithm should be selected.
11107 <p>It accepts the following values:
11108 </p><dl compact="compact">
11109 <dt> ‘<samp>fast_bilinear</samp>’</dt>
11110 <dd><p>Select fast bilinear scaling algorithm.
11113 <dt> ‘<samp>bilinear</samp>’</dt>
11114 <dd><p>Select bilinear scaling algorithm.
11117 <dt> ‘<samp>bicubic</samp>’</dt>
11118 <dd><p>Select bicubic scaling algorithm.
11121 <dt> ‘<samp>experimental</samp>’</dt>
11122 <dd><p>Select experimental scaling algorithm.
11125 <dt> ‘<samp>neighbor</samp>’</dt>
11126 <dd><p>Select nearest neighbor rescaling algorithm.
11129 <dt> ‘<samp>area</samp>’</dt>
11130 <dd><p>Select averaging area rescaling algorithm.
11133 <dt> ‘<samp>bicubiclin</samp>’</dt>
11134 <dd><p>Select bicubic scaling algorithm for the luma component, bilinear for
11138 <dt> ‘<samp>gauss</samp>’</dt>
11139 <dd><p>Select Gaussian rescaling algorithm.
11142 <dt> ‘<samp>sinc</samp>’</dt>
11143 <dd><p>Select sinc rescaling algorithm.
11146 <dt> ‘<samp>lanczos</samp>’</dt>
11147 <dd><p>Select lanczos rescaling algorithm.
11150 <dt> ‘<samp>spline</samp>’</dt>
11151 <dd><p>Select natural bicubic spline rescaling algorithm.
11154 <dt> ‘<samp>print_info</samp>’</dt>
11155 <dd><p>Enable printing/debug logging.
11158 <dt> ‘<samp>accurate_rnd</samp>’</dt>
11159 <dd><p>Enable accurate rounding.
11162 <dt> ‘<samp>full_chroma_int</samp>’</dt>
11163 <dd><p>Enable full chroma interpolation.
11166 <dt> ‘<samp>full_chroma_inp</samp>’</dt>
11167 <dd><p>Select full chroma input.
11170 <dt> ‘<samp>bitexact</samp>’</dt>
11171 <dd><p>Enable bitexact output.
11176 <dt> ‘<samp>srcw</samp>’</dt>
11177 <dd><p>Set source width.
11180 <dt> ‘<samp>srch</samp>’</dt>
11181 <dd><p>Set source height.
11184 <dt> ‘<samp>dstw</samp>’</dt>
11185 <dd><p>Set destination width.
11188 <dt> ‘<samp>dsth</samp>’</dt>
11189 <dd><p>Set destination height.
11192 <dt> ‘<samp>src_format</samp>’</dt>
11193 <dd><p>Set source pixel format (must be expressed as an integer).
11196 <dt> ‘<samp>dst_format</samp>’</dt>
11197 <dd><p>Set destination pixel format (must be expressed as an integer).
11200 <dt> ‘<samp>src_range</samp>’</dt>
11201 <dd><p>Select source range.
11204 <dt> ‘<samp>dst_range</samp>’</dt>
11205 <dd><p>Select destination range.
11208 <dt> ‘<samp>param0, param1</samp>’</dt>
11209 <dd><p>Set scaling algorithm parameters. The specified values are specific of
11210 some scaling algorithms and ignored by others. The specified values
11211 are floating point number values.
11214 <dt> ‘<samp>sws_dither</samp>’</dt>
11215 <dd><p>Set the dithering algorithm. Accepts one of the following
11216 values. Default value is ‘<samp>auto</samp>’.
11218 <dl compact="compact">
11219 <dt> ‘<samp>auto</samp>’</dt>
11220 <dd><p>automatic choice
11223 <dt> ‘<samp>none</samp>’</dt>
11224 <dd><p>no dithering
11227 <dt> ‘<samp>bayer</samp>’</dt>
11228 <dd><p>bayer dither
11231 <dt> ‘<samp>ed</samp>’</dt>
11232 <dd><p>error diffusion dither
11239 <a name="Filtering-Introduction"></a>
11240 <h1 class="chapter"><a href="ffplay-all.html#toc-Filtering-Introduction">26. Filtering Introduction</a></h1>
11242 <p>Filtering in FFmpeg is enabled through the libavfilter library.
11244 <p>In libavfilter, a filter can have multiple inputs and multiple
11246 To illustrate the sorts of things that are possible, we consider the
11247 following filtergraph.
11249 <table><tr><td> </td><td><pre class="example"> [main]
11250 input --> split ---------------------> overlay --> output
11253 +-----> crop --> vflip -------+
11254 </pre></td></tr></table>
11256 <p>This filtergraph splits the input stream in two streams, sends one
11257 stream through the crop filter and the vflip filter before merging it
11258 back with the other stream by overlaying it on top. You can use the
11259 following command to achieve this:
11261 <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
11262 </pre></td></tr></table>
11264 <p>The result will be that in output the top half of the video is mirrored
11265 onto the bottom half.
11267 <p>Filters in the same linear chain are separated by commas, and distinct
11268 linear chains of filters are separated by semicolons. In our example,
11269 <var>crop,vflip</var> are in one linear chain, <var>split</var> and
11270 <var>overlay</var> are separately in another. The points where the linear
11271 chains join are labelled by names enclosed in square brackets. In the
11272 example, the split filter generates two outputs that are associated to
11273 the labels <var>[main]</var> and <var>[tmp]</var>.
11275 <p>The stream sent to the second output of <var>split</var>, labelled as
11276 <var>[tmp]</var>, is processed through the <var>crop</var> filter, which crops
11277 away the lower half part of the video, and then vertically flipped. The
11278 <var>overlay</var> filter takes in input the first unchanged output of the
11279 split filter (which was labelled as <var>[main]</var>), and overlay on its
11280 lower half the output generated by the <var>crop,vflip</var> filterchain.
11282 <p>Some filters take in input a list of parameters: they are specified
11283 after the filter name and an equal sign, and are separated from each other
11286 <p>There exist so-called <var>source filters</var> that do not have an
11287 audio/video input, and <var>sink filters</var> that will not have audio/video
11291 <a name="graph2dot"></a>
11292 <h1 class="chapter"><a href="ffplay-all.html#toc-graph2dot">27. graph2dot</a></h1>
11294 <p>The ‘<tt>graph2dot</tt>’ program included in the FFmpeg ‘<tt>tools</tt>’
11295 directory can be used to parse a filtergraph description and issue a
11296 corresponding textual representation in the dot language.
11298 <p>Invoke the command:
11299 </p><table><tr><td> </td><td><pre class="example">graph2dot -h
11300 </pre></td></tr></table>
11302 <p>to see how to use ‘<tt>graph2dot</tt>’.
11304 <p>You can then pass the dot description to the ‘<tt>dot</tt>’ program (from
11305 the graphviz suite of programs) and obtain a graphical representation
11306 of the filtergraph.
11308 <p>For example the sequence of commands:
11309 </p><table><tr><td> </td><td><pre class="example">echo <var>GRAPH_DESCRIPTION</var> | \
11310 tools/graph2dot -o graph.tmp && \
11311 dot -Tpng graph.tmp -o graph.png && \
11313 </pre></td></tr></table>
11315 <p>can be used to create and display an image representing the graph
11316 described by the <var>GRAPH_DESCRIPTION</var> string. Note that this string must be
11317 a complete self-contained graph, with its inputs and outputs explicitly defined.
11318 For example if your command line is of the form:
11319 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i infile -vf scale=640:360 outfile
11320 </pre></td></tr></table>
11321 <p>your <var>GRAPH_DESCRIPTION</var> string will need to be of the form:
11322 </p><table><tr><td> </td><td><pre class="example">nullsrc,scale=640:360,nullsink
11323 </pre></td></tr></table>
11324 <p>you may also need to set the <var>nullsrc</var> parameters and add a <var>format</var>
11325 filter in order to simulate a specific input file.
11328 <a name="Filtergraph-description"></a>
11329 <h1 class="chapter"><a href="ffplay-all.html#toc-Filtergraph-description">28. Filtergraph description</a></h1>
11331 <p>A filtergraph is a directed graph of connected filters. It can contain
11332 cycles, and there can be multiple links between a pair of
11333 filters. Each link has one input pad on one side connecting it to one
11334 filter from which it takes its input, and one output pad on the other
11335 side connecting it to the one filter accepting its output.
11337 <p>Each filter in a filtergraph is an instance of a filter class
11338 registered in the application, which defines the features and the
11339 number of input and output pads of the filter.
11341 <p>A filter with no input pads is called a "source", a filter with no
11342 output pads is called a "sink".
11344 <p><a name="Filtergraph-syntax"></a>
11345 </p><a name="Filtergraph-syntax-1"></a>
11346 <h2 class="section"><a href="ffplay-all.html#toc-Filtergraph-syntax-1">28.1 Filtergraph syntax</a></h2>
11348 <p>A filtergraph can be represented using a textual representation, which is
11349 recognized by the ‘<samp>-filter</samp>’/‘<samp>-vf</samp>’ and ‘<samp>-filter_complex</samp>’
11350 options in <code>ffmpeg</code> and ‘<samp>-vf</samp>’ in <code>ffplay</code>, and by the
11351 <code>avfilter_graph_parse()</code>/<code>avfilter_graph_parse2()</code> function defined in
11352 ‘<tt>libavfilter/avfilter.h</tt>’.
11354 <p>A filterchain consists of a sequence of connected filters, each one
11355 connected to the previous one in the sequence. A filterchain is
11356 represented by a list of ","-separated filter descriptions.
11358 <p>A filtergraph consists of a sequence of filterchains. A sequence of
11359 filterchains is represented by a list of ";"-separated filterchain
11362 <p>A filter is represented by a string of the form:
11363 [<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>]
11365 <p><var>filter_name</var> is the name of the filter class of which the
11366 described filter is an instance of, and has to be the name of one of
11367 the filter classes registered in the program.
11368 The name of the filter class is optionally followed by a string
11369 "=<var>arguments</var>".
11371 <p><var>arguments</var> is a string which contains the parameters used to
11372 initialize the filter instance. It may have one of the following forms:
11375 A ’:’-separated list of <var>key=value</var> pairs.
11378 A ’:’-separated list of <var>value</var>. In this case, the keys are assumed to be
11379 the option names in the order they are declared. E.g. the <code>fade</code> filter
11380 declares three options in this order – ‘<samp>type</samp>’, ‘<samp>start_frame</samp>’ and
11381 ‘<samp>nb_frames</samp>’. Then the parameter list <var>in:0:30</var> means that the value
11382 <var>in</var> is assigned to the option ‘<samp>type</samp>’, <var>0</var> to
11383 ‘<samp>start_frame</samp>’ and <var>30</var> to ‘<samp>nb_frames</samp>’.
11386 A ’:’-separated list of mixed direct <var>value</var> and long <var>key=value</var>
11387 pairs. The direct <var>value</var> must precede the <var>key=value</var> pairs, and
11388 follow the same constraints order of the previous point. The following
11389 <var>key=value</var> pairs can be set in any preferred order.
11393 <p>If the option value itself is a list of items (e.g. the <code>format</code> filter
11394 takes a list of pixel formats), the items in the list are usually separated by
11397 <p>The list of arguments can be quoted using the character "’" as initial
11398 and ending mark, and the character ’\’ for escaping the characters
11399 within the quoted text; otherwise the argument string is considered
11400 terminated when the next special character (belonging to the set
11401 "[]=;,") is encountered.
11403 <p>The name and arguments of the filter are optionally preceded and
11404 followed by a list of link labels.
11405 A link label allows to name a link and associate it to a filter output
11406 or input pad. The preceding labels <var>in_link_1</var>
11407 ... <var>in_link_N</var>, are associated to the filter input pads,
11408 the following labels <var>out_link_1</var> ... <var>out_link_M</var>, are
11409 associated to the output pads.
11411 <p>When two link labels with the same name are found in the
11412 filtergraph, a link between the corresponding input and output pad is
11415 <p>If an output pad is not labelled, it is linked by default to the first
11416 unlabelled input pad of the next filter in the filterchain.
11417 For example in the filterchain:
11418 </p><table><tr><td> </td><td><pre class="example">nullsrc, split[L1], [L2]overlay, nullsink
11419 </pre></td></tr></table>
11420 <p>the split filter instance has two output pads, and the overlay filter
11421 instance two input pads. The first output pad of split is labelled
11422 "L1", the first input pad of overlay is labelled "L2", and the second
11423 output pad of split is linked to the second input pad of overlay,
11424 which are both unlabelled.
11426 <p>In a complete filterchain all the unlabelled filter input and output
11427 pads must be connected. A filtergraph is considered valid if all the
11428 filter input and output pads of all the filterchains are connected.
11430 <p>Libavfilter will automatically insert <a href="#scale">scale</a> filters where format
11431 conversion is required. It is possible to specify swscale flags
11432 for those automatically inserted scalers by prepending
11433 <code>sws_flags=<var>flags</var>;</code>
11434 to the filtergraph description.
11436 <p>Follows a BNF description for the filtergraph syntax:
11437 </p><table><tr><td> </td><td><pre class="example"><var>NAME</var> ::= sequence of alphanumeric characters and '_'
11438 <var>LINKLABEL</var> ::= "[" <var>NAME</var> "]"
11439 <var>LINKLABELS</var> ::= <var>LINKLABEL</var> [<var>LINKLABELS</var>]
11440 <var>FILTER_ARGUMENTS</var> ::= sequence of chars (eventually quoted)
11441 <var>FILTER</var> ::= [<var>LINKLABELS</var>] <var>NAME</var> ["=" <var>FILTER_ARGUMENTS</var>] [<var>LINKLABELS</var>]
11442 <var>FILTERCHAIN</var> ::= <var>FILTER</var> [,<var>FILTERCHAIN</var>]
11443 <var>FILTERGRAPH</var> ::= [sws_flags=<var>flags</var>;] <var>FILTERCHAIN</var> [;<var>FILTERGRAPH</var>]
11444 </pre></td></tr></table>
11446 <a name="Notes-on-filtergraph-escaping"></a>
11447 <h2 class="section"><a href="ffplay-all.html#toc-Notes-on-filtergraph-escaping">28.2 Notes on filtergraph escaping</a></h2>
11449 <p>Some filter arguments require the use of special characters, typically
11450 <code>:</code> to separate key=value pairs in a named options list. In this
11451 case the user should perform a first level escaping when specifying
11452 the filter arguments. For example, consider the following literal
11453 string to be embedded in the <a href="#drawtext">drawtext</a> filter arguments:
11454 </p><table><tr><td> </td><td><pre class="example">this is a 'string': may contain one, or more, special characters
11455 </pre></td></tr></table>
11457 <p>Since <code>:</code> is special for the filter arguments syntax, it needs to
11458 be escaped, so you get:
11459 </p><table><tr><td> </td><td><pre class="example">text=this is a \'string\'\: may contain one, or more, special characters
11460 </pre></td></tr></table>
11462 <p>A second level of escaping is required when embedding the filter
11463 arguments in a filtergraph description, in order to escape all the
11464 filtergraph special characters. Thus the example above becomes:
11465 </p><table><tr><td> </td><td><pre class="example">drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
11466 </pre></td></tr></table>
11468 <p>Finally an additional level of escaping may be needed when writing the
11469 filtergraph description in a shell command, which depends on the
11470 escaping rules of the adopted shell. For example, assuming that
11471 <code>\</code> is special and needs to be escaped with another <code>\</code>, the
11472 previous string will finally result in:
11473 </p><table><tr><td> </td><td><pre class="example">-vf "drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters"
11474 </pre></td></tr></table>
11476 <p>Sometimes, it might be more convenient to employ quoting in place of
11477 escaping. For example the string:
11478 </p><table><tr><td> </td><td><pre class="example">Caesar: tu quoque, Brute, fili mi
11479 </pre></td></tr></table>
11481 <p>Can be quoted in the filter arguments as:
11482 </p><table><tr><td> </td><td><pre class="example">text='Caesar: tu quoque, Brute, fili mi'
11483 </pre></td></tr></table>
11485 <p>And finally inserted in a filtergraph like:
11486 </p><table><tr><td> </td><td><pre class="example">drawtext=text=\'Caesar: tu quoque\, Brute\, fili mi\'
11487 </pre></td></tr></table>
11489 <p>See the “Quoting and escaping” section in the ffmpeg-utils manual
11490 for more information about the escaping and quoting rules adopted by
11493 <a name="Timeline-editing"></a>
11494 <h1 class="chapter"><a href="ffplay-all.html#toc-Timeline-editing">29. Timeline editing</a></h1>
11496 <p>Some filters support a generic ‘<samp>enable</samp>’ option. For the filters
11497 supporting timeline editing, this option can be set to an expression which is
11498 evaluated before sending a frame to the filter. If the evaluation is non-zero,
11499 the filter will be enabled, otherwise the frame will be sent unchanged to the
11500 next filter in the filtergraph.
11502 <p>The expression accepts the following values:
11503 </p><dl compact="compact">
11504 <dt> ‘<samp>t</samp>’</dt>
11505 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
11508 <dt> ‘<samp>n</samp>’</dt>
11509 <dd><p>sequential number of the input frame, starting from 0
11512 <dt> ‘<samp>pos</samp>’</dt>
11513 <dd><p>the position in the file of the input frame, NAN if unknown
11517 <p>Additionally, these filters support an ‘<samp>enable</samp>’ command that can be used
11518 to re-define the expression.
11520 <p>Like any other filtering option, the ‘<samp>enable</samp>’ option follows the same
11523 <p>For example, to enable a blur filter (<a href="#smartblur">smartblur</a>) from 10 seconds to 3
11524 minutes, and a <a href="#curves">curves</a> filter starting at 3 seconds:
11525 </p><table><tr><td> </td><td><pre class="example">smartblur = enable='between(t,10,3*60)',
11526 curves = enable='gte(t,3)' : preset=cross_process
11527 </pre></td></tr></table>
11530 <a name="Audio-Filters"></a>
11531 <h1 class="chapter"><a href="ffplay-all.html#toc-Audio-Filters">30. Audio Filters</a></h1>
11533 <p>When you configure your FFmpeg build, you can disable any of the
11534 existing filters using <code>--disable-filters</code>.
11535 The configure output will show the audio filters included in your
11538 <p>Below is a description of the currently available audio filters.
11540 <a name="aconvert"></a>
11541 <h2 class="section"><a href="ffplay-all.html#toc-aconvert">30.1 aconvert</a></h2>
11543 <p>Convert the input audio format to the specified formats.
11545 <p><em>This filter is deprecated. Use <a href="#aformat">aformat</a> instead.</em>
11547 <p>The filter accepts a string of the form:
11548 "<var>sample_format</var>:<var>channel_layout</var>".
11550 <p><var>sample_format</var> specifies the sample format, and can be a string or the
11551 corresponding numeric value defined in ‘<tt>libavutil/samplefmt.h</tt>’. Use ’p’
11552 suffix for a planar sample format.
11554 <p><var>channel_layout</var> specifies the channel layout, and can be a string
11555 or the corresponding number value defined in ‘<tt>libavutil/channel_layout.h</tt>’.
11557 <p>The special parameter "auto", signifies that the filter will
11558 automatically select the output format depending on the output filter.
11560 <a name="Examples-47"></a>
11561 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-47">30.1.1 Examples</a></h3>
11565 Convert input to float, planar, stereo:
11566 <table><tr><td> </td><td><pre class="example">aconvert=fltp:stereo
11567 </pre></td></tr></table>
11570 Convert input to unsigned 8-bit, automatically select out channel layout:
11571 <table><tr><td> </td><td><pre class="example">aconvert=u8:auto
11572 </pre></td></tr></table>
11575 <a name="adelay"></a>
11576 <h2 class="section"><a href="ffplay-all.html#toc-adelay">30.2 adelay</a></h2>
11578 <p>Delay one or more audio channels.
11580 <p>Samples in delayed channel are filled with silence.
11582 <p>The filter accepts the following option:
11584 <dl compact="compact">
11585 <dt> ‘<samp>delays</samp>’</dt>
11586 <dd><p>Set list of delays in milliseconds for each channel separated by ’|’.
11587 At least one delay greater than 0 should be provided.
11588 Unused delays will be silently ignored. If number of given delays is
11589 smaller than number of channels all remaining channels will not be delayed.
11593 <a name="Examples-41"></a>
11594 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-41">30.2.1 Examples</a></h3>
11598 Delay first channel by 1.5 seconds, the third channel by 0.5 seconds and leave
11599 the second channel (and any other channels that may be present) unchanged.
11600 <table><tr><td> </td><td><pre class="example">adelay=1500|0|500
11601 </pre></td></tr></table>
11604 <a name="aecho"></a>
11605 <h2 class="section"><a href="ffplay-all.html#toc-aecho">30.3 aecho</a></h2>
11607 <p>Apply echoing to the input audio.
11609 <p>Echoes are reflected sound and can occur naturally amongst mountains
11610 (and sometimes large buildings) when talking or shouting; digital echo
11611 effects emulate this behaviour and are often used to help fill out the
11612 sound of a single instrument or vocal. The time difference between the
11613 original signal and the reflection is the <code>delay</code>, and the
11614 loudness of the reflected signal is the <code>decay</code>.
11615 Multiple echoes can have different delays and decays.
11617 <p>A description of the accepted parameters follows.
11619 <dl compact="compact">
11620 <dt> ‘<samp>in_gain</samp>’</dt>
11621 <dd><p>Set input gain of reflected signal. Default is <code>0.6</code>.
11624 <dt> ‘<samp>out_gain</samp>’</dt>
11625 <dd><p>Set output gain of reflected signal. Default is <code>0.3</code>.
11628 <dt> ‘<samp>delays</samp>’</dt>
11629 <dd><p>Set list of time intervals in milliseconds between original signal and reflections
11630 separated by ’|’. Allowed range for each <code>delay</code> is <code>(0 - 90000.0]</code>.
11631 Default is <code>1000</code>.
11634 <dt> ‘<samp>decays</samp>’</dt>
11635 <dd><p>Set list of loudnesses of reflected signals separated by ’|’.
11636 Allowed range for each <code>decay</code> is <code>(0 - 1.0]</code>.
11637 Default is <code>0.5</code>.
11641 <a name="Examples-19"></a>
11642 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-19">30.3.1 Examples</a></h3>
11646 Make it sound as if there are twice as many instruments as are actually playing:
11647 <table><tr><td> </td><td><pre class="example">aecho=0.8:0.88:60:0.4
11648 </pre></td></tr></table>
11651 If delay is very short, then it sound like a (metallic) robot playing music:
11652 <table><tr><td> </td><td><pre class="example">aecho=0.8:0.88:6:0.4
11653 </pre></td></tr></table>
11656 A longer delay will sound like an open air concert in the mountains:
11657 <table><tr><td> </td><td><pre class="example">aecho=0.8:0.9:1000:0.3
11658 </pre></td></tr></table>
11661 Same as above but with one more mountain:
11662 <table><tr><td> </td><td><pre class="example">aecho=0.8:0.9:1000|1800:0.3|0.25
11663 </pre></td></tr></table>
11666 <a name="aeval"></a>
11667 <h2 class="section"><a href="ffplay-all.html#toc-aeval">30.4 aeval</a></h2>
11669 <p>Modify an audio signal according to the specified expressions.
11671 <p>This filter accepts one or more expressions (one for each channel),
11672 which are evaluated and used to modify a corresponding audio signal.
11674 <p>This filter accepts the following options:
11676 <dl compact="compact">
11677 <dt> ‘<samp>exprs</samp>’</dt>
11678 <dd><p>Set the ’|’-separated expressions list for each separate channel. If
11679 the number of input channels is greater than the number of
11680 expressions, the last specified expression is used for the remaining
11684 <dt> ‘<samp>channel_layout, c</samp>’</dt>
11685 <dd><p>Set output channel layout. If not specified, the channel layout is
11686 specified by the number of expressions. If set to ‘<samp>same</samp>’, it will
11687 use by default the same input channel layout.
11691 <p>Each expression in <var>exprs</var> can contain the following constants and functions:
11693 <dl compact="compact">
11694 <dt> ‘<samp>ch</samp>’</dt>
11695 <dd><p>channel number of the current expression
11698 <dt> ‘<samp>n</samp>’</dt>
11699 <dd><p>number of the evaluated sample, starting from 0
11702 <dt> ‘<samp>s</samp>’</dt>
11706 <dt> ‘<samp>t</samp>’</dt>
11707 <dd><p>time of the evaluated sample expressed in seconds
11710 <dt> ‘<samp>nb_in_channels</samp>’</dt>
11711 <dt> ‘<samp>nb_out_channels</samp>’</dt>
11712 <dd><p>input and output number of channels
11715 <dt> ‘<samp>val(CH)</samp>’</dt>
11716 <dd><p>the value of input channel with number <var>CH</var>
11720 <p>Note: this filter is slow. For faster processing you should use a
11723 <a name="Examples-34"></a>
11724 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-34">30.4.1 Examples</a></h3>
11729 <table><tr><td> </td><td><pre class="example">aeval=val(ch)/2:c=same
11730 </pre></td></tr></table>
11733 Invert phase of the second channel:
11734 <table><tr><td> </td><td><pre class="example">eval=val(0)|-val(1)
11735 </pre></td></tr></table>
11738 <a name="afade"></a>
11739 <h2 class="section"><a href="ffplay-all.html#toc-afade">30.5 afade</a></h2>
11741 <p>Apply fade-in/out effect to input audio.
11743 <p>A description of the accepted parameters follows.
11745 <dl compact="compact">
11746 <dt> ‘<samp>type, t</samp>’</dt>
11747 <dd><p>Specify the effect type, can be either <code>in</code> for fade-in, or
11748 <code>out</code> for a fade-out effect. Default is <code>in</code>.
11751 <dt> ‘<samp>start_sample, ss</samp>’</dt>
11752 <dd><p>Specify the number of the start sample for starting to apply the fade
11753 effect. Default is 0.
11756 <dt> ‘<samp>nb_samples, ns</samp>’</dt>
11757 <dd><p>Specify the number of samples for which the fade effect has to last. At
11758 the end of the fade-in effect the output audio will have the same
11759 volume as the input audio, at the end of the fade-out transition
11760 the output audio will be silence. Default is 44100.
11763 <dt> ‘<samp>start_time, st</samp>’</dt>
11764 <dd><p>Specify time for starting to apply the fade effect. Default is 0.
11765 The accepted syntax is:
11766 </p><table><tr><td> </td><td><pre class="example">[-]HH[:MM[:SS[.m...]]]
11768 </pre></td></tr></table>
11769 <p>See also the function <code>av_parse_time()</code>.
11770 If set this option is used instead of <var>start_sample</var> one.
11773 <dt> ‘<samp>duration, d</samp>’</dt>
11774 <dd><p>Specify the duration for which the fade effect has to last. Default is 0.
11775 The accepted syntax is:
11776 </p><table><tr><td> </td><td><pre class="example">[-]HH[:MM[:SS[.m...]]]
11778 </pre></td></tr></table>
11779 <p>See also the function <code>av_parse_time()</code>.
11780 At the end of the fade-in effect the output audio will have the same
11781 volume as the input audio, at the end of the fade-out transition
11782 the output audio will be silence.
11783 If set this option is used instead of <var>nb_samples</var> one.
11786 <dt> ‘<samp>curve</samp>’</dt>
11787 <dd><p>Set curve for fade transition.
11789 <p>It accepts the following values:
11790 </p><dl compact="compact">
11791 <dt> ‘<samp>tri</samp>’</dt>
11792 <dd><p>select triangular, linear slope (default)
11794 <dt> ‘<samp>qsin</samp>’</dt>
11795 <dd><p>select quarter of sine wave
11797 <dt> ‘<samp>hsin</samp>’</dt>
11798 <dd><p>select half of sine wave
11800 <dt> ‘<samp>esin</samp>’</dt>
11801 <dd><p>select exponential sine wave
11803 <dt> ‘<samp>log</samp>’</dt>
11804 <dd><p>select logarithmic
11806 <dt> ‘<samp>par</samp>’</dt>
11807 <dd><p>select inverted parabola
11809 <dt> ‘<samp>qua</samp>’</dt>
11810 <dd><p>select quadratic
11812 <dt> ‘<samp>cub</samp>’</dt>
11813 <dd><p>select cubic
11815 <dt> ‘<samp>squ</samp>’</dt>
11816 <dd><p>select square root
11818 <dt> ‘<samp>cbr</samp>’</dt>
11819 <dd><p>select cubic root
11825 <a name="Examples-24"></a>
11826 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-24">30.5.1 Examples</a></h3>
11830 Fade in first 15 seconds of audio:
11831 <table><tr><td> </td><td><pre class="example">afade=t=in:ss=0:d=15
11832 </pre></td></tr></table>
11835 Fade out last 25 seconds of a 900 seconds audio:
11836 <table><tr><td> </td><td><pre class="example">afade=t=out:st=875:d=25
11837 </pre></td></tr></table>
11840 <p><a name="aformat"></a>
11841 </p><a name="aformat-1"></a>
11842 <h2 class="section"><a href="ffplay-all.html#toc-aformat-1">30.6 aformat</a></h2>
11844 <p>Set output format constraints for the input audio. The framework will
11845 negotiate the most appropriate format to minimize conversions.
11847 <p>The filter accepts the following named parameters:
11848 </p><dl compact="compact">
11849 <dt> ‘<samp>sample_fmts</samp>’</dt>
11850 <dd><p>A ’|’-separated list of requested sample formats.
11853 <dt> ‘<samp>sample_rates</samp>’</dt>
11854 <dd><p>A ’|’-separated list of requested sample rates.
11857 <dt> ‘<samp>channel_layouts</samp>’</dt>
11858 <dd><p>A ’|’-separated list of requested channel layouts.
11860 <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)channel layout syntax</a>
11861 for the required syntax.
11865 <p>If a parameter is omitted, all values are allowed.
11867 <p>For example to force the output to either unsigned 8-bit or signed 16-bit stereo:
11868 </p><table><tr><td> </td><td><pre class="example">aformat=sample_fmts=u8|s16:channel_layouts=stereo
11869 </pre></td></tr></table>
11871 <a name="allpass"></a>
11872 <h2 class="section"><a href="ffplay-all.html#toc-allpass">30.7 allpass</a></h2>
11874 <p>Apply a two-pole all-pass filter with central frequency (in Hz)
11875 <var>frequency</var>, and filter-width <var>width</var>.
11876 An all-pass filter changes the audio’s frequency to phase relationship
11877 without changing its frequency to amplitude relationship.
11879 <p>The filter accepts the following options:
11881 <dl compact="compact">
11882 <dt> ‘<samp>frequency, f</samp>’</dt>
11883 <dd><p>Set frequency in Hz.
11886 <dt> ‘<samp>width_type</samp>’</dt>
11887 <dd><p>Set method to specify band-width of filter.
11888 </p><dl compact="compact">
11889 <dt> ‘<samp>h</samp>’</dt>
11892 <dt> ‘<samp>q</samp>’</dt>
11895 <dt> ‘<samp>o</samp>’</dt>
11898 <dt> ‘<samp>s</samp>’</dt>
11904 <dt> ‘<samp>width, w</samp>’</dt>
11905 <dd><p>Specify the band-width of a filter in width_type units.
11909 <a name="amerge"></a>
11910 <h2 class="section"><a href="ffplay-all.html#toc-amerge">30.8 amerge</a></h2>
11912 <p>Merge two or more audio streams into a single multi-channel stream.
11914 <p>The filter accepts the following options:
11916 <dl compact="compact">
11917 <dt> ‘<samp>inputs</samp>’</dt>
11918 <dd><p>Set the number of inputs. Default is 2.
11923 <p>If the channel layouts of the inputs are disjoint, and therefore compatible,
11924 the channel layout of the output will be set accordingly and the channels
11925 will be reordered as necessary. If the channel layouts of the inputs are not
11926 disjoint, the output will have all the channels of the first input then all
11927 the channels of the second input, in that order, and the channel layout of
11928 the output will be the default value corresponding to the total number of
11931 <p>For example, if the first input is in 2.1 (FL+FR+LF) and the second input
11932 is FC+BL+BR, then the output will be in 5.1, with the channels in the
11933 following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the
11934 first input, b1 is the first channel of the second input).
11936 <p>On the other hand, if both input are in stereo, the output channels will be
11937 in the default order: a1, a2, b1, b2, and the channel layout will be
11938 arbitrarily set to 4.0, which may or may not be the expected value.
11940 <p>All inputs must have the same sample rate, and format.
11942 <p>If inputs do not have the same duration, the output will stop with the
11945 <a name="Examples-62"></a>
11946 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-62">30.8.1 Examples</a></h3>
11950 Merge two mono files into a stereo stream:
11951 <table><tr><td> </td><td><pre class="example">amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
11952 </pre></td></tr></table>
11955 Multiple merges assuming 1 video stream and 6 audio streams in ‘<tt>input.mkv</tt>’:
11956 <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
11957 </pre></td></tr></table>
11960 <a name="amix"></a>
11961 <h2 class="section"><a href="ffplay-all.html#toc-amix">30.9 amix</a></h2>
11963 <p>Mixes multiple audio inputs into a single output.
11966 </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
11967 </pre></td></tr></table>
11968 <p>will mix 3 input audio streams to a single output with the same duration as the
11969 first input and a dropout transition time of 3 seconds.
11971 <p>The filter accepts the following named parameters:
11972 </p><dl compact="compact">
11973 <dt> ‘<samp>inputs</samp>’</dt>
11974 <dd><p>Number of inputs. If unspecified, it defaults to 2.
11977 <dt> ‘<samp>duration</samp>’</dt>
11978 <dd><p>How to determine the end-of-stream.
11979 </p><dl compact="compact">
11980 <dt> ‘<samp>longest</samp>’</dt>
11981 <dd><p>Duration of longest input. (default)
11984 <dt> ‘<samp>shortest</samp>’</dt>
11985 <dd><p>Duration of shortest input.
11988 <dt> ‘<samp>first</samp>’</dt>
11989 <dd><p>Duration of first input.
11995 <dt> ‘<samp>dropout_transition</samp>’</dt>
11996 <dd><p>Transition time, in seconds, for volume renormalization when an input
11997 stream ends. The default value is 2 seconds.
12002 <a name="anull"></a>
12003 <h2 class="section"><a href="ffplay-all.html#toc-anull">30.10 anull</a></h2>
12005 <p>Pass the audio source unchanged to the output.
12007 <a name="apad"></a>
12008 <h2 class="section"><a href="ffplay-all.html#toc-apad">30.11 apad</a></h2>
12010 <p>Pad the end of a audio stream with silence, this can be used together with
12011 -shortest to extend audio streams to the same length as the video stream.
12013 <a name="aphaser"></a>
12014 <h2 class="section"><a href="ffplay-all.html#toc-aphaser">30.12 aphaser</a></h2>
12015 <p>Add a phasing effect to the input audio.
12017 <p>A phaser filter creates series of peaks and troughs in the frequency spectrum.
12018 The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect.
12020 <p>A description of the accepted parameters follows.
12022 <dl compact="compact">
12023 <dt> ‘<samp>in_gain</samp>’</dt>
12024 <dd><p>Set input gain. Default is 0.4.
12027 <dt> ‘<samp>out_gain</samp>’</dt>
12028 <dd><p>Set output gain. Default is 0.74
12031 <dt> ‘<samp>delay</samp>’</dt>
12032 <dd><p>Set delay in milliseconds. Default is 3.0.
12035 <dt> ‘<samp>decay</samp>’</dt>
12036 <dd><p>Set decay. Default is 0.4.
12039 <dt> ‘<samp>speed</samp>’</dt>
12040 <dd><p>Set modulation speed in Hz. Default is 0.5.
12043 <dt> ‘<samp>type</samp>’</dt>
12044 <dd><p>Set modulation type. Default is triangular.
12046 <p>It accepts the following values:
12047 </p><dl compact="compact">
12048 <dt> ‘<samp>triangular, t</samp>’</dt>
12049 <dt> ‘<samp>sinusoidal, s</samp>’</dt>
12054 <p><a name="aresample"></a>
12055 </p><a name="aresample-1"></a>
12056 <h2 class="section"><a href="ffplay-all.html#toc-aresample-1">30.13 aresample</a></h2>
12058 <p>Resample the input audio to the specified parameters, using the
12059 libswresample library. If none are specified then the filter will
12060 automatically convert between its input and output.
12062 <p>This filter is also able to stretch/squeeze the audio data to make it match
12063 the timestamps or to inject silence / cut out audio to make it match the
12064 timestamps, do a combination of both or do neither.
12066 <p>The filter accepts the syntax
12067 [<var>sample_rate</var>:]<var>resampler_options</var>, where <var>sample_rate</var>
12068 expresses a sample rate and <var>resampler_options</var> is a list of
12069 <var>key</var>=<var>value</var> pairs, separated by ":". See the
12070 ffmpeg-resampler manual for the complete list of supported options.
12072 <a name="Examples-22"></a>
12073 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-22">30.13.1 Examples</a></h3>
12077 Resample the input audio to 44100Hz:
12078 <table><tr><td> </td><td><pre class="example">aresample=44100
12079 </pre></td></tr></table>
12082 Stretch/squeeze samples to the given timestamps, with a maximum of 1000
12083 samples per second compensation:
12084 <table><tr><td> </td><td><pre class="example">aresample=async=1000
12085 </pre></td></tr></table>
12088 <a name="asetnsamples"></a>
12089 <h2 class="section"><a href="ffplay-all.html#toc-asetnsamples">30.14 asetnsamples</a></h2>
12091 <p>Set the number of samples per each output audio frame.
12093 <p>The last output packet may contain a different number of samples, as
12094 the filter will flush all the remaining samples when the input audio
12097 <p>The filter accepts the following options:
12099 <dl compact="compact">
12100 <dt> ‘<samp>nb_out_samples, n</samp>’</dt>
12101 <dd><p>Set the number of frames per each output audio frame. The number is
12102 intended as the number of samples <em>per each channel</em>.
12103 Default value is 1024.
12106 <dt> ‘<samp>pad, p</samp>’</dt>
12107 <dd><p>If set to 1, the filter will pad the last audio frame with zeroes, so
12108 that the last frame will contain the same number of samples as the
12109 previous ones. Default value is 1.
12113 <p>For example, to set the number of per-frame samples to 1234 and
12114 disable padding for the last frame, use:
12115 </p><table><tr><td> </td><td><pre class="example">asetnsamples=n=1234:p=0
12116 </pre></td></tr></table>
12118 <a name="asetrate"></a>
12119 <h2 class="section"><a href="ffplay-all.html#toc-asetrate">30.15 asetrate</a></h2>
12121 <p>Set the sample rate without altering the PCM data.
12122 This will result in a change of speed and pitch.
12124 <p>The filter accepts the following options:
12126 <dl compact="compact">
12127 <dt> ‘<samp>sample_rate, r</samp>’</dt>
12128 <dd><p>Set the output sample rate. Default is 44100 Hz.
12132 <a name="ashowinfo"></a>
12133 <h2 class="section"><a href="ffplay-all.html#toc-ashowinfo">30.16 ashowinfo</a></h2>
12135 <p>Show a line containing various information for each input audio frame.
12136 The input audio is not modified.
12138 <p>The shown line contains a sequence of key/value pairs of the form
12139 <var>key</var>:<var>value</var>.
12141 <p>A description of each shown parameter follows:
12143 <dl compact="compact">
12144 <dt> ‘<samp>n</samp>’</dt>
12145 <dd><p>sequential number of the input frame, starting from 0
12148 <dt> ‘<samp>pts</samp>’</dt>
12149 <dd><p>Presentation timestamp of the input frame, in time base units; the time base
12150 depends on the filter input pad, and is usually 1/<var>sample_rate</var>.
12153 <dt> ‘<samp>pts_time</samp>’</dt>
12154 <dd><p>presentation timestamp of the input frame in seconds
12157 <dt> ‘<samp>pos</samp>’</dt>
12158 <dd><p>position of the frame in the input stream, -1 if this information in
12159 unavailable and/or meaningless (for example in case of synthetic audio)
12162 <dt> ‘<samp>fmt</samp>’</dt>
12163 <dd><p>sample format
12166 <dt> ‘<samp>chlayout</samp>’</dt>
12167 <dd><p>channel layout
12170 <dt> ‘<samp>rate</samp>’</dt>
12171 <dd><p>sample rate for the audio frame
12174 <dt> ‘<samp>nb_samples</samp>’</dt>
12175 <dd><p>number of samples (per channel) in the frame
12178 <dt> ‘<samp>checksum</samp>’</dt>
12179 <dd><p>Adler-32 checksum (printed in hexadecimal) of the audio data. For planar audio
12180 the data is treated as if all the planes were concatenated.
12183 <dt> ‘<samp>plane_checksums</samp>’</dt>
12184 <dd><p>A list of Adler-32 checksums for each data plane.
12188 <a name="astats"></a>
12189 <h2 class="section"><a href="ffplay-all.html#toc-astats">30.17 astats</a></h2>
12191 <p>Display time domain statistical information about the audio channels.
12192 Statistics are calculated and displayed for each audio channel and,
12193 where applicable, an overall figure is also given.
12195 <p>The filter accepts the following option:
12196 </p><dl compact="compact">
12197 <dt> ‘<samp>length</samp>’</dt>
12198 <dd><p>Short window length in seconds, used for peak and trough RMS measurement.
12199 Default is <code>0.05</code> (50 miliseconds). Allowed range is <code>[0.1 - 10]</code>.
12203 <p>A description of each shown parameter follows:
12205 <dl compact="compact">
12206 <dt> ‘<samp>DC offset</samp>’</dt>
12207 <dd><p>Mean amplitude displacement from zero.
12210 <dt> ‘<samp>Min level</samp>’</dt>
12211 <dd><p>Minimal sample level.
12214 <dt> ‘<samp>Max level</samp>’</dt>
12215 <dd><p>Maximal sample level.
12218 <dt> ‘<samp>Peak level dB</samp>’</dt>
12219 <dt> ‘<samp>RMS level dB</samp>’</dt>
12220 <dd><p>Standard peak and RMS level measured in dBFS.
12223 <dt> ‘<samp>RMS peak dB</samp>’</dt>
12224 <dt> ‘<samp>RMS trough dB</samp>’</dt>
12225 <dd><p>Peak and trough values for RMS level measured over a short window.
12228 <dt> ‘<samp>Crest factor</samp>’</dt>
12229 <dd><p>Standard ratio of peak to RMS level (note: not in dB).
12232 <dt> ‘<samp>Flat factor</samp>’</dt>
12233 <dd><p>Flatness (i.e. consecutive samples with the same value) of the signal at its peak levels
12234 (i.e. either <var>Min level</var> or <var>Max level</var>).
12237 <dt> ‘<samp>Peak count</samp>’</dt>
12238 <dd><p>Number of occasions (not the number of samples) that the signal attained either
12239 <var>Min level</var> or <var>Max level</var>.
12243 <a name="astreamsync"></a>
12244 <h2 class="section"><a href="ffplay-all.html#toc-astreamsync">30.18 astreamsync</a></h2>
12246 <p>Forward two audio streams and control the order the buffers are forwarded.
12248 <p>The filter accepts the following options:
12250 <dl compact="compact">
12251 <dt> ‘<samp>expr, e</samp>’</dt>
12252 <dd><p>Set the expression deciding which stream should be
12253 forwarded next: if the result is negative, the first stream is forwarded; if
12254 the result is positive or zero, the second stream is forwarded. It can use
12255 the following variables:
12257 <dl compact="compact">
12258 <dt> <var>b1 b2</var></dt>
12259 <dd><p>number of buffers forwarded so far on each stream
12261 <dt> <var>s1 s2</var></dt>
12262 <dd><p>number of samples forwarded so far on each stream
12264 <dt> <var>t1 t2</var></dt>
12265 <dd><p>current timestamp of each stream
12269 <p>The default value is <code>t1-t2</code>, which means to always forward the stream
12270 that has a smaller timestamp.
12274 <a name="Examples-46"></a>
12275 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-46">30.18.1 Examples</a></h3>
12277 <p>Stress-test <code>amerge</code> by randomly sending buffers on the wrong
12278 input, while avoiding too much of a desynchronization:
12279 </p><table><tr><td> </td><td><pre class="example">amovie=file.ogg [a] ; amovie=file.mp3 [b] ;
12280 [a] [b] astreamsync=(2*random(1))-1+tanh(5*(t1-t2)) [a2] [b2] ;
12282 </pre></td></tr></table>
12284 <a name="asyncts"></a>
12285 <h2 class="section"><a href="ffplay-all.html#toc-asyncts">30.19 asyncts</a></h2>
12287 <p>Synchronize audio data with timestamps by squeezing/stretching it and/or
12288 dropping samples/adding silence when needed.
12290 <p>This filter is not built by default, please use <a href="#aresample">aresample</a> to do squeezing/stretching.
12292 <p>The filter accepts the following named parameters:
12293 </p><dl compact="compact">
12294 <dt> ‘<samp>compensate</samp>’</dt>
12295 <dd><p>Enable stretching/squeezing the data to make it match the timestamps. Disabled
12296 by default. When disabled, time gaps are covered with silence.
12299 <dt> ‘<samp>min_delta</samp>’</dt>
12300 <dd><p>Minimum difference between timestamps and audio data (in seconds) to trigger
12301 adding/dropping samples. Default value is 0.1. If you get non-perfect sync with
12302 this filter, try setting this parameter to 0.
12305 <dt> ‘<samp>max_comp</samp>’</dt>
12306 <dd><p>Maximum compensation in samples per second. Relevant only with compensate=1.
12310 <dt> ‘<samp>first_pts</samp>’</dt>
12311 <dd><p>Assume the first pts should be this value. The time base is 1 / sample rate.
12312 This allows for padding/trimming at the start of stream. By default, no
12313 assumption is made about the first frame’s expected pts, so no padding or
12314 trimming is done. For example, this could be set to 0 to pad the beginning with
12315 silence if an audio stream starts after the video stream or to trim any samples
12316 with a negative pts due to encoder delay.
12321 <a name="atempo"></a>
12322 <h2 class="section"><a href="ffplay-all.html#toc-atempo">30.20 atempo</a></h2>
12324 <p>Adjust audio tempo.
12326 <p>The filter accepts exactly one parameter, the audio tempo. If not
12327 specified then the filter will assume nominal 1.0 tempo. Tempo must
12328 be in the [0.5, 2.0] range.
12330 <a name="Examples-60"></a>
12331 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-60">30.20.1 Examples</a></h3>
12335 Slow down audio to 80% tempo:
12336 <table><tr><td> </td><td><pre class="example">atempo=0.8
12337 </pre></td></tr></table>
12340 To speed up audio to 125% tempo:
12341 <table><tr><td> </td><td><pre class="example">atempo=1.25
12342 </pre></td></tr></table>
12345 <a name="atrim"></a>
12346 <h2 class="section"><a href="ffplay-all.html#toc-atrim">30.21 atrim</a></h2>
12348 <p>Trim the input so that the output contains one continuous subpart of the input.
12350 <p>This filter accepts the following options:
12351 </p><dl compact="compact">
12352 <dt> ‘<samp>start</samp>’</dt>
12353 <dd><p>Specify time of the start of the kept section, i.e. the audio sample
12354 with the timestamp <var>start</var> will be the first sample in the output.
12357 <dt> ‘<samp>end</samp>’</dt>
12358 <dd><p>Specify time of the first audio sample that will be dropped, i.e. the
12359 audio sample immediately preceding the one with the timestamp <var>end</var> will be
12360 the last sample in the output.
12363 <dt> ‘<samp>start_pts</samp>’</dt>
12364 <dd><p>Same as <var>start</var>, except this option sets the start timestamp in samples
12365 instead of seconds.
12368 <dt> ‘<samp>end_pts</samp>’</dt>
12369 <dd><p>Same as <var>end</var>, except this option sets the end timestamp in samples instead
12373 <dt> ‘<samp>duration</samp>’</dt>
12374 <dd><p>Specify maximum duration of the output.
12377 <dt> ‘<samp>start_sample</samp>’</dt>
12378 <dd><p>Number of the first sample that should be passed to output.
12381 <dt> ‘<samp>end_sample</samp>’</dt>
12382 <dd><p>Number of the first sample that should be dropped.
12386 <p>‘<samp>start</samp>’, ‘<samp>end</samp>’, ‘<samp>duration</samp>’ are expressed as time
12387 duration specifications, check the "Time duration" section in the
12388 ffmpeg-utils manual.
12390 <p>Note that the first two sets of the start/end options and the ‘<samp>duration</samp>’
12391 option look at the frame timestamp, while the _sample options simply count the
12392 samples that pass through the filter. So start/end_pts and start/end_sample will
12393 give different results when the timestamps are wrong, inexact or do not start at
12394 zero. Also note that this filter does not modify the timestamps. If you wish
12395 that the output timestamps start at zero, insert the asetpts filter after the
12398 <p>If multiple start or end options are set, this filter tries to be greedy and
12399 keep all samples that match at least one of the specified constraints. To keep
12400 only the part that matches all the constraints at once, chain multiple atrim
12403 <p>The defaults are such that all the input is kept. So it is possible to set e.g.
12404 just the end values to keep everything before the specified time.
12409 drop everything except the second minute of input
12410 <table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -af atrim=60:120
12411 </pre></td></tr></table>
12414 keep only the first 1000 samples
12415 <table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -af atrim=end_sample=1000
12416 </pre></td></tr></table>
12420 <a name="bandpass"></a>
12421 <h2 class="section"><a href="ffplay-all.html#toc-bandpass">30.22 bandpass</a></h2>
12423 <p>Apply a two-pole Butterworth band-pass filter with central
12424 frequency <var>frequency</var>, and (3dB-point) band-width width.
12425 The <var>csg</var> option selects a constant skirt gain (peak gain = Q)
12426 instead of the default: constant 0dB peak gain.
12427 The filter roll off at 6dB per octave (20dB per decade).
12429 <p>The filter accepts the following options:
12431 <dl compact="compact">
12432 <dt> ‘<samp>frequency, f</samp>’</dt>
12433 <dd><p>Set the filter’s central frequency. Default is <code>3000</code>.
12436 <dt> ‘<samp>csg</samp>’</dt>
12437 <dd><p>Constant skirt gain if set to 1. Defaults to 0.
12440 <dt> ‘<samp>width_type</samp>’</dt>
12441 <dd><p>Set method to specify band-width of filter.
12442 </p><dl compact="compact">
12443 <dt> ‘<samp>h</samp>’</dt>
12446 <dt> ‘<samp>q</samp>’</dt>
12449 <dt> ‘<samp>o</samp>’</dt>
12452 <dt> ‘<samp>s</samp>’</dt>
12458 <dt> ‘<samp>width, w</samp>’</dt>
12459 <dd><p>Specify the band-width of a filter in width_type units.
12463 <a name="bandreject"></a>
12464 <h2 class="section"><a href="ffplay-all.html#toc-bandreject">30.23 bandreject</a></h2>
12466 <p>Apply a two-pole Butterworth band-reject filter with central
12467 frequency <var>frequency</var>, and (3dB-point) band-width <var>width</var>.
12468 The filter roll off at 6dB per octave (20dB per decade).
12470 <p>The filter accepts the following options:
12472 <dl compact="compact">
12473 <dt> ‘<samp>frequency, f</samp>’</dt>
12474 <dd><p>Set the filter’s central frequency. Default is <code>3000</code>.
12477 <dt> ‘<samp>width_type</samp>’</dt>
12478 <dd><p>Set method to specify band-width of filter.
12479 </p><dl compact="compact">
12480 <dt> ‘<samp>h</samp>’</dt>
12483 <dt> ‘<samp>q</samp>’</dt>
12486 <dt> ‘<samp>o</samp>’</dt>
12489 <dt> ‘<samp>s</samp>’</dt>
12495 <dt> ‘<samp>width, w</samp>’</dt>
12496 <dd><p>Specify the band-width of a filter in width_type units.
12500 <a name="bass"></a>
12501 <h2 class="section"><a href="ffplay-all.html#toc-bass">30.24 bass</a></h2>
12503 <p>Boost or cut the bass (lower) frequencies of the audio using a two-pole
12504 shelving filter with a response similar to that of a standard
12505 hi-fi’s tone-controls. This is also known as shelving equalisation (EQ).
12507 <p>The filter accepts the following options:
12509 <dl compact="compact">
12510 <dt> ‘<samp>gain, g</samp>’</dt>
12511 <dd><p>Give the gain at 0 Hz. Its useful range is about -20
12512 (for a large cut) to +20 (for a large boost).
12513 Beware of clipping when using a positive gain.
12516 <dt> ‘<samp>frequency, f</samp>’</dt>
12517 <dd><p>Set the filter’s central frequency and so can be used
12518 to extend or reduce the frequency range to be boosted or cut.
12519 The default value is <code>100</code> Hz.
12522 <dt> ‘<samp>width_type</samp>’</dt>
12523 <dd><p>Set method to specify band-width of filter.
12524 </p><dl compact="compact">
12525 <dt> ‘<samp>h</samp>’</dt>
12528 <dt> ‘<samp>q</samp>’</dt>
12531 <dt> ‘<samp>o</samp>’</dt>
12534 <dt> ‘<samp>s</samp>’</dt>
12540 <dt> ‘<samp>width, w</samp>’</dt>
12541 <dd><p>Determine how steep is the filter’s shelf transition.
12545 <a name="biquad"></a>
12546 <h2 class="section"><a href="ffplay-all.html#toc-biquad">30.25 biquad</a></h2>
12548 <p>Apply a biquad IIR filter with the given coefficients.
12549 Where <var>b0</var>, <var>b1</var>, <var>b2</var> and <var>a0</var>, <var>a1</var>, <var>a2</var>
12550 are the numerator and denominator coefficients respectively.
12552 <a name="channelmap"></a>
12553 <h2 class="section"><a href="ffplay-all.html#toc-channelmap">30.26 channelmap</a></h2>
12555 <p>Remap input channels to new locations.
12557 <p>This filter accepts the following named parameters:
12558 </p><dl compact="compact">
12559 <dt> ‘<samp>channel_layout</samp>’</dt>
12560 <dd><p>Channel layout of the output stream.
12563 <dt> ‘<samp>map</samp>’</dt>
12564 <dd><p>Map channels from input to output. The argument is a ’|’-separated list of
12565 mappings, each in the <code><var>in_channel</var>-<var>out_channel</var></code> or
12566 <var>in_channel</var> form. <var>in_channel</var> can be either the name of the input
12567 channel (e.g. FL for front left) or its index in the input channel layout.
12568 <var>out_channel</var> is the name of the output channel or its index in the output
12569 channel layout. If <var>out_channel</var> is not given then it is implicitly an
12570 index, starting with zero and increasing by one for each mapping.
12574 <p>If no mapping is present, the filter will implicitly map input channels to
12575 output channels preserving index.
12577 <p>For example, assuming a 5.1+downmix input MOV file
12578 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
12579 </pre></td></tr></table>
12580 <p>will create an output WAV file tagged as stereo from the downmix channels of
12583 <p>To fix a 5.1 WAV improperly encoded in AAC’s native channel order
12584 </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
12585 </pre></td></tr></table>
12587 <a name="channelsplit"></a>
12588 <h2 class="section"><a href="ffplay-all.html#toc-channelsplit">30.27 channelsplit</a></h2>
12590 <p>Split each channel in input audio stream into a separate output stream.
12592 <p>This filter accepts the following named parameters:
12593 </p><dl compact="compact">
12594 <dt> ‘<samp>channel_layout</samp>’</dt>
12595 <dd><p>Channel layout of the input stream. Default is "stereo".
12599 <p>For example, assuming a stereo input MP3 file
12600 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
12601 </pre></td></tr></table>
12602 <p>will create an output Matroska file with two audio streams, one containing only
12603 the left channel and the other the right channel.
12605 <p>To split a 5.1 WAV file into per-channel files
12606 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i in.wav -filter_complex
12607 'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
12608 -map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
12609 front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
12611 </pre></td></tr></table>
12613 <a name="compand"></a>
12614 <h2 class="section"><a href="ffplay-all.html#toc-compand">30.28 compand</a></h2>
12616 <p>Compress or expand audio dynamic range.
12618 <p>A description of the accepted options follows.
12620 <dl compact="compact">
12621 <dt> ‘<samp>attacks</samp>’</dt>
12622 <dt> ‘<samp>decays</samp>’</dt>
12623 <dd><p>Set list of times in seconds for each channel over which the instantaneous
12624 level of the input signal is averaged to determine its volume.
12625 ‘<samp>attacks</samp>’ refers to increase of volume and ‘<samp>decays</samp>’ refers
12626 to decrease of volume.
12627 For most situations, the attack time (response to the audio getting louder)
12628 should be shorter than the decay time because the human ear is more sensitive
12629 to sudden loud audio than sudden soft audio.
12630 Typical value for attack is <code>0.3</code> seconds and for decay <code>0.8</code>
12634 <dt> ‘<samp>points</samp>’</dt>
12635 <dd><p>Set list of points for transfer function, specified in dB relative to maximum
12636 possible signal amplitude.
12637 Each key points list need to be defined using the following syntax:
12638 <code>x0/y0 x1/y1 x2/y2 ...</code>.
12640 <p>The input values must be in strictly increasing order but the transfer
12641 function does not have to be monotonically rising.
12642 The point <code>0/0</code> is assumed but may be overridden (by <code>0/out-dBn</code>).
12643 Typical values for the transfer function are <code>-70/-70 -60/-20</code>.
12646 <dt> ‘<samp>soft-knee</samp>’</dt>
12647 <dd><p>Set amount for which the points at where adjacent line segments on the
12648 transfer function meet will be rounded. Defaults is <code>0.01</code>.
12651 <dt> ‘<samp>gain</samp>’</dt>
12652 <dd><p>Set additional gain in dB to be applied at all points on the transfer function
12653 and allows easy adjustment of the overall gain.
12654 Default is <code>0</code>.
12657 <dt> ‘<samp>volume</samp>’</dt>
12658 <dd><p>Set initial volume in dB to be assumed for each channel when filtering starts.
12659 This permits the user to supply a nominal level initially, so that,
12660 for example, a very large gain is not applied to initial signal levels before
12661 the companding has begun to operate. A typical value for audio which is
12662 initially quiet is -90 dB. Default is <code>0</code>.
12665 <dt> ‘<samp>delay</samp>’</dt>
12666 <dd><p>Set delay in seconds. Default is <code>0</code>. The input audio
12667 is analysed immediately, but audio is delayed before being fed to the
12668 volume adjuster. Specifying a delay approximately equal to the attack/decay
12669 times allows the filter to effectively operate in predictive rather than
12674 <a name="Examples-15"></a>
12675 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-15">30.28.1 Examples</a></h3>
12678 Make music with both quiet and loud passages suitable for listening
12679 in a noisy environment:
12680 <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
12681 </pre></td></tr></table>
12684 Noise-gate for when the noise is at a lower level than the signal:
12685 <table><tr><td> </td><td><pre class="example">compand=.1 .1:.2 .2:-900/-900 -50.1/-900 -50/-50:.01:0:-90:.1
12686 </pre></td></tr></table>
12689 Here is another noise-gate, this time for when the noise is at a higher level
12690 than the signal (making it, in some ways, similar to squelch):
12691 <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
12692 </pre></td></tr></table>
12695 <a name="earwax"></a>
12696 <h2 class="section"><a href="ffplay-all.html#toc-earwax">30.29 earwax</a></h2>
12698 <p>Make audio easier to listen to on headphones.
12700 <p>This filter adds ‘cues’ to 44.1kHz stereo (i.e. audio CD format) audio
12701 so that when listened to on headphones the stereo image is moved from
12702 inside your head (standard for headphones) to outside and in front of
12703 the listener (standard for speakers).
12705 <p>Ported from SoX.
12707 <a name="equalizer"></a>
12708 <h2 class="section"><a href="ffplay-all.html#toc-equalizer">30.30 equalizer</a></h2>
12710 <p>Apply a two-pole peaking equalisation (EQ) filter. With this
12711 filter, the signal-level at and around a selected frequency can
12712 be increased or decreased, whilst (unlike bandpass and bandreject
12713 filters) that at all other frequencies is unchanged.
12715 <p>In order to produce complex equalisation curves, this filter can
12716 be given several times, each with a different central frequency.
12718 <p>The filter accepts the following options:
12720 <dl compact="compact">
12721 <dt> ‘<samp>frequency, f</samp>’</dt>
12722 <dd><p>Set the filter’s central frequency in Hz.
12725 <dt> ‘<samp>width_type</samp>’</dt>
12726 <dd><p>Set method to specify band-width of filter.
12727 </p><dl compact="compact">
12728 <dt> ‘<samp>h</samp>’</dt>
12731 <dt> ‘<samp>q</samp>’</dt>
12734 <dt> ‘<samp>o</samp>’</dt>
12737 <dt> ‘<samp>s</samp>’</dt>
12743 <dt> ‘<samp>width, w</samp>’</dt>
12744 <dd><p>Specify the band-width of a filter in width_type units.
12747 <dt> ‘<samp>gain, g</samp>’</dt>
12748 <dd><p>Set the required gain or attenuation in dB.
12749 Beware of clipping when using a positive gain.
12753 <a name="highpass"></a>
12754 <h2 class="section"><a href="ffplay-all.html#toc-highpass">30.31 highpass</a></h2>
12756 <p>Apply a high-pass filter with 3dB point frequency.
12757 The filter can be either single-pole, or double-pole (the default).
12758 The filter roll off at 6dB per pole per octave (20dB per pole per decade).
12760 <p>The filter accepts the following options:
12762 <dl compact="compact">
12763 <dt> ‘<samp>frequency, f</samp>’</dt>
12764 <dd><p>Set frequency in Hz. Default is 3000.
12767 <dt> ‘<samp>poles, p</samp>’</dt>
12768 <dd><p>Set number of poles. Default is 2.
12771 <dt> ‘<samp>width_type</samp>’</dt>
12772 <dd><p>Set method to specify band-width of filter.
12773 </p><dl compact="compact">
12774 <dt> ‘<samp>h</samp>’</dt>
12777 <dt> ‘<samp>q</samp>’</dt>
12780 <dt> ‘<samp>o</samp>’</dt>
12783 <dt> ‘<samp>s</samp>’</dt>
12789 <dt> ‘<samp>width, w</samp>’</dt>
12790 <dd><p>Specify the band-width of a filter in width_type units.
12791 Applies only to double-pole filter.
12792 The default is 0.707q and gives a Butterworth response.
12796 <a name="join"></a>
12797 <h2 class="section"><a href="ffplay-all.html#toc-join">30.32 join</a></h2>
12799 <p>Join multiple input streams into one multi-channel stream.
12801 <p>The filter accepts the following named parameters:
12802 </p><dl compact="compact">
12803 <dt> ‘<samp>inputs</samp>’</dt>
12804 <dd><p>Number of input streams. Defaults to 2.
12807 <dt> ‘<samp>channel_layout</samp>’</dt>
12808 <dd><p>Desired output channel layout. Defaults to stereo.
12811 <dt> ‘<samp>map</samp>’</dt>
12812 <dd><p>Map channels from inputs to output. The argument is a ’|’-separated list of
12813 mappings, each in the <code><var>input_idx</var>.<var>in_channel</var>-<var>out_channel</var></code>
12814 form. <var>input_idx</var> is the 0-based index of the input stream. <var>in_channel</var>
12815 can be either the name of the input channel (e.g. FL for front left) or its
12816 index in the specified input stream. <var>out_channel</var> is the name of the output
12821 <p>The filter will attempt to guess the mappings when those are not specified
12822 explicitly. It does so by first trying to find an unused matching input channel
12823 and if that fails it picks the first unused input channel.
12825 <p>E.g. to join 3 inputs (with properly set channel layouts)
12826 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
12827 </pre></td></tr></table>
12829 <p>To build a 5.1 output from 6 single-channel streams:
12830 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
12831 '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'
12833 </pre></td></tr></table>
12835 <a name="ladspa"></a>
12836 <h2 class="section"><a href="ffplay-all.html#toc-ladspa">30.33 ladspa</a></h2>
12838 <p>Load a LADSPA (Linux Audio Developer’s Simple Plugin API) plugin.
12840 <p>To enable compilation of this filter you need to configure FFmpeg with
12841 <code>--enable-ladspa</code>.
12843 <dl compact="compact">
12844 <dt> ‘<samp>file, f</samp>’</dt>
12845 <dd><p>Specifies the name of LADSPA plugin library to load. If the environment
12846 variable <code>LADSPA_PATH</code> is defined, the LADSPA plugin is searched in
12847 each one of the directories specified by the colon separated list in
12848 <code>LADSPA_PATH</code>, otherwise in the standard LADSPA paths, which are in
12849 this order: ‘<tt>HOME/.ladspa/lib/</tt>’, ‘<tt>/usr/local/lib/ladspa/</tt>’,
12850 ‘<tt>/usr/lib/ladspa/</tt>’.
12853 <dt> ‘<samp>plugin, p</samp>’</dt>
12854 <dd><p>Specifies the plugin within the library. Some libraries contain only
12855 one plugin, but others contain many of them. If this is not set filter
12856 will list all available plugins within the specified library.
12859 <dt> ‘<samp>controls, c</samp>’</dt>
12860 <dd><p>Set the ’|’ separated list of controls which are zero or more floating point
12861 values that determine the behavior of the loaded plugin (for example delay,
12862 threshold or gain).
12863 Controls need to be defined using the following syntax:
12864 c0=<var>value0</var>|c1=<var>value1</var>|c2=<var>value2</var>|..., where
12865 <var>valuei</var> is the value set on the <var>i</var>-th control.
12866 If ‘<samp>controls</samp>’ is set to <code>help</code>, all available controls and
12867 their valid ranges are printed.
12870 <dt> ‘<samp>sample_rate, s</samp>’</dt>
12871 <dd><p>Specify the sample rate, default to 44100. Only used if plugin have
12875 <dt> ‘<samp>nb_samples, n</samp>’</dt>
12876 <dd><p>Set the number of samples per channel per each output frame, default
12877 is 1024. Only used if plugin have zero inputs.
12880 <dt> ‘<samp>duration, d</samp>’</dt>
12881 <dd><p>Set the minimum duration of the sourced audio. See the function
12882 <code>av_parse_time()</code> for the accepted format, also check the "Time duration"
12883 section in the ffmpeg-utils manual.
12884 Note that the resulting duration may be greater than the specified duration,
12885 as the generated audio is always cut at the end of a complete frame.
12886 If not specified, or the expressed duration is negative, the audio is
12887 supposed to be generated forever.
12888 Only used if plugin have zero inputs.
12893 <a name="Examples-9"></a>
12894 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-9">30.33.1 Examples</a></h3>
12898 List all available plugins within amp (LADSPA example plugin) library:
12899 <table><tr><td> </td><td><pre class="example">ladspa=file=amp
12900 </pre></td></tr></table>
12903 List all available controls and their valid ranges for <code>vcf_notch</code>
12904 plugin from <code>VCF</code> library:
12905 <table><tr><td> </td><td><pre class="example">ladspa=f=vcf:p=vcf_notch:c=help
12906 </pre></td></tr></table>
12909 Simulate low quality audio equipment using <code>Computer Music Toolkit</code> (CMT)
12911 <table><tr><td> </td><td><pre class="example">ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12
12912 </pre></td></tr></table>
12915 Add reverberation to the audio using TAP-plugins
12916 (Tom’s Audio Processing plugins):
12917 <table><tr><td> </td><td><pre class="example">ladspa=file=tap_reverb:tap_reverb
12918 </pre></td></tr></table>
12921 Generate white noise, with 0.2 amplitude:
12922 <table><tr><td> </td><td><pre class="example">ladspa=file=cmt:noise_source_white:c=c0=.2
12923 </pre></td></tr></table>
12926 Generate 20 bpm clicks using plugin <code>C* Click - Metronome</code> from the
12927 <code>C* Audio Plugin Suite</code> (CAPS) library:
12928 <table><tr><td> </td><td><pre class="example">ladspa=file=caps:Click:c=c1=20'
12929 </pre></td></tr></table>
12932 Apply <code>C* Eq10X2 - Stereo 10-band equaliser</code> effect:
12933 <table><tr><td> </td><td><pre class="example">ladspa=caps:Eq10X2:c=c0=-48|c9=-24|c3=12|c4=2
12934 </pre></td></tr></table>
12937 <a name="Commands-3"></a>
12938 <h3 class="subsection"><a href="ffplay-all.html#toc-Commands-3">30.33.2 Commands</a></h3>
12940 <p>This filter supports the following commands:
12941 </p><dl compact="compact">
12942 <dt> ‘<samp>cN</samp>’</dt>
12943 <dd><p>Modify the <var>N</var>-th control value.
12945 <p>If the specified value is not valid, it is ignored and prior one is kept.
12949 <a name="lowpass"></a>
12950 <h2 class="section"><a href="ffplay-all.html#toc-lowpass">30.34 lowpass</a></h2>
12952 <p>Apply a low-pass filter with 3dB point frequency.
12953 The filter can be either single-pole or double-pole (the default).
12954 The filter roll off at 6dB per pole per octave (20dB per pole per decade).
12956 <p>The filter accepts the following options:
12958 <dl compact="compact">
12959 <dt> ‘<samp>frequency, f</samp>’</dt>
12960 <dd><p>Set frequency in Hz. Default is 500.
12963 <dt> ‘<samp>poles, p</samp>’</dt>
12964 <dd><p>Set number of poles. Default is 2.
12967 <dt> ‘<samp>width_type</samp>’</dt>
12968 <dd><p>Set method to specify band-width of filter.
12969 </p><dl compact="compact">
12970 <dt> ‘<samp>h</samp>’</dt>
12973 <dt> ‘<samp>q</samp>’</dt>
12976 <dt> ‘<samp>o</samp>’</dt>
12979 <dt> ‘<samp>s</samp>’</dt>
12985 <dt> ‘<samp>width, w</samp>’</dt>
12986 <dd><p>Specify the band-width of a filter in width_type units.
12987 Applies only to double-pole filter.
12988 The default is 0.707q and gives a Butterworth response.
12993 <h2 class="section"><a href="ffplay-all.html#toc-pan">30.35 pan</a></h2>
12995 <p>Mix channels with specific gain levels. The filter accepts the output
12996 channel layout followed by a set of channels definitions.
12998 <p>This filter is also designed to remap efficiently the channels of an audio
13001 <p>The filter accepts parameters of the form:
13002 "<var>l</var>:<var>outdef</var>:<var>outdef</var>:..."
13004 <dl compact="compact">
13005 <dt> ‘<samp>l</samp>’</dt>
13006 <dd><p>output channel layout or number of channels
13009 <dt> ‘<samp>outdef</samp>’</dt>
13010 <dd><p>output channel specification, of the form:
13011 "<var>out_name</var>=[<var>gain</var>*]<var>in_name</var>[+[<var>gain</var>*]<var>in_name</var>...]"
13014 <dt> ‘<samp>out_name</samp>’</dt>
13015 <dd><p>output channel to define, either a channel name (FL, FR, etc.) or a channel
13016 number (c0, c1, etc.)
13019 <dt> ‘<samp>gain</samp>’</dt>
13020 <dd><p>multiplicative coefficient for the channel, 1 leaving the volume unchanged
13023 <dt> ‘<samp>in_name</samp>’</dt>
13024 <dd><p>input channel to use, see out_name for details; it is not possible to mix
13025 named and numbered input channels
13029 <p>If the ‘=’ in a channel specification is replaced by ‘<’, then the gains for
13030 that specification will be renormalized so that the total is 1, thus
13031 avoiding clipping noise.
13033 <a name="Mixing-examples"></a>
13034 <h3 class="subsection"><a href="ffplay-all.html#toc-Mixing-examples">30.35.1 Mixing examples</a></h3>
13036 <p>For example, if you want to down-mix from stereo to mono, but with a bigger
13037 factor for the left channel:
13038 </p><table><tr><td> </td><td><pre class="example">pan=1:c0=0.9*c0+0.1*c1
13039 </pre></td></tr></table>
13041 <p>A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
13042 7-channels surround:
13043 </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
13044 </pre></td></tr></table>
13046 <p>Note that <code>ffmpeg</code> integrates a default down-mix (and up-mix) system
13047 that should be preferred (see "-ac" option) unless you have very specific
13050 <a name="Remapping-examples"></a>
13051 <h3 class="subsection"><a href="ffplay-all.html#toc-Remapping-examples">30.35.2 Remapping examples</a></h3>
13053 <p>The channel remapping will be effective if, and only if:
13056 <li> gain coefficients are zeroes or ones,
13057 </li><li> only one input per channel output,
13060 <p>If all these conditions are satisfied, the filter will notify the user ("Pure
13061 channel mapping detected"), and use an optimized and lossless method to do the
13064 <p>For example, if you have a 5.1 source and want a stereo audio stream by
13065 dropping the extra channels:
13066 </p><table><tr><td> </td><td><pre class="example">pan="stereo: c0=FL : c1=FR"
13067 </pre></td></tr></table>
13069 <p>Given the same source, you can also switch front left and front right channels
13070 and keep the input channel layout:
13071 </p><table><tr><td> </td><td><pre class="example">pan="5.1: c0=c1 : c1=c0 : c2=c2 : c3=c3 : c4=c4 : c5=c5"
13072 </pre></td></tr></table>
13074 <p>If the input is a stereo audio stream, you can mute the front left channel (and
13075 still keep the stereo channel layout) with:
13076 </p><table><tr><td> </td><td><pre class="example">pan="stereo:c1=c1"
13077 </pre></td></tr></table>
13079 <p>Still with a stereo audio stream input, you can copy the right channel in both
13080 front left and right:
13081 </p><table><tr><td> </td><td><pre class="example">pan="stereo: c0=FR : c1=FR"
13082 </pre></td></tr></table>
13084 <a name="replaygain"></a>
13085 <h2 class="section"><a href="ffplay-all.html#toc-replaygain">30.36 replaygain</a></h2>
13087 <p>ReplayGain scanner filter. This filter takes an audio stream as an input and
13088 outputs it unchanged.
13089 At end of filtering it displays <code>track_gain</code> and <code>track_peak</code>.
13091 <a name="resample"></a>
13092 <h2 class="section"><a href="ffplay-all.html#toc-resample">30.37 resample</a></h2>
13094 <p>Convert the audio sample format, sample rate and channel layout. This filter is
13095 not meant to be used directly.
13097 <a name="silencedetect"></a>
13098 <h2 class="section"><a href="ffplay-all.html#toc-silencedetect">30.38 silencedetect</a></h2>
13100 <p>Detect silence in an audio stream.
13102 <p>This filter logs a message when it detects that the input audio volume is less
13103 or equal to a noise tolerance value for a duration greater or equal to the
13104 minimum detected noise duration.
13106 <p>The printed times and duration are expressed in seconds.
13108 <p>The filter accepts the following options:
13110 <dl compact="compact">
13111 <dt> ‘<samp>duration, d</samp>’</dt>
13112 <dd><p>Set silence duration until notification (default is 2 seconds).
13115 <dt> ‘<samp>noise, n</samp>’</dt>
13116 <dd><p>Set noise tolerance. Can be specified in dB (in case "dB" is appended to the
13117 specified value) or amplitude ratio. Default is -60dB, or 0.001.
13121 <a name="Examples-64"></a>
13122 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-64">30.38.1 Examples</a></h3>
13126 Detect 5 seconds of silence with -50dB noise tolerance:
13127 <table><tr><td> </td><td><pre class="example">silencedetect=n=-50dB:d=5
13128 </pre></td></tr></table>
13131 Complete example with <code>ffmpeg</code> to detect silence with 0.0001 noise
13132 tolerance in ‘<tt>silence.mp3</tt>’:
13133 <table><tr><td> </td><td><pre class="example">ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
13134 </pre></td></tr></table>
13137 <a name="treble"></a>
13138 <h2 class="section"><a href="ffplay-all.html#toc-treble">30.39 treble</a></h2>
13140 <p>Boost or cut treble (upper) frequencies of the audio using a two-pole
13141 shelving filter with a response similar to that of a standard
13142 hi-fi’s tone-controls. This is also known as shelving equalisation (EQ).
13144 <p>The filter accepts the following options:
13146 <dl compact="compact">
13147 <dt> ‘<samp>gain, g</samp>’</dt>
13148 <dd><p>Give the gain at whichever is the lower of ~22 kHz and the
13149 Nyquist frequency. Its useful range is about -20 (for a large cut)
13150 to +20 (for a large boost). Beware of clipping when using a positive gain.
13153 <dt> ‘<samp>frequency, f</samp>’</dt>
13154 <dd><p>Set the filter’s central frequency and so can be used
13155 to extend or reduce the frequency range to be boosted or cut.
13156 The default value is <code>3000</code> Hz.
13159 <dt> ‘<samp>width_type</samp>’</dt>
13160 <dd><p>Set method to specify band-width of filter.
13161 </p><dl compact="compact">
13162 <dt> ‘<samp>h</samp>’</dt>
13165 <dt> ‘<samp>q</samp>’</dt>
13168 <dt> ‘<samp>o</samp>’</dt>
13171 <dt> ‘<samp>s</samp>’</dt>
13177 <dt> ‘<samp>width, w</samp>’</dt>
13178 <dd><p>Determine how steep is the filter’s shelf transition.
13182 <a name="volume"></a>
13183 <h2 class="section"><a href="ffplay-all.html#toc-volume">30.40 volume</a></h2>
13185 <p>Adjust the input audio volume.
13187 <p>The filter accepts the following options:
13189 <dl compact="compact">
13190 <dt> ‘<samp>volume</samp>’</dt>
13191 <dd><p>Expresses how the audio volume will be increased or decreased.
13193 <p>Output values are clipped to the maximum value.
13195 <p>The output audio volume is given by the relation:
13196 </p><table><tr><td> </td><td><pre class="example"><var>output_volume</var> = <var>volume</var> * <var>input_volume</var>
13197 </pre></td></tr></table>
13199 <p>Default value for <var>volume</var> is 1.0.
13202 <dt> ‘<samp>precision</samp>’</dt>
13203 <dd><p>Set the mathematical precision.
13205 <p>This determines which input sample formats will be allowed, which affects the
13206 precision of the volume scaling.
13208 <dl compact="compact">
13209 <dt> ‘<samp>fixed</samp>’</dt>
13210 <dd><p>8-bit fixed-point; limits input sample format to U8, S16, and S32.
13212 <dt> ‘<samp>float</samp>’</dt>
13213 <dd><p>32-bit floating-point; limits input sample format to FLT. (default)
13215 <dt> ‘<samp>double</samp>’</dt>
13216 <dd><p>64-bit floating-point; limits input sample format to DBL.
13222 <a name="Examples-80"></a>
13223 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-80">30.40.1 Examples</a></h3>
13227 Halve the input audio volume:
13228 <table><tr><td> </td><td><pre class="example">volume=volume=0.5
13230 volume=volume=-6.0206dB
13231 </pre></td></tr></table>
13233 <p>In all the above example the named key for ‘<samp>volume</samp>’ can be
13234 omitted, for example like in:
13235 </p><table><tr><td> </td><td><pre class="example">volume=0.5
13236 </pre></td></tr></table>
13239 Increase input audio power by 6 decibels using fixed-point precision:
13240 <table><tr><td> </td><td><pre class="example">volume=volume=6dB:precision=fixed
13241 </pre></td></tr></table>
13244 <a name="volumedetect"></a>
13245 <h2 class="section"><a href="ffplay-all.html#toc-volumedetect">30.41 volumedetect</a></h2>
13247 <p>Detect the volume of the input video.
13249 <p>The filter has no parameters. The input is not modified. Statistics about
13250 the volume will be printed in the log when the input stream end is reached.
13252 <p>In particular it will show the mean volume (root mean square), maximum
13253 volume (on a per-sample basis), and the beginning of a histogram of the
13254 registered volume values (from the maximum value to a cumulated 1/1000 of
13257 <p>All volumes are in decibels relative to the maximum PCM value.
13259 <a name="Examples-55"></a>
13260 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-55">30.41.1 Examples</a></h3>
13262 <p>Here is an excerpt of the output:
13263 </p><table><tr><td> </td><td><pre class="example">[Parsed_volumedetect_0 0xa23120] mean_volume: -27 dB
13264 [Parsed_volumedetect_0 0xa23120] max_volume: -4 dB
13265 [Parsed_volumedetect_0 0xa23120] histogram_4db: 6
13266 [Parsed_volumedetect_0 0xa23120] histogram_5db: 62
13267 [Parsed_volumedetect_0 0xa23120] histogram_6db: 286
13268 [Parsed_volumedetect_0 0xa23120] histogram_7db: 1042
13269 [Parsed_volumedetect_0 0xa23120] histogram_8db: 2551
13270 [Parsed_volumedetect_0 0xa23120] histogram_9db: 4609
13271 [Parsed_volumedetect_0 0xa23120] histogram_10db: 8409
13272 </pre></td></tr></table>
13277 The mean square energy is approximately -27 dB, or 10^-2.7.
13279 The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB.
13281 There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc.
13284 <p>In other words, raising the volume by +4 dB does not cause any clipping,
13285 raising it by +5 dB causes clipping for 6 samples, etc.
13288 <a name="Audio-Sources"></a>
13289 <h1 class="chapter"><a href="ffplay-all.html#toc-Audio-Sources">31. Audio Sources</a></h1>
13291 <p>Below is a description of the currently available audio sources.
13293 <a name="abuffer"></a>
13294 <h2 class="section"><a href="ffplay-all.html#toc-abuffer">31.1 abuffer</a></h2>
13296 <p>Buffer audio frames, and make them available to the filter chain.
13298 <p>This source is mainly intended for a programmatic use, in particular
13299 through the interface defined in ‘<tt>libavfilter/asrc_abuffer.h</tt>’.
13301 <p>It accepts the following named parameters:
13303 <dl compact="compact">
13304 <dt> ‘<samp>time_base</samp>’</dt>
13305 <dd><p>Timebase which will be used for timestamps of submitted frames. It must be
13306 either a floating-point number or in <var>numerator</var>/<var>denominator</var> form.
13309 <dt> ‘<samp>sample_rate</samp>’</dt>
13310 <dd><p>The sample rate of the incoming audio buffers.
13313 <dt> ‘<samp>sample_fmt</samp>’</dt>
13314 <dd><p>The sample format of the incoming audio buffers.
13315 Either a sample format name or its corresponging integer representation from
13316 the enum AVSampleFormat in ‘<tt>libavutil/samplefmt.h</tt>’
13319 <dt> ‘<samp>channel_layout</samp>’</dt>
13320 <dd><p>The channel layout of the incoming audio buffers.
13321 Either a channel layout name from channel_layout_map in
13322 ‘<tt>libavutil/channel_layout.c</tt>’ or its corresponding integer representation
13323 from the AV_CH_LAYOUT_* macros in ‘<tt>libavutil/channel_layout.h</tt>’
13326 <dt> ‘<samp>channels</samp>’</dt>
13327 <dd><p>The number of channels of the incoming audio buffers.
13328 If both <var>channels</var> and <var>channel_layout</var> are specified, then they
13329 must be consistent.
13334 <a name="Examples-27"></a>
13335 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-27">31.1.1 Examples</a></h3>
13337 <table><tr><td> </td><td><pre class="example">abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
13338 </pre></td></tr></table>
13340 <p>will instruct the source to accept planar 16bit signed stereo at 44100Hz.
13341 Since the sample format with name "s16p" corresponds to the number
13342 6 and the "stereo" channel layout corresponds to the value 0x3, this is
13344 </p><table><tr><td> </td><td><pre class="example">abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
13345 </pre></td></tr></table>
13347 <a name="aevalsrc"></a>
13348 <h2 class="section"><a href="ffplay-all.html#toc-aevalsrc">31.2 aevalsrc</a></h2>
13350 <p>Generate an audio signal specified by an expression.
13352 <p>This source accepts in input one or more expressions (one for each
13353 channel), which are evaluated and used to generate a corresponding
13356 <p>This source accepts the following options:
13358 <dl compact="compact">
13359 <dt> ‘<samp>exprs</samp>’</dt>
13360 <dd><p>Set the ’|’-separated expressions list for each separate channel. In case the
13361 ‘<samp>channel_layout</samp>’ option is not specified, the selected channel layout
13362 depends on the number of provided expressions. Otherwise the last
13363 specified expression is applied to the remaining output channels.
13366 <dt> ‘<samp>channel_layout, c</samp>’</dt>
13367 <dd><p>Set the channel layout. The number of channels in the specified layout
13368 must be equal to the number of specified expressions.
13371 <dt> ‘<samp>duration, d</samp>’</dt>
13372 <dd><p>Set the minimum duration of the sourced audio. See the function
13373 <code>av_parse_time()</code> for the accepted format.
13374 Note that the resulting duration may be greater than the specified
13375 duration, as the generated audio is always cut at the end of a
13378 <p>If not specified, or the expressed duration is negative, the audio is
13379 supposed to be generated forever.
13382 <dt> ‘<samp>nb_samples, n</samp>’</dt>
13383 <dd><p>Set the number of samples per channel per each output frame,
13387 <dt> ‘<samp>sample_rate, s</samp>’</dt>
13388 <dd><p>Specify the sample rate, default to 44100.
13392 <p>Each expression in <var>exprs</var> can contain the following constants:
13394 <dl compact="compact">
13395 <dt> ‘<samp>n</samp>’</dt>
13396 <dd><p>number of the evaluated sample, starting from 0
13399 <dt> ‘<samp>t</samp>’</dt>
13400 <dd><p>time of the evaluated sample expressed in seconds, starting from 0
13403 <dt> ‘<samp>s</samp>’</dt>
13409 <a name="Examples-78"></a>
13410 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-78">31.2.1 Examples</a></h3>
13415 <table><tr><td> </td><td><pre class="example">aevalsrc=0
13416 </pre></td></tr></table>
13419 Generate a sin signal with frequency of 440 Hz, set sample rate to
13421 <table><tr><td> </td><td><pre class="example">aevalsrc="sin(440*2*PI*t):s=8000"
13422 </pre></td></tr></table>
13425 Generate a two channels signal, specify the channel layout (Front
13426 Center + Back Center) explicitly:
13427 <table><tr><td> </td><td><pre class="example">aevalsrc="sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC"
13428 </pre></td></tr></table>
13431 Generate white noise:
13432 <table><tr><td> </td><td><pre class="example">aevalsrc="-2+random(0)"
13433 </pre></td></tr></table>
13436 Generate an amplitude modulated signal:
13437 <table><tr><td> </td><td><pre class="example">aevalsrc="sin(10*2*PI*t)*sin(880*2*PI*t)"
13438 </pre></td></tr></table>
13441 Generate 2.5 Hz binaural beats on a 360 Hz carrier:
13442 <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)"
13443 </pre></td></tr></table>
13447 <a name="anullsrc"></a>
13448 <h2 class="section"><a href="ffplay-all.html#toc-anullsrc">31.3 anullsrc</a></h2>
13450 <p>Null audio source, return unprocessed audio frames. It is mainly useful
13451 as a template and to be employed in analysis / debugging tools, or as
13452 the source for filters which ignore the input data (for example the sox
13455 <p>This source accepts the following options:
13457 <dl compact="compact">
13458 <dt> ‘<samp>channel_layout, cl</samp>’</dt>
13460 <p>Specify the channel layout, and can be either an integer or a string
13461 representing a channel layout. The default value of <var>channel_layout</var>
13462 is "stereo".
13464 <p>Check the channel_layout_map definition in
13465 ‘<tt>libavutil/channel_layout.c</tt>’ for the mapping between strings and
13466 channel layout values.
13469 <dt> ‘<samp>sample_rate, r</samp>’</dt>
13470 <dd><p>Specify the sample rate, and defaults to 44100.
13473 <dt> ‘<samp>nb_samples, n</samp>’</dt>
13474 <dd><p>Set the number of samples per requested frames.
13479 <a name="Examples-84"></a>
13480 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-84">31.3.1 Examples</a></h3>
13484 Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO.
13485 <table><tr><td> </td><td><pre class="example">anullsrc=r=48000:cl=4
13486 </pre></td></tr></table>
13489 Do the same operation with a more obvious syntax:
13490 <table><tr><td> </td><td><pre class="example">anullsrc=r=48000:cl=mono
13491 </pre></td></tr></table>
13494 <p>All the parameters need to be explicitly defined.
13496 <a name="flite"></a>
13497 <h2 class="section"><a href="ffplay-all.html#toc-flite">31.4 flite</a></h2>
13499 <p>Synthesize a voice utterance using the libflite library.
13501 <p>To enable compilation of this filter you need to configure FFmpeg with
13502 <code>--enable-libflite</code>.
13504 <p>Note that the flite library is not thread-safe.
13506 <p>The filter accepts the following options:
13508 <dl compact="compact">
13509 <dt> ‘<samp>list_voices</samp>’</dt>
13510 <dd><p>If set to 1, list the names of the available voices and exit
13511 immediately. Default value is 0.
13514 <dt> ‘<samp>nb_samples, n</samp>’</dt>
13515 <dd><p>Set the maximum number of samples per frame. Default value is 512.
13518 <dt> ‘<samp>textfile</samp>’</dt>
13519 <dd><p>Set the filename containing the text to speak.
13522 <dt> ‘<samp>text</samp>’</dt>
13523 <dd><p>Set the text to speak.
13526 <dt> ‘<samp>voice, v</samp>’</dt>
13527 <dd><p>Set the voice to use for the speech synthesis. Default value is
13528 <code>kal</code>. See also the <var>list_voices</var> option.
13532 <a name="Examples-85"></a>
13533 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-85">31.4.1 Examples</a></h3>
13537 Read from file ‘<tt>speech.txt</tt>’, and synthetize the text using the
13538 standard flite voice:
13539 <table><tr><td> </td><td><pre class="example">flite=textfile=speech.txt
13540 </pre></td></tr></table>
13543 Read the specified text selecting the <code>slt</code> voice:
13544 <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
13545 </pre></td></tr></table>
13548 Input text to ffmpeg:
13549 <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
13550 </pre></td></tr></table>
13553 Make ‘<tt>ffplay</tt>’ speak the specified text, using <code>flite</code> and
13554 the <code>lavfi</code> device:
13555 <table><tr><td> </td><td><pre class="example">ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.'
13556 </pre></td></tr></table>
13559 <p>For more information about libflite, check:
13560 <a href="http://www.speech.cs.cmu.edu/flite/">http://www.speech.cs.cmu.edu/flite/</a>
13562 <a name="sine"></a>
13563 <h2 class="section"><a href="ffplay-all.html#toc-sine">31.5 sine</a></h2>
13565 <p>Generate an audio signal made of a sine wave with amplitude 1/8.
13567 <p>The audio signal is bit-exact.
13569 <p>The filter accepts the following options:
13571 <dl compact="compact">
13572 <dt> ‘<samp>frequency, f</samp>’</dt>
13573 <dd><p>Set the carrier frequency. Default is 440 Hz.
13576 <dt> ‘<samp>beep_factor, b</samp>’</dt>
13577 <dd><p>Enable a periodic beep every second with frequency <var>beep_factor</var> times
13578 the carrier frequency. Default is 0, meaning the beep is disabled.
13581 <dt> ‘<samp>sample_rate, r</samp>’</dt>
13582 <dd><p>Specify the sample rate, default is 44100.
13585 <dt> ‘<samp>duration, d</samp>’</dt>
13586 <dd><p>Specify the duration of the generated audio stream.
13589 <dt> ‘<samp>samples_per_frame</samp>’</dt>
13590 <dd><p>Set the number of samples per output frame, default is 1024.
13594 <a name="Examples-32"></a>
13595 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-32">31.5.1 Examples</a></h3>
13599 Generate a simple 440 Hz sine wave:
13600 <table><tr><td> </td><td><pre class="example">sine
13601 </pre></td></tr></table>
13604 Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds:
13605 <table><tr><td> </td><td><pre class="example">sine=220:4:d=5
13607 sine=frequency=220:beep_factor=4:duration=5
13608 </pre></td></tr></table>
13613 <a name="Audio-Sinks"></a>
13614 <h1 class="chapter"><a href="ffplay-all.html#toc-Audio-Sinks">32. Audio Sinks</a></h1>
13616 <p>Below is a description of the currently available audio sinks.
13618 <a name="abuffersink"></a>
13619 <h2 class="section"><a href="ffplay-all.html#toc-abuffersink">32.1 abuffersink</a></h2>
13621 <p>Buffer audio frames, and make them available to the end of filter chain.
13623 <p>This sink is mainly intended for programmatic use, in particular
13624 through the interface defined in ‘<tt>libavfilter/buffersink.h</tt>’
13625 or the options system.
13627 <p>It accepts a pointer to an AVABufferSinkContext structure, which
13628 defines the incoming buffers’ formats, to be passed as the opaque
13629 parameter to <code>avfilter_init_filter</code> for initialization.
13631 <a name="anullsink"></a>
13632 <h2 class="section"><a href="ffplay-all.html#toc-anullsink">32.2 anullsink</a></h2>
13634 <p>Null audio sink, do absolutely nothing with the input audio. It is
13635 mainly useful as a template and to be employed in analysis / debugging
13639 <a name="Video-Filters"></a>
13640 <h1 class="chapter"><a href="ffplay-all.html#toc-Video-Filters">33. Video Filters</a></h1>
13642 <p>When you configure your FFmpeg build, you can disable any of the
13643 existing filters using <code>--disable-filters</code>.
13644 The configure output will show the video filters included in your
13647 <p>Below is a description of the currently available video filters.
13649 <a name="alphaextract"></a>
13650 <h2 class="section"><a href="ffplay-all.html#toc-alphaextract">33.1 alphaextract</a></h2>
13652 <p>Extract the alpha component from the input as a grayscale video. This
13653 is especially useful with the <var>alphamerge</var> filter.
13655 <a name="alphamerge"></a>
13656 <h2 class="section"><a href="ffplay-all.html#toc-alphamerge">33.2 alphamerge</a></h2>
13658 <p>Add or replace the alpha component of the primary input with the
13659 grayscale value of a second input. This is intended for use with
13660 <var>alphaextract</var> to allow the transmission or storage of frame
13661 sequences that have alpha in a format that doesn’t support an alpha
13664 <p>For example, to reconstruct full frames from a normal YUV-encoded video
13665 and a separate video created with <var>alphaextract</var>, you might use:
13666 </p><table><tr><td> </td><td><pre class="example">movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
13667 </pre></td></tr></table>
13669 <p>Since this filter is designed for reconstruction, it operates on frame
13670 sequences without considering timestamps, and terminates when either
13671 input reaches end of stream. This will cause problems if your encoding
13672 pipeline drops frames. If you’re trying to apply an image as an
13673 overlay to a video stream, consider the <var>overlay</var> filter instead.
13676 <h2 class="section"><a href="ffplay-all.html#toc-ass">33.3 ass</a></h2>
13678 <p>Same as the <a href="#subtitles">subtitles</a> filter, except that it doesn’t require libavcodec
13679 and libavformat to work. On the other hand, it is limited to ASS (Advanced
13680 Substation Alpha) subtitles files.
13682 <a name="bbox"></a>
13683 <h2 class="section"><a href="ffplay-all.html#toc-bbox">33.4 bbox</a></h2>
13685 <p>Compute the bounding box for the non-black pixels in the input frame
13688 <p>This filter computes the bounding box containing all the pixels with a
13689 luminance value greater than the minimum allowed value.
13690 The parameters describing the bounding box are printed on the filter
13693 <p>The filter accepts the following option:
13695 <dl compact="compact">
13696 <dt> ‘<samp>min_val</samp>’</dt>
13697 <dd><p>Set the minimal luminance value. Default is <code>16</code>.
13701 <a name="blackdetect"></a>
13702 <h2 class="section"><a href="ffplay-all.html#toc-blackdetect">33.5 blackdetect</a></h2>
13704 <p>Detect video intervals that are (almost) completely black. Can be
13705 useful to detect chapter transitions, commercials, or invalid
13706 recordings. Output lines contains the time for the start, end and
13707 duration of the detected black interval expressed in seconds.
13709 <p>In order to display the output lines, you need to set the loglevel at
13710 least to the AV_LOG_INFO value.
13712 <p>The filter accepts the following options:
13714 <dl compact="compact">
13715 <dt> ‘<samp>black_min_duration, d</samp>’</dt>
13716 <dd><p>Set the minimum detected black duration expressed in seconds. It must
13717 be a non-negative floating point number.
13719 <p>Default value is 2.0.
13722 <dt> ‘<samp>picture_black_ratio_th, pic_th</samp>’</dt>
13723 <dd><p>Set the threshold for considering a picture "black".
13724 Express the minimum value for the ratio:
13725 </p><table><tr><td> </td><td><pre class="example"><var>nb_black_pixels</var> / <var>nb_pixels</var>
13726 </pre></td></tr></table>
13728 <p>for which a picture is considered black.
13729 Default value is 0.98.
13732 <dt> ‘<samp>pixel_black_th, pix_th</samp>’</dt>
13733 <dd><p>Set the threshold for considering a pixel "black".
13735 <p>The threshold expresses the maximum pixel luminance value for which a
13736 pixel is considered "black". The provided value is scaled according to
13737 the following equation:
13738 </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>
13739 </pre></td></tr></table>
13741 <p><var>luminance_range_size</var> and <var>luminance_minimum_value</var> depend on
13742 the input video format, the range is [0-255] for YUV full-range
13743 formats and [16-235] for YUV non full-range formats.
13745 <p>Default value is 0.10.
13749 <p>The following example sets the maximum pixel threshold to the minimum
13750 value, and detects only black intervals of 2 or more seconds:
13751 </p><table><tr><td> </td><td><pre class="example">blackdetect=d=2:pix_th=0.00
13752 </pre></td></tr></table>
13754 <a name="blackframe"></a>
13755 <h2 class="section"><a href="ffplay-all.html#toc-blackframe">33.6 blackframe</a></h2>
13757 <p>Detect frames that are (almost) completely black. Can be useful to
13758 detect chapter transitions or commercials. Output lines consist of
13759 the frame number of the detected frame, the percentage of blackness,
13760 the position in the file if known or -1 and the timestamp in seconds.
13762 <p>In order to display the output lines, you need to set the loglevel at
13763 least to the AV_LOG_INFO value.
13765 <p>The filter accepts the following options:
13767 <dl compact="compact">
13768 <dt> ‘<samp>amount</samp>’</dt>
13769 <dd><p>Set the percentage of the pixels that have to be below the threshold, defaults
13770 to <code>98</code>.
13773 <dt> ‘<samp>threshold, thresh</samp>’</dt>
13774 <dd><p>Set the threshold below which a pixel value is considered black, defaults to
13780 <a name="blend"></a>
13781 <h2 class="section"><a href="ffplay-all.html#toc-blend">33.7 blend</a></h2>
13783 <p>Blend two video frames into each other.
13785 <p>It takes two input streams and outputs one stream, the first input is the
13786 "top" layer and second input is "bottom" layer.
13787 Output terminates when shortest input terminates.
13789 <p>A description of the accepted options follows.
13791 <dl compact="compact">
13792 <dt> ‘<samp>c0_mode</samp>’</dt>
13793 <dt> ‘<samp>c1_mode</samp>’</dt>
13794 <dt> ‘<samp>c2_mode</samp>’</dt>
13795 <dt> ‘<samp>c3_mode</samp>’</dt>
13796 <dt> ‘<samp>all_mode</samp>’</dt>
13797 <dd><p>Set blend mode for specific pixel component or all pixel components in case
13798 of <var>all_mode</var>. Default value is <code>normal</code>.
13800 <p>Available values for component modes are:
13801 </p><dl compact="compact">
13802 <dt> ‘<samp>addition</samp>’</dt>
13803 <dt> ‘<samp>and</samp>’</dt>
13804 <dt> ‘<samp>average</samp>’</dt>
13805 <dt> ‘<samp>burn</samp>’</dt>
13806 <dt> ‘<samp>darken</samp>’</dt>
13807 <dt> ‘<samp>difference</samp>’</dt>
13808 <dt> ‘<samp>divide</samp>’</dt>
13809 <dt> ‘<samp>dodge</samp>’</dt>
13810 <dt> ‘<samp>exclusion</samp>’</dt>
13811 <dt> ‘<samp>hardlight</samp>’</dt>
13812 <dt> ‘<samp>lighten</samp>’</dt>
13813 <dt> ‘<samp>multiply</samp>’</dt>
13814 <dt> ‘<samp>negation</samp>’</dt>
13815 <dt> ‘<samp>normal</samp>’</dt>
13816 <dt> ‘<samp>or</samp>’</dt>
13817 <dt> ‘<samp>overlay</samp>’</dt>
13818 <dt> ‘<samp>phoenix</samp>’</dt>
13819 <dt> ‘<samp>pinlight</samp>’</dt>
13820 <dt> ‘<samp>reflect</samp>’</dt>
13821 <dt> ‘<samp>screen</samp>’</dt>
13822 <dt> ‘<samp>softlight</samp>’</dt>
13823 <dt> ‘<samp>subtract</samp>’</dt>
13824 <dt> ‘<samp>vividlight</samp>’</dt>
13825 <dt> ‘<samp>xor</samp>’</dt>
13829 <dt> ‘<samp>c0_opacity</samp>’</dt>
13830 <dt> ‘<samp>c1_opacity</samp>’</dt>
13831 <dt> ‘<samp>c2_opacity</samp>’</dt>
13832 <dt> ‘<samp>c3_opacity</samp>’</dt>
13833 <dt> ‘<samp>all_opacity</samp>’</dt>
13834 <dd><p>Set blend opacity for specific pixel component or all pixel components in case
13835 of <var>all_opacity</var>. Only used in combination with pixel component blend modes.
13838 <dt> ‘<samp>c0_expr</samp>’</dt>
13839 <dt> ‘<samp>c1_expr</samp>’</dt>
13840 <dt> ‘<samp>c2_expr</samp>’</dt>
13841 <dt> ‘<samp>c3_expr</samp>’</dt>
13842 <dt> ‘<samp>all_expr</samp>’</dt>
13843 <dd><p>Set blend expression for specific pixel component or all pixel components in case
13844 of <var>all_expr</var>. Note that related mode options will be ignored if those are set.
13846 <p>The expressions can use the following variables:
13848 <dl compact="compact">
13849 <dt> ‘<samp>N</samp>’</dt>
13850 <dd><p>The sequential number of the filtered frame, starting from <code>0</code>.
13853 <dt> ‘<samp>X</samp>’</dt>
13854 <dt> ‘<samp>Y</samp>’</dt>
13855 <dd><p>the coordinates of the current sample
13858 <dt> ‘<samp>W</samp>’</dt>
13859 <dt> ‘<samp>H</samp>’</dt>
13860 <dd><p>the width and height of currently filtered plane
13863 <dt> ‘<samp>SW</samp>’</dt>
13864 <dt> ‘<samp>SH</samp>’</dt>
13865 <dd><p>Width and height scale depending on the currently filtered plane. It is the
13866 ratio between the corresponding luma plane number of pixels and the current
13867 plane ones. E.g. for YUV4:2:0 the values are <code>1,1</code> for the luma plane, and
13868 <code>0.5,0.5</code> for chroma planes.
13871 <dt> ‘<samp>T</samp>’</dt>
13872 <dd><p>Time of the current frame, expressed in seconds.
13875 <dt> ‘<samp>TOP, A</samp>’</dt>
13876 <dd><p>Value of pixel component at current location for first video frame (top layer).
13879 <dt> ‘<samp>BOTTOM, B</samp>’</dt>
13880 <dd><p>Value of pixel component at current location for second video frame (bottom layer).
13885 <dt> ‘<samp>shortest</samp>’</dt>
13886 <dd><p>Force termination when the shortest input terminates. Default is <code>0</code>.
13888 <dt> ‘<samp>repeatlast</samp>’</dt>
13889 <dd><p>Continue applying the last bottom frame after the end of the stream. A value of
13890 <code>0</code> disable the filter after the last frame of the bottom layer is reached.
13891 Default is <code>1</code>.
13895 <a name="Examples-54"></a>
13896 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-54">33.7.1 Examples</a></h3>
13900 Apply transition from bottom layer to top layer in first 10 seconds:
13901 <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)))'
13902 </pre></td></tr></table>
13905 Apply 1x1 checkerboard effect:
13906 <table><tr><td> </td><td><pre class="example">blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
13907 </pre></td></tr></table>
13910 Apply uncover left effect:
13911 <table><tr><td> </td><td><pre class="example">blend=all_expr='if(gte(N*SW+X,W),A,B)'
13912 </pre></td></tr></table>
13915 Apply uncover down effect:
13916 <table><tr><td> </td><td><pre class="example">blend=all_expr='if(gte(Y-N*SH,0),A,B)'
13917 </pre></td></tr></table>
13920 Apply uncover up-left effect:
13921 <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)'
13922 </pre></td></tr></table>
13925 <a name="boxblur"></a>
13926 <h2 class="section"><a href="ffplay-all.html#toc-boxblur">33.8 boxblur</a></h2>
13928 <p>Apply boxblur algorithm to the input video.
13930 <p>The filter accepts the following options:
13932 <dl compact="compact">
13933 <dt> ‘<samp>luma_radius, lr</samp>’</dt>
13934 <dt> ‘<samp>luma_power, lp</samp>’</dt>
13935 <dt> ‘<samp>chroma_radius, cr</samp>’</dt>
13936 <dt> ‘<samp>chroma_power, cp</samp>’</dt>
13937 <dt> ‘<samp>alpha_radius, ar</samp>’</dt>
13938 <dt> ‘<samp>alpha_power, ap</samp>’</dt>
13941 <p>A description of the accepted options follows.
13943 <dl compact="compact">
13944 <dt> ‘<samp>luma_radius, lr</samp>’</dt>
13945 <dt> ‘<samp>chroma_radius, cr</samp>’</dt>
13946 <dt> ‘<samp>alpha_radius, ar</samp>’</dt>
13947 <dd><p>Set an expression for the box radius in pixels used for blurring the
13948 corresponding input plane.
13950 <p>The radius value must be a non-negative number, and must not be
13951 greater than the value of the expression <code>min(w,h)/2</code> for the
13952 luma and alpha planes, and of <code>min(cw,ch)/2</code> for the chroma
13955 <p>Default value for ‘<samp>luma_radius</samp>’ is "2". If not specified,
13956 ‘<samp>chroma_radius</samp>’ and ‘<samp>alpha_radius</samp>’ default to the
13957 corresponding value set for ‘<samp>luma_radius</samp>’.
13959 <p>The expressions can contain the following constants:
13960 </p><dl compact="compact">
13961 <dt> ‘<samp>w</samp>’</dt>
13962 <dt> ‘<samp>h</samp>’</dt>
13963 <dd><p>the input width and height in pixels
13966 <dt> ‘<samp>cw</samp>’</dt>
13967 <dt> ‘<samp>ch</samp>’</dt>
13968 <dd><p>the input chroma image width and height in pixels
13971 <dt> ‘<samp>hsub</samp>’</dt>
13972 <dt> ‘<samp>vsub</samp>’</dt>
13973 <dd><p>horizontal and vertical chroma subsample values. For example for the
13974 pixel format "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
13979 <dt> ‘<samp>luma_power, lp</samp>’</dt>
13980 <dt> ‘<samp>chroma_power, cp</samp>’</dt>
13981 <dt> ‘<samp>alpha_power, ap</samp>’</dt>
13982 <dd><p>Specify how many times the boxblur filter is applied to the
13983 corresponding plane.
13985 <p>Default value for ‘<samp>luma_power</samp>’ is 2. If not specified,
13986 ‘<samp>chroma_power</samp>’ and ‘<samp>alpha_power</samp>’ default to the
13987 corresponding value set for ‘<samp>luma_power</samp>’.
13989 <p>A value of 0 will disable the effect.
13993 <a name="Examples-4"></a>
13994 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-4">33.8.1 Examples</a></h3>
13998 Apply a boxblur filter with luma, chroma, and alpha radius
14000 <table><tr><td> </td><td><pre class="example">boxblur=luma_radius=2:luma_power=1
14002 </pre></td></tr></table>
14005 Set luma radius to 2, alpha and chroma radius to 0:
14006 <table><tr><td> </td><td><pre class="example">boxblur=2:1:cr=0:ar=0
14007 </pre></td></tr></table>
14010 Set luma and chroma radius to a fraction of the video dimension:
14011 <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
14012 </pre></td></tr></table>
14015 <a name="colorbalance"></a>
14016 <h2 class="section"><a href="ffplay-all.html#toc-colorbalance">33.9 colorbalance</a></h2>
14017 <p>Modify intensity of primary colors (red, green and blue) of input frames.
14019 <p>The filter allows an input frame to be adjusted in the shadows, midtones or highlights
14020 regions for the red-cyan, green-magenta or blue-yellow balance.
14022 <p>A positive adjustment value shifts the balance towards the primary color, a negative
14023 value towards the complementary color.
14025 <p>The filter accepts the following options:
14027 <dl compact="compact">
14028 <dt> ‘<samp>rs</samp>’</dt>
14029 <dt> ‘<samp>gs</samp>’</dt>
14030 <dt> ‘<samp>bs</samp>’</dt>
14031 <dd><p>Adjust red, green and blue shadows (darkest pixels).
14034 <dt> ‘<samp>rm</samp>’</dt>
14035 <dt> ‘<samp>gm</samp>’</dt>
14036 <dt> ‘<samp>bm</samp>’</dt>
14037 <dd><p>Adjust red, green and blue midtones (medium pixels).
14040 <dt> ‘<samp>rh</samp>’</dt>
14041 <dt> ‘<samp>gh</samp>’</dt>
14042 <dt> ‘<samp>bh</samp>’</dt>
14043 <dd><p>Adjust red, green and blue highlights (brightest pixels).
14045 <p>Allowed ranges for options are <code>[-1.0, 1.0]</code>. Defaults are <code>0</code>.
14049 <a name="Examples-89"></a>
14050 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-89">33.9.1 Examples</a></h3>
14054 Add red color cast to shadows:
14055 <table><tr><td> </td><td><pre class="example">colorbalance=rs=.3
14056 </pre></td></tr></table>
14059 <a name="colorchannelmixer"></a>
14060 <h2 class="section"><a href="ffplay-all.html#toc-colorchannelmixer">33.10 colorchannelmixer</a></h2>
14062 <p>Adjust video input frames by re-mixing color channels.
14064 <p>This filter modifies a color channel by adding the values associated to
14065 the other channels of the same pixels. For example if the value to
14066 modify is red, the output value will be:
14067 </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>
14068 </pre></td></tr></table>
14070 <p>The filter accepts the following options:
14072 <dl compact="compact">
14073 <dt> ‘<samp>rr</samp>’</dt>
14074 <dt> ‘<samp>rg</samp>’</dt>
14075 <dt> ‘<samp>rb</samp>’</dt>
14076 <dt> ‘<samp>ra</samp>’</dt>
14077 <dd><p>Adjust contribution of input red, green, blue and alpha channels for output red channel.
14078 Default is <code>1</code> for <var>rr</var>, and <code>0</code> for <var>rg</var>, <var>rb</var> and <var>ra</var>.
14081 <dt> ‘<samp>gr</samp>’</dt>
14082 <dt> ‘<samp>gg</samp>’</dt>
14083 <dt> ‘<samp>gb</samp>’</dt>
14084 <dt> ‘<samp>ga</samp>’</dt>
14085 <dd><p>Adjust contribution of input red, green, blue and alpha channels for output green channel.
14086 Default is <code>1</code> for <var>gg</var>, and <code>0</code> for <var>gr</var>, <var>gb</var> and <var>ga</var>.
14089 <dt> ‘<samp>br</samp>’</dt>
14090 <dt> ‘<samp>bg</samp>’</dt>
14091 <dt> ‘<samp>bb</samp>’</dt>
14092 <dt> ‘<samp>ba</samp>’</dt>
14093 <dd><p>Adjust contribution of input red, green, blue and alpha channels for output blue channel.
14094 Default is <code>1</code> for <var>bb</var>, and <code>0</code> for <var>br</var>, <var>bg</var> and <var>ba</var>.
14097 <dt> ‘<samp>ar</samp>’</dt>
14098 <dt> ‘<samp>ag</samp>’</dt>
14099 <dt> ‘<samp>ab</samp>’</dt>
14100 <dt> ‘<samp>aa</samp>’</dt>
14101 <dd><p>Adjust contribution of input red, green, blue and alpha channels for output alpha channel.
14102 Default is <code>1</code> for <var>aa</var>, and <code>0</code> for <var>ar</var>, <var>ag</var> and <var>ab</var>.
14104 <p>Allowed ranges for options are <code>[-2.0, 2.0]</code>.
14108 <a name="Examples-65"></a>
14109 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-65">33.10.1 Examples</a></h3>
14113 Convert source to grayscale:
14114 <table><tr><td> </td><td><pre class="example">colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
14115 </pre></td></tr></table>
14117 Simulate sepia tones:
14118 <table><tr><td> </td><td><pre class="example">colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131
14119 </pre></td></tr></table>
14122 <a name="colormatrix"></a>
14123 <h2 class="section"><a href="ffplay-all.html#toc-colormatrix">33.11 colormatrix</a></h2>
14125 <p>Convert color matrix.
14127 <p>The filter accepts the following options:
14129 <dl compact="compact">
14130 <dt> ‘<samp>src</samp>’</dt>
14131 <dt> ‘<samp>dst</samp>’</dt>
14132 <dd><p>Specify the source and destination color matrix. Both values must be
14135 <p>The accepted values are:
14136 </p><dl compact="compact">
14137 <dt> ‘<samp>bt709</samp>’</dt>
14141 <dt> ‘<samp>bt601</samp>’</dt>
14145 <dt> ‘<samp>smpte240m</samp>’</dt>
14149 <dt> ‘<samp>fcc</samp>’</dt>
14156 <p>For example to convert from BT.601 to SMPTE-240M, use the command:
14157 </p><table><tr><td> </td><td><pre class="example">colormatrix=bt601:smpte240m
14158 </pre></td></tr></table>
14160 <a name="copy"></a>
14161 <h2 class="section"><a href="ffplay-all.html#toc-copy">33.12 copy</a></h2>
14163 <p>Copy the input source unchanged to the output. Mainly useful for
14166 <a name="crop"></a>
14167 <h2 class="section"><a href="ffplay-all.html#toc-crop">33.13 crop</a></h2>
14169 <p>Crop the input video to given dimensions.
14171 <p>The filter accepts the following options:
14173 <dl compact="compact">
14174 <dt> ‘<samp>w, out_w</samp>’</dt>
14175 <dd><p>Width of the output video. It defaults to <code>iw</code>.
14176 This expression is evaluated only once during the filter
14180 <dt> ‘<samp>h, out_h</samp>’</dt>
14181 <dd><p>Height of the output video. It defaults to <code>ih</code>.
14182 This expression is evaluated only once during the filter
14186 <dt> ‘<samp>x</samp>’</dt>
14187 <dd><p>Horizontal position, in the input video, of the left edge of the output video.
14188 It defaults to <code>(in_w-out_w)/2</code>.
14189 This expression is evaluated per-frame.
14192 <dt> ‘<samp>y</samp>’</dt>
14193 <dd><p>Vertical position, in the input video, of the top edge of the output video.
14194 It defaults to <code>(in_h-out_h)/2</code>.
14195 This expression is evaluated per-frame.
14198 <dt> ‘<samp>keep_aspect</samp>’</dt>
14199 <dd><p>If set to 1 will force the output display aspect ratio
14200 to be the same of the input, by changing the output sample aspect
14201 ratio. It defaults to 0.
14205 <p>The <var>out_w</var>, <var>out_h</var>, <var>x</var>, <var>y</var> parameters are
14206 expressions containing the following constants:
14208 <dl compact="compact">
14209 <dt> ‘<samp>x</samp>’</dt>
14210 <dt> ‘<samp>y</samp>’</dt>
14211 <dd><p>the computed values for <var>x</var> and <var>y</var>. They are evaluated for
14215 <dt> ‘<samp>in_w</samp>’</dt>
14216 <dt> ‘<samp>in_h</samp>’</dt>
14217 <dd><p>the input width and height
14220 <dt> ‘<samp>iw</samp>’</dt>
14221 <dt> ‘<samp>ih</samp>’</dt>
14222 <dd><p>same as <var>in_w</var> and <var>in_h</var>
14225 <dt> ‘<samp>out_w</samp>’</dt>
14226 <dt> ‘<samp>out_h</samp>’</dt>
14227 <dd><p>the output (cropped) width and height
14230 <dt> ‘<samp>ow</samp>’</dt>
14231 <dt> ‘<samp>oh</samp>’</dt>
14232 <dd><p>same as <var>out_w</var> and <var>out_h</var>
14235 <dt> ‘<samp>a</samp>’</dt>
14236 <dd><p>same as <var>iw</var> / <var>ih</var>
14239 <dt> ‘<samp>sar</samp>’</dt>
14240 <dd><p>input sample aspect ratio
14243 <dt> ‘<samp>dar</samp>’</dt>
14244 <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
14247 <dt> ‘<samp>hsub</samp>’</dt>
14248 <dt> ‘<samp>vsub</samp>’</dt>
14249 <dd><p>horizontal and vertical chroma subsample values. For example for the
14250 pixel format "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
14253 <dt> ‘<samp>n</samp>’</dt>
14254 <dd><p>the number of input frame, starting from 0
14257 <dt> ‘<samp>pos</samp>’</dt>
14258 <dd><p>the position in the file of the input frame, NAN if unknown
14261 <dt> ‘<samp>t</samp>’</dt>
14262 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
14267 <p>The expression for <var>out_w</var> may depend on the value of <var>out_h</var>,
14268 and the expression for <var>out_h</var> may depend on <var>out_w</var>, but they
14269 cannot depend on <var>x</var> and <var>y</var>, as <var>x</var> and <var>y</var> are
14270 evaluated after <var>out_w</var> and <var>out_h</var>.
14272 <p>The <var>x</var> and <var>y</var> parameters specify the expressions for the
14273 position of the top-left corner of the output (non-cropped) area. They
14274 are evaluated for each frame. If the evaluated value is not valid, it
14275 is approximated to the nearest valid value.
14277 <p>The expression for <var>x</var> may depend on <var>y</var>, and the expression
14278 for <var>y</var> may depend on <var>x</var>.
14280 <a name="Examples-8"></a>
14281 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-8">33.13.1 Examples</a></h3>
14285 Crop area with size 100x100 at position (12,34).
14286 <table><tr><td> </td><td><pre class="example">crop=100:100:12:34
14287 </pre></td></tr></table>
14289 <p>Using named options, the example above becomes:
14290 </p><table><tr><td> </td><td><pre class="example">crop=w=100:h=100:x=12:y=34
14291 </pre></td></tr></table>
14294 Crop the central input area with size 100x100:
14295 <table><tr><td> </td><td><pre class="example">crop=100:100
14296 </pre></td></tr></table>
14299 Crop the central input area with size 2/3 of the input video:
14300 <table><tr><td> </td><td><pre class="example">crop=2/3*in_w:2/3*in_h
14301 </pre></td></tr></table>
14304 Crop the input video central square:
14305 <table><tr><td> </td><td><pre class="example">crop=out_w=in_h
14307 </pre></td></tr></table>
14310 Delimit the rectangle with the top-left corner placed at position
14311 100:100 and the right-bottom corner corresponding to the right-bottom
14312 corner of the input image:
14313 <table><tr><td> </td><td><pre class="example">crop=in_w-100:in_h-100:100:100
14314 </pre></td></tr></table>
14317 Crop 10 pixels from the left and right borders, and 20 pixels from
14318 the top and bottom borders
14319 <table><tr><td> </td><td><pre class="example">crop=in_w-2*10:in_h-2*20
14320 </pre></td></tr></table>
14323 Keep only the bottom right quarter of the input image:
14324 <table><tr><td> </td><td><pre class="example">crop=in_w/2:in_h/2:in_w/2:in_h/2
14325 </pre></td></tr></table>
14328 Crop height for getting Greek harmony:
14329 <table><tr><td> </td><td><pre class="example">crop=in_w:1/PHI*in_w
14330 </pre></td></tr></table>
14333 Appply trembling effect:
14334 <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)
14335 </pre></td></tr></table>
14338 Apply erratic camera effect depending on timestamp:
14339 <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)"
14340 </pre></td></tr></table>
14343 Set x depending on the value of y:
14344 <table><tr><td> </td><td><pre class="example">crop=in_w/2:in_h/2:y:10+10*sin(n/10)
14345 </pre></td></tr></table>
14348 <a name="cropdetect"></a>
14349 <h2 class="section"><a href="ffplay-all.html#toc-cropdetect">33.14 cropdetect</a></h2>
14351 <p>Auto-detect crop size.
14353 <p>Calculate necessary cropping parameters and prints the recommended
14354 parameters through the logging system. The detected dimensions
14355 correspond to the non-black area of the input video.
14357 <p>The filter accepts the following options:
14359 <dl compact="compact">
14360 <dt> ‘<samp>limit</samp>’</dt>
14361 <dd><p>Set higher black value threshold, which can be optionally specified
14362 from nothing (0) to everything (255). An intensity value greater
14363 to the set value is considered non-black. Default value is 24.
14366 <dt> ‘<samp>round</samp>’</dt>
14367 <dd><p>Set the value for which the width/height should be divisible by. The
14368 offset is automatically adjusted to center the video. Use 2 to get
14369 only even dimensions (needed for 4:2:2 video). 16 is best when
14370 encoding to most video codecs. Default value is 16.
14373 <dt> ‘<samp>reset_count, reset</samp>’</dt>
14374 <dd><p>Set the counter that determines after how many frames cropdetect will
14375 reset the previously detected largest video area and start over to
14376 detect the current optimal crop area. Default value is 0.
14378 <p>This can be useful when channel logos distort the video area. 0
14379 indicates never reset and return the largest area encountered during
14384 <p><a name="curves"></a>
14385 </p><a name="curves-1"></a>
14386 <h2 class="section"><a href="ffplay-all.html#toc-curves-1">33.15 curves</a></h2>
14388 <p>Apply color adjustments using curves.
14390 <p>This filter is similar to the Adobe Photoshop and GIMP curves tools. Each
14391 component (red, green and blue) has its values defined by <var>N</var> key points
14392 tied from each other using a smooth curve. The x-axis represents the pixel
14393 values from the input frame, and the y-axis the new pixel values to be set for
14396 <p>By default, a component curve is defined by the two points <var>(0;0)</var> and
14397 <var>(1;1)</var>. This creates a straight line where each original pixel value is
14398 "adjusted" to its own value, which means no change to the image.
14400 <p>The filter allows you to redefine these two points and add some more. A new
14401 curve (using a natural cubic spline interpolation) will be define to pass
14402 smoothly through all these new coordinates. The new defined points needs to be
14403 strictly increasing over the x-axis, and their <var>x</var> and <var>y</var> values must
14404 be in the <var>[0;1]</var> interval. If the computed curves happened to go outside
14405 the vector spaces, the values will be clipped accordingly.
14407 <p>If there is no key point defined in <code>x=0</code>, the filter will automatically
14408 insert a <var>(0;0)</var> point. In the same way, if there is no key point defined
14409 in <code>x=1</code>, the filter will automatically insert a <var>(1;1)</var> point.
14411 <p>The filter accepts the following options:
14413 <dl compact="compact">
14414 <dt> ‘<samp>preset</samp>’</dt>
14415 <dd><p>Select one of the available color presets. This option can be used in addition
14416 to the ‘<samp>r</samp>’, ‘<samp>g</samp>’, ‘<samp>b</samp>’ parameters; in this case, the later
14417 options takes priority on the preset values.
14418 Available presets are:
14419 </p><dl compact="compact">
14420 <dt> ‘<samp>none</samp>’</dt>
14421 <dt> ‘<samp>color_negative</samp>’</dt>
14422 <dt> ‘<samp>cross_process</samp>’</dt>
14423 <dt> ‘<samp>darker</samp>’</dt>
14424 <dt> ‘<samp>increase_contrast</samp>’</dt>
14425 <dt> ‘<samp>lighter</samp>’</dt>
14426 <dt> ‘<samp>linear_contrast</samp>’</dt>
14427 <dt> ‘<samp>medium_contrast</samp>’</dt>
14428 <dt> ‘<samp>negative</samp>’</dt>
14429 <dt> ‘<samp>strong_contrast</samp>’</dt>
14430 <dt> ‘<samp>vintage</samp>’</dt>
14432 <p>Default is <code>none</code>.
14434 <dt> ‘<samp>master, m</samp>’</dt>
14435 <dd><p>Set the master key points. These points will define a second pass mapping. It
14436 is sometimes called a "luminance" or "value" mapping. It can be used with
14437 ‘<samp>r</samp>’, ‘<samp>g</samp>’, ‘<samp>b</samp>’ or ‘<samp>all</samp>’ since it acts like a
14438 post-processing LUT.
14440 <dt> ‘<samp>red, r</samp>’</dt>
14441 <dd><p>Set the key points for the red component.
14443 <dt> ‘<samp>green, g</samp>’</dt>
14444 <dd><p>Set the key points for the green component.
14446 <dt> ‘<samp>blue, b</samp>’</dt>
14447 <dd><p>Set the key points for the blue component.
14449 <dt> ‘<samp>all</samp>’</dt>
14450 <dd><p>Set the key points for all components (not including master).
14451 Can be used in addition to the other key points component
14452 options. In this case, the unset component(s) will fallback on this
14453 ‘<samp>all</samp>’ setting.
14455 <dt> ‘<samp>psfile</samp>’</dt>
14456 <dd><p>Specify a Photoshop curves file (<code>.asv</code>) to import the settings from.
14460 <p>To avoid some filtergraph syntax conflicts, each key points list need to be
14461 defined using the following syntax: <code>x0/y0 x1/y1 x2/y2 ...</code>.
14463 <a name="Examples-75"></a>
14464 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-75">33.15.1 Examples</a></h3>
14468 Increase slightly the middle level of blue:
14469 <table><tr><td> </td><td><pre class="example">curves=blue='0.5/0.58'
14470 </pre></td></tr></table>
14474 <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'
14475 </pre></td></tr></table>
14476 <p>Here we obtain the following coordinates for each components:
14477 </p><dl compact="compact">
14478 <dt> <var>red</var></dt>
14479 <dd><p><code>(0;0.11) (0.42;0.51) (1;0.95)</code>
14481 <dt> <var>green</var></dt>
14482 <dd><p><code>(0;0) (0.50;0.48) (1;1)</code>
14484 <dt> <var>blue</var></dt>
14485 <dd><p><code>(0;0.22) (0.49;0.44) (1;0.80)</code>
14490 The previous example can also be achieved with the associated built-in preset:
14491 <table><tr><td> </td><td><pre class="example">curves=preset=vintage
14492 </pre></td></tr></table>
14496 <table><tr><td> </td><td><pre class="example">curves=vintage
14497 </pre></td></tr></table>
14500 Use a Photoshop preset and redefine the points of the green component:
14501 <table><tr><td> </td><td><pre class="example">curves=psfile='MyCurvesPresets/purple.asv':green='0.45/0.53'
14502 </pre></td></tr></table>
14505 <a name="dctdnoiz"></a>
14506 <h2 class="section"><a href="ffplay-all.html#toc-dctdnoiz">33.16 dctdnoiz</a></h2>
14508 <p>Denoise frames using 2D DCT (frequency domain filtering).
14510 <p>This filter is not designed for real time and can be extremely slow.
14512 <p>The filter accepts the following options:
14514 <dl compact="compact">
14515 <dt> ‘<samp>sigma, s</samp>’</dt>
14516 <dd><p>Set the noise sigma constant.
14518 <p>This <var>sigma</var> defines a hard threshold of <code>3 * sigma</code>; every DCT
14519 coefficient (absolute value) below this threshold with be dropped.
14521 <p>If you need a more advanced filtering, see ‘<samp>expr</samp>’.
14523 <p>Default is <code>0</code>.
14526 <dt> ‘<samp>overlap</samp>’</dt>
14527 <dd><p>Set number overlapping pixels for each block. Each block is of size
14528 <code>16x16</code>. Since the filter can be slow, you may want to reduce this value,
14529 at the cost of a less effective filter and the risk of various artefacts.
14531 <p>If the overlapping value doesn’t allow to process the whole input width or
14532 height, a warning will be displayed and according borders won’t be denoised.
14534 <p>Default value is <code>15</code>.
14537 <dt> ‘<samp>expr, e</samp>’</dt>
14538 <dd><p>Set the coefficient factor expression.
14540 <p>For each coefficient of a DCT block, this expression will be evaluated as a
14541 multiplier value for the coefficient.
14543 <p>If this is option is set, the ‘<samp>sigma</samp>’ option will be ignored.
14545 <p>The absolute value of the coefficient can be accessed through the <var>c</var>
14550 <a name="Examples-20"></a>
14551 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-20">33.16.1 Examples</a></h3>
14553 <p>Apply a denoise with a ‘<samp>sigma</samp>’ of <code>4.5</code>:
14554 </p><table><tr><td> </td><td><pre class="example">dctdnoiz=4.5
14555 </pre></td></tr></table>
14557 <p>The same operation can be achieved using the expression system:
14558 </p><table><tr><td> </td><td><pre class="example">dctdnoiz=e='gte(c, 4.5*3)'
14559 </pre></td></tr></table>
14561 <p><a name="decimate"></a>
14562 </p><a name="decimate-1"></a>
14563 <h2 class="section"><a href="ffplay-all.html#toc-decimate-1">33.17 decimate</a></h2>
14565 <p>Drop duplicated frames at regular intervals.
14567 <p>The filter accepts the following options:
14569 <dl compact="compact">
14570 <dt> ‘<samp>cycle</samp>’</dt>
14571 <dd><p>Set the number of frames from which one will be dropped. Setting this to
14572 <var>N</var> means one frame in every batch of <var>N</var> frames will be dropped.
14573 Default is <code>5</code>.
14576 <dt> ‘<samp>dupthresh</samp>’</dt>
14577 <dd><p>Set the threshold for duplicate detection. If the difference metric for a frame
14578 is less than or equal to this value, then it is declared as duplicate. Default
14579 is <code>1.1</code>
14582 <dt> ‘<samp>scthresh</samp>’</dt>
14583 <dd><p>Set scene change threshold. Default is <code>15</code>.
14586 <dt> ‘<samp>blockx</samp>’</dt>
14587 <dt> ‘<samp>blocky</samp>’</dt>
14588 <dd><p>Set the size of the x and y-axis blocks used during metric calculations.
14589 Larger blocks give better noise suppression, but also give worse detection of
14590 small movements. Must be a power of two. Default is <code>32</code>.
14593 <dt> ‘<samp>ppsrc</samp>’</dt>
14594 <dd><p>Mark main input as a pre-processed input and activate clean source input
14595 stream. This allows the input to be pre-processed with various filters to help
14596 the metrics calculation while keeping the frame selection lossless. When set to
14597 <code>1</code>, the first stream is for the pre-processed input, and the second
14598 stream is the clean source from where the kept frames are chosen. Default is
14602 <dt> ‘<samp>chroma</samp>’</dt>
14603 <dd><p>Set whether or not chroma is considered in the metric calculations. Default is
14608 <a name="delogo"></a>
14609 <h2 class="section"><a href="ffplay-all.html#toc-delogo">33.18 delogo</a></h2>
14611 <p>Suppress a TV station logo by a simple interpolation of the surrounding
14612 pixels. Just set a rectangle covering the logo and watch it disappear
14613 (and sometimes something even uglier appear - your mileage may vary).
14615 <p>This filter accepts the following options:
14616 </p><dl compact="compact">
14617 <dt> ‘<samp>x</samp>’</dt>
14618 <dt> ‘<samp>y</samp>’</dt>
14619 <dd><p>Specify the top left corner coordinates of the logo. They must be
14623 <dt> ‘<samp>w</samp>’</dt>
14624 <dt> ‘<samp>h</samp>’</dt>
14625 <dd><p>Specify the width and height of the logo to clear. They must be
14629 <dt> ‘<samp>band, t</samp>’</dt>
14630 <dd><p>Specify the thickness of the fuzzy edge of the rectangle (added to
14631 <var>w</var> and <var>h</var>). The default value is 4.
14634 <dt> ‘<samp>show</samp>’</dt>
14635 <dd><p>When set to 1, a green rectangle is drawn on the screen to simplify
14636 finding the right <var>x</var>, <var>y</var>, <var>w</var>, and <var>h</var> parameters.
14637 The default value is 0.
14639 <p>The rectangle is drawn on the outermost pixels which will be (partly)
14640 replaced with interpolated values. The values of the next pixels
14641 immediately outside this rectangle in each direction will be used to
14642 compute the interpolated pixel values inside the rectangle.
14647 <a name="Examples-44"></a>
14648 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-44">33.18.1 Examples</a></h3>
14652 Set a rectangle covering the area with top left corner coordinates 0,0
14653 and size 100x77, setting a band of size 10:
14654 <table><tr><td> </td><td><pre class="example">delogo=x=0:y=0:w=100:h=77:band=10
14655 </pre></td></tr></table>
14659 <a name="deshake"></a>
14660 <h2 class="section"><a href="ffplay-all.html#toc-deshake">33.19 deshake</a></h2>
14662 <p>Attempt to fix small changes in horizontal and/or vertical shift. This
14663 filter helps remove camera shake from hand-holding a camera, bumping a
14664 tripod, moving on a vehicle, etc.
14666 <p>The filter accepts the following options:
14668 <dl compact="compact">
14669 <dt> ‘<samp>x</samp>’</dt>
14670 <dt> ‘<samp>y</samp>’</dt>
14671 <dt> ‘<samp>w</samp>’</dt>
14672 <dt> ‘<samp>h</samp>’</dt>
14673 <dd><p>Specify a rectangular area where to limit the search for motion
14675 If desired the search for motion vectors can be limited to a
14676 rectangular area of the frame defined by its top left corner, width
14677 and height. These parameters have the same meaning as the drawbox
14678 filter which can be used to visualise the position of the bounding
14681 <p>This is useful when simultaneous movement of subjects within the frame
14682 might be confused for camera motion by the motion vector search.
14684 <p>If any or all of <var>x</var>, <var>y</var>, <var>w</var> and <var>h</var> are set to -1
14685 then the full frame is used. This allows later options to be set
14686 without specifying the bounding box for the motion vector search.
14688 <p>Default - search the whole frame.
14691 <dt> ‘<samp>rx</samp>’</dt>
14692 <dt> ‘<samp>ry</samp>’</dt>
14693 <dd><p>Specify the maximum extent of movement in x and y directions in the
14694 range 0-64 pixels. Default 16.
14697 <dt> ‘<samp>edge</samp>’</dt>
14698 <dd><p>Specify how to generate pixels to fill blanks at the edge of the
14699 frame. Available values are:
14700 </p><dl compact="compact">
14701 <dt> ‘<samp>blank, 0</samp>’</dt>
14702 <dd><p>Fill zeroes at blank locations
14704 <dt> ‘<samp>original, 1</samp>’</dt>
14705 <dd><p>Original image at blank locations
14707 <dt> ‘<samp>clamp, 2</samp>’</dt>
14708 <dd><p>Extruded edge value at blank locations
14710 <dt> ‘<samp>mirror, 3</samp>’</dt>
14711 <dd><p>Mirrored edge at blank locations
14714 <p>Default value is ‘<samp>mirror</samp>’.
14717 <dt> ‘<samp>blocksize</samp>’</dt>
14718 <dd><p>Specify the blocksize to use for motion search. Range 4-128 pixels,
14722 <dt> ‘<samp>contrast</samp>’</dt>
14723 <dd><p>Specify the contrast threshold for blocks. Only blocks with more than
14724 the specified contrast (difference between darkest and lightest
14725 pixels) will be considered. Range 1-255, default 125.
14728 <dt> ‘<samp>search</samp>’</dt>
14729 <dd><p>Specify the search strategy. Available values are:
14730 </p><dl compact="compact">
14731 <dt> ‘<samp>exhaustive, 0</samp>’</dt>
14732 <dd><p>Set exhaustive search
14734 <dt> ‘<samp>less, 1</samp>’</dt>
14735 <dd><p>Set less exhaustive search.
14738 <p>Default value is ‘<samp>exhaustive</samp>’.
14741 <dt> ‘<samp>filename</samp>’</dt>
14742 <dd><p>If set then a detailed log of the motion search is written to the
14746 <dt> ‘<samp>opencl</samp>’</dt>
14747 <dd><p>If set to 1, specify using OpenCL capabilities, only available if
14748 FFmpeg was configured with <code>--enable-opencl</code>. Default value is 0.
14753 <a name="drawbox"></a>
14754 <h2 class="section"><a href="ffplay-all.html#toc-drawbox">33.20 drawbox</a></h2>
14756 <p>Draw a colored box on the input image.
14758 <p>This filter accepts the following options:
14760 <dl compact="compact">
14761 <dt> ‘<samp>x</samp>’</dt>
14762 <dt> ‘<samp>y</samp>’</dt>
14763 <dd><p>The expressions which specify the top left corner coordinates of the box. Default to 0.
14766 <dt> ‘<samp>width, w</samp>’</dt>
14767 <dt> ‘<samp>height, h</samp>’</dt>
14768 <dd><p>The expressions which specify the width and height of the box, if 0 they are interpreted as
14769 the input width and height. Default to 0.
14772 <dt> ‘<samp>color, c</samp>’</dt>
14773 <dd><p>Specify the color of the box to write. For the general syntax of this option,
14774 check the "Color" section in the ffmpeg-utils manual. If the special
14775 value <code>invert</code> is used, the box edge color is the same as the
14776 video with inverted luma.
14779 <dt> ‘<samp>thickness, t</samp>’</dt>
14780 <dd><p>The expression which sets the thickness of the box edge. Default value is <code>3</code>.
14782 <p>See below for the list of accepted constants.
14786 <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
14787 following constants:
14789 <dl compact="compact">
14790 <dt> ‘<samp>dar</samp>’</dt>
14791 <dd><p>The input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>.
14794 <dt> ‘<samp>hsub</samp>’</dt>
14795 <dt> ‘<samp>vsub</samp>’</dt>
14796 <dd><p>horizontal and vertical chroma subsample values. For example for the
14797 pixel format "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
14800 <dt> ‘<samp>in_h, ih</samp>’</dt>
14801 <dt> ‘<samp>in_w, iw</samp>’</dt>
14802 <dd><p>The input width and height.
14805 <dt> ‘<samp>sar</samp>’</dt>
14806 <dd><p>The input sample aspect ratio.
14809 <dt> ‘<samp>x</samp>’</dt>
14810 <dt> ‘<samp>y</samp>’</dt>
14811 <dd><p>The x and y offset coordinates where the box is drawn.
14814 <dt> ‘<samp>w</samp>’</dt>
14815 <dt> ‘<samp>h</samp>’</dt>
14816 <dd><p>The width and height of the drawn box.
14819 <dt> ‘<samp>t</samp>’</dt>
14820 <dd><p>The thickness of the drawn box.
14822 <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
14823 each other, so you may for example specify <code>y=x/dar</code> or <code>h=w/dar</code>.
14828 <a name="Examples-86"></a>
14829 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-86">33.20.1 Examples</a></h3>
14833 Draw a black box around the edge of the input image:
14834 <table><tr><td> </td><td><pre class="example">drawbox
14835 </pre></td></tr></table>
14838 Draw a box with color red and an opacity of 50%:
14839 <table><tr><td> </td><td><pre class="example">drawbox=10:20:200:60:red@0.5
14840 </pre></td></tr></table>
14842 <p>The previous example can be specified as:
14843 </p><table><tr><td> </td><td><pre class="example">drawbox=x=10:y=20:w=200:h=60:color=red@0.5
14844 </pre></td></tr></table>
14847 Fill the box with pink color:
14848 <table><tr><td> </td><td><pre class="example">drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=max
14849 </pre></td></tr></table>
14852 Draw a 2-pixel red 2.40:1 mask:
14853 <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
14854 </pre></td></tr></table>
14857 <a name="drawgrid"></a>
14858 <h2 class="section"><a href="ffplay-all.html#toc-drawgrid">33.21 drawgrid</a></h2>
14860 <p>Draw a grid on the input image.
14862 <p>This filter accepts the following options:
14864 <dl compact="compact">
14865 <dt> ‘<samp>x</samp>’</dt>
14866 <dt> ‘<samp>y</samp>’</dt>
14867 <dd><p>The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0.
14870 <dt> ‘<samp>width, w</samp>’</dt>
14871 <dt> ‘<samp>height, h</samp>’</dt>
14872 <dd><p>The expressions which specify the width and height of the grid cell, if 0 they are interpreted as the
14873 input width and height, respectively, minus <code>thickness</code>, so image gets
14874 framed. Default to 0.
14877 <dt> ‘<samp>color, c</samp>’</dt>
14878 <dd><p>Specify the color of the grid. For the general syntax of this option,
14879 check the "Color" section in the ffmpeg-utils manual. If the special
14880 value <code>invert</code> is used, the grid color is the same as the
14881 video with inverted luma.
14884 <dt> ‘<samp>thickness, t</samp>’</dt>
14885 <dd><p>The expression which sets the thickness of the grid line. Default value is <code>1</code>.
14887 <p>See below for the list of accepted constants.
14891 <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
14892 following constants:
14894 <dl compact="compact">
14895 <dt> ‘<samp>dar</samp>’</dt>
14896 <dd><p>The input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>.
14899 <dt> ‘<samp>hsub</samp>’</dt>
14900 <dt> ‘<samp>vsub</samp>’</dt>
14901 <dd><p>horizontal and vertical chroma subsample values. For example for the
14902 pixel format "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
14905 <dt> ‘<samp>in_h, ih</samp>’</dt>
14906 <dt> ‘<samp>in_w, iw</samp>’</dt>
14907 <dd><p>The input grid cell width and height.
14910 <dt> ‘<samp>sar</samp>’</dt>
14911 <dd><p>The input sample aspect ratio.
14914 <dt> ‘<samp>x</samp>’</dt>
14915 <dt> ‘<samp>y</samp>’</dt>
14916 <dd><p>The x and y coordinates of some point of grid intersection (meant to configure offset).
14919 <dt> ‘<samp>w</samp>’</dt>
14920 <dt> ‘<samp>h</samp>’</dt>
14921 <dd><p>The width and height of the drawn cell.
14924 <dt> ‘<samp>t</samp>’</dt>
14925 <dd><p>The thickness of the drawn cell.
14927 <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
14928 each other, so you may for example specify <code>y=x/dar</code> or <code>h=w/dar</code>.
14933 <a name="Examples-36"></a>
14934 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-36">33.21.1 Examples</a></h3>
14938 Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an opacity of 50%:
14939 <table><tr><td> </td><td><pre class="example">drawgrid=width=100:height=100:thickness=2:color=red@0.5
14940 </pre></td></tr></table>
14943 Draw a white 3x3 grid with an opacity of 50%:
14944 <table><tr><td> </td><td><pre class="example">drawgrid=w=iw/3:h=ih/3:t=2:c=white@0.5
14945 </pre></td></tr></table>
14948 <p><a name="drawtext"></a>
14949 </p><a name="drawtext-1"></a>
14950 <h2 class="section"><a href="ffplay-all.html#toc-drawtext-1">33.22 drawtext</a></h2>
14952 <p>Draw text string or text from specified file on top of video using the
14953 libfreetype library.
14955 <p>To enable compilation of this filter you need to configure FFmpeg with
14956 <code>--enable-libfreetype</code>.
14958 <a name="Syntax"></a>
14959 <h3 class="subsection"><a href="ffplay-all.html#toc-Syntax">33.22.1 Syntax</a></h3>
14961 <p>The description of the accepted parameters follows.
14963 <dl compact="compact">
14964 <dt> ‘<samp>box</samp>’</dt>
14965 <dd><p>Used to draw a box around text using background color.
14966 Value should be either 1 (enable) or 0 (disable).
14967 The default value of <var>box</var> is 0.
14970 <dt> ‘<samp>boxcolor</samp>’</dt>
14971 <dd><p>The color to be used for drawing box around text. For the syntax of this
14972 option, check the "Color" section in the ffmpeg-utils manual.
14974 <p>The default value of <var>boxcolor</var> is "white".
14977 <dt> ‘<samp>expansion</samp>’</dt>
14978 <dd><p>Select how the <var>text</var> is expanded. Can be either <code>none</code>,
14979 <code>strftime</code> (deprecated) or
14980 <code>normal</code> (default). See the <a href="#drawtext_005fexpansion">Text expansion</a> section
14984 <dt> ‘<samp>fix_bounds</samp>’</dt>
14985 <dd><p>If true, check and fix text coords to avoid clipping.
14988 <dt> ‘<samp>fontcolor</samp>’</dt>
14989 <dd><p>The color to be used for drawing fonts. For the syntax of this option, check
14990 the "Color" section in the ffmpeg-utils manual.
14992 <p>The default value of <var>fontcolor</var> is "black".
14995 <dt> ‘<samp>fontfile</samp>’</dt>
14996 <dd><p>The font file to be used for drawing text. Path must be included.
14997 This parameter is mandatory.
15000 <dt> ‘<samp>fontsize</samp>’</dt>
15001 <dd><p>The font size to be used for drawing text.
15002 The default value of <var>fontsize</var> is 16.
15005 <dt> ‘<samp>ft_load_flags</samp>’</dt>
15006 <dd><p>Flags to be used for loading the fonts.
15008 <p>The flags map the corresponding flags supported by libfreetype, and are
15009 a combination of the following values:
15010 </p><dl compact="compact">
15011 <dt> <var>default</var></dt>
15012 <dt> <var>no_scale</var></dt>
15013 <dt> <var>no_hinting</var></dt>
15014 <dt> <var>render</var></dt>
15015 <dt> <var>no_bitmap</var></dt>
15016 <dt> <var>vertical_layout</var></dt>
15017 <dt> <var>force_autohint</var></dt>
15018 <dt> <var>crop_bitmap</var></dt>
15019 <dt> <var>pedantic</var></dt>
15020 <dt> <var>ignore_global_advance_width</var></dt>
15021 <dt> <var>no_recurse</var></dt>
15022 <dt> <var>ignore_transform</var></dt>
15023 <dt> <var>monochrome</var></dt>
15024 <dt> <var>linear_design</var></dt>
15025 <dt> <var>no_autohint</var></dt>
15028 <p>Default value is "render".
15030 <p>For more information consult the documentation for the FT_LOAD_*
15034 <dt> ‘<samp>shadowcolor</samp>’</dt>
15035 <dd><p>The color to be used for drawing a shadow behind the drawn text. For the
15036 syntax of this option, check the "Color" section in the ffmpeg-utils manual.
15038 <p>The default value of <var>shadowcolor</var> is "black".
15041 <dt> ‘<samp>shadowx</samp>’</dt>
15042 <dt> ‘<samp>shadowy</samp>’</dt>
15043 <dd><p>The x and y offsets for the text shadow position with respect to the
15044 position of the text. They can be either positive or negative
15045 values. Default value for both is "0".
15048 <dt> ‘<samp>start_number</samp>’</dt>
15049 <dd><p>The starting frame number for the n/frame_num variable. The default value
15053 <dt> ‘<samp>tabsize</samp>’</dt>
15054 <dd><p>The size in number of spaces to use for rendering the tab.
15055 Default value is 4.
15058 <dt> ‘<samp>timecode</samp>’</dt>
15059 <dd><p>Set the initial timecode representation in "hh:mm:ss[:;.]ff"
15060 format. It can be used with or without text parameter. <var>timecode_rate</var>
15061 option must be specified.
15064 <dt> ‘<samp>timecode_rate, rate, r</samp>’</dt>
15065 <dd><p>Set the timecode frame rate (timecode only).
15068 <dt> ‘<samp>text</samp>’</dt>
15069 <dd><p>The text string to be drawn. The text must be a sequence of UTF-8
15070 encoded characters.
15071 This parameter is mandatory if no file is specified with the parameter
15072 <var>textfile</var>.
15075 <dt> ‘<samp>textfile</samp>’</dt>
15076 <dd><p>A text file containing text to be drawn. The text must be a sequence
15077 of UTF-8 encoded characters.
15079 <p>This parameter is mandatory if no text string is specified with the
15080 parameter <var>text</var>.
15082 <p>If both <var>text</var> and <var>textfile</var> are specified, an error is thrown.
15085 <dt> ‘<samp>reload</samp>’</dt>
15086 <dd><p>If set to 1, the <var>textfile</var> will be reloaded before each frame.
15087 Be sure to update it atomically, or it may be read partially, or even fail.
15090 <dt> ‘<samp>x</samp>’</dt>
15091 <dt> ‘<samp>y</samp>’</dt>
15092 <dd><p>The expressions which specify the offsets where text will be drawn
15093 within the video frame. They are relative to the top/left border of the
15096 <p>The default value of <var>x</var> and <var>y</var> is "0".
15098 <p>See below for the list of accepted constants and functions.
15102 <p>The parameters for <var>x</var> and <var>y</var> are expressions containing the
15103 following constants and functions:
15105 <dl compact="compact">
15106 <dt> ‘<samp>dar</samp>’</dt>
15107 <dd><p>input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>
15110 <dt> ‘<samp>hsub</samp>’</dt>
15111 <dt> ‘<samp>vsub</samp>’</dt>
15112 <dd><p>horizontal and vertical chroma subsample values. For example for the
15113 pixel format "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
15116 <dt> ‘<samp>line_h, lh</samp>’</dt>
15117 <dd><p>the height of each text line
15120 <dt> ‘<samp>main_h, h, H</samp>’</dt>
15121 <dd><p>the input height
15124 <dt> ‘<samp>main_w, w, W</samp>’</dt>
15125 <dd><p>the input width
15128 <dt> ‘<samp>max_glyph_a, ascent</samp>’</dt>
15129 <dd><p>the maximum distance from the baseline to the highest/upper grid
15130 coordinate used to place a glyph outline point, for all the rendered
15132 It is a positive value, due to the grid’s orientation with the Y axis
15136 <dt> ‘<samp>max_glyph_d, descent</samp>’</dt>
15137 <dd><p>the maximum distance from the baseline to the lowest grid coordinate
15138 used to place a glyph outline point, for all the rendered glyphs.
15139 This is a negative value, due to the grid’s orientation, with the Y axis
15143 <dt> ‘<samp>max_glyph_h</samp>’</dt>
15144 <dd><p>maximum glyph height, that is the maximum height for all the glyphs
15145 contained in the rendered text, it is equivalent to <var>ascent</var> -
15146 <var>descent</var>.
15149 <dt> ‘<samp>max_glyph_w</samp>’</dt>
15150 <dd><p>maximum glyph width, that is the maximum width for all the glyphs
15151 contained in the rendered text
15154 <dt> ‘<samp>n</samp>’</dt>
15155 <dd><p>the number of input frame, starting from 0
15158 <dt> ‘<samp>rand(min, max)</samp>’</dt>
15159 <dd><p>return a random number included between <var>min</var> and <var>max</var>
15162 <dt> ‘<samp>sar</samp>’</dt>
15163 <dd><p>input sample aspect ratio
15166 <dt> ‘<samp>t</samp>’</dt>
15167 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
15170 <dt> ‘<samp>text_h, th</samp>’</dt>
15171 <dd><p>the height of the rendered text
15174 <dt> ‘<samp>text_w, tw</samp>’</dt>
15175 <dd><p>the width of the rendered text
15178 <dt> ‘<samp>x</samp>’</dt>
15179 <dt> ‘<samp>y</samp>’</dt>
15180 <dd><p>the x and y offset coordinates where the text is drawn.
15182 <p>These parameters allow the <var>x</var> and <var>y</var> expressions to refer
15183 each other, so you can for example specify <code>y=x/dar</code>.
15187 <p>If libavfilter was built with <code>--enable-fontconfig</code>, then
15188 ‘<samp>fontfile</samp>’ can be a fontconfig pattern or omitted.
15190 <p><a name="drawtext_005fexpansion"></a>
15191 </p><a name="Text-expansion"></a>
15192 <h3 class="subsection"><a href="ffplay-all.html#toc-Text-expansion">33.22.2 Text expansion</a></h3>
15194 <p>If ‘<samp>expansion</samp>’ is set to <code>strftime</code>,
15195 the filter recognizes strftime() sequences in the provided text and
15196 expands them accordingly. Check the documentation of strftime(). This
15197 feature is deprecated.
15199 <p>If ‘<samp>expansion</samp>’ is set to <code>none</code>, the text is printed verbatim.
15201 <p>If ‘<samp>expansion</samp>’ is set to <code>normal</code> (which is the default),
15202 the following expansion mechanism is used.
15204 <p>The backslash character ’\’, followed by any character, always expands to
15205 the second character.
15207 <p>Sequence of the form <code>%{...}</code> are expanded. The text between the
15208 braces is a function name, possibly followed by arguments separated by ’:’.
15209 If the arguments contain special characters or delimiters (’:’ or ’}’),
15210 they should be escaped.
15212 <p>Note that they probably must also be escaped as the value for the
15213 ‘<samp>text</samp>’ option in the filter argument string and as the filter
15214 argument in the filtergraph description, and possibly also for the shell,
15215 that makes up to four levels of escaping; using a text file avoids these
15218 <p>The following functions are available:
15220 <dl compact="compact">
15221 <dt> <code>expr, e</code></dt>
15222 <dd><p>The expression evaluation result.
15224 <p>It must take one argument specifying the expression to be evaluated,
15225 which accepts the same constants and functions as the <var>x</var> and
15226 <var>y</var> values. Note that not all constants should be used, for
15227 example the text size is not known when evaluating the expression, so
15228 the constants <var>text_w</var> and <var>text_h</var> will have an undefined
15232 <dt> <code>gmtime</code></dt>
15233 <dd><p>The time at which the filter is running, expressed in UTC.
15234 It can accept an argument: a strftime() format string.
15237 <dt> <code>localtime</code></dt>
15238 <dd><p>The time at which the filter is running, expressed in the local time zone.
15239 It can accept an argument: a strftime() format string.
15242 <dt> <code>metadata</code></dt>
15243 <dd><p>Frame metadata. It must take one argument specifying metadata key.
15246 <dt> <code>n, frame_num</code></dt>
15247 <dd><p>The frame number, starting from 0.
15250 <dt> <code>pict_type</code></dt>
15251 <dd><p>A 1 character description of the current picture type.
15254 <dt> <code>pts</code></dt>
15255 <dd><p>The timestamp of the current frame, in seconds, with microsecond accuracy.
15260 <a name="Examples-58"></a>
15261 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-58">33.22.3 Examples</a></h3>
15265 Draw "Test Text" with font FreeSerif, using the default values for the
15266 optional parameters.
15268 <table><tr><td> </td><td><pre class="example">drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'"
15269 </pre></td></tr></table>
15272 Draw ’Test Text’ with font FreeSerif of size 24 at position x=100
15273 and y=50 (counting from the top-left corner of the screen), text is
15274 yellow with a red box around it. Both the text and the box have an
15277 <table><tr><td> </td><td><pre class="example">drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
15278 x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2"
15279 </pre></td></tr></table>
15281 <p>Note that the double quotes are not necessary if spaces are not used
15282 within the parameter list.
15285 Show the text at the center of the video frame:
15286 <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"
15287 </pre></td></tr></table>
15290 Show a text line sliding from right to left in the last row of the video
15291 frame. The file ‘<tt>LONG_LINE</tt>’ is assumed to contain a single line
15293 <table><tr><td> </td><td><pre class="example">drawtext="fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t"
15294 </pre></td></tr></table>
15297 Show the content of file ‘<tt>CREDITS</tt>’ off the bottom of the frame and scroll up.
15298 <table><tr><td> </td><td><pre class="example">drawtext="fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t"
15299 </pre></td></tr></table>
15302 Draw a single green letter "g", at the center of the input video.
15303 The glyph baseline is placed at half screen height.
15304 <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"
15305 </pre></td></tr></table>
15308 Show text for 1 second every 3 seconds:
15309 <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'"
15310 </pre></td></tr></table>
15313 Use fontconfig to set the font. Note that the colons need to be escaped.
15314 <table><tr><td> </td><td><pre class="example">drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg'
15315 </pre></td></tr></table>
15318 Print the date of a real-time encoding (see strftime(3)):
15319 <table><tr><td> </td><td><pre class="example">drawtext='fontfile=FreeSans.ttf:text=%{localtime:%a %b %d %Y}'
15320 </pre></td></tr></table>
15324 <p>For more information about libfreetype, check:
15325 <a href="http://www.freetype.org/">http://www.freetype.org/</a>.
15327 <p>For more information about fontconfig, check:
15328 <a href="http://freedesktop.org/software/fontconfig/fontconfig-user.html">http://freedesktop.org/software/fontconfig/fontconfig-user.html</a>.
15330 <a name="edgedetect"></a>
15331 <h2 class="section"><a href="ffplay-all.html#toc-edgedetect">33.23 edgedetect</a></h2>
15333 <p>Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
15335 <p>The filter accepts the following options:
15337 <dl compact="compact">
15338 <dt> ‘<samp>low</samp>’</dt>
15339 <dt> ‘<samp>high</samp>’</dt>
15340 <dd><p>Set low and high threshold values used by the Canny thresholding
15343 <p>The high threshold selects the "strong" edge pixels, which are then
15344 connected through 8-connectivity with the "weak" edge pixels selected
15345 by the low threshold.
15347 <p><var>low</var> and <var>high</var> threshold values must be choosen in the range
15348 [0,1], and <var>low</var> should be lesser or equal to <var>high</var>.
15350 <p>Default value for <var>low</var> is <code>20/255</code>, and default value for <var>high</var>
15351 is <code>50/255</code>.
15356 </p><table><tr><td> </td><td><pre class="example">edgedetect=low=0.1:high=0.4
15357 </pre></td></tr></table>
15359 <a name="extractplanes"></a>
15360 <h2 class="section"><a href="ffplay-all.html#toc-extractplanes">33.24 extractplanes</a></h2>
15362 <p>Extract color channel components from input video stream into
15363 separate grayscale video streams.
15365 <p>The filter accepts the following option:
15367 <dl compact="compact">
15368 <dt> ‘<samp>planes</samp>’</dt>
15369 <dd><p>Set plane(s) to extract.
15371 <p>Available values for planes are:
15372 </p><dl compact="compact">
15373 <dt> ‘<samp>y</samp>’</dt>
15374 <dt> ‘<samp>u</samp>’</dt>
15375 <dt> ‘<samp>v</samp>’</dt>
15376 <dt> ‘<samp>a</samp>’</dt>
15377 <dt> ‘<samp>r</samp>’</dt>
15378 <dt> ‘<samp>g</samp>’</dt>
15379 <dt> ‘<samp>b</samp>’</dt>
15382 <p>Choosing planes not available in the input will result in an error.
15383 That means you cannot select <code>r</code>, <code>g</code>, <code>b</code> planes
15384 with <code>y</code>, <code>u</code>, <code>v</code> planes at same time.
15388 <a name="Examples-70"></a>
15389 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-70">33.24.1 Examples</a></h3>
15393 Extract luma, u and v color channel component from input video frame
15394 into 3 grayscale outputs:
15395 <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
15396 </pre></td></tr></table>
15399 <a name="elbg"></a>
15400 <h2 class="section"><a href="ffplay-all.html#toc-elbg">33.25 elbg</a></h2>
15402 <p>Apply a posterize effect using the ELBG (Enhanced LBG) algorithm.
15404 <p>For each input image, the filter will compute the optimal mapping from
15405 the input to the output given the codebook length, that is the number
15406 of distinct output colors.
15408 <p>This filter accepts the following options.
15410 <dl compact="compact">
15411 <dt> ‘<samp>codebook_length, l</samp>’</dt>
15412 <dd><p>Set codebook length. The value must be a positive integer, and
15413 represents the number of distinct output colors. Default value is 256.
15416 <dt> ‘<samp>nb_steps, n</samp>’</dt>
15417 <dd><p>Set the maximum number of iterations to apply for computing the optimal
15418 mapping. The higher the value the better the result and the higher the
15419 computation time. Default value is 1.
15422 <dt> ‘<samp>seed, s</samp>’</dt>
15423 <dd><p>Set a random seed, must be an integer included between 0 and
15424 UINT32_MAX. If not specified, or if explicitly set to -1, the filter
15425 will try to use a good random seed on a best effort basis.
15429 <a name="fade"></a>
15430 <h2 class="section"><a href="ffplay-all.html#toc-fade">33.26 fade</a></h2>
15432 <p>Apply fade-in/out effect to input video.
15434 <p>This filter accepts the following options:
15436 <dl compact="compact">
15437 <dt> ‘<samp>type, t</samp>’</dt>
15438 <dd><p>The effect type – can be either "in" for fade-in, or "out" for a fade-out
15440 Default is <code>in</code>.
15443 <dt> ‘<samp>start_frame, s</samp>’</dt>
15444 <dd><p>Specify the number of the start frame for starting to apply the fade
15445 effect. Default is 0.
15448 <dt> ‘<samp>nb_frames, n</samp>’</dt>
15449 <dd><p>The number of frames for which the fade effect has to last. At the end of the
15450 fade-in effect the output video will have the same intensity as the input video,
15451 at the end of the fade-out transition the output video will be filled with the
15452 selected ‘<samp>color</samp>’.
15456 <dt> ‘<samp>alpha</samp>’</dt>
15457 <dd><p>If set to 1, fade only alpha channel, if one exists on the input.
15458 Default value is 0.
15461 <dt> ‘<samp>start_time, st</samp>’</dt>
15462 <dd><p>Specify the timestamp (in seconds) of the frame to start to apply the fade
15463 effect. If both start_frame and start_time are specified, the fade will start at
15464 whichever comes last. Default is 0.
15467 <dt> ‘<samp>duration, d</samp>’</dt>
15468 <dd><p>The number of seconds for which the fade effect has to last. At the end of the
15469 fade-in effect the output video will have the same intensity as the input video,
15470 at the end of the fade-out transition the output video will be filled with the
15471 selected ‘<samp>color</samp>’.
15472 If both duration and nb_frames are specified, duration is used. Default is 0.
15475 <dt> ‘<samp>color, c</samp>’</dt>
15476 <dd><p>Specify the color of the fade. Default is "black".
15480 <a name="Examples-3"></a>
15481 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-3">33.26.1 Examples</a></h3>
15485 Fade in first 30 frames of video:
15486 <table><tr><td> </td><td><pre class="example">fade=in:0:30
15487 </pre></td></tr></table>
15489 <p>The command above is equivalent to:
15490 </p><table><tr><td> </td><td><pre class="example">fade=t=in:s=0:n=30
15491 </pre></td></tr></table>
15494 Fade out last 45 frames of a 200-frame video:
15495 <table><tr><td> </td><td><pre class="example">fade=out:155:45
15496 fade=type=out:start_frame=155:nb_frames=45
15497 </pre></td></tr></table>
15500 Fade in first 25 frames and fade out last 25 frames of a 1000-frame video:
15501 <table><tr><td> </td><td><pre class="example">fade=in:0:25, fade=out:975:25
15502 </pre></td></tr></table>
15505 Make first 5 frames yellow, then fade in from frame 5-24:
15506 <table><tr><td> </td><td><pre class="example">fade=in:5:20:color=yellow
15507 </pre></td></tr></table>
15510 Fade in alpha over first 25 frames of video:
15511 <table><tr><td> </td><td><pre class="example">fade=in:0:25:alpha=1
15512 </pre></td></tr></table>
15515 Make first 5.5 seconds black, then fade in for 0.5 seconds:
15516 <table><tr><td> </td><td><pre class="example">fade=t=in:st=5.5:d=0.5
15517 </pre></td></tr></table>
15521 <a name="field"></a>
15522 <h2 class="section"><a href="ffplay-all.html#toc-field">33.27 field</a></h2>
15524 <p>Extract a single field from an interlaced image using stride
15525 arithmetic to avoid wasting CPU time. The output frames are marked as
15528 <p>The filter accepts the following options:
15530 <dl compact="compact">
15531 <dt> ‘<samp>type</samp>’</dt>
15532 <dd><p>Specify whether to extract the top (if the value is <code>0</code> or
15533 <code>top</code>) or the bottom field (if the value is <code>1</code> or
15534 <code>bottom</code>).
15538 <a name="fieldmatch"></a>
15539 <h2 class="section"><a href="ffplay-all.html#toc-fieldmatch">33.28 fieldmatch</a></h2>
15541 <p>Field matching filter for inverse telecine. It is meant to reconstruct the
15542 progressive frames from a telecined stream. The filter does not drop duplicated
15543 frames, so to achieve a complete inverse telecine <code>fieldmatch</code> needs to be
15544 followed by a decimation filter such as <a href="#decimate">decimate</a> in the filtergraph.
15546 <p>The separation of the field matching and the decimation is notably motivated by
15547 the possibility of inserting a de-interlacing filter fallback between the two.
15548 If the source has mixed telecined and real interlaced content,
15549 <code>fieldmatch</code> will not be able to match fields for the interlaced parts.
15550 But these remaining combed frames will be marked as interlaced, and thus can be
15551 de-interlaced by a later filter such as <a href="#yadif">yadif</a> before decimation.
15553 <p>In addition to the various configuration options, <code>fieldmatch</code> can take an
15554 optional second stream, activated through the ‘<samp>ppsrc</samp>’ option. If
15555 enabled, the frames reconstruction will be based on the fields and frames from
15556 this second stream. This allows the first input to be pre-processed in order to
15557 help the various algorithms of the filter, while keeping the output lossless
15558 (assuming the fields are matched properly). Typically, a field-aware denoiser,
15559 or brightness/contrast adjustments can help.
15561 <p>Note that this filter uses the same algorithms as TIVTC/TFM (AviSynth project)
15562 and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from
15563 which <code>fieldmatch</code> is based on. While the semantic and usage are very
15564 close, some behaviour and options names can differ.
15566 <p>The filter accepts the following options:
15568 <dl compact="compact">
15569 <dt> ‘<samp>order</samp>’</dt>
15570 <dd><p>Specify the assumed field order of the input stream. Available values are:
15572 <dl compact="compact">
15573 <dt> ‘<samp>auto</samp>’</dt>
15574 <dd><p>Auto detect parity (use FFmpeg’s internal parity value).
15576 <dt> ‘<samp>bff</samp>’</dt>
15577 <dd><p>Assume bottom field first.
15579 <dt> ‘<samp>tff</samp>’</dt>
15580 <dd><p>Assume top field first.
15584 <p>Note that it is sometimes recommended not to trust the parity announced by the
15587 <p>Default value is <var>auto</var>.
15590 <dt> ‘<samp>mode</samp>’</dt>
15591 <dd><p>Set the matching mode or strategy to use. ‘<samp>pc</samp>’ mode is the safest in the
15592 sense that it won’t risk creating jerkiness due to duplicate frames when
15593 possible, but if there are bad edits or blended fields it will end up
15594 outputting combed frames when a good match might actually exist. On the other
15595 hand, ‘<samp>pcn_ub</samp>’ mode is the most risky in terms of creating jerkiness,
15596 but will almost always find a good frame if there is one. The other values are
15597 all somewhere in between ‘<samp>pc</samp>’ and ‘<samp>pcn_ub</samp>’ in terms of risking
15598 jerkiness and creating duplicate frames versus finding good matches in sections
15599 with bad edits, orphaned fields, blended fields, etc.
15601 <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.
15603 <p>Available values are:
15605 <dl compact="compact">
15606 <dt> ‘<samp>pc</samp>’</dt>
15607 <dd><p>2-way matching (p/c)
15609 <dt> ‘<samp>pc_n</samp>’</dt>
15610 <dd><p>2-way matching, and trying 3rd match if still combed (p/c + n)
15612 <dt> ‘<samp>pc_u</samp>’</dt>
15613 <dd><p>2-way matching, and trying 3rd match (same order) if still combed (p/c + u)
15615 <dt> ‘<samp>pc_n_ub</samp>’</dt>
15616 <dd><p>2-way matching, trying 3rd match if still combed, and trying 4th/5th matches if
15617 still combed (p/c + n + u/b)
15619 <dt> ‘<samp>pcn</samp>’</dt>
15620 <dd><p>3-way matching (p/c/n)
15622 <dt> ‘<samp>pcn_ub</samp>’</dt>
15623 <dd><p>3-way matching, and trying 4th/5th matches if all 3 of the original matches are
15624 detected as combed (p/c/n + u/b)
15628 <p>The parenthesis at the end indicate the matches that would be used for that
15629 mode assuming ‘<samp>order</samp>’=<var>tff</var> (and ‘<samp>field</samp>’ on <var>auto</var> or
15632 <p>In terms of speed ‘<samp>pc</samp>’ mode is by far the fastest and ‘<samp>pcn_ub</samp>’ is
15635 <p>Default value is <var>pc_n</var>.
15638 <dt> ‘<samp>ppsrc</samp>’</dt>
15639 <dd><p>Mark the main input stream as a pre-processed input, and enable the secondary
15640 input stream as the clean source to pick the fields from. See the filter
15641 introduction for more details. It is similar to the ‘<samp>clip2</samp>’ feature from
15644 <p>Default value is <code>0</code> (disabled).
15647 <dt> ‘<samp>field</samp>’</dt>
15648 <dd><p>Set the field to match from. It is recommended to set this to the same value as
15649 ‘<samp>order</samp>’ unless you experience matching failures with that setting. In
15650 certain circumstances changing the field that is used to match from can have a
15651 large impact on matching performance. Available values are:
15653 <dl compact="compact">
15654 <dt> ‘<samp>auto</samp>’</dt>
15655 <dd><p>Automatic (same value as ‘<samp>order</samp>’).
15657 <dt> ‘<samp>bottom</samp>’</dt>
15658 <dd><p>Match from the bottom field.
15660 <dt> ‘<samp>top</samp>’</dt>
15661 <dd><p>Match from the top field.
15665 <p>Default value is <var>auto</var>.
15668 <dt> ‘<samp>mchroma</samp>’</dt>
15669 <dd><p>Set whether or not chroma is included during the match comparisons. In most
15670 cases it is recommended to leave this enabled. You should set this to <code>0</code>
15671 only if your clip has bad chroma problems such as heavy rainbowing or other
15672 artifacts. Setting this to <code>0</code> could also be used to speed things up at
15673 the cost of some accuracy.
15675 <p>Default value is <code>1</code>.
15678 <dt> ‘<samp>y0</samp>’</dt>
15679 <dt> ‘<samp>y1</samp>’</dt>
15680 <dd><p>These define an exclusion band which excludes the lines between ‘<samp>y0</samp>’ and
15681 ‘<samp>y1</samp>’ from being included in the field matching decision. An exclusion
15682 band can be used to ignore subtitles, a logo, or other things that may
15683 interfere with the matching. ‘<samp>y0</samp>’ sets the starting scan line and
15684 ‘<samp>y1</samp>’ sets the ending line; all lines in between ‘<samp>y0</samp>’ and
15685 ‘<samp>y1</samp>’ (including ‘<samp>y0</samp>’ and ‘<samp>y1</samp>’) will be ignored. Setting
15686 ‘<samp>y0</samp>’ and ‘<samp>y1</samp>’ to the same value will disable the feature.
15687 ‘<samp>y0</samp>’ and ‘<samp>y1</samp>’ defaults to <code>0</code>.
15690 <dt> ‘<samp>scthresh</samp>’</dt>
15691 <dd><p>Set the scene change detection threshold as a percentage of maximum change on
15692 the luma plane. Good values are in the <code>[8.0, 14.0]</code> range. Scene change
15693 detection is only relevant in case ‘<samp>combmatch</samp>’=<var>sc</var>. The range for
15694 ‘<samp>scthresh</samp>’ is <code>[0.0, 100.0]</code>.
15696 <p>Default value is <code>12.0</code>.
15699 <dt> ‘<samp>combmatch</samp>’</dt>
15700 <dd><p>When ‘<samp>combatch</samp>’ is not <var>none</var>, <code>fieldmatch</code> will take into
15701 account the combed scores of matches when deciding what match to use as the
15702 final match. Available values are:
15704 <dl compact="compact">
15705 <dt> ‘<samp>none</samp>’</dt>
15706 <dd><p>No final matching based on combed scores.
15708 <dt> ‘<samp>sc</samp>’</dt>
15709 <dd><p>Combed scores are only used when a scene change is detected.
15711 <dt> ‘<samp>full</samp>’</dt>
15712 <dd><p>Use combed scores all the time.
15716 <p>Default is <var>sc</var>.
15719 <dt> ‘<samp>combdbg</samp>’</dt>
15720 <dd><p>Force <code>fieldmatch</code> to calculate the combed metrics for certain matches and
15721 print them. This setting is known as ‘<samp>micout</samp>’ in TFM/VFM vocabulary.
15722 Available values are:
15724 <dl compact="compact">
15725 <dt> ‘<samp>none</samp>’</dt>
15726 <dd><p>No forced calculation.
15728 <dt> ‘<samp>pcn</samp>’</dt>
15729 <dd><p>Force p/c/n calculations.
15731 <dt> ‘<samp>pcnub</samp>’</dt>
15732 <dd><p>Force p/c/n/u/b calculations.
15736 <p>Default value is <var>none</var>.
15739 <dt> ‘<samp>cthresh</samp>’</dt>
15740 <dd><p>This is the area combing threshold used for combed frame detection. This
15741 essentially controls how "strong" or "visible" combing must be to be detected.
15742 Larger values mean combing must be more visible and smaller values mean combing
15743 can be less visible or strong and still be detected. Valid settings are from
15744 <code>-1</code> (every pixel will be detected as combed) to <code>255</code> (no pixel will
15745 be detected as combed). This is basically a pixel difference value. A good
15746 range is <code>[8, 12]</code>.
15748 <p>Default value is <code>9</code>.
15751 <dt> ‘<samp>chroma</samp>’</dt>
15752 <dd><p>Sets whether or not chroma is considered in the combed frame decision. Only
15753 disable this if your source has chroma problems (rainbowing, etc.) that are
15754 causing problems for the combed frame detection with chroma enabled. Actually,
15755 using ‘<samp>chroma</samp>’=<var>0</var> is usually more reliable, except for the case
15756 where there is chroma only combing in the source.
15758 <p>Default value is <code>0</code>.
15761 <dt> ‘<samp>blockx</samp>’</dt>
15762 <dt> ‘<samp>blocky</samp>’</dt>
15763 <dd><p>Respectively set the x-axis and y-axis size of the window used during combed
15764 frame detection. This has to do with the size of the area in which
15765 ‘<samp>combpel</samp>’ pixels are required to be detected as combed for a frame to be
15766 declared combed. See the ‘<samp>combpel</samp>’ parameter description for more info.
15767 Possible values are any number that is a power of 2 starting at 4 and going up
15770 <p>Default value is <code>16</code>.
15773 <dt> ‘<samp>combpel</samp>’</dt>
15774 <dd><p>The number of combed pixels inside any of the ‘<samp>blocky</samp>’ by
15775 ‘<samp>blockx</samp>’ size blocks on the frame for the frame to be detected as
15776 combed. While ‘<samp>cthresh</samp>’ controls how "visible" the combing must be, this
15777 setting controls "how much" combing there must be in any localized area (a
15778 window defined by the ‘<samp>blockx</samp>’ and ‘<samp>blocky</samp>’ settings) on the
15779 frame. Minimum value is <code>0</code> and maximum is <code>blocky x blockx</code> (at
15780 which point no frames will ever be detected as combed). This setting is known
15781 as ‘<samp>MI</samp>’ in TFM/VFM vocabulary.
15783 <p>Default value is <code>80</code>.
15787 <p><a name="p_002fc_002fn_002fu_002fb-meaning"></a>
15788 </p><a name="p_002fc_002fn_002fu_002fb-meaning-1"></a>
15789 <h3 class="subsection"><a href="ffplay-all.html#toc-p_002fc_002fn_002fu_002fb-meaning-1">33.28.1 p/c/n/u/b meaning</a></h3>
15791 <a name="p_002fc_002fn"></a>
15792 <h4 class="subsubsection"><a href="ffplay-all.html#toc-p_002fc_002fn">33.28.1.1 p/c/n</a></h4>
15794 <p>We assume the following telecined stream:
15796 <table><tr><td> </td><td><pre class="example">Top fields: 1 2 2 3 4
15797 Bottom fields: 1 2 3 4 4
15798 </pre></td></tr></table>
15800 <p>The numbers correspond to the progressive frame the fields relate to. Here, the
15801 first two frames are progressive, the 3rd and 4th are combed, and so on.
15803 <p>When <code>fieldmatch</code> is configured to run a matching from bottom
15804 (‘<samp>field</samp>’=<var>bottom</var>) this is how this input stream get transformed:
15806 <table><tr><td> </td><td><pre class="example">Input stream:
15808 B 1 2 3 4 4 <-- matching reference
15815 </pre></td></tr></table>
15817 <p>As a result of the field matching, we can see that some frames get duplicated.
15818 To perform a complete inverse telecine, you need to rely on a decimation filter
15819 after this operation. See for instance the <a href="#decimate">decimate</a> filter.
15821 <p>The same operation now matching from top fields (‘<samp>field</samp>’=<var>top</var>)
15824 <table><tr><td> </td><td><pre class="example">Input stream:
15825 T 1 2 2 3 4 <-- matching reference
15833 </pre></td></tr></table>
15835 <p>In these examples, we can see what <var>p</var>, <var>c</var> and <var>n</var> mean;
15836 basically, they refer to the frame and field of the opposite parity:
15839 <li> <var>p</var> matches the field of the opposite parity in the previous frame
15840 </li><li> <var>c</var> matches the field of the opposite parity in the current frame
15841 </li><li> <var>n</var> matches the field of the opposite parity in the next frame
15844 <a name="u_002fb"></a>
15845 <h4 class="subsubsection"><a href="ffplay-all.html#toc-u_002fb">33.28.1.2 u/b</a></h4>
15847 <p>The <var>u</var> and <var>b</var> matching are a bit special in the sense that they match
15848 from the opposite parity flag. In the following examples, we assume that we are
15849 currently matching the 2nd frame (Top:2, bottom:2). According to the match, a
15850 ’x’ is placed above and below each matched fields.
15852 <p>With bottom matching (‘<samp>field</samp>’=<var>bottom</var>):
15853 </p><table><tr><td> </td><td><pre class="example">Match: c p n b u
15856 Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
15857 Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
15863 </pre></td></tr></table>
15865 <p>With top matching (‘<samp>field</samp>’=<var>top</var>):
15866 </p><table><tr><td> </td><td><pre class="example">Match: c p n b u
15869 Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
15870 Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
15876 </pre></td></tr></table>
15878 <a name="Examples-52"></a>
15879 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-52">33.28.2 Examples</a></h3>
15881 <p>Simple IVTC of a top field first telecined stream:
15882 </p><table><tr><td> </td><td><pre class="example">fieldmatch=order=tff:combmatch=none, decimate
15883 </pre></td></tr></table>
15885 <p>Advanced IVTC, with fallback on <a href="#yadif">yadif</a> for still combed frames:
15886 </p><table><tr><td> </td><td><pre class="example">fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
15887 </pre></td></tr></table>
15889 <a name="fieldorder"></a>
15890 <h2 class="section"><a href="ffplay-all.html#toc-fieldorder">33.29 fieldorder</a></h2>
15892 <p>Transform the field order of the input video.
15894 <p>This filter accepts the following options:
15896 <dl compact="compact">
15897 <dt> ‘<samp>order</samp>’</dt>
15898 <dd><p>Output field order. Valid values are <var>tff</var> for top field first or <var>bff</var>
15899 for bottom field first.
15903 <p>Default value is ‘<samp>tff</samp>’.
15905 <p>Transformation is achieved by shifting the picture content up or down
15906 by one line, and filling the remaining line with appropriate picture content.
15907 This method is consistent with most broadcast field order converters.
15909 <p>If the input video is not flagged as being interlaced, or it is already
15910 flagged as being of the required output field order then this filter does
15911 not alter the incoming video.
15913 <p>This filter is very useful when converting to or from PAL DV material,
15914 which is bottom field first.
15917 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i in.vob -vf "fieldorder=bff" out.dv
15918 </pre></td></tr></table>
15920 <a name="fifo"></a>
15921 <h2 class="section"><a href="ffplay-all.html#toc-fifo">33.30 fifo</a></h2>
15923 <p>Buffer input images and send them when they are requested.
15925 <p>This filter is mainly useful when auto-inserted by the libavfilter
15928 <p>The filter does not take parameters.
15930 <p><a name="format"></a>
15931 </p><a name="format-1"></a>
15932 <h2 class="section"><a href="ffplay-all.html#toc-format-1">33.31 format</a></h2>
15934 <p>Convert the input video to one of the specified pixel formats.
15935 Libavfilter will try to pick one that is supported for the input to
15938 <p>This filter accepts the following parameters:
15939 </p><dl compact="compact">
15940 <dt> ‘<samp>pix_fmts</samp>’</dt>
15941 <dd><p>A ’|’-separated list of pixel format names, for example
15942 "pix_fmts=yuv420p|monow|rgb24".
15947 <a name="Examples-57"></a>
15948 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-57">33.31.1 Examples</a></h3>
15952 Convert the input video to the format <var>yuv420p</var>
15953 <table><tr><td> </td><td><pre class="example">format=pix_fmts=yuv420p
15954 </pre></td></tr></table>
15956 <p>Convert the input video to any of the formats in the list
15957 </p><table><tr><td> </td><td><pre class="example">format=pix_fmts=yuv420p|yuv444p|yuv410p
15958 </pre></td></tr></table>
15961 <p><a name="fps"></a>
15962 </p><a name="fps-1"></a>
15963 <h2 class="section"><a href="ffplay-all.html#toc-fps-1">33.32 fps</a></h2>
15965 <p>Convert the video to specified constant frame rate by duplicating or dropping
15966 frames as necessary.
15968 <p>This filter accepts the following named parameters:
15969 </p><dl compact="compact">
15970 <dt> ‘<samp>fps</samp>’</dt>
15971 <dd><p>Desired output frame rate. The default is <code>25</code>.
15974 <dt> ‘<samp>round</samp>’</dt>
15975 <dd><p>Rounding method.
15977 <p>Possible values are:
15978 </p><dl compact="compact">
15979 <dt> ‘<samp>zero</samp>’</dt>
15980 <dd><p>zero round towards 0
15982 <dt> ‘<samp>inf</samp>’</dt>
15983 <dd><p>round away from 0
15985 <dt> ‘<samp>down</samp>’</dt>
15986 <dd><p>round towards -infinity
15988 <dt> ‘<samp>up</samp>’</dt>
15989 <dd><p>round towards +infinity
15991 <dt> ‘<samp>near</samp>’</dt>
15992 <dd><p>round to nearest
15995 <p>The default is <code>near</code>.
15998 <dt> ‘<samp>start_time</samp>’</dt>
15999 <dd><p>Assume the first PTS should be the given value, in seconds. This allows for
16000 padding/trimming at the start of stream. By default, no assumption is made
16001 about the first frame’s expected PTS, so no padding or trimming is done.
16002 For example, this could be set to 0 to pad the beginning with duplicates of
16003 the first frame if a video stream starts after the audio stream or to trim any
16004 frames with a negative PTS.
16009 <p>Alternatively, the options can be specified as a flat string:
16010 <var>fps</var>[:<var>round</var>].
16012 <p>See also the <a href="#setpts">setpts</a> filter.
16014 <a name="Examples-25"></a>
16015 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-25">33.32.1 Examples</a></h3>
16019 A typical usage in order to set the fps to 25:
16020 <table><tr><td> </td><td><pre class="example">fps=fps=25
16021 </pre></td></tr></table>
16024 Sets the fps to 24, using abbreviation and rounding method to round to nearest:
16025 <table><tr><td> </td><td><pre class="example">fps=fps=film:round=near
16026 </pre></td></tr></table>
16029 <a name="framestep"></a>
16030 <h2 class="section"><a href="ffplay-all.html#toc-framestep">33.33 framestep</a></h2>
16032 <p>Select one frame every N-th frame.
16034 <p>This filter accepts the following option:
16035 </p><dl compact="compact">
16036 <dt> ‘<samp>step</samp>’</dt>
16037 <dd><p>Select frame after every <code>step</code> frames.
16038 Allowed values are positive integers higher than 0. Default value is <code>1</code>.
16042 <p><a name="frei0r"></a>
16043 </p><a name="frei0r-1"></a>
16044 <h2 class="section"><a href="ffplay-all.html#toc-frei0r-1">33.34 frei0r</a></h2>
16046 <p>Apply a frei0r effect to the input video.
16048 <p>To enable compilation of this filter you need to install the frei0r
16049 header and configure FFmpeg with <code>--enable-frei0r</code>.
16051 <p>This filter accepts the following options:
16053 <dl compact="compact">
16054 <dt> ‘<samp>filter_name</samp>’</dt>
16055 <dd><p>The name to the frei0r effect to load. If the environment variable
16056 <code>FREI0R_PATH</code> is defined, the frei0r effect is searched in each one of the
16057 directories specified by the colon separated list in <code>FREIOR_PATH</code>,
16058 otherwise in the standard frei0r paths, which are in this order:
16059 ‘<tt>HOME/.frei0r-1/lib/</tt>’, ‘<tt>/usr/local/lib/frei0r-1/</tt>’,
16060 ‘<tt>/usr/lib/frei0r-1/</tt>’.
16063 <dt> ‘<samp>filter_params</samp>’</dt>
16064 <dd><p>A ’|’-separated list of parameters to pass to the frei0r effect.
16069 <p>A frei0r effect parameter can be a boolean (whose values are specified
16070 with "y" and "n"), a double, a color (specified by the syntax
16071 <var>R</var>/<var>G</var>/<var>B</var>, (<var>R</var>, <var>G</var>, and <var>B</var> being float
16072 numbers from 0.0 to 1.0) or by a color description specified in the "Color"
16073 section in the ffmpeg-utils manual), a position (specified by the syntax <var>X</var>/<var>Y</var>,
16074 <var>X</var> and <var>Y</var> being float numbers) and a string.
16076 <p>The number and kind of parameters depend on the loaded effect. If an
16077 effect parameter is not specified the default value is set.
16079 <a name="Examples-12"></a>
16080 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-12">33.34.1 Examples</a></h3>
16084 Apply the distort0r effect, set the first two double parameters:
16085 <table><tr><td> </td><td><pre class="example">frei0r=filter_name=distort0r:filter_params=0.5|0.01
16086 </pre></td></tr></table>
16089 Apply the colordistance effect, take a color as first parameter:
16090 <table><tr><td> </td><td><pre class="example">frei0r=colordistance:0.2/0.3/0.4
16091 frei0r=colordistance:violet
16092 frei0r=colordistance:0x112233
16093 </pre></td></tr></table>
16096 Apply the perspective effect, specify the top left and top right image
16098 <table><tr><td> </td><td><pre class="example">frei0r=perspective:0.2/0.2|0.8/0.2
16099 </pre></td></tr></table>
16102 <p>For more information see:
16103 <a href="http://frei0r.dyne.org">http://frei0r.dyne.org</a>
16106 <h2 class="section"><a href="ffplay-all.html#toc-geq">33.35 geq</a></h2>
16108 <p>The filter accepts the following options:
16110 <dl compact="compact">
16111 <dt> ‘<samp>lum_expr, lum</samp>’</dt>
16112 <dd><p>Set the luminance expression.
16114 <dt> ‘<samp>cb_expr, cb</samp>’</dt>
16115 <dd><p>Set the chrominance blue expression.
16117 <dt> ‘<samp>cr_expr, cr</samp>’</dt>
16118 <dd><p>Set the chrominance red expression.
16120 <dt> ‘<samp>alpha_expr, a</samp>’</dt>
16121 <dd><p>Set the alpha expression.
16123 <dt> ‘<samp>red_expr, r</samp>’</dt>
16124 <dd><p>Set the red expression.
16126 <dt> ‘<samp>green_expr, g</samp>’</dt>
16127 <dd><p>Set the green expression.
16129 <dt> ‘<samp>blue_expr, b</samp>’</dt>
16130 <dd><p>Set the blue expression.
16134 <p>The colorspace is selected according to the specified options. If one
16135 of the ‘<samp>lum_expr</samp>’, ‘<samp>cb_expr</samp>’, or ‘<samp>cr_expr</samp>’
16136 options is specified, the filter will automatically select a YCbCr
16137 colorspace. If one of the ‘<samp>red_expr</samp>’, ‘<samp>green_expr</samp>’, or
16138 ‘<samp>blue_expr</samp>’ options is specified, it will select an RGB
16141 <p>If one of the chrominance expression is not defined, it falls back on the other
16142 one. If no alpha expression is specified it will evaluate to opaque value.
16143 If none of chrominance expressions are specified, they will evaluate
16144 to the luminance expression.
16146 <p>The expressions can use the following variables and functions:
16148 <dl compact="compact">
16149 <dt> ‘<samp>N</samp>’</dt>
16150 <dd><p>The sequential number of the filtered frame, starting from <code>0</code>.
16153 <dt> ‘<samp>X</samp>’</dt>
16154 <dt> ‘<samp>Y</samp>’</dt>
16155 <dd><p>The coordinates of the current sample.
16158 <dt> ‘<samp>W</samp>’</dt>
16159 <dt> ‘<samp>H</samp>’</dt>
16160 <dd><p>The width and height of the image.
16163 <dt> ‘<samp>SW</samp>’</dt>
16164 <dt> ‘<samp>SH</samp>’</dt>
16165 <dd><p>Width and height scale depending on the currently filtered plane. It is the
16166 ratio between the corresponding luma plane number of pixels and the current
16167 plane ones. E.g. for YUV4:2:0 the values are <code>1,1</code> for the luma plane, and
16168 <code>0.5,0.5</code> for chroma planes.
16171 <dt> ‘<samp>T</samp>’</dt>
16172 <dd><p>Time of the current frame, expressed in seconds.
16175 <dt> ‘<samp>p(x, y)</samp>’</dt>
16176 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the current
16180 <dt> ‘<samp>lum(x, y)</samp>’</dt>
16181 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the luminance
16185 <dt> ‘<samp>cb(x, y)</samp>’</dt>
16186 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
16187 blue-difference chroma plane. Return 0 if there is no such plane.
16190 <dt> ‘<samp>cr(x, y)</samp>’</dt>
16191 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
16192 red-difference chroma plane. Return 0 if there is no such plane.
16195 <dt> ‘<samp>r(x, y)</samp>’</dt>
16196 <dt> ‘<samp>g(x, y)</samp>’</dt>
16197 <dt> ‘<samp>b(x, y)</samp>’</dt>
16198 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
16199 red/green/blue component. Return 0 if there is no such component.
16202 <dt> ‘<samp>alpha(x, y)</samp>’</dt>
16203 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the alpha
16204 plane. Return 0 if there is no such plane.
16208 <p>For functions, if <var>x</var> and <var>y</var> are outside the area, the value will be
16209 automatically clipped to the closer edge.
16211 <a name="Examples-79"></a>
16212 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-79">33.35.1 Examples</a></h3>
16216 Flip the image horizontally:
16217 <table><tr><td> </td><td><pre class="example">geq=p(W-X\,Y)
16218 </pre></td></tr></table>
16221 Generate a bidimensional sine wave, with angle <code>PI/3</code> and a
16222 wavelength of 100 pixels:
16223 <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
16224 </pre></td></tr></table>
16227 Generate a fancy enigmatic moving light:
16228 <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
16229 </pre></td></tr></table>
16232 Generate a quick emboss effect:
16233 <table><tr><td> </td><td><pre class="example">format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'
16234 </pre></td></tr></table>
16237 Modify RGB components depending on pixel position:
16238 <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)'
16239 </pre></td></tr></table>
16242 <a name="gradfun"></a>
16243 <h2 class="section"><a href="ffplay-all.html#toc-gradfun">33.36 gradfun</a></h2>
16245 <p>Fix the banding artifacts that are sometimes introduced into nearly flat
16246 regions by truncation to 8bit color depth.
16247 Interpolate the gradients that should go where the bands are, and
16250 <p>This filter is designed for playback only. Do not use it prior to
16251 lossy compression, because compression tends to lose the dither and
16252 bring back the bands.
16254 <p>This filter accepts the following options:
16256 <dl compact="compact">
16257 <dt> ‘<samp>strength</samp>’</dt>
16258 <dd><p>The maximum amount by which the filter will change any one pixel. Also the
16259 threshold for detecting nearly flat regions. Acceptable values range from .51 to
16260 64, default value is 1.2, out-of-range values will be clipped to the valid
16264 <dt> ‘<samp>radius</samp>’</dt>
16265 <dd><p>The neighborhood to fit the gradient to. A larger radius makes for smoother
16266 gradients, but also prevents the filter from modifying the pixels near detailed
16267 regions. Acceptable values are 8-32, default value is 16, out-of-range values
16268 will be clipped to the valid range.
16273 <p>Alternatively, the options can be specified as a flat string:
16274 <var>strength</var>[:<var>radius</var>]
16276 <a name="Examples-72"></a>
16277 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-72">33.36.1 Examples</a></h3>
16281 Apply the filter with a <code>3.5</code> strength and radius of <code>8</code>:
16282 <table><tr><td> </td><td><pre class="example">gradfun=3.5:8
16283 </pre></td></tr></table>
16286 Specify radius, omitting the strength (which will fall-back to the default
16288 <table><tr><td> </td><td><pre class="example">gradfun=radius=8
16289 </pre></td></tr></table>
16293 <p><a name="haldclut"></a>
16294 </p><a name="haldclut-1"></a>
16295 <h2 class="section"><a href="ffplay-all.html#toc-haldclut-1">33.37 haldclut</a></h2>
16297 <p>Apply a Hald CLUT to a video stream.
16299 <p>First input is the video stream to process, and second one is the Hald CLUT.
16300 The Hald CLUT input can be a simple picture or a complete video stream.
16302 <p>The filter accepts the following options:
16304 <dl compact="compact">
16305 <dt> ‘<samp>shortest</samp>’</dt>
16306 <dd><p>Force termination when the shortest input terminates. Default is <code>0</code>.
16308 <dt> ‘<samp>repeatlast</samp>’</dt>
16309 <dd><p>Continue applying the last CLUT after the end of the stream. A value of
16310 <code>0</code> disable the filter after the last frame of the CLUT is reached.
16311 Default is <code>1</code>.
16315 <p><code>haldclut</code> also has the same interpolation options as <a href="#lut3d">lut3d</a> (both
16316 filters share the same internals).
16318 <p>More information about the Hald CLUT can be found on Eskil Steenberg’s website
16319 (Hald CLUT author) at <a href="http://www.quelsolaar.com/technology/clut.html">http://www.quelsolaar.com/technology/clut.html</a>.
16321 <a name="Workflow-examples"></a>
16322 <h3 class="subsection"><a href="ffplay-all.html#toc-Workflow-examples">33.37.1 Workflow examples</a></h3>
16324 <a name="Hald-CLUT-video-stream"></a>
16325 <h4 class="subsubsection"><a href="ffplay-all.html#toc-Hald-CLUT-video-stream">33.37.1.1 Hald CLUT video stream</a></h4>
16327 <p>Generate an identity Hald CLUT stream altered with various effects:
16328 </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
16329 </pre></td></tr></table>
16331 <p>Note: make sure you use a lossless codec.
16333 <p>Then use it with <code>haldclut</code> to apply it on some random stream:
16334 </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
16335 </pre></td></tr></table>
16337 <p>The Hald CLUT will be applied to the 10 first seconds (duration of
16338 ‘<tt>clut.nut</tt>’), then the latest picture of that CLUT stream will be applied
16339 to the remaining frames of the <code>mandelbrot</code> stream.
16341 <a name="Hald-CLUT-with-preview"></a>
16342 <h4 class="subsubsection"><a href="ffplay-all.html#toc-Hald-CLUT-with-preview">33.37.1.2 Hald CLUT with preview</a></h4>
16344 <p>A Hald CLUT is supposed to be a squared image of <code>Level*Level*Level</code> by
16345 <code>Level*Level*Level</code> pixels. For a given Hald CLUT, FFmpeg will select the
16346 biggest possible square starting at the top left of the picture. The remaining
16347 padding pixels (bottom or right) will be ignored. This area can be used to add
16348 a preview of the Hald CLUT.
16350 <p>Typically, the following generated Hald CLUT will be supported by the
16351 <code>haldclut</code> filter:
16353 <table><tr><td> </td><td><pre class="example">ffmpeg -f lavfi -i <a href="#haldclutsrc">haldclutsrc</a>=8 -vf "
16354 pad=iw+320 [padded_clut];
16355 smptebars=s=320x256, split [a][b];
16356 [padded_clut][a] overlay=W-320:h, curves=color_negative [main];
16357 [main][b] overlay=W-320" -frames:v 1 clut.png
16358 </pre></td></tr></table>
16360 <p>It contains the original and a preview of the effect of the CLUT: SMPTE color
16361 bars are displayed on the right-top, and below the same color bars processed by
16364 <p>Then, the effect of this Hald CLUT can be visualized with:
16365 </p><table><tr><td> </td><td><pre class="example">ffplay input.mkv -vf "movie=clut.png, [in] haldclut"
16366 </pre></td></tr></table>
16368 <a name="hflip"></a>
16369 <h2 class="section"><a href="ffplay-all.html#toc-hflip">33.38 hflip</a></h2>
16371 <p>Flip the input video horizontally.
16373 <p>For example to horizontally flip the input video with <code>ffmpeg</code>:
16374 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i in.avi -vf "hflip" out.avi
16375 </pre></td></tr></table>
16377 <a name="histeq"></a>
16378 <h2 class="section"><a href="ffplay-all.html#toc-histeq">33.39 histeq</a></h2>
16379 <p>This filter applies a global color histogram equalization on a
16382 <p>It can be used to correct video that has a compressed range of pixel
16383 intensities. The filter redistributes the pixel intensities to
16384 equalize their distribution across the intensity range. It may be
16385 viewed as an "automatically adjusting contrast filter". This filter is
16386 useful only for correcting degraded or poorly captured source
16389 <p>The filter accepts the following options:
16391 <dl compact="compact">
16392 <dt> ‘<samp>strength</samp>’</dt>
16393 <dd><p>Determine the amount of equalization to be applied. As the strength
16394 is reduced, the distribution of pixel intensities more-and-more
16395 approaches that of the input frame. The value must be a float number
16396 in the range [0,1] and defaults to 0.200.
16399 <dt> ‘<samp>intensity</samp>’</dt>
16400 <dd><p>Set the maximum intensity that can generated and scale the output
16401 values appropriately. The strength should be set as desired and then
16402 the intensity can be limited if needed to avoid washing-out. The value
16403 must be a float number in the range [0,1] and defaults to 0.210.
16406 <dt> ‘<samp>antibanding</samp>’</dt>
16407 <dd><p>Set the antibanding level. If enabled the filter will randomly vary
16408 the luminance of output pixels by a small amount to avoid banding of
16409 the histogram. Possible values are <code>none</code>, <code>weak</code> or
16410 <code>strong</code>. It defaults to <code>none</code>.
16414 <a name="histogram"></a>
16415 <h2 class="section"><a href="ffplay-all.html#toc-histogram">33.40 histogram</a></h2>
16417 <p>Compute and draw a color distribution histogram for the input video.
16419 <p>The computed histogram is a representation of distribution of color components
16422 <p>The filter accepts the following options:
16424 <dl compact="compact">
16425 <dt> ‘<samp>mode</samp>’</dt>
16426 <dd><p>Set histogram mode.
16428 <p>It accepts the following values:
16429 </p><dl compact="compact">
16430 <dt> ‘<samp>levels</samp>’</dt>
16431 <dd><p>standard histogram that display color components distribution in an image.
16432 Displays color graph for each color component. Shows distribution
16433 of the Y, U, V, A or R, G, B components, depending on input format,
16434 in current frame. Bellow each graph is color component scale meter.
16437 <dt> ‘<samp>color</samp>’</dt>
16438 <dd><p>chroma values in vectorscope, if brighter more such chroma values are
16439 distributed in an image.
16440 Displays chroma values (U/V color placement) in two dimensional graph
16441 (which is called a vectorscope). It can be used to read of the hue and
16442 saturation of the current frame. At a same time it is a histogram.
16443 The whiter a pixel in the vectorscope, the more pixels of the input frame
16444 correspond to that pixel (that is the more pixels have this chroma value).
16445 The V component is displayed on the horizontal (X) axis, with the leftmost
16446 side being V = 0 and the rightmost side being V = 255.
16447 The U component is displayed on the vertical (Y) axis, with the top
16448 representing U = 0 and the bottom representing U = 255.
16450 <p>The position of a white pixel in the graph corresponds to the chroma value
16451 of a pixel of the input clip. So the graph can be used to read of the
16452 hue (color flavor) and the saturation (the dominance of the hue in the color).
16453 As the hue of a color changes, it moves around the square. At the center of
16454 the square, the saturation is zero, which means that the corresponding pixel
16455 has no color. If you increase the amount of a specific color, while leaving
16456 the other colors unchanged, the saturation increases, and you move towards
16457 the edge of the square.
16460 <dt> ‘<samp>color2</samp>’</dt>
16461 <dd><p>chroma values in vectorscope, similar as <code>color</code> but actual chroma values
16465 <dt> ‘<samp>waveform</samp>’</dt>
16466 <dd><p>per row/column color component graph. In row mode graph in the left side represents
16467 color component value 0 and right side represents value = 255. In column mode top
16468 side represents color component value = 0 and bottom side represents value = 255.
16471 <p>Default value is <code>levels</code>.
16474 <dt> ‘<samp>level_height</samp>’</dt>
16475 <dd><p>Set height of level in <code>levels</code>. Default value is <code>200</code>.
16476 Allowed range is [50, 2048].
16479 <dt> ‘<samp>scale_height</samp>’</dt>
16480 <dd><p>Set height of color scale in <code>levels</code>. Default value is <code>12</code>.
16481 Allowed range is [0, 40].
16484 <dt> ‘<samp>step</samp>’</dt>
16485 <dd><p>Set step for <code>waveform</code> mode. Smaller values are useful to find out how much
16486 of same luminance values across input rows/columns are distributed.
16487 Default value is <code>10</code>. Allowed range is [1, 255].
16490 <dt> ‘<samp>waveform_mode</samp>’</dt>
16491 <dd><p>Set mode for <code>waveform</code>. Can be either <code>row</code>, or <code>column</code>.
16492 Default is <code>row</code>.
16495 <dt> ‘<samp>waveform_mirror</samp>’</dt>
16496 <dd><p>Set mirroring mode for <code>waveform</code>. <code>0</code> means unmirrored, <code>1</code>
16497 means mirrored. In mirrored mode, higher values will be represented on the left
16498 side for <code>row</code> mode and at the top for <code>column</code> mode. Default is
16499 <code>0</code> (unmirrored).
16502 <dt> ‘<samp>display_mode</samp>’</dt>
16503 <dd><p>Set display mode for <code>waveform</code> and <code>levels</code>.
16504 It accepts the following values:
16505 </p><dl compact="compact">
16506 <dt> ‘<samp>parade</samp>’</dt>
16507 <dd><p>Display separate graph for the color components side by side in
16508 <code>row</code> waveform mode or one below other in <code>column</code> waveform mode
16509 for <code>waveform</code> histogram mode. For <code>levels</code> histogram mode
16510 per color component graphs are placed one bellow other.
16512 <p>This display mode in <code>waveform</code> histogram mode makes it easy to spot
16513 color casts in the highlights and shadows of an image, by comparing the
16514 contours of the top and the bottom of each waveform.
16515 Since whites, grays, and blacks are characterized by
16516 exactly equal amounts of red, green, and blue, neutral areas of the
16517 picture should display three waveforms of roughly equal width/height.
16518 If not, the correction is easy to make by making adjustments to level the
16522 <dt> ‘<samp>overlay</samp>’</dt>
16523 <dd><p>Presents information that’s identical to that in the <code>parade</code>, except
16524 that the graphs representing color components are superimposed directly
16527 <p>This display mode in <code>waveform</code> histogram mode can make it easier to spot
16528 the relative differences or similarities in overlapping areas of the color
16529 components that are supposed to be identical, such as neutral whites, grays,
16533 <p>Default is <code>parade</code>.
16536 <dt> ‘<samp>levels_mode</samp>’</dt>
16537 <dd><p>Set mode for <code>levels</code>. Can be either <code>linear</code>, or <code>logarithmic</code>.
16538 Default is <code>linear</code>.
16542 <a name="Examples-16"></a>
16543 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-16">33.40.1 Examples</a></h3>
16547 Calculate and draw histogram:
16548 <table><tr><td> </td><td><pre class="example">ffplay -i input -vf histogram
16549 </pre></td></tr></table>
16553 <p><a name="hqdn3d"></a>
16554 </p><a name="hqdn3d-1"></a>
16555 <h2 class="section"><a href="ffplay-all.html#toc-hqdn3d-1">33.41 hqdn3d</a></h2>
16557 <p>High precision/quality 3d denoise filter. This filter aims to reduce
16558 image noise producing smooth images and making still images really
16559 still. It should enhance compressibility.
16561 <p>It accepts the following optional parameters:
16563 <dl compact="compact">
16564 <dt> ‘<samp>luma_spatial</samp>’</dt>
16565 <dd><p>a non-negative float number which specifies spatial luma strength,
16569 <dt> ‘<samp>chroma_spatial</samp>’</dt>
16570 <dd><p>a non-negative float number which specifies spatial chroma strength,
16571 defaults to 3.0*<var>luma_spatial</var>/4.0
16574 <dt> ‘<samp>luma_tmp</samp>’</dt>
16575 <dd><p>a float number which specifies luma temporal strength, defaults to
16576 6.0*<var>luma_spatial</var>/4.0
16579 <dt> ‘<samp>chroma_tmp</samp>’</dt>
16580 <dd><p>a float number which specifies chroma temporal strength, defaults to
16581 <var>luma_tmp</var>*<var>chroma_spatial</var>/<var>luma_spatial</var>
16586 <h2 class="section"><a href="ffplay-all.html#toc-hue">33.42 hue</a></h2>
16588 <p>Modify the hue and/or the saturation of the input.
16590 <p>This filter accepts the following options:
16592 <dl compact="compact">
16593 <dt> ‘<samp>h</samp>’</dt>
16594 <dd><p>Specify the hue angle as a number of degrees. It accepts an expression,
16595 and defaults to "0".
16598 <dt> ‘<samp>s</samp>’</dt>
16599 <dd><p>Specify the saturation in the [-10,10] range. It accepts an expression and
16600 defaults to "1".
16603 <dt> ‘<samp>H</samp>’</dt>
16604 <dd><p>Specify the hue angle as a number of radians. It accepts an
16605 expression, and defaults to "0".
16608 <dt> ‘<samp>b</samp>’</dt>
16609 <dd><p>Specify the brightness in the [-10,10] range. It accepts an expression and
16610 defaults to "0".
16614 <p>‘<samp>h</samp>’ and ‘<samp>H</samp>’ are mutually exclusive, and can’t be
16615 specified at the same time.
16617 <p>The ‘<samp>b</samp>’, ‘<samp>h</samp>’, ‘<samp>H</samp>’ and ‘<samp>s</samp>’ option values are
16618 expressions containing the following constants:
16620 <dl compact="compact">
16621 <dt> ‘<samp>n</samp>’</dt>
16622 <dd><p>frame count of the input frame starting from 0
16625 <dt> ‘<samp>pts</samp>’</dt>
16626 <dd><p>presentation timestamp of the input frame expressed in time base units
16629 <dt> ‘<samp>r</samp>’</dt>
16630 <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
16633 <dt> ‘<samp>t</samp>’</dt>
16634 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
16637 <dt> ‘<samp>tb</samp>’</dt>
16638 <dd><p>time base of the input video
16642 <a name="Examples-51"></a>
16643 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-51">33.42.1 Examples</a></h3>
16647 Set the hue to 90 degrees and the saturation to 1.0:
16648 <table><tr><td> </td><td><pre class="example">hue=h=90:s=1
16649 </pre></td></tr></table>
16652 Same command but expressing the hue in radians:
16653 <table><tr><td> </td><td><pre class="example">hue=H=PI/2:s=1
16654 </pre></td></tr></table>
16657 Rotate hue and make the saturation swing between 0
16658 and 2 over a period of 1 second:
16659 <table><tr><td> </td><td><pre class="example">hue="H=2*PI*t: s=sin(2*PI*t)+1"
16660 </pre></td></tr></table>
16663 Apply a 3 seconds saturation fade-in effect starting at 0:
16664 <table><tr><td> </td><td><pre class="example">hue="s=min(t/3\,1)"
16665 </pre></td></tr></table>
16667 <p>The general fade-in expression can be written as:
16668 </p><table><tr><td> </td><td><pre class="example">hue="s=min(0\, max((t-START)/DURATION\, 1))"
16669 </pre></td></tr></table>
16672 Apply a 3 seconds saturation fade-out effect starting at 5 seconds:
16673 <table><tr><td> </td><td><pre class="example">hue="s=max(0\, min(1\, (8-t)/3))"
16674 </pre></td></tr></table>
16676 <p>The general fade-out expression can be written as:
16677 </p><table><tr><td> </td><td><pre class="example">hue="s=max(0\, min(1\, (START+DURATION-t)/DURATION))"
16678 </pre></td></tr></table>
16682 <a name="Commands"></a>
16683 <h3 class="subsection"><a href="ffplay-all.html#toc-Commands">33.42.2 Commands</a></h3>
16685 <p>This filter supports the following commands:
16686 </p><dl compact="compact">
16687 <dt> ‘<samp>b</samp>’</dt>
16688 <dt> ‘<samp>s</samp>’</dt>
16689 <dt> ‘<samp>h</samp>’</dt>
16690 <dt> ‘<samp>H</samp>’</dt>
16691 <dd><p>Modify the hue and/or the saturation and/or brightness of the input video.
16692 The command accepts the same syntax of the corresponding option.
16694 <p>If the specified expression is not valid, it is kept at its current
16699 <a name="idet"></a>
16700 <h2 class="section"><a href="ffplay-all.html#toc-idet">33.43 idet</a></h2>
16702 <p>Detect video interlacing type.
16704 <p>This filter tries to detect if the input is interlaced or progressive,
16705 top or bottom field first.
16707 <p>The filter accepts the following options:
16709 <dl compact="compact">
16710 <dt> ‘<samp>intl_thres</samp>’</dt>
16711 <dd><p>Set interlacing threshold.
16713 <dt> ‘<samp>prog_thres</samp>’</dt>
16714 <dd><p>Set progressive threshold.
16719 <h2 class="section"><a href="ffplay-all.html#toc-il">33.44 il</a></h2>
16721 <p>Deinterleave or interleave fields.
16723 <p>This filter allows to process interlaced images fields without
16724 deinterlacing them. Deinterleaving splits the input frame into 2
16725 fields (so called half pictures). Odd lines are moved to the top
16726 half of the output image, even lines to the bottom half.
16727 You can process (filter) them independently and then re-interleave them.
16729 <p>The filter accepts the following options:
16731 <dl compact="compact">
16732 <dt> ‘<samp>luma_mode, l</samp>’</dt>
16733 <dt> ‘<samp>chroma_mode, c</samp>’</dt>
16734 <dt> ‘<samp>alpha_mode, a</samp>’</dt>
16735 <dd><p>Available values for <var>luma_mode</var>, <var>chroma_mode</var> and
16736 <var>alpha_mode</var> are:
16738 <dl compact="compact">
16739 <dt> ‘<samp>none</samp>’</dt>
16743 <dt> ‘<samp>deinterleave, d</samp>’</dt>
16744 <dd><p>Deinterleave fields, placing one above the other.
16747 <dt> ‘<samp>interleave, i</samp>’</dt>
16748 <dd><p>Interleave fields. Reverse the effect of deinterleaving.
16751 <p>Default value is <code>none</code>.
16754 <dt> ‘<samp>luma_swap, ls</samp>’</dt>
16755 <dt> ‘<samp>chroma_swap, cs</samp>’</dt>
16756 <dt> ‘<samp>alpha_swap, as</samp>’</dt>
16757 <dd><p>Swap luma/chroma/alpha fields. Exchange even & odd lines. Default value is <code>0</code>.
16761 <a name="interlace"></a>
16762 <h2 class="section"><a href="ffplay-all.html#toc-interlace">33.45 interlace</a></h2>
16764 <p>Simple interlacing filter from progressive contents. This interleaves upper (or
16765 lower) lines from odd frames with lower (or upper) lines from even frames,
16766 halving the frame rate and preserving image height.
16768 <table><tr><td> </td><td><pre class="example"> Original Original New Frame
16769 Frame 'j' Frame 'j+1' (tff)
16770 ========== =========== ==================
16771 Line 0 --------------------> Frame 'j' Line 0
16772 Line 1 Line 1 ----> Frame 'j+1' Line 1
16773 Line 2 ---------------------> Frame 'j' Line 2
16774 Line 3 Line 3 ----> Frame 'j+1' Line 3
16776 New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on
16777 </pre></td></tr></table>
16779 <p>It accepts the following optional parameters:
16781 <dl compact="compact">
16782 <dt> ‘<samp>scan</samp>’</dt>
16783 <dd><p>determines whether the interlaced frame is taken from the even (tff - default)
16784 or odd (bff) lines of the progressive frame.
16787 <dt> ‘<samp>lowpass</samp>’</dt>
16788 <dd><p>Enable (default) or disable the vertical lowpass filter to avoid twitter
16789 interlacing and reduce moire patterns.
16793 <a name="kerndeint"></a>
16794 <h2 class="section"><a href="ffplay-all.html#toc-kerndeint">33.46 kerndeint</a></h2>
16796 <p>Deinterlace input video by applying Donald Graft’s adaptive kernel
16797 deinterling. Work on interlaced parts of a video to produce
16798 progressive frames.
16800 <p>The description of the accepted parameters follows.
16802 <dl compact="compact">
16803 <dt> ‘<samp>thresh</samp>’</dt>
16804 <dd><p>Set the threshold which affects the filter’s tolerance when
16805 determining if a pixel line must be processed. It must be an integer
16806 in the range [0,255] and defaults to 10. A value of 0 will result in
16807 applying the process on every pixels.
16810 <dt> ‘<samp>map</samp>’</dt>
16811 <dd><p>Paint pixels exceeding the threshold value to white if set to 1.
16815 <dt> ‘<samp>order</samp>’</dt>
16816 <dd><p>Set the fields order. Swap fields if set to 1, leave fields alone if
16820 <dt> ‘<samp>sharp</samp>’</dt>
16821 <dd><p>Enable additional sharpening if set to 1. Default is 0.
16824 <dt> ‘<samp>twoway</samp>’</dt>
16825 <dd><p>Enable twoway sharpening if set to 1. Default is 0.
16829 <a name="Examples-50"></a>
16830 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-50">33.46.1 Examples</a></h3>
16834 Apply default values:
16835 <table><tr><td> </td><td><pre class="example">kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
16836 </pre></td></tr></table>
16839 Enable additional sharpening:
16840 <table><tr><td> </td><td><pre class="example">kerndeint=sharp=1
16841 </pre></td></tr></table>
16844 Paint processed pixels in white:
16845 <table><tr><td> </td><td><pre class="example">kerndeint=map=1
16846 </pre></td></tr></table>
16849 <p><a name="lut3d"></a>
16850 </p><a name="lut3d-1"></a>
16851 <h2 class="section"><a href="ffplay-all.html#toc-lut3d-1">33.47 lut3d</a></h2>
16853 <p>Apply a 3D LUT to an input video.
16855 <p>The filter accepts the following options:
16857 <dl compact="compact">
16858 <dt> ‘<samp>file</samp>’</dt>
16859 <dd><p>Set the 3D LUT file name.
16861 <p>Currently supported formats:
16862 </p><dl compact="compact">
16863 <dt> ‘<samp>3dl</samp>’</dt>
16864 <dd><p>AfterEffects
16866 <dt> ‘<samp>cube</samp>’</dt>
16869 <dt> ‘<samp>dat</samp>’</dt>
16872 <dt> ‘<samp>m3d</samp>’</dt>
16877 <dt> ‘<samp>interp</samp>’</dt>
16878 <dd><p>Select interpolation mode.
16880 <p>Available values are:
16882 <dl compact="compact">
16883 <dt> ‘<samp>nearest</samp>’</dt>
16884 <dd><p>Use values from the nearest defined point.
16886 <dt> ‘<samp>trilinear</samp>’</dt>
16887 <dd><p>Interpolate values using the 8 points defining a cube.
16889 <dt> ‘<samp>tetrahedral</samp>’</dt>
16890 <dd><p>Interpolate values using a tetrahedron.
16896 <a name="lut_002c-lutrgb_002c-lutyuv"></a>
16897 <h2 class="section"><a href="ffplay-all.html#toc-lut_002c-lutrgb_002c-lutyuv">33.48 lut, lutrgb, lutyuv</a></h2>
16899 <p>Compute a look-up table for binding each pixel component input value
16900 to an output value, and apply it to input video.
16902 <p><var>lutyuv</var> applies a lookup table to a YUV input video, <var>lutrgb</var>
16903 to an RGB input video.
16905 <p>These filters accept the following options:
16906 </p><dl compact="compact">
16907 <dt> ‘<samp>c0</samp>’</dt>
16908 <dd><p>set first pixel component expression
16910 <dt> ‘<samp>c1</samp>’</dt>
16911 <dd><p>set second pixel component expression
16913 <dt> ‘<samp>c2</samp>’</dt>
16914 <dd><p>set third pixel component expression
16916 <dt> ‘<samp>c3</samp>’</dt>
16917 <dd><p>set fourth pixel component expression, corresponds to the alpha component
16920 <dt> ‘<samp>r</samp>’</dt>
16921 <dd><p>set red component expression
16923 <dt> ‘<samp>g</samp>’</dt>
16924 <dd><p>set green component expression
16926 <dt> ‘<samp>b</samp>’</dt>
16927 <dd><p>set blue component expression
16929 <dt> ‘<samp>a</samp>’</dt>
16930 <dd><p>alpha component expression
16933 <dt> ‘<samp>y</samp>’</dt>
16934 <dd><p>set Y/luminance component expression
16936 <dt> ‘<samp>u</samp>’</dt>
16937 <dd><p>set U/Cb component expression
16939 <dt> ‘<samp>v</samp>’</dt>
16940 <dd><p>set V/Cr component expression
16944 <p>Each of them specifies the expression to use for computing the lookup table for
16945 the corresponding pixel component values.
16947 <p>The exact component associated to each of the <var>c*</var> options depends on the
16950 <p>The <var>lut</var> filter requires either YUV or RGB pixel formats in input,
16951 <var>lutrgb</var> requires RGB pixel formats in input, and <var>lutyuv</var> requires YUV.
16953 <p>The expressions can contain the following constants and functions:
16955 <dl compact="compact">
16956 <dt> ‘<samp>w</samp>’</dt>
16957 <dt> ‘<samp>h</samp>’</dt>
16958 <dd><p>the input width and height
16961 <dt> ‘<samp>val</samp>’</dt>
16962 <dd><p>input value for the pixel component
16965 <dt> ‘<samp>clipval</samp>’</dt>
16966 <dd><p>the input value clipped in the <var>minval</var>-<var>maxval</var> range
16969 <dt> ‘<samp>maxval</samp>’</dt>
16970 <dd><p>maximum value for the pixel component
16973 <dt> ‘<samp>minval</samp>’</dt>
16974 <dd><p>minimum value for the pixel component
16977 <dt> ‘<samp>negval</samp>’</dt>
16978 <dd><p>the negated value for the pixel component value clipped in the
16979 <var>minval</var>-<var>maxval</var> range , it corresponds to the expression
16980 "maxval-clipval+minval"
16983 <dt> ‘<samp>clip(val)</samp>’</dt>
16984 <dd><p>the computed value in <var>val</var> clipped in the
16985 <var>minval</var>-<var>maxval</var> range
16988 <dt> ‘<samp>gammaval(gamma)</samp>’</dt>
16989 <dd><p>the computed gamma correction value of the pixel component value
16990 clipped in the <var>minval</var>-<var>maxval</var> range, corresponds to the
16992 "pow((clipval-minval)/(maxval-minval)\,<var>gamma</var>)*(maxval-minval)+minval"
16997 <p>All expressions default to "val".
16999 <a name="Examples-14"></a>
17000 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-14">33.48.1 Examples</a></h3>
17004 Negate input video:
17005 <table><tr><td> </td><td><pre class="example">lutrgb="r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val"
17006 lutyuv="y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val"
17007 </pre></td></tr></table>
17009 <p>The above is the same as:
17010 </p><table><tr><td> </td><td><pre class="example">lutrgb="r=negval:g=negval:b=negval"
17011 lutyuv="y=negval:u=negval:v=negval"
17012 </pre></td></tr></table>
17016 <table><tr><td> </td><td><pre class="example">lutyuv=y=negval
17017 </pre></td></tr></table>
17020 Remove chroma components, turns the video into a graytone image:
17021 <table><tr><td> </td><td><pre class="example">lutyuv="u=128:v=128"
17022 </pre></td></tr></table>
17025 Apply a luma burning effect:
17026 <table><tr><td> </td><td><pre class="example">lutyuv="y=2*val"
17027 </pre></td></tr></table>
17030 Remove green and blue components:
17031 <table><tr><td> </td><td><pre class="example">lutrgb="g=0:b=0"
17032 </pre></td></tr></table>
17035 Set a constant alpha channel value on input:
17036 <table><tr><td> </td><td><pre class="example">format=rgba,lutrgb=a="maxval-minval/2"
17037 </pre></td></tr></table>
17040 Correct luminance gamma by a 0.5 factor:
17041 <table><tr><td> </td><td><pre class="example">lutyuv=y=gammaval(0.5)
17042 </pre></td></tr></table>
17045 Discard least significant bits of luma:
17046 <table><tr><td> </td><td><pre class="example">lutyuv=y='bitand(val, 128+64+32)'
17047 </pre></td></tr></table>
17050 <a name="mergeplanes"></a>
17051 <h2 class="section"><a href="ffplay-all.html#toc-mergeplanes">33.49 mergeplanes</a></h2>
17053 <p>Merge color channel components from several video streams.
17055 <p>The filter accepts up to 4 input streams, and merge selected input
17056 planes to the output video.
17058 <p>This filter accepts the following options:
17059 </p><dl compact="compact">
17060 <dt> ‘<samp>mapping</samp>’</dt>
17061 <dd><p>Set input to output plane mapping. Default is <code>0</code>.
17063 <p>The mappings is specified as a bitmap. It should be specified as a
17064 hexadecimal number in the form 0xAa[Bb[Cc[Dd]]]. ’Aa’ describes the
17065 mapping for the first plane of the output stream. ’A’ sets the number of
17066 the input stream to use (from 0 to 3), and ’a’ the plane number of the
17067 corresponding input to use (from 0 to 3). The rest of the mappings is
17068 similar, ’Bb’ describes the mapping for the output stream second
17069 plane, ’Cc’ describes the mapping for the output stream third plane and
17070 ’Dd’ describes the mapping for the output stream fourth plane.
17073 <dt> ‘<samp>format</samp>’</dt>
17074 <dd><p>Set output pixel format. Default is <code>yuva444p</code>.
17078 <a name="Examples-67"></a>
17079 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-67">33.49.1 Examples</a></h3>
17083 Merge three gray video streams of same width and height into single video stream:
17084 <table><tr><td> </td><td><pre class="example">[a0][a1][a2]mergeplanes=0x001020:yuv444p
17085 </pre></td></tr></table>
17088 Merge 1st yuv444p stream and 2nd gray video stream into yuva444p video stream:
17089 <table><tr><td> </td><td><pre class="example">[a0][a1]mergeplanes=0x00010210:yuva444p
17090 </pre></td></tr></table>
17093 Swap Y and A plane in yuva444p stream:
17094 <table><tr><td> </td><td><pre class="example">format=yuva444p,mergeplanes=0x03010200:yuva444p
17095 </pre></td></tr></table>
17098 Swap U and V plane in yuv420p stream:
17099 <table><tr><td> </td><td><pre class="example">format=yuv420p,mergeplanes=0x000201:yuv420p
17100 </pre></td></tr></table>
17103 Cast a rgb24 clip to yuv444p:
17104 <table><tr><td> </td><td><pre class="example">format=rgb24,mergeplanes=0x000102:yuv444p
17105 </pre></td></tr></table>
17108 <a name="mcdeint"></a>
17109 <h2 class="section"><a href="ffplay-all.html#toc-mcdeint">33.50 mcdeint</a></h2>
17111 <p>Apply motion-compensation deinterlacing.
17113 <p>It needs one field per frame as input and must thus be used together
17114 with yadif=1/3 or equivalent.
17116 <p>This filter accepts the following options:
17117 </p><dl compact="compact">
17118 <dt> ‘<samp>mode</samp>’</dt>
17119 <dd><p>Set the deinterlacing mode.
17121 <p>It accepts one of the following values:
17122 </p><dl compact="compact">
17123 <dt> ‘<samp>fast</samp>’</dt>
17124 <dt> ‘<samp>medium</samp>’</dt>
17125 <dt> ‘<samp>slow</samp>’</dt>
17126 <dd><p>use iterative motion estimation
17128 <dt> ‘<samp>extra_slow</samp>’</dt>
17129 <dd><p>like ‘<samp>slow</samp>’, but use multiple reference frames.
17132 <p>Default value is ‘<samp>fast</samp>’.
17135 <dt> ‘<samp>parity</samp>’</dt>
17136 <dd><p>Set the picture field parity assumed for the input video. It must be
17137 one of the following values:
17139 <dl compact="compact">
17140 <dt> ‘<samp>0, tff</samp>’</dt>
17141 <dd><p>assume top field first
17143 <dt> ‘<samp>1, bff</samp>’</dt>
17144 <dd><p>assume bottom field first
17148 <p>Default value is ‘<samp>bff</samp>’.
17151 <dt> ‘<samp>qp</samp>’</dt>
17152 <dd><p>Set per-block quantization parameter (QP) used by the internal
17155 <p>Higher values should result in a smoother motion vector field but less
17156 optimal individual vectors. Default value is 1.
17161 <h2 class="section"><a href="ffplay-all.html#toc-mp">33.51 mp</a></h2>
17163 <p>Apply an MPlayer filter to the input video.
17165 <p>This filter provides a wrapper around some of the filters of
17168 <p>This wrapper is considered experimental. Some of the wrapped filters
17169 may not work properly and we may drop support for them, as they will
17170 be implemented natively into FFmpeg. Thus you should avoid
17171 depending on them when writing portable scripts.
17173 <p>The filter accepts the parameters:
17174 <var>filter_name</var>[:=]<var>filter_params</var>
17176 <p><var>filter_name</var> is the name of a supported MPlayer filter,
17177 <var>filter_params</var> is a string containing the parameters accepted by
17180 <p>The list of the currently supported filters follows:
17181 </p><dl compact="compact">
17182 <dt> <var>eq2</var></dt>
17183 <dt> <var>eq</var></dt>
17184 <dt> <var>fspp</var></dt>
17185 <dt> <var>ilpack</var></dt>
17186 <dt> <var>pp7</var></dt>
17187 <dt> <var>softpulldown</var></dt>
17188 <dt> <var>uspp</var></dt>
17191 <p>The parameter syntax and behavior for the listed filters are the same
17192 of the corresponding MPlayer filters. For detailed instructions check
17193 the "VIDEO FILTERS" section in the MPlayer manual.
17195 <a name="Examples-7"></a>
17196 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-7">33.51.1 Examples</a></h3>
17200 Adjust gamma, brightness, contrast:
17201 <table><tr><td> </td><td><pre class="example">mp=eq2=1.0:2:0.5
17202 </pre></td></tr></table>
17205 <p>See also mplayer(1), <a href="http://www.mplayerhq.hu/">http://www.mplayerhq.hu/</a>.
17207 <a name="mpdecimate"></a>
17208 <h2 class="section"><a href="ffplay-all.html#toc-mpdecimate">33.52 mpdecimate</a></h2>
17210 <p>Drop frames that do not differ greatly from the previous frame in
17211 order to reduce frame rate.
17213 <p>The main use of this filter is for very-low-bitrate encoding
17214 (e.g. streaming over dialup modem), but it could in theory be used for
17215 fixing movies that were inverse-telecined incorrectly.
17217 <p>A description of the accepted options follows.
17219 <dl compact="compact">
17220 <dt> ‘<samp>max</samp>’</dt>
17221 <dd><p>Set the maximum number of consecutive frames which can be dropped (if
17222 positive), or the minimum interval between dropped frames (if
17223 negative). If the value is 0, the frame is dropped unregarding the
17224 number of previous sequentially dropped frames.
17226 <p>Default value is 0.
17229 <dt> ‘<samp>hi</samp>’</dt>
17230 <dt> ‘<samp>lo</samp>’</dt>
17231 <dt> ‘<samp>frac</samp>’</dt>
17232 <dd><p>Set the dropping threshold values.
17234 <p>Values for ‘<samp>hi</samp>’ and ‘<samp>lo</samp>’ are for 8x8 pixel blocks and
17235 represent actual pixel value differences, so a threshold of 64
17236 corresponds to 1 unit of difference for each pixel, or the same spread
17237 out differently over the block.
17239 <p>A frame is a candidate for dropping if no 8x8 blocks differ by more
17240 than a threshold of ‘<samp>hi</samp>’, and if no more than ‘<samp>frac</samp>’ blocks (1
17241 meaning the whole image) differ by more than a threshold of ‘<samp>lo</samp>’.
17243 <p>Default value for ‘<samp>hi</samp>’ is 64*12, default value for ‘<samp>lo</samp>’ is
17244 64*5, and default value for ‘<samp>frac</samp>’ is 0.33.
17249 <a name="negate"></a>
17250 <h2 class="section"><a href="ffplay-all.html#toc-negate">33.53 negate</a></h2>
17252 <p>Negate input video.
17254 <p>This filter accepts an integer in input, if non-zero it negates the
17255 alpha component (if available). The default value in input is 0.
17257 <a name="noformat"></a>
17258 <h2 class="section"><a href="ffplay-all.html#toc-noformat">33.54 noformat</a></h2>
17260 <p>Force libavfilter not to use any of the specified pixel formats for the
17261 input to the next filter.
17263 <p>This filter accepts the following parameters:
17264 </p><dl compact="compact">
17265 <dt> ‘<samp>pix_fmts</samp>’</dt>
17266 <dd><p>A ’|’-separated list of pixel format names, for example
17267 "pix_fmts=yuv420p|monow|rgb24".
17272 <a name="Examples-53"></a>
17273 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-53">33.54.1 Examples</a></h3>
17277 Force libavfilter to use a format different from <var>yuv420p</var> for the
17278 input to the vflip filter:
17279 <table><tr><td> </td><td><pre class="example">noformat=pix_fmts=yuv420p,vflip
17280 </pre></td></tr></table>
17283 Convert the input video to any of the formats not contained in the list:
17284 <table><tr><td> </td><td><pre class="example">noformat=yuv420p|yuv444p|yuv410p
17285 </pre></td></tr></table>
17288 <a name="noise"></a>
17289 <h2 class="section"><a href="ffplay-all.html#toc-noise">33.55 noise</a></h2>
17291 <p>Add noise on video input frame.
17293 <p>The filter accepts the following options:
17295 <dl compact="compact">
17296 <dt> ‘<samp>all_seed</samp>’</dt>
17297 <dt> ‘<samp>c0_seed</samp>’</dt>
17298 <dt> ‘<samp>c1_seed</samp>’</dt>
17299 <dt> ‘<samp>c2_seed</samp>’</dt>
17300 <dt> ‘<samp>c3_seed</samp>’</dt>
17301 <dd><p>Set noise seed for specific pixel component or all pixel components in case
17302 of <var>all_seed</var>. Default value is <code>123457</code>.
17305 <dt> ‘<samp>all_strength, alls</samp>’</dt>
17306 <dt> ‘<samp>c0_strength, c0s</samp>’</dt>
17307 <dt> ‘<samp>c1_strength, c1s</samp>’</dt>
17308 <dt> ‘<samp>c2_strength, c2s</samp>’</dt>
17309 <dt> ‘<samp>c3_strength, c3s</samp>’</dt>
17310 <dd><p>Set noise strength for specific pixel component or all pixel components in case
17311 <var>all_strength</var>. Default value is <code>0</code>. Allowed range is [0, 100].
17314 <dt> ‘<samp>all_flags, allf</samp>’</dt>
17315 <dt> ‘<samp>c0_flags, c0f</samp>’</dt>
17316 <dt> ‘<samp>c1_flags, c1f</samp>’</dt>
17317 <dt> ‘<samp>c2_flags, c2f</samp>’</dt>
17318 <dt> ‘<samp>c3_flags, c3f</samp>’</dt>
17319 <dd><p>Set pixel component flags or set flags for all components if <var>all_flags</var>.
17320 Available values for component flags are:
17321 </p><dl compact="compact">
17322 <dt> ‘<samp>a</samp>’</dt>
17323 <dd><p>averaged temporal noise (smoother)
17325 <dt> ‘<samp>p</samp>’</dt>
17326 <dd><p>mix random noise with a (semi)regular pattern
17328 <dt> ‘<samp>t</samp>’</dt>
17329 <dd><p>temporal noise (noise pattern changes between frames)
17331 <dt> ‘<samp>u</samp>’</dt>
17332 <dd><p>uniform noise (gaussian otherwise)
17338 <a name="Examples-17"></a>
17339 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-17">33.55.1 Examples</a></h3>
17341 <p>Add temporal and uniform noise to input video:
17342 </p><table><tr><td> </td><td><pre class="example">noise=alls=20:allf=t+u
17343 </pre></td></tr></table>
17345 <a name="null"></a>
17346 <h2 class="section"><a href="ffplay-all.html#toc-null">33.56 null</a></h2>
17348 <p>Pass the video source unchanged to the output.
17351 <h2 class="section"><a href="ffplay-all.html#toc-ocv">33.57 ocv</a></h2>
17353 <p>Apply video transform using libopencv.
17355 <p>To enable this filter install libopencv library and headers and
17356 configure FFmpeg with <code>--enable-libopencv</code>.
17358 <p>This filter accepts the following parameters:
17360 <dl compact="compact">
17361 <dt> ‘<samp>filter_name</samp>’</dt>
17362 <dd><p>The name of the libopencv filter to apply.
17365 <dt> ‘<samp>filter_params</samp>’</dt>
17366 <dd><p>The parameters to pass to the libopencv filter. If not specified the default
17367 values are assumed.
17372 <p>Refer to the official libopencv documentation for more precise
17374 <a href="http://opencv.willowgarage.com/documentation/c/image_filtering.html">http://opencv.willowgarage.com/documentation/c/image_filtering.html</a>
17376 <p>Follows the list of supported libopencv filters.
17378 <p><a name="dilate"></a>
17379 </p><a name="dilate-1"></a>
17380 <h3 class="subsection"><a href="ffplay-all.html#toc-dilate-1">33.57.1 dilate</a></h3>
17382 <p>Dilate an image by using a specific structuring element.
17383 This filter corresponds to the libopencv function <code>cvDilate</code>.
17385 <p>It accepts the parameters: <var>struct_el</var>|<var>nb_iterations</var>.
17387 <p><var>struct_el</var> represents a structuring element, and has the syntax:
17388 <var>cols</var>x<var>rows</var>+<var>anchor_x</var>x<var>anchor_y</var>/<var>shape</var>
17390 <p><var>cols</var> and <var>rows</var> represent the number of columns and rows of
17391 the structuring element, <var>anchor_x</var> and <var>anchor_y</var> the anchor
17392 point, and <var>shape</var> the shape for the structuring element, and
17393 can be one of the values "rect", "cross", "ellipse", "custom".
17395 <p>If the value for <var>shape</var> is "custom", it must be followed by a
17396 string of the form "=<var>filename</var>". The file with name
17397 <var>filename</var> is assumed to represent a binary image, with each
17398 printable character corresponding to a bright pixel. When a custom
17399 <var>shape</var> is used, <var>cols</var> and <var>rows</var> are ignored, the number
17400 or columns and rows of the read file are assumed instead.
17402 <p>The default value for <var>struct_el</var> is "3x3+0x0/rect".
17404 <p><var>nb_iterations</var> specifies the number of times the transform is
17405 applied to the image, and defaults to 1.
17407 <p>Follow some example:
17408 </p><table><tr><td> </td><td><pre class="example"># use the default values
17411 # dilate using a structuring element with a 5x5 cross, iterate two times
17412 ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
17414 # read the shape from the file diamond.shape, iterate two times
17415 # the file diamond.shape may contain a pattern of characters like this:
17421 # the specified cols and rows are ignored (but not the anchor point coordinates)
17422 ocv=dilate:0x0+2x2/custom=diamond.shape|2
17423 </pre></td></tr></table>
17425 <a name="erode"></a>
17426 <h3 class="subsection"><a href="ffplay-all.html#toc-erode">33.57.2 erode</a></h3>
17428 <p>Erode an image by using a specific structuring element.
17429 This filter corresponds to the libopencv function <code>cvErode</code>.
17431 <p>The filter accepts the parameters: <var>struct_el</var>:<var>nb_iterations</var>,
17432 with the same syntax and semantics as the <a href="#dilate">dilate</a> filter.
17434 <a name="smooth"></a>
17435 <h3 class="subsection"><a href="ffplay-all.html#toc-smooth">33.57.3 smooth</a></h3>
17437 <p>Smooth the input video.
17439 <p>The filter takes the following parameters:
17440 <var>type</var>|<var>param1</var>|<var>param2</var>|<var>param3</var>|<var>param4</var>.
17442 <p><var>type</var> is the type of smooth filter to apply, and can be one of
17443 the following values: "blur", "blur_no_scale", "median", "gaussian",
17444 "bilateral". The default value is "gaussian".
17446 <p><var>param1</var>, <var>param2</var>, <var>param3</var>, and <var>param4</var> are
17447 parameters whose meanings depend on smooth type. <var>param1</var> and
17448 <var>param2</var> accept integer positive values or 0, <var>param3</var> and
17449 <var>param4</var> accept float values.
17451 <p>The default value for <var>param1</var> is 3, the default value for the
17452 other parameters is 0.
17454 <p>These parameters correspond to the parameters assigned to the
17455 libopencv function <code>cvSmooth</code>.
17457 <p><a name="overlay"></a>
17458 </p><a name="overlay-1"></a>
17459 <h2 class="section"><a href="ffplay-all.html#toc-overlay-1">33.58 overlay</a></h2>
17461 <p>Overlay one video on top of another.
17463 <p>It takes two inputs and one output, the first input is the "main"
17464 video on which the second input is overlayed.
17466 <p>This filter accepts the following parameters:
17468 <p>A description of the accepted options follows.
17470 <dl compact="compact">
17471 <dt> ‘<samp>x</samp>’</dt>
17472 <dt> ‘<samp>y</samp>’</dt>
17473 <dd><p>Set the expression for the x and y coordinates of the overlayed video
17474 on the main video. Default value is "0" for both expressions. In case
17475 the expression is invalid, it is set to a huge value (meaning that the
17476 overlay will not be displayed within the output visible area).
17479 <dt> ‘<samp>eval</samp>’</dt>
17480 <dd><p>Set when the expressions for ‘<samp>x</samp>’, and ‘<samp>y</samp>’ are evaluated.
17482 <p>It accepts the following values:
17483 </p><dl compact="compact">
17484 <dt> ‘<samp>init</samp>’</dt>
17485 <dd><p>only evaluate expressions once during the filter initialization or
17486 when a command is processed
17489 <dt> ‘<samp>frame</samp>’</dt>
17490 <dd><p>evaluate expressions for each incoming frame
17494 <p>Default value is ‘<samp>frame</samp>’.
17497 <dt> ‘<samp>shortest</samp>’</dt>
17498 <dd><p>If set to 1, force the output to terminate when the shortest input
17499 terminates. Default value is 0.
17502 <dt> ‘<samp>format</samp>’</dt>
17503 <dd><p>Set the format for the output video.
17505 <p>It accepts the following values:
17506 </p><dl compact="compact">
17507 <dt> ‘<samp>yuv420</samp>’</dt>
17508 <dd><p>force YUV420 output
17511 <dt> ‘<samp>yuv444</samp>’</dt>
17512 <dd><p>force YUV444 output
17515 <dt> ‘<samp>rgb</samp>’</dt>
17516 <dd><p>force RGB output
17520 <p>Default value is ‘<samp>yuv420</samp>’.
17523 <dt> ‘<samp>rgb <em>(deprecated)</em></samp>’</dt>
17524 <dd><p>If set to 1, force the filter to accept inputs in the RGB
17525 color space. Default value is 0. This option is deprecated, use
17526 ‘<samp>format</samp>’ instead.
17529 <dt> ‘<samp>repeatlast</samp>’</dt>
17530 <dd><p>If set to 1, force the filter to draw the last overlay frame over the
17531 main input until the end of the stream. A value of 0 disables this
17532 behavior. Default value is 1.
17536 <p>The ‘<samp>x</samp>’, and ‘<samp>y</samp>’ expressions can contain the following
17539 <dl compact="compact">
17540 <dt> ‘<samp>main_w, W</samp>’</dt>
17541 <dt> ‘<samp>main_h, H</samp>’</dt>
17542 <dd><p>main input width and height
17545 <dt> ‘<samp>overlay_w, w</samp>’</dt>
17546 <dt> ‘<samp>overlay_h, h</samp>’</dt>
17547 <dd><p>overlay input width and height
17550 <dt> ‘<samp>x</samp>’</dt>
17551 <dt> ‘<samp>y</samp>’</dt>
17552 <dd><p>the computed values for <var>x</var> and <var>y</var>. They are evaluated for
17556 <dt> ‘<samp>hsub</samp>’</dt>
17557 <dt> ‘<samp>vsub</samp>’</dt>
17558 <dd><p>horizontal and vertical chroma subsample values of the output
17559 format. For example for the pixel format "yuv422p" <var>hsub</var> is 2 and
17560 <var>vsub</var> is 1.
17563 <dt> ‘<samp>n</samp>’</dt>
17564 <dd><p>the number of input frame, starting from 0
17567 <dt> ‘<samp>pos</samp>’</dt>
17568 <dd><p>the position in the file of the input frame, NAN if unknown
17571 <dt> ‘<samp>t</samp>’</dt>
17572 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
17576 <p>Note that the <var>n</var>, <var>pos</var>, <var>t</var> variables are available only
17577 when evaluation is done <em>per frame</em>, and will evaluate to NAN
17578 when ‘<samp>eval</samp>’ is set to ‘<samp>init</samp>’.
17580 <p>Be aware that frames are taken from each input video in timestamp
17581 order, hence, if their initial timestamps differ, it is a good idea
17582 to pass the two inputs through a <var>setpts=PTS-STARTPTS</var> filter to
17583 have them begin in the same zero timestamp, as it does the example for
17584 the <var>movie</var> filter.
17586 <p>You can chain together more overlays but you should test the
17587 efficiency of such approach.
17589 <a name="Commands-2"></a>
17590 <h3 class="subsection"><a href="ffplay-all.html#toc-Commands-2">33.58.1 Commands</a></h3>
17592 <p>This filter supports the following commands:
17593 </p><dl compact="compact">
17594 <dt> ‘<samp>x</samp>’</dt>
17595 <dt> ‘<samp>y</samp>’</dt>
17596 <dd><p>Modify the x and y of the overlay input.
17597 The command accepts the same syntax of the corresponding option.
17599 <p>If the specified expression is not valid, it is kept at its current
17604 <a name="Examples-73"></a>
17605 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-73">33.58.2 Examples</a></h3>
17609 Draw the overlay at 10 pixels from the bottom right corner of the main
17611 <table><tr><td> </td><td><pre class="example">overlay=main_w-overlay_w-10:main_h-overlay_h-10
17612 </pre></td></tr></table>
17614 <p>Using named options the example above becomes:
17615 </p><table><tr><td> </td><td><pre class="example">overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10
17616 </pre></td></tr></table>
17619 Insert a transparent PNG logo in the bottom left corner of the input,
17620 using the <code>ffmpeg</code> tool with the <code>-filter_complex</code> option:
17621 <table><tr><td> </td><td><pre class="example">ffmpeg -i input -i logo -filter_complex 'overlay=10:main_h-overlay_h-10' output
17622 </pre></td></tr></table>
17625 Insert 2 different transparent PNG logos (second logo on bottom
17626 right corner) using the <code>ffmpeg</code> tool:
17627 <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
17628 </pre></td></tr></table>
17631 Add a transparent color layer on top of the main video, <code>WxH</code>
17632 must specify the size of the main input to the overlay filter:
17633 <table><tr><td> </td><td><pre class="example">color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
17634 </pre></td></tr></table>
17637 Play an original video and a filtered version (here with the deshake
17638 filter) side by side using the <code>ffplay</code> tool:
17639 <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'
17640 </pre></td></tr></table>
17642 <p>The above command is the same as:
17643 </p><table><tr><td> </td><td><pre class="example">ffplay input.avi -vf 'split[b], pad=iw*2[src], [b]deshake, [src]overlay=w'
17644 </pre></td></tr></table>
17647 Make a sliding overlay appearing from the left to the right top part of the
17648 screen starting since time 2:
17649 <table><tr><td> </td><td><pre class="example">overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
17650 </pre></td></tr></table>
17653 Compose output by putting two input videos side to side:
17654 <table><tr><td> </td><td><pre class="example">ffmpeg -i left.avi -i right.avi -filter_complex "
17655 nullsrc=size=200x100 [background];
17656 [0:v] setpts=PTS-STARTPTS, scale=100x100 [left];
17657 [1:v] setpts=PTS-STARTPTS, scale=100x100 [right];
17658 [background][left] overlay=shortest=1 [background+left];
17659 [background+left][right] overlay=shortest=1:x=100 [left+right]
17661 </pre></td></tr></table>
17664 Chain several overlays in cascade:
17665 <table><tr><td> </td><td><pre class="example">nullsrc=s=200x200 [bg];
17666 testsrc=s=100x100, split=4 [in0][in1][in2][in3];
17667 [in0] lutrgb=r=0, [bg] overlay=0:0 [mid0];
17668 [in1] lutrgb=g=0, [mid0] overlay=100:0 [mid1];
17669 [in2] lutrgb=b=0, [mid1] overlay=0:100 [mid2];
17670 [in3] null, [mid2] overlay=100:100 [out0]
17671 </pre></td></tr></table>
17675 <a name="owdenoise"></a>
17676 <h2 class="section"><a href="ffplay-all.html#toc-owdenoise">33.59 owdenoise</a></h2>
17678 <p>Apply Overcomplete Wavelet denoiser.
17680 <p>The filter accepts the following options:
17682 <dl compact="compact">
17683 <dt> ‘<samp>depth</samp>’</dt>
17686 <p>Larger depth values will denoise lower frequency components more, but
17687 slow down filtering.
17689 <p>Must be an int in the range 8-16, default is <code>8</code>.
17692 <dt> ‘<samp>luma_strength, ls</samp>’</dt>
17693 <dd><p>Set luma strength.
17695 <p>Must be a double value in the range 0-1000, default is <code>1.0</code>.
17698 <dt> ‘<samp>chroma_strength, cs</samp>’</dt>
17699 <dd><p>Set chroma strength.
17701 <p>Must be a double value in the range 0-1000, default is <code>1.0</code>.
17706 <h2 class="section"><a href="ffplay-all.html#toc-pad">33.60 pad</a></h2>
17708 <p>Add paddings to the input image, and place the original input at the
17709 given coordinates <var>x</var>, <var>y</var>.
17711 <p>This filter accepts the following parameters:
17713 <dl compact="compact">
17714 <dt> ‘<samp>width, w</samp>’</dt>
17715 <dt> ‘<samp>height, h</samp>’</dt>
17716 <dd><p>Specify an expression for the size of the output image with the
17717 paddings added. If the value for <var>width</var> or <var>height</var> is 0, the
17718 corresponding input size is used for the output.
17720 <p>The <var>width</var> expression can reference the value set by the
17721 <var>height</var> expression, and vice versa.
17723 <p>The default value of <var>width</var> and <var>height</var> is 0.
17726 <dt> ‘<samp>x</samp>’</dt>
17727 <dt> ‘<samp>y</samp>’</dt>
17728 <dd><p>Specify an expression for the offsets where to place the input image
17729 in the padded area with respect to the top/left border of the output
17732 <p>The <var>x</var> expression can reference the value set by the <var>y</var>
17733 expression, and vice versa.
17735 <p>The default value of <var>x</var> and <var>y</var> is 0.
17738 <dt> ‘<samp>color</samp>’</dt>
17739 <dd><p>Specify the color of the padded area. For the syntax of this option,
17740 check the "Color" section in the ffmpeg-utils manual.
17742 <p>The default value of <var>color</var> is "black".
17746 <p>The value for the <var>width</var>, <var>height</var>, <var>x</var>, and <var>y</var>
17747 options are expressions containing the following constants:
17749 <dl compact="compact">
17750 <dt> ‘<samp>in_w</samp>’</dt>
17751 <dt> ‘<samp>in_h</samp>’</dt>
17752 <dd><p>the input video width and height
17755 <dt> ‘<samp>iw</samp>’</dt>
17756 <dt> ‘<samp>ih</samp>’</dt>
17757 <dd><p>same as <var>in_w</var> and <var>in_h</var>
17760 <dt> ‘<samp>out_w</samp>’</dt>
17761 <dt> ‘<samp>out_h</samp>’</dt>
17762 <dd><p>the output width and height, that is the size of the padded area as
17763 specified by the <var>width</var> and <var>height</var> expressions
17766 <dt> ‘<samp>ow</samp>’</dt>
17767 <dt> ‘<samp>oh</samp>’</dt>
17768 <dd><p>same as <var>out_w</var> and <var>out_h</var>
17771 <dt> ‘<samp>x</samp>’</dt>
17772 <dt> ‘<samp>y</samp>’</dt>
17773 <dd><p>x and y offsets as specified by the <var>x</var> and <var>y</var>
17774 expressions, or NAN if not yet specified
17777 <dt> ‘<samp>a</samp>’</dt>
17778 <dd><p>same as <var>iw</var> / <var>ih</var>
17781 <dt> ‘<samp>sar</samp>’</dt>
17782 <dd><p>input sample aspect ratio
17785 <dt> ‘<samp>dar</samp>’</dt>
17786 <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
17789 <dt> ‘<samp>hsub</samp>’</dt>
17790 <dt> ‘<samp>vsub</samp>’</dt>
17791 <dd><p>horizontal and vertical chroma subsample values. For example for the
17792 pixel format "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
17796 <a name="Examples-63"></a>
17797 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-63">33.60.1 Examples</a></h3>
17801 Add paddings with color "violet" to the input video. Output video
17802 size is 640x480, the top-left corner of the input video is placed at
17804 <table><tr><td> </td><td><pre class="example">pad=640:480:0:40:violet
17805 </pre></td></tr></table>
17807 <p>The example above is equivalent to the following command:
17808 </p><table><tr><td> </td><td><pre class="example">pad=width=640:height=480:x=0:y=40:color=violet
17809 </pre></td></tr></table>
17812 Pad the input to get an output with dimensions increased by 3/2,
17813 and put the input video at the center of the padded area:
17814 <table><tr><td> </td><td><pre class="example">pad="3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2"
17815 </pre></td></tr></table>
17818 Pad the input to get a squared output with size equal to the maximum
17819 value between the input width and height, and put the input video at
17820 the center of the padded area:
17821 <table><tr><td> </td><td><pre class="example">pad="max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2"
17822 </pre></td></tr></table>
17825 Pad the input to get a final w/h ratio of 16:9:
17826 <table><tr><td> </td><td><pre class="example">pad="ih*16/9:ih:(ow-iw)/2:(oh-ih)/2"
17827 </pre></td></tr></table>
17830 In case of anamorphic video, in order to set the output display aspect
17831 correctly, it is necessary to use <var>sar</var> in the expression,
17832 according to the relation:
17833 <table><tr><td> </td><td><pre class="example">(ih * X / ih) * sar = output_dar
17834 X = output_dar / sar
17835 </pre></td></tr></table>
17837 <p>Thus the previous example needs to be modified to:
17838 </p><table><tr><td> </td><td><pre class="example">pad="ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2"
17839 </pre></td></tr></table>
17842 Double output size and put the input video in the bottom-right
17843 corner of the output padded area:
17844 <table><tr><td> </td><td><pre class="example">pad="2*iw:2*ih:ow-iw:oh-ih"
17845 </pre></td></tr></table>
17848 <a name="perspective"></a>
17849 <h2 class="section"><a href="ffplay-all.html#toc-perspective">33.61 perspective</a></h2>
17851 <p>Correct perspective of video not recorded perpendicular to the screen.
17853 <p>A description of the accepted parameters follows.
17855 <dl compact="compact">
17856 <dt> ‘<samp>x0</samp>’</dt>
17857 <dt> ‘<samp>y0</samp>’</dt>
17858 <dt> ‘<samp>x1</samp>’</dt>
17859 <dt> ‘<samp>y1</samp>’</dt>
17860 <dt> ‘<samp>x2</samp>’</dt>
17861 <dt> ‘<samp>y2</samp>’</dt>
17862 <dt> ‘<samp>x3</samp>’</dt>
17863 <dt> ‘<samp>y3</samp>’</dt>
17864 <dd><p>Set coordinates expression for top left, top right, bottom left and bottom right corners.
17865 Default values are <code>0:0:W:0:0:H:W:H</code> with which perspective will remain unchanged.
17867 <p>The expressions can use the following variables:
17869 <dl compact="compact">
17870 <dt> ‘<samp>W</samp>’</dt>
17871 <dt> ‘<samp>H</samp>’</dt>
17872 <dd><p>the width and height of video frame.
17877 <dt> ‘<samp>interpolation</samp>’</dt>
17878 <dd><p>Set interpolation for perspective correction.
17880 <p>It accepts the following values:
17881 </p><dl compact="compact">
17882 <dt> ‘<samp>linear</samp>’</dt>
17883 <dt> ‘<samp>cubic</samp>’</dt>
17886 <p>Default value is ‘<samp>linear</samp>’.
17890 <a name="phase"></a>
17891 <h2 class="section"><a href="ffplay-all.html#toc-phase">33.62 phase</a></h2>
17893 <p>Delay interlaced video by one field time so that the field order changes.
17895 <p>The intended use is to fix PAL movies that have been captured with the
17896 opposite field order to the film-to-video transfer.
17898 <p>A description of the accepted parameters follows.
17900 <dl compact="compact">
17901 <dt> ‘<samp>mode</samp>’</dt>
17902 <dd><p>Set phase mode.
17904 <p>It accepts the following values:
17905 </p><dl compact="compact">
17906 <dt> ‘<samp>t</samp>’</dt>
17907 <dd><p>Capture field order top-first, transfer bottom-first.
17908 Filter will delay the bottom field.
17911 <dt> ‘<samp>b</samp>’</dt>
17912 <dd><p>Capture field order bottom-first, transfer top-first.
17913 Filter will delay the top field.
17916 <dt> ‘<samp>p</samp>’</dt>
17917 <dd><p>Capture and transfer with the same field order. This mode only exists
17918 for the documentation of the other options to refer to, but if you
17919 actually select it, the filter will faithfully do nothing.
17922 <dt> ‘<samp>a</samp>’</dt>
17923 <dd><p>Capture field order determined automatically by field flags, transfer
17925 Filter selects among ‘<samp>t</samp>’ and ‘<samp>b</samp>’ modes on a frame by frame
17926 basis using field flags. If no field information is available,
17927 then this works just like ‘<samp>u</samp>’.
17930 <dt> ‘<samp>u</samp>’</dt>
17931 <dd><p>Capture unknown or varying, transfer opposite.
17932 Filter selects among ‘<samp>t</samp>’ and ‘<samp>b</samp>’ on a frame by frame basis by
17933 analyzing the images and selecting the alternative that produces best
17934 match between the fields.
17937 <dt> ‘<samp>T</samp>’</dt>
17938 <dd><p>Capture top-first, transfer unknown or varying.
17939 Filter selects among ‘<samp>t</samp>’ and ‘<samp>p</samp>’ using image analysis.
17942 <dt> ‘<samp>B</samp>’</dt>
17943 <dd><p>Capture bottom-first, transfer unknown or varying.
17944 Filter selects among ‘<samp>b</samp>’ and ‘<samp>p</samp>’ using image analysis.
17947 <dt> ‘<samp>A</samp>’</dt>
17948 <dd><p>Capture determined by field flags, transfer unknown or varying.
17949 Filter selects among ‘<samp>t</samp>’, ‘<samp>b</samp>’ and ‘<samp>p</samp>’ using field flags and
17950 image analysis. If no field information is available, then this works just
17951 like ‘<samp>U</samp>’. This is the default mode.
17954 <dt> ‘<samp>U</samp>’</dt>
17955 <dd><p>Both capture and transfer unknown or varying.
17956 Filter selects among ‘<samp>t</samp>’, ‘<samp>b</samp>’ and ‘<samp>p</samp>’ using image analysis only.
17962 <a name="pixdesctest"></a>
17963 <h2 class="section"><a href="ffplay-all.html#toc-pixdesctest">33.63 pixdesctest</a></h2>
17965 <p>Pixel format descriptor test filter, mainly useful for internal
17966 testing. The output video should be equal to the input video.
17969 </p><table><tr><td> </td><td><pre class="example">format=monow, pixdesctest
17970 </pre></td></tr></table>
17972 <p>can be used to test the monowhite pixel format descriptor definition.
17975 <h2 class="section"><a href="ffplay-all.html#toc-pp">33.64 pp</a></h2>
17977 <p>Enable the specified chain of postprocessing subfilters using libpostproc. This
17978 library should be automatically selected with a GPL build (<code>--enable-gpl</code>).
17979 Subfilters must be separated by ’/’ and can be disabled by prepending a ’-’.
17980 Each subfilter and some options have a short and a long name that can be used
17981 interchangeably, i.e. dr/dering are the same.
17983 <p>The filters accept the following options:
17985 <dl compact="compact">
17986 <dt> ‘<samp>subfilters</samp>’</dt>
17987 <dd><p>Set postprocessing subfilters string.
17991 <p>All subfilters share common options to determine their scope:
17993 <dl compact="compact">
17994 <dt> ‘<samp>a/autoq</samp>’</dt>
17995 <dd><p>Honor the quality commands for this subfilter.
17998 <dt> ‘<samp>c/chrom</samp>’</dt>
17999 <dd><p>Do chrominance filtering, too (default).
18002 <dt> ‘<samp>y/nochrom</samp>’</dt>
18003 <dd><p>Do luminance filtering only (no chrominance).
18006 <dt> ‘<samp>n/noluma</samp>’</dt>
18007 <dd><p>Do chrominance filtering only (no luminance).
18011 <p>These options can be appended after the subfilter name, separated by a ’|’.
18013 <p>Available subfilters are:
18015 <dl compact="compact">
18016 <dt> ‘<samp>hb/hdeblock[|difference[|flatness]]</samp>’</dt>
18017 <dd><p>Horizontal deblocking filter
18018 </p><dl compact="compact">
18019 <dt> ‘<samp>difference</samp>’</dt>
18020 <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
18022 <dt> ‘<samp>flatness</samp>’</dt>
18023 <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
18028 <dt> ‘<samp>vb/vdeblock[|difference[|flatness]]</samp>’</dt>
18029 <dd><p>Vertical deblocking filter
18030 </p><dl compact="compact">
18031 <dt> ‘<samp>difference</samp>’</dt>
18032 <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
18034 <dt> ‘<samp>flatness</samp>’</dt>
18035 <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
18040 <dt> ‘<samp>ha/hadeblock[|difference[|flatness]]</samp>’</dt>
18041 <dd><p>Accurate horizontal deblocking filter
18042 </p><dl compact="compact">
18043 <dt> ‘<samp>difference</samp>’</dt>
18044 <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
18046 <dt> ‘<samp>flatness</samp>’</dt>
18047 <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
18052 <dt> ‘<samp>va/vadeblock[|difference[|flatness]]</samp>’</dt>
18053 <dd><p>Accurate vertical deblocking filter
18054 </p><dl compact="compact">
18055 <dt> ‘<samp>difference</samp>’</dt>
18056 <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
18058 <dt> ‘<samp>flatness</samp>’</dt>
18059 <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
18065 <p>The horizontal and vertical deblocking filters share the difference and
18066 flatness values so you cannot set different horizontal and vertical
18069 <dl compact="compact">
18070 <dt> ‘<samp>h1/x1hdeblock</samp>’</dt>
18071 <dd><p>Experimental horizontal deblocking filter
18074 <dt> ‘<samp>v1/x1vdeblock</samp>’</dt>
18075 <dd><p>Experimental vertical deblocking filter
18078 <dt> ‘<samp>dr/dering</samp>’</dt>
18079 <dd><p>Deringing filter
18082 <dt> ‘<samp>tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer</samp>’</dt>
18083 <dd><dl compact="compact">
18084 <dt> ‘<samp>threshold1</samp>’</dt>
18085 <dd><p>larger -> stronger filtering
18087 <dt> ‘<samp>threshold2</samp>’</dt>
18088 <dd><p>larger -> stronger filtering
18090 <dt> ‘<samp>threshold3</samp>’</dt>
18091 <dd><p>larger -> stronger filtering
18096 <dt> ‘<samp>al/autolevels[:f/fullyrange], automatic brightness / contrast correction</samp>’</dt>
18097 <dd><dl compact="compact">
18098 <dt> ‘<samp>f/fullyrange</samp>’</dt>
18099 <dd><p>Stretch luminance to <code>0-255</code>.
18104 <dt> ‘<samp>lb/linblenddeint</samp>’</dt>
18105 <dd><p>Linear blend deinterlacing filter that deinterlaces the given block by
18106 filtering all lines with a <code>(1 2 1)</code> filter.
18109 <dt> ‘<samp>li/linipoldeint</samp>’</dt>
18110 <dd><p>Linear interpolating deinterlacing filter that deinterlaces the given block by
18111 linearly interpolating every second line.
18114 <dt> ‘<samp>ci/cubicipoldeint</samp>’</dt>
18115 <dd><p>Cubic interpolating deinterlacing filter deinterlaces the given block by
18116 cubically interpolating every second line.
18119 <dt> ‘<samp>md/mediandeint</samp>’</dt>
18120 <dd><p>Median deinterlacing filter that deinterlaces the given block by applying a
18121 median filter to every second line.
18124 <dt> ‘<samp>fd/ffmpegdeint</samp>’</dt>
18125 <dd><p>FFmpeg deinterlacing filter that deinterlaces the given block by filtering every
18126 second line with a <code>(-1 4 2 4 -1)</code> filter.
18129 <dt> ‘<samp>l5/lowpass5</samp>’</dt>
18130 <dd><p>Vertically applied FIR lowpass deinterlacing filter that deinterlaces the given
18131 block by filtering all lines with a <code>(-1 2 6 2 -1)</code> filter.
18134 <dt> ‘<samp>fq/forceQuant[|quantizer]</samp>’</dt>
18135 <dd><p>Overrides the quantizer table from the input with the constant quantizer you
18137 </p><dl compact="compact">
18138 <dt> ‘<samp>quantizer</samp>’</dt>
18139 <dd><p>Quantizer to use
18144 <dt> ‘<samp>de/default</samp>’</dt>
18145 <dd><p>Default pp filter combination (<code>hb|a,vb|a,dr|a</code>)
18148 <dt> ‘<samp>fa/fast</samp>’</dt>
18149 <dd><p>Fast pp filter combination (<code>h1|a,v1|a,dr|a</code>)
18152 <dt> ‘<samp>ac</samp>’</dt>
18153 <dd><p>High quality pp filter combination (<code>ha|a|128|7,va|a,dr|a</code>)
18157 <a name="Examples-26"></a>
18158 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-26">33.64.1 Examples</a></h3>
18162 Apply horizontal and vertical deblocking, deringing and automatic
18163 brightness/contrast:
18164 <table><tr><td> </td><td><pre class="example">pp=hb/vb/dr/al
18165 </pre></td></tr></table>
18168 Apply default filters without brightness/contrast correction:
18169 <table><tr><td> </td><td><pre class="example">pp=de/-al
18170 </pre></td></tr></table>
18173 Apply default filters and temporal denoiser:
18174 <table><tr><td> </td><td><pre class="example">pp=default/tmpnoise|1|2|3
18175 </pre></td></tr></table>
18178 Apply deblocking on luminance only, and switch vertical deblocking on or off
18179 automatically depending on available CPU time:
18180 <table><tr><td> </td><td><pre class="example">pp=hb|y/vb|a
18181 </pre></td></tr></table>
18184 <a name="psnr"></a>
18185 <h2 class="section"><a href="ffplay-all.html#toc-psnr">33.65 psnr</a></h2>
18187 <p>Obtain the average, maximum and minimum PSNR (Peak Signal to Noise
18188 Ratio) between two input videos.
18190 <p>This filter takes in input two input videos, the first input is
18191 considered the "main" source and is passed unchanged to the
18192 output. The second input is used as a "reference" video for computing
18195 <p>Both video inputs must have the same resolution and pixel format for
18196 this filter to work correctly. Also it assumes that both inputs
18197 have the same number of frames, which are compared one by one.
18199 <p>The obtained average PSNR is printed through the logging system.
18201 <p>The filter stores the accumulated MSE (mean squared error) of each
18202 frame, and at the end of the processing it is averaged across all frames
18203 equally, and the following formula is applied to obtain the PSNR:
18205 <table><tr><td> </td><td><pre class="example">PSNR = 10*log10(MAX^2/MSE)
18206 </pre></td></tr></table>
18208 <p>Where MAX is the average of the maximum values of each component of the
18211 <p>The description of the accepted parameters follows.
18213 <dl compact="compact">
18214 <dt> ‘<samp>stats_file, f</samp>’</dt>
18215 <dd><p>If specified the filter will use the named file to save the PSNR of
18216 each individual frame.
18220 <p>The file printed if <var>stats_file</var> is selected, contains a sequence of
18221 key/value pairs of the form <var>key</var>:<var>value</var> for each compared
18224 <p>A description of each shown parameter follows:
18226 <dl compact="compact">
18227 <dt> ‘<samp>n</samp>’</dt>
18228 <dd><p>sequential number of the input frame, starting from 1
18231 <dt> ‘<samp>mse_avg</samp>’</dt>
18232 <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
18233 frames, averaged over all the image components.
18236 <dt> ‘<samp>mse_y, mse_u, mse_v, mse_r, mse_g, mse_g, mse_a</samp>’</dt>
18237 <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
18238 frames for the component specified by the suffix.
18241 <dt> ‘<samp>psnr_y, psnr_u, psnr_v, psnr_r, psnr_g, psnr_b, psnr_a</samp>’</dt>
18242 <dd><p>Peak Signal to Noise ratio of the compared frames for the component
18243 specified by the suffix.
18248 </p><table><tr><td> </td><td><pre class="example">movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
18249 [main][ref] psnr="stats_file=stats.log" [out]
18250 </pre></td></tr></table>
18252 <p>On this example the input file being processed is compared with the
18253 reference file ‘<tt>ref_movie.mpg</tt>’. The PSNR of each individual frame
18254 is stored in ‘<tt>stats.log</tt>’.
18256 <a name="pullup"></a>
18257 <h2 class="section"><a href="ffplay-all.html#toc-pullup">33.66 pullup</a></h2>
18259 <p>Pulldown reversal (inverse telecine) filter, capable of handling mixed
18260 hard-telecine, 24000/1001 fps progressive, and 30000/1001 fps progressive
18263 <p>The pullup filter is designed to take advantage of future context in making
18264 its decisions. This filter is stateless in the sense that it does not lock
18265 onto a pattern to follow, but it instead looks forward to the following
18266 fields in order to identify matches and rebuild progressive frames.
18268 <p>To produce content with an even framerate, insert the fps filter after
18269 pullup, use <code>fps=24000/1001</code> if the input frame rate is 29.97fps,
18270 <code>fps=24</code> for 30fps and the (rare) telecined 25fps input.
18272 <p>The filter accepts the following options:
18274 <dl compact="compact">
18275 <dt> ‘<samp>jl</samp>’</dt>
18276 <dt> ‘<samp>jr</samp>’</dt>
18277 <dt> ‘<samp>jt</samp>’</dt>
18278 <dt> ‘<samp>jb</samp>’</dt>
18279 <dd><p>These options set the amount of "junk" to ignore at the left, right, top, and
18280 bottom of the image, respectively. Left and right are in units of 8 pixels,
18281 while top and bottom are in units of 2 lines.
18282 The default is 8 pixels on each side.
18285 <dt> ‘<samp>sb</samp>’</dt>
18286 <dd><p>Set the strict breaks. Setting this option to 1 will reduce the chances of
18287 filter generating an occasional mismatched frame, but it may also cause an
18288 excessive number of frames to be dropped during high motion sequences.
18289 Conversely, setting it to -1 will make filter match fields more easily.
18290 This may help processing of video where there is slight blurring between
18291 the fields, but may also cause there to be interlaced frames in the output.
18292 Default value is <code>0</code>.
18295 <dt> ‘<samp>mp</samp>’</dt>
18296 <dd><p>Set the metric plane to use. It accepts the following values:
18297 </p><dl compact="compact">
18298 <dt> ‘<samp>l</samp>’</dt>
18299 <dd><p>Use luma plane.
18302 <dt> ‘<samp>u</samp>’</dt>
18303 <dd><p>Use chroma blue plane.
18306 <dt> ‘<samp>v</samp>’</dt>
18307 <dd><p>Use chroma red plane.
18311 <p>This option may be set to use chroma plane instead of the default luma plane
18312 for doing filter’s computations. This may improve accuracy on very clean
18313 source material, but more likely will decrease accuracy, especially if there
18314 is chroma noise (rainbow effect) or any grayscale video.
18315 The main purpose of setting ‘<samp>mp</samp>’ to a chroma plane is to reduce CPU
18316 load and make pullup usable in realtime on slow machines.
18320 <p>For best results (without duplicated frames in the output file) it is
18321 necessary to change the output frame rate. For example, to inverse
18322 telecine NTSC input:
18323 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i input -vf pullup -r 24000/1001 ...
18324 </pre></td></tr></table>
18326 <a name="removelogo"></a>
18327 <h2 class="section"><a href="ffplay-all.html#toc-removelogo">33.67 removelogo</a></h2>
18329 <p>Suppress a TV station logo, using an image file to determine which
18330 pixels comprise the logo. It works by filling in the pixels that
18331 comprise the logo with neighboring pixels.
18333 <p>The filter accepts the following options:
18335 <dl compact="compact">
18336 <dt> ‘<samp>filename, f</samp>’</dt>
18337 <dd><p>Set the filter bitmap file, which can be any image format supported by
18338 libavformat. The width and height of the image file must match those of the
18339 video stream being processed.
18343 <p>Pixels in the provided bitmap image with a value of zero are not
18344 considered part of the logo, non-zero pixels are considered part of
18345 the logo. If you use white (255) for the logo and black (0) for the
18346 rest, you will be safe. For making the filter bitmap, it is
18347 recommended to take a screen capture of a black frame with the logo
18348 visible, and then using a threshold filter followed by the erode
18349 filter once or twice.
18351 <p>If needed, little splotches can be fixed manually. Remember that if
18352 logo pixels are not covered, the filter quality will be much
18353 reduced. Marking too many pixels as part of the logo does not hurt as
18354 much, but it will increase the amount of blurring needed to cover over
18355 the image and will destroy more information than necessary, and extra
18356 pixels will slow things down on a large logo.
18358 <a name="rotate"></a>
18359 <h2 class="section"><a href="ffplay-all.html#toc-rotate">33.68 rotate</a></h2>
18361 <p>Rotate video by an arbitrary angle expressed in radians.
18363 <p>The filter accepts the following options:
18365 <p>A description of the optional parameters follows.
18366 </p><dl compact="compact">
18367 <dt> ‘<samp>angle, a</samp>’</dt>
18368 <dd><p>Set an expression for the angle by which to rotate the input video
18369 clockwise, expressed as a number of radians. A negative value will
18370 result in a counter-clockwise rotation. By default it is set to "0".
18372 <p>This expression is evaluated for each frame.
18375 <dt> ‘<samp>out_w, ow</samp>’</dt>
18376 <dd><p>Set the output width expression, default value is "iw".
18377 This expression is evaluated just once during configuration.
18380 <dt> ‘<samp>out_h, oh</samp>’</dt>
18381 <dd><p>Set the output height expression, default value is "ih".
18382 This expression is evaluated just once during configuration.
18385 <dt> ‘<samp>bilinear</samp>’</dt>
18386 <dd><p>Enable bilinear interpolation if set to 1, a value of 0 disables
18387 it. Default value is 1.
18390 <dt> ‘<samp>fillcolor, c</samp>’</dt>
18391 <dd><p>Set the color used to fill the output area not covered by the rotated
18392 image. For the generalsyntax of this option, check the "Color" section in the
18393 ffmpeg-utils manual. If the special value "none" is selected then no
18394 background is printed (useful for example if the background is never shown).
18396 <p>Default value is "black".
18400 <p>The expressions for the angle and the output size can contain the
18401 following constants and functions:
18403 <dl compact="compact">
18404 <dt> ‘<samp>n</samp>’</dt>
18405 <dd><p>sequential number of the input frame, starting from 0. It is always NAN
18406 before the first frame is filtered.
18409 <dt> ‘<samp>t</samp>’</dt>
18410 <dd><p>time in seconds of the input frame, it is set to 0 when the filter is
18411 configured. It is always NAN before the first frame is filtered.
18414 <dt> ‘<samp>hsub</samp>’</dt>
18415 <dt> ‘<samp>vsub</samp>’</dt>
18416 <dd><p>horizontal and vertical chroma subsample values. For example for the
18417 pixel format "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
18420 <dt> ‘<samp>in_w, iw</samp>’</dt>
18421 <dt> ‘<samp>in_h, ih</samp>’</dt>
18422 <dd><p>the input video width and heigth
18425 <dt> ‘<samp>out_w, ow</samp>’</dt>
18426 <dt> ‘<samp>out_h, oh</samp>’</dt>
18427 <dd><p>the output width and heigth, that is the size of the padded area as
18428 specified by the <var>width</var> and <var>height</var> expressions
18431 <dt> ‘<samp>rotw(a)</samp>’</dt>
18432 <dt> ‘<samp>roth(a)</samp>’</dt>
18433 <dd><p>the minimal width/height required for completely containing the input
18434 video rotated by <var>a</var> radians.
18436 <p>These are only available when computing the ‘<samp>out_w</samp>’ and
18437 ‘<samp>out_h</samp>’ expressions.
18441 <a name="Examples-61"></a>
18442 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-61">33.68.1 Examples</a></h3>
18446 Rotate the input by PI/6 radians clockwise:
18447 <table><tr><td> </td><td><pre class="example">rotate=PI/6
18448 </pre></td></tr></table>
18451 Rotate the input by PI/6 radians counter-clockwise:
18452 <table><tr><td> </td><td><pre class="example">rotate=-PI/6
18453 </pre></td></tr></table>
18456 Apply a constant rotation with period T, starting from an angle of PI/3:
18457 <table><tr><td> </td><td><pre class="example">rotate=PI/3+2*PI*t/T
18458 </pre></td></tr></table>
18461 Make the input video rotation oscillating with a period of T
18462 seconds and an amplitude of A radians:
18463 <table><tr><td> </td><td><pre class="example">rotate=A*sin(2*PI/T*t)
18464 </pre></td></tr></table>
18467 Rotate the video, output size is choosen so that the whole rotating
18468 input video is always completely contained in the output:
18469 <table><tr><td> </td><td><pre class="example">rotate='2*PI*t:ow=hypot(iw,ih):oh=ow'
18470 </pre></td></tr></table>
18473 Rotate the video, reduce the output size so that no background is ever
18475 <table><tr><td> </td><td><pre class="example">rotate=2*PI*t:ow='min(iw,ih)/sqrt(2)':oh=ow:c=none
18476 </pre></td></tr></table>
18479 <a name="Commands-1"></a>
18480 <h3 class="subsection"><a href="ffplay-all.html#toc-Commands-1">33.68.2 Commands</a></h3>
18482 <p>The filter supports the following commands:
18484 <dl compact="compact">
18485 <dt> ‘<samp>a, angle</samp>’</dt>
18486 <dd><p>Set the angle expression.
18487 The command accepts the same syntax of the corresponding option.
18489 <p>If the specified expression is not valid, it is kept at its current
18495 <h2 class="section"><a href="ffplay-all.html#toc-sab">33.69 sab</a></h2>
18497 <p>Apply Shape Adaptive Blur.
18499 <p>The filter accepts the following options:
18501 <dl compact="compact">
18502 <dt> ‘<samp>luma_radius, lr</samp>’</dt>
18503 <dd><p>Set luma blur filter strength, must be a value in range 0.1-4.0, default
18504 value is 1.0. A greater value will result in a more blurred image, and
18505 in slower processing.
18508 <dt> ‘<samp>luma_pre_filter_radius, lpfr</samp>’</dt>
18509 <dd><p>Set luma pre-filter radius, must be a value in the 0.1-2.0 range, default
18513 <dt> ‘<samp>luma_strength, ls</samp>’</dt>
18514 <dd><p>Set luma maximum difference between pixels to still be considered, must
18515 be a value in the 0.1-100.0 range, default value is 1.0.
18518 <dt> ‘<samp>chroma_radius, cr</samp>’</dt>
18519 <dd><p>Set chroma blur filter strength, must be a value in range 0.1-4.0. A
18520 greater value will result in a more blurred image, and in slower
18524 <dt> ‘<samp>chroma_pre_filter_radius, cpfr</samp>’</dt>
18525 <dd><p>Set chroma pre-filter radius, must be a value in the 0.1-2.0 range.
18528 <dt> ‘<samp>chroma_strength, cs</samp>’</dt>
18529 <dd><p>Set chroma maximum difference between pixels to still be considered,
18530 must be a value in the 0.1-100.0 range.
18534 <p>Each chroma option value, if not explicitly specified, is set to the
18535 corresponding luma option value.
18537 <p><a name="scale"></a>
18538 </p><a name="scale-1"></a>
18539 <h2 class="section"><a href="ffplay-all.html#toc-scale-1">33.70 scale</a></h2>
18541 <p>Scale (resize) the input video, using the libswscale library.
18543 <p>The scale filter forces the output display aspect ratio to be the same
18544 of the input, by changing the output sample aspect ratio.
18546 <p>If the input image format is different from the format requested by
18547 the next filter, the scale filter will convert the input to the
18550 <a name="Options-21"></a>
18551 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-21">33.70.1 Options</a></h3>
18552 <p>The filter accepts the following options, or any of the options
18553 supported by the libswscale scaler.
18555 <p>See <a href="ffmpeg-scaler.html#scaler_005foptions">(ffmpeg-scaler)scaler_options</a> for
18556 the complete list of scaler options.
18558 <dl compact="compact">
18559 <dt> ‘<samp>width, w</samp>’</dt>
18560 <dt> ‘<samp>height, h</samp>’</dt>
18561 <dd><p>Set the output video dimension expression. Default value is the input
18564 <p>If the value is 0, the input width is used for the output.
18566 <p>If one of the values is -1, the scale filter will use a value that
18567 maintains the aspect ratio of the input image, calculated from the
18568 other specified dimension. If both of them are -1, the input size is
18571 <p>See below for the list of accepted constants for use in the dimension
18575 <dt> ‘<samp>interl</samp>’</dt>
18576 <dd><p>Set the interlacing mode. It accepts the following values:
18578 <dl compact="compact">
18579 <dt> ‘<samp>1</samp>’</dt>
18580 <dd><p>Force interlaced aware scaling.
18583 <dt> ‘<samp>0</samp>’</dt>
18584 <dd><p>Do not apply interlaced scaling.
18587 <dt> ‘<samp>-1</samp>’</dt>
18588 <dd><p>Select interlaced aware scaling depending on whether the source frames
18589 are flagged as interlaced or not.
18593 <p>Default value is ‘<samp>0</samp>’.
18596 <dt> ‘<samp>flags</samp>’</dt>
18597 <dd><p>Set libswscale scaling flags. See
18598 <a href="ffmpeg-scaler.html#sws_005fflags">(ffmpeg-scaler)sws_flags</a> for the
18599 complete list of values. If not explictly specified the filter applies
18603 <dt> ‘<samp>size, s</samp>’</dt>
18604 <dd><p>Set the video size. For the syntax of this option, check the "Video size"
18605 section in the ffmpeg-utils manual.
18608 <dt> ‘<samp>in_color_matrix</samp>’</dt>
18609 <dt> ‘<samp>out_color_matrix</samp>’</dt>
18610 <dd><p>Set in/output YCbCr color space type.
18612 <p>This allows the autodetected value to be overridden as well as allows forcing
18613 a specific value used for the output and encoder.
18615 <p>If not specified, the color space type depends on the pixel format.
18617 <p>Possible values:
18619 <dl compact="compact">
18620 <dt> ‘<samp>auto</samp>’</dt>
18621 <dd><p>Choose automatically.
18624 <dt> ‘<samp>bt709</samp>’</dt>
18625 <dd><p>Format conforming to International Telecommunication Union (ITU)
18626 Recommendation BT.709.
18629 <dt> ‘<samp>fcc</samp>’</dt>
18630 <dd><p>Set color space conforming to the United States Federal Communications
18631 Commission (FCC) Code of Federal Regulations (CFR) Title 47 (2003) 73.682 (a).
18634 <dt> ‘<samp>bt601</samp>’</dt>
18635 <dd><p>Set color space conforming to:
18639 ITU Radiocommunication Sector (ITU-R) Recommendation BT.601
18642 ITU-R Rec. BT.470-6 (1998) Systems B, B1, and G
18645 Society of Motion Picture and Television Engineers (SMPTE) ST 170:2004
18650 <dt> ‘<samp>smpte240m</samp>’</dt>
18651 <dd><p>Set color space conforming to SMPTE ST 240:1999.
18656 <dt> ‘<samp>in_range</samp>’</dt>
18657 <dt> ‘<samp>out_range</samp>’</dt>
18658 <dd><p>Set in/output YCbCr sample range.
18660 <p>This allows the autodetected value to be overridden as well as allows forcing
18661 a specific value used for the output and encoder. If not specified, the
18662 range depends on the pixel format. Possible values:
18664 <dl compact="compact">
18665 <dt> ‘<samp>auto</samp>’</dt>
18666 <dd><p>Choose automatically.
18669 <dt> ‘<samp>jpeg/full/pc</samp>’</dt>
18670 <dd><p>Set full range (0-255 in case of 8-bit luma).
18673 <dt> ‘<samp>mpeg/tv</samp>’</dt>
18674 <dd><p>Set "MPEG" range (16-235 in case of 8-bit luma).
18679 <dt> ‘<samp>force_original_aspect_ratio</samp>’</dt>
18680 <dd><p>Enable decreasing or increasing output video width or height if necessary to
18681 keep the original aspect ratio. Possible values:
18683 <dl compact="compact">
18684 <dt> ‘<samp>disable</samp>’</dt>
18685 <dd><p>Scale the video as specified and disable this feature.
18688 <dt> ‘<samp>decrease</samp>’</dt>
18689 <dd><p>The output video dimensions will automatically be decreased if needed.
18692 <dt> ‘<samp>increase</samp>’</dt>
18693 <dd><p>The output video dimensions will automatically be increased if needed.
18698 <p>One useful instance of this option is that when you know a specific device’s
18699 maximum allowed resolution, you can use this to limit the output video to
18700 that, while retaining the aspect ratio. For example, device A allows
18701 1280x720 playback, and your video is 1920x800. Using this option (set it to
18702 decrease) and specifying 1280x720 to the command line makes the output
18705 <p>Please note that this is a different thing than specifying -1 for ‘<samp>w</samp>’
18706 or ‘<samp>h</samp>’, you still need to specify the output resolution for this option
18712 <p>The values of the ‘<samp>w</samp>’ and ‘<samp>h</samp>’ options are expressions
18713 containing the following constants:
18715 <dl compact="compact">
18716 <dt> <var>in_w</var></dt>
18717 <dt> <var>in_h</var></dt>
18718 <dd><p>the input width and height
18721 <dt> <var>iw</var></dt>
18722 <dt> <var>ih</var></dt>
18723 <dd><p>same as <var>in_w</var> and <var>in_h</var>
18726 <dt> <var>out_w</var></dt>
18727 <dt> <var>out_h</var></dt>
18728 <dd><p>the output (scaled) width and height
18731 <dt> <var>ow</var></dt>
18732 <dt> <var>oh</var></dt>
18733 <dd><p>same as <var>out_w</var> and <var>out_h</var>
18736 <dt> <var>a</var></dt>
18737 <dd><p>same as <var>iw</var> / <var>ih</var>
18740 <dt> <var>sar</var></dt>
18741 <dd><p>input sample aspect ratio
18744 <dt> <var>dar</var></dt>
18745 <dd><p>input display aspect ratio. Calculated from <code>(iw / ih) * sar</code>.
18748 <dt> <var>hsub</var></dt>
18749 <dt> <var>vsub</var></dt>
18750 <dd><p>horizontal and vertical input chroma subsample values. For example for the
18751 pixel format "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
18754 <dt> <var>ohsub</var></dt>
18755 <dt> <var>ovsub</var></dt>
18756 <dd><p>horizontal and vertical output chroma subsample values. For example for the
18757 pixel format "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
18761 <a name="Examples-1"></a>
18762 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-1">33.70.2 Examples</a></h3>
18766 Scale the input video to a size of 200x100:
18767 <table><tr><td> </td><td><pre class="example">scale=w=200:h=100
18768 </pre></td></tr></table>
18770 <p>This is equivalent to:
18771 </p><table><tr><td> </td><td><pre class="example">scale=200:100
18772 </pre></td></tr></table>
18775 </p><table><tr><td> </td><td><pre class="example">scale=200x100
18776 </pre></td></tr></table>
18779 Specify a size abbreviation for the output size:
18780 <table><tr><td> </td><td><pre class="example">scale=qcif
18781 </pre></td></tr></table>
18783 <p>which can also be written as:
18784 </p><table><tr><td> </td><td><pre class="example">scale=size=qcif
18785 </pre></td></tr></table>
18788 Scale the input to 2x:
18789 <table><tr><td> </td><td><pre class="example">scale=w=2*iw:h=2*ih
18790 </pre></td></tr></table>
18793 The above is the same as:
18794 <table><tr><td> </td><td><pre class="example">scale=2*in_w:2*in_h
18795 </pre></td></tr></table>
18798 Scale the input to 2x with forced interlaced scaling:
18799 <table><tr><td> </td><td><pre class="example">scale=2*iw:2*ih:interl=1
18800 </pre></td></tr></table>
18803 Scale the input to half size:
18804 <table><tr><td> </td><td><pre class="example">scale=w=iw/2:h=ih/2
18805 </pre></td></tr></table>
18808 Increase the width, and set the height to the same size:
18809 <table><tr><td> </td><td><pre class="example">scale=3/2*iw:ow
18810 </pre></td></tr></table>
18813 Seek for Greek harmony:
18814 <table><tr><td> </td><td><pre class="example">scale=iw:1/PHI*iw
18816 </pre></td></tr></table>
18819 Increase the height, and set the width to 3/2 of the height:
18820 <table><tr><td> </td><td><pre class="example">scale=w=3/2*oh:h=3/5*ih
18821 </pre></td></tr></table>
18824 Increase the size, but make the size a multiple of the chroma
18826 <table><tr><td> </td><td><pre class="example">scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
18827 </pre></td></tr></table>
18830 Increase the width to a maximum of 500 pixels, keep the same input
18832 <table><tr><td> </td><td><pre class="example">scale=w='min(500\, iw*3/2):h=-1'
18833 </pre></td></tr></table>
18836 <a name="separatefields"></a>
18837 <h2 class="section"><a href="ffplay-all.html#toc-separatefields">33.71 separatefields</a></h2>
18839 <p>The <code>separatefields</code> takes a frame-based video input and splits
18840 each frame into its components fields, producing a new half height clip
18841 with twice the frame rate and twice the frame count.
18843 <p>This filter use field-dominance information in frame to decide which
18844 of each pair of fields to place first in the output.
18845 If it gets it wrong use <a href="#setfield">setfield</a> filter before <code>separatefields</code> filter.
18847 <a name="setdar_002c-setsar"></a>
18848 <h2 class="section"><a href="ffplay-all.html#toc-setdar_002c-setsar">33.72 setdar, setsar</a></h2>
18850 <p>The <code>setdar</code> filter sets the Display Aspect Ratio for the filter
18853 <p>This is done by changing the specified Sample (aka Pixel) Aspect
18854 Ratio, according to the following equation:
18855 </p><table><tr><td> </td><td><pre class="example"><var>DAR</var> = <var>HORIZONTAL_RESOLUTION</var> / <var>VERTICAL_RESOLUTION</var> * <var>SAR</var>
18856 </pre></td></tr></table>
18858 <p>Keep in mind that the <code>setdar</code> filter does not modify the pixel
18859 dimensions of the video frame. Also the display aspect ratio set by
18860 this filter may be changed by later filters in the filterchain,
18861 e.g. in case of scaling or if another "setdar" or a "setsar" filter is
18864 <p>The <code>setsar</code> filter sets the Sample (aka Pixel) Aspect Ratio for
18865 the filter output video.
18867 <p>Note that as a consequence of the application of this filter, the
18868 output display aspect ratio will change according to the equation
18871 <p>Keep in mind that the sample aspect ratio set by the <code>setsar</code>
18872 filter may be changed by later filters in the filterchain, e.g. if
18873 another "setsar" or a "setdar" filter is applied.
18875 <p>The filters accept the following options:
18877 <dl compact="compact">
18878 <dt> ‘<samp>r, ratio, dar (<code>setdar</code> only), sar (<code>setsar</code> only)</samp>’</dt>
18879 <dd><p>Set the aspect ratio used by the filter.
18881 <p>The parameter can be a floating point number string, an expression, or
18882 a string of the form <var>num</var>:<var>den</var>, where <var>num</var> and
18883 <var>den</var> are the numerator and denominator of the aspect ratio. If
18884 the parameter is not specified, it is assumed the value "0".
18885 In case the form "<var>num</var>:<var>den</var>" is used, the <code>:</code> character
18889 <dt> ‘<samp>max</samp>’</dt>
18890 <dd><p>Set the maximum integer value to use for expressing numerator and
18891 denominator when reducing the expressed aspect ratio to a rational.
18892 Default value is <code>100</code>.
18897 <p>The parameter <var>sar</var> is an expression containing
18898 the following constants:
18900 <dl compact="compact">
18901 <dt> ‘<samp>E, PI, PHI</samp>’</dt>
18902 <dd><p>the corresponding mathematical approximated values for e
18903 (euler number), pi (greek PI), phi (golden ratio)
18906 <dt> ‘<samp>w, h</samp>’</dt>
18907 <dd><p>the input width and height
18910 <dt> ‘<samp>a</samp>’</dt>
18911 <dd><p>same as <var>w</var> / <var>h</var>
18914 <dt> ‘<samp>sar</samp>’</dt>
18915 <dd><p>input sample aspect ratio
18918 <dt> ‘<samp>dar</samp>’</dt>
18919 <dd><p>input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>
18922 <dt> ‘<samp>hsub, vsub</samp>’</dt>
18923 <dd><p>horizontal and vertical chroma subsample values. For example for the
18924 pixel format "yuv422p" <var>hsub</var> is 2 and <var>vsub</var> is 1.
18928 <a name="Examples-91"></a>
18929 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-91">33.72.1 Examples</a></h3>
18933 To change the display aspect ratio to 16:9, specify one of the following:
18934 <table><tr><td> </td><td><pre class="example">setdar=dar=1.77777
18937 </pre></td></tr></table>
18940 To change the sample aspect ratio to 10:11, specify:
18941 <table><tr><td> </td><td><pre class="example">setsar=sar=10/11
18942 </pre></td></tr></table>
18945 To set a display aspect ratio of 16:9, and specify a maximum integer value of
18946 1000 in the aspect ratio reduction, use the command:
18947 <table><tr><td> </td><td><pre class="example">setdar=ratio=16/9:max=1000
18948 </pre></td></tr></table>
18952 <p><a name="setfield"></a>
18953 </p><a name="setfield-1"></a>
18954 <h2 class="section"><a href="ffplay-all.html#toc-setfield-1">33.73 setfield</a></h2>
18956 <p>Force field for the output video frame.
18958 <p>The <code>setfield</code> filter marks the interlace type field for the
18959 output frames. It does not change the input frame, but only sets the
18960 corresponding property, which affects how the frame is treated by
18961 following filters (e.g. <code>fieldorder</code> or <code>yadif</code>).
18963 <p>The filter accepts the following options:
18965 <dl compact="compact">
18966 <dt> ‘<samp>mode</samp>’</dt>
18967 <dd><p>Available values are:
18969 <dl compact="compact">
18970 <dt> ‘<samp>auto</samp>’</dt>
18971 <dd><p>Keep the same field property.
18974 <dt> ‘<samp>bff</samp>’</dt>
18975 <dd><p>Mark the frame as bottom-field-first.
18978 <dt> ‘<samp>tff</samp>’</dt>
18979 <dd><p>Mark the frame as top-field-first.
18982 <dt> ‘<samp>prog</samp>’</dt>
18983 <dd><p>Mark the frame as progressive.
18989 <a name="showinfo"></a>
18990 <h2 class="section"><a href="ffplay-all.html#toc-showinfo">33.74 showinfo</a></h2>
18992 <p>Show a line containing various information for each input video frame.
18993 The input video is not modified.
18995 <p>The shown line contains a sequence of key/value pairs of the form
18996 <var>key</var>:<var>value</var>.
18998 <p>A description of each shown parameter follows:
19000 <dl compact="compact">
19001 <dt> ‘<samp>n</samp>’</dt>
19002 <dd><p>sequential number of the input frame, starting from 0
19005 <dt> ‘<samp>pts</samp>’</dt>
19006 <dd><p>Presentation TimeStamp of the input frame, expressed as a number of
19007 time base units. The time base unit depends on the filter input pad.
19010 <dt> ‘<samp>pts_time</samp>’</dt>
19011 <dd><p>Presentation TimeStamp of the input frame, expressed as a number of
19015 <dt> ‘<samp>pos</samp>’</dt>
19016 <dd><p>position of the frame in the input stream, -1 if this information in
19017 unavailable and/or meaningless (for example in case of synthetic video)
19020 <dt> ‘<samp>fmt</samp>’</dt>
19021 <dd><p>pixel format name
19024 <dt> ‘<samp>sar</samp>’</dt>
19025 <dd><p>sample aspect ratio of the input frame, expressed in the form
19026 <var>num</var>/<var>den</var>
19029 <dt> ‘<samp>s</samp>’</dt>
19030 <dd><p>size of the input frame. For the syntax of this option, check the "Video size"
19031 section in the ffmpeg-utils manual.
19034 <dt> ‘<samp>i</samp>’</dt>
19035 <dd><p>interlaced mode ("P" for "progressive", "T" for top field first, "B"
19036 for bottom field first)
19039 <dt> ‘<samp>iskey</samp>’</dt>
19040 <dd><p>1 if the frame is a key frame, 0 otherwise
19043 <dt> ‘<samp>type</samp>’</dt>
19044 <dd><p>picture type of the input frame ("I" for an I-frame, "P" for a
19045 P-frame, "B" for a B-frame, "?" for unknown type).
19046 Check also the documentation of the <code>AVPictureType</code> enum and of
19047 the <code>av_get_picture_type_char</code> function defined in
19048 ‘<tt>libavutil/avutil.h</tt>’.
19051 <dt> ‘<samp>checksum</samp>’</dt>
19052 <dd><p>Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame
19055 <dt> ‘<samp>plane_checksum</samp>’</dt>
19056 <dd><p>Adler-32 checksum (printed in hexadecimal) of each plane of the input frame,
19057 expressed in the form "[<var>c0</var> <var>c1</var> <var>c2</var> <var>c3</var>]"
19061 <p><a name="smartblur"></a>
19062 </p><a name="smartblur-1"></a>
19063 <h2 class="section"><a href="ffplay-all.html#toc-smartblur-1">33.75 smartblur</a></h2>
19065 <p>Blur the input video without impacting the outlines.
19067 <p>The filter accepts the following options:
19069 <dl compact="compact">
19070 <dt> ‘<samp>luma_radius, lr</samp>’</dt>
19071 <dd><p>Set the luma radius. The option value must be a float number in
19072 the range [0.1,5.0] that specifies the variance of the gaussian filter
19073 used to blur the image (slower if larger). Default value is 1.0.
19076 <dt> ‘<samp>luma_strength, ls</samp>’</dt>
19077 <dd><p>Set the luma strength. The option value must be a float number
19078 in the range [-1.0,1.0] that configures the blurring. A value included
19079 in [0.0,1.0] will blur the image whereas a value included in
19080 [-1.0,0.0] will sharpen the image. Default value is 1.0.
19083 <dt> ‘<samp>luma_threshold, lt</samp>’</dt>
19084 <dd><p>Set the luma threshold used as a coefficient to determine
19085 whether a pixel should be blurred or not. The option value must be an
19086 integer in the range [-30,30]. A value of 0 will filter all the image,
19087 a value included in [0,30] will filter flat areas and a value included
19088 in [-30,0] will filter edges. Default value is 0.
19091 <dt> ‘<samp>chroma_radius, cr</samp>’</dt>
19092 <dd><p>Set the chroma radius. The option value must be a float number in
19093 the range [0.1,5.0] that specifies the variance of the gaussian filter
19094 used to blur the image (slower if larger). Default value is 1.0.
19097 <dt> ‘<samp>chroma_strength, cs</samp>’</dt>
19098 <dd><p>Set the chroma strength. The option value must be a float number
19099 in the range [-1.0,1.0] that configures the blurring. A value included
19100 in [0.0,1.0] will blur the image whereas a value included in
19101 [-1.0,0.0] will sharpen the image. Default value is 1.0.
19104 <dt> ‘<samp>chroma_threshold, ct</samp>’</dt>
19105 <dd><p>Set the chroma threshold used as a coefficient to determine
19106 whether a pixel should be blurred or not. The option value must be an
19107 integer in the range [-30,30]. A value of 0 will filter all the image,
19108 a value included in [0,30] will filter flat areas and a value included
19109 in [-30,0] will filter edges. Default value is 0.
19113 <p>If a chroma option is not explicitly set, the corresponding luma value
19116 <a name="stereo3d"></a>
19117 <h2 class="section"><a href="ffplay-all.html#toc-stereo3d">33.76 stereo3d</a></h2>
19119 <p>Convert between different stereoscopic image formats.
19121 <p>The filters accept the following options:
19123 <dl compact="compact">
19124 <dt> ‘<samp>in</samp>’</dt>
19125 <dd><p>Set stereoscopic image format of input.
19127 <p>Available values for input image formats are:
19128 </p><dl compact="compact">
19129 <dt> ‘<samp>sbsl</samp>’</dt>
19130 <dd><p>side by side parallel (left eye left, right eye right)
19133 <dt> ‘<samp>sbsr</samp>’</dt>
19134 <dd><p>side by side crosseye (right eye left, left eye right)
19137 <dt> ‘<samp>sbs2l</samp>’</dt>
19138 <dd><p>side by side parallel with half width resolution
19139 (left eye left, right eye right)
19142 <dt> ‘<samp>sbs2r</samp>’</dt>
19143 <dd><p>side by side crosseye with half width resolution
19144 (right eye left, left eye right)
19147 <dt> ‘<samp>abl</samp>’</dt>
19148 <dd><p>above-below (left eye above, right eye below)
19151 <dt> ‘<samp>abr</samp>’</dt>
19152 <dd><p>above-below (right eye above, left eye below)
19155 <dt> ‘<samp>ab2l</samp>’</dt>
19156 <dd><p>above-below with half height resolution
19157 (left eye above, right eye below)
19160 <dt> ‘<samp>ab2r</samp>’</dt>
19161 <dd><p>above-below with half height resolution
19162 (right eye above, left eye below)
19165 <dt> ‘<samp>al</samp>’</dt>
19166 <dd><p>alternating frames (left eye first, right eye second)
19169 <dt> ‘<samp>ar</samp>’</dt>
19170 <dd><p>alternating frames (right eye first, left eye second)
19172 <p>Default value is ‘<samp>sbsl</samp>’.
19177 <dt> ‘<samp>out</samp>’</dt>
19178 <dd><p>Set stereoscopic image format of output.
19180 <p>Available values for output image formats are all the input formats as well as:
19181 </p><dl compact="compact">
19182 <dt> ‘<samp>arbg</samp>’</dt>
19183 <dd><p>anaglyph red/blue gray
19184 (red filter on left eye, blue filter on right eye)
19187 <dt> ‘<samp>argg</samp>’</dt>
19188 <dd><p>anaglyph red/green gray
19189 (red filter on left eye, green filter on right eye)
19192 <dt> ‘<samp>arcg</samp>’</dt>
19193 <dd><p>anaglyph red/cyan gray
19194 (red filter on left eye, cyan filter on right eye)
19197 <dt> ‘<samp>arch</samp>’</dt>
19198 <dd><p>anaglyph red/cyan half colored
19199 (red filter on left eye, cyan filter on right eye)
19202 <dt> ‘<samp>arcc</samp>’</dt>
19203 <dd><p>anaglyph red/cyan color
19204 (red filter on left eye, cyan filter on right eye)
19207 <dt> ‘<samp>arcd</samp>’</dt>
19208 <dd><p>anaglyph red/cyan color optimized with the least squares projection of dubois
19209 (red filter on left eye, cyan filter on right eye)
19212 <dt> ‘<samp>agmg</samp>’</dt>
19213 <dd><p>anaglyph green/magenta gray
19214 (green filter on left eye, magenta filter on right eye)
19217 <dt> ‘<samp>agmh</samp>’</dt>
19218 <dd><p>anaglyph green/magenta half colored
19219 (green filter on left eye, magenta filter on right eye)
19222 <dt> ‘<samp>agmc</samp>’</dt>
19223 <dd><p>anaglyph green/magenta colored
19224 (green filter on left eye, magenta filter on right eye)
19227 <dt> ‘<samp>agmd</samp>’</dt>
19228 <dd><p>anaglyph green/magenta color optimized with the least squares projection of dubois
19229 (green filter on left eye, magenta filter on right eye)
19232 <dt> ‘<samp>aybg</samp>’</dt>
19233 <dd><p>anaglyph yellow/blue gray
19234 (yellow filter on left eye, blue filter on right eye)
19237 <dt> ‘<samp>aybh</samp>’</dt>
19238 <dd><p>anaglyph yellow/blue half colored
19239 (yellow filter on left eye, blue filter on right eye)
19242 <dt> ‘<samp>aybc</samp>’</dt>
19243 <dd><p>anaglyph yellow/blue colored
19244 (yellow filter on left eye, blue filter on right eye)
19247 <dt> ‘<samp>aybd</samp>’</dt>
19248 <dd><p>anaglyph yellow/blue color optimized with the least squares projection of dubois
19249 (yellow filter on left eye, blue filter on right eye)
19252 <dt> ‘<samp>irl</samp>’</dt>
19253 <dd><p>interleaved rows (left eye has top row, right eye starts on next row)
19256 <dt> ‘<samp>irr</samp>’</dt>
19257 <dd><p>interleaved rows (right eye has top row, left eye starts on next row)
19260 <dt> ‘<samp>ml</samp>’</dt>
19261 <dd><p>mono output (left eye only)
19264 <dt> ‘<samp>mr</samp>’</dt>
19265 <dd><p>mono output (right eye only)
19269 <p>Default value is ‘<samp>arcd</samp>’.
19273 <a name="Examples-77"></a>
19274 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-77">33.76.1 Examples</a></h3>
19278 Convert input video from side by side parallel to anaglyph yellow/blue dubois:
19279 <table><tr><td> </td><td><pre class="example">stereo3d=sbsl:aybd
19280 </pre></td></tr></table>
19283 Convert input video from above bellow (left eye above, right eye below) to side by side crosseye.
19284 <table><tr><td> </td><td><pre class="example">stereo3d=abl:sbsr
19285 </pre></td></tr></table>
19289 <h2 class="section"><a href="ffplay-all.html#toc-spp">33.77 spp</a></h2>
19291 <p>Apply a simple postprocessing filter that compresses and decompresses the image
19292 at several (or - in the case of ‘<samp>quality</samp>’ level <code>6</code> - all) shifts
19293 and average the results.
19295 <p>The filter accepts the following options:
19297 <dl compact="compact">
19298 <dt> ‘<samp>quality</samp>’</dt>
19299 <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
19300 an integer in the range 0-6. If set to <code>0</code>, the filter will have no
19301 effect. A value of <code>6</code> means the higher quality. For each increment of
19302 that value the speed drops by a factor of approximately 2. Default value is
19306 <dt> ‘<samp>qp</samp>’</dt>
19307 <dd><p>Force a constant quantization parameter. If not set, the filter will use the QP
19308 from the video stream (if available).
19311 <dt> ‘<samp>mode</samp>’</dt>
19312 <dd><p>Set thresholding mode. Available modes are:
19314 <dl compact="compact">
19315 <dt> ‘<samp>hard</samp>’</dt>
19316 <dd><p>Set hard thresholding (default).
19318 <dt> ‘<samp>soft</samp>’</dt>
19319 <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
19324 <dt> ‘<samp>use_bframe_qp</samp>’</dt>
19325 <dd><p>Enable the use of the QP from the B-Frames if set to <code>1</code>. Using this
19326 option may cause flicker since the B-Frames have often larger QP. Default is
19327 <code>0</code> (not enabled).
19331 <p><a name="subtitles"></a>
19332 </p><a name="subtitles-1"></a>
19333 <h2 class="section"><a href="ffplay-all.html#toc-subtitles-1">33.78 subtitles</a></h2>
19335 <p>Draw subtitles on top of input video using the libass library.
19337 <p>To enable compilation of this filter you need to configure FFmpeg with
19338 <code>--enable-libass</code>. This filter also requires a build with libavcodec and
19339 libavformat to convert the passed subtitles file to ASS (Advanced Substation
19340 Alpha) subtitles format.
19342 <p>The filter accepts the following options:
19344 <dl compact="compact">
19345 <dt> ‘<samp>filename, f</samp>’</dt>
19346 <dd><p>Set the filename of the subtitle file to read. It must be specified.
19349 <dt> ‘<samp>original_size</samp>’</dt>
19350 <dd><p>Specify the size of the original video, the video for which the ASS file
19351 was composed. For the syntax of this option, check the "Video size" section in
19352 the ffmpeg-utils manual. Due to a misdesign in ASS aspect ratio arithmetic,
19353 this is necessary to correctly scale the fonts if the aspect ratio has been
19357 <dt> ‘<samp>charenc</samp>’</dt>
19358 <dd><p>Set subtitles input character encoding. <code>subtitles</code> filter only. Only
19359 useful if not UTF-8.
19363 <p>If the first key is not specified, it is assumed that the first value
19364 specifies the ‘<samp>filename</samp>’.
19366 <p>For example, to render the file ‘<tt>sub.srt</tt>’ on top of the input
19367 video, use the command:
19368 </p><table><tr><td> </td><td><pre class="example">subtitles=sub.srt
19369 </pre></td></tr></table>
19371 <p>which is equivalent to:
19372 </p><table><tr><td> </td><td><pre class="example">subtitles=filename=sub.srt
19373 </pre></td></tr></table>
19375 <a name="super2xsai"></a>
19376 <h2 class="section"><a href="ffplay-all.html#toc-super2xsai">33.79 super2xsai</a></h2>
19378 <p>Scale the input by 2x and smooth using the Super2xSaI (Scale and
19379 Interpolate) pixel art scaling algorithm.
19381 <p>Useful for enlarging pixel art images without reducing sharpness.
19383 <a name="swapuv"></a>
19384 <h2 class="section"><a href="ffplay-all.html#toc-swapuv">33.80 swapuv</a></h2>
19385 <p>Swap U & V plane.
19387 <a name="telecine"></a>
19388 <h2 class="section"><a href="ffplay-all.html#toc-telecine">33.81 telecine</a></h2>
19390 <p>Apply telecine process to the video.
19392 <p>This filter accepts the following options:
19394 <dl compact="compact">
19395 <dt> ‘<samp>first_field</samp>’</dt>
19396 <dd><dl compact="compact">
19397 <dt> ‘<samp>top, t</samp>’</dt>
19398 <dd><p>top field first
19400 <dt> ‘<samp>bottom, b</samp>’</dt>
19401 <dd><p>bottom field first
19402 The default value is <code>top</code>.
19407 <dt> ‘<samp>pattern</samp>’</dt>
19408 <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
19409 The default value is <code>23</code>.
19413 <table><tr><td> </td><td><pre class="example">Some typical patterns:
19418 24p: 2332 (preferred)
19425 24p: 222222222223 ("Euro pulldown")
19428 </pre></td></tr></table>
19430 <a name="thumbnail"></a>
19431 <h2 class="section"><a href="ffplay-all.html#toc-thumbnail">33.82 thumbnail</a></h2>
19432 <p>Select the most representative frame in a given sequence of consecutive frames.
19434 <p>The filter accepts the following options:
19436 <dl compact="compact">
19437 <dt> ‘<samp>n</samp>’</dt>
19438 <dd><p>Set the frames batch size to analyze; in a set of <var>n</var> frames, the filter
19439 will pick one of them, and then handle the next batch of <var>n</var> frames until
19440 the end. Default is <code>100</code>.
19444 <p>Since the filter keeps track of the whole frames sequence, a bigger <var>n</var>
19445 value will result in a higher memory usage, so a high value is not recommended.
19447 <a name="Examples-30"></a>
19448 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-30">33.82.1 Examples</a></h3>
19452 Extract one picture each 50 frames:
19453 <table><tr><td> </td><td><pre class="example">thumbnail=50
19454 </pre></td></tr></table>
19457 Complete example of a thumbnail creation with <code>ffmpeg</code>:
19458 <table><tr><td> </td><td><pre class="example">ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
19459 </pre></td></tr></table>
19462 <a name="tile"></a>
19463 <h2 class="section"><a href="ffplay-all.html#toc-tile">33.83 tile</a></h2>
19465 <p>Tile several successive frames together.
19467 <p>The filter accepts the following options:
19469 <dl compact="compact">
19470 <dt> ‘<samp>layout</samp>’</dt>
19471 <dd><p>Set the grid size (i.e. the number of lines and columns). For the syntax of
19472 this option, check the "Video size" section in the ffmpeg-utils manual.
19475 <dt> ‘<samp>nb_frames</samp>’</dt>
19476 <dd><p>Set the maximum number of frames to render in the given area. It must be less
19477 than or equal to <var>w</var>x<var>h</var>. The default value is <code>0</code>, meaning all
19478 the area will be used.
19481 <dt> ‘<samp>margin</samp>’</dt>
19482 <dd><p>Set the outer border margin in pixels.
19485 <dt> ‘<samp>padding</samp>’</dt>
19486 <dd><p>Set the inner border thickness (i.e. the number of pixels between frames). For
19487 more advanced padding options (such as having different values for the edges),
19488 refer to the pad video filter.
19491 <dt> ‘<samp>color</samp>’</dt>
19492 <dd><p>Specify the color of the unused areaFor the syntax of this option, check the
19493 "Color" section in the ffmpeg-utils manual. The default value of <var>color</var>
19494 is "black".
19498 <a name="Examples-11"></a>
19499 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-11">33.83.1 Examples</a></h3>
19503 Produce 8x8 PNG tiles of all keyframes (‘<samp>-skip_frame nokey</samp>’) in a movie:
19504 <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
19505 </pre></td></tr></table>
19506 <p>The ‘<samp>-vsync 0</samp>’ is necessary to prevent <code>ffmpeg</code> from
19507 duplicating each output frame to accomodate the originally detected frame
19511 Display <code>5</code> pictures in an area of <code>3x2</code> frames,
19512 with <code>7</code> pixels between them, and <code>2</code> pixels of initial margin, using
19513 mixed flat and named options:
19514 <table><tr><td> </td><td><pre class="example">tile=3x2:nb_frames=5:padding=7:margin=2
19515 </pre></td></tr></table>
19518 <a name="tinterlace"></a>
19519 <h2 class="section"><a href="ffplay-all.html#toc-tinterlace">33.84 tinterlace</a></h2>
19521 <p>Perform various types of temporal field interlacing.
19523 <p>Frames are counted starting from 1, so the first input frame is
19526 <p>The filter accepts the following options:
19528 <dl compact="compact">
19529 <dt> ‘<samp>mode</samp>’</dt>
19530 <dd><p>Specify the mode of the interlacing. This option can also be specified
19531 as a value alone. See below for a list of values for this option.
19533 <p>Available values are:
19535 <dl compact="compact">
19536 <dt> ‘<samp>merge, 0</samp>’</dt>
19537 <dd><p>Move odd frames into the upper field, even into the lower field,
19538 generating a double height frame at half frame rate.
19541 <dt> ‘<samp>drop_odd, 1</samp>’</dt>
19542 <dd><p>Only output even frames, odd frames are dropped, generating a frame with
19543 unchanged height at half frame rate.
19546 <dt> ‘<samp>drop_even, 2</samp>’</dt>
19547 <dd><p>Only output odd frames, even frames are dropped, generating a frame with
19548 unchanged height at half frame rate.
19551 <dt> ‘<samp>pad, 3</samp>’</dt>
19552 <dd><p>Expand each frame to full height, but pad alternate lines with black,
19553 generating a frame with double height at the same input frame rate.
19556 <dt> ‘<samp>interleave_top, 4</samp>’</dt>
19557 <dd><p>Interleave the upper field from odd frames with the lower field from
19558 even frames, generating a frame with unchanged height at half frame rate.
19561 <dt> ‘<samp>interleave_bottom, 5</samp>’</dt>
19562 <dd><p>Interleave the lower field from odd frames with the upper field from
19563 even frames, generating a frame with unchanged height at half frame rate.
19566 <dt> ‘<samp>interlacex2, 6</samp>’</dt>
19567 <dd><p>Double frame rate with unchanged height. Frames are inserted each
19568 containing the second temporal field from the previous input frame and
19569 the first temporal field from the next input frame. This mode relies on
19570 the top_field_first flag. Useful for interlaced video displays with no
19571 field synchronisation.
19575 <p>Numeric values are deprecated but are accepted for backward
19576 compatibility reasons.
19578 <p>Default mode is <code>merge</code>.
19581 <dt> ‘<samp>flags</samp>’</dt>
19582 <dd><p>Specify flags influencing the filter process.
19584 <p>Available value for <var>flags</var> is:
19586 <dl compact="compact">
19587 <dt> ‘<samp>low_pass_filter, vlfp</samp>’</dt>
19588 <dd><p>Enable vertical low-pass filtering in the filter.
19589 Vertical low-pass filtering is required when creating an interlaced
19590 destination from a progressive source which contains high-frequency
19591 vertical detail. Filtering will reduce interlace ’twitter’ and Moire
19594 <p>Vertical low-pass filtering can only be enabled for ‘<samp>mode</samp>’
19595 <var>interleave_top</var> and <var>interleave_bottom</var>.
19602 <a name="transpose"></a>
19603 <h2 class="section"><a href="ffplay-all.html#toc-transpose">33.85 transpose</a></h2>
19605 <p>Transpose rows with columns in the input video and optionally flip it.
19607 <p>This filter accepts the following options:
19609 <dl compact="compact">
19610 <dt> ‘<samp>dir</samp>’</dt>
19611 <dd><p>Specify the transposition direction.
19613 <p>Can assume the following values:
19614 </p><dl compact="compact">
19615 <dt> ‘<samp>0, 4, cclock_flip</samp>’</dt>
19616 <dd><p>Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
19617 </p><table><tr><td> </td><td><pre class="example">L.R L.l
19620 </pre></td></tr></table>
19623 <dt> ‘<samp>1, 5, clock</samp>’</dt>
19624 <dd><p>Rotate by 90 degrees clockwise, that is:
19625 </p><table><tr><td> </td><td><pre class="example">L.R l.L
19628 </pre></td></tr></table>
19631 <dt> ‘<samp>2, 6, cclock</samp>’</dt>
19632 <dd><p>Rotate by 90 degrees counterclockwise, that is:
19633 </p><table><tr><td> </td><td><pre class="example">L.R R.r
19636 </pre></td></tr></table>
19639 <dt> ‘<samp>3, 7, clock_flip</samp>’</dt>
19640 <dd><p>Rotate by 90 degrees clockwise and vertically flip, that is:
19641 </p><table><tr><td> </td><td><pre class="example">L.R r.R
19644 </pre></td></tr></table>
19648 <p>For values between 4-7, the transposition is only done if the input
19649 video geometry is portrait and not landscape. These values are
19650 deprecated, the <code>passthrough</code> option should be used instead.
19652 <p>Numerical values are deprecated, and should be dropped in favor of
19653 symbolic constants.
19656 <dt> ‘<samp>passthrough</samp>’</dt>
19657 <dd><p>Do not apply the transposition if the input geometry matches the one
19658 specified by the specified value. It accepts the following values:
19659 </p><dl compact="compact">
19660 <dt> ‘<samp>none</samp>’</dt>
19661 <dd><p>Always apply transposition.
19663 <dt> ‘<samp>portrait</samp>’</dt>
19664 <dd><p>Preserve portrait geometry (when <var>height</var> >= <var>width</var>).
19666 <dt> ‘<samp>landscape</samp>’</dt>
19667 <dd><p>Preserve landscape geometry (when <var>width</var> >= <var>height</var>).
19671 <p>Default value is <code>none</code>.
19675 <p>For example to rotate by 90 degrees clockwise and preserve portrait
19677 </p><table><tr><td> </td><td><pre class="example">transpose=dir=1:passthrough=portrait
19678 </pre></td></tr></table>
19680 <p>The command above can also be specified as:
19681 </p><table><tr><td> </td><td><pre class="example">transpose=1:portrait
19682 </pre></td></tr></table>
19684 <a name="trim"></a>
19685 <h2 class="section"><a href="ffplay-all.html#toc-trim">33.86 trim</a></h2>
19686 <p>Trim the input so that the output contains one continuous subpart of the input.
19688 <p>This filter accepts the following options:
19689 </p><dl compact="compact">
19690 <dt> ‘<samp>start</samp>’</dt>
19691 <dd><p>Specify time of the start of the kept section, i.e. the frame with the
19692 timestamp <var>start</var> will be the first frame in the output.
19695 <dt> ‘<samp>end</samp>’</dt>
19696 <dd><p>Specify time of the first frame that will be dropped, i.e. the frame
19697 immediately preceding the one with the timestamp <var>end</var> will be the last
19698 frame in the output.
19701 <dt> ‘<samp>start_pts</samp>’</dt>
19702 <dd><p>Same as <var>start</var>, except this option sets the start timestamp in timebase
19703 units instead of seconds.
19706 <dt> ‘<samp>end_pts</samp>’</dt>
19707 <dd><p>Same as <var>end</var>, except this option sets the end timestamp in timebase units
19708 instead of seconds.
19711 <dt> ‘<samp>duration</samp>’</dt>
19712 <dd><p>Specify maximum duration of the output.
19715 <dt> ‘<samp>start_frame</samp>’</dt>
19716 <dd><p>Number of the first frame that should be passed to output.
19719 <dt> ‘<samp>end_frame</samp>’</dt>
19720 <dd><p>Number of the first frame that should be dropped.
19724 <p>‘<samp>start</samp>’, ‘<samp>end</samp>’, ‘<samp>duration</samp>’ are expressed as time
19725 duration specifications, check the "Time duration" section in the
19726 ffmpeg-utils manual.
19728 <p>Note that the first two sets of the start/end options and the ‘<samp>duration</samp>’
19729 option look at the frame timestamp, while the _frame variants simply count the
19730 frames that pass through the filter. Also note that this filter does not modify
19731 the timestamps. If you wish that the output timestamps start at zero, insert a
19732 setpts filter after the trim filter.
19734 <p>If multiple start or end options are set, this filter tries to be greedy and
19735 keep all the frames that match at least one of the specified constraints. To keep
19736 only the part that matches all the constraints at once, chain multiple trim
19739 <p>The defaults are such that all the input is kept. So it is possible to set e.g.
19740 just the end values to keep everything before the specified time.
19745 drop everything except the second minute of input
19746 <table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -vf trim=60:120
19747 </pre></td></tr></table>
19750 keep only the first second
19751 <table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -vf trim=duration=1
19752 </pre></td></tr></table>
19757 <a name="unsharp"></a>
19758 <h2 class="section"><a href="ffplay-all.html#toc-unsharp">33.87 unsharp</a></h2>
19760 <p>Sharpen or blur the input video.
19762 <p>It accepts the following parameters:
19764 <dl compact="compact">
19765 <dt> ‘<samp>luma_msize_x, lx</samp>’</dt>
19766 <dd><p>Set the luma matrix horizontal size. It must be an odd integer between
19767 3 and 63, default value is 5.
19770 <dt> ‘<samp>luma_msize_y, ly</samp>’</dt>
19771 <dd><p>Set the luma matrix vertical size. It must be an odd integer between 3
19772 and 63, default value is 5.
19775 <dt> ‘<samp>luma_amount, la</samp>’</dt>
19776 <dd><p>Set the luma effect strength. It can be a float number, reasonable
19777 values lay between -1.5 and 1.5.
19779 <p>Negative values will blur the input video, while positive values will
19780 sharpen it, a value of zero will disable the effect.
19782 <p>Default value is 1.0.
19785 <dt> ‘<samp>chroma_msize_x, cx</samp>’</dt>
19786 <dd><p>Set the chroma matrix horizontal size. It must be an odd integer
19787 between 3 and 63, default value is 5.
19790 <dt> ‘<samp>chroma_msize_y, cy</samp>’</dt>
19791 <dd><p>Set the chroma matrix vertical size. It must be an odd integer
19792 between 3 and 63, default value is 5.
19795 <dt> ‘<samp>chroma_amount, ca</samp>’</dt>
19796 <dd><p>Set the chroma effect strength. It can be a float number, reasonable
19797 values lay between -1.5 and 1.5.
19799 <p>Negative values will blur the input video, while positive values will
19800 sharpen it, a value of zero will disable the effect.
19802 <p>Default value is 0.0.
19805 <dt> ‘<samp>opencl</samp>’</dt>
19806 <dd><p>If set to 1, specify using OpenCL capabilities, only available if
19807 FFmpeg was configured with <code>--enable-opencl</code>. Default value is 0.
19812 <p>All parameters are optional and default to the equivalent of the
19813 string ’5:5:1.0:5:5:0.0’.
19815 <a name="Examples-6"></a>
19816 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-6">33.87.1 Examples</a></h3>
19820 Apply strong luma sharpen effect:
19821 <table><tr><td> </td><td><pre class="example">unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
19822 </pre></td></tr></table>
19825 Apply strong blur of both luma and chroma parameters:
19826 <table><tr><td> </td><td><pre class="example">unsharp=7:7:-2:7:7:-2
19827 </pre></td></tr></table>
19830 <p><a name="vidstabdetect"></a>
19831 </p><a name="vidstabdetect-1"></a>
19832 <h2 class="section"><a href="ffplay-all.html#toc-vidstabdetect-1">33.88 vidstabdetect</a></h2>
19834 <p>Analyze video stabilization/deshaking. Perform pass 1 of 2, see
19835 <a href="#vidstabtransform">vidstabtransform</a> for pass 2.
19837 <p>This filter generates a file with relative translation and rotation
19838 transform information about subsequent frames, which is then used by
19839 the <a href="#vidstabtransform">vidstabtransform</a> filter.
19841 <p>To enable compilation of this filter you need to configure FFmpeg with
19842 <code>--enable-libvidstab</code>.
19844 <p>This filter accepts the following options:
19846 <dl compact="compact">
19847 <dt> ‘<samp>result</samp>’</dt>
19848 <dd><p>Set the path to the file used to write the transforms information.
19849 Default value is ‘<tt>transforms.trf</tt>’.
19852 <dt> ‘<samp>shakiness</samp>’</dt>
19853 <dd><p>Set how shaky the video is and how quick the camera is. It accepts an
19854 integer in the range 1-10, a value of 1 means little shakiness, a
19855 value of 10 means strong shakiness. Default value is 5.
19858 <dt> ‘<samp>accuracy</samp>’</dt>
19859 <dd><p>Set the accuracy of the detection process. It must be a value in the
19860 range 1-15. A value of 1 means low accuracy, a value of 15 means high
19861 accuracy. Default value is 9.
19864 <dt> ‘<samp>stepsize</samp>’</dt>
19865 <dd><p>Set stepsize of the search process. The region around minimum is
19866 scanned with 1 pixel resolution. Default value is 6.
19869 <dt> ‘<samp>mincontrast</samp>’</dt>
19870 <dd><p>Set minimum contrast. Below this value a local measurement field is
19871 discarded. Must be a floating point value in the range 0-1. Default
19875 <dt> ‘<samp>tripod</samp>’</dt>
19876 <dd><p>Set reference frame number for tripod mode.
19878 <p>If enabled, the motion of the frames is compared to a reference frame
19879 in the filtered stream, identified by the specified number. The idea
19880 is to compensate all movements in a more-or-less static scene and keep
19881 the camera view absolutely still.
19883 <p>If set to 0, it is disabled. The frames are counted starting from 1.
19886 <dt> ‘<samp>show</samp>’</dt>
19887 <dd><p>Show fields and transforms in the resulting frames. It accepts an
19888 integer in the range 0-2. Default value is 0, which disables any
19893 <a name="Examples-5"></a>
19894 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-5">33.88.1 Examples</a></h3>
19898 Use default values:
19899 <table><tr><td> </td><td><pre class="example">vidstabdetect
19900 </pre></td></tr></table>
19903 Analyze strongly shaky movie and put the results in file
19904 ‘<tt>mytransforms.trf</tt>’:
19905 <table><tr><td> </td><td><pre class="example">vidstabdetect=shakiness=10:accuracy=15:result="mytransforms.trf"
19906 </pre></td></tr></table>
19909 Visualize the result of internal transformations in the resulting
19911 <table><tr><td> </td><td><pre class="example">vidstabdetect=show=1
19912 </pre></td></tr></table>
19915 Analyze a video with medium shakiness using <code>ffmpeg</code>:
19916 <table><tr><td> </td><td><pre class="example">ffmpeg -i input -vf vidstabdetect=shakiness=5:show=1 dummy.avi
19917 </pre></td></tr></table>
19920 <p><a name="vidstabtransform"></a>
19921 </p><a name="vidstabtransform-1"></a>
19922 <h2 class="section"><a href="ffplay-all.html#toc-vidstabtransform-1">33.89 vidstabtransform</a></h2>
19924 <p>Video stabilization/deshaking: pass 2 of 2,
19925 see <a href="#vidstabdetect">vidstabdetect</a> for pass 1.
19927 <p>Read a file with transform information for each frame and
19928 apply/compensate them. Together with the <a href="#vidstabdetect">vidstabdetect</a>
19929 filter this can be used to deshake videos. See also
19930 <a href="http://public.hronopik.de/vid.stab">http://public.hronopik.de/vid.stab</a>. It is important to also use
19931 the unsharp filter, see below.
19933 <p>To enable compilation of this filter you need to configure FFmpeg with
19934 <code>--enable-libvidstab</code>.
19936 <p>This filter accepts the following options:
19938 <dl compact="compact">
19939 <dt> ‘<samp>input</samp>’</dt>
19940 <dd><p>path to the file used to read the transforms (default: ‘<tt>transforms.trf</tt>’)
19943 <dt> ‘<samp>smoothing</samp>’</dt>
19944 <dd><p>number of frames (value*2 + 1) used for lowpass filtering the camera movements
19945 (default: 10). For example a number of 10 means that 21 frames are used
19946 (10 in the past and 10 in the future) to smoothen the motion in the
19947 video. A larger values leads to a smoother video, but limits the
19948 acceleration of the camera (pan/tilt movements).
19951 <dt> ‘<samp>maxshift</samp>’</dt>
19952 <dd><p>maximal number of pixels to translate frames (default: -1 no limit)
19955 <dt> ‘<samp>maxangle</samp>’</dt>
19956 <dd><p>maximal angle in radians (degree*PI/180) to rotate frames (default: -1
19960 <dt> ‘<samp>crop</samp>’</dt>
19961 <dd><p>How to deal with borders that may be visible due to movement
19962 compensation. Available values are:
19964 <dl compact="compact">
19965 <dt> ‘<samp>keep</samp>’</dt>
19966 <dd><p>keep image information from previous frame (default)
19968 <dt> ‘<samp>black</samp>’</dt>
19969 <dd><p>fill the border black
19974 <dt> ‘<samp>invert</samp>’</dt>
19975 <dd><dl compact="compact">
19976 <dt> ‘<samp>0</samp>’</dt>
19977 <dd><p>keep transforms normal (default)
19979 <dt> ‘<samp>1</samp>’</dt>
19980 <dd><p>invert transforms
19985 <dt> ‘<samp>relative</samp>’</dt>
19986 <dd><p>consider transforms as
19987 </p><dl compact="compact">
19988 <dt> ‘<samp>0</samp>’</dt>
19991 <dt> ‘<samp>1</samp>’</dt>
19992 <dd><p>relative to previous frame (default)
19997 <dt> ‘<samp>zoom</samp>’</dt>
19998 <dd><p>percentage to zoom (default: 0)
19999 </p><dl compact="compact">
20000 <dt> ‘<samp>>0</samp>’</dt>
20003 <dt> ‘<samp><0</samp>’</dt>
20009 <dt> ‘<samp>optzoom</samp>’</dt>
20010 <dd><p>set optimal zooming to avoid borders
20011 </p><dl compact="compact">
20012 <dt> ‘<samp>0</samp>’</dt>
20015 <dt> ‘<samp>1</samp>’</dt>
20016 <dd><p>optimal static zoom value is determined (only very strong movements will lead to visible borders) (default)
20018 <dt> ‘<samp>2</samp>’</dt>
20019 <dd><p>optimal adaptive zoom value is determined (no borders will be visible)
20022 <p>Note that the value given at zoom is added to the one calculated
20026 <dt> ‘<samp>interpol</samp>’</dt>
20027 <dd><p>type of interpolation
20029 <p>Available values are:
20030 </p><dl compact="compact">
20031 <dt> ‘<samp>no</samp>’</dt>
20032 <dd><p>no interpolation
20034 <dt> ‘<samp>linear</samp>’</dt>
20035 <dd><p>linear only horizontal
20037 <dt> ‘<samp>bilinear</samp>’</dt>
20038 <dd><p>linear in both directions (default)
20040 <dt> ‘<samp>bicubic</samp>’</dt>
20041 <dd><p>cubic in both directions (slow)
20046 <dt> ‘<samp>tripod</samp>’</dt>
20047 <dd><p>virtual tripod mode means that the video is stabilized such that the
20048 camera stays stationary. Use also <code>tripod</code> option of
20049 <a href="#vidstabdetect">vidstabdetect</a>.
20050 </p><dl compact="compact">
20051 <dt> ‘<samp>0</samp>’</dt>
20052 <dd><p>off (default)
20054 <dt> ‘<samp>1</samp>’</dt>
20055 <dd><p>virtual tripod mode: equivalent to <code>relative=0:smoothing=0</code>
20062 <a name="Examples-10"></a>
20063 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-10">33.89.1 Examples</a></h3>
20067 typical call with default default values:
20068 (note the unsharp filter which is always recommended)
20069 <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
20070 </pre></td></tr></table>
20073 zoom in a bit more and load transform data from a given file
20074 <table><tr><td> </td><td><pre class="example">vidstabtransform=zoom=5:input="mytransforms.trf"
20075 </pre></td></tr></table>
20078 smoothen the video even more
20079 <table><tr><td> </td><td><pre class="example">vidstabtransform=smoothing=30
20080 </pre></td></tr></table>
20084 <a name="vflip"></a>
20085 <h2 class="section"><a href="ffplay-all.html#toc-vflip">33.90 vflip</a></h2>
20087 <p>Flip the input video vertically.
20089 <p>For example, to vertically flip a video with <code>ffmpeg</code>:
20090 </p><table><tr><td> </td><td><pre class="example">ffmpeg -i in.avi -vf "vflip" out.avi
20091 </pre></td></tr></table>
20093 <a name="vignette"></a>
20094 <h2 class="section"><a href="ffplay-all.html#toc-vignette">33.91 vignette</a></h2>
20096 <p>Make or reverse a natural vignetting effect.
20098 <p>The filter accepts the following options:
20100 <dl compact="compact">
20101 <dt> ‘<samp>angle, a</samp>’</dt>
20102 <dd><p>Set lens angle expression as a number of radians.
20104 <p>The value is clipped in the <code>[0,PI/2]</code> range.
20106 <p>Default value: <code>"PI/5"</code>
20109 <dt> ‘<samp>x0</samp>’</dt>
20110 <dt> ‘<samp>y0</samp>’</dt>
20111 <dd><p>Set center coordinates expressions. Respectively <code>"w/2"</code> and <code>"h/2"</code>
20115 <dt> ‘<samp>mode</samp>’</dt>
20116 <dd><p>Set forward/backward mode.
20118 <p>Available modes are:
20119 </p><dl compact="compact">
20120 <dt> ‘<samp>forward</samp>’</dt>
20121 <dd><p>The larger the distance from the central point, the darker the image becomes.
20124 <dt> ‘<samp>backward</samp>’</dt>
20125 <dd><p>The larger the distance from the central point, the brighter the image becomes.
20126 This can be used to reverse a vignette effect, though there is no automatic
20127 detection to extract the lens ‘<samp>angle</samp>’ and other settings (yet). It can
20128 also be used to create a burning effect.
20132 <p>Default value is ‘<samp>forward</samp>’.
20135 <dt> ‘<samp>eval</samp>’</dt>
20136 <dd><p>Set evaluation mode for the expressions (‘<samp>angle</samp>’, ‘<samp>x0</samp>’, ‘<samp>y0</samp>’).
20138 <p>It accepts the following values:
20139 </p><dl compact="compact">
20140 <dt> ‘<samp>init</samp>’</dt>
20141 <dd><p>Evaluate expressions only once during the filter initialization.
20144 <dt> ‘<samp>frame</samp>’</dt>
20145 <dd><p>Evaluate expressions for each incoming frame. This is way slower than the
20146 ‘<samp>init</samp>’ mode since it requires all the scalers to be re-computed, but it
20147 allows advanced dynamic expressions.
20151 <p>Default value is ‘<samp>init</samp>’.
20154 <dt> ‘<samp>dither</samp>’</dt>
20155 <dd><p>Set dithering to reduce the circular banding effects. Default is <code>1</code>
20159 <dt> ‘<samp>aspect</samp>’</dt>
20160 <dd><p>Set vignette aspect. This setting allows to adjust the shape of the vignette.
20161 Setting this value to the SAR of the input will make a rectangular vignetting
20162 following the dimensions of the video.
20164 <p>Default is <code>1/1</code>.
20168 <a name="Expressions"></a>
20169 <h3 class="subsection"><a href="ffplay-all.html#toc-Expressions">33.91.1 Expressions</a></h3>
20171 <p>The ‘<samp>alpha</samp>’, ‘<samp>x0</samp>’ and ‘<samp>y0</samp>’ expressions can contain the
20172 following parameters.
20174 <dl compact="compact">
20175 <dt> ‘<samp>w</samp>’</dt>
20176 <dt> ‘<samp>h</samp>’</dt>
20177 <dd><p>input width and height
20180 <dt> ‘<samp>n</samp>’</dt>
20181 <dd><p>the number of input frame, starting from 0
20184 <dt> ‘<samp>pts</samp>’</dt>
20185 <dd><p>the PTS (Presentation TimeStamp) time of the filtered video frame, expressed in
20186 <var>TB</var> units, NAN if undefined
20189 <dt> ‘<samp>r</samp>’</dt>
20190 <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
20193 <dt> ‘<samp>t</samp>’</dt>
20194 <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
20195 expressed in seconds, NAN if undefined
20198 <dt> ‘<samp>tb</samp>’</dt>
20199 <dd><p>time base of the input video
20204 <a name="Examples-45"></a>
20205 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-45">33.91.2 Examples</a></h3>
20209 Apply simple strong vignetting effect:
20210 <table><tr><td> </td><td><pre class="example">vignette=PI/4
20211 </pre></td></tr></table>
20214 Make a flickering vignetting:
20215 <table><tr><td> </td><td><pre class="example">vignette='PI/4+random(1)*PI/50':eval=frame
20216 </pre></td></tr></table>
20220 <a name="w3fdif"></a>
20221 <h2 class="section"><a href="ffplay-all.html#toc-w3fdif">33.92 w3fdif</a></h2>
20223 <p>Deinterlace the input video ("w3fdif" stands for "Weston 3 Field
20224 Deinterlacing Filter").
20226 <p>Based on the process described by Martin Weston for BBC R&D, and
20227 implemented based on the de-interlace algorithm written by Jim
20228 Easterbrook for BBC R&D, the Weston 3 field deinterlacing filter
20229 uses filter coefficients calculated by BBC R&D.
20231 <p>There are two sets of filter coefficients, so called "simple":
20232 and "complex". Which set of filter coefficients is used can
20233 be set by passing an optional parameter:
20235 <dl compact="compact">
20236 <dt> ‘<samp>filter</samp>’</dt>
20237 <dd><p>Set the interlacing filter coefficients. Accepts one of the following values:
20239 <dl compact="compact">
20240 <dt> ‘<samp>simple</samp>’</dt>
20241 <dd><p>Simple filter coefficient set.
20243 <dt> ‘<samp>complex</samp>’</dt>
20244 <dd><p>More-complex filter coefficient set.
20247 <p>Default value is ‘<samp>complex</samp>’.
20250 <dt> ‘<samp>deint</samp>’</dt>
20251 <dd><p>Specify which frames to deinterlace. Accept one of the following values:
20253 <dl compact="compact">
20254 <dt> ‘<samp>all</samp>’</dt>
20255 <dd><p>Deinterlace all frames,
20257 <dt> ‘<samp>interlaced</samp>’</dt>
20258 <dd><p>Only deinterlace frames marked as interlaced.
20262 <p>Default value is ‘<samp>all</samp>’.
20266 <p><a name="yadif"></a>
20267 </p><a name="yadif-1"></a>
20268 <h2 class="section"><a href="ffplay-all.html#toc-yadif-1">33.93 yadif</a></h2>
20270 <p>Deinterlace the input video ("yadif" means "yet another deinterlacing
20273 <p>This filter accepts the following options:
20276 <dl compact="compact">
20277 <dt> ‘<samp>mode</samp>’</dt>
20278 <dd><p>The interlacing mode to adopt, accepts one of the following values:
20280 <dl compact="compact">
20281 <dt> ‘<samp>0, send_frame</samp>’</dt>
20282 <dd><p>output 1 frame for each frame
20284 <dt> ‘<samp>1, send_field</samp>’</dt>
20285 <dd><p>output 1 frame for each field
20287 <dt> ‘<samp>2, send_frame_nospatial</samp>’</dt>
20288 <dd><p>like <code>send_frame</code> but skip spatial interlacing check
20290 <dt> ‘<samp>3, send_field_nospatial</samp>’</dt>
20291 <dd><p>like <code>send_field</code> but skip spatial interlacing check
20295 <p>Default value is <code>send_frame</code>.
20298 <dt> ‘<samp>parity</samp>’</dt>
20299 <dd><p>The picture field parity assumed for the input interlaced video, accepts one of
20300 the following values:
20302 <dl compact="compact">
20303 <dt> ‘<samp>0, tff</samp>’</dt>
20304 <dd><p>assume top field first
20306 <dt> ‘<samp>1, bff</samp>’</dt>
20307 <dd><p>assume bottom field first
20309 <dt> ‘<samp>-1, auto</samp>’</dt>
20310 <dd><p>enable automatic detection
20314 <p>Default value is <code>auto</code>.
20315 If interlacing is unknown or decoder does not export this information,
20316 top field first will be assumed.
20319 <dt> ‘<samp>deint</samp>’</dt>
20320 <dd><p>Specify which frames to deinterlace. Accept one of the following
20323 <dl compact="compact">
20324 <dt> ‘<samp>0, all</samp>’</dt>
20325 <dd><p>deinterlace all frames
20327 <dt> ‘<samp>1, interlaced</samp>’</dt>
20328 <dd><p>only deinterlace frames marked as interlaced
20332 <p>Default value is <code>all</code>.
20337 <a name="Video-Sources"></a>
20338 <h1 class="chapter"><a href="ffplay-all.html#toc-Video-Sources">34. Video Sources</a></h1>
20340 <p>Below is a description of the currently available video sources.
20342 <a name="buffer"></a>
20343 <h2 class="section"><a href="ffplay-all.html#toc-buffer">34.1 buffer</a></h2>
20345 <p>Buffer video frames, and make them available to the filter chain.
20347 <p>This source is mainly intended for a programmatic use, in particular
20348 through the interface defined in ‘<tt>libavfilter/vsrc_buffer.h</tt>’.
20350 <p>This source accepts the following options:
20352 <dl compact="compact">
20353 <dt> ‘<samp>video_size</samp>’</dt>
20354 <dd><p>Specify the size (width and height) of the buffered video frames. For the
20355 syntax of this option, check the "Video size" section in the ffmpeg-utils
20359 <dt> ‘<samp>width</samp>’</dt>
20360 <dd><p>Input video width.
20363 <dt> ‘<samp>height</samp>’</dt>
20364 <dd><p>Input video height.
20367 <dt> ‘<samp>pix_fmt</samp>’</dt>
20368 <dd><p>A string representing the pixel format of the buffered video frames.
20369 It may be a number corresponding to a pixel format, or a pixel format
20373 <dt> ‘<samp>time_base</samp>’</dt>
20374 <dd><p>Specify the timebase assumed by the timestamps of the buffered frames.
20377 <dt> ‘<samp>frame_rate</samp>’</dt>
20378 <dd><p>Specify the frame rate expected for the video stream.
20381 <dt> ‘<samp>pixel_aspect, sar</samp>’</dt>
20382 <dd><p>Specify the sample aspect ratio assumed by the video frames.
20385 <dt> ‘<samp>sws_param</samp>’</dt>
20386 <dd><p>Specify the optional parameters to be used for the scale filter which
20387 is automatically inserted when an input change is detected in the
20388 input size or format.
20393 </p><table><tr><td> </td><td><pre class="example">buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
20394 </pre></td></tr></table>
20396 <p>will instruct the source to accept video frames with size 320x240 and
20397 with format "yuv410p", assuming 1/24 as the timestamps timebase and
20398 square pixels (1:1 sample aspect ratio).
20399 Since the pixel format with name "yuv410p" corresponds to the number 6
20400 (check the enum AVPixelFormat definition in ‘<tt>libavutil/pixfmt.h</tt>’),
20401 this example corresponds to:
20402 </p><table><tr><td> </td><td><pre class="example">buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
20403 </pre></td></tr></table>
20405 <p>Alternatively, the options can be specified as a flat string, but this
20406 syntax is deprecated:
20408 <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>]
20410 <a name="cellauto"></a>
20411 <h2 class="section"><a href="ffplay-all.html#toc-cellauto">34.2 cellauto</a></h2>
20413 <p>Create a pattern generated by an elementary cellular automaton.
20415 <p>The initial state of the cellular automaton can be defined through the
20416 ‘<samp>filename</samp>’, and ‘<samp>pattern</samp>’ options. If such options are
20417 not specified an initial state is created randomly.
20419 <p>At each new frame a new row in the video is filled with the result of
20420 the cellular automaton next generation. The behavior when the whole
20421 frame is filled is defined by the ‘<samp>scroll</samp>’ option.
20423 <p>This source accepts the following options:
20425 <dl compact="compact">
20426 <dt> ‘<samp>filename, f</samp>’</dt>
20427 <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
20428 the specified file.
20429 In the file, each non-whitespace character is considered an alive
20430 cell, a newline will terminate the row, and further characters in the
20431 file will be ignored.
20434 <dt> ‘<samp>pattern, p</samp>’</dt>
20435 <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
20436 the specified string.
20438 <p>Each non-whitespace character in the string is considered an alive
20439 cell, a newline will terminate the row, and further characters in the
20440 string will be ignored.
20443 <dt> ‘<samp>rate, r</samp>’</dt>
20444 <dd><p>Set the video rate, that is the number of frames generated per second.
20448 <dt> ‘<samp>random_fill_ratio, ratio</samp>’</dt>
20449 <dd><p>Set the random fill ratio for the initial cellular automaton row. It
20450 is a floating point number value ranging from 0 to 1, defaults to
20453 <p>This option is ignored when a file or a pattern is specified.
20456 <dt> ‘<samp>random_seed, seed</samp>’</dt>
20457 <dd><p>Set the seed for filling randomly the initial row, must be an integer
20458 included between 0 and UINT32_MAX. If not specified, or if explicitly
20459 set to -1, the filter will try to use a good random seed on a best
20463 <dt> ‘<samp>rule</samp>’</dt>
20464 <dd><p>Set the cellular automaton rule, it is a number ranging from 0 to 255.
20465 Default value is 110.
20468 <dt> ‘<samp>size, s</samp>’</dt>
20469 <dd><p>Set the size of the output video. For the syntax of this option, check
20470 the "Video size" section in the ffmpeg-utils manual.
20472 <p>If ‘<samp>filename</samp>’ or ‘<samp>pattern</samp>’ is specified, the size is set
20473 by default to the width of the specified initial state row, and the
20474 height is set to <var>width</var> * PHI.
20476 <p>If ‘<samp>size</samp>’ is set, it must contain the width of the specified
20477 pattern string, and the specified pattern will be centered in the
20480 <p>If a filename or a pattern string is not specified, the size value
20481 defaults to "320x518" (used for a randomly generated initial state).
20484 <dt> ‘<samp>scroll</samp>’</dt>
20485 <dd><p>If set to 1, scroll the output upward when all the rows in the output
20486 have been already filled. If set to 0, the new generated row will be
20487 written over the top row just after the bottom row is filled.
20491 <dt> ‘<samp>start_full, full</samp>’</dt>
20492 <dd><p>If set to 1, completely fill the output with generated rows before
20493 outputting the first frame.
20494 This is the default behavior, for disabling set the value to 0.
20497 <dt> ‘<samp>stitch</samp>’</dt>
20498 <dd><p>If set to 1, stitch the left and right row edges together.
20499 This is the default behavior, for disabling set the value to 0.
20503 <a name="Examples-38"></a>
20504 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-38">34.2.1 Examples</a></h3>
20508 Read the initial state from ‘<tt>pattern</tt>’, and specify an output of
20510 <table><tr><td> </td><td><pre class="example">cellauto=f=pattern:s=200x400
20511 </pre></td></tr></table>
20514 Generate a random initial row with a width of 200 cells, with a fill
20516 <table><tr><td> </td><td><pre class="example">cellauto=ratio=2/3:s=200x200
20517 </pre></td></tr></table>
20520 Create a pattern generated by rule 18 starting by a single alive cell
20521 centered on an initial row with width 100:
20522 <table><tr><td> </td><td><pre class="example">cellauto=p=@:s=100x400:full=0:rule=18
20523 </pre></td></tr></table>
20526 Specify a more elaborated initial pattern:
20527 <table><tr><td> </td><td><pre class="example">cellauto=p='@@ @ @@':s=100x400:full=0:rule=18
20528 </pre></td></tr></table>
20532 <a name="mandelbrot"></a>
20533 <h2 class="section"><a href="ffplay-all.html#toc-mandelbrot">34.3 mandelbrot</a></h2>
20535 <p>Generate a Mandelbrot set fractal, and progressively zoom towards the
20536 point specified with <var>start_x</var> and <var>start_y</var>.
20538 <p>This source accepts the following options:
20540 <dl compact="compact">
20541 <dt> ‘<samp>end_pts</samp>’</dt>
20542 <dd><p>Set the terminal pts value. Default value is 400.
20545 <dt> ‘<samp>end_scale</samp>’</dt>
20546 <dd><p>Set the terminal scale value.
20547 Must be a floating point value. Default value is 0.3.
20550 <dt> ‘<samp>inner</samp>’</dt>
20551 <dd><p>Set the inner coloring mode, that is the algorithm used to draw the
20552 Mandelbrot fractal internal region.
20554 <p>It shall assume one of the following values:
20555 </p><dl compact="compact">
20556 <dt> ‘<samp>black</samp>’</dt>
20557 <dd><p>Set black mode.
20559 <dt> ‘<samp>convergence</samp>’</dt>
20560 <dd><p>Show time until convergence.
20562 <dt> ‘<samp>mincol</samp>’</dt>
20563 <dd><p>Set color based on point closest to the origin of the iterations.
20565 <dt> ‘<samp>period</samp>’</dt>
20566 <dd><p>Set period mode.
20570 <p>Default value is <var>mincol</var>.
20573 <dt> ‘<samp>bailout</samp>’</dt>
20574 <dd><p>Set the bailout value. Default value is 10.0.
20577 <dt> ‘<samp>maxiter</samp>’</dt>
20578 <dd><p>Set the maximum of iterations performed by the rendering
20579 algorithm. Default value is 7189.
20582 <dt> ‘<samp>outer</samp>’</dt>
20583 <dd><p>Set outer coloring mode.
20584 It shall assume one of following values:
20585 </p><dl compact="compact">
20586 <dt> ‘<samp>iteration_count</samp>’</dt>
20587 <dd><p>Set iteration cound mode.
20589 <dt> ‘<samp>normalized_iteration_count</samp>’</dt>
20590 <dd><p>set normalized iteration count mode.
20593 <p>Default value is <var>normalized_iteration_count</var>.
20596 <dt> ‘<samp>rate, r</samp>’</dt>
20597 <dd><p>Set frame rate, expressed as number of frames per second. Default
20598 value is "25".
20601 <dt> ‘<samp>size, s</samp>’</dt>
20602 <dd><p>Set frame size. For the syntax of this option, check the "Video
20603 size" section in the ffmpeg-utils manual. Default value is "640x480".
20606 <dt> ‘<samp>start_scale</samp>’</dt>
20607 <dd><p>Set the initial scale value. Default value is 3.0.
20610 <dt> ‘<samp>start_x</samp>’</dt>
20611 <dd><p>Set the initial x position. Must be a floating point value between
20612 -100 and 100. Default value is -0.743643887037158704752191506114774.
20615 <dt> ‘<samp>start_y</samp>’</dt>
20616 <dd><p>Set the initial y position. Must be a floating point value between
20617 -100 and 100. Default value is -0.131825904205311970493132056385139.
20621 <a name="mptestsrc"></a>
20622 <h2 class="section"><a href="ffplay-all.html#toc-mptestsrc">34.4 mptestsrc</a></h2>
20624 <p>Generate various test patterns, as generated by the MPlayer test filter.
20626 <p>The size of the generated video is fixed, and is 256x256.
20627 This source is useful in particular for testing encoding features.
20629 <p>This source accepts the following options:
20631 <dl compact="compact">
20632 <dt> ‘<samp>rate, r</samp>’</dt>
20633 <dd><p>Specify the frame rate of the sourced video, as the number of frames
20634 generated per second. It has to be a string in the format
20635 <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a float
20636 number or a valid video frame rate abbreviation. The default value is
20640 <dt> ‘<samp>duration, d</samp>’</dt>
20641 <dd><p>Set the video duration of the sourced video. The accepted syntax is:
20642 </p><table><tr><td> </td><td><pre class="example">[-]HH:MM:SS[.m...]
20644 </pre></td></tr></table>
20645 <p>See also the function <code>av_parse_time()</code>.
20647 <p>If not specified, or the expressed duration is negative, the video is
20648 supposed to be generated forever.
20651 <dt> ‘<samp>test, t</samp>’</dt>
20653 <p>Set the number or the name of the test to perform. Supported tests are:
20654 </p><dl compact="compact">
20655 <dt> ‘<samp>dc_luma</samp>’</dt>
20656 <dt> ‘<samp>dc_chroma</samp>’</dt>
20657 <dt> ‘<samp>freq_luma</samp>’</dt>
20658 <dt> ‘<samp>freq_chroma</samp>’</dt>
20659 <dt> ‘<samp>amp_luma</samp>’</dt>
20660 <dt> ‘<samp>amp_chroma</samp>’</dt>
20661 <dt> ‘<samp>cbp</samp>’</dt>
20662 <dt> ‘<samp>mv</samp>’</dt>
20663 <dt> ‘<samp>ring1</samp>’</dt>
20664 <dt> ‘<samp>ring2</samp>’</dt>
20665 <dt> ‘<samp>all</samp>’</dt>
20668 <p>Default value is "all", which will cycle through the list of all tests.
20672 <p>For example the following:
20673 </p><table><tr><td> </td><td><pre class="example">testsrc=t=dc_luma
20674 </pre></td></tr></table>
20676 <p>will generate a "dc_luma" test pattern.
20678 <a name="frei0r_005fsrc"></a>
20679 <h2 class="section"><a href="ffplay-all.html#toc-frei0r_005fsrc">34.5 frei0r_src</a></h2>
20681 <p>Provide a frei0r source.
20683 <p>To enable compilation of this filter you need to install the frei0r
20684 header and configure FFmpeg with <code>--enable-frei0r</code>.
20686 <p>This source accepts the following options:
20688 <dl compact="compact">
20689 <dt> ‘<samp>size</samp>’</dt>
20690 <dd><p>The size of the video to generate. For the syntax of this option, check the
20691 "Video size" section in the ffmpeg-utils manual.
20694 <dt> ‘<samp>framerate</samp>’</dt>
20695 <dd><p>Framerate of the generated video, may be a string of the form
20696 <var>num</var>/<var>den</var> or a frame rate abbreviation.
20699 <dt> ‘<samp>filter_name</samp>’</dt>
20700 <dd><p>The name to the frei0r source to load. For more information regarding frei0r and
20701 how to set the parameters read the section <a href="#frei0r">frei0r</a> in the description of
20705 <dt> ‘<samp>filter_params</samp>’</dt>
20706 <dd><p>A ’|’-separated list of parameters to pass to the frei0r source.
20711 <p>For example, to generate a frei0r partik0l source with size 200x200
20712 and frame rate 10 which is overlayed on the overlay filter main input:
20713 </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
20714 </pre></td></tr></table>
20716 <a name="life"></a>
20717 <h2 class="section"><a href="ffplay-all.html#toc-life">34.6 life</a></h2>
20719 <p>Generate a life pattern.
20721 <p>This source is based on a generalization of John Conway’s life game.
20723 <p>The sourced input represents a life grid, each pixel represents a cell
20724 which can be in one of two possible states, alive or dead. Every cell
20725 interacts with its eight neighbours, which are the cells that are
20726 horizontally, vertically, or diagonally adjacent.
20728 <p>At each interaction the grid evolves according to the adopted rule,
20729 which specifies the number of neighbor alive cells which will make a
20730 cell stay alive or born. The ‘<samp>rule</samp>’ option allows to specify
20733 <p>This source accepts the following options:
20735 <dl compact="compact">
20736 <dt> ‘<samp>filename, f</samp>’</dt>
20737 <dd><p>Set the file from which to read the initial grid state. In the file,
20738 each non-whitespace character is considered an alive cell, and newline
20739 is used to delimit the end of each row.
20741 <p>If this option is not specified, the initial grid is generated
20745 <dt> ‘<samp>rate, r</samp>’</dt>
20746 <dd><p>Set the video rate, that is the number of frames generated per second.
20750 <dt> ‘<samp>random_fill_ratio, ratio</samp>’</dt>
20751 <dd><p>Set the random fill ratio for the initial random grid. It is a
20752 floating point number value ranging from 0 to 1, defaults to 1/PHI.
20753 It is ignored when a file is specified.
20756 <dt> ‘<samp>random_seed, seed</samp>’</dt>
20757 <dd><p>Set the seed for filling the initial random grid, must be an integer
20758 included between 0 and UINT32_MAX. If not specified, or if explicitly
20759 set to -1, the filter will try to use a good random seed on a best
20763 <dt> ‘<samp>rule</samp>’</dt>
20764 <dd><p>Set the life rule.
20766 <p>A rule can be specified with a code of the kind "S<var>NS</var>/B<var>NB</var>",
20767 where <var>NS</var> and <var>NB</var> are sequences of numbers in the range 0-8,
20768 <var>NS</var> specifies the number of alive neighbor cells which make a
20769 live cell stay alive, and <var>NB</var> the number of alive neighbor cells
20770 which make a dead cell to become alive (i.e. to "born").
20771 "s" and "b" can be used in place of "S" and "B", respectively.
20773 <p>Alternatively a rule can be specified by an 18-bits integer. The 9
20774 high order bits are used to encode the next cell state if it is alive
20775 for each number of neighbor alive cells, the low order bits specify
20776 the rule for "borning" new cells. Higher order bits encode for an
20777 higher number of neighbor cells.
20778 For example the number 6153 = <code>(12<<9)+9</code> specifies a stay alive
20779 rule of 12 and a born rule of 9, which corresponds to "S23/B03".
20781 <p>Default value is "S23/B3", which is the original Conway’s game of life
20782 rule, and will keep a cell alive if it has 2 or 3 neighbor alive
20783 cells, and will born a new cell if there are three alive cells around
20787 <dt> ‘<samp>size, s</samp>’</dt>
20788 <dd><p>Set the size of the output video. For the syntax of this option, check the
20789 "Video size" section in the ffmpeg-utils manual.
20791 <p>If ‘<samp>filename</samp>’ is specified, the size is set by default to the
20792 same size of the input file. If ‘<samp>size</samp>’ is set, it must contain
20793 the size specified in the input file, and the initial grid defined in
20794 that file is centered in the larger resulting area.
20796 <p>If a filename is not specified, the size value defaults to "320x240"
20797 (used for a randomly generated initial grid).
20800 <dt> ‘<samp>stitch</samp>’</dt>
20801 <dd><p>If set to 1, stitch the left and right grid edges together, and the
20802 top and bottom edges also. Defaults to 1.
20805 <dt> ‘<samp>mold</samp>’</dt>
20806 <dd><p>Set cell mold speed. If set, a dead cell will go from ‘<samp>death_color</samp>’ to
20807 ‘<samp>mold_color</samp>’ with a step of ‘<samp>mold</samp>’. ‘<samp>mold</samp>’ can have a
20808 value from 0 to 255.
20811 <dt> ‘<samp>life_color</samp>’</dt>
20812 <dd><p>Set the color of living (or new born) cells.
20815 <dt> ‘<samp>death_color</samp>’</dt>
20816 <dd><p>Set the color of dead cells. If ‘<samp>mold</samp>’ is set, this is the first color
20817 used to represent a dead cell.
20820 <dt> ‘<samp>mold_color</samp>’</dt>
20821 <dd><p>Set mold color, for definitely dead and moldy cells.
20823 <p>For the syntax of these 3 color options, check the "Color" section in the
20824 ffmpeg-utils manual.
20828 <a name="Examples-21"></a>
20829 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-21">34.6.1 Examples</a></h3>
20833 Read a grid from ‘<tt>pattern</tt>’, and center it on a grid of size
20835 <table><tr><td> </td><td><pre class="example">life=f=pattern:s=300x300
20836 </pre></td></tr></table>
20839 Generate a random grid of size 200x200, with a fill ratio of 2/3:
20840 <table><tr><td> </td><td><pre class="example">life=ratio=2/3:s=200x200
20841 </pre></td></tr></table>
20844 Specify a custom rule for evolving a randomly generated grid:
20845 <table><tr><td> </td><td><pre class="example">life=rule=S14/B34
20846 </pre></td></tr></table>
20849 Full example with slow death effect (mold) using <code>ffplay</code>:
20850 <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
20851 </pre></td></tr></table>
20854 <p><a name="color"></a>
20855 <a name="haldclutsrc"></a>
20856 <a name="nullsrc"></a>
20857 <a name="rgbtestsrc"></a>
20858 <a name="smptebars"></a>
20859 <a name="smptehdbars"></a>
20860 <a name="testsrc"></a>
20861 </p><a name="color_002c-haldclutsrc_002c-nullsrc_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc"></a>
20862 <h2 class="section"><a href="ffplay-all.html#toc-color_002c-haldclutsrc_002c-nullsrc_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc">34.7 color, haldclutsrc, nullsrc, rgbtestsrc, smptebars, smptehdbars, testsrc</a></h2>
20864 <p>The <code>color</code> source provides an uniformly colored input.
20866 <p>The <code>haldclutsrc</code> source provides an identity Hald CLUT. See also
20867 <a href="#haldclut">haldclut</a> filter.
20869 <p>The <code>nullsrc</code> source returns unprocessed video frames. It is
20870 mainly useful to be employed in analysis / debugging tools, or as the
20871 source for filters which ignore the input data.
20873 <p>The <code>rgbtestsrc</code> source generates an RGB test pattern useful for
20874 detecting RGB vs BGR issues. You should see a red, green and blue
20875 stripe from top to bottom.
20877 <p>The <code>smptebars</code> source generates a color bars pattern, based on
20878 the SMPTE Engineering Guideline EG 1-1990.
20880 <p>The <code>smptehdbars</code> source generates a color bars pattern, based on
20881 the SMPTE RP 219-2002.
20883 <p>The <code>testsrc</code> source generates a test video pattern, showing a
20884 color pattern, a scrolling gradient and a timestamp. This is mainly
20885 intended for testing purposes.
20887 <p>The sources accept the following options:
20889 <dl compact="compact">
20890 <dt> ‘<samp>color, c</samp>’</dt>
20891 <dd><p>Specify the color of the source, only available in the <code>color</code>
20892 source. For the syntax of this option, check the "Color" section in the
20893 ffmpeg-utils manual.
20896 <dt> ‘<samp>level</samp>’</dt>
20897 <dd><p>Specify the level of the Hald CLUT, only available in the <code>haldclutsrc</code>
20898 source. A level of <code>N</code> generates a picture of <code>N*N*N</code> by <code>N*N*N</code>
20899 pixels to be used as identity matrix for 3D lookup tables. Each component is
20900 coded on a <code>1/(N*N)</code> scale.
20903 <dt> ‘<samp>size, s</samp>’</dt>
20904 <dd><p>Specify the size of the sourced video. For the syntax of this option, check the
20905 "Video size" section in the ffmpeg-utils manual. The default value is
20906 "320x240".
20908 <p>This option is not available with the <code>haldclutsrc</code> filter.
20911 <dt> ‘<samp>rate, r</samp>’</dt>
20912 <dd><p>Specify the frame rate of the sourced video, as the number of frames
20913 generated per second. It has to be a string in the format
20914 <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a float
20915 number or a valid video frame rate abbreviation. The default value is
20919 <dt> ‘<samp>sar</samp>’</dt>
20920 <dd><p>Set the sample aspect ratio of the sourced video.
20923 <dt> ‘<samp>duration, d</samp>’</dt>
20924 <dd><p>Set the video duration of the sourced video. The accepted syntax is:
20925 </p><table><tr><td> </td><td><pre class="example">[-]HH[:MM[:SS[.m...]]]
20927 </pre></td></tr></table>
20928 <p>See also the function <code>av_parse_time()</code>.
20930 <p>If not specified, or the expressed duration is negative, the video is
20931 supposed to be generated forever.
20934 <dt> ‘<samp>decimals, n</samp>’</dt>
20935 <dd><p>Set the number of decimals to show in the timestamp, only available in the
20936 <code>testsrc</code> source.
20938 <p>The displayed timestamp value will correspond to the original
20939 timestamp value multiplied by the power of 10 of the specified
20940 value. Default value is 0.
20944 <p>For example the following:
20945 </p><table><tr><td> </td><td><pre class="example">testsrc=duration=5.3:size=qcif:rate=10
20946 </pre></td></tr></table>
20948 <p>will generate a video with a duration of 5.3 seconds, with size
20949 176x144 and a frame rate of 10 frames per second.
20951 <p>The following graph description will generate a red source
20952 with an opacity of 0.2, with size "qcif" and a frame rate of 10
20954 </p><table><tr><td> </td><td><pre class="example">color=c=red@0.2:s=qcif:r=10
20955 </pre></td></tr></table>
20957 <p>If the input content is to be ignored, <code>nullsrc</code> can be used. The
20958 following command generates noise in the luminance plane by employing
20959 the <code>geq</code> filter:
20960 </p><table><tr><td> </td><td><pre class="example">nullsrc=s=256x256, geq=random(1)*255:128:128
20961 </pre></td></tr></table>
20963 <a name="Commands-4"></a>
20964 <h3 class="subsection"><a href="ffplay-all.html#toc-Commands-4">34.7.1 Commands</a></h3>
20966 <p>The <code>color</code> source supports the following commands:
20968 <dl compact="compact">
20969 <dt> ‘<samp>c, color</samp>’</dt>
20970 <dd><p>Set the color of the created image. Accepts the same syntax of the
20971 corresponding ‘<samp>color</samp>’ option.
20976 <a name="Video-Sinks"></a>
20977 <h1 class="chapter"><a href="ffplay-all.html#toc-Video-Sinks">35. Video Sinks</a></h1>
20979 <p>Below is a description of the currently available video sinks.
20981 <a name="buffersink"></a>
20982 <h2 class="section"><a href="ffplay-all.html#toc-buffersink">35.1 buffersink</a></h2>
20984 <p>Buffer video frames, and make them available to the end of the filter
20987 <p>This sink is mainly intended for a programmatic use, in particular
20988 through the interface defined in ‘<tt>libavfilter/buffersink.h</tt>’
20989 or the options system.
20991 <p>It accepts a pointer to an AVBufferSinkContext structure, which
20992 defines the incoming buffers’ formats, to be passed as the opaque
20993 parameter to <code>avfilter_init_filter</code> for initialization.
20995 <a name="nullsink"></a>
20996 <h2 class="section"><a href="ffplay-all.html#toc-nullsink">35.2 nullsink</a></h2>
20998 <p>Null video sink, do absolutely nothing with the input video. It is
20999 mainly useful as a template and to be employed in analysis / debugging
21003 <a name="Multimedia-Filters"></a>
21004 <h1 class="chapter"><a href="ffplay-all.html#toc-Multimedia-Filters">36. Multimedia Filters</a></h1>
21006 <p>Below is a description of the currently available multimedia filters.
21008 <a name="avectorscope"></a>
21009 <h2 class="section"><a href="ffplay-all.html#toc-avectorscope">36.1 avectorscope</a></h2>
21011 <p>Convert input audio to a video output, representing the audio vector
21014 <p>The filter is used to measure the difference between channels of stereo
21015 audio stream. A monoaural signal, consisting of identical left and right
21016 signal, results in straight vertical line. Any stereo separation is visible
21017 as a deviation from this line, creating a Lissajous figure.
21018 If the straight (or deviation from it) but horizontal line appears this
21019 indicates that the left and right channels are out of phase.
21021 <p>The filter accepts the following options:
21023 <dl compact="compact">
21024 <dt> ‘<samp>mode, m</samp>’</dt>
21025 <dd><p>Set the vectorscope mode.
21027 <p>Available values are:
21028 </p><dl compact="compact">
21029 <dt> ‘<samp>lissajous</samp>’</dt>
21030 <dd><p>Lissajous rotated by 45 degrees.
21033 <dt> ‘<samp>lissajous_xy</samp>’</dt>
21034 <dd><p>Same as above but not rotated.
21038 <p>Default value is ‘<samp>lissajous</samp>’.
21041 <dt> ‘<samp>size, s</samp>’</dt>
21042 <dd><p>Set the video size for the output. For the syntax of this option, check the "Video size"
21043 section in the ffmpeg-utils manual. Default value is <code>400x400</code>.
21046 <dt> ‘<samp>rate, r</samp>’</dt>
21047 <dd><p>Set the output frame rate. Default value is <code>25</code>.
21050 <dt> ‘<samp>rc</samp>’</dt>
21051 <dt> ‘<samp>gc</samp>’</dt>
21052 <dt> ‘<samp>bc</samp>’</dt>
21053 <dd><p>Specify the red, green and blue contrast. Default values are <code>40</code>, <code>160</code> and <code>80</code>.
21054 Allowed range is <code>[0, 255]</code>.
21057 <dt> ‘<samp>rf</samp>’</dt>
21058 <dt> ‘<samp>gf</samp>’</dt>
21059 <dt> ‘<samp>bf</samp>’</dt>
21060 <dd><p>Specify the red, green and blue fade. Default values are <code>15</code>, <code>10</code> and <code>5</code>.
21061 Allowed range is <code>[0, 255]</code>.
21064 <dt> ‘<samp>zoom</samp>’</dt>
21065 <dd><p>Set the zoom factor. Default value is <code>1</code>. Allowed range is <code>[1, 10]</code>.
21069 <a name="Examples"></a>
21070 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples">36.1.1 Examples</a></h3>
21074 Complete example using <code>ffplay</code>:
21075 <table><tr><td> </td><td><pre class="example">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
21076 [a] avectorscope=zoom=1.3:rc=2:gc=200:bc=10:rf=1:gf=8:bf=7 [out0]'
21077 </pre></td></tr></table>
21080 <a name="concat-2"></a>
21081 <h2 class="section"><a href="ffplay-all.html#toc-concat-2">36.2 concat</a></h2>
21083 <p>Concatenate audio and video streams, joining them together one after the
21086 <p>The filter works on segments of synchronized video and audio streams. All
21087 segments must have the same number of streams of each type, and that will
21088 also be the number of streams at output.
21090 <p>The filter accepts the following options:
21092 <dl compact="compact">
21093 <dt> ‘<samp>n</samp>’</dt>
21094 <dd><p>Set the number of segments. Default is 2.
21097 <dt> ‘<samp>v</samp>’</dt>
21098 <dd><p>Set the number of output video streams, that is also the number of video
21099 streams in each segment. Default is 1.
21102 <dt> ‘<samp>a</samp>’</dt>
21103 <dd><p>Set the number of output audio streams, that is also the number of video
21104 streams in each segment. Default is 0.
21107 <dt> ‘<samp>unsafe</samp>’</dt>
21108 <dd><p>Activate unsafe mode: do not fail if segments have a different format.
21113 <p>The filter has <var>v</var>+<var>a</var> outputs: first <var>v</var> video outputs, then
21114 <var>a</var> audio outputs.
21116 <p>There are <var>n</var>x(<var>v</var>+<var>a</var>) inputs: first the inputs for the first
21117 segment, in the same order as the outputs, then the inputs for the second
21120 <p>Related streams do not always have exactly the same duration, for various
21121 reasons including codec frame size or sloppy authoring. For that reason,
21122 related synchronized streams (e.g. a video and its audio track) should be
21123 concatenated at once. The concat filter will use the duration of the longest
21124 stream in each segment (except the last one), and if necessary pad shorter
21125 audio streams with silence.
21127 <p>For this filter to work correctly, all segments must start at timestamp 0.
21129 <p>All corresponding streams must have the same parameters in all segments; the
21130 filtering system will automatically select a common pixel format for video
21131 streams, and a common sample format, sample rate and channel layout for
21132 audio streams, but other settings, such as resolution, must be converted
21133 explicitly by the user.
21135 <p>Different frame rates are acceptable but will result in variable frame rate
21136 at output; be sure to configure the output file to handle it.
21138 <a name="Examples-40"></a>
21139 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-40">36.2.1 Examples</a></h3>
21143 Concatenate an opening, an episode and an ending, all in bilingual version
21144 (video in stream 0, audio in streams 1 and 2):
21145 <table><tr><td> </td><td><pre class="example">ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \
21146 '[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
21147 concat=n=3:v=1:a=2 [v] [a1] [a2]' \
21148 -map '[v]' -map '[a1]' -map '[a2]' output.mkv
21149 </pre></td></tr></table>
21152 Concatenate two parts, handling audio and video separately, using the
21153 (a)movie sources, and adjusting the resolution:
21154 <table><tr><td> </td><td><pre class="example">movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
21155 movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
21156 [v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
21157 </pre></td></tr></table>
21158 <p>Note that a desync will happen at the stitch if the audio and video streams
21159 do not have exactly the same duration in the first file.
21163 <a name="ebur128"></a>
21164 <h2 class="section"><a href="ffplay-all.html#toc-ebur128">36.3 ebur128</a></h2>
21166 <p>EBU R128 scanner filter. This filter takes an audio stream as input and outputs
21167 it unchanged. By default, it logs a message at a frequency of 10Hz with the
21168 Momentary loudness (identified by <code>M</code>), Short-term loudness (<code>S</code>),
21169 Integrated loudness (<code>I</code>) and Loudness Range (<code>LRA</code>).
21171 <p>The filter also has a video output (see the <var>video</var> option) with a real
21172 time graph to observe the loudness evolution. The graphic contains the logged
21173 message mentioned above, so it is not printed anymore when this option is set,
21174 unless the verbose logging is set. The main graphing area contains the
21175 short-term loudness (3 seconds of analysis), and the gauge on the right is for
21176 the momentary loudness (400 milliseconds).
21178 <p>More information about the Loudness Recommendation EBU R128 on
21179 <a href="http://tech.ebu.ch/loudness">http://tech.ebu.ch/loudness</a>.
21181 <p>The filter accepts the following options:
21183 <dl compact="compact">
21184 <dt> ‘<samp>video</samp>’</dt>
21185 <dd><p>Activate the video output. The audio stream is passed unchanged whether this
21186 option is set or no. The video stream will be the first output stream if
21187 activated. Default is <code>0</code>.
21190 <dt> ‘<samp>size</samp>’</dt>
21191 <dd><p>Set the video size. This option is for video only. For the syntax of this
21192 option, check the "Video size" section in the ffmpeg-utils manual. Default
21193 and minimum resolution is <code>640x480</code>.
21196 <dt> ‘<samp>meter</samp>’</dt>
21197 <dd><p>Set the EBU scale meter. Default is <code>9</code>. Common values are <code>9</code> and
21198 <code>18</code>, respectively for EBU scale meter +9 and EBU scale meter +18. Any
21199 other integer value between this range is allowed.
21202 <dt> ‘<samp>metadata</samp>’</dt>
21203 <dd><p>Set metadata injection. If set to <code>1</code>, the audio input will be segmented
21204 into 100ms output frames, each of them containing various loudness information
21205 in metadata. All the metadata keys are prefixed with <code>lavfi.r128.</code>.
21207 <p>Default is <code>0</code>.
21210 <dt> ‘<samp>framelog</samp>’</dt>
21211 <dd><p>Force the frame logging level.
21213 <p>Available values are:
21214 </p><dl compact="compact">
21215 <dt> ‘<samp>info</samp>’</dt>
21216 <dd><p>information logging level
21218 <dt> ‘<samp>verbose</samp>’</dt>
21219 <dd><p>verbose logging level
21223 <p>By default, the logging level is set to <var>info</var>. If the ‘<samp>video</samp>’ or
21224 the ‘<samp>metadata</samp>’ options are set, it switches to <var>verbose</var>.
21228 <a name="Examples-18"></a>
21229 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-18">36.3.1 Examples</a></h3>
21233 Real-time graph using <code>ffplay</code>, with a EBU scale meter +18:
21234 <table><tr><td> </td><td><pre class="example">ffplay -f lavfi -i "amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]"
21235 </pre></td></tr></table>
21238 Run an analysis with <code>ffmpeg</code>:
21239 <table><tr><td> </td><td><pre class="example">ffmpeg -nostats -i input.mp3 -filter_complex ebur128 -f null -
21240 </pre></td></tr></table>
21243 <a name="interleave_002c-ainterleave"></a>
21244 <h2 class="section"><a href="ffplay-all.html#toc-interleave_002c-ainterleave">36.4 interleave, ainterleave</a></h2>
21246 <p>Temporally interleave frames from several inputs.
21248 <p><code>interleave</code> works with video inputs, <code>ainterleave</code> with audio.
21250 <p>These filters read frames from several inputs and send the oldest
21251 queued frame to the output.
21253 <p>Input streams must have a well defined, monotonically increasing frame
21256 <p>In order to submit one frame to output, these filters need to enqueue
21257 at least one frame for each input, so they cannot work in case one
21258 input is not yet terminated and will not receive incoming frames.
21260 <p>For example consider the case when one input is a <code>select</code> filter
21261 which always drop input frames. The <code>interleave</code> filter will keep
21262 reading from that input, but it will never be able to send new frames
21263 to output until the input will send an end-of-stream signal.
21265 <p>Also, depending on inputs synchronization, the filters will drop
21266 frames in case one input receives more frames than the other ones, and
21267 the queue is already filled.
21269 <p>These filters accept the following options:
21271 <dl compact="compact">
21272 <dt> ‘<samp>nb_inputs, n</samp>’</dt>
21273 <dd><p>Set the number of different inputs, it is 2 by default.
21277 <a name="Examples-35"></a>
21278 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-35">36.4.1 Examples</a></h3>
21282 Interleave frames belonging to different streams using <code>ffmpeg</code>:
21283 <table><tr><td> </td><td><pre class="example">ffmpeg -i bambi.avi -i pr0n.mkv -filter_complex "[0:v][1:v] interleave" out.avi
21284 </pre></td></tr></table>
21287 Add flickering blur effect:
21288 <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
21289 </pre></td></tr></table>
21292 <a name="perms_002c-aperms"></a>
21293 <h2 class="section"><a href="ffplay-all.html#toc-perms_002c-aperms">36.5 perms, aperms</a></h2>
21295 <p>Set read/write permissions for the output frames.
21297 <p>These filters are mainly aimed at developers to test direct path in the
21298 following filter in the filtergraph.
21300 <p>The filters accept the following options:
21302 <dl compact="compact">
21303 <dt> ‘<samp>mode</samp>’</dt>
21304 <dd><p>Select the permissions mode.
21306 <p>It accepts the following values:
21307 </p><dl compact="compact">
21308 <dt> ‘<samp>none</samp>’</dt>
21309 <dd><p>Do nothing. This is the default.
21311 <dt> ‘<samp>ro</samp>’</dt>
21312 <dd><p>Set all the output frames read-only.
21314 <dt> ‘<samp>rw</samp>’</dt>
21315 <dd><p>Set all the output frames directly writable.
21317 <dt> ‘<samp>toggle</samp>’</dt>
21318 <dd><p>Make the frame read-only if writable, and writable if read-only.
21320 <dt> ‘<samp>random</samp>’</dt>
21321 <dd><p>Set each output frame read-only or writable randomly.
21326 <dt> ‘<samp>seed</samp>’</dt>
21327 <dd><p>Set the seed for the <var>random</var> mode, must be an integer included between
21328 <code>0</code> and <code>UINT32_MAX</code>. If not specified, or if explicitly set to
21329 <code>-1</code>, the filter will try to use a good random seed on a best effort
21334 <p>Note: in case of auto-inserted filter between the permission filter and the
21335 following one, the permission might not be received as expected in that
21336 following filter. Inserting a <a href="#format">format</a> or <a href="#aformat">aformat</a> filter before the
21337 perms/aperms filter can avoid this problem.
21339 <a name="select_002c-aselect"></a>
21340 <h2 class="section"><a href="ffplay-all.html#toc-select_002c-aselect">36.6 select, aselect</a></h2>
21342 <p>Select frames to pass in output.
21344 <p>This filter accepts the following options:
21346 <dl compact="compact">
21347 <dt> ‘<samp>expr, e</samp>’</dt>
21348 <dd><p>Set expression, which is evaluated for each input frame.
21350 <p>If the expression is evaluated to zero, the frame is discarded.
21352 <p>If the evaluation result is negative or NaN, the frame is sent to the
21353 first output; otherwise it is sent to the output with index
21354 <code>ceil(val)-1</code>, assuming that the input index starts from 0.
21356 <p>For example a value of <code>1.2</code> corresponds to the output with index
21357 <code>ceil(1.2)-1 = 2-1 = 1</code>, that is the second output.
21360 <dt> ‘<samp>outputs, n</samp>’</dt>
21361 <dd><p>Set the number of outputs. The output to which to send the selected
21362 frame is based on the result of the evaluation. Default value is 1.
21366 <p>The expression can contain the following constants:
21368 <dl compact="compact">
21369 <dt> ‘<samp>n</samp>’</dt>
21370 <dd><p>the sequential number of the filtered frame, starting from 0
21373 <dt> ‘<samp>selected_n</samp>’</dt>
21374 <dd><p>the sequential number of the selected frame, starting from 0
21377 <dt> ‘<samp>prev_selected_n</samp>’</dt>
21378 <dd><p>the sequential number of the last selected frame, NAN if undefined
21381 <dt> ‘<samp>TB</samp>’</dt>
21382 <dd><p>timebase of the input timestamps
21385 <dt> ‘<samp>pts</samp>’</dt>
21386 <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
21387 expressed in <var>TB</var> units, NAN if undefined
21390 <dt> ‘<samp>t</samp>’</dt>
21391 <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
21392 expressed in seconds, NAN if undefined
21395 <dt> ‘<samp>prev_pts</samp>’</dt>
21396 <dd><p>the PTS of the previously filtered video frame, NAN if undefined
21399 <dt> ‘<samp>prev_selected_pts</samp>’</dt>
21400 <dd><p>the PTS of the last previously filtered video frame, NAN if undefined
21403 <dt> ‘<samp>prev_selected_t</samp>’</dt>
21404 <dd><p>the PTS of the last previously selected video frame, NAN if undefined
21407 <dt> ‘<samp>start_pts</samp>’</dt>
21408 <dd><p>the PTS of the first video frame in the video, NAN if undefined
21411 <dt> ‘<samp>start_t</samp>’</dt>
21412 <dd><p>the time of the first video frame in the video, NAN if undefined
21415 <dt> ‘<samp>pict_type <em>(video only)</em></samp>’</dt>
21416 <dd><p>the type of the filtered frame, can assume one of the following
21418 </p><dl compact="compact">
21419 <dt> ‘<samp>I</samp>’</dt>
21420 <dt> ‘<samp>P</samp>’</dt>
21421 <dt> ‘<samp>B</samp>’</dt>
21422 <dt> ‘<samp>S</samp>’</dt>
21423 <dt> ‘<samp>SI</samp>’</dt>
21424 <dt> ‘<samp>SP</samp>’</dt>
21425 <dt> ‘<samp>BI</samp>’</dt>
21429 <dt> ‘<samp>interlace_type <em>(video only)</em></samp>’</dt>
21430 <dd><p>the frame interlace type, can assume one of the following values:
21431 </p><dl compact="compact">
21432 <dt> ‘<samp>PROGRESSIVE</samp>’</dt>
21433 <dd><p>the frame is progressive (not interlaced)
21435 <dt> ‘<samp>TOPFIRST</samp>’</dt>
21436 <dd><p>the frame is top-field-first
21438 <dt> ‘<samp>BOTTOMFIRST</samp>’</dt>
21439 <dd><p>the frame is bottom-field-first
21444 <dt> ‘<samp>consumed_sample_n <em>(audio only)</em></samp>’</dt>
21445 <dd><p>the number of selected samples before the current frame
21448 <dt> ‘<samp>samples_n <em>(audio only)</em></samp>’</dt>
21449 <dd><p>the number of samples in the current frame
21452 <dt> ‘<samp>sample_rate <em>(audio only)</em></samp>’</dt>
21453 <dd><p>the input sample rate
21456 <dt> ‘<samp>key</samp>’</dt>
21457 <dd><p>1 if the filtered frame is a key-frame, 0 otherwise
21460 <dt> ‘<samp>pos</samp>’</dt>
21461 <dd><p>the position in the file of the filtered frame, -1 if the information
21462 is not available (e.g. for synthetic video)
21465 <dt> ‘<samp>scene <em>(video only)</em></samp>’</dt>
21466 <dd><p>value between 0 and 1 to indicate a new scene; a low value reflects a low
21467 probability for the current frame to introduce a new scene, while a higher
21468 value means the current frame is more likely to be one (see the example below)
21473 <p>The default value of the select expression is "1".
21475 <a name="Examples-76"></a>
21476 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-76">36.6.1 Examples</a></h3>
21480 Select all frames in input:
21481 <table><tr><td> </td><td><pre class="example">select
21482 </pre></td></tr></table>
21484 <p>The example above is the same as:
21485 </p><table><tr><td> </td><td><pre class="example">select=1
21486 </pre></td></tr></table>
21490 <table><tr><td> </td><td><pre class="example">select=0
21491 </pre></td></tr></table>
21494 Select only I-frames:
21495 <table><tr><td> </td><td><pre class="example">select='eq(pict_type\,I)'
21496 </pre></td></tr></table>
21499 Select one frame every 100:
21500 <table><tr><td> </td><td><pre class="example">select='not(mod(n\,100))'
21501 </pre></td></tr></table>
21504 Select only frames contained in the 10-20 time interval:
21505 <table><tr><td> </td><td><pre class="example">select=between(t\,10\,20)
21506 </pre></td></tr></table>
21509 Select only I frames contained in the 10-20 time interval:
21510 <table><tr><td> </td><td><pre class="example">select=between(t\,10\,20)*eq(pict_type\,I)
21511 </pre></td></tr></table>
21514 Select frames with a minimum distance of 10 seconds:
21515 <table><tr><td> </td><td><pre class="example">select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
21516 </pre></td></tr></table>
21519 Use aselect to select only audio frames with samples number > 100:
21520 <table><tr><td> </td><td><pre class="example">aselect='gt(samples_n\,100)'
21521 </pre></td></tr></table>
21524 Create a mosaic of the first scenes:
21525 <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
21526 </pre></td></tr></table>
21528 <p>Comparing <var>scene</var> against a value between 0.3 and 0.5 is generally a sane
21532 Send even and odd frames to separate outputs, and compose them:
21533 <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
21534 </pre></td></tr></table>
21537 <a name="sendcmd_002c-asendcmd"></a>
21538 <h2 class="section"><a href="ffplay-all.html#toc-sendcmd_002c-asendcmd">36.7 sendcmd, asendcmd</a></h2>
21540 <p>Send commands to filters in the filtergraph.
21542 <p>These filters read commands to be sent to other filters in the
21545 <p><code>sendcmd</code> must be inserted between two video filters,
21546 <code>asendcmd</code> must be inserted between two audio filters, but apart
21547 from that they act the same way.
21549 <p>The specification of commands can be provided in the filter arguments
21550 with the <var>commands</var> option, or in a file specified by the
21551 <var>filename</var> option.
21553 <p>These filters accept the following options:
21554 </p><dl compact="compact">
21555 <dt> ‘<samp>commands, c</samp>’</dt>
21556 <dd><p>Set the commands to be read and sent to the other filters.
21558 <dt> ‘<samp>filename, f</samp>’</dt>
21559 <dd><p>Set the filename of the commands to be read and sent to the other
21564 <a name="Commands-syntax"></a>
21565 <h3 class="subsection"><a href="ffplay-all.html#toc-Commands-syntax">36.7.1 Commands syntax</a></h3>
21567 <p>A commands description consists of a sequence of interval
21568 specifications, comprising a list of commands to be executed when a
21569 particular event related to that interval occurs. The occurring event
21570 is typically the current frame time entering or leaving a given time
21573 <p>An interval is specified by the following syntax:
21574 </p><table><tr><td> </td><td><pre class="example"><var>START</var>[-<var>END</var>] <var>COMMANDS</var>;
21575 </pre></td></tr></table>
21577 <p>The time interval is specified by the <var>START</var> and <var>END</var> times.
21578 <var>END</var> is optional and defaults to the maximum time.
21580 <p>The current frame time is considered within the specified interval if
21581 it is included in the interval [<var>START</var>, <var>END</var>), that is when
21582 the time is greater or equal to <var>START</var> and is lesser than
21585 <p><var>COMMANDS</var> consists of a sequence of one or more command
21586 specifications, separated by ",", relating to that interval. The
21587 syntax of a command specification is given by:
21588 </p><table><tr><td> </td><td><pre class="example">[<var>FLAGS</var>] <var>TARGET</var> <var>COMMAND</var> <var>ARG</var>
21589 </pre></td></tr></table>
21591 <p><var>FLAGS</var> is optional and specifies the type of events relating to
21592 the time interval which enable sending the specified command, and must
21593 be a non-null sequence of identifier flags separated by "+" or "|" and
21594 enclosed between "[" and "]".
21596 <p>The following flags are recognized:
21597 </p><dl compact="compact">
21598 <dt> ‘<samp>enter</samp>’</dt>
21599 <dd><p>The command is sent when the current frame timestamp enters the
21600 specified interval. In other words, the command is sent when the
21601 previous frame timestamp was not in the given interval, and the
21605 <dt> ‘<samp>leave</samp>’</dt>
21606 <dd><p>The command is sent when the current frame timestamp leaves the
21607 specified interval. In other words, the command is sent when the
21608 previous frame timestamp was in the given interval, and the
21613 <p>If <var>FLAGS</var> is not specified, a default value of <code>[enter]</code> is
21616 <p><var>TARGET</var> specifies the target of the command, usually the name of
21617 the filter class or a specific filter instance name.
21619 <p><var>COMMAND</var> specifies the name of the command for the target filter.
21621 <p><var>ARG</var> is optional and specifies the optional list of argument for
21622 the given <var>COMMAND</var>.
21624 <p>Between one interval specification and another, whitespaces, or
21625 sequences of characters starting with <code>#</code> until the end of line,
21626 are ignored and can be used to annotate comments.
21628 <p>A simplified BNF description of the commands specification syntax
21630 </p><table><tr><td> </td><td><pre class="example"><var>COMMAND_FLAG</var> ::= "enter" | "leave"
21631 <var>COMMAND_FLAGS</var> ::= <var>COMMAND_FLAG</var> [(+|"|")<var>COMMAND_FLAG</var>]
21632 <var>COMMAND</var> ::= ["[" <var>COMMAND_FLAGS</var> "]"] <var>TARGET</var> <var>COMMAND</var> [<var>ARG</var>]
21633 <var>COMMANDS</var> ::= <var>COMMAND</var> [,<var>COMMANDS</var>]
21634 <var>INTERVAL</var> ::= <var>START</var>[-<var>END</var>] <var>COMMANDS</var>
21635 <var>INTERVALS</var> ::= <var>INTERVAL</var>[;<var>INTERVALS</var>]
21636 </pre></td></tr></table>
21638 <a name="Examples-39"></a>
21639 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-39">36.7.2 Examples</a></h3>
21643 Specify audio tempo change at second 4:
21644 <table><tr><td> </td><td><pre class="example">asendcmd=c='4.0 atempo tempo 1.5',atempo
21645 </pre></td></tr></table>
21648 Specify a list of drawtext and hue commands in a file.
21649 <table><tr><td> </td><td><pre class="example"># show text in the interval 5-10
21650 5.0-10.0 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=hello world',
21651 [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=';
21653 # desaturate the image in the interval 15-20
21654 15.0-20.0 [enter] hue s 0,
21655 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=nocolor',
21657 [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color';
21659 # apply an exponential saturation fade-out effect, starting from time 25
21660 25 [enter] hue s exp(25-t)
21661 </pre></td></tr></table>
21663 <p>A filtergraph allowing to read and process the above command list
21664 stored in a file ‘<tt>test.cmd</tt>’, can be specified with:
21665 </p><table><tr><td> </td><td><pre class="example">sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue
21666 </pre></td></tr></table>
21669 <p><a name="setpts"></a>
21670 </p><a name="setpts_002c-asetpts"></a>
21671 <h2 class="section"><a href="ffplay-all.html#toc-setpts_002c-asetpts">36.8 setpts, asetpts</a></h2>
21673 <p>Change the PTS (presentation timestamp) of the input frames.
21675 <p><code>setpts</code> works on video frames, <code>asetpts</code> on audio frames.
21677 <p>This filter accepts the following options:
21679 <dl compact="compact">
21680 <dt> ‘<samp>expr</samp>’</dt>
21681 <dd><p>The expression which is evaluated for each frame to construct its timestamp.
21686 <p>The expression is evaluated through the eval API and can contain the following
21689 <dl compact="compact">
21690 <dt> ‘<samp>FRAME_RATE</samp>’</dt>
21691 <dd><p>frame rate, only defined for constant frame-rate video
21694 <dt> ‘<samp>PTS</samp>’</dt>
21695 <dd><p>the presentation timestamp in input
21698 <dt> ‘<samp>N</samp>’</dt>
21699 <dd><p>the count of the input frame for video or the number of consumed samples,
21700 not including the current frame for audio, starting from 0.
21703 <dt> ‘<samp>NB_CONSUMED_SAMPLES</samp>’</dt>
21704 <dd><p>the number of consumed samples, not including the current frame (only
21708 <dt> ‘<samp>NB_SAMPLES, S</samp>’</dt>
21709 <dd><p>the number of samples in the current frame (only audio)
21712 <dt> ‘<samp>SAMPLE_RATE, SR</samp>’</dt>
21713 <dd><p>audio sample rate
21716 <dt> ‘<samp>STARTPTS</samp>’</dt>
21717 <dd><p>the PTS of the first frame
21720 <dt> ‘<samp>STARTT</samp>’</dt>
21721 <dd><p>the time in seconds of the first frame
21724 <dt> ‘<samp>INTERLACED</samp>’</dt>
21725 <dd><p>tell if the current frame is interlaced
21728 <dt> ‘<samp>T</samp>’</dt>
21729 <dd><p>the time in seconds of the current frame
21732 <dt> ‘<samp>POS</samp>’</dt>
21733 <dd><p>original position in the file of the frame, or undefined if undefined
21734 for the current frame
21737 <dt> ‘<samp>PREV_INPTS</samp>’</dt>
21738 <dd><p>previous input PTS
21741 <dt> ‘<samp>PREV_INT</samp>’</dt>
21742 <dd><p>previous input time in seconds
21745 <dt> ‘<samp>PREV_OUTPTS</samp>’</dt>
21746 <dd><p>previous output PTS
21749 <dt> ‘<samp>PREV_OUTT</samp>’</dt>
21750 <dd><p>previous output time in seconds
21753 <dt> ‘<samp>RTCTIME</samp>’</dt>
21754 <dd><p>wallclock (RTC) time in microseconds. This is deprecated, use time(0)
21758 <dt> ‘<samp>RTCSTART</samp>’</dt>
21759 <dd><p>wallclock (RTC) time at the start of the movie in microseconds
21762 <dt> ‘<samp>TB</samp>’</dt>
21763 <dd><p>timebase of the input timestamps
21768 <a name="Examples-42"></a>
21769 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-42">36.8.1 Examples</a></h3>
21773 Start counting PTS from zero
21774 <table><tr><td> </td><td><pre class="example">setpts=PTS-STARTPTS
21775 </pre></td></tr></table>
21778 Apply fast motion effect:
21779 <table><tr><td> </td><td><pre class="example">setpts=0.5*PTS
21780 </pre></td></tr></table>
21783 Apply slow motion effect:
21784 <table><tr><td> </td><td><pre class="example">setpts=2.0*PTS
21785 </pre></td></tr></table>
21788 Set fixed rate of 25 frames per second:
21789 <table><tr><td> </td><td><pre class="example">setpts=N/(25*TB)
21790 </pre></td></tr></table>
21793 Set fixed rate 25 fps with some jitter:
21794 <table><tr><td> </td><td><pre class="example">setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
21795 </pre></td></tr></table>
21798 Apply an offset of 10 seconds to the input PTS:
21799 <table><tr><td> </td><td><pre class="example">setpts=PTS+10/TB
21800 </pre></td></tr></table>
21803 Generate timestamps from a "live source" and rebase onto the current timebase:
21804 <table><tr><td> </td><td><pre class="example">setpts='(RTCTIME - RTCSTART) / (TB * 1000000)'
21805 </pre></td></tr></table>
21808 Generate timestamps by counting samples:
21809 <table><tr><td> </td><td><pre class="example">asetpts=N/SR/TB
21810 </pre></td></tr></table>
21814 <a name="settb_002c-asettb"></a>
21815 <h2 class="section"><a href="ffplay-all.html#toc-settb_002c-asettb">36.9 settb, asettb</a></h2>
21817 <p>Set the timebase to use for the output frames timestamps.
21818 It is mainly useful for testing timebase configuration.
21820 <p>This filter accepts the following options:
21822 <dl compact="compact">
21823 <dt> ‘<samp>expr, tb</samp>’</dt>
21824 <dd><p>The expression which is evaluated into the output timebase.
21829 <p>The value for ‘<samp>tb</samp>’ is an arithmetic expression representing a
21830 rational. The expression can contain the constants "AVTB" (the default
21831 timebase), "intb" (the input timebase) and "sr" (the sample rate,
21832 audio only). Default value is "intb".
21834 <a name="Examples-68"></a>
21835 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-68">36.9.1 Examples</a></h3>
21839 Set the timebase to 1/25:
21840 <table><tr><td> </td><td><pre class="example">settb=expr=1/25
21841 </pre></td></tr></table>
21844 Set the timebase to 1/10:
21845 <table><tr><td> </td><td><pre class="example">settb=expr=0.1
21846 </pre></td></tr></table>
21849 Set the timebase to 1001/1000:
21850 <table><tr><td> </td><td><pre class="example">settb=1+0.001
21851 </pre></td></tr></table>
21854 Set the timebase to 2*intb:
21855 <table><tr><td> </td><td><pre class="example">settb=2*intb
21856 </pre></td></tr></table>
21859 Set the default timebase value:
21860 <table><tr><td> </td><td><pre class="example">settb=AVTB
21861 </pre></td></tr></table>
21864 <a name="showspectrum"></a>
21865 <h2 class="section"><a href="ffplay-all.html#toc-showspectrum">36.10 showspectrum</a></h2>
21867 <p>Convert input audio to a video output, representing the audio frequency
21870 <p>The filter accepts the following options:
21872 <dl compact="compact">
21873 <dt> ‘<samp>size, s</samp>’</dt>
21874 <dd><p>Specify the video size for the output. For the syntax of this option, check
21875 the "Video size" section in the ffmpeg-utils manual. Default value is
21876 <code>640x512</code>.
21879 <dt> ‘<samp>slide</samp>’</dt>
21880 <dd><p>Specify if the spectrum should slide along the window. Default value is
21884 <dt> ‘<samp>mode</samp>’</dt>
21885 <dd><p>Specify display mode.
21887 <p>It accepts the following values:
21888 </p><dl compact="compact">
21889 <dt> ‘<samp>combined</samp>’</dt>
21890 <dd><p>all channels are displayed in the same row
21892 <dt> ‘<samp>separate</samp>’</dt>
21893 <dd><p>all channels are displayed in separate rows
21897 <p>Default value is ‘<samp>combined</samp>’.
21900 <dt> ‘<samp>color</samp>’</dt>
21901 <dd><p>Specify display color mode.
21903 <p>It accepts the following values:
21904 </p><dl compact="compact">
21905 <dt> ‘<samp>channel</samp>’</dt>
21906 <dd><p>each channel is displayed in a separate color
21908 <dt> ‘<samp>intensity</samp>’</dt>
21909 <dd><p>each channel is is displayed using the same color scheme
21913 <p>Default value is ‘<samp>channel</samp>’.
21916 <dt> ‘<samp>scale</samp>’</dt>
21917 <dd><p>Specify scale used for calculating intensity color values.
21919 <p>It accepts the following values:
21920 </p><dl compact="compact">
21921 <dt> ‘<samp>lin</samp>’</dt>
21924 <dt> ‘<samp>sqrt</samp>’</dt>
21925 <dd><p>square root, default
21927 <dt> ‘<samp>cbrt</samp>’</dt>
21930 <dt> ‘<samp>log</samp>’</dt>
21935 <p>Default value is ‘<samp>sqrt</samp>’.
21938 <dt> ‘<samp>saturation</samp>’</dt>
21939 <dd><p>Set saturation modifier for displayed colors. Negative values provide
21940 alternative color scheme. <code>0</code> is no saturation at all.
21941 Saturation must be in [-10.0, 10.0] range.
21942 Default value is <code>1</code>.
21945 <dt> ‘<samp>win_func</samp>’</dt>
21946 <dd><p>Set window function.
21948 <p>It accepts the following values:
21949 </p><dl compact="compact">
21950 <dt> ‘<samp>none</samp>’</dt>
21951 <dd><p>No samples pre-processing (do not expect this to be faster)
21953 <dt> ‘<samp>hann</samp>’</dt>
21956 <dt> ‘<samp>hamming</samp>’</dt>
21957 <dd><p>Hamming window
21959 <dt> ‘<samp>blackman</samp>’</dt>
21960 <dd><p>Blackman window
21964 <p>Default value is <code>hann</code>.
21968 <p>The usage is very similar to the showwaves filter; see the examples in that
21971 <a name="Examples-2"></a>
21972 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-2">36.10.1 Examples</a></h3>
21976 Large window with logarithmic color scaling:
21977 <table><tr><td> </td><td><pre class="example">showspectrum=s=1280x480:scale=log
21978 </pre></td></tr></table>
21981 Complete example for a colored and sliding spectrum per channel using <code>ffplay</code>:
21982 <table><tr><td> </td><td><pre class="example">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
21983 [a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]'
21984 </pre></td></tr></table>
21987 <a name="showwaves"></a>
21988 <h2 class="section"><a href="ffplay-all.html#toc-showwaves">36.11 showwaves</a></h2>
21990 <p>Convert input audio to a video output, representing the samples waves.
21992 <p>The filter accepts the following options:
21994 <dl compact="compact">
21995 <dt> ‘<samp>size, s</samp>’</dt>
21996 <dd><p>Specify the video size for the output. For the syntax of this option, check
21997 the "Video size" section in the ffmpeg-utils manual. Default value
21998 is "600x240".
22001 <dt> ‘<samp>mode</samp>’</dt>
22002 <dd><p>Set display mode.
22004 <p>Available values are:
22005 </p><dl compact="compact">
22006 <dt> ‘<samp>point</samp>’</dt>
22007 <dd><p>Draw a point for each sample.
22010 <dt> ‘<samp>line</samp>’</dt>
22011 <dd><p>Draw a vertical line for each sample.
22015 <p>Default value is <code>point</code>.
22018 <dt> ‘<samp>n</samp>’</dt>
22019 <dd><p>Set the number of samples which are printed on the same column. A
22020 larger value will decrease the frame rate. Must be a positive
22021 integer. This option can be set only if the value for <var>rate</var>
22022 is not explicitly specified.
22025 <dt> ‘<samp>rate, r</samp>’</dt>
22026 <dd><p>Set the (approximate) output frame rate. This is done by setting the
22027 option <var>n</var>. Default value is "25".
22032 <a name="Examples-90"></a>
22033 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-90">36.11.1 Examples</a></h3>
22037 Output the input file audio and the corresponding video representation
22039 <table><tr><td> </td><td><pre class="example">amovie=a.mp3,asplit[out0],showwaves[out1]
22040 </pre></td></tr></table>
22043 Create a synthetic signal and show it with showwaves, forcing a
22044 frame rate of 30 frames per second:
22045 <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]
22046 </pre></td></tr></table>
22049 <a name="split_002c-asplit"></a>
22050 <h2 class="section"><a href="ffplay-all.html#toc-split_002c-asplit">36.12 split, asplit</a></h2>
22052 <p>Split input into several identical outputs.
22054 <p><code>asplit</code> works with audio input, <code>split</code> with video.
22056 <p>The filter accepts a single parameter which specifies the number of outputs. If
22057 unspecified, it defaults to 2.
22059 <a name="Examples-83"></a>
22060 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-83">36.12.1 Examples</a></h3>
22064 Create two separate outputs from the same input:
22065 <table><tr><td> </td><td><pre class="example">[in] split [out0][out1]
22066 </pre></td></tr></table>
22069 To create 3 or more outputs, you need to specify the number of
22071 <table><tr><td> </td><td><pre class="example">[in] asplit=3 [out0][out1][out2]
22072 </pre></td></tr></table>
22075 Create two separate outputs from the same input, one cropped and
22077 <table><tr><td> </td><td><pre class="example">[in] split [splitout1][splitout2];
22078 [splitout1] crop=100:100:0:0 [cropout];
22079 [splitout2] pad=200:200:100:100 [padout];
22080 </pre></td></tr></table>
22083 Create 5 copies of the input audio with <code>ffmpeg</code>:
22084 <table><tr><td> </td><td><pre class="example">ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT
22085 </pre></td></tr></table>
22088 <a name="zmq_002c-azmq"></a>
22089 <h2 class="section"><a href="ffplay-all.html#toc-zmq_002c-azmq">36.13 zmq, azmq</a></h2>
22091 <p>Receive commands sent through a libzmq client, and forward them to
22092 filters in the filtergraph.
22094 <p><code>zmq</code> and <code>azmq</code> work as a pass-through filters. <code>zmq</code>
22095 must be inserted between two video filters, <code>azmq</code> between two
22098 <p>To enable these filters you need to install the libzmq library and
22099 headers and configure FFmpeg with <code>--enable-libzmq</code>.
22101 <p>For more information about libzmq see:
22102 <a href="http://www.zeromq.org/">http://www.zeromq.org/</a>
22104 <p>The <code>zmq</code> and <code>azmq</code> filters work as a libzmq server, which
22105 receives messages sent through a network interface defined by the
22106 ‘<samp>bind_address</samp>’ option.
22108 <p>The received message must be in the form:
22109 </p><table><tr><td> </td><td><pre class="example"><var>TARGET</var> <var>COMMAND</var> [<var>ARG</var>]
22110 </pre></td></tr></table>
22112 <p><var>TARGET</var> specifies the target of the command, usually the name of
22113 the filter class or a specific filter instance name.
22115 <p><var>COMMAND</var> specifies the name of the command for the target filter.
22117 <p><var>ARG</var> is optional and specifies the optional argument list for the
22118 given <var>COMMAND</var>.
22120 <p>Upon reception, the message is processed and the corresponding command
22121 is injected into the filtergraph. Depending on the result, the filter
22122 will send a reply to the client, adopting the format:
22123 </p><table><tr><td> </td><td><pre class="example"><var>ERROR_CODE</var> <var>ERROR_REASON</var>
22125 </pre></td></tr></table>
22127 <p><var>MESSAGE</var> is optional.
22129 <a name="Examples-29"></a>
22130 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-29">36.13.1 Examples</a></h3>
22132 <p>Look at ‘<tt>tools/zmqsend</tt>’ for an example of a zmq client which can
22133 be used to send commands processed by these filters.
22135 <p>Consider the following filtergraph generated by <code>ffplay</code>
22136 </p><table><tr><td> </td><td><pre class="example">ffplay -dumpgraph 1 -f lavfi "
22137 color=s=100x100:c=red [l];
22138 color=s=100x100:c=blue [r];
22139 nullsrc=s=200x100, zmq [bg];
22140 [bg][l] overlay [bg+l];
22141 [bg+l][r] overlay=x=100 "
22142 </pre></td></tr></table>
22144 <p>To change the color of the left side of the video, the following
22145 command can be used:
22146 </p><table><tr><td> </td><td><pre class="example">echo Parsed_color_0 c yellow | tools/zmqsend
22147 </pre></td></tr></table>
22149 <p>To change the right side:
22150 </p><table><tr><td> </td><td><pre class="example">echo Parsed_color_1 c pink | tools/zmqsend
22151 </pre></td></tr></table>
22154 <a name="Multimedia-Sources"></a>
22155 <h1 class="chapter"><a href="ffplay-all.html#toc-Multimedia-Sources">37. Multimedia Sources</a></h1>
22157 <p>Below is a description of the currently available multimedia sources.
22159 <a name="amovie"></a>
22160 <h2 class="section"><a href="ffplay-all.html#toc-amovie">37.1 amovie</a></h2>
22162 <p>This is the same as <a href="#movie">movie</a> source, except it selects an audio
22165 <p><a name="movie"></a>
22166 </p><a name="movie-1"></a>
22167 <h2 class="section"><a href="ffplay-all.html#toc-movie-1">37.2 movie</a></h2>
22169 <p>Read audio and/or video stream(s) from a movie container.
22171 <p>This filter accepts the following options:
22173 <dl compact="compact">
22174 <dt> ‘<samp>filename</samp>’</dt>
22175 <dd><p>The name of the resource to read (not necessarily a file but also a device or a
22176 stream accessed through some protocol).
22179 <dt> ‘<samp>format_name, f</samp>’</dt>
22180 <dd><p>Specifies the format assumed for the movie to read, and can be either
22181 the name of a container or an input device. If not specified the
22182 format is guessed from <var>movie_name</var> or by probing.
22185 <dt> ‘<samp>seek_point, sp</samp>’</dt>
22186 <dd><p>Specifies the seek point in seconds, the frames will be output
22187 starting from this seek point, the parameter is evaluated with
22188 <code>av_strtod</code> so the numerical value may be suffixed by an IS
22189 postfix. Default value is "0".
22192 <dt> ‘<samp>streams, s</samp>’</dt>
22193 <dd><p>Specifies the streams to read. Several streams can be specified,
22194 separated by "+". The source will then have as many outputs, in the
22195 same order. The syntax is explained in the “Stream specifiers”
22196 section in the ffmpeg manual. Two special names, "dv" and "da" specify
22197 respectively the default (best suited) video and audio stream. Default
22198 is "dv", or "da" if the filter is called as "amovie".
22201 <dt> ‘<samp>stream_index, si</samp>’</dt>
22202 <dd><p>Specifies the index of the video stream to read. If the value is -1,
22203 the best suited video stream will be automatically selected. Default
22204 value is "-1". Deprecated. If the filter is called "amovie", it will select
22205 audio instead of video.
22208 <dt> ‘<samp>loop</samp>’</dt>
22209 <dd><p>Specifies how many times to read the stream in sequence.
22210 If the value is less than 1, the stream will be read again and again.
22211 Default value is "1".
22213 <p>Note that when the movie is looped the source timestamps are not
22214 changed, so it will generate non monotonically increasing timestamps.
22218 <p>This filter allows to overlay a second video on top of main input of
22219 a filtergraph as shown in this graph:
22220 </p><table><tr><td> </td><td><pre class="example">input -----------> deltapts0 --> overlay --> output
22223 movie --> scale--> deltapts1 -------+
22224 </pre></td></tr></table>
22226 <a name="Examples-69"></a>
22227 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-69">37.2.1 Examples</a></h3>
22231 Skip 3.2 seconds from the start of the avi file in.avi, and overlay it
22232 on top of the input labelled as "in":
22233 <table><tr><td> </td><td><pre class="example">movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [over];
22234 [in] setpts=PTS-STARTPTS [main];
22235 [main][over] overlay=16:16 [out]
22236 </pre></td></tr></table>
22239 Read from a video4linux2 device, and overlay it on top of the input
22240 labelled as "in":
22241 <table><tr><td> </td><td><pre class="example">movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [over];
22242 [in] setpts=PTS-STARTPTS [main];
22243 [main][over] overlay=16:16 [out]
22244 </pre></td></tr></table>
22247 Read the first video stream and the audio stream with id 0x81 from
22248 dvd.vob; the video is connected to the pad named "video" and the audio is
22249 connected to the pad named "audio":
22250 <table><tr><td> </td><td><pre class="example">movie=dvd.vob:s=v:0+#0x81 [video] [audio]
22251 </pre></td></tr></table>
22255 <a name="See-Also"></a>
22256 <h1 class="chapter"><a href="ffplay-all.html#toc-See-Also">38. See Also</a></h1>
22258 <p><a href="ffplay.html">ffplay</a>,
22259 <a href="ffmpeg.html">ffmpeg</a>, <a href="ffprobe.html">ffprobe</a>, <a href="ffserver.html">ffserver</a>,
22260 <a href="ffmpeg-utils.html">ffmpeg-utils</a>,
22261 <a href="ffmpeg-scaler.html">ffmpeg-scaler</a>,
22262 <a href="ffmpeg-resampler.html">ffmpeg-resampler</a>,
22263 <a href="ffmpeg-codecs.html">ffmpeg-codecs</a>,
22264 <a href="ffmpeg-bitstream-filters.html">ffmpeg-bitstream-filters</a>,
22265 <a href="ffmpeg-formats.html">ffmpeg-formats</a>,
22266 <a href="ffmpeg-devices.html">ffmpeg-devices</a>,
22267 <a href="ffmpeg-protocols.html">ffmpeg-protocols</a>,
22268 <a href="ffmpeg-filters.html">ffmpeg-filters</a>
22271 <a name="Authors"></a>
22272 <h1 class="chapter"><a href="ffplay-all.html#toc-Authors">39. Authors</a></h1>
22274 <p>The FFmpeg developers.
22276 <p>For details about the authorship, see the Git history of the project
22277 (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
22278 <code>git log</code> in the FFmpeg source directory, or browsing the
22279 online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
22281 <p>Maintainers for the specific components are listed in the file
22282 ‘<tt>MAINTAINERS</tt>’ in the source code tree.
22285 <footer class="footer pagination-right">
22286 <span class="label label-info">This document was generated by <em>Kyle Schwarz</em> on <em>December 14, 2013</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.</span></footer></div></div></body>