]> git.sesse.net Git - casparcg/blob - dependencies/ffmpeg/doc/ffplay-all.html
Check in complete ffmpeg-20131215-git-ec13849-win32 Zeranoe build with README updates...
[casparcg] / dependencies / ffmpeg / doc / ffplay-all.html
1 <!DOCTYPE html>
2 <html>
3 <!-- Created on December 14, 2013 by texi2html 1.82 -->
4 <!--
5 texi2html was written by: 
6             Lionel Cons <Lionel.Cons@cern.ch> (original author)
7             Karl Berry  <karl@freefriends.org>
8             Olaf Bachmann <obachman@mathematik.uni-kl.de>
9             and many others.
10 Maintained by: Many creative people.
11 Send bugs and suggestions to <texi2html-bug@nongnu.org>
12
13 -->
14 <head>
15 <title>FFmpeg documentation : ffplay </title>
16
17 <meta name="description" content="ffplay Documentation: ">
18 <meta name="keywords" content="FFmpeg documentation : ffplay ">
19 <meta name="Generator" content="texi2html 1.82">
20 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
21 <link rel="stylesheet" type="text/css" href="default.css" />
22
23 <link rel="icon" href="favicon.png" type="image/png" />
24 </head>
25 <body>
26 <div id="container">
27 <div id="body">
28
29 <a name="SEC_Top"></a>
30 <h1 class="settitle">ffplay Documentation</h1>
31
32 <a name="SEC_Contents"></a>
33 <h1>Table of Contents</h1>
34 <div class="contents">
35
36 <ul class="toc">
37   <li><a name="toc-Synopsis" href="#Synopsis">1. Synopsis</a></li>
38   <li><a name="toc-Description" href="#Description">2. Description</a></li>
39   <li><a name="toc-Options-25" href="#Options-25">3. Options</a>
40   <ul class="toc">
41     <li><a name="toc-Stream-specifiers-1" href="#Stream-specifiers-1">3.1 Stream specifiers</a></li>
42     <li><a name="toc-Generic-options" href="#Generic-options">3.2 Generic options</a></li>
43     <li><a name="toc-AVOptions" href="#AVOptions">3.3 AVOptions</a></li>
44     <li><a name="toc-Main-options" href="#Main-options">3.4 Main options</a></li>
45     <li><a name="toc-Advanced-options" href="#Advanced-options">3.5 Advanced options</a></li>
46     <li><a name="toc-While-playing" href="#While-playing">3.6 While playing</a></li>
47   </ul></li>
48   <li><a name="toc-Syntax-2" href="#Syntax-2">4. Syntax</a>
49   <ul class="toc">
50     <li><a name="toc-Quoting-and-escaping" href="#Quoting-and-escaping">4.1 Quoting and escaping</a>
51     <ul class="toc">
52       <li><a name="toc-Examples-13" href="#Examples-13">4.1.1 Examples</a></li>
53     </ul></li>
54     <li><a name="toc-Date" href="#Date">4.2 Date</a></li>
55     <li><a name="toc-Time-duration" href="#Time-duration">4.3 Time duration</a>
56     <ul class="toc">
57       <li><a name="toc-Examples-31" href="#Examples-31">4.3.1 Examples</a></li>
58     </ul></li>
59     <li><a name="toc-Video-size" href="#Video-size">4.4 Video size</a></li>
60     <li><a name="toc-Video-rate" href="#Video-rate">4.5 Video rate</a></li>
61     <li><a name="toc-Ratio" href="#Ratio">4.6 Ratio</a></li>
62     <li><a name="toc-Color" href="#Color">4.7 Color</a></li>
63     <li><a name="toc-Channel-Layout" href="#Channel-Layout">4.8 Channel Layout</a></li>
64   </ul></li>
65   <li><a name="toc-Expression-Evaluation" href="#Expression-Evaluation">5. Expression Evaluation</a></li>
66   <li><a name="toc-OpenCL-Options" href="#OpenCL-Options">6. OpenCL Options</a></li>
67   <li><a name="toc-Codec-Options" href="#Codec-Options">7. Codec Options</a></li>
68   <li><a name="toc-Decoders" href="#Decoders">8. Decoders</a></li>
69   <li><a name="toc-Video-Decoders" href="#Video-Decoders">9. Video Decoders</a>
70   <ul class="toc">
71     <li><a name="toc-rawvideo-1" href="#rawvideo-1">9.1 rawvideo</a>
72     <ul class="toc">
73       <li><a name="toc-Options-9" href="#Options-9">9.1.1 Options</a></li>
74     </ul>
75 </li>
76   </ul></li>
77   <li><a name="toc-Audio-Decoders" href="#Audio-Decoders">10. Audio Decoders</a>
78   <ul class="toc">
79     <li><a name="toc-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>
83     <ul class="toc">
84       <li><a name="toc-Options" href="#Options">10.4.1 Options</a></li>
85     </ul></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>
89   </ul></li>
90   <li><a name="toc-Subtitles-Decoders" href="#Subtitles-Decoders">11. Subtitles Decoders</a>
91   <ul class="toc">
92     <li><a name="toc-dvdsub" href="#dvdsub">11.1 dvdsub</a>
93     <ul class="toc">
94       <li><a name="toc-Options-24" href="#Options-24">11.1.1 Options</a></li>
95     </ul></li>
96     <li><a name="toc-libzvbi_002dteletext" href="#libzvbi_002dteletext">11.2 libzvbi-teletext</a>
97     <ul class="toc">
98       <li><a name="toc-Options-7" href="#Options-7">11.2.1 Options</a></li>
99     </ul>
100 </li>
101   </ul></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>
104   <ul class="toc">
105     <li><a name="toc-aac" href="#aac">13.1 aac</a>
106     <ul class="toc">
107       <li><a name="toc-Options-27" href="#Options-27">13.1.1 Options</a></li>
108     </ul></li>
109     <li><a name="toc-ac3-and-ac3_005ffixed" href="#ac3-and-ac3_005ffixed">13.2 ac3 and ac3_fixed</a>
110     <ul class="toc">
111       <li><a name="toc-AC_002d3-Metadata" href="#AC_002d3-Metadata">13.2.1 AC-3 Metadata</a>
112       <ul class="toc">
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>
117       </ul></li>
118       <li><a name="toc-Extended-Bitstream-Information" href="#Extended-Bitstream-Information">13.2.2 Extended Bitstream Information</a>
119       <ul class="toc">
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>
122       </ul></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>
125     </ul></li>
126     <li><a name="toc-libfaac-1" href="#libfaac-1">13.3 libfaac</a>
127     <ul class="toc">
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>
130     </ul></li>
131     <li><a name="toc-libfdk_005faac" href="#libfdk_005faac">13.4 libfdk_aac</a>
132     <ul class="toc">
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>
135     </ul></li>
136     <li><a name="toc-libmp3lame-1" href="#libmp3lame-1">13.5 libmp3lame</a>
137     <ul class="toc">
138       <li><a name="toc-Options-17" href="#Options-17">13.5.1 Options</a></li>
139     </ul></li>
140     <li><a name="toc-libopencore_002damrnb" href="#libopencore_002damrnb">13.6 libopencore-amrnb</a>
141     <ul class="toc">
142       <li><a name="toc-Options-29" href="#Options-29">13.6.1 Options</a></li>
143     </ul></li>
144     <li><a name="toc-libshine-1" href="#libshine-1">13.7 libshine</a>
145     <ul class="toc">
146       <li><a name="toc-Options-16" href="#Options-16">13.7.1 Options</a></li>
147     </ul></li>
148     <li><a name="toc-libtwolame" href="#libtwolame">13.8 libtwolame</a>
149     <ul class="toc">
150       <li><a name="toc-Options-22" href="#Options-22">13.8.1 Options</a></li>
151     </ul></li>
152     <li><a name="toc-libvo_002daacenc-1" href="#libvo_002daacenc-1">13.9 libvo-aacenc</a>
153     <ul class="toc">
154       <li><a name="toc-Options-11" href="#Options-11">13.9.1 Options</a></li>
155     </ul></li>
156     <li><a name="toc-libvo_002damrwbenc" href="#libvo_002damrwbenc">13.10 libvo-amrwbenc</a>
157     <ul class="toc">
158       <li><a name="toc-Options-23" href="#Options-23">13.10.1 Options</a></li>
159     </ul></li>
160     <li><a name="toc-libopus-1" href="#libopus-1">13.11 libopus</a>
161     <ul class="toc">
162       <li><a name="toc-Option-Mapping" href="#Option-Mapping">13.11.1 Option Mapping</a></li>
163     </ul></li>
164     <li><a name="toc-libvorbis" href="#libvorbis">13.12 libvorbis</a>
165     <ul class="toc">
166       <li><a name="toc-Options-32" href="#Options-32">13.12.1 Options</a></li>
167     </ul></li>
168     <li><a name="toc-libwavpack" href="#libwavpack">13.13 libwavpack</a></li>
169   </ul></li>
170   <li><a name="toc-Video-Encoders" href="#Video-Encoders">14. Video Encoders</a>
171   <ul class="toc">
172     <li><a name="toc-libtheora" href="#libtheora">14.1 libtheora</a>
173     <ul class="toc">
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>
176     </ul></li>
177     <li><a name="toc-libvpx" href="#libvpx">14.2 libvpx</a>
178     <ul class="toc">
179       <li><a name="toc-Options-1" href="#Options-1">14.2.1 Options</a></li>
180     </ul></li>
181     <li><a name="toc-libx264" href="#libx264">14.3 libx264</a>
182     <ul class="toc">
183       <li><a name="toc-Options-10" href="#Options-10">14.3.1 Options</a></li>
184     </ul></li>
185     <li><a name="toc-libxvid" href="#libxvid">14.4 libxvid</a>
186     <ul class="toc">
187       <li><a name="toc-Options-14" href="#Options-14">14.4.1 Options</a></li>
188     </ul></li>
189     <li><a name="toc-png" href="#png">14.5 png</a>
190     <ul class="toc">
191       <li><a name="toc-Private-options" href="#Private-options">14.5.1 Private options</a></li>
192     </ul></li>
193     <li><a name="toc-ProRes" href="#ProRes">14.6 ProRes</a>
194     <ul class="toc">
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>
197     </ul>
198 </li>
199   </ul></li>
200   <li><a name="toc-Bitstream-Filters" href="#Bitstream-Filters">15. Bitstream Filters</a>
201   <ul class="toc">
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>
213   </ul></li>
214   <li><a name="toc-Format-Options" href="#Format-Options">16. Format Options</a>
215   <ul class="toc">
216     <li><a name="toc-Format-stream-specifiers-1" href="#Format-stream-specifiers-1">16.1 Format stream specifiers</a></li>
217   </ul></li>
218   <li><a name="toc-Demuxers" href="#Demuxers">17. Demuxers</a>
219   <ul class="toc">
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>
223     <ul class="toc">
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>
226     </ul></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>
231     <ul class="toc">
232       <li><a name="toc-Examples-88" href="#Examples-88">17.7.1 Examples</a></li>
233     </ul></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>
238   </ul></li>
239   <li><a name="toc-Muxers" href="#Muxers">18. Muxers</a>
240   <ul class="toc">
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>
257     <ul class="toc">
258       <li><a name="toc-Examples-81" href="#Examples-81">18.16.1 Examples</a></li>
259     </ul></li>
260     <li><a name="toc-tee" href="#tee">18.17 tee</a></li>
261   </ul></li>
262   <li><a name="toc-Metadata" href="#Metadata">19. Metadata</a></li>
263   <li><a name="toc-Protocols" href="#Protocols">20. Protocols</a>
264   <ul class="toc">
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>
275     <ul class="toc">
276       <li><a name="toc-HTTP-Cookies" href="#HTTP-Cookies">20.10.1 HTTP Cookies</a></li>
277     </ul></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>
293     <ul class="toc">
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>
296     </ul></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>
303   </ul></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>
306   <ul class="toc">
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>
310     <ul class="toc">
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>
313     </ul></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>
317     <ul class="toc">
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>
320     </ul></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>
323     <ul class="toc">
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>
326     </ul></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>
329     <ul class="toc">
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>
332     </ul></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>
335     <ul class="toc">
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>
338     </ul></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>
341     <ul class="toc">
342       <li><a name="toc-Options-2" href="#Options-2">22.14.1 Options</a></li>
343     </ul></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>
346     <ul class="toc">
347       <li><a name="toc-Options-20" href="#Options-20">22.16.1 Options</a></li>
348     </ul>
349 </li>
350   </ul></li>
351   <li><a name="toc-Output-Devices" href="#Output-Devices">23. Output Devices</a>
352   <ul class="toc">
353     <li><a name="toc-alsa" href="#alsa">23.1 alsa</a>
354     <ul class="toc">
355       <li><a name="toc-Examples-33" href="#Examples-33">23.1.1 Examples</a></li>
356     </ul></li>
357     <li><a name="toc-caca" href="#caca">23.2 caca</a>
358     <ul class="toc">
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>
361     </ul></li>
362     <li><a name="toc-fbdev" href="#fbdev">23.3 fbdev</a>
363     <ul class="toc">
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>
366     </ul></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>
369     <ul class="toc">
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>
372     </ul></li>
373     <li><a name="toc-sdl" href="#sdl">23.6 sdl</a>
374     <ul class="toc">
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>
378     </ul></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>
381     <ul class="toc">
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>
384     </ul>
385 </li>
386   </ul></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>
392   <ul class="toc">
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>
395   </ul></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>
398   <ul class="toc">
399     <li><a name="toc-aconvert" href="#aconvert">30.1 aconvert</a>
400     <ul class="toc">
401       <li><a name="toc-Examples-47" href="#Examples-47">30.1.1 Examples</a></li>
402     </ul></li>
403     <li><a name="toc-adelay" href="#adelay">30.2 adelay</a>
404     <ul class="toc">
405       <li><a name="toc-Examples-41" href="#Examples-41">30.2.1 Examples</a></li>
406     </ul></li>
407     <li><a name="toc-aecho" href="#aecho">30.3 aecho</a>
408     <ul class="toc">
409       <li><a name="toc-Examples-19" href="#Examples-19">30.3.1 Examples</a></li>
410     </ul></li>
411     <li><a name="toc-aeval" href="#aeval">30.4 aeval</a>
412     <ul class="toc">
413       <li><a name="toc-Examples-34" href="#Examples-34">30.4.1 Examples</a></li>
414     </ul></li>
415     <li><a name="toc-afade" href="#afade">30.5 afade</a>
416     <ul class="toc">
417       <li><a name="toc-Examples-24" href="#Examples-24">30.5.1 Examples</a></li>
418     </ul></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>
422     <ul class="toc">
423       <li><a name="toc-Examples-62" href="#Examples-62">30.8.1 Examples</a></li>
424     </ul></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>
430     <ul class="toc">
431       <li><a name="toc-Examples-22" href="#Examples-22">30.13.1 Examples</a></li>
432     </ul></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>
438     <ul class="toc">
439       <li><a name="toc-Examples-46" href="#Examples-46">30.18.1 Examples</a></li>
440     </ul></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>
443     <ul class="toc">
444       <li><a name="toc-Examples-60" href="#Examples-60">30.20.1 Examples</a></li>
445     </ul></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>
454     <ul class="toc">
455       <li><a name="toc-Examples-15" href="#Examples-15">30.28.1 Examples</a></li>
456     </ul></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>
462     <ul class="toc">
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>
465     </ul></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>
468     <ul class="toc">
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>
471     </ul></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>
475     <ul class="toc">
476       <li><a name="toc-Examples-64" href="#Examples-64">30.38.1 Examples</a></li>
477     </ul></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>
480     <ul class="toc">
481       <li><a name="toc-Examples-80" href="#Examples-80">30.40.1 Examples</a></li>
482     </ul></li>
483     <li><a name="toc-volumedetect" href="#volumedetect">30.41 volumedetect</a>
484     <ul class="toc">
485       <li><a name="toc-Examples-55" href="#Examples-55">30.41.1 Examples</a></li>
486     </ul>
487 </li>
488   </ul></li>
489   <li><a name="toc-Audio-Sources" href="#Audio-Sources">31. Audio Sources</a>
490   <ul class="toc">
491     <li><a name="toc-abuffer" href="#abuffer">31.1 abuffer</a>
492     <ul class="toc">
493       <li><a name="toc-Examples-27" href="#Examples-27">31.1.1 Examples</a></li>
494     </ul></li>
495     <li><a name="toc-aevalsrc" href="#aevalsrc">31.2 aevalsrc</a>
496     <ul class="toc">
497       <li><a name="toc-Examples-78" href="#Examples-78">31.2.1 Examples</a></li>
498     </ul></li>
499     <li><a name="toc-anullsrc" href="#anullsrc">31.3 anullsrc</a>
500     <ul class="toc">
501       <li><a name="toc-Examples-84" href="#Examples-84">31.3.1 Examples</a></li>
502     </ul></li>
503     <li><a name="toc-flite" href="#flite">31.4 flite</a>
504     <ul class="toc">
505       <li><a name="toc-Examples-85" href="#Examples-85">31.4.1 Examples</a></li>
506     </ul></li>
507     <li><a name="toc-sine" href="#sine">31.5 sine</a>
508     <ul class="toc">
509       <li><a name="toc-Examples-32" href="#Examples-32">31.5.1 Examples</a></li>
510     </ul>
511 </li>
512   </ul></li>
513   <li><a name="toc-Audio-Sinks" href="#Audio-Sinks">32. Audio Sinks</a>
514   <ul class="toc">
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>
517   </ul></li>
518   <li><a name="toc-Video-Filters" href="#Video-Filters">33. Video Filters</a>
519   <ul class="toc">
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>
527     <ul class="toc">
528       <li><a name="toc-Examples-54" href="#Examples-54">33.7.1 Examples</a></li>
529     </ul></li>
530     <li><a name="toc-boxblur" href="#boxblur">33.8 boxblur</a>
531     <ul class="toc">
532       <li><a name="toc-Examples-4" href="#Examples-4">33.8.1 Examples</a></li>
533     </ul></li>
534     <li><a name="toc-colorbalance" href="#colorbalance">33.9 colorbalance</a>
535     <ul class="toc">
536       <li><a name="toc-Examples-89" href="#Examples-89">33.9.1 Examples</a></li>
537     </ul></li>
538     <li><a name="toc-colorchannelmixer" href="#colorchannelmixer">33.10 colorchannelmixer</a>
539     <ul class="toc">
540       <li><a name="toc-Examples-65" href="#Examples-65">33.10.1 Examples</a></li>
541     </ul></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>
545     <ul class="toc">
546       <li><a name="toc-Examples-8" href="#Examples-8">33.13.1 Examples</a></li>
547     </ul></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>
550     <ul class="toc">
551       <li><a name="toc-Examples-75" href="#Examples-75">33.15.1 Examples</a></li>
552     </ul></li>
553     <li><a name="toc-dctdnoiz" href="#dctdnoiz">33.16 dctdnoiz</a>
554     <ul class="toc">
555       <li><a name="toc-Examples-20" href="#Examples-20">33.16.1 Examples</a></li>
556     </ul></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>
559     <ul class="toc">
560       <li><a name="toc-Examples-44" href="#Examples-44">33.18.1 Examples</a></li>
561     </ul></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>
564     <ul class="toc">
565       <li><a name="toc-Examples-86" href="#Examples-86">33.20.1 Examples</a></li>
566     </ul></li>
567     <li><a name="toc-drawgrid" href="#drawgrid">33.21 drawgrid</a>
568     <ul class="toc">
569       <li><a name="toc-Examples-36" href="#Examples-36">33.21.1 Examples</a></li>
570     </ul></li>
571     <li><a name="toc-drawtext-1" href="#drawtext-1">33.22 drawtext</a>
572     <ul class="toc">
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>
576     </ul></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>
579     <ul class="toc">
580       <li><a name="toc-Examples-70" href="#Examples-70">33.24.1 Examples</a></li>
581     </ul></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>
584     <ul class="toc">
585       <li><a name="toc-Examples-3" href="#Examples-3">33.26.1 Examples</a></li>
586     </ul></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>
589     <ul class="toc">
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>
591       <ul class="toc">
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>
594       </ul></li>
595       <li><a name="toc-Examples-52" href="#Examples-52">33.28.2 Examples</a></li>
596     </ul></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>
600     <ul class="toc">
601       <li><a name="toc-Examples-57" href="#Examples-57">33.31.1 Examples</a></li>
602     </ul></li>
603     <li><a name="toc-fps-1" href="#fps-1">33.32 fps</a>
604     <ul class="toc">
605       <li><a name="toc-Examples-25" href="#Examples-25">33.32.1 Examples</a></li>
606     </ul></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>
609     <ul class="toc">
610       <li><a name="toc-Examples-12" href="#Examples-12">33.34.1 Examples</a></li>
611     </ul></li>
612     <li><a name="toc-geq" href="#geq">33.35 geq</a>
613     <ul class="toc">
614       <li><a name="toc-Examples-79" href="#Examples-79">33.35.1 Examples</a></li>
615     </ul></li>
616     <li><a name="toc-gradfun" href="#gradfun">33.36 gradfun</a>
617     <ul class="toc">
618       <li><a name="toc-Examples-72" href="#Examples-72">33.36.1 Examples</a></li>
619     </ul></li>
620     <li><a name="toc-haldclut-1" href="#haldclut-1">33.37 haldclut</a>
621     <ul class="toc">
622       <li><a name="toc-Workflow-examples" href="#Workflow-examples">33.37.1 Workflow examples</a>
623       <ul class="toc">
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>
626       </ul>
627 </li>
628     </ul></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>
632     <ul class="toc">
633       <li><a name="toc-Examples-16" href="#Examples-16">33.40.1 Examples</a></li>
634     </ul></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>
637     <ul class="toc">
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>
640     </ul></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>
645     <ul class="toc">
646       <li><a name="toc-Examples-50" href="#Examples-50">33.46.1 Examples</a></li>
647     </ul></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>
650     <ul class="toc">
651       <li><a name="toc-Examples-14" href="#Examples-14">33.48.1 Examples</a></li>
652     </ul></li>
653     <li><a name="toc-mergeplanes" href="#mergeplanes">33.49 mergeplanes</a>
654     <ul class="toc">
655       <li><a name="toc-Examples-67" href="#Examples-67">33.49.1 Examples</a></li>
656     </ul></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>
659     <ul class="toc">
660       <li><a name="toc-Examples-7" href="#Examples-7">33.51.1 Examples</a></li>
661     </ul></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>
665     <ul class="toc">
666       <li><a name="toc-Examples-53" href="#Examples-53">33.54.1 Examples</a></li>
667     </ul></li>
668     <li><a name="toc-noise" href="#noise">33.55 noise</a>
669     <ul class="toc">
670       <li><a name="toc-Examples-17" href="#Examples-17">33.55.1 Examples</a></li>
671     </ul></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>
674     <ul class="toc">
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>
678     </ul></li>
679     <li><a name="toc-overlay-1" href="#overlay-1">33.58 overlay</a>
680     <ul class="toc">
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>
683     </ul></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>
686     <ul class="toc">
687       <li><a name="toc-Examples-63" href="#Examples-63">33.60.1 Examples</a></li>
688     </ul></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>
693     <ul class="toc">
694       <li><a name="toc-Examples-26" href="#Examples-26">33.64.1 Examples</a></li>
695     </ul></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>
700     <ul class="toc">
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>
703     </ul></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>
706     <ul class="toc">
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>
709     </ul></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>
712     <ul class="toc">
713       <li><a name="toc-Examples-91" href="#Examples-91">33.72.1 Examples</a></li>
714     </ul></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>
719     <ul class="toc">
720       <li><a name="toc-Examples-77" href="#Examples-77">33.76.1 Examples</a></li>
721     </ul></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>
728     <ul class="toc">
729       <li><a name="toc-Examples-30" href="#Examples-30">33.82.1 Examples</a></li>
730     </ul></li>
731     <li><a name="toc-tile" href="#tile">33.83 tile</a>
732     <ul class="toc">
733       <li><a name="toc-Examples-11" href="#Examples-11">33.83.1 Examples</a></li>
734     </ul></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>
739     <ul class="toc">
740       <li><a name="toc-Examples-6" href="#Examples-6">33.87.1 Examples</a></li>
741     </ul></li>
742     <li><a name="toc-vidstabdetect-1" href="#vidstabdetect-1">33.88 vidstabdetect</a>
743     <ul class="toc">
744       <li><a name="toc-Examples-5" href="#Examples-5">33.88.1 Examples</a></li>
745     </ul></li>
746     <li><a name="toc-vidstabtransform-1" href="#vidstabtransform-1">33.89 vidstabtransform</a>
747     <ul class="toc">
748       <li><a name="toc-Examples-10" href="#Examples-10">33.89.1 Examples</a></li>
749     </ul></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>
752     <ul class="toc">
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>
755     </ul></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>
758   </ul></li>
759   <li><a name="toc-Video-Sources" href="#Video-Sources">34. Video Sources</a>
760   <ul class="toc">
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>
763     <ul class="toc">
764       <li><a name="toc-Examples-38" href="#Examples-38">34.2.1 Examples</a></li>
765     </ul></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>
770     <ul class="toc">
771       <li><a name="toc-Examples-21" href="#Examples-21">34.6.1 Examples</a></li>
772     </ul></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>
774     <ul class="toc">
775       <li><a name="toc-Commands-4" href="#Commands-4">34.7.1 Commands</a></li>
776     </ul>
777 </li>
778   </ul></li>
779   <li><a name="toc-Video-Sinks" href="#Video-Sinks">35. Video Sinks</a>
780   <ul class="toc">
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>
783   </ul></li>
784   <li><a name="toc-Multimedia-Filters" href="#Multimedia-Filters">36. Multimedia Filters</a>
785   <ul class="toc">
786     <li><a name="toc-avectorscope" href="#avectorscope">36.1 avectorscope</a>
787     <ul class="toc">
788       <li><a name="toc-Examples" href="#Examples">36.1.1 Examples</a></li>
789     </ul></li>
790     <li><a name="toc-concat-2" href="#concat-2">36.2 concat</a>
791     <ul class="toc">
792       <li><a name="toc-Examples-40" href="#Examples-40">36.2.1 Examples</a></li>
793     </ul></li>
794     <li><a name="toc-ebur128" href="#ebur128">36.3 ebur128</a>
795     <ul class="toc">
796       <li><a name="toc-Examples-18" href="#Examples-18">36.3.1 Examples</a></li>
797     </ul></li>
798     <li><a name="toc-interleave_002c-ainterleave" href="#interleave_002c-ainterleave">36.4 interleave, ainterleave</a>
799     <ul class="toc">
800       <li><a name="toc-Examples-35" href="#Examples-35">36.4.1 Examples</a></li>
801     </ul></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>
804     <ul class="toc">
805       <li><a name="toc-Examples-76" href="#Examples-76">36.6.1 Examples</a></li>
806     </ul></li>
807     <li><a name="toc-sendcmd_002c-asendcmd" href="#sendcmd_002c-asendcmd">36.7 sendcmd, asendcmd</a>
808     <ul class="toc">
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>
811     </ul></li>
812     <li><a name="toc-setpts_002c-asetpts" href="#setpts_002c-asetpts">36.8 setpts, asetpts</a>
813     <ul class="toc">
814       <li><a name="toc-Examples-42" href="#Examples-42">36.8.1 Examples</a></li>
815     </ul></li>
816     <li><a name="toc-settb_002c-asettb" href="#settb_002c-asettb">36.9 settb, asettb</a>
817     <ul class="toc">
818       <li><a name="toc-Examples-68" href="#Examples-68">36.9.1 Examples</a></li>
819     </ul></li>
820     <li><a name="toc-showspectrum" href="#showspectrum">36.10 showspectrum</a>
821     <ul class="toc">
822       <li><a name="toc-Examples-2" href="#Examples-2">36.10.1 Examples</a></li>
823     </ul></li>
824     <li><a name="toc-showwaves" href="#showwaves">36.11 showwaves</a>
825     <ul class="toc">
826       <li><a name="toc-Examples-90" href="#Examples-90">36.11.1 Examples</a></li>
827     </ul></li>
828     <li><a name="toc-split_002c-asplit" href="#split_002c-asplit">36.12 split, asplit</a>
829     <ul class="toc">
830       <li><a name="toc-Examples-83" href="#Examples-83">36.12.1 Examples</a></li>
831     </ul></li>
832     <li><a name="toc-zmq_002c-azmq" href="#zmq_002c-azmq">36.13 zmq, azmq</a>
833     <ul class="toc">
834       <li><a name="toc-Examples-29" href="#Examples-29">36.13.1 Examples</a></li>
835     </ul>
836 </li>
837   </ul></li>
838   <li><a name="toc-Multimedia-Sources" href="#Multimedia-Sources">37. Multimedia Sources</a>
839   <ul class="toc">
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>
842     <ul class="toc">
843       <li><a name="toc-Examples-69" href="#Examples-69">37.2.1 Examples</a></li>
844     </ul>
845 </li>
846   </ul></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>
849 </ul>
850 </div>
851
852 <a name="Synopsis"></a>
853 <h1 class="chapter"><a href="ffplay-all.html#toc-Synopsis">1. Synopsis</a></h1>
854
855 <p>ffplay [<var>options</var>] [&lsquo;<tt>input_file</tt>&rsquo;]
856 </p>
857 <a name="Description"></a>
858 <h1 class="chapter"><a href="ffplay-all.html#toc-Description">2. Description</a></h1>
859
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
862 various FFmpeg APIs.
863 </p>
864 <a name="Options-25"></a>
865 <h1 class="chapter"><a href="ffplay-all.html#toc-Options-25">3. Options</a></h1>
866
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: &rsquo;K&rsquo;, &rsquo;M&rsquo;, or &rsquo;G&rsquo;.
870 </p>
871 <p>If &rsquo;i&rsquo; 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 &rsquo;B&rsquo; to the SI unit
874 prefix multiplies the value by 8. This allows using, for example:
875 &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;, &rsquo;G&rsquo; and &rsquo;B&rsquo; as number suffixes.
876 </p>
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 &quot;no&quot;. For example using &quot;-nofoo&quot;
880 will set the boolean option with name &quot;foo&quot; to false.
881 </p>
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.
887 </p>
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.
892 </p>
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
895 streams.
896 </p>
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.
899 </p>
900 <p>Possible forms of stream specifiers are:
901 </p><dl compact="compact">
902 <dt> &lsquo;<samp><var>stream_index</var></samp>&rsquo;</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.
905 </p></dd>
906 <dt> &lsquo;<samp><var>stream_type</var>[:<var>stream_index</var>]</samp>&rsquo;</dt>
907 <dd><p><var>stream_type</var> is one of following: &rsquo;v&rsquo; for video, &rsquo;a&rsquo; for audio, &rsquo;s&rsquo; for subtitle,
908 &rsquo;d&rsquo; for data, and &rsquo;t&rsquo; 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.
911 </p></dd>
912 <dt> &lsquo;<samp>p:<var>program_id</var>[:<var>stream_index</var>]</samp>&rsquo;</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
915 program.
916 </p></dd>
917 <dt> &lsquo;<samp>#<var>stream_id</var></samp>&rsquo;</dt>
918 <dd><p>Matches the stream by a format-specific ID.
919 </p></dd>
920 </dl>
921
922 <a name="Generic-options"></a>
923 <h2 class="section"><a href="ffplay-all.html#toc-Generic-options">3.2 Generic options</a></h2>
924
925 <p>These options are shared amongst the ff* tools.
926 </p>
927 <dl compact="compact">
928 <dt> &lsquo;<samp>-L</samp>&rsquo;</dt>
929 <dd><p>Show license.
930 </p>
931 </dd>
932 <dt> &lsquo;<samp>-h, -?, -help, --help [<var>arg</var>]</samp>&rsquo;</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
935 options are shown.
936 </p>
937 <p>Possible values of <var>arg</var> are:
938 </p><dl compact="compact">
939 <dt> &lsquo;<samp>long</samp>&rsquo;</dt>
940 <dd><p>Print advanced tool options in addition to the basic tool options.
941 </p>
942 </dd>
943 <dt> &lsquo;<samp>full</samp>&rsquo;</dt>
944 <dd><p>Print complete list of options, including shared and private options
945 for encoders, decoders, demuxers, muxers, filters, etc.
946 </p>
947 </dd>
948 <dt> &lsquo;<samp>decoder=<var>decoder_name</var></samp>&rsquo;</dt>
949 <dd><p>Print detailed information about the decoder named <var>decoder_name</var>. Use the
950 &lsquo;<samp>-decoders</samp>&rsquo; option to get a list of all decoders.
951 </p>
952 </dd>
953 <dt> &lsquo;<samp>encoder=<var>encoder_name</var></samp>&rsquo;</dt>
954 <dd><p>Print detailed information about the encoder named <var>encoder_name</var>. Use the
955 &lsquo;<samp>-encoders</samp>&rsquo; option to get a list of all encoders.
956 </p>
957 </dd>
958 <dt> &lsquo;<samp>demuxer=<var>demuxer_name</var></samp>&rsquo;</dt>
959 <dd><p>Print detailed information about the demuxer named <var>demuxer_name</var>. Use the
960 &lsquo;<samp>-formats</samp>&rsquo; option to get a list of all demuxers and muxers.
961 </p>
962 </dd>
963 <dt> &lsquo;<samp>muxer=<var>muxer_name</var></samp>&rsquo;</dt>
964 <dd><p>Print detailed information about the muxer named <var>muxer_name</var>. Use the
965 &lsquo;<samp>-formats</samp>&rsquo; option to get a list of all muxers and demuxers.
966 </p>
967 </dd>
968 <dt> &lsquo;<samp>filter=<var>filter_name</var></samp>&rsquo;</dt>
969 <dd><p>Print detailed information about the filter name <var>filter_name</var>. Use the
970 &lsquo;<samp>-filters</samp>&rsquo; option to get a list of all filters.
971 </p></dd>
972 </dl>
973
974 </dd>
975 <dt> &lsquo;<samp>-version</samp>&rsquo;</dt>
976 <dd><p>Show version.
977 </p>
978 </dd>
979 <dt> &lsquo;<samp>-formats</samp>&rsquo;</dt>
980 <dd><p>Show available formats.
981 </p>
982 </dd>
983 <dt> &lsquo;<samp>-codecs</samp>&rsquo;</dt>
984 <dd><p>Show all codecs known to libavcodec.
985 </p>
986 <p>Note that the term &rsquo;codec&rsquo; is used throughout this documentation as a shortcut
987 for what is more correctly called a media bitstream format.
988 </p>
989 </dd>
990 <dt> &lsquo;<samp>-decoders</samp>&rsquo;</dt>
991 <dd><p>Show available decoders.
992 </p>
993 </dd>
994 <dt> &lsquo;<samp>-encoders</samp>&rsquo;</dt>
995 <dd><p>Show all available encoders.
996 </p>
997 </dd>
998 <dt> &lsquo;<samp>-bsfs</samp>&rsquo;</dt>
999 <dd><p>Show available bitstream filters.
1000 </p>
1001 </dd>
1002 <dt> &lsquo;<samp>-protocols</samp>&rsquo;</dt>
1003 <dd><p>Show available protocols.
1004 </p>
1005 </dd>
1006 <dt> &lsquo;<samp>-filters</samp>&rsquo;</dt>
1007 <dd><p>Show available libavfilter filters.
1008 </p>
1009 </dd>
1010 <dt> &lsquo;<samp>-pix_fmts</samp>&rsquo;</dt>
1011 <dd><p>Show available pixel formats.
1012 </p>
1013 </dd>
1014 <dt> &lsquo;<samp>-sample_fmts</samp>&rsquo;</dt>
1015 <dd><p>Show available sample formats.
1016 </p>
1017 </dd>
1018 <dt> &lsquo;<samp>-layouts</samp>&rsquo;</dt>
1019 <dd><p>Show channel names and standard channel layouts.
1020 </p>
1021 </dd>
1022 <dt> &lsquo;<samp>-colors</samp>&rsquo;</dt>
1023 <dd><p>Show recognized color names.
1024 </p>
1025 </dd>
1026 <dt> &lsquo;<samp>-loglevel [repeat+]<var>loglevel</var> | -v [repeat+]<var>loglevel</var></samp>&rsquo;</dt>
1027 <dd><p>Set the logging level used by the library.
1028 Adding &quot;repeat+&quot; indicates that repeated log output should not be compressed
1029 to the first line and the &quot;Last message repeated n times&quot; line will be
1030 omitted. &quot;repeat&quot; can also be used alone.
1031 If &quot;repeat&quot; is used alone, and with no prior loglevel set, the default
1032 loglevel will be used. If multiple loglevel parameters are given, using
1033 &rsquo;repeat&rsquo; 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> &lsquo;<samp>quiet</samp>&rsquo;</dt>
1037 <dd><p>Show nothing at all; be silent.
1038 </p></dd>
1039 <dt> &lsquo;<samp>panic</samp>&rsquo;</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.
1042 </p></dd>
1043 <dt> &lsquo;<samp>fatal</samp>&rsquo;</dt>
1044 <dd><p>Only show fatal errors. These are errors after which the process absolutely
1045 cannot continue after.
1046 </p></dd>
1047 <dt> &lsquo;<samp>error</samp>&rsquo;</dt>
1048 <dd><p>Show all errors, including ones which can be recovered from.
1049 </p></dd>
1050 <dt> &lsquo;<samp>warning</samp>&rsquo;</dt>
1051 <dd><p>Show all warnings and errors. Any message related to possibly
1052 incorrect or unexpected events will be shown.
1053 </p></dd>
1054 <dt> &lsquo;<samp>info</samp>&rsquo;</dt>
1055 <dd><p>Show informative messages during processing. This is in addition to
1056 warnings and errors. This is the default value.
1057 </p></dd>
1058 <dt> &lsquo;<samp>verbose</samp>&rsquo;</dt>
1059 <dd><p>Same as <code>info</code>, except more verbose.
1060 </p></dd>
1061 <dt> &lsquo;<samp>debug</samp>&rsquo;</dt>
1062 <dd><p>Show everything, including debugging information.
1063 </p></dd>
1064 </dl>
1065
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.
1073 </p>
1074 </dd>
1075 <dt> &lsquo;<samp>-report</samp>&rsquo;</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
1078 directory.
1079 This file can be useful for bug reports.
1080 It also implies <code>-loglevel verbose</code>.
1081 </p>
1082 <p>Setting the environment variable <code>FFREPORT</code> to any value has the
1083 same effect. If the value is a &rsquo;:&rsquo;-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 &rsquo;:&rsquo; (see the
1086 &ldquo;Quoting and escaping&rdquo; section in the ffmpeg-utils manual). The
1087 following option is recognized:
1088 </p><dl compact="compact">
1089 <dt> &lsquo;<samp>file</samp>&rsquo;</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>
1093 </p></dd>
1094 </dl>
1095
1096 <p>Errors in parsing the environment variable are not fatal, and will not
1097 appear in the report.
1098 </p>
1099 </dd>
1100 <dt> &lsquo;<samp>-cpuflags flags (<em>global</em>)</samp>&rsquo;</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&rsquo;re doing.
1103 </p><table><tr><td>&nbsp;</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> &lsquo;<samp>x86</samp>&rsquo;</dt>
1110 <dd><dl compact="compact">
1111 <dt> &lsquo;<samp>mmx</samp>&rsquo;</dt>
1112 <dt> &lsquo;<samp>mmxext</samp>&rsquo;</dt>
1113 <dt> &lsquo;<samp>sse</samp>&rsquo;</dt>
1114 <dt> &lsquo;<samp>sse2</samp>&rsquo;</dt>
1115 <dt> &lsquo;<samp>sse2slow</samp>&rsquo;</dt>
1116 <dt> &lsquo;<samp>sse3</samp>&rsquo;</dt>
1117 <dt> &lsquo;<samp>sse3slow</samp>&rsquo;</dt>
1118 <dt> &lsquo;<samp>ssse3</samp>&rsquo;</dt>
1119 <dt> &lsquo;<samp>atom</samp>&rsquo;</dt>
1120 <dt> &lsquo;<samp>sse4.1</samp>&rsquo;</dt>
1121 <dt> &lsquo;<samp>sse4.2</samp>&rsquo;</dt>
1122 <dt> &lsquo;<samp>avx</samp>&rsquo;</dt>
1123 <dt> &lsquo;<samp>xop</samp>&rsquo;</dt>
1124 <dt> &lsquo;<samp>fma4</samp>&rsquo;</dt>
1125 <dt> &lsquo;<samp>3dnow</samp>&rsquo;</dt>
1126 <dt> &lsquo;<samp>3dnowext</samp>&rsquo;</dt>
1127 <dt> &lsquo;<samp>cmov</samp>&rsquo;</dt>
1128 </dl>
1129 </dd>
1130 <dt> &lsquo;<samp>ARM</samp>&rsquo;</dt>
1131 <dd><dl compact="compact">
1132 <dt> &lsquo;<samp>armv5te</samp>&rsquo;</dt>
1133 <dt> &lsquo;<samp>armv6</samp>&rsquo;</dt>
1134 <dt> &lsquo;<samp>armv6t2</samp>&rsquo;</dt>
1135 <dt> &lsquo;<samp>vfp</samp>&rsquo;</dt>
1136 <dt> &lsquo;<samp>vfpv3</samp>&rsquo;</dt>
1137 <dt> &lsquo;<samp>neon</samp>&rsquo;</dt>
1138 </dl>
1139 </dd>
1140 <dt> &lsquo;<samp>PowerPC</samp>&rsquo;</dt>
1141 <dd><dl compact="compact">
1142 <dt> &lsquo;<samp>altivec</samp>&rsquo;</dt>
1143 </dl>
1144 </dd>
1145 <dt> &lsquo;<samp>Specific Processors</samp>&rsquo;</dt>
1146 <dd><dl compact="compact">
1147 <dt> &lsquo;<samp>pentium2</samp>&rsquo;</dt>
1148 <dt> &lsquo;<samp>pentium3</samp>&rsquo;</dt>
1149 <dt> &lsquo;<samp>pentium4</samp>&rsquo;</dt>
1150 <dt> &lsquo;<samp>k6</samp>&rsquo;</dt>
1151 <dt> &lsquo;<samp>k62</samp>&rsquo;</dt>
1152 <dt> &lsquo;<samp>athlon</samp>&rsquo;</dt>
1153 <dt> &lsquo;<samp>athlonxp</samp>&rsquo;</dt>
1154 <dt> &lsquo;<samp>k8</samp>&rsquo;</dt>
1155 </dl>
1156 </dd>
1157 </dl>
1158
1159 </dd>
1160 <dt> &lsquo;<samp>-opencl_bench</samp>&rsquo;</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>.
1163 </p>
1164 </dd>
1165 <dt> &lsquo;<samp>-opencl_options options (<em>global</em>)</samp>&rsquo;</dt>
1166 <dd><p>Set OpenCL environment options. This option is only available when
1167 FFmpeg has been compiled with <code>--enable-opencl</code>.
1168 </p>
1169 <p><var>options</var> must be a list of <var>key</var>=<var>value</var> option pairs
1170 separated by &rsquo;:&rsquo;. See the &ldquo;OpenCL Options&rdquo; section in the
1171 ffmpeg-utils manual for the list of supported options.
1172 </p></dd>
1173 </dl>
1174
1175 <a name="AVOptions"></a>
1176 <h2 class="section"><a href="ffplay-all.html#toc-AVOptions">3.3 AVOptions</a></h2>
1177
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 &lsquo;<samp>-help</samp>&rsquo; option. They are separated into two categories:
1181 </p><dl compact="compact">
1182 <dt> &lsquo;<samp>generic</samp>&rsquo;</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.
1186 </p></dd>
1187 <dt> &lsquo;<samp>private</samp>&rsquo;</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.
1190 </p></dd>
1191 </dl>
1192
1193 <p>For example to write an ID3v2.3 header instead of a default ID3v2.4 to
1194 an MP3 file, use the &lsquo;<samp>id3v2_version</samp>&rsquo; private option of the MP3
1195 muxer:
1196 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i input.flac -id3v2_version 3 out.mp3
1197 </pre></td></tr></table>
1198
1199 <p>All codec AVOptions are per-stream, and thus a stream specifier
1200 should be attached to them.
1201 </p>
1202 <p>Note: the &lsquo;<samp>-nooption</samp>&rsquo; syntax cannot be used for boolean
1203 AVOptions, use &lsquo;<samp>-option 0</samp>&rsquo;/&lsquo;<samp>-option 1</samp>&rsquo;.
1204 </p>
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
1207 removed soon.
1208 </p>
1209 <a name="Main-options"></a>
1210 <h2 class="section"><a href="ffplay-all.html#toc-Main-options">3.4 Main options</a></h2>
1211
1212 <dl compact="compact">
1213 <dt> &lsquo;<samp>-x <var>width</var></samp>&rsquo;</dt>
1214 <dd><p>Force displayed width.
1215 </p></dd>
1216 <dt> &lsquo;<samp>-y <var>height</var></samp>&rsquo;</dt>
1217 <dd><p>Force displayed height.
1218 </p></dd>
1219 <dt> &lsquo;<samp>-s <var>size</var></samp>&rsquo;</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.
1223 </p></dd>
1224 <dt> &lsquo;<samp>-an</samp>&rsquo;</dt>
1225 <dd><p>Disable audio.
1226 </p></dd>
1227 <dt> &lsquo;<samp>-vn</samp>&rsquo;</dt>
1228 <dd><p>Disable video.
1229 </p></dd>
1230 <dt> &lsquo;<samp>-ss <var>pos</var></samp>&rsquo;</dt>
1231 <dd><p>Seek to a given position in seconds.
1232 </p></dd>
1233 <dt> &lsquo;<samp>-t <var>duration</var></samp>&rsquo;</dt>
1234 <dd><p>play &lt;duration&gt; seconds of audio/video
1235 </p></dd>
1236 <dt> &lsquo;<samp>-bytes</samp>&rsquo;</dt>
1237 <dd><p>Seek by bytes.
1238 </p></dd>
1239 <dt> &lsquo;<samp>-nodisp</samp>&rsquo;</dt>
1240 <dd><p>Disable graphical display.
1241 </p></dd>
1242 <dt> &lsquo;<samp>-f <var>fmt</var></samp>&rsquo;</dt>
1243 <dd><p>Force format.
1244 </p></dd>
1245 <dt> &lsquo;<samp>-window_title <var>title</var></samp>&rsquo;</dt>
1246 <dd><p>Set window title (default is the input filename).
1247 </p></dd>
1248 <dt> &lsquo;<samp>-loop <var>number</var></samp>&rsquo;</dt>
1249 <dd><p>Loops movie playback &lt;number&gt; times. 0 means forever.
1250 </p></dd>
1251 <dt> &lsquo;<samp>-showmode <var>mode</var></samp>&rsquo;</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> &lsquo;<samp>0, video</samp>&rsquo;</dt>
1256 <dd><p>show video
1257 </p></dd>
1258 <dt> &lsquo;<samp>1, waves</samp>&rsquo;</dt>
1259 <dd><p>show audio waves
1260 </p></dd>
1261 <dt> &lsquo;<samp>2, rdft</samp>&rsquo;</dt>
1262 <dd><p>show audio frequency band using RDFT ((Inverse) Real Discrete Fourier Transform)
1263 </p></dd>
1264 </dl>
1265
1266 <p>Default value is &quot;video&quot;, if video is not present or cannot be played
1267 &quot;rdft&quot; is automatically selected.
1268 </p>
1269 <p>You can interactively cycle through the available show modes by
1270 pressing the key &lt;w&gt;.
1271 </p>
1272 </dd>
1273 <dt> &lsquo;<samp>-vf <var>filtergraph</var></samp>&rsquo;</dt>
1274 <dd><p>Create the filtergraph specified by <var>filtergraph</var> and use it to
1275 filter the video stream.
1276 </p>
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
1282 syntax.
1283 </p>
1284 </dd>
1285 <dt> &lsquo;<samp>-af <var>filtergraph</var></samp>&rsquo;</dt>
1286 <dd><p><var>filtergraph</var> is a description of the filtergraph to apply to
1287 the input audio.
1288 Use the option &quot;-filters&quot; to show all the available filters (including
1289 sources and sinks).
1290 </p>
1291 </dd>
1292 <dt> &lsquo;<samp>-i <var>input_file</var></samp>&rsquo;</dt>
1293 <dd><p>Read <var>input_file</var>.
1294 </p></dd>
1295 </dl>
1296
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> &lsquo;<samp>-pix_fmt <var>format</var></samp>&rsquo;</dt>
1301 <dd><p>Set pixel format.
1302 This option has been deprecated in favor of private options, try -pixel_format.
1303 </p>
1304 </dd>
1305 <dt> &lsquo;<samp>-stats</samp>&rsquo;</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>.
1310 </p>
1311 </dd>
1312 <dt> &lsquo;<samp>-bug</samp>&rsquo;</dt>
1313 <dd><p>Work around bugs.
1314 </p></dd>
1315 <dt> &lsquo;<samp>-fast</samp>&rsquo;</dt>
1316 <dd><p>Non-spec-compliant optimizations.
1317 </p></dd>
1318 <dt> &lsquo;<samp>-genpts</samp>&rsquo;</dt>
1319 <dd><p>Generate pts.
1320 </p></dd>
1321 <dt> &lsquo;<samp>-rtp_tcp</samp>&rsquo;</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.
1324 </p></dd>
1325 <dt> &lsquo;<samp>-sync <var>type</var></samp>&rsquo;</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.
1332 </p></dd>
1333 <dt> &lsquo;<samp>-threads <var>count</var></samp>&rsquo;</dt>
1334 <dd><p>Set the thread count.
1335 </p></dd>
1336 <dt> &lsquo;<samp>-ast <var>audio_stream_number</var></samp>&rsquo;</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.
1341 </p></dd>
1342 <dt> &lsquo;<samp>-vst <var>video_stream_number</var></samp>&rsquo;</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.
1347 </p></dd>
1348 <dt> &lsquo;<samp>-sst <var>subtitle_stream_number</var></samp>&rsquo;</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.
1353 </p></dd>
1354 <dt> &lsquo;<samp>-autoexit</samp>&rsquo;</dt>
1355 <dd><p>Exit when video is done playing.
1356 </p></dd>
1357 <dt> &lsquo;<samp>-exitonkeydown</samp>&rsquo;</dt>
1358 <dd><p>Exit if any key is pressed.
1359 </p></dd>
1360 <dt> &lsquo;<samp>-exitonmousedown</samp>&rsquo;</dt>
1361 <dd><p>Exit if any mouse button is pressed.
1362 </p>
1363 </dd>
1364 <dt> &lsquo;<samp>-codec:<var>media_specifier</var> <var>codec_name</var></samp>&rsquo;</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.
1368 </p>
1369 </dd>
1370 <dt> &lsquo;<samp>-acodec <var>codec_name</var></samp>&rsquo;</dt>
1371 <dd><p>Force a specific audio decoder.
1372 </p>
1373 </dd>
1374 <dt> &lsquo;<samp>-vcodec <var>codec_name</var></samp>&rsquo;</dt>
1375 <dd><p>Force a specific video decoder.
1376 </p>
1377 </dd>
1378 <dt> &lsquo;<samp>-scodec <var>codec_name</var></samp>&rsquo;</dt>
1379 <dd><p>Force a specific subtitle decoder.
1380 </p></dd>
1381 </dl>
1382
1383 <a name="While-playing"></a>
1384 <h2 class="section"><a href="ffplay-all.html#toc-While-playing">3.6 While playing</a></h2>
1385
1386 <dl compact="compact">
1387 <dt> &lt;q, ESC&gt;</dt>
1388 <dd><p>Quit.
1389 </p>
1390 </dd>
1391 <dt> &lt;f&gt;</dt>
1392 <dd><p>Toggle full screen.
1393 </p>
1394 </dd>
1395 <dt> &lt;p, SPC&gt;</dt>
1396 <dd><p>Pause.
1397 </p>
1398 </dd>
1399 <dt> &lt;a&gt;</dt>
1400 <dd><p>Cycle audio channel in the curret program.
1401 </p>
1402 </dd>
1403 <dt> &lt;v&gt;</dt>
1404 <dd><p>Cycle video channel.
1405 </p>
1406 </dd>
1407 <dt> &lt;t&gt;</dt>
1408 <dd><p>Cycle subtitle channel in the current program.
1409 </p>
1410 </dd>
1411 <dt> &lt;c&gt;</dt>
1412 <dd><p>Cycle program.
1413 </p>
1414 </dd>
1415 <dt> &lt;w&gt;</dt>
1416 <dd><p>Show audio waves.
1417 </p>
1418 </dd>
1419 <dt> &lt;left/right&gt;</dt>
1420 <dd><p>Seek backward/forward 10 seconds.
1421 </p>
1422 </dd>
1423 <dt> &lt;down/up&gt;</dt>
1424 <dd><p>Seek backward/forward 1 minute.
1425 </p>
1426 </dd>
1427 <dt> &lt;page down/page up&gt;</dt>
1428 <dd><p>Seek backward/forward 10 minutes.
1429 </p>
1430 </dd>
1431 <dt> &lt;mouse click&gt;</dt>
1432 <dd><p>Seek to percentage in file corresponding to fraction of width.
1433 </p>
1434 </dd>
1435 </dl>
1436
1437
1438 <a name="Syntax-2"></a>
1439 <h1 class="chapter"><a href="ffplay-all.html#toc-Syntax-2">4. Syntax</a></h1>
1440
1441 <p>This section documents the syntax and formats employed by the FFmpeg
1442 libraries and tools.
1443 </p>
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>
1447
1448 <p>FFmpeg adopts the following quoting and escaping mechanism, unless
1449 explicitly specified. The following rules are applied:
1450 </p>
1451 <ul>
1452 <li>
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.
1457
1458 </li><li>
1459 A special character is escaped by prefixing it with a &rsquo;\&rsquo;.
1460
1461 </li><li>
1462 All characters enclosed between &rdquo; 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.
1465
1466 </li><li>
1467 Leading and trailing whitespaces, unless escaped or quoted, are
1468 removed from the parsed string.
1469 </li></ul>
1470
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.
1474 </p>
1475 <p>The function <code>av_get_token</code> defined in
1476 &lsquo;<tt>libavutil/avstring.h</tt>&rsquo; can be used to parse a token quoted or
1477 escaped according to the rules defined above.
1478 </p>
1479 <p>The tool &lsquo;<tt>tools/ffescape</tt>&rsquo; in the FFmpeg source tree can be used
1480 to automatically quote or escape a string in a script.
1481 </p>
1482 <a name="Examples-13"></a>
1483 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-13">4.1.1 Examples</a></h3>
1484
1485 <ul>
1486 <li>
1487 Escape the string <code>Crime d'Amour</code> containing the <code>'</code> special
1488 character:
1489 <table><tr><td>&nbsp;</td><td><pre class="example">Crime d\'Amour
1490 </pre></td></tr></table>
1491
1492 </li><li>
1493 The string above contains a quote, so the <code>'</code> needs to be escaped
1494 when quoting it:
1495 <table><tr><td>&nbsp;</td><td><pre class="example">'Crime d'\''Amour'
1496 </pre></td></tr></table>
1497
1498 </li><li>
1499 Include leading or trailing whitespaces using quoting:
1500 <table><tr><td>&nbsp;</td><td><pre class="example">'  this string starts and ends with whitespaces  '
1501 </pre></td></tr></table>
1502
1503 </li><li>
1504 Escaping and quoting can be mixed together:
1505 <table><tr><td>&nbsp;</td><td><pre class="example">' The string '\'string\'' is a string '
1506 </pre></td></tr></table>
1507
1508 </li><li>
1509 To include a literal <code>\</code> you can use either escaping or quoting:
1510 <table><tr><td>&nbsp;</td><td><pre class="example">'c:\foo' can be written as c:\\foo
1511 </pre></td></tr></table>
1512 </li></ul>
1513
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>
1517
1518 <p>The accepted syntax is:
1519 </p><table><tr><td>&nbsp;</td><td><pre class="example">[(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
1520 now
1521 </pre></td></tr></table>
1522
1523 <p>If the value is &quot;now&quot; it takes the current time.
1524 </p>
1525 <p>Time is local time unless Z is appended, in which case it is
1526 interpreted as UTC.
1527 If the year-month-day part is not specified it takes the current
1528 year-month-day.
1529 </p>
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>
1533
1534 <p>There are two accepted syntaxes for expressing time duration.
1535 </p>
1536 <table><tr><td>&nbsp;</td><td><pre class="example">[-][<var>HH</var>:]<var>MM</var>:<var>SS</var>[.<var>m</var>...]
1537 </pre></td></tr></table>
1538
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
1542 <var>SS</var>.
1543 </p>
1544 <p><em>or</em>
1545 </p>
1546 <table><tr><td>&nbsp;</td><td><pre class="example">[-]<var>S</var>+[.<var>m</var>...]
1547 </pre></td></tr></table>
1548
1549 <p><var>S</var> expresses the number of seconds, with the optional decimal part
1550 <var>m</var>.
1551 </p>
1552 <p>In both expressions, the optional &lsquo;<samp>-</samp>&rsquo; indicates negative duration.
1553 </p>
1554 <a name="Examples-31"></a>
1555 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-31">4.3.1 Examples</a></h3>
1556
1557 <p>The following examples are all valid time duration:
1558 </p>
1559 <dl compact="compact">
1560 <dt> &lsquo;<samp>55</samp>&rsquo;</dt>
1561 <dd><p>55 seconds
1562 </p>
1563 </dd>
1564 <dt> &lsquo;<samp>12:03:45</samp>&rsquo;</dt>
1565 <dd><p>12 hours, 03 minutes and 45 seconds
1566 </p>
1567 </dd>
1568 <dt> &lsquo;<samp>23.189</samp>&rsquo;</dt>
1569 <dd><p>23.189 seconds
1570 </p></dd>
1571 </dl>
1572
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.
1578 </p>
1579 <p>The following abbreviations are recognized:
1580 </p><dl compact="compact">
1581 <dt> &lsquo;<samp>ntsc</samp>&rsquo;</dt>
1582 <dd><p>720x480
1583 </p></dd>
1584 <dt> &lsquo;<samp>pal</samp>&rsquo;</dt>
1585 <dd><p>720x576
1586 </p></dd>
1587 <dt> &lsquo;<samp>qntsc</samp>&rsquo;</dt>
1588 <dd><p>352x240
1589 </p></dd>
1590 <dt> &lsquo;<samp>qpal</samp>&rsquo;</dt>
1591 <dd><p>352x288
1592 </p></dd>
1593 <dt> &lsquo;<samp>sntsc</samp>&rsquo;</dt>
1594 <dd><p>640x480
1595 </p></dd>
1596 <dt> &lsquo;<samp>spal</samp>&rsquo;</dt>
1597 <dd><p>768x576
1598 </p></dd>
1599 <dt> &lsquo;<samp>film</samp>&rsquo;</dt>
1600 <dd><p>352x240
1601 </p></dd>
1602 <dt> &lsquo;<samp>ntsc-film</samp>&rsquo;</dt>
1603 <dd><p>352x240
1604 </p></dd>
1605 <dt> &lsquo;<samp>sqcif</samp>&rsquo;</dt>
1606 <dd><p>128x96
1607 </p></dd>
1608 <dt> &lsquo;<samp>qcif</samp>&rsquo;</dt>
1609 <dd><p>176x144
1610 </p></dd>
1611 <dt> &lsquo;<samp>cif</samp>&rsquo;</dt>
1612 <dd><p>352x288
1613 </p></dd>
1614 <dt> &lsquo;<samp>4cif</samp>&rsquo;</dt>
1615 <dd><p>704x576
1616 </p></dd>
1617 <dt> &lsquo;<samp>16cif</samp>&rsquo;</dt>
1618 <dd><p>1408x1152
1619 </p></dd>
1620 <dt> &lsquo;<samp>qqvga</samp>&rsquo;</dt>
1621 <dd><p>160x120
1622 </p></dd>
1623 <dt> &lsquo;<samp>qvga</samp>&rsquo;</dt>
1624 <dd><p>320x240
1625 </p></dd>
1626 <dt> &lsquo;<samp>vga</samp>&rsquo;</dt>
1627 <dd><p>640x480
1628 </p></dd>
1629 <dt> &lsquo;<samp>svga</samp>&rsquo;</dt>
1630 <dd><p>800x600
1631 </p></dd>
1632 <dt> &lsquo;<samp>xga</samp>&rsquo;</dt>
1633 <dd><p>1024x768
1634 </p></dd>
1635 <dt> &lsquo;<samp>uxga</samp>&rsquo;</dt>
1636 <dd><p>1600x1200
1637 </p></dd>
1638 <dt> &lsquo;<samp>qxga</samp>&rsquo;</dt>
1639 <dd><p>2048x1536
1640 </p></dd>
1641 <dt> &lsquo;<samp>sxga</samp>&rsquo;</dt>
1642 <dd><p>1280x1024
1643 </p></dd>
1644 <dt> &lsquo;<samp>qsxga</samp>&rsquo;</dt>
1645 <dd><p>2560x2048
1646 </p></dd>
1647 <dt> &lsquo;<samp>hsxga</samp>&rsquo;</dt>
1648 <dd><p>5120x4096
1649 </p></dd>
1650 <dt> &lsquo;<samp>wvga</samp>&rsquo;</dt>
1651 <dd><p>852x480
1652 </p></dd>
1653 <dt> &lsquo;<samp>wxga</samp>&rsquo;</dt>
1654 <dd><p>1366x768
1655 </p></dd>
1656 <dt> &lsquo;<samp>wsxga</samp>&rsquo;</dt>
1657 <dd><p>1600x1024
1658 </p></dd>
1659 <dt> &lsquo;<samp>wuxga</samp>&rsquo;</dt>
1660 <dd><p>1920x1200
1661 </p></dd>
1662 <dt> &lsquo;<samp>woxga</samp>&rsquo;</dt>
1663 <dd><p>2560x1600
1664 </p></dd>
1665 <dt> &lsquo;<samp>wqsxga</samp>&rsquo;</dt>
1666 <dd><p>3200x2048
1667 </p></dd>
1668 <dt> &lsquo;<samp>wquxga</samp>&rsquo;</dt>
1669 <dd><p>3840x2400
1670 </p></dd>
1671 <dt> &lsquo;<samp>whsxga</samp>&rsquo;</dt>
1672 <dd><p>6400x4096
1673 </p></dd>
1674 <dt> &lsquo;<samp>whuxga</samp>&rsquo;</dt>
1675 <dd><p>7680x4800
1676 </p></dd>
1677 <dt> &lsquo;<samp>cga</samp>&rsquo;</dt>
1678 <dd><p>320x200
1679 </p></dd>
1680 <dt> &lsquo;<samp>ega</samp>&rsquo;</dt>
1681 <dd><p>640x350
1682 </p></dd>
1683 <dt> &lsquo;<samp>hd480</samp>&rsquo;</dt>
1684 <dd><p>852x480
1685 </p></dd>
1686 <dt> &lsquo;<samp>hd720</samp>&rsquo;</dt>
1687 <dd><p>1280x720
1688 </p></dd>
1689 <dt> &lsquo;<samp>hd1080</samp>&rsquo;</dt>
1690 <dd><p>1920x1080
1691 </p></dd>
1692 <dt> &lsquo;<samp>2k</samp>&rsquo;</dt>
1693 <dd><p>2048x1080
1694 </p></dd>
1695 <dt> &lsquo;<samp>2kflat</samp>&rsquo;</dt>
1696 <dd><p>1998x1080
1697 </p></dd>
1698 <dt> &lsquo;<samp>2kscope</samp>&rsquo;</dt>
1699 <dd><p>2048x858
1700 </p></dd>
1701 <dt> &lsquo;<samp>4k</samp>&rsquo;</dt>
1702 <dd><p>4096x2160
1703 </p></dd>
1704 <dt> &lsquo;<samp>4kflat</samp>&rsquo;</dt>
1705 <dd><p>3996x2160
1706 </p></dd>
1707 <dt> &lsquo;<samp>4kscope</samp>&rsquo;</dt>
1708 <dd><p>4096x1716
1709 </p></dd>
1710 <dt> &lsquo;<samp>nhd</samp>&rsquo;</dt>
1711 <dd><p>640x360
1712 </p></dd>
1713 <dt> &lsquo;<samp>hqvga</samp>&rsquo;</dt>
1714 <dd><p>240x160
1715 </p></dd>
1716 <dt> &lsquo;<samp>wqvga</samp>&rsquo;</dt>
1717 <dd><p>400x240
1718 </p></dd>
1719 <dt> &lsquo;<samp>fwqvga</samp>&rsquo;</dt>
1720 <dd><p>432x240
1721 </p></dd>
1722 <dt> &lsquo;<samp>hvga</samp>&rsquo;</dt>
1723 <dd><p>480x320
1724 </p></dd>
1725 <dt> &lsquo;<samp>qhd</samp>&rsquo;</dt>
1726 <dd><p>960x540
1727 </p></dd>
1728 </dl>
1729
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>
1733
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.
1738 </p>
1739 <p>The following abbreviations are recognized:
1740 </p><dl compact="compact">
1741 <dt> &lsquo;<samp>ntsc</samp>&rsquo;</dt>
1742 <dd><p>30000/1001
1743 </p></dd>
1744 <dt> &lsquo;<samp>pal</samp>&rsquo;</dt>
1745 <dd><p>25/1
1746 </p></dd>
1747 <dt> &lsquo;<samp>qntsc</samp>&rsquo;</dt>
1748 <dd><p>30000/1001
1749 </p></dd>
1750 <dt> &lsquo;<samp>qpal</samp>&rsquo;</dt>
1751 <dd><p>25/1
1752 </p></dd>
1753 <dt> &lsquo;<samp>sntsc</samp>&rsquo;</dt>
1754 <dd><p>30000/1001
1755 </p></dd>
1756 <dt> &lsquo;<samp>spal</samp>&rsquo;</dt>
1757 <dd><p>25/1
1758 </p></dd>
1759 <dt> &lsquo;<samp>film</samp>&rsquo;</dt>
1760 <dd><p>24/1
1761 </p></dd>
1762 <dt> &lsquo;<samp>ntsc-film</samp>&rsquo;</dt>
1763 <dd><p>24000/1001
1764 </p></dd>
1765 </dl>
1766
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>
1770
1771 <p>A ratio can be expressed as an expression, or in the form
1772 <var>numerator</var>:<var>denominator</var>.
1773 </p>
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.
1777 </p>
1778 <p>The undefined value can be expressed using the &quot;0:0&quot; string.
1779 </p>
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>
1783
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.
1787 </p>
1788 <p>The alpha component may be a string composed by &quot;0x&quot; followed by an
1789 hexadecimal number or a decimal number between 0.0 and 1.0, which
1790 represents the opacity value (&lsquo;<samp>0x00</samp>&rsquo; or &lsquo;<samp>0.0</samp>&rsquo; means completely
1791 transparent, &lsquo;<samp>0xff</samp>&rsquo; or &lsquo;<samp>1.0</samp>&rsquo; completely opaque). If the alpha
1792 component is not specified then &lsquo;<samp>0xff</samp>&rsquo; is assumed.
1793 </p>
1794 <p>The string &lsquo;<samp>random</samp>&rsquo; will result in a random color.
1795 </p>
1796 <p>The following names of colors are recognized:
1797 </p><dl compact="compact">
1798 <dt> &lsquo;<samp>AliceBlue</samp>&rsquo;</dt>
1799 <dd><p>0xF0F8FF
1800 </p></dd>
1801 <dt> &lsquo;<samp>AntiqueWhite</samp>&rsquo;</dt>
1802 <dd><p>0xFAEBD7
1803 </p></dd>
1804 <dt> &lsquo;<samp>Aqua</samp>&rsquo;</dt>
1805 <dd><p>0x00FFFF
1806 </p></dd>
1807 <dt> &lsquo;<samp>Aquamarine</samp>&rsquo;</dt>
1808 <dd><p>0x7FFFD4
1809 </p></dd>
1810 <dt> &lsquo;<samp>Azure</samp>&rsquo;</dt>
1811 <dd><p>0xF0FFFF
1812 </p></dd>
1813 <dt> &lsquo;<samp>Beige</samp>&rsquo;</dt>
1814 <dd><p>0xF5F5DC
1815 </p></dd>
1816 <dt> &lsquo;<samp>Bisque</samp>&rsquo;</dt>
1817 <dd><p>0xFFE4C4
1818 </p></dd>
1819 <dt> &lsquo;<samp>Black</samp>&rsquo;</dt>
1820 <dd><p>0x000000
1821 </p></dd>
1822 <dt> &lsquo;<samp>BlanchedAlmond</samp>&rsquo;</dt>
1823 <dd><p>0xFFEBCD
1824 </p></dd>
1825 <dt> &lsquo;<samp>Blue</samp>&rsquo;</dt>
1826 <dd><p>0x0000FF
1827 </p></dd>
1828 <dt> &lsquo;<samp>BlueViolet</samp>&rsquo;</dt>
1829 <dd><p>0x8A2BE2
1830 </p></dd>
1831 <dt> &lsquo;<samp>Brown</samp>&rsquo;</dt>
1832 <dd><p>0xA52A2A
1833 </p></dd>
1834 <dt> &lsquo;<samp>BurlyWood</samp>&rsquo;</dt>
1835 <dd><p>0xDEB887
1836 </p></dd>
1837 <dt> &lsquo;<samp>CadetBlue</samp>&rsquo;</dt>
1838 <dd><p>0x5F9EA0
1839 </p></dd>
1840 <dt> &lsquo;<samp>Chartreuse</samp>&rsquo;</dt>
1841 <dd><p>0x7FFF00
1842 </p></dd>
1843 <dt> &lsquo;<samp>Chocolate</samp>&rsquo;</dt>
1844 <dd><p>0xD2691E
1845 </p></dd>
1846 <dt> &lsquo;<samp>Coral</samp>&rsquo;</dt>
1847 <dd><p>0xFF7F50
1848 </p></dd>
1849 <dt> &lsquo;<samp>CornflowerBlue</samp>&rsquo;</dt>
1850 <dd><p>0x6495ED
1851 </p></dd>
1852 <dt> &lsquo;<samp>Cornsilk</samp>&rsquo;</dt>
1853 <dd><p>0xFFF8DC
1854 </p></dd>
1855 <dt> &lsquo;<samp>Crimson</samp>&rsquo;</dt>
1856 <dd><p>0xDC143C
1857 </p></dd>
1858 <dt> &lsquo;<samp>Cyan</samp>&rsquo;</dt>
1859 <dd><p>0x00FFFF
1860 </p></dd>
1861 <dt> &lsquo;<samp>DarkBlue</samp>&rsquo;</dt>
1862 <dd><p>0x00008B
1863 </p></dd>
1864 <dt> &lsquo;<samp>DarkCyan</samp>&rsquo;</dt>
1865 <dd><p>0x008B8B
1866 </p></dd>
1867 <dt> &lsquo;<samp>DarkGoldenRod</samp>&rsquo;</dt>
1868 <dd><p>0xB8860B
1869 </p></dd>
1870 <dt> &lsquo;<samp>DarkGray</samp>&rsquo;</dt>
1871 <dd><p>0xA9A9A9
1872 </p></dd>
1873 <dt> &lsquo;<samp>DarkGreen</samp>&rsquo;</dt>
1874 <dd><p>0x006400
1875 </p></dd>
1876 <dt> &lsquo;<samp>DarkKhaki</samp>&rsquo;</dt>
1877 <dd><p>0xBDB76B
1878 </p></dd>
1879 <dt> &lsquo;<samp>DarkMagenta</samp>&rsquo;</dt>
1880 <dd><p>0x8B008B
1881 </p></dd>
1882 <dt> &lsquo;<samp>DarkOliveGreen</samp>&rsquo;</dt>
1883 <dd><p>0x556B2F
1884 </p></dd>
1885 <dt> &lsquo;<samp>Darkorange</samp>&rsquo;</dt>
1886 <dd><p>0xFF8C00
1887 </p></dd>
1888 <dt> &lsquo;<samp>DarkOrchid</samp>&rsquo;</dt>
1889 <dd><p>0x9932CC
1890 </p></dd>
1891 <dt> &lsquo;<samp>DarkRed</samp>&rsquo;</dt>
1892 <dd><p>0x8B0000
1893 </p></dd>
1894 <dt> &lsquo;<samp>DarkSalmon</samp>&rsquo;</dt>
1895 <dd><p>0xE9967A
1896 </p></dd>
1897 <dt> &lsquo;<samp>DarkSeaGreen</samp>&rsquo;</dt>
1898 <dd><p>0x8FBC8F
1899 </p></dd>
1900 <dt> &lsquo;<samp>DarkSlateBlue</samp>&rsquo;</dt>
1901 <dd><p>0x483D8B
1902 </p></dd>
1903 <dt> &lsquo;<samp>DarkSlateGray</samp>&rsquo;</dt>
1904 <dd><p>0x2F4F4F
1905 </p></dd>
1906 <dt> &lsquo;<samp>DarkTurquoise</samp>&rsquo;</dt>
1907 <dd><p>0x00CED1
1908 </p></dd>
1909 <dt> &lsquo;<samp>DarkViolet</samp>&rsquo;</dt>
1910 <dd><p>0x9400D3
1911 </p></dd>
1912 <dt> &lsquo;<samp>DeepPink</samp>&rsquo;</dt>
1913 <dd><p>0xFF1493
1914 </p></dd>
1915 <dt> &lsquo;<samp>DeepSkyBlue</samp>&rsquo;</dt>
1916 <dd><p>0x00BFFF
1917 </p></dd>
1918 <dt> &lsquo;<samp>DimGray</samp>&rsquo;</dt>
1919 <dd><p>0x696969
1920 </p></dd>
1921 <dt> &lsquo;<samp>DodgerBlue</samp>&rsquo;</dt>
1922 <dd><p>0x1E90FF
1923 </p></dd>
1924 <dt> &lsquo;<samp>FireBrick</samp>&rsquo;</dt>
1925 <dd><p>0xB22222
1926 </p></dd>
1927 <dt> &lsquo;<samp>FloralWhite</samp>&rsquo;</dt>
1928 <dd><p>0xFFFAF0
1929 </p></dd>
1930 <dt> &lsquo;<samp>ForestGreen</samp>&rsquo;</dt>
1931 <dd><p>0x228B22
1932 </p></dd>
1933 <dt> &lsquo;<samp>Fuchsia</samp>&rsquo;</dt>
1934 <dd><p>0xFF00FF
1935 </p></dd>
1936 <dt> &lsquo;<samp>Gainsboro</samp>&rsquo;</dt>
1937 <dd><p>0xDCDCDC
1938 </p></dd>
1939 <dt> &lsquo;<samp>GhostWhite</samp>&rsquo;</dt>
1940 <dd><p>0xF8F8FF
1941 </p></dd>
1942 <dt> &lsquo;<samp>Gold</samp>&rsquo;</dt>
1943 <dd><p>0xFFD700
1944 </p></dd>
1945 <dt> &lsquo;<samp>GoldenRod</samp>&rsquo;</dt>
1946 <dd><p>0xDAA520
1947 </p></dd>
1948 <dt> &lsquo;<samp>Gray</samp>&rsquo;</dt>
1949 <dd><p>0x808080
1950 </p></dd>
1951 <dt> &lsquo;<samp>Green</samp>&rsquo;</dt>
1952 <dd><p>0x008000
1953 </p></dd>
1954 <dt> &lsquo;<samp>GreenYellow</samp>&rsquo;</dt>
1955 <dd><p>0xADFF2F
1956 </p></dd>
1957 <dt> &lsquo;<samp>HoneyDew</samp>&rsquo;</dt>
1958 <dd><p>0xF0FFF0
1959 </p></dd>
1960 <dt> &lsquo;<samp>HotPink</samp>&rsquo;</dt>
1961 <dd><p>0xFF69B4
1962 </p></dd>
1963 <dt> &lsquo;<samp>IndianRed</samp>&rsquo;</dt>
1964 <dd><p>0xCD5C5C
1965 </p></dd>
1966 <dt> &lsquo;<samp>Indigo</samp>&rsquo;</dt>
1967 <dd><p>0x4B0082
1968 </p></dd>
1969 <dt> &lsquo;<samp>Ivory</samp>&rsquo;</dt>
1970 <dd><p>0xFFFFF0
1971 </p></dd>
1972 <dt> &lsquo;<samp>Khaki</samp>&rsquo;</dt>
1973 <dd><p>0xF0E68C
1974 </p></dd>
1975 <dt> &lsquo;<samp>Lavender</samp>&rsquo;</dt>
1976 <dd><p>0xE6E6FA
1977 </p></dd>
1978 <dt> &lsquo;<samp>LavenderBlush</samp>&rsquo;</dt>
1979 <dd><p>0xFFF0F5
1980 </p></dd>
1981 <dt> &lsquo;<samp>LawnGreen</samp>&rsquo;</dt>
1982 <dd><p>0x7CFC00
1983 </p></dd>
1984 <dt> &lsquo;<samp>LemonChiffon</samp>&rsquo;</dt>
1985 <dd><p>0xFFFACD
1986 </p></dd>
1987 <dt> &lsquo;<samp>LightBlue</samp>&rsquo;</dt>
1988 <dd><p>0xADD8E6
1989 </p></dd>
1990 <dt> &lsquo;<samp>LightCoral</samp>&rsquo;</dt>
1991 <dd><p>0xF08080
1992 </p></dd>
1993 <dt> &lsquo;<samp>LightCyan</samp>&rsquo;</dt>
1994 <dd><p>0xE0FFFF
1995 </p></dd>
1996 <dt> &lsquo;<samp>LightGoldenRodYellow</samp>&rsquo;</dt>
1997 <dd><p>0xFAFAD2
1998 </p></dd>
1999 <dt> &lsquo;<samp>LightGreen</samp>&rsquo;</dt>
2000 <dd><p>0x90EE90
2001 </p></dd>
2002 <dt> &lsquo;<samp>LightGrey</samp>&rsquo;</dt>
2003 <dd><p>0xD3D3D3
2004 </p></dd>
2005 <dt> &lsquo;<samp>LightPink</samp>&rsquo;</dt>
2006 <dd><p>0xFFB6C1
2007 </p></dd>
2008 <dt> &lsquo;<samp>LightSalmon</samp>&rsquo;</dt>
2009 <dd><p>0xFFA07A
2010 </p></dd>
2011 <dt> &lsquo;<samp>LightSeaGreen</samp>&rsquo;</dt>
2012 <dd><p>0x20B2AA
2013 </p></dd>
2014 <dt> &lsquo;<samp>LightSkyBlue</samp>&rsquo;</dt>
2015 <dd><p>0x87CEFA
2016 </p></dd>
2017 <dt> &lsquo;<samp>LightSlateGray</samp>&rsquo;</dt>
2018 <dd><p>0x778899
2019 </p></dd>
2020 <dt> &lsquo;<samp>LightSteelBlue</samp>&rsquo;</dt>
2021 <dd><p>0xB0C4DE
2022 </p></dd>
2023 <dt> &lsquo;<samp>LightYellow</samp>&rsquo;</dt>
2024 <dd><p>0xFFFFE0
2025 </p></dd>
2026 <dt> &lsquo;<samp>Lime</samp>&rsquo;</dt>
2027 <dd><p>0x00FF00
2028 </p></dd>
2029 <dt> &lsquo;<samp>LimeGreen</samp>&rsquo;</dt>
2030 <dd><p>0x32CD32
2031 </p></dd>
2032 <dt> &lsquo;<samp>Linen</samp>&rsquo;</dt>
2033 <dd><p>0xFAF0E6
2034 </p></dd>
2035 <dt> &lsquo;<samp>Magenta</samp>&rsquo;</dt>
2036 <dd><p>0xFF00FF
2037 </p></dd>
2038 <dt> &lsquo;<samp>Maroon</samp>&rsquo;</dt>
2039 <dd><p>0x800000
2040 </p></dd>
2041 <dt> &lsquo;<samp>MediumAquaMarine</samp>&rsquo;</dt>
2042 <dd><p>0x66CDAA
2043 </p></dd>
2044 <dt> &lsquo;<samp>MediumBlue</samp>&rsquo;</dt>
2045 <dd><p>0x0000CD
2046 </p></dd>
2047 <dt> &lsquo;<samp>MediumOrchid</samp>&rsquo;</dt>
2048 <dd><p>0xBA55D3
2049 </p></dd>
2050 <dt> &lsquo;<samp>MediumPurple</samp>&rsquo;</dt>
2051 <dd><p>0x9370D8
2052 </p></dd>
2053 <dt> &lsquo;<samp>MediumSeaGreen</samp>&rsquo;</dt>
2054 <dd><p>0x3CB371
2055 </p></dd>
2056 <dt> &lsquo;<samp>MediumSlateBlue</samp>&rsquo;</dt>
2057 <dd><p>0x7B68EE
2058 </p></dd>
2059 <dt> &lsquo;<samp>MediumSpringGreen</samp>&rsquo;</dt>
2060 <dd><p>0x00FA9A
2061 </p></dd>
2062 <dt> &lsquo;<samp>MediumTurquoise</samp>&rsquo;</dt>
2063 <dd><p>0x48D1CC
2064 </p></dd>
2065 <dt> &lsquo;<samp>MediumVioletRed</samp>&rsquo;</dt>
2066 <dd><p>0xC71585
2067 </p></dd>
2068 <dt> &lsquo;<samp>MidnightBlue</samp>&rsquo;</dt>
2069 <dd><p>0x191970
2070 </p></dd>
2071 <dt> &lsquo;<samp>MintCream</samp>&rsquo;</dt>
2072 <dd><p>0xF5FFFA
2073 </p></dd>
2074 <dt> &lsquo;<samp>MistyRose</samp>&rsquo;</dt>
2075 <dd><p>0xFFE4E1
2076 </p></dd>
2077 <dt> &lsquo;<samp>Moccasin</samp>&rsquo;</dt>
2078 <dd><p>0xFFE4B5
2079 </p></dd>
2080 <dt> &lsquo;<samp>NavajoWhite</samp>&rsquo;</dt>
2081 <dd><p>0xFFDEAD
2082 </p></dd>
2083 <dt> &lsquo;<samp>Navy</samp>&rsquo;</dt>
2084 <dd><p>0x000080
2085 </p></dd>
2086 <dt> &lsquo;<samp>OldLace</samp>&rsquo;</dt>
2087 <dd><p>0xFDF5E6
2088 </p></dd>
2089 <dt> &lsquo;<samp>Olive</samp>&rsquo;</dt>
2090 <dd><p>0x808000
2091 </p></dd>
2092 <dt> &lsquo;<samp>OliveDrab</samp>&rsquo;</dt>
2093 <dd><p>0x6B8E23
2094 </p></dd>
2095 <dt> &lsquo;<samp>Orange</samp>&rsquo;</dt>
2096 <dd><p>0xFFA500
2097 </p></dd>
2098 <dt> &lsquo;<samp>OrangeRed</samp>&rsquo;</dt>
2099 <dd><p>0xFF4500
2100 </p></dd>
2101 <dt> &lsquo;<samp>Orchid</samp>&rsquo;</dt>
2102 <dd><p>0xDA70D6
2103 </p></dd>
2104 <dt> &lsquo;<samp>PaleGoldenRod</samp>&rsquo;</dt>
2105 <dd><p>0xEEE8AA
2106 </p></dd>
2107 <dt> &lsquo;<samp>PaleGreen</samp>&rsquo;</dt>
2108 <dd><p>0x98FB98
2109 </p></dd>
2110 <dt> &lsquo;<samp>PaleTurquoise</samp>&rsquo;</dt>
2111 <dd><p>0xAFEEEE
2112 </p></dd>
2113 <dt> &lsquo;<samp>PaleVioletRed</samp>&rsquo;</dt>
2114 <dd><p>0xD87093
2115 </p></dd>
2116 <dt> &lsquo;<samp>PapayaWhip</samp>&rsquo;</dt>
2117 <dd><p>0xFFEFD5
2118 </p></dd>
2119 <dt> &lsquo;<samp>PeachPuff</samp>&rsquo;</dt>
2120 <dd><p>0xFFDAB9
2121 </p></dd>
2122 <dt> &lsquo;<samp>Peru</samp>&rsquo;</dt>
2123 <dd><p>0xCD853F
2124 </p></dd>
2125 <dt> &lsquo;<samp>Pink</samp>&rsquo;</dt>
2126 <dd><p>0xFFC0CB
2127 </p></dd>
2128 <dt> &lsquo;<samp>Plum</samp>&rsquo;</dt>
2129 <dd><p>0xDDA0DD
2130 </p></dd>
2131 <dt> &lsquo;<samp>PowderBlue</samp>&rsquo;</dt>
2132 <dd><p>0xB0E0E6
2133 </p></dd>
2134 <dt> &lsquo;<samp>Purple</samp>&rsquo;</dt>
2135 <dd><p>0x800080
2136 </p></dd>
2137 <dt> &lsquo;<samp>Red</samp>&rsquo;</dt>
2138 <dd><p>0xFF0000
2139 </p></dd>
2140 <dt> &lsquo;<samp>RosyBrown</samp>&rsquo;</dt>
2141 <dd><p>0xBC8F8F
2142 </p></dd>
2143 <dt> &lsquo;<samp>RoyalBlue</samp>&rsquo;</dt>
2144 <dd><p>0x4169E1
2145 </p></dd>
2146 <dt> &lsquo;<samp>SaddleBrown</samp>&rsquo;</dt>
2147 <dd><p>0x8B4513
2148 </p></dd>
2149 <dt> &lsquo;<samp>Salmon</samp>&rsquo;</dt>
2150 <dd><p>0xFA8072
2151 </p></dd>
2152 <dt> &lsquo;<samp>SandyBrown</samp>&rsquo;</dt>
2153 <dd><p>0xF4A460
2154 </p></dd>
2155 <dt> &lsquo;<samp>SeaGreen</samp>&rsquo;</dt>
2156 <dd><p>0x2E8B57
2157 </p></dd>
2158 <dt> &lsquo;<samp>SeaShell</samp>&rsquo;</dt>
2159 <dd><p>0xFFF5EE
2160 </p></dd>
2161 <dt> &lsquo;<samp>Sienna</samp>&rsquo;</dt>
2162 <dd><p>0xA0522D
2163 </p></dd>
2164 <dt> &lsquo;<samp>Silver</samp>&rsquo;</dt>
2165 <dd><p>0xC0C0C0
2166 </p></dd>
2167 <dt> &lsquo;<samp>SkyBlue</samp>&rsquo;</dt>
2168 <dd><p>0x87CEEB
2169 </p></dd>
2170 <dt> &lsquo;<samp>SlateBlue</samp>&rsquo;</dt>
2171 <dd><p>0x6A5ACD
2172 </p></dd>
2173 <dt> &lsquo;<samp>SlateGray</samp>&rsquo;</dt>
2174 <dd><p>0x708090
2175 </p></dd>
2176 <dt> &lsquo;<samp>Snow</samp>&rsquo;</dt>
2177 <dd><p>0xFFFAFA
2178 </p></dd>
2179 <dt> &lsquo;<samp>SpringGreen</samp>&rsquo;</dt>
2180 <dd><p>0x00FF7F
2181 </p></dd>
2182 <dt> &lsquo;<samp>SteelBlue</samp>&rsquo;</dt>
2183 <dd><p>0x4682B4
2184 </p></dd>
2185 <dt> &lsquo;<samp>Tan</samp>&rsquo;</dt>
2186 <dd><p>0xD2B48C
2187 </p></dd>
2188 <dt> &lsquo;<samp>Teal</samp>&rsquo;</dt>
2189 <dd><p>0x008080
2190 </p></dd>
2191 <dt> &lsquo;<samp>Thistle</samp>&rsquo;</dt>
2192 <dd><p>0xD8BFD8
2193 </p></dd>
2194 <dt> &lsquo;<samp>Tomato</samp>&rsquo;</dt>
2195 <dd><p>0xFF6347
2196 </p></dd>
2197 <dt> &lsquo;<samp>Turquoise</samp>&rsquo;</dt>
2198 <dd><p>0x40E0D0
2199 </p></dd>
2200 <dt> &lsquo;<samp>Violet</samp>&rsquo;</dt>
2201 <dd><p>0xEE82EE
2202 </p></dd>
2203 <dt> &lsquo;<samp>Wheat</samp>&rsquo;</dt>
2204 <dd><p>0xF5DEB3
2205 </p></dd>
2206 <dt> &lsquo;<samp>White</samp>&rsquo;</dt>
2207 <dd><p>0xFFFFFF
2208 </p></dd>
2209 <dt> &lsquo;<samp>WhiteSmoke</samp>&rsquo;</dt>
2210 <dd><p>0xF5F5F5
2211 </p></dd>
2212 <dt> &lsquo;<samp>Yellow</samp>&rsquo;</dt>
2213 <dd><p>0xFFFF00
2214 </p></dd>
2215 <dt> &lsquo;<samp>YellowGreen</samp>&rsquo;</dt>
2216 <dd><p>0x9ACD32
2217 </p></dd>
2218 </dl>
2219
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>
2223
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.
2227 </p>
2228 <p>Individual channels are identified by an id, as given by the table
2229 below:
2230 </p><dl compact="compact">
2231 <dt> &lsquo;<samp>FL</samp>&rsquo;</dt>
2232 <dd><p>front left
2233 </p></dd>
2234 <dt> &lsquo;<samp>FR</samp>&rsquo;</dt>
2235 <dd><p>front right
2236 </p></dd>
2237 <dt> &lsquo;<samp>FC</samp>&rsquo;</dt>
2238 <dd><p>front center
2239 </p></dd>
2240 <dt> &lsquo;<samp>LFE</samp>&rsquo;</dt>
2241 <dd><p>low frequency
2242 </p></dd>
2243 <dt> &lsquo;<samp>BL</samp>&rsquo;</dt>
2244 <dd><p>back left
2245 </p></dd>
2246 <dt> &lsquo;<samp>BR</samp>&rsquo;</dt>
2247 <dd><p>back right
2248 </p></dd>
2249 <dt> &lsquo;<samp>FLC</samp>&rsquo;</dt>
2250 <dd><p>front left-of-center
2251 </p></dd>
2252 <dt> &lsquo;<samp>FRC</samp>&rsquo;</dt>
2253 <dd><p>front right-of-center
2254 </p></dd>
2255 <dt> &lsquo;<samp>BC</samp>&rsquo;</dt>
2256 <dd><p>back center
2257 </p></dd>
2258 <dt> &lsquo;<samp>SL</samp>&rsquo;</dt>
2259 <dd><p>side left
2260 </p></dd>
2261 <dt> &lsquo;<samp>SR</samp>&rsquo;</dt>
2262 <dd><p>side right
2263 </p></dd>
2264 <dt> &lsquo;<samp>TC</samp>&rsquo;</dt>
2265 <dd><p>top center
2266 </p></dd>
2267 <dt> &lsquo;<samp>TFL</samp>&rsquo;</dt>
2268 <dd><p>top front left
2269 </p></dd>
2270 <dt> &lsquo;<samp>TFC</samp>&rsquo;</dt>
2271 <dd><p>top front center
2272 </p></dd>
2273 <dt> &lsquo;<samp>TFR</samp>&rsquo;</dt>
2274 <dd><p>top front right
2275 </p></dd>
2276 <dt> &lsquo;<samp>TBL</samp>&rsquo;</dt>
2277 <dd><p>top back left
2278 </p></dd>
2279 <dt> &lsquo;<samp>TBC</samp>&rsquo;</dt>
2280 <dd><p>top back center
2281 </p></dd>
2282 <dt> &lsquo;<samp>TBR</samp>&rsquo;</dt>
2283 <dd><p>top back right
2284 </p></dd>
2285 <dt> &lsquo;<samp>DL</samp>&rsquo;</dt>
2286 <dd><p>downmix left
2287 </p></dd>
2288 <dt> &lsquo;<samp>DR</samp>&rsquo;</dt>
2289 <dd><p>downmix right
2290 </p></dd>
2291 <dt> &lsquo;<samp>WL</samp>&rsquo;</dt>
2292 <dd><p>wide left
2293 </p></dd>
2294 <dt> &lsquo;<samp>WR</samp>&rsquo;</dt>
2295 <dd><p>wide right
2296 </p></dd>
2297 <dt> &lsquo;<samp>SDL</samp>&rsquo;</dt>
2298 <dd><p>surround direct left
2299 </p></dd>
2300 <dt> &lsquo;<samp>SDR</samp>&rsquo;</dt>
2301 <dd><p>surround direct right
2302 </p></dd>
2303 <dt> &lsquo;<samp>LFE2</samp>&rsquo;</dt>
2304 <dd><p>low frequency 2
2305 </p></dd>
2306 </dl>
2307
2308 <p>Standard channel layout compositions can be specified by using the
2309 following identifiers:
2310 </p><dl compact="compact">
2311 <dt> &lsquo;<samp>mono</samp>&rsquo;</dt>
2312 <dd><p>FC
2313 </p></dd>
2314 <dt> &lsquo;<samp>stereo</samp>&rsquo;</dt>
2315 <dd><p>FL+FR
2316 </p></dd>
2317 <dt> &lsquo;<samp>2.1</samp>&rsquo;</dt>
2318 <dd><p>FL+FR+LFE
2319 </p></dd>
2320 <dt> &lsquo;<samp>3.0</samp>&rsquo;</dt>
2321 <dd><p>FL+FR+FC
2322 </p></dd>
2323 <dt> &lsquo;<samp>3.0(back)</samp>&rsquo;</dt>
2324 <dd><p>FL+FR+BC
2325 </p></dd>
2326 <dt> &lsquo;<samp>4.0</samp>&rsquo;</dt>
2327 <dd><p>FL+FR+FC+BC
2328 </p></dd>
2329 <dt> &lsquo;<samp>quad</samp>&rsquo;</dt>
2330 <dd><p>FL+FR+BL+BR
2331 </p></dd>
2332 <dt> &lsquo;<samp>quad(side)</samp>&rsquo;</dt>
2333 <dd><p>FL+FR+SL+SR
2334 </p></dd>
2335 <dt> &lsquo;<samp>3.1</samp>&rsquo;</dt>
2336 <dd><p>FL+FR+FC+LFE
2337 </p></dd>
2338 <dt> &lsquo;<samp>5.0</samp>&rsquo;</dt>
2339 <dd><p>FL+FR+FC+BL+BR
2340 </p></dd>
2341 <dt> &lsquo;<samp>5.0(side)</samp>&rsquo;</dt>
2342 <dd><p>FL+FR+FC+SL+SR
2343 </p></dd>
2344 <dt> &lsquo;<samp>4.1</samp>&rsquo;</dt>
2345 <dd><p>FL+FR+FC+LFE+BC
2346 </p></dd>
2347 <dt> &lsquo;<samp>5.1</samp>&rsquo;</dt>
2348 <dd><p>FL+FR+FC+LFE+BL+BR
2349 </p></dd>
2350 <dt> &lsquo;<samp>5.1(side)</samp>&rsquo;</dt>
2351 <dd><p>FL+FR+FC+LFE+SL+SR
2352 </p></dd>
2353 <dt> &lsquo;<samp>6.0</samp>&rsquo;</dt>
2354 <dd><p>FL+FR+FC+BC+SL+SR
2355 </p></dd>
2356 <dt> &lsquo;<samp>6.0(front)</samp>&rsquo;</dt>
2357 <dd><p>FL+FR+FLC+FRC+SL+SR
2358 </p></dd>
2359 <dt> &lsquo;<samp>hexagonal</samp>&rsquo;</dt>
2360 <dd><p>FL+FR+FC+BL+BR+BC
2361 </p></dd>
2362 <dt> &lsquo;<samp>6.1</samp>&rsquo;</dt>
2363 <dd><p>FL+FR+FC+LFE+BC+SL+SR
2364 </p></dd>
2365 <dt> &lsquo;<samp>6.1</samp>&rsquo;</dt>
2366 <dd><p>FL+FR+FC+LFE+BL+BR+BC
2367 </p></dd>
2368 <dt> &lsquo;<samp>6.1(front)</samp>&rsquo;</dt>
2369 <dd><p>FL+FR+LFE+FLC+FRC+SL+SR
2370 </p></dd>
2371 <dt> &lsquo;<samp>7.0</samp>&rsquo;</dt>
2372 <dd><p>FL+FR+FC+BL+BR+SL+SR
2373 </p></dd>
2374 <dt> &lsquo;<samp>7.0(front)</samp>&rsquo;</dt>
2375 <dd><p>FL+FR+FC+FLC+FRC+SL+SR
2376 </p></dd>
2377 <dt> &lsquo;<samp>7.1</samp>&rsquo;</dt>
2378 <dd><p>FL+FR+FC+LFE+BL+BR+SL+SR
2379 </p></dd>
2380 <dt> &lsquo;<samp>7.1(wide)</samp>&rsquo;</dt>
2381 <dd><p>FL+FR+FC+LFE+BL+BR+FLC+FRC
2382 </p></dd>
2383 <dt> &lsquo;<samp>7.1(wide-side)</samp>&rsquo;</dt>
2384 <dd><p>FL+FR+FC+LFE+FLC+FRC+SL+SR
2385 </p></dd>
2386 <dt> &lsquo;<samp>octagonal</samp>&rsquo;</dt>
2387 <dd><p>FL+FR+FC+BL+BR+BC+SL+SR
2388 </p></dd>
2389 <dt> &lsquo;<samp>downmix</samp>&rsquo;</dt>
2390 <dd><p>DL+DR
2391 </p></dd>
2392 </dl>
2393
2394 <p>A custom channel layout can be specified as a sequence of terms, separated by
2395 &rsquo;+&rsquo; or &rsquo;|&rsquo;. Each term can be:
2396 </p><ul>
2397 <li>
2398 the name of a standard channel layout (e.g. &lsquo;<samp>mono</samp>&rsquo;,
2399 &lsquo;<samp>stereo</samp>&rsquo;, &lsquo;<samp>4.0</samp>&rsquo;, &lsquo;<samp>quad</samp>&rsquo;, &lsquo;<samp>5.0</samp>&rsquo;, etc.)
2400
2401 </li><li>
2402 the name of a single channel (e.g. &lsquo;<samp>FL</samp>&rsquo;, &lsquo;<samp>FR</samp>&rsquo;, &lsquo;<samp>FC</samp>&rsquo;, &lsquo;<samp>LFE</samp>&rsquo;, etc.)
2403
2404 </li><li>
2405 a number of channels, in decimal, optionally followed by &rsquo;c&rsquo;, yielding
2406 the default channel layout for that number of channels (see the
2407 function <code>av_get_default_channel_layout</code>)
2408
2409 </li><li>
2410 a channel layout mask, in hexadecimal starting with &quot;0x&quot; (see the
2411 <code>AV_CH_*</code> macros in &lsquo;<tt>libavutil/channel_layout.h</tt>&rsquo;.
2412 </li></ul>
2413
2414 <p>Starting from libavutil version 53 the trailing character &quot;c&quot; 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 &quot;c&quot;).
2418 </p>
2419 <p>See also the function <code>av_get_channel_layout</code> defined in
2420 &lsquo;<tt>libavutil/channel_layout.h</tt>&rsquo;.
2421 </p>
2422 <a name="Expression-Evaluation"></a>
2423 <h1 class="chapter"><a href="ffplay-all.html#toc-Expression-Evaluation">5. Expression Evaluation</a></h1>
2424
2425 <p>When evaluating an arithmetic expression, FFmpeg uses an internal
2426 formula evaluator, implemented through the &lsquo;<tt>libavutil/eval.h</tt>&rsquo;
2427 interface.
2428 </p>
2429 <p>An expression may contain unary, binary operators, constants, and
2430 functions.
2431 </p>
2432 <p>Two expressions <var>expr1</var> and <var>expr2</var> can be combined to form
2433 another expression &quot;<var>expr1</var>;<var>expr2</var>&quot;.
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>.
2436 </p>
2437 <p>The following binary operators are available: <code>+</code>, <code>-</code>,
2438 <code>*</code>, <code>/</code>, <code>^</code>.
2439 </p>
2440 <p>The following unary operators are available: <code>+</code>, <code>-</code>.
2441 </p>
2442 <p>The following functions are available:
2443 </p><dl compact="compact">
2444 <dt> &lsquo;<samp>abs(x)</samp>&rsquo;</dt>
2445 <dd><p>Compute absolute value of <var>x</var>.
2446 </p>
2447 </dd>
2448 <dt> &lsquo;<samp>acos(x)</samp>&rsquo;</dt>
2449 <dd><p>Compute arccosine of <var>x</var>.
2450 </p>
2451 </dd>
2452 <dt> &lsquo;<samp>asin(x)</samp>&rsquo;</dt>
2453 <dd><p>Compute arcsine of <var>x</var>.
2454 </p>
2455 </dd>
2456 <dt> &lsquo;<samp>atan(x)</samp>&rsquo;</dt>
2457 <dd><p>Compute arctangent of <var>x</var>.
2458 </p>
2459 </dd>
2460 <dt> &lsquo;<samp>between(x, min, max)</samp>&rsquo;</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.
2463 </p>
2464 </dd>
2465 <dt> &lsquo;<samp>bitand(x, y)</samp>&rsquo;</dt>
2466 <dt> &lsquo;<samp>bitor(x, y)</samp>&rsquo;</dt>
2467 <dd><p>Compute bitwise and/or operation on <var>x</var> and <var>y</var>.
2468 </p>
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.
2471 </p>
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).
2475 </p>
2476 </dd>
2477 <dt> &lsquo;<samp>ceil(expr)</samp>&rsquo;</dt>
2478 <dd><p>Round the value of expression <var>expr</var> upwards to the nearest
2479 integer. For example, &quot;ceil(1.5)&quot; is &quot;2.0&quot;.
2480 </p>
2481 </dd>
2482 <dt> &lsquo;<samp>cos(x)</samp>&rsquo;</dt>
2483 <dd><p>Compute cosine of <var>x</var>.
2484 </p>
2485 </dd>
2486 <dt> &lsquo;<samp>cosh(x)</samp>&rsquo;</dt>
2487 <dd><p>Compute hyperbolic cosine of <var>x</var>.
2488 </p>
2489 </dd>
2490 <dt> &lsquo;<samp>eq(x, y)</samp>&rsquo;</dt>
2491 <dd><p>Return 1 if <var>x</var> and <var>y</var> are equivalent, 0 otherwise.
2492 </p>
2493 </dd>
2494 <dt> &lsquo;<samp>exp(x)</samp>&rsquo;</dt>
2495 <dd><p>Compute exponential of <var>x</var> (with base <code>e</code>, the Euler&rsquo;s number).
2496 </p>
2497 </dd>
2498 <dt> &lsquo;<samp>floor(expr)</samp>&rsquo;</dt>
2499 <dd><p>Round the value of expression <var>expr</var> downwards to the nearest
2500 integer. For example, &quot;floor(-1.5)&quot; is &quot;-2.0&quot;.
2501 </p>
2502 </dd>
2503 <dt> &lsquo;<samp>gauss(x)</samp>&rsquo;</dt>
2504 <dd><p>Compute Gauss function of <var>x</var>, corresponding to
2505 <code>exp(-x*x/2) / sqrt(2*PI)</code>.
2506 </p>
2507 </dd>
2508 <dt> &lsquo;<samp>gcd(x, y)</samp>&rsquo;</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.
2511 </p>
2512 </dd>
2513 <dt> &lsquo;<samp>gt(x, y)</samp>&rsquo;</dt>
2514 <dd><p>Return 1 if <var>x</var> is greater than <var>y</var>, 0 otherwise.
2515 </p>
2516 </dd>
2517 <dt> &lsquo;<samp>gte(x, y)</samp>&rsquo;</dt>
2518 <dd><p>Return 1 if <var>x</var> is greater than or equal to <var>y</var>, 0 otherwise.
2519 </p>
2520 </dd>
2521 <dt> &lsquo;<samp>hypot(x, y)</samp>&rsquo;</dt>
2522 <dd><p>This function is similar to the C function with the same name; it returns
2523 &quot;sqrt(<var>x</var>*<var>x</var> + <var>y</var>*<var>y</var>)&quot;, 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.
2526 </p>
2527 </dd>
2528 <dt> &lsquo;<samp>if(x, y)</samp>&rsquo;</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.
2531 </p>
2532 </dd>
2533 <dt> &lsquo;<samp>if(x, y, z)</samp>&rsquo;</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>.
2536 </p>
2537 </dd>
2538 <dt> &lsquo;<samp>ifnot(x, y)</samp>&rsquo;</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.
2541 </p>
2542 </dd>
2543 <dt> &lsquo;<samp>ifnot(x, y, z)</samp>&rsquo;</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>.
2546 </p>
2547 </dd>
2548 <dt> &lsquo;<samp>isinf(x)</samp>&rsquo;</dt>
2549 <dd><p>Return 1.0 if <var>x</var> is +/-INFINITY, 0.0 otherwise.
2550 </p>
2551 </dd>
2552 <dt> &lsquo;<samp>isnan(x)</samp>&rsquo;</dt>
2553 <dd><p>Return 1.0 if <var>x</var> is NAN, 0.0 otherwise.
2554 </p>
2555 </dd>
2556 <dt> &lsquo;<samp>ld(var)</samp>&rsquo;</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.
2560 </p>
2561 </dd>
2562 <dt> &lsquo;<samp>log(x)</samp>&rsquo;</dt>
2563 <dd><p>Compute natural logarithm of <var>x</var>.
2564 </p>
2565 </dd>
2566 <dt> &lsquo;<samp>lt(x, y)</samp>&rsquo;</dt>
2567 <dd><p>Return 1 if <var>x</var> is lesser than <var>y</var>, 0 otherwise.
2568 </p>
2569 </dd>
2570 <dt> &lsquo;<samp>lte(x, y)</samp>&rsquo;</dt>
2571 <dd><p>Return 1 if <var>x</var> is lesser than or equal to <var>y</var>, 0 otherwise.
2572 </p>
2573 </dd>
2574 <dt> &lsquo;<samp>max(x, y)</samp>&rsquo;</dt>
2575 <dd><p>Return the maximum between <var>x</var> and <var>y</var>.
2576 </p>
2577 </dd>
2578 <dt> &lsquo;<samp>min(x, y)</samp>&rsquo;</dt>
2579 <dd><p>Return the maximum between <var>x</var> and <var>y</var>.
2580 </p>
2581 </dd>
2582 <dt> &lsquo;<samp>mod(x, y)</samp>&rsquo;</dt>
2583 <dd><p>Compute the remainder of division of <var>x</var> by <var>y</var>.
2584 </p>
2585 </dd>
2586 <dt> &lsquo;<samp>not(expr)</samp>&rsquo;</dt>
2587 <dd><p>Return 1.0 if <var>expr</var> is zero, 0.0 otherwise.
2588 </p>
2589 </dd>
2590 <dt> &lsquo;<samp>pow(x, y)</samp>&rsquo;</dt>
2591 <dd><p>Compute the power of <var>x</var> elevated <var>y</var>, it is equivalent to
2592 &quot;(<var>x</var>)^(<var>y</var>)&quot;.
2593 </p>
2594 </dd>
2595 <dt> &lsquo;<samp>print(t)</samp>&rsquo;</dt>
2596 <dt> &lsquo;<samp>print(t, l)</samp>&rsquo;</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.
2600 </p>
2601 <p>Prints t with loglevel l
2602 </p>
2603 </dd>
2604 <dt> &lsquo;<samp>random(x)</samp>&rsquo;</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.
2607 </p>
2608 </dd>
2609 <dt> &lsquo;<samp>root(expr, max)</samp>&rsquo;</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>.
2612 </p>
2613 <p>The expression in <var>expr</var> must denote a continuous function or the
2614 result is undefined.
2615 </p>
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.
2621 </p>
2622 </dd>
2623 <dt> &lsquo;<samp>sin(x)</samp>&rsquo;</dt>
2624 <dd><p>Compute sine of <var>x</var>.
2625 </p>
2626 </dd>
2627 <dt> &lsquo;<samp>sinh(x)</samp>&rsquo;</dt>
2628 <dd><p>Compute hyperbolic sine of <var>x</var>.
2629 </p>
2630 </dd>
2631 <dt> &lsquo;<samp>sqrt(expr)</samp>&rsquo;</dt>
2632 <dd><p>Compute the square root of <var>expr</var>. This is equivalent to
2633 &quot;(<var>expr</var>)^.5&quot;.
2634 </p>
2635 </dd>
2636 <dt> &lsquo;<samp>squish(x)</samp>&rsquo;</dt>
2637 <dd><p>Compute expression <code>1/(1 + exp(4*x))</code>.
2638 </p>
2639 </dd>
2640 <dt> &lsquo;<samp>st(var, expr)</samp>&rsquo;</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.
2646 </p>
2647 </dd>
2648 <dt> &lsquo;<samp>tan(x)</samp>&rsquo;</dt>
2649 <dd><p>Compute tangent of <var>x</var>.
2650 </p>
2651 </dd>
2652 <dt> &lsquo;<samp>tanh(x)</samp>&rsquo;</dt>
2653 <dd><p>Compute hyperbolic tangent of <var>x</var>.
2654 </p>
2655 </dd>
2656 <dt> &lsquo;<samp>taylor(expr, x)</samp>&rsquo;</dt>
2657 <dt> &lsquo;<samp>taylor(expr, x, id)</samp>&rsquo;</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.
2660 </p>
2661 <p>When the series does not converge the result is undefined.
2662 </p>
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.
2667 </p>
2668 <p>Note, when you have the derivatives at y instead of 0,
2669 <code>taylor(expr, x-y)</code> can be used.
2670 </p>
2671 </dd>
2672 <dt> &lsquo;<samp>time(0)</samp>&rsquo;</dt>
2673 <dd><p>Return the current (wallclock) time in seconds.
2674 </p>
2675 </dd>
2676 <dt> &lsquo;<samp>trunc(expr)</samp>&rsquo;</dt>
2677 <dd><p>Round the value of expression <var>expr</var> towards zero to the nearest
2678 integer. For example, &quot;trunc(-1.5)&quot; is &quot;-1.0&quot;.
2679 </p>
2680 </dd>
2681 <dt> &lsquo;<samp>while(cond, expr)</samp>&rsquo;</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.
2685 </p></dd>
2686 </dl>
2687
2688 <p>The following constants are available:
2689 </p><dl compact="compact">
2690 <dt> &lsquo;<samp>PI</samp>&rsquo;</dt>
2691 <dd><p>area of the unit disc, approximately 3.14
2692 </p></dd>
2693 <dt> &lsquo;<samp>E</samp>&rsquo;</dt>
2694 <dd><p>exp(1) (Euler&rsquo;s number), approximately 2.718
2695 </p></dd>
2696 <dt> &lsquo;<samp>PHI</samp>&rsquo;</dt>
2697 <dd><p>golden ratio (1+sqrt(5))/2, approximately 1.618
2698 </p></dd>
2699 </dl>
2700
2701 <p>Assuming that an expression is considered &quot;true&quot; if it has a non-zero
2702 value, note that:
2703 </p>
2704 <p><code>*</code> works like AND
2705 </p>
2706 <p><code>+</code> works like OR
2707 </p>
2708 <p>For example the construct:
2709 </p><table><tr><td>&nbsp;</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>&nbsp;</td><td><pre class="example">if(A*B, C)
2713 </pre></td></tr></table>
2714
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
2717 expressions.
2718 </p>
2719 <p>The evaluator also recognizes the International System unit prefixes.
2720 If &rsquo;i&rsquo; is appended after the prefix, binary prefixes are used, which
2721 are based on powers of 1024 instead of powers of 1000.
2722 The &rsquo;B&rsquo; postfix multiplies the value by 8, and can be appended after a
2723 unit prefix or used alone. This allows using for example &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;,
2724 &rsquo;G&rsquo; and &rsquo;B&rsquo; as number postfix.
2725 </p>
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> &lsquo;<samp>y</samp>&rsquo;</dt>
2730 <dd><p>10^-24 / 2^-80
2731 </p></dd>
2732 <dt> &lsquo;<samp>z</samp>&rsquo;</dt>
2733 <dd><p>10^-21 / 2^-70
2734 </p></dd>
2735 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
2736 <dd><p>10^-18 / 2^-60
2737 </p></dd>
2738 <dt> &lsquo;<samp>f</samp>&rsquo;</dt>
2739 <dd><p>10^-15 / 2^-50
2740 </p></dd>
2741 <dt> &lsquo;<samp>p</samp>&rsquo;</dt>
2742 <dd><p>10^-12 / 2^-40
2743 </p></dd>
2744 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
2745 <dd><p>10^-9 / 2^-30
2746 </p></dd>
2747 <dt> &lsquo;<samp>u</samp>&rsquo;</dt>
2748 <dd><p>10^-6 / 2^-20
2749 </p></dd>
2750 <dt> &lsquo;<samp>m</samp>&rsquo;</dt>
2751 <dd><p>10^-3 / 2^-10
2752 </p></dd>
2753 <dt> &lsquo;<samp>c</samp>&rsquo;</dt>
2754 <dd><p>10^-2
2755 </p></dd>
2756 <dt> &lsquo;<samp>d</samp>&rsquo;</dt>
2757 <dd><p>10^-1
2758 </p></dd>
2759 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
2760 <dd><p>10^2
2761 </p></dd>
2762 <dt> &lsquo;<samp>k</samp>&rsquo;</dt>
2763 <dd><p>10^3 / 2^10
2764 </p></dd>
2765 <dt> &lsquo;<samp>K</samp>&rsquo;</dt>
2766 <dd><p>10^3 / 2^10
2767 </p></dd>
2768 <dt> &lsquo;<samp>M</samp>&rsquo;</dt>
2769 <dd><p>10^6 / 2^20
2770 </p></dd>
2771 <dt> &lsquo;<samp>G</samp>&rsquo;</dt>
2772 <dd><p>10^9 / 2^30
2773 </p></dd>
2774 <dt> &lsquo;<samp>T</samp>&rsquo;</dt>
2775 <dd><p>10^12 / 2^40
2776 </p></dd>
2777 <dt> &lsquo;<samp>P</samp>&rsquo;</dt>
2778 <dd><p>10^15 / 2^40
2779 </p></dd>
2780 <dt> &lsquo;<samp>E</samp>&rsquo;</dt>
2781 <dd><p>10^18 / 2^50
2782 </p></dd>
2783 <dt> &lsquo;<samp>Z</samp>&rsquo;</dt>
2784 <dd><p>10^21 / 2^60
2785 </p></dd>
2786 <dt> &lsquo;<samp>Y</samp>&rsquo;</dt>
2787 <dd><p>10^24 / 2^70
2788 </p></dd>
2789 </dl>
2790
2791
2792 <a name="OpenCL-Options"></a>
2793 <h1 class="chapter"><a href="ffplay-all.html#toc-OpenCL-Options">6. OpenCL Options</a></h1>
2794
2795 <p>When FFmpeg is configured with <code>--enable-opencl</code>, it is possible
2796 to set the options for the global OpenCL context.
2797 </p>
2798 <p>The list of supported options follows:
2799 </p>
2800 <dl compact="compact">
2801 <dt> &lsquo;<samp>build_options</samp>&rsquo;</dt>
2802 <dd><p>Set build options used to compile the registered kernels.
2803 </p>
2804 <p>See reference &quot;OpenCL Specification Version: 1.2 chapter 5.6.4&quot;.
2805 </p>
2806 </dd>
2807 <dt> &lsquo;<samp>platform_idx</samp>&rsquo;</dt>
2808 <dd><p>Select the index of the platform to run OpenCL code.
2809 </p>
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>.
2812 </p>
2813 </dd>
2814 <dt> &lsquo;<samp>device_idx</samp>&rsquo;</dt>
2815 <dd><p>Select the index of the device used to run OpenCL code.
2816 </p>
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>.
2819 </p>
2820 </dd>
2821 </dl>
2822
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>
2826
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.
2830 </p>
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.
2835 </p>
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 &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API
2839 for programmatic use.
2840 </p>
2841 <p>The list of supported options follow:
2842 </p>
2843 <dl compact="compact">
2844 <dt> &lsquo;<samp>b <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
2845 <dd><p>Set bitrate in bits/s. Default value is 200K.
2846 </p>
2847 </dd>
2848 <dt> &lsquo;<samp>ab <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
2849 <dd><p>Set audio bitrate (in bits/s). Default value is 128K.
2850 </p>
2851 </dd>
2852 <dt> &lsquo;<samp>bt <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</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.
2857 </p>
2858 </dd>
2859 <dt> &lsquo;<samp>flags <var>flags</var> (<em>decoding/encoding,audio,video,subtitles</em>)</samp>&rsquo;</dt>
2860 <dd><p>Set generic flags.
2861 </p>
2862 <p>Possible values:
2863 </p><dl compact="compact">
2864 <dt> &lsquo;<samp>mv4</samp>&rsquo;</dt>
2865 <dd><p>Use four motion vector by macroblock (mpeg4).
2866 </p></dd>
2867 <dt> &lsquo;<samp>qpel</samp>&rsquo;</dt>
2868 <dd><p>Use 1/4 pel motion compensation.
2869 </p></dd>
2870 <dt> &lsquo;<samp>loop</samp>&rsquo;</dt>
2871 <dd><p>Use loop filter.
2872 </p></dd>
2873 <dt> &lsquo;<samp>qscale</samp>&rsquo;</dt>
2874 <dd><p>Use fixed qscale.
2875 </p></dd>
2876 <dt> &lsquo;<samp>gmc</samp>&rsquo;</dt>
2877 <dd><p>Use gmc.
2878 </p></dd>
2879 <dt> &lsquo;<samp>mv0</samp>&rsquo;</dt>
2880 <dd><p>Always try a mb with mv=&lt;0,0&gt;.
2881 </p></dd>
2882 <dt> &lsquo;<samp>input_preserved</samp>&rsquo;</dt>
2883 <dt> &lsquo;<samp>pass1</samp>&rsquo;</dt>
2884 <dd><p>Use internal 2pass ratecontrol in first pass mode.
2885 </p></dd>
2886 <dt> &lsquo;<samp>pass2</samp>&rsquo;</dt>
2887 <dd><p>Use internal 2pass ratecontrol in second pass mode.
2888 </p></dd>
2889 <dt> &lsquo;<samp>gray</samp>&rsquo;</dt>
2890 <dd><p>Only decode/encode grayscale.
2891 </p></dd>
2892 <dt> &lsquo;<samp>emu_edge</samp>&rsquo;</dt>
2893 <dd><p>Do not draw edges.
2894 </p></dd>
2895 <dt> &lsquo;<samp>psnr</samp>&rsquo;</dt>
2896 <dd><p>Set error[?] variables during encoding.
2897 </p></dd>
2898 <dt> &lsquo;<samp>truncated</samp>&rsquo;</dt>
2899 <dt> &lsquo;<samp>naq</samp>&rsquo;</dt>
2900 <dd><p>Normalize adaptive quantization.
2901 </p></dd>
2902 <dt> &lsquo;<samp>ildct</samp>&rsquo;</dt>
2903 <dd><p>Use interlaced DCT.
2904 </p></dd>
2905 <dt> &lsquo;<samp>low_delay</samp>&rsquo;</dt>
2906 <dd><p>Force low delay.
2907 </p></dd>
2908 <dt> &lsquo;<samp>global_header</samp>&rsquo;</dt>
2909 <dd><p>Place global headers in extradata instead of every keyframe.
2910 </p></dd>
2911 <dt> &lsquo;<samp>bitexact</samp>&rsquo;</dt>
2912 <dd><p>Use only bitexact stuff (except (I)DCT).
2913 </p></dd>
2914 <dt> &lsquo;<samp>aic</samp>&rsquo;</dt>
2915 <dd><p>Apply H263 advanced intra coding / mpeg4 ac prediction.
2916 </p></dd>
2917 <dt> &lsquo;<samp>cbp</samp>&rsquo;</dt>
2918 <dd><p>Deprecated, use mpegvideo private options instead.
2919 </p></dd>
2920 <dt> &lsquo;<samp>qprd</samp>&rsquo;</dt>
2921 <dd><p>Deprecated, use mpegvideo private options instead.
2922 </p></dd>
2923 <dt> &lsquo;<samp>ilme</samp>&rsquo;</dt>
2924 <dd><p>Apply interlaced motion estimation.
2925 </p></dd>
2926 <dt> &lsquo;<samp>cgop</samp>&rsquo;</dt>
2927 <dd><p>Use closed gop.
2928 </p></dd>
2929 </dl>
2930
2931 </dd>
2932 <dt> &lsquo;<samp>me_method <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
2933 <dd><p>Set motion estimation method.
2934 </p>
2935 <p>Possible values:
2936 </p><dl compact="compact">
2937 <dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
2938 <dd><p>zero motion estimation (fastest)
2939 </p></dd>
2940 <dt> &lsquo;<samp>full</samp>&rsquo;</dt>
2941 <dd><p>full motion estimation (slowest)
2942 </p></dd>
2943 <dt> &lsquo;<samp>epzs</samp>&rsquo;</dt>
2944 <dd><p>EPZS motion estimation (default)
2945 </p></dd>
2946 <dt> &lsquo;<samp>esa</samp>&rsquo;</dt>
2947 <dd><p>esa motion estimation (alias for full)
2948 </p></dd>
2949 <dt> &lsquo;<samp>tesa</samp>&rsquo;</dt>
2950 <dd><p>tesa motion estimation
2951 </p></dd>
2952 <dt> &lsquo;<samp>dia</samp>&rsquo;</dt>
2953 <dd><p>dia motion estimation (alias for epzs)
2954 </p></dd>
2955 <dt> &lsquo;<samp>log</samp>&rsquo;</dt>
2956 <dd><p>log motion estimation
2957 </p></dd>
2958 <dt> &lsquo;<samp>phods</samp>&rsquo;</dt>
2959 <dd><p>phods motion estimation
2960 </p></dd>
2961 <dt> &lsquo;<samp>x1</samp>&rsquo;</dt>
2962 <dd><p>X1 motion estimation
2963 </p></dd>
2964 <dt> &lsquo;<samp>hex</samp>&rsquo;</dt>
2965 <dd><p>hex motion estimation
2966 </p></dd>
2967 <dt> &lsquo;<samp>umh</samp>&rsquo;</dt>
2968 <dd><p>umh motion estimation
2969 </p></dd>
2970 <dt> &lsquo;<samp>iter</samp>&rsquo;</dt>
2971 <dd><p>iter motion estimation
2972 </p></dd>
2973 </dl>
2974
2975 </dd>
2976 <dt> &lsquo;<samp>extradata_size <var>integer</var></samp>&rsquo;</dt>
2977 <dd><p>Set extradata size.
2978 </p>
2979 </dd>
2980 <dt> &lsquo;<samp>time_base <var>rational number</var></samp>&rsquo;</dt>
2981 <dd><p>Set codec time base.
2982 </p>
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
2986 identically 1.
2987 </p>
2988 </dd>
2989 <dt> &lsquo;<samp>g <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
2990 <dd><p>Set the group of picture size. Default value is 12.
2991 </p>
2992 </dd>
2993 <dt> &lsquo;<samp>ar <var>integer</var> (<em>decoding/encoding,audio</em>)</samp>&rsquo;</dt>
2994 <dd><p>Set audio sampling rate (in Hz).
2995 </p>
2996 </dd>
2997 <dt> &lsquo;<samp>ac <var>integer</var> (<em>decoding/encoding,audio</em>)</samp>&rsquo;</dt>
2998 <dd><p>Set number of audio channels.
2999 </p>
3000 </dd>
3001 <dt> &lsquo;<samp>cutoff <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
3002 <dd><p>Set cutoff bandwidth.
3003 </p>
3004 </dd>
3005 <dt> &lsquo;<samp>frame_size <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
3006 <dd><p>Set audio frame size.
3007 </p>
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
3012 size.
3013 </p>
3014 </dd>
3015 <dt> &lsquo;<samp>frame_number <var>integer</var></samp>&rsquo;</dt>
3016 <dd><p>Set the frame number.
3017 </p>
3018 </dd>
3019 <dt> &lsquo;<samp>delay <var>integer</var></samp>&rsquo;</dt>
3020 <dt> &lsquo;<samp>qcomp <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</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:
3023 0.0-1.0.
3024 </p>
3025 </dd>
3026 <dt> &lsquo;<samp>qblur <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3027 <dd><p>Set video quantizer scale blur (VBR).
3028 </p>
3029 </dd>
3030 <dt> &lsquo;<samp>qmin <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3031 <dd><p>Set min video quantizer scale (VBR). Must be included between -1 and
3032 69, default value is 2.
3033 </p>
3034 </dd>
3035 <dt> &lsquo;<samp>qmax <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3036 <dd><p>Set max video quantizer scale (VBR). Must be included between -1 and
3037 1024, default value is 31.
3038 </p>
3039 </dd>
3040 <dt> &lsquo;<samp>qdiff <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3041 <dd><p>Set max difference between the quantizer scale (VBR).
3042 </p>
3043 </dd>
3044 <dt> &lsquo;<samp>bf <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3045 <dd><p>Set max number of B frames between non-B-frames.
3046 </p>
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.
3050 </p>
3051 <p>Default value is 0.
3052 </p>
3053 </dd>
3054 <dt> &lsquo;<samp>b_qfactor <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3055 <dd><p>Set qp factor between P and B frames.
3056 </p>
3057 </dd>
3058 <dt> &lsquo;<samp>rc_strategy <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3059 <dd><p>Set ratecontrol method.
3060 </p>
3061 </dd>
3062 <dt> &lsquo;<samp>b_strategy <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3063 <dd><p>Set strategy to choose between I/P/B-frames.
3064 </p>
3065 </dd>
3066 <dt> &lsquo;<samp>ps <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3067 <dd><p>Set RTP payload size in bytes.
3068 </p>
3069 </dd>
3070 <dt> &lsquo;<samp>mv_bits <var>integer</var></samp>&rsquo;</dt>
3071 <dt> &lsquo;<samp>header_bits <var>integer</var></samp>&rsquo;</dt>
3072 <dt> &lsquo;<samp>i_tex_bits <var>integer</var></samp>&rsquo;</dt>
3073 <dt> &lsquo;<samp>p_tex_bits <var>integer</var></samp>&rsquo;</dt>
3074 <dt> &lsquo;<samp>i_count <var>integer</var></samp>&rsquo;</dt>
3075 <dt> &lsquo;<samp>p_count <var>integer</var></samp>&rsquo;</dt>
3076 <dt> &lsquo;<samp>skip_count <var>integer</var></samp>&rsquo;</dt>
3077 <dt> &lsquo;<samp>misc_bits <var>integer</var></samp>&rsquo;</dt>
3078 <dt> &lsquo;<samp>frame_bits <var>integer</var></samp>&rsquo;</dt>
3079 <dt> &lsquo;<samp>codec_tag <var>integer</var></samp>&rsquo;</dt>
3080 <dt> &lsquo;<samp>bug <var>flags</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
3081 <dd><p>Workaround not auto detected encoder bugs.
3082 </p>
3083 <p>Possible values:
3084 </p><dl compact="compact">
3085 <dt> &lsquo;<samp>autodetect</samp>&rsquo;</dt>
3086 <dt> &lsquo;<samp>old_msmpeg4</samp>&rsquo;</dt>
3087 <dd><p>some old lavc generated msmpeg4v3 files (no autodetection)
3088 </p></dd>
3089 <dt> &lsquo;<samp>xvid_ilace</samp>&rsquo;</dt>
3090 <dd><p>Xvid interlacing bug (autodetected if fourcc==XVIX)
3091 </p></dd>
3092 <dt> &lsquo;<samp>ump4</samp>&rsquo;</dt>
3093 <dd><p>(autodetected if fourcc==UMP4)
3094 </p></dd>
3095 <dt> &lsquo;<samp>no_padding</samp>&rsquo;</dt>
3096 <dd><p>padding bug (autodetected)
3097 </p></dd>
3098 <dt> &lsquo;<samp>amv</samp>&rsquo;</dt>
3099 <dt> &lsquo;<samp>ac_vlc</samp>&rsquo;</dt>
3100 <dd><p>illegal vlc bug (autodetected per fourcc)
3101 </p></dd>
3102 <dt> &lsquo;<samp>qpel_chroma</samp>&rsquo;</dt>
3103 <dt> &lsquo;<samp>std_qpel</samp>&rsquo;</dt>
3104 <dd><p>old standard qpel (autodetected per fourcc/version)
3105 </p></dd>
3106 <dt> &lsquo;<samp>qpel_chroma2</samp>&rsquo;</dt>
3107 <dt> &lsquo;<samp>direct_blocksize</samp>&rsquo;</dt>
3108 <dd><p>direct-qpel-blocksize bug (autodetected per fourcc/version)
3109 </p></dd>
3110 <dt> &lsquo;<samp>edge</samp>&rsquo;</dt>
3111 <dd><p>edge padding bug (autodetected per fourcc/version)
3112 </p></dd>
3113 <dt> &lsquo;<samp>hpel_chroma</samp>&rsquo;</dt>
3114 <dt> &lsquo;<samp>dc_clip</samp>&rsquo;</dt>
3115 <dt> &lsquo;<samp>ms</samp>&rsquo;</dt>
3116 <dd><p>Workaround various bugs in microsoft broken decoders.
3117 </p></dd>
3118 <dt> &lsquo;<samp>trunc</samp>&rsquo;</dt>
3119 <dd><p>trancated frames
3120 </p></dd>
3121 </dl>
3122
3123 </dd>
3124 <dt> &lsquo;<samp>lelim <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3125 <dd><p>Set single coefficient elimination threshold for luminance (negative
3126 values also consider DC coefficient).
3127 </p>
3128 </dd>
3129 <dt> &lsquo;<samp>celim <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3130 <dd><p>Set single coefficient elimination threshold for chrominance (negative
3131 values also consider dc coefficient)
3132 </p>
3133 </dd>
3134 <dt> &lsquo;<samp>strict <var>integer</var> (<em>decoding/encoding,audio,video</em>)</samp>&rsquo;</dt>
3135 <dd><p>Specify how strictly to follow the standards.
3136 </p>
3137 <p>Possible values:
3138 </p><dl compact="compact">
3139 <dt> &lsquo;<samp>very</samp>&rsquo;</dt>
3140 <dd><p>strictly conform to a older more strict version of the spec or reference software
3141 </p></dd>
3142 <dt> &lsquo;<samp>strict</samp>&rsquo;</dt>
3143 <dd><p>strictly conform to all the things in the spec no matter what consequences
3144 </p></dd>
3145 <dt> &lsquo;<samp>normal</samp>&rsquo;</dt>
3146 <dt> &lsquo;<samp>unofficial</samp>&rsquo;</dt>
3147 <dd><p>allow unofficial extensions
3148 </p></dd>
3149 <dt> &lsquo;<samp>experimental</samp>&rsquo;</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.
3154 </p></dd>
3155 </dl>
3156
3157 </dd>
3158 <dt> &lsquo;<samp>b_qoffset <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3159 <dd><p>Set QP offset between P and B frames.
3160 </p>
3161 </dd>
3162 <dt> &lsquo;<samp>err_detect <var>flags</var> (<em>decoding,audio,video</em>)</samp>&rsquo;</dt>
3163 <dd><p>Set error detection flags.
3164 </p>
3165 <p>Possible values:
3166 </p><dl compact="compact">
3167 <dt> &lsquo;<samp>crccheck</samp>&rsquo;</dt>
3168 <dd><p>verify embedded CRCs
3169 </p></dd>
3170 <dt> &lsquo;<samp>bitstream</samp>&rsquo;</dt>
3171 <dd><p>detect bitstream specification deviations
3172 </p></dd>
3173 <dt> &lsquo;<samp>buffer</samp>&rsquo;</dt>
3174 <dd><p>detect improper bitstream length
3175 </p></dd>
3176 <dt> &lsquo;<samp>explode</samp>&rsquo;</dt>
3177 <dd><p>abort decoding on minor error detection
3178 </p></dd>
3179 <dt> &lsquo;<samp>careful</samp>&rsquo;</dt>
3180 <dd><p>consider things that violate the spec and have not been seen in the wild as errors
3181 </p></dd>
3182 <dt> &lsquo;<samp>compliant</samp>&rsquo;</dt>
3183 <dd><p>consider all spec non compliancies as errors
3184 </p></dd>
3185 <dt> &lsquo;<samp>aggressive</samp>&rsquo;</dt>
3186 <dd><p>consider things that a sane encoder should not do as an error
3187 </p></dd>
3188 </dl>
3189
3190 </dd>
3191 <dt> &lsquo;<samp>has_b_frames <var>integer</var></samp>&rsquo;</dt>
3192 <dt> &lsquo;<samp>block_align <var>integer</var></samp>&rsquo;</dt>
3193 <dt> &lsquo;<samp>mpeg_quant <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3194 <dd><p>Use MPEG quantizers instead of H.263.
3195 </p>
3196 </dd>
3197 <dt> &lsquo;<samp>qsquish <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3198 <dd><p>How to keep quantizer between qmin and qmax (0 = clip, 1 = use
3199 differentiable function).
3200 </p>
3201 </dd>
3202 <dt> &lsquo;<samp>rc_qmod_amp <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3203 <dd><p>Set experimental quantizer modulation.
3204 </p>
3205 </dd>
3206 <dt> &lsquo;<samp>rc_qmod_freq <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3207 <dd><p>Set experimental quantizer modulation.
3208 </p>
3209 </dd>
3210 <dt> &lsquo;<samp>rc_override_count <var>integer</var></samp>&rsquo;</dt>
3211 <dt> &lsquo;<samp>rc_eq <var>string</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3212 <dd><p>Set rate control equation. When computing the expression, besides the
3213 standard functions defined in the section &rsquo;Expression Evaluation&rsquo;, 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
3217 avgTex.
3218 </p>
3219 </dd>
3220 <dt> &lsquo;<samp>maxrate <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
3221 <dd><p>Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
3222 </p>
3223 </dd>
3224 <dt> &lsquo;<samp>minrate <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</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.
3227 </p>
3228 </dd>
3229 <dt> &lsquo;<samp>bufsize <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
3230 <dd><p>Set ratecontrol buffer size (in bits).
3231 </p>
3232 </dd>
3233 <dt> &lsquo;<samp>rc_buf_aggressivity <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3234 <dd><p>Currently useless.
3235 </p>
3236 </dd>
3237 <dt> &lsquo;<samp>i_qfactor <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3238 <dd><p>Set QP factor between P and I frames.
3239 </p>
3240 </dd>
3241 <dt> &lsquo;<samp>i_qoffset <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3242 <dd><p>Set QP offset between P and I frames.
3243 </p>
3244 </dd>
3245 <dt> &lsquo;<samp>rc_init_cplx <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3246 <dd><p>Set initial complexity for 1-pass encoding.
3247 </p>
3248 </dd>
3249 <dt> &lsquo;<samp>dct <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3250 <dd><p>Set DCT algorithm.
3251 </p>
3252 <p>Possible values:
3253 </p><dl compact="compact">
3254 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
3255 <dd><p>autoselect a good one (default)
3256 </p></dd>
3257 <dt> &lsquo;<samp>fastint</samp>&rsquo;</dt>
3258 <dd><p>fast integer
3259 </p></dd>
3260 <dt> &lsquo;<samp>int</samp>&rsquo;</dt>
3261 <dd><p>accurate integer
3262 </p></dd>
3263 <dt> &lsquo;<samp>mmx</samp>&rsquo;</dt>
3264 <dt> &lsquo;<samp>altivec</samp>&rsquo;</dt>
3265 <dt> &lsquo;<samp>faan</samp>&rsquo;</dt>
3266 <dd><p>floating point AAN DCT
3267 </p></dd>
3268 </dl>
3269
3270 </dd>
3271 <dt> &lsquo;<samp>lumi_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3272 <dd><p>Compress bright areas stronger than medium ones.
3273 </p>
3274 </dd>
3275 <dt> &lsquo;<samp>tcplx_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3276 <dd><p>Set temporal complexity masking.
3277 </p>
3278 </dd>
3279 <dt> &lsquo;<samp>scplx_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3280 <dd><p>Set spatial complexity masking.
3281 </p>
3282 </dd>
3283 <dt> &lsquo;<samp>p_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3284 <dd><p>Set inter masking.
3285 </p>
3286 </dd>
3287 <dt> &lsquo;<samp>dark_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3288 <dd><p>Compress dark areas stronger than medium ones.
3289 </p>
3290 </dd>
3291 <dt> &lsquo;<samp>idct <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
3292 <dd><p>Select IDCT implementation.
3293 </p>
3294 <p>Possible values:
3295 </p><dl compact="compact">
3296 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
3297 <dt> &lsquo;<samp>int</samp>&rsquo;</dt>
3298 <dt> &lsquo;<samp>simple</samp>&rsquo;</dt>
3299 <dt> &lsquo;<samp>simplemmx</samp>&rsquo;</dt>
3300 <dt> &lsquo;<samp>arm</samp>&rsquo;</dt>
3301 <dt> &lsquo;<samp>altivec</samp>&rsquo;</dt>
3302 <dt> &lsquo;<samp>sh4</samp>&rsquo;</dt>
3303 <dt> &lsquo;<samp>simplearm</samp>&rsquo;</dt>
3304 <dt> &lsquo;<samp>simplearmv5te</samp>&rsquo;</dt>
3305 <dt> &lsquo;<samp>simplearmv6</samp>&rsquo;</dt>
3306 <dt> &lsquo;<samp>simpleneon</samp>&rsquo;</dt>
3307 <dt> &lsquo;<samp>simplealpha</samp>&rsquo;</dt>
3308 <dt> &lsquo;<samp>ipp</samp>&rsquo;</dt>
3309 <dt> &lsquo;<samp>xvidmmx</samp>&rsquo;</dt>
3310 <dt> &lsquo;<samp>faani</samp>&rsquo;</dt>
3311 <dd><p>floating point AAN IDCT
3312 </p></dd>
3313 </dl>
3314
3315 </dd>
3316 <dt> &lsquo;<samp>slice_count <var>integer</var></samp>&rsquo;</dt>
3317 <dt> &lsquo;<samp>ec <var>flags</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
3318 <dd><p>Set error concealment strategy.
3319 </p>
3320 <p>Possible values:
3321 </p><dl compact="compact">
3322 <dt> &lsquo;<samp>guess_mvs</samp>&rsquo;</dt>
3323 <dd><p>iterative motion vector (MV) search (slow)
3324 </p></dd>
3325 <dt> &lsquo;<samp>deblock</samp>&rsquo;</dt>
3326 <dd><p>use strong deblock filter for damaged MBs
3327 </p></dd>
3328 </dl>
3329
3330 </dd>
3331 <dt> &lsquo;<samp>bits_per_coded_sample <var>integer</var></samp>&rsquo;</dt>
3332 <dt> &lsquo;<samp>pred <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3333 <dd><p>Set prediction method.
3334 </p>
3335 <p>Possible values:
3336 </p><dl compact="compact">
3337 <dt> &lsquo;<samp>left</samp>&rsquo;</dt>
3338 <dt> &lsquo;<samp>plane</samp>&rsquo;</dt>
3339 <dt> &lsquo;<samp>median</samp>&rsquo;</dt>
3340 </dl>
3341
3342 </dd>
3343 <dt> &lsquo;<samp>aspect <var>rational number</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3344 <dd><p>Set sample aspect ratio.
3345 </p>
3346 </dd>
3347 <dt> &lsquo;<samp>debug <var>flags</var> (<em>decoding/encoding,audio,video,subtitles</em>)</samp>&rsquo;</dt>
3348 <dd><p>Print specific debug info.
3349 </p>
3350 <p>Possible values:
3351 </p><dl compact="compact">
3352 <dt> &lsquo;<samp>pict</samp>&rsquo;</dt>
3353 <dd><p>picture info
3354 </p></dd>
3355 <dt> &lsquo;<samp>rc</samp>&rsquo;</dt>
3356 <dd><p>rate control
3357 </p></dd>
3358 <dt> &lsquo;<samp>bitstream</samp>&rsquo;</dt>
3359 <dt> &lsquo;<samp>mb_type</samp>&rsquo;</dt>
3360 <dd><p>macroblock (MB) type
3361 </p></dd>
3362 <dt> &lsquo;<samp>qp</samp>&rsquo;</dt>
3363 <dd><p>per-block quantization parameter (QP)
3364 </p></dd>
3365 <dt> &lsquo;<samp>mv</samp>&rsquo;</dt>
3366 <dd><p>motion vector
3367 </p></dd>
3368 <dt> &lsquo;<samp>dct_coeff</samp>&rsquo;</dt>
3369 <dt> &lsquo;<samp>skip</samp>&rsquo;</dt>
3370 <dt> &lsquo;<samp>startcode</samp>&rsquo;</dt>
3371 <dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
3372 <dt> &lsquo;<samp>er</samp>&rsquo;</dt>
3373 <dd><p>error recognition
3374 </p></dd>
3375 <dt> &lsquo;<samp>mmco</samp>&rsquo;</dt>
3376 <dd><p>memory management control operations (H.264)
3377 </p></dd>
3378 <dt> &lsquo;<samp>bugs</samp>&rsquo;</dt>
3379 <dt> &lsquo;<samp>vis_qp</samp>&rsquo;</dt>
3380 <dd><p>visualize quantization parameter (QP), lower QP are tinted greener
3381 </p></dd>
3382 <dt> &lsquo;<samp>vis_mb_type</samp>&rsquo;</dt>
3383 <dd><p>visualize block types
3384 </p></dd>
3385 <dt> &lsquo;<samp>buffers</samp>&rsquo;</dt>
3386 <dd><p>picture buffer allocations
3387 </p></dd>
3388 <dt> &lsquo;<samp>thread_ops</samp>&rsquo;</dt>
3389 <dd><p>threading operations
3390 </p></dd>
3391 </dl>
3392
3393 </dd>
3394 <dt> &lsquo;<samp>vismv <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
3395 <dd><p>Visualize motion vectors (MVs).
3396 </p>
3397 <p>Possible values:
3398 </p><dl compact="compact">
3399 <dt> &lsquo;<samp>pf</samp>&rsquo;</dt>
3400 <dd><p>forward predicted MVs of P-frames
3401 </p></dd>
3402 <dt> &lsquo;<samp>bf</samp>&rsquo;</dt>
3403 <dd><p>forward predicted MVs of B-frames
3404 </p></dd>
3405 <dt> &lsquo;<samp>bb</samp>&rsquo;</dt>
3406 <dd><p>backward predicted MVs of B-frames
3407 </p></dd>
3408 </dl>
3409
3410 </dd>
3411 <dt> &lsquo;<samp>cmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3412 <dd><p>Set full pel me compare function.
3413 </p>
3414 <p>Possible values:
3415 </p><dl compact="compact">
3416 <dt> &lsquo;<samp>sad</samp>&rsquo;</dt>
3417 <dd><p>sum of absolute differences, fast (default)
3418 </p></dd>
3419 <dt> &lsquo;<samp>sse</samp>&rsquo;</dt>
3420 <dd><p>sum of squared errors
3421 </p></dd>
3422 <dt> &lsquo;<samp>satd</samp>&rsquo;</dt>
3423 <dd><p>sum of absolute Hadamard transformed differences
3424 </p></dd>
3425 <dt> &lsquo;<samp>dct</samp>&rsquo;</dt>
3426 <dd><p>sum of absolute DCT transformed differences
3427 </p></dd>
3428 <dt> &lsquo;<samp>psnr</samp>&rsquo;</dt>
3429 <dd><p>sum of squared quantization errors (avoid, low quality)
3430 </p></dd>
3431 <dt> &lsquo;<samp>bit</samp>&rsquo;</dt>
3432 <dd><p>number of bits needed for the block
3433 </p></dd>
3434 <dt> &lsquo;<samp>rd</samp>&rsquo;</dt>
3435 <dd><p>rate distortion optimal, slow
3436 </p></dd>
3437 <dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
3438 <dd><p>0
3439 </p></dd>
3440 <dt> &lsquo;<samp>vsad</samp>&rsquo;</dt>
3441 <dd><p>sum of absolute vertical differences
3442 </p></dd>
3443 <dt> &lsquo;<samp>vsse</samp>&rsquo;</dt>
3444 <dd><p>sum of squared vertical differences
3445 </p></dd>
3446 <dt> &lsquo;<samp>nsse</samp>&rsquo;</dt>
3447 <dd><p>noise preserving sum of squared differences
3448 </p></dd>
3449 <dt> &lsquo;<samp>w53</samp>&rsquo;</dt>
3450 <dd><p>5/3 wavelet, only used in snow
3451 </p></dd>
3452 <dt> &lsquo;<samp>w97</samp>&rsquo;</dt>
3453 <dd><p>9/7 wavelet, only used in snow
3454 </p></dd>
3455 <dt> &lsquo;<samp>dctmax</samp>&rsquo;</dt>
3456 <dt> &lsquo;<samp>chroma</samp>&rsquo;</dt>
3457 </dl>
3458
3459 </dd>
3460 <dt> &lsquo;<samp>subcmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3461 <dd><p>Set sub pel me compare function.
3462 </p>
3463 <p>Possible values:
3464 </p><dl compact="compact">
3465 <dt> &lsquo;<samp>sad</samp>&rsquo;</dt>
3466 <dd><p>sum of absolute differences, fast (default)
3467 </p></dd>
3468 <dt> &lsquo;<samp>sse</samp>&rsquo;</dt>
3469 <dd><p>sum of squared errors
3470 </p></dd>
3471 <dt> &lsquo;<samp>satd</samp>&rsquo;</dt>
3472 <dd><p>sum of absolute Hadamard transformed differences
3473 </p></dd>
3474 <dt> &lsquo;<samp>dct</samp>&rsquo;</dt>
3475 <dd><p>sum of absolute DCT transformed differences
3476 </p></dd>
3477 <dt> &lsquo;<samp>psnr</samp>&rsquo;</dt>
3478 <dd><p>sum of squared quantization errors (avoid, low quality)
3479 </p></dd>
3480 <dt> &lsquo;<samp>bit</samp>&rsquo;</dt>
3481 <dd><p>number of bits needed for the block
3482 </p></dd>
3483 <dt> &lsquo;<samp>rd</samp>&rsquo;</dt>
3484 <dd><p>rate distortion optimal, slow
3485 </p></dd>
3486 <dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
3487 <dd><p>0
3488 </p></dd>
3489 <dt> &lsquo;<samp>vsad</samp>&rsquo;</dt>
3490 <dd><p>sum of absolute vertical differences
3491 </p></dd>
3492 <dt> &lsquo;<samp>vsse</samp>&rsquo;</dt>
3493 <dd><p>sum of squared vertical differences
3494 </p></dd>
3495 <dt> &lsquo;<samp>nsse</samp>&rsquo;</dt>
3496 <dd><p>noise preserving sum of squared differences
3497 </p></dd>
3498 <dt> &lsquo;<samp>w53</samp>&rsquo;</dt>
3499 <dd><p>5/3 wavelet, only used in snow
3500 </p></dd>
3501 <dt> &lsquo;<samp>w97</samp>&rsquo;</dt>
3502 <dd><p>9/7 wavelet, only used in snow
3503 </p></dd>
3504 <dt> &lsquo;<samp>dctmax</samp>&rsquo;</dt>
3505 <dt> &lsquo;<samp>chroma</samp>&rsquo;</dt>
3506 </dl>
3507
3508 </dd>
3509 <dt> &lsquo;<samp>mbcmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3510 <dd><p>Set macroblock compare function.
3511 </p>
3512 <p>Possible values:
3513 </p><dl compact="compact">
3514 <dt> &lsquo;<samp>sad</samp>&rsquo;</dt>
3515 <dd><p>sum of absolute differences, fast (default)
3516 </p></dd>
3517 <dt> &lsquo;<samp>sse</samp>&rsquo;</dt>
3518 <dd><p>sum of squared errors
3519 </p></dd>
3520 <dt> &lsquo;<samp>satd</samp>&rsquo;</dt>
3521 <dd><p>sum of absolute Hadamard transformed differences
3522 </p></dd>
3523 <dt> &lsquo;<samp>dct</samp>&rsquo;</dt>
3524 <dd><p>sum of absolute DCT transformed differences
3525 </p></dd>
3526 <dt> &lsquo;<samp>psnr</samp>&rsquo;</dt>
3527 <dd><p>sum of squared quantization errors (avoid, low quality)
3528 </p></dd>
3529 <dt> &lsquo;<samp>bit</samp>&rsquo;</dt>
3530 <dd><p>number of bits needed for the block
3531 </p></dd>
3532 <dt> &lsquo;<samp>rd</samp>&rsquo;</dt>
3533 <dd><p>rate distortion optimal, slow
3534 </p></dd>
3535 <dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
3536 <dd><p>0
3537 </p></dd>
3538 <dt> &lsquo;<samp>vsad</samp>&rsquo;</dt>
3539 <dd><p>sum of absolute vertical differences
3540 </p></dd>
3541 <dt> &lsquo;<samp>vsse</samp>&rsquo;</dt>
3542 <dd><p>sum of squared vertical differences
3543 </p></dd>
3544 <dt> &lsquo;<samp>nsse</samp>&rsquo;</dt>
3545 <dd><p>noise preserving sum of squared differences
3546 </p></dd>
3547 <dt> &lsquo;<samp>w53</samp>&rsquo;</dt>
3548 <dd><p>5/3 wavelet, only used in snow
3549 </p></dd>
3550 <dt> &lsquo;<samp>w97</samp>&rsquo;</dt>
3551 <dd><p>9/7 wavelet, only used in snow
3552 </p></dd>
3553 <dt> &lsquo;<samp>dctmax</samp>&rsquo;</dt>
3554 <dt> &lsquo;<samp>chroma</samp>&rsquo;</dt>
3555 </dl>
3556
3557 </dd>
3558 <dt> &lsquo;<samp>ildctcmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3559 <dd><p>Set interlaced dct compare function.
3560 </p>
3561 <p>Possible values:
3562 </p><dl compact="compact">
3563 <dt> &lsquo;<samp>sad</samp>&rsquo;</dt>
3564 <dd><p>sum of absolute differences, fast (default)
3565 </p></dd>
3566 <dt> &lsquo;<samp>sse</samp>&rsquo;</dt>
3567 <dd><p>sum of squared errors
3568 </p></dd>
3569 <dt> &lsquo;<samp>satd</samp>&rsquo;</dt>
3570 <dd><p>sum of absolute Hadamard transformed differences
3571 </p></dd>
3572 <dt> &lsquo;<samp>dct</samp>&rsquo;</dt>
3573 <dd><p>sum of absolute DCT transformed differences
3574 </p></dd>
3575 <dt> &lsquo;<samp>psnr</samp>&rsquo;</dt>
3576 <dd><p>sum of squared quantization errors (avoid, low quality)
3577 </p></dd>
3578 <dt> &lsquo;<samp>bit</samp>&rsquo;</dt>
3579 <dd><p>number of bits needed for the block
3580 </p></dd>
3581 <dt> &lsquo;<samp>rd</samp>&rsquo;</dt>
3582 <dd><p>rate distortion optimal, slow
3583 </p></dd>
3584 <dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
3585 <dd><p>0
3586 </p></dd>
3587 <dt> &lsquo;<samp>vsad</samp>&rsquo;</dt>
3588 <dd><p>sum of absolute vertical differences
3589 </p></dd>
3590 <dt> &lsquo;<samp>vsse</samp>&rsquo;</dt>
3591 <dd><p>sum of squared vertical differences
3592 </p></dd>
3593 <dt> &lsquo;<samp>nsse</samp>&rsquo;</dt>
3594 <dd><p>noise preserving sum of squared differences
3595 </p></dd>
3596 <dt> &lsquo;<samp>w53</samp>&rsquo;</dt>
3597 <dd><p>5/3 wavelet, only used in snow
3598 </p></dd>
3599 <dt> &lsquo;<samp>w97</samp>&rsquo;</dt>
3600 <dd><p>9/7 wavelet, only used in snow
3601 </p></dd>
3602 <dt> &lsquo;<samp>dctmax</samp>&rsquo;</dt>
3603 <dt> &lsquo;<samp>chroma</samp>&rsquo;</dt>
3604 </dl>
3605
3606 </dd>
3607 <dt> &lsquo;<samp>dia_size <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3608 <dd><p>Set diamond type &amp; size for motion estimation.
3609 </p>
3610 </dd>
3611 <dt> &lsquo;<samp>last_pred <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3612 <dd><p>Set amount of motion predictors from the previous frame.
3613 </p>
3614 </dd>
3615 <dt> &lsquo;<samp>preme <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3616 <dd><p>Set pre motion estimation.
3617 </p>
3618 </dd>
3619 <dt> &lsquo;<samp>precmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3620 <dd><p>Set pre motion estimation compare function.
3621 </p>
3622 <p>Possible values:
3623 </p><dl compact="compact">
3624 <dt> &lsquo;<samp>sad</samp>&rsquo;</dt>
3625 <dd><p>sum of absolute differences, fast (default)
3626 </p></dd>
3627 <dt> &lsquo;<samp>sse</samp>&rsquo;</dt>
3628 <dd><p>sum of squared errors
3629 </p></dd>
3630 <dt> &lsquo;<samp>satd</samp>&rsquo;</dt>
3631 <dd><p>sum of absolute Hadamard transformed differences
3632 </p></dd>
3633 <dt> &lsquo;<samp>dct</samp>&rsquo;</dt>
3634 <dd><p>sum of absolute DCT transformed differences
3635 </p></dd>
3636 <dt> &lsquo;<samp>psnr</samp>&rsquo;</dt>
3637 <dd><p>sum of squared quantization errors (avoid, low quality)
3638 </p></dd>
3639 <dt> &lsquo;<samp>bit</samp>&rsquo;</dt>
3640 <dd><p>number of bits needed for the block
3641 </p></dd>
3642 <dt> &lsquo;<samp>rd</samp>&rsquo;</dt>
3643 <dd><p>rate distortion optimal, slow
3644 </p></dd>
3645 <dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
3646 <dd><p>0
3647 </p></dd>
3648 <dt> &lsquo;<samp>vsad</samp>&rsquo;</dt>
3649 <dd><p>sum of absolute vertical differences
3650 </p></dd>
3651 <dt> &lsquo;<samp>vsse</samp>&rsquo;</dt>
3652 <dd><p>sum of squared vertical differences
3653 </p></dd>
3654 <dt> &lsquo;<samp>nsse</samp>&rsquo;</dt>
3655 <dd><p>noise preserving sum of squared differences
3656 </p></dd>
3657 <dt> &lsquo;<samp>w53</samp>&rsquo;</dt>
3658 <dd><p>5/3 wavelet, only used in snow
3659 </p></dd>
3660 <dt> &lsquo;<samp>w97</samp>&rsquo;</dt>
3661 <dd><p>9/7 wavelet, only used in snow
3662 </p></dd>
3663 <dt> &lsquo;<samp>dctmax</samp>&rsquo;</dt>
3664 <dt> &lsquo;<samp>chroma</samp>&rsquo;</dt>
3665 </dl>
3666
3667 </dd>
3668 <dt> &lsquo;<samp>pre_dia_size <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3669 <dd><p>Set diamond type &amp; size for motion estimation pre-pass.
3670 </p>
3671 </dd>
3672 <dt> &lsquo;<samp>subq <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3673 <dd><p>Set sub pel motion estimation quality.
3674 </p>
3675 </dd>
3676 <dt> &lsquo;<samp>dtg_active_format <var>integer</var></samp>&rsquo;</dt>
3677 <dt> &lsquo;<samp>me_range <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3678 <dd><p>Set limit motion vectors range (1023 for DivX player).
3679 </p>
3680 </dd>
3681 <dt> &lsquo;<samp>ibias <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3682 <dd><p>Set intra quant bias.
3683 </p>
3684 </dd>
3685 <dt> &lsquo;<samp>pbias <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3686 <dd><p>Set inter quant bias.
3687 </p>
3688 </dd>
3689 <dt> &lsquo;<samp>color_table_id <var>integer</var></samp>&rsquo;</dt>
3690 <dt> &lsquo;<samp>global_quality <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
3691 <dt> &lsquo;<samp>coder <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3692 <dd>
3693 <p>Possible values:
3694 </p><dl compact="compact">
3695 <dt> &lsquo;<samp>vlc</samp>&rsquo;</dt>
3696 <dd><p>variable length coder / huffman coder
3697 </p></dd>
3698 <dt> &lsquo;<samp>ac</samp>&rsquo;</dt>
3699 <dd><p>arithmetic coder
3700 </p></dd>
3701 <dt> &lsquo;<samp>raw</samp>&rsquo;</dt>
3702 <dd><p>raw (no encoding)
3703 </p></dd>
3704 <dt> &lsquo;<samp>rle</samp>&rsquo;</dt>
3705 <dd><p>run-length coder
3706 </p></dd>
3707 <dt> &lsquo;<samp>deflate</samp>&rsquo;</dt>
3708 <dd><p>deflate-based coder
3709 </p></dd>
3710 </dl>
3711
3712 </dd>
3713 <dt> &lsquo;<samp>context <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3714 <dd><p>Set context model.
3715 </p>
3716 </dd>
3717 <dt> &lsquo;<samp>slice_flags <var>integer</var></samp>&rsquo;</dt>
3718 <dt> &lsquo;<samp>xvmc_acceleration <var>integer</var></samp>&rsquo;</dt>
3719 <dt> &lsquo;<samp>mbd <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3720 <dd><p>Set macroblock decision algorithm (high quality mode).
3721 </p>
3722 <p>Possible values:
3723 </p><dl compact="compact">
3724 <dt> &lsquo;<samp>simple</samp>&rsquo;</dt>
3725 <dd><p>use mbcmp (default)
3726 </p></dd>
3727 <dt> &lsquo;<samp>bits</samp>&rsquo;</dt>
3728 <dd><p>use fewest bits
3729 </p></dd>
3730 <dt> &lsquo;<samp>rd</samp>&rsquo;</dt>
3731 <dd><p>use best rate distortion
3732 </p></dd>
3733 </dl>
3734
3735 </dd>
3736 <dt> &lsquo;<samp>stream_codec_tag <var>integer</var></samp>&rsquo;</dt>
3737 <dt> &lsquo;<samp>sc_threshold <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3738 <dd><p>Set scene change threshold.
3739 </p>
3740 </dd>
3741 <dt> &lsquo;<samp>lmin <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3742 <dd><p>Set min lagrange factor (VBR).
3743 </p>
3744 </dd>
3745 <dt> &lsquo;<samp>lmax <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3746 <dd><p>Set max lagrange factor (VBR).
3747 </p>
3748 </dd>
3749 <dt> &lsquo;<samp>nr <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3750 <dd><p>Set noise reduction.
3751 </p>
3752 </dd>
3753 <dt> &lsquo;<samp>rc_init_occupancy <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3754 <dd><p>Set number of bits which should be loaded into the rc buffer before
3755 decoding starts.
3756 </p>
3757 </dd>
3758 <dt> &lsquo;<samp>flags2 <var>flags</var> (<em>decoding/encoding,audio,video</em>)</samp>&rsquo;</dt>
3759 <dd>
3760 <p>Possible values:
3761 </p><dl compact="compact">
3762 <dt> &lsquo;<samp>fast</samp>&rsquo;</dt>
3763 <dd><p>Allow non spec compliant speedup tricks.
3764 </p></dd>
3765 <dt> &lsquo;<samp>sgop</samp>&rsquo;</dt>
3766 <dd><p>Deprecated, use mpegvideo private options instead.
3767 </p></dd>
3768 <dt> &lsquo;<samp>noout</samp>&rsquo;</dt>
3769 <dd><p>Skip bitstream encoding.
3770 </p></dd>
3771 <dt> &lsquo;<samp>ignorecrop</samp>&rsquo;</dt>
3772 <dd><p>Ignore cropping information from sps.
3773 </p></dd>
3774 <dt> &lsquo;<samp>local_header</samp>&rsquo;</dt>
3775 <dd><p>Place global headers at every keyframe instead of in extradata.
3776 </p></dd>
3777 <dt> &lsquo;<samp>chunks</samp>&rsquo;</dt>
3778 <dd><p>Frame data might be split into multiple chunks.
3779 </p></dd>
3780 <dt> &lsquo;<samp>showall</samp>&rsquo;</dt>
3781 <dd><p>Show all frames before the first keyframe.
3782 </p></dd>
3783 <dt> &lsquo;<samp>skiprd</samp>&rsquo;</dt>
3784 <dd><p>Deprecated, use mpegvideo private options instead.
3785 </p></dd>
3786 </dl>
3787
3788 </dd>
3789 <dt> &lsquo;<samp>error <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3790 <dt> &lsquo;<samp>qns <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3791 <dd><p>Deprecated, use mpegvideo private options instead.
3792 </p>
3793 </dd>
3794 <dt> &lsquo;<samp>threads <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
3795 <dd>
3796 <p>Possible values:
3797 </p><dl compact="compact">
3798 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
3799 <dd><p>detect a good number of threads
3800 </p></dd>
3801 </dl>
3802
3803 </dd>
3804 <dt> &lsquo;<samp>me_threshold <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3805 <dd><p>Set motion estimation threshold.
3806 </p>
3807 </dd>
3808 <dt> &lsquo;<samp>mb_threshold <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3809 <dd><p>Set macroblock threshold.
3810 </p>
3811 </dd>
3812 <dt> &lsquo;<samp>dc <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3813 <dd><p>Set intra_dc_precision.
3814 </p>
3815 </dd>
3816 <dt> &lsquo;<samp>nssew <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3817 <dd><p>Set nsse weight.
3818 </p>
3819 </dd>
3820 <dt> &lsquo;<samp>skip_top <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
3821 <dd><p>Set number of macroblock rows at the top which are skipped.
3822 </p>
3823 </dd>
3824 <dt> &lsquo;<samp>skip_bottom <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
3825 <dd><p>Set number of macroblock rows at the bottom which are skipped.
3826 </p>
3827 </dd>
3828 <dt> &lsquo;<samp>profile <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
3829 <dd>
3830 <p>Possible values:
3831 </p><dl compact="compact">
3832 <dt> &lsquo;<samp>unknown</samp>&rsquo;</dt>
3833 <dt> &lsquo;<samp>aac_main</samp>&rsquo;</dt>
3834 <dt> &lsquo;<samp>aac_low</samp>&rsquo;</dt>
3835 <dt> &lsquo;<samp>aac_ssr</samp>&rsquo;</dt>
3836 <dt> &lsquo;<samp>aac_ltp</samp>&rsquo;</dt>
3837 <dt> &lsquo;<samp>aac_he</samp>&rsquo;</dt>
3838 <dt> &lsquo;<samp>aac_he_v2</samp>&rsquo;</dt>
3839 <dt> &lsquo;<samp>aac_ld</samp>&rsquo;</dt>
3840 <dt> &lsquo;<samp>aac_eld</samp>&rsquo;</dt>
3841 <dt> &lsquo;<samp>mpeg2_aac_low</samp>&rsquo;</dt>
3842 <dt> &lsquo;<samp>mpeg2_aac_he</samp>&rsquo;</dt>
3843 <dt> &lsquo;<samp>dts</samp>&rsquo;</dt>
3844 <dt> &lsquo;<samp>dts_es</samp>&rsquo;</dt>
3845 <dt> &lsquo;<samp>dts_96_24</samp>&rsquo;</dt>
3846 <dt> &lsquo;<samp>dts_hd_hra</samp>&rsquo;</dt>
3847 <dt> &lsquo;<samp>dts_hd_ma</samp>&rsquo;</dt>
3848 </dl>
3849
3850 </dd>
3851 <dt> &lsquo;<samp>level <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
3852 <dd>
3853 <p>Possible values:
3854 </p><dl compact="compact">
3855 <dt> &lsquo;<samp>unknown</samp>&rsquo;</dt>
3856 </dl>
3857
3858 </dd>
3859 <dt> &lsquo;<samp>lowres <var>integer</var> (<em>decoding,audio,video</em>)</samp>&rsquo;</dt>
3860 <dd><p>Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
3861 </p>
3862 </dd>
3863 <dt> &lsquo;<samp>skip_threshold <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3864 <dd><p>Set frame skip threshold.
3865 </p>
3866 </dd>
3867 <dt> &lsquo;<samp>skip_factor <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3868 <dd><p>Set frame skip factor.
3869 </p>
3870 </dd>
3871 <dt> &lsquo;<samp>skip_exp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3872 <dd><p>Set frame skip exponent.
3873 </p>
3874 </dd>
3875 <dt> &lsquo;<samp>skipcmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3876 <dd><p>Set frame skip compare function.
3877 </p>
3878 <p>Possible values:
3879 </p><dl compact="compact">
3880 <dt> &lsquo;<samp>sad</samp>&rsquo;</dt>
3881 <dd><p>sum of absolute differences, fast (default)
3882 </p></dd>
3883 <dt> &lsquo;<samp>sse</samp>&rsquo;</dt>
3884 <dd><p>sum of squared errors
3885 </p></dd>
3886 <dt> &lsquo;<samp>satd</samp>&rsquo;</dt>
3887 <dd><p>sum of absolute Hadamard transformed differences
3888 </p></dd>
3889 <dt> &lsquo;<samp>dct</samp>&rsquo;</dt>
3890 <dd><p>sum of absolute DCT transformed differences
3891 </p></dd>
3892 <dt> &lsquo;<samp>psnr</samp>&rsquo;</dt>
3893 <dd><p>sum of squared quantization errors (avoid, low quality)
3894 </p></dd>
3895 <dt> &lsquo;<samp>bit</samp>&rsquo;</dt>
3896 <dd><p>number of bits needed for the block
3897 </p></dd>
3898 <dt> &lsquo;<samp>rd</samp>&rsquo;</dt>
3899 <dd><p>rate distortion optimal, slow
3900 </p></dd>
3901 <dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
3902 <dd><p>0
3903 </p></dd>
3904 <dt> &lsquo;<samp>vsad</samp>&rsquo;</dt>
3905 <dd><p>sum of absolute vertical differences
3906 </p></dd>
3907 <dt> &lsquo;<samp>vsse</samp>&rsquo;</dt>
3908 <dd><p>sum of squared vertical differences
3909 </p></dd>
3910 <dt> &lsquo;<samp>nsse</samp>&rsquo;</dt>
3911 <dd><p>noise preserving sum of squared differences
3912 </p></dd>
3913 <dt> &lsquo;<samp>w53</samp>&rsquo;</dt>
3914 <dd><p>5/3 wavelet, only used in snow
3915 </p></dd>
3916 <dt> &lsquo;<samp>w97</samp>&rsquo;</dt>
3917 <dd><p>9/7 wavelet, only used in snow
3918 </p></dd>
3919 <dt> &lsquo;<samp>dctmax</samp>&rsquo;</dt>
3920 <dt> &lsquo;<samp>chroma</samp>&rsquo;</dt>
3921 </dl>
3922
3923 </dd>
3924 <dt> &lsquo;<samp>border_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3925 <dd><p>Increase the quantizer for macroblocks close to borders.
3926 </p>
3927 </dd>
3928 <dt> &lsquo;<samp>mblmin <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3929 <dd><p>Set min macroblock lagrange factor (VBR).
3930 </p>
3931 </dd>
3932 <dt> &lsquo;<samp>mblmax <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3933 <dd><p>Set max macroblock lagrange factor (VBR).
3934 </p>
3935 </dd>
3936 <dt> &lsquo;<samp>mepc <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3937 <dd><p>Set motion estimation bitrate penalty compensation (1.0 = 256).
3938 </p>
3939 </dd>
3940 <dt> &lsquo;<samp>skip_loop_filter <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
3941 <dt> &lsquo;<samp>skip_idct        <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
3942 <dt> &lsquo;<samp>skip_frame       <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
3943 <dd>
3944 <p>Make decoder discard processing depending on the frame type selected
3945 by the option value.
3946 </p>
3947 <p>&lsquo;<samp>skip_loop_filter</samp>&rsquo; skips frame loop filtering, &lsquo;<samp>skip_idct</samp>&rsquo;
3948 skips frame IDCT/dequantization, &lsquo;<samp>skip_frame</samp>&rsquo; skips decoding.
3949 </p>
3950 <p>Possible values:
3951 </p><dl compact="compact">
3952 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
3953 <dd><p>Discard no frame.
3954 </p>
3955 </dd>
3956 <dt> &lsquo;<samp>default</samp>&rsquo;</dt>
3957 <dd><p>Discard useless frames like 0-sized frames.
3958 </p>
3959 </dd>
3960 <dt> &lsquo;<samp>noref</samp>&rsquo;</dt>
3961 <dd><p>Discard all non-reference frames.
3962 </p>
3963 </dd>
3964 <dt> &lsquo;<samp>bidir</samp>&rsquo;</dt>
3965 <dd><p>Discard all bidirectional frames.
3966 </p>
3967 </dd>
3968 <dt> &lsquo;<samp>nokey</samp>&rsquo;</dt>
3969 <dd><p>Discard all frames excepts keyframes.
3970 </p>
3971 </dd>
3972 <dt> &lsquo;<samp>all</samp>&rsquo;</dt>
3973 <dd><p>Discard all frames.
3974 </p></dd>
3975 </dl>
3976
3977 <p>Default value is &lsquo;<samp>default</samp>&rsquo;.
3978 </p>
3979 </dd>
3980 <dt> &lsquo;<samp>bidir_refine <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3981 <dd><p>Refine the two motion vectors used in bidirectional macroblocks.
3982 </p>
3983 </dd>
3984 <dt> &lsquo;<samp>brd_scale <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3985 <dd><p>Downscale frames for dynamic B-frame decision.
3986 </p>
3987 </dd>
3988 <dt> &lsquo;<samp>keyint_min <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3989 <dd><p>Set minimum interval between IDR-frames.
3990 </p>
3991 </dd>
3992 <dt> &lsquo;<samp>refs <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3993 <dd><p>Set reference frames to consider for motion compensation.
3994 </p>
3995 </dd>
3996 <dt> &lsquo;<samp>chromaoffset <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
3997 <dd><p>Set chroma qp offset from luma.
3998 </p>
3999 </dd>
4000 <dt> &lsquo;<samp>trellis <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
4001 <dd><p>Set rate-distortion optimal quantization.
4002 </p>
4003 </dd>
4004 <dt> &lsquo;<samp>sc_factor <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4005 <dd><p>Set value multiplied by qscale for each frame and added to
4006 scene_change_score.
4007 </p>
4008 </dd>
4009 <dt> &lsquo;<samp>mv0_threshold <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4010 <dt> &lsquo;<samp>b_sensitivity <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4011 <dd><p>Adjust sensitivity of b_frame_strategy 1.
4012 </p>
4013 </dd>
4014 <dt> &lsquo;<samp>compression_level <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
4015 <dt> &lsquo;<samp>min_prediction_order <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
4016 <dt> &lsquo;<samp>max_prediction_order <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
4017 <dt> &lsquo;<samp>timecode_frame_start <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4018 <dd><p>Set GOP timecode frame start number, in non drop frame format.
4019 </p>
4020 </dd>
4021 <dt> &lsquo;<samp>request_channels <var>integer</var> (<em>decoding,audio</em>)</samp>&rsquo;</dt>
4022 <dd><p>Set desired number of audio channels.
4023 </p>
4024 </dd>
4025 <dt> &lsquo;<samp>bits_per_raw_sample <var>integer</var></samp>&rsquo;</dt>
4026 <dt> &lsquo;<samp>channel_layout <var>integer</var> (<em>decoding/encoding,audio</em>)</samp>&rsquo;</dt>
4027 <dd>
4028 <p>Possible values:
4029 </p></dd>
4030 <dt> &lsquo;<samp>request_channel_layout <var>integer</var> (<em>decoding,audio</em>)</samp>&rsquo;</dt>
4031 <dd>
4032 <p>Possible values:
4033 </p></dd>
4034 <dt> &lsquo;<samp>rc_max_vbv_use <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4035 <dt> &lsquo;<samp>rc_min_vbv_use <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4036 <dt> &lsquo;<samp>ticks_per_frame <var>integer</var> (<em>decoding/encoding,audio,video</em>)</samp>&rsquo;</dt>
4037 <dt> &lsquo;<samp>color_primaries <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
4038 <dt> &lsquo;<samp>color_trc <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
4039 <dt> &lsquo;<samp>colorspace <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
4040 <dt> &lsquo;<samp>color_range <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
4041 <dt> &lsquo;<samp>chroma_sample_location <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
4042 <dt> &lsquo;<samp>log_level_offset <var>integer</var></samp>&rsquo;</dt>
4043 <dd><p>Set the log level offset.
4044 </p>
4045 </dd>
4046 <dt> &lsquo;<samp>slices <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4047 <dd><p>Number of slices, used in parallelized encoding.
4048 </p>
4049 </dd>
4050 <dt> &lsquo;<samp>thread_type <var>flags</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
4051 <dd><p>Select multithreading type.
4052 </p>
4053 <p>Possible values:
4054 </p><dl compact="compact">
4055 <dt> &lsquo;<samp>slice</samp>&rsquo;</dt>
4056 <dt> &lsquo;<samp>frame</samp>&rsquo;</dt>
4057 </dl>
4058 </dd>
4059 <dt> &lsquo;<samp>audio_service_type <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
4060 <dd><p>Set audio service type.
4061 </p>
4062 <p>Possible values:
4063 </p><dl compact="compact">
4064 <dt> &lsquo;<samp>ma</samp>&rsquo;</dt>
4065 <dd><p>Main Audio Service
4066 </p></dd>
4067 <dt> &lsquo;<samp>ef</samp>&rsquo;</dt>
4068 <dd><p>Effects
4069 </p></dd>
4070 <dt> &lsquo;<samp>vi</samp>&rsquo;</dt>
4071 <dd><p>Visually Impaired
4072 </p></dd>
4073 <dt> &lsquo;<samp>hi</samp>&rsquo;</dt>
4074 <dd><p>Hearing Impaired
4075 </p></dd>
4076 <dt> &lsquo;<samp>di</samp>&rsquo;</dt>
4077 <dd><p>Dialogue
4078 </p></dd>
4079 <dt> &lsquo;<samp>co</samp>&rsquo;</dt>
4080 <dd><p>Commentary
4081 </p></dd>
4082 <dt> &lsquo;<samp>em</samp>&rsquo;</dt>
4083 <dd><p>Emergency
4084 </p></dd>
4085 <dt> &lsquo;<samp>vo</samp>&rsquo;</dt>
4086 <dd><p>Voice Over
4087 </p></dd>
4088 <dt> &lsquo;<samp>ka</samp>&rsquo;</dt>
4089 <dd><p>Karaoke
4090 </p></dd>
4091 </dl>
4092
4093 </dd>
4094 <dt> &lsquo;<samp>request_sample_fmt <var>sample_fmt</var> (<em>decoding,audio</em>)</samp>&rsquo;</dt>
4095 <dd><p>Set sample format audio decoders should prefer. Default value is
4096 <code>none</code>.
4097 </p>
4098 </dd>
4099 <dt> &lsquo;<samp>pkt_timebase <var>rational number</var></samp>&rsquo;</dt>
4100 <dt> &lsquo;<samp>sub_charenc <var>encoding</var> (<em>decoding,subtitles</em>)</samp>&rsquo;</dt>
4101 <dd><p>Set the input subtitles character encoding.
4102 </p>
4103 </dd>
4104 <dt> &lsquo;<samp>field_order  <var>field_order</var> (<em>video</em>)</samp>&rsquo;</dt>
4105 <dd><p>Set/override the field order of the video.
4106 Possible values:
4107 </p><dl compact="compact">
4108 <dt> &lsquo;<samp>progressive</samp>&rsquo;</dt>
4109 <dd><p>Progressive video
4110 </p></dd>
4111 <dt> &lsquo;<samp>tt</samp>&rsquo;</dt>
4112 <dd><p>Interlaced video, top field coded and displayed first
4113 </p></dd>
4114 <dt> &lsquo;<samp>bb</samp>&rsquo;</dt>
4115 <dd><p>Interlaced video, bottom field coded and displayed first
4116 </p></dd>
4117 <dt> &lsquo;<samp>tb</samp>&rsquo;</dt>
4118 <dd><p>Interlaced video, top coded first, bottom displayed first
4119 </p></dd>
4120 <dt> &lsquo;<samp>bt</samp>&rsquo;</dt>
4121 <dd><p>Interlaced video, bottom coded first, top displayed first
4122 </p></dd>
4123 </dl>
4124
4125 </dd>
4126 <dt> &lsquo;<samp>skip_alpha <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
4127 <dd><p>Set to 1 to disable processing alpha (transparency). This works like the
4128 &lsquo;<samp>gray</samp>&rsquo; flag in the &lsquo;<samp>flags</samp>&rsquo; option which skips chroma information
4129 instead of alpha. Default is 0.
4130 </p></dd>
4131 </dl>
4132
4133
4134 <a name="Decoders"></a>
4135 <h1 class="chapter"><a href="ffplay-all.html#toc-Decoders">8. Decoders</a></h1>
4136
4137 <p>Decoders are configured elements in FFmpeg which allow the decoding of
4138 multimedia streams.
4139 </p>
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>.
4144 </p>
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>.
4149 </p>
4150 <p>The option <code>-codecs</code> of the ff* tools will display the list of
4151 enabled decoders.
4152 </p>
4153
4154 <a name="Video-Decoders"></a>
4155 <h1 class="chapter"><a href="ffplay-all.html#toc-Video-Decoders">9. Video Decoders</a></h1>
4156
4157 <p>A description of some of the currently available video decoders
4158 follows.
4159 </p>
4160 <a name="rawvideo-1"></a>
4161 <h2 class="section"><a href="ffplay-all.html#toc-rawvideo-1">9.1 rawvideo</a></h2>
4162
4163 <p>Raw video decoder.
4164 </p>
4165 <p>This decoder decodes rawvideo streams.
4166 </p>
4167 <a name="Options-9"></a>
4168 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-9">9.1.1 Options</a></h3>
4169
4170 <dl compact="compact">
4171 <dt> &lsquo;<samp>top <var>top_field_first</var></samp>&rsquo;</dt>
4172 <dd><p>Specify the assumed field type of the input video.
4173 </p><dl compact="compact">
4174 <dt> &lsquo;<samp>-1</samp>&rsquo;</dt>
4175 <dd><p>the video is assumed to be progressive (default)
4176 </p></dd>
4177 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
4178 <dd><p>bottom-field-first is assumed
4179 </p></dd>
4180 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
4181 <dd><p>top-field-first is assumed
4182 </p></dd>
4183 </dl>
4184
4185 </dd>
4186 </dl>
4187
4188
4189 <a name="Audio-Decoders"></a>
4190 <h1 class="chapter"><a href="ffplay-all.html#toc-Audio-Decoders">10. Audio Decoders</a></h1>
4191
4192 <a name="ffwavesynth"></a>
4193 <h2 class="section"><a href="ffplay-all.html#toc-ffwavesynth">10.1 ffwavesynth</a></h2>
4194
4195 <p>Internal wave synthetizer.
4196 </p>
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
4199 documented.
4200 </p>
4201 <a name="libcelt"></a>
4202 <h2 class="section"><a href="ffplay-all.html#toc-libcelt">10.2 libcelt</a></h2>
4203
4204 <p>libcelt decoder wrapper.
4205 </p>
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>.
4209 </p>
4210 <a name="libgsm"></a>
4211 <h2 class="section"><a href="ffplay-all.html#toc-libgsm">10.3 libgsm</a></h2>
4212
4213 <p>libgsm decoder wrapper.
4214 </p>
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>.
4218 </p>
4219 <p>This decoder supports both the ordinary GSM and the Microsoft variant.
4220 </p>
4221 <a name="libilbc"></a>
4222 <h2 class="section"><a href="ffplay-all.html#toc-libilbc">10.4 libilbc</a></h2>
4223
4224 <p>libilbc decoder wrapper.
4225 </p>
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>.
4230 </p>
4231 <a name="Options"></a>
4232 <h3 class="subsection"><a href="ffplay-all.html#toc-Options">10.4.1 Options</a></h3>
4233
4234 <p>The following option is supported by the libilbc wrapper.
4235 </p>
4236 <dl compact="compact">
4237 <dt> &lsquo;<samp>enhance</samp>&rsquo;</dt>
4238 <dd>
4239 <p>Enable the enhancement of the decoded audio when set to 1. The default
4240 value is 0 (disabled).
4241 </p>
4242 </dd>
4243 </dl>
4244
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>
4247
4248 <p>libopencore-amrnb decoder wrapper.
4249 </p>
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>.
4254 </p>
4255 <p>An FFmpeg native decoder for AMR-NB exists, so users can decode AMR-NB
4256 without this library.
4257 </p>
4258 <a name="libopencore_002damrwb"></a>
4259 <h2 class="section"><a href="ffplay-all.html#toc-libopencore_002damrwb">10.6 libopencore-amrwb</a></h2>
4260
4261 <p>libopencore-amrwb decoder wrapper.
4262 </p>
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>.
4267 </p>
4268 <p>An FFmpeg native decoder for AMR-WB exists, so users can decode AMR-WB
4269 without this library.
4270 </p>
4271 <a name="libopus"></a>
4272 <h2 class="section"><a href="ffplay-all.html#toc-libopus">10.7 libopus</a></h2>
4273
4274 <p>libopus decoder wrapper.
4275 </p>
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>.
4280 </p>
4281
4282 <a name="Subtitles-Decoders"></a>
4283 <h1 class="chapter"><a href="ffplay-all.html#toc-Subtitles-Decoders">11. Subtitles Decoders</a></h1>
4284
4285 <a name="dvdsub"></a>
4286 <h2 class="section"><a href="ffplay-all.html#toc-dvdsub">11.1 dvdsub</a></h2>
4287
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.
4290 </p>
4291 <a name="Options-24"></a>
4292 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-24">11.1.1 Options</a></h3>
4293
4294 <dl compact="compact">
4295 <dt> &lsquo;<samp>palette</samp>&rsquo;</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.
4301 </p>
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>.
4306 </p></dd>
4307 </dl>
4308
4309 <a name="libzvbi_002dteletext"></a>
4310 <h2 class="section"><a href="ffplay-all.html#toc-libzvbi_002dteletext">11.2 libzvbi-teletext</a></h2>
4311
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>.
4316 </p>
4317 <a name="Options-7"></a>
4318 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-7">11.2.1 Options</a></h3>
4319
4320 <dl compact="compact">
4321 <dt> &lsquo;<samp>txt_page</samp>&rsquo;</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.
4324 Default value is *.
4325 </p></dd>
4326 <dt> &lsquo;<samp>txt_chop_top</samp>&rsquo;</dt>
4327 <dd><p>Discards the top teletext line. Default value is 1.
4328 </p></dd>
4329 <dt> &lsquo;<samp>txt_format</samp>&rsquo;</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 &quot;bitmap&quot; for teletext pages, because certain graphics and colors cannot be
4333 expressed in simple text. You might use &quot;text&quot; for teletext based subtitles if
4334 your application can handle simple text based subtitles. Default value is
4335 bitmap.
4336 </p></dd>
4337 <dt> &lsquo;<samp>txt_left</samp>&rsquo;</dt>
4338 <dd><p>X offset of generated bitmaps, default is 0.
4339 </p></dd>
4340 <dt> &lsquo;<samp>txt_top</samp>&rsquo;</dt>
4341 <dd><p>Y offset of generated bitmaps, default is 0.
4342 </p></dd>
4343 <dt> &lsquo;<samp>txt_chop_spaces</samp>&rsquo;</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.
4348 Default value is 1.
4349 </p></dd>
4350 <dt> &lsquo;<samp>txt_duration</samp>&rsquo;</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.
4353 </p></dd>
4354 <dt> &lsquo;<samp>txt_transparent</samp>&rsquo;</dt>
4355 <dd><p>Force transparent background of the generated teletext bitmaps. Default value
4356 is 0 which means an opaque (black) background.
4357 </p></dd>
4358 </dl>
4359
4360 <a name="Encoders"></a>
4361 <h1 class="chapter"><a href="ffplay-all.html#toc-Encoders">12. Encoders</a></h1>
4362
4363 <p>Encoders are configured elements in FFmpeg which allow the encoding of
4364 multimedia streams.
4365 </p>
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>.
4370 </p>
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>.
4375 </p>
4376 <p>The option <code>-codecs</code> of the ff* tools will display the list of
4377 enabled encoders.
4378 </p>
4379
4380 <a name="Audio-Encoders"></a>
4381 <h1 class="chapter"><a href="ffplay-all.html#toc-Audio-Encoders">13. Audio Encoders</a></h1>
4382
4383 <p>A description of some of the currently available audio encoders
4384 follows.
4385 </p>
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>
4389
4390 <p>Advanced Audio Coding (AAC) encoder.
4391 </p>
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 &lsquo;<samp>strict</samp>&rsquo; option to &lsquo;<samp>experimental</samp>&rsquo; or lower.
4395 </p>
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.
4399 </p>
4400 <p>See also <a href="#libfdk_002daac_002denc">libfdk_aac</a> and <a href="#libfaac">libfaac</a>.
4401 </p>
4402 <a name="Options-27"></a>
4403 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-27">13.1.1 Options</a></h3>
4404
4405 <dl compact="compact">
4406 <dt> &lsquo;<samp>b</samp>&rsquo;</dt>
4407 <dd><p>Set bit rate in bits/s. Setting this automatically activates constant bit rate
4408 (CBR) mode.
4409 </p>
4410 </dd>
4411 <dt> &lsquo;<samp>q</samp>&rsquo;</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 &lsquo;<samp>global_quality</samp>&rsquo;.
4415 </p>
4416 </dd>
4417 <dt> &lsquo;<samp>stereo_mode</samp>&rsquo;</dt>
4418 <dd><p>Set stereo encoding mode. Possible values:
4419 </p>
4420 <dl compact="compact">
4421 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
4422 <dd><p>Automatically selected by the encoder.
4423 </p>
4424 </dd>
4425 <dt> &lsquo;<samp>ms_off</samp>&rsquo;</dt>
4426 <dd><p>Disable middle/side encoding. This is the default.
4427 </p>
4428 </dd>
4429 <dt> &lsquo;<samp>ms_force</samp>&rsquo;</dt>
4430 <dd><p>Force middle/side encoding.
4431 </p></dd>
4432 </dl>
4433
4434 </dd>
4435 <dt> &lsquo;<samp>aac_coder</samp>&rsquo;</dt>
4436 <dd><p>Set AAC encoder coding method. Possible values:
4437 </p>
4438 <dl compact="compact">
4439 <dt> &lsquo;<samp>faac</samp>&rsquo;</dt>
4440 <dd><p>FAAC-inspired method.
4441 </p>
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.
4446 </p>
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.
4449 </p>
4450 </dd>
4451 <dt> &lsquo;<samp>anmr</samp>&rsquo;</dt>
4452 <dd><p>Average noise to mask ratio (ANMR) trellis-based solution.
4453 </p>
4454 <p>This has a theoretic best quality out of all the coding methods, but at the
4455 cost of the slowest speed.
4456 </p>
4457 </dd>
4458 <dt> &lsquo;<samp>twoloop</samp>&rsquo;</dt>
4459 <dd><p>Two loop searching (TLS) method.
4460 </p>
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.
4464 </p>
4465 <p>This method produces similar quality with the FAAC method and is the default.
4466 </p>
4467 </dd>
4468 <dt> &lsquo;<samp>fast</samp>&rsquo;</dt>
4469 <dd><p>Constant quantizer method.
4470 </p>
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.
4473 </p>
4474 </dd>
4475 </dl>
4476
4477 </dd>
4478 </dl>
4479
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>
4482
4483 <p>AC-3 audio encoders.
4484 </p>
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).
4487 </p>
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.
4495 </p>
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>
4498
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.
4506 </p>
4507 <p>These parameters are described in detail in several publicly-available
4508 documents.
4509 </p><ul>
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>
4514 </li></ul>
4515
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>
4518
4519 <dl compact="compact">
4520 <dt> &lsquo;<samp>-per_frame_metadata <var>boolean</var></samp>&rsquo;</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> &lsquo;<samp>0</samp>&rsquo;</dt>
4525 <dd><p>The metadata values set at initialization will be used for every frame in the
4526 stream. (default)
4527 </p></dd>
4528 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
4529 <dd><p>Metadata values can be changed before encoding each frame.
4530 </p></dd>
4531 </dl>
4532
4533 </dd>
4534 </dl>
4535
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>
4538
4539 <dl compact="compact">
4540 <dt> &lsquo;<samp>-center_mixlev <var>level</var></samp>&rsquo;</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> &lsquo;<samp>0.707</samp>&rsquo;</dt>
4547 <dd><p>Apply -3dB gain
4548 </p></dd>
4549 <dt> &lsquo;<samp>0.595</samp>&rsquo;</dt>
4550 <dd><p>Apply -4.5dB gain (default)
4551 </p></dd>
4552 <dt> &lsquo;<samp>0.500</samp>&rsquo;</dt>
4553 <dd><p>Apply -6dB gain
4554 </p></dd>
4555 </dl>
4556
4557 </dd>
4558 <dt> &lsquo;<samp>-surround_mixlev <var>level</var></samp>&rsquo;</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> &lsquo;<samp>0.707</samp>&rsquo;</dt>
4565 <dd><p>Apply -3dB gain
4566 </p></dd>
4567 <dt> &lsquo;<samp>0.500</samp>&rsquo;</dt>
4568 <dd><p>Apply -6dB gain (default)
4569 </p></dd>
4570 <dt> &lsquo;<samp>0.000</samp>&rsquo;</dt>
4571 <dd><p>Silence Surround Channel(s)
4572 </p></dd>
4573 </dl>
4574
4575 </dd>
4576 </dl>
4577
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.
4582 </p>
4583 <dl compact="compact">
4584 <dt> &lsquo;<samp>-mixing_level <var>number</var></samp>&rsquo;</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.
4591 </p>
4592 </dd>
4593 <dt> &lsquo;<samp>-room_type <var>type</var></samp>&rsquo;</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> &lsquo;<samp>0</samp>&rsquo;</dt>
4601 <dt> &lsquo;<samp>notindicated</samp>&rsquo;</dt>
4602 <dd><p>Not Indicated (default)
4603 </p></dd>
4604 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
4605 <dt> &lsquo;<samp>large</samp>&rsquo;</dt>
4606 <dd><p>Large Room
4607 </p></dd>
4608 <dt> &lsquo;<samp>2</samp>&rsquo;</dt>
4609 <dt> &lsquo;<samp>small</samp>&rsquo;</dt>
4610 <dd><p>Small Room
4611 </p></dd>
4612 </dl>
4613
4614 </dd>
4615 </dl>
4616
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>
4619
4620 <dl compact="compact">
4621 <dt> &lsquo;<samp>-copyright <var>boolean</var></samp>&rsquo;</dt>
4622 <dd><p>Copyright Indicator. Specifies whether a copyright exists for this audio.
4623 </p><dl compact="compact">
4624 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
4625 <dt> &lsquo;<samp>off</samp>&rsquo;</dt>
4626 <dd><p>No Copyright Exists (default)
4627 </p></dd>
4628 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
4629 <dt> &lsquo;<samp>on</samp>&rsquo;</dt>
4630 <dd><p>Copyright Exists
4631 </p></dd>
4632 </dl>
4633
4634 </dd>
4635 <dt> &lsquo;<samp>-dialnorm <var>value</var></samp>&rsquo;</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.
4643 </p>
4644 </dd>
4645 <dt> &lsquo;<samp>-dsur_mode <var>mode</var></samp>&rsquo;</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> &lsquo;<samp>0</samp>&rsquo;</dt>
4652 <dt> &lsquo;<samp>notindicated</samp>&rsquo;</dt>
4653 <dd><p>Not Indicated (default)
4654 </p></dd>
4655 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
4656 <dt> &lsquo;<samp>off</samp>&rsquo;</dt>
4657 <dd><p>Not Dolby Surround Encoded
4658 </p></dd>
4659 <dt> &lsquo;<samp>2</samp>&rsquo;</dt>
4660 <dt> &lsquo;<samp>on</samp>&rsquo;</dt>
4661 <dd><p>Dolby Surround Encoded
4662 </p></dd>
4663 </dl>
4664
4665 </dd>
4666 <dt> &lsquo;<samp>-original <var>boolean</var></samp>&rsquo;</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> &lsquo;<samp>0</samp>&rsquo;</dt>
4671 <dt> &lsquo;<samp>off</samp>&rsquo;</dt>
4672 <dd><p>Not Original Source
4673 </p></dd>
4674 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
4675 <dt> &lsquo;<samp>on</samp>&rsquo;</dt>
4676 <dd><p>Original Source (default)
4677 </p></dd>
4678 </dl>
4679
4680 </dd>
4681 </dl>
4682
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
4692 Syntax.
4693 </p>
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>
4696
4697 <dl compact="compact">
4698 <dt> &lsquo;<samp>-dmix_mode <var>mode</var></samp>&rsquo;</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> &lsquo;<samp>0</samp>&rsquo;</dt>
4703 <dt> &lsquo;<samp>notindicated</samp>&rsquo;</dt>
4704 <dd><p>Not Indicated (default)
4705 </p></dd>
4706 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
4707 <dt> &lsquo;<samp>ltrt</samp>&rsquo;</dt>
4708 <dd><p>Lt/Rt Downmix Preferred
4709 </p></dd>
4710 <dt> &lsquo;<samp>2</samp>&rsquo;</dt>
4711 <dt> &lsquo;<samp>loro</samp>&rsquo;</dt>
4712 <dd><p>Lo/Ro Downmix Preferred
4713 </p></dd>
4714 </dl>
4715
4716 </dd>
4717 <dt> &lsquo;<samp>-ltrt_cmixlev <var>level</var></samp>&rsquo;</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> &lsquo;<samp>1.414</samp>&rsquo;</dt>
4722 <dd><p>Apply +3dB gain
4723 </p></dd>
4724 <dt> &lsquo;<samp>1.189</samp>&rsquo;</dt>
4725 <dd><p>Apply +1.5dB gain
4726 </p></dd>
4727 <dt> &lsquo;<samp>1.000</samp>&rsquo;</dt>
4728 <dd><p>Apply 0dB gain
4729 </p></dd>
4730 <dt> &lsquo;<samp>0.841</samp>&rsquo;</dt>
4731 <dd><p>Apply -1.5dB gain
4732 </p></dd>
4733 <dt> &lsquo;<samp>0.707</samp>&rsquo;</dt>
4734 <dd><p>Apply -3.0dB gain
4735 </p></dd>
4736 <dt> &lsquo;<samp>0.595</samp>&rsquo;</dt>
4737 <dd><p>Apply -4.5dB gain (default)
4738 </p></dd>
4739 <dt> &lsquo;<samp>0.500</samp>&rsquo;</dt>
4740 <dd><p>Apply -6.0dB gain
4741 </p></dd>
4742 <dt> &lsquo;<samp>0.000</samp>&rsquo;</dt>
4743 <dd><p>Silence Center Channel
4744 </p></dd>
4745 </dl>
4746
4747 </dd>
4748 <dt> &lsquo;<samp>-ltrt_surmixlev <var>level</var></samp>&rsquo;</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> &lsquo;<samp>0.841</samp>&rsquo;</dt>
4753 <dd><p>Apply -1.5dB gain
4754 </p></dd>
4755 <dt> &lsquo;<samp>0.707</samp>&rsquo;</dt>
4756 <dd><p>Apply -3.0dB gain
4757 </p></dd>
4758 <dt> &lsquo;<samp>0.595</samp>&rsquo;</dt>
4759 <dd><p>Apply -4.5dB gain
4760 </p></dd>
4761 <dt> &lsquo;<samp>0.500</samp>&rsquo;</dt>
4762 <dd><p>Apply -6.0dB gain (default)
4763 </p></dd>
4764 <dt> &lsquo;<samp>0.000</samp>&rsquo;</dt>
4765 <dd><p>Silence Surround Channel(s)
4766 </p></dd>
4767 </dl>
4768
4769 </dd>
4770 <dt> &lsquo;<samp>-loro_cmixlev <var>level</var></samp>&rsquo;</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> &lsquo;<samp>1.414</samp>&rsquo;</dt>
4775 <dd><p>Apply +3dB gain
4776 </p></dd>
4777 <dt> &lsquo;<samp>1.189</samp>&rsquo;</dt>
4778 <dd><p>Apply +1.5dB gain
4779 </p></dd>
4780 <dt> &lsquo;<samp>1.000</samp>&rsquo;</dt>
4781 <dd><p>Apply 0dB gain
4782 </p></dd>
4783 <dt> &lsquo;<samp>0.841</samp>&rsquo;</dt>
4784 <dd><p>Apply -1.5dB gain
4785 </p></dd>
4786 <dt> &lsquo;<samp>0.707</samp>&rsquo;</dt>
4787 <dd><p>Apply -3.0dB gain
4788 </p></dd>
4789 <dt> &lsquo;<samp>0.595</samp>&rsquo;</dt>
4790 <dd><p>Apply -4.5dB gain (default)
4791 </p></dd>
4792 <dt> &lsquo;<samp>0.500</samp>&rsquo;</dt>
4793 <dd><p>Apply -6.0dB gain
4794 </p></dd>
4795 <dt> &lsquo;<samp>0.000</samp>&rsquo;</dt>
4796 <dd><p>Silence Center Channel
4797 </p></dd>
4798 </dl>
4799
4800 </dd>
4801 <dt> &lsquo;<samp>-loro_surmixlev <var>level</var></samp>&rsquo;</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> &lsquo;<samp>0.841</samp>&rsquo;</dt>
4806 <dd><p>Apply -1.5dB gain
4807 </p></dd>
4808 <dt> &lsquo;<samp>0.707</samp>&rsquo;</dt>
4809 <dd><p>Apply -3.0dB gain
4810 </p></dd>
4811 <dt> &lsquo;<samp>0.595</samp>&rsquo;</dt>
4812 <dd><p>Apply -4.5dB gain
4813 </p></dd>
4814 <dt> &lsquo;<samp>0.500</samp>&rsquo;</dt>
4815 <dd><p>Apply -6.0dB gain (default)
4816 </p></dd>
4817 <dt> &lsquo;<samp>0.000</samp>&rsquo;</dt>
4818 <dd><p>Silence Surround Channel(s)
4819 </p></dd>
4820 </dl>
4821
4822 </dd>
4823 </dl>
4824
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>
4827
4828 <dl compact="compact">
4829 <dt> &lsquo;<samp>-dsurex_mode <var>mode</var></samp>&rsquo;</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> &lsquo;<samp>0</samp>&rsquo;</dt>
4835 <dt> &lsquo;<samp>notindicated</samp>&rsquo;</dt>
4836 <dd><p>Not Indicated (default)
4837 </p></dd>
4838 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
4839 <dt> &lsquo;<samp>on</samp>&rsquo;</dt>
4840 <dd><p>Dolby Surround EX Off
4841 </p></dd>
4842 <dt> &lsquo;<samp>2</samp>&rsquo;</dt>
4843 <dt> &lsquo;<samp>off</samp>&rsquo;</dt>
4844 <dd><p>Dolby Surround EX On
4845 </p></dd>
4846 </dl>
4847
4848 </dd>
4849 <dt> &lsquo;<samp>-dheadphone_mode <var>mode</var></samp>&rsquo;</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
4853 processing.
4854 </p><dl compact="compact">
4855 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
4856 <dt> &lsquo;<samp>notindicated</samp>&rsquo;</dt>
4857 <dd><p>Not Indicated (default)
4858 </p></dd>
4859 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
4860 <dt> &lsquo;<samp>on</samp>&rsquo;</dt>
4861 <dd><p>Dolby Headphone Off
4862 </p></dd>
4863 <dt> &lsquo;<samp>2</samp>&rsquo;</dt>
4864 <dt> &lsquo;<samp>off</samp>&rsquo;</dt>
4865 <dd><p>Dolby Headphone On
4866 </p></dd>
4867 </dl>
4868
4869 </dd>
4870 <dt> &lsquo;<samp>-ad_conv_type <var>type</var></samp>&rsquo;</dt>
4871 <dd><p>A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
4872 conversion.
4873 </p><dl compact="compact">
4874 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
4875 <dt> &lsquo;<samp>standard</samp>&rsquo;</dt>
4876 <dd><p>Standard A/D Converter (default)
4877 </p></dd>
4878 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
4879 <dt> &lsquo;<samp>hdcd</samp>&rsquo;</dt>
4880 <dd><p>HDCD A/D Converter
4881 </p></dd>
4882 </dl>
4883
4884 </dd>
4885 </dl>
4886
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>
4889
4890 <dl compact="compact">
4891 <dt> &lsquo;<samp>-stereo_rematrixing <var>boolean</var></samp>&rsquo;</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.
4896 </p>
4897 </dd>
4898 </dl>
4899
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>
4902
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.
4906 </p>
4907 <dl compact="compact">
4908 <dt> &lsquo;<samp>-channel_coupling <var>boolean</var></samp>&rsquo;</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> &lsquo;<samp>-1</samp>&rsquo;</dt>
4919 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
4920 <dd><p>Selected by Encoder (default)
4921 </p></dd>
4922 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
4923 <dt> &lsquo;<samp>off</samp>&rsquo;</dt>
4924 <dd><p>Disable Channel Coupling
4925 </p></dd>
4926 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
4927 <dt> &lsquo;<samp>on</samp>&rsquo;</dt>
4928 <dd><p>Enable Channel Coupling
4929 </p></dd>
4930 </dl>
4931
4932 </dd>
4933 <dt> &lsquo;<samp>-cpl_start_band <var>number</var></samp>&rsquo;</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> &lsquo;<samp>-1</samp>&rsquo;</dt>
4941 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
4942 <dd><p>Selected by Encoder (default)
4943 </p></dd>
4944 </dl>
4945
4946 </dd>
4947 </dl>
4948
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>
4952
4953 <p>libfaac AAC (Advanced Audio Coding) encoder wrapper.
4954 </p>
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>.
4958 </p>
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>.
4961 </p>
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>.
4964 </p>
4965 <a name="Options-28"></a>
4966 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-28">13.3.1 Options</a></h3>
4967
4968 <p>The following shared FFmpeg codec options are recognized.
4969 </p>
4970 <p>The following options are supported by the libfaac wrapper. The
4971 <code>faac</code>-equivalent of the options are listed in parentheses.
4972 </p>
4973 <dl compact="compact">
4974 <dt> &lsquo;<samp>b (<em>-b</em>)</samp>&rsquo;</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.
4979 </p>
4980 <p>Note that libfaac does not support CBR (Constant Bit Rate) but only
4981 ABR (Average Bit Rate).
4982 </p>
4983 <p>If VBR mode is enabled this option is ignored.
4984 </p>
4985 </dd>
4986 <dt> &lsquo;<samp>ar (<em>-R</em>)</samp>&rsquo;</dt>
4987 <dd><p>Set audio sampling rate (in Hz).
4988 </p>
4989 </dd>
4990 <dt> &lsquo;<samp>ac (<em>-c</em>)</samp>&rsquo;</dt>
4991 <dd><p>Set the number of audio channels.
4992 </p>
4993 </dd>
4994 <dt> &lsquo;<samp>cutoff (<em>-C</em>)</samp>&rsquo;</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
4997 is 0.
4998 </p>
4999 </dd>
5000 <dt> &lsquo;<samp>profile</samp>&rsquo;</dt>
5001 <dd><p>Set audio profile.
5002 </p>
5003 <p>The following profiles are recognized:
5004 </p><dl compact="compact">
5005 <dt> &lsquo;<samp>aac_main</samp>&rsquo;</dt>
5006 <dd><p>Main AAC (Main)
5007 </p>
5008 </dd>
5009 <dt> &lsquo;<samp>aac_low</samp>&rsquo;</dt>
5010 <dd><p>Low Complexity AAC (LC)
5011 </p>
5012 </dd>
5013 <dt> &lsquo;<samp>aac_ssr</samp>&rsquo;</dt>
5014 <dd><p>Scalable Sample Rate (SSR)
5015 </p>
5016 </dd>
5017 <dt> &lsquo;<samp>aac_ltp</samp>&rsquo;</dt>
5018 <dd><p>Long Term Prediction (LTP)
5019 </p></dd>
5020 </dl>
5021
5022 <p>If not specified it is set to &lsquo;<samp>aac_low</samp>&rsquo;.
5023 </p>
5024 </dd>
5025 <dt> &lsquo;<samp>flags +qscale</samp>&rsquo;</dt>
5026 <dd><p>Set constant quality VBR (Variable Bit Rate) mode.
5027 </p>
5028 </dd>
5029 <dt> &lsquo;<samp>global_quality</samp>&rsquo;</dt>
5030 <dd><p>Set quality in VBR mode as an integer number of lambda units.
5031 </p>
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
5036 higher the quality.
5037 </p>
5038 </dd>
5039 <dt> &lsquo;<samp>q (<em>-q</em>)</samp>&rsquo;</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.
5042 </p>
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
5045 quality.
5046 </p>
5047 <p>This option is valid only using the <code>ffmpeg</code> command-line
5048 tool. For library interface users, use &lsquo;<samp>global_quality</samp>&rsquo;.
5049 </p></dd>
5050 </dl>
5051
5052 <a name="Examples-43"></a>
5053 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-43">13.3.2 Examples</a></h3>
5054
5055 <ul>
5056 <li>
5057 Use <code>ffmpeg</code> to convert an audio file to ABR 128 kbps AAC in an M4A (MP4)
5058 container:
5059 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i input.wav -codec:a libfaac -b:a 128k -output.m4a
5060 </pre></td></tr></table>
5061
5062 </li><li>
5063 Use <code>ffmpeg</code> to convert an audio file to VBR AAC, using the
5064 LTP AAC profile:
5065 <table><tr><td>&nbsp;</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>
5067 </li></ul>
5068
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>
5072
5073 <p>libfdk-aac AAC (Advanced Audio Coding) encoder wrapper.
5074 </p>
5075 <p>The libfdk-aac library is based on the Fraunhofer FDK AAC code from
5076 the Android project.
5077 </p>
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>.
5083 </p>
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>.
5087 </p>
5088 <p>VBR encoding, enabled through the &lsquo;<samp>vbr</samp>&rsquo; or &lsquo;<samp>flags
5089 +qscale</samp>&rsquo; options, is experimental and only works with some
5090 combinations of parameters.
5091 </p>
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>.
5094 </p>
5095 <a name="Options-8"></a>
5096 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-8">13.4.1 Options</a></h3>
5097
5098 <p>The following options are mapped on the shared FFmpeg codec options.
5099 </p>
5100 <dl compact="compact">
5101 <dt> &lsquo;<samp>b</samp>&rsquo;</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
5104 profile.
5105 </p>
5106 <p>In case VBR mode is enabled the option is ignored.
5107 </p>
5108 </dd>
5109 <dt> &lsquo;<samp>ar</samp>&rsquo;</dt>
5110 <dd><p>Set audio sampling rate (in Hz).
5111 </p>
5112 </dd>
5113 <dt> &lsquo;<samp>channels</samp>&rsquo;</dt>
5114 <dd><p>Set the number of audio channels.
5115 </p>
5116 </dd>
5117 <dt> &lsquo;<samp>flags +qscale</samp>&rsquo;</dt>
5118 <dd><p>Enable fixed quality, VBR (Variable Bit Rate) mode.
5119 Note that VBR is implicitly enabled when the &lsquo;<samp>vbr</samp>&rsquo; value is
5120 positive.
5121 </p>
5122 </dd>
5123 <dt> &lsquo;<samp>cutoff</samp>&rsquo;</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
5126 is 0.
5127 </p>
5128 </dd>
5129 <dt> &lsquo;<samp>profile</samp>&rsquo;</dt>
5130 <dd><p>Set audio profile.
5131 </p>
5132 <p>The following profiles are recognized:
5133 </p><dl compact="compact">
5134 <dt> &lsquo;<samp>aac_low</samp>&rsquo;</dt>
5135 <dd><p>Low Complexity AAC (LC)
5136 </p>
5137 </dd>
5138 <dt> &lsquo;<samp>aac_he</samp>&rsquo;</dt>
5139 <dd><p>High Efficiency AAC (HE-AAC)
5140 </p>
5141 </dd>
5142 <dt> &lsquo;<samp>aac_he_v2</samp>&rsquo;</dt>
5143 <dd><p>High Efficiency AAC version 2 (HE-AACv2)
5144 </p>
5145 </dd>
5146 <dt> &lsquo;<samp>aac_ld</samp>&rsquo;</dt>
5147 <dd><p>Low Delay AAC (LD)
5148 </p>
5149 </dd>
5150 <dt> &lsquo;<samp>aac_eld</samp>&rsquo;</dt>
5151 <dd><p>Enhanced Low Delay AAC (ELD)
5152 </p></dd>
5153 </dl>
5154
5155 <p>If not specified it is set to &lsquo;<samp>aac_low</samp>&rsquo;.
5156 </p></dd>
5157 </dl>
5158
5159 <p>The following are private options of the libfdk_aac encoder.
5160 </p>
5161 <dl compact="compact">
5162 <dt> &lsquo;<samp>afterburner</samp>&rsquo;</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.
5165 </p>
5166 <p>Default value is 1.
5167 </p>
5168 </dd>
5169 <dt> &lsquo;<samp>eld_sbr</samp>&rsquo;</dt>
5170 <dd><p>Enable SBR (Spectral Band Replication) for ELD if set to 1, disabled
5171 if set to 0.
5172 </p>
5173 <p>Default value is 0.
5174 </p>
5175 </dd>
5176 <dt> &lsquo;<samp>signaling</samp>&rsquo;</dt>
5177 <dd><p>Set SBR/PS signaling style.
5178 </p>
5179 <p>It can assume one of the following values:
5180 </p><dl compact="compact">
5181 <dt> &lsquo;<samp>default</samp>&rsquo;</dt>
5182 <dd><p>choose signaling implicitly (explicit hierarchical by default,
5183 implicit if global header is disabled)
5184 </p>
5185 </dd>
5186 <dt> &lsquo;<samp>implicit</samp>&rsquo;</dt>
5187 <dd><p>implicit backwards compatible signaling
5188 </p>
5189 </dd>
5190 <dt> &lsquo;<samp>explicit_sbr</samp>&rsquo;</dt>
5191 <dd><p>explicit SBR, implicit PS signaling
5192 </p>
5193 </dd>
5194 <dt> &lsquo;<samp>explicit_hierarchical</samp>&rsquo;</dt>
5195 <dd><p>explicit hierarchical signaling
5196 </p></dd>
5197 </dl>
5198
5199 <p>Default value is &lsquo;<samp>default</samp>&rsquo;.
5200 </p>
5201 </dd>
5202 <dt> &lsquo;<samp>latm</samp>&rsquo;</dt>
5203 <dd><p>Output LATM/LOAS encapsulated data if set to 1, disabled if set to 0.
5204 </p>
5205 <p>Default value is 0.
5206 </p>
5207 </dd>
5208 <dt> &lsquo;<samp>header_period</samp>&rsquo;</dt>
5209 <dd><p>Set StreamMuxConfig and PCE repetition period (in frames) for sending
5210 in-band configuration buffers within LATM/LOAS transport layer.
5211 </p>
5212 <p>Must be a 16-bits non-negative integer.
5213 </p>
5214 <p>Default value is 0.
5215 </p>
5216 </dd>
5217 <dt> &lsquo;<samp>vbr</samp>&rsquo;</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.
5221 </p>
5222 <p>Currently only the &lsquo;<samp>aac_low</samp>&rsquo; profile supports VBR encoding.
5223 </p>
5224 <p>VBR modes 1-5 correspond to roughly the following average bit rates:
5225 </p>
5226 <dl compact="compact">
5227 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
5228 <dd><p>32 kbps/channel
5229 </p></dd>
5230 <dt> &lsquo;<samp>2</samp>&rsquo;</dt>
5231 <dd><p>40 kbps/channel
5232 </p></dd>
5233 <dt> &lsquo;<samp>3</samp>&rsquo;</dt>
5234 <dd><p>48-56 kbps/channel
5235 </p></dd>
5236 <dt> &lsquo;<samp>4</samp>&rsquo;</dt>
5237 <dd><p>64 kbps/channel
5238 </p></dd>
5239 <dt> &lsquo;<samp>5</samp>&rsquo;</dt>
5240 <dd><p>about 80-96 kbps/channel
5241 </p></dd>
5242 </dl>
5243
5244 <p>Default value is 0.
5245 </p></dd>
5246 </dl>
5247
5248 <a name="Examples-59"></a>
5249 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-59">13.4.2 Examples</a></h3>
5250
5251 <ul>
5252 <li>
5253 Use <code>ffmpeg</code> to convert an audio file to VBR AAC in an M4A (MP4)
5254 container:
5255 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i input.wav -codec:a libfdk_aac -vbr 3 output.m4a
5256 </pre></td></tr></table>
5257
5258 </li><li>
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>&nbsp;</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>
5263 </li></ul>
5264
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>
5268
5269 <p>LAME (Lame Ain&rsquo;t an MP3 Encoder) MP3 encoder wrapper.
5270 </p>
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>.
5274 </p>
5275 <p>See <a href="#libshine">libshine</a> for a fixed-point MP3 encoder, although with a
5276 lower quality.
5277 </p>
5278 <a name="Options-17"></a>
5279 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-17">13.5.1 Options</a></h3>
5280
5281 <p>The following options are supported by the libmp3lame wrapper. The
5282 <code>lame</code>-equivalent of the options are listed in parentheses.
5283 </p>
5284 <dl compact="compact">
5285 <dt> &lsquo;<samp>b (<em>-b</em>)</samp>&rsquo;</dt>
5286 <dd><p>Set bitrate expressed in bits/s for CBR or ABR. LAME <code>bitrate</code> is
5287 expressed in kilobits/s.
5288 </p>
5289 </dd>
5290 <dt> &lsquo;<samp>q (<em>-V</em>)</samp>&rsquo;</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 &lsquo;<samp>global_quality</samp>&rsquo;.
5294 </p>
5295 </dd>
5296 <dt> &lsquo;<samp>compression_level (<em>-q</em>)</samp>&rsquo;</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.
5300 </p>
5301 </dd>
5302 <dt> &lsquo;<samp>reservoir</samp>&rsquo;</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 &lsquo;<samp>--nores</samp>&rsquo; option.
5306 </p>
5307 </dd>
5308 <dt> &lsquo;<samp>joint_stereo (<em>-m j</em>)</samp>&rsquo;</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.
5311 </p>
5312 </dd>
5313 <dt> &lsquo;<samp>abr (<em>--abr</em>)</samp>&rsquo;</dt>
5314 <dd><p>Enable the encoder to use ABR when set to 1. The <code>lame</code>
5315 &lsquo;<samp>--abr</samp>&rsquo; sets the target bitrate, while this options only
5316 tells FFmpeg to use ABR still relies on &lsquo;<samp>b</samp>&rsquo; to set bitrate.
5317 </p>
5318 </dd>
5319 </dl>
5320
5321 <a name="libopencore_002damrnb"></a>
5322 <h2 class="section"><a href="ffplay-all.html#toc-libopencore_002damrnb">13.6 libopencore-amrnb</a></h2>
5323
5324 <p>OpenCORE Adaptive Multi-Rate Narrowband encoder.
5325 </p>
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>.
5329 </p>
5330 <p>This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
5331 but you can override it by setting &lsquo;<samp>strict</samp>&rsquo; to &lsquo;<samp>unofficial</samp>&rsquo; or
5332 lower.
5333 </p>
5334 <a name="Options-29"></a>
5335 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-29">13.6.1 Options</a></h3>
5336
5337 <dl compact="compact">
5338 <dt> &lsquo;<samp>b</samp>&rsquo;</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.
5341 </p>
5342 <dl compact="compact">
5343 <dt> &lsquo;<samp>4750</samp>&rsquo;</dt>
5344 <dt> &lsquo;<samp>5150</samp>&rsquo;</dt>
5345 <dt> &lsquo;<samp>5900</samp>&rsquo;</dt>
5346 <dt> &lsquo;<samp>6700</samp>&rsquo;</dt>
5347 <dt> &lsquo;<samp>7400</samp>&rsquo;</dt>
5348 <dt> &lsquo;<samp>7950</samp>&rsquo;</dt>
5349 <dt> &lsquo;<samp>10200</samp>&rsquo;</dt>
5350 <dt> &lsquo;<samp>12200</samp>&rsquo;</dt>
5351 </dl>
5352
5353 </dd>
5354 <dt> &lsquo;<samp>dtx</samp>&rsquo;</dt>
5355 <dd><p>Allow discontinuous transmission (generate comfort noise) when set to 1. The
5356 default value is 0 (disabled).
5357 </p>
5358 </dd>
5359 </dl>
5360
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>
5364
5365 <p>Shine Fixed-Point MP3 encoder wrapper.
5366 </p>
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&rsquo;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.
5373 </p>
5374 <p>This encoder only supports stereo and mono input. This is also CBR-only.
5375 </p>
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>.
5379 </p>
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>.
5383 </p>
5384 <p>See also <a href="#libmp3lame">libmp3lame</a>.
5385 </p>
5386 <a name="Options-16"></a>
5387 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-16">13.7.1 Options</a></h3>
5388
5389 <p>The following options are supported by the libshine wrapper. The
5390 <code>shineenc</code>-equivalent of the options are listed in parentheses.
5391 </p>
5392 <dl compact="compact">
5393 <dt> &lsquo;<samp>b (<em>-b</em>)</samp>&rsquo;</dt>
5394 <dd><p>Set bitrate expressed in bits/s for CBR. <code>shineenc</code> &lsquo;<samp>-b</samp>&rsquo; option
5395 is expressed in kilobits/s.
5396 </p>
5397 </dd>
5398 </dl>
5399
5400 <a name="libtwolame"></a>
5401 <h2 class="section"><a href="ffplay-all.html#toc-libtwolame">13.8 libtwolame</a></h2>
5402
5403 <p>TwoLAME MP2 encoder wrapper.
5404 </p>
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>.
5408 </p>
5409 <a name="Options-22"></a>
5410 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-22">13.8.1 Options</a></h3>
5411
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
5414 parentheses.
5415 </p>
5416 <dl compact="compact">
5417 <dt> &lsquo;<samp>b (<em>-b</em>)</samp>&rsquo;</dt>
5418 <dd><p>Set bitrate expressed in bits/s for CBR. <code>twolame</code> &lsquo;<samp>b</samp>&rsquo;
5419 option is expressed in kilobits/s. Default value is 128k.
5420 </p>
5421 </dd>
5422 <dt> &lsquo;<samp>q (<em>-V</em>)</samp>&rsquo;</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 &lsquo;<samp>global_quality</samp>&rsquo;.
5428 </p>
5429 </dd>
5430 <dt> &lsquo;<samp>mode (<em>--mode</em>)</samp>&rsquo;</dt>
5431 <dd><p>Set the mode of the resulting audio. Possible values:
5432 </p>
5433 <dl compact="compact">
5434 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
5435 <dd><p>Choose mode automatically based on the input. This is the default.
5436 </p></dd>
5437 <dt> &lsquo;<samp>stereo</samp>&rsquo;</dt>
5438 <dd><p>Stereo
5439 </p></dd>
5440 <dt> &lsquo;<samp>joint_stereo</samp>&rsquo;</dt>
5441 <dd><p>Joint stereo
5442 </p></dd>
5443 <dt> &lsquo;<samp>dual_channel</samp>&rsquo;</dt>
5444 <dd><p>Dual channel
5445 </p></dd>
5446 <dt> &lsquo;<samp>mono</samp>&rsquo;</dt>
5447 <dd><p>Mono
5448 </p></dd>
5449 </dl>
5450
5451 </dd>
5452 <dt> &lsquo;<samp>psymodel (<em>--psyc-mode</em>)</samp>&rsquo;</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.
5456 </p>
5457 </dd>
5458 <dt> &lsquo;<samp>energy_levels (<em>--energy</em>)</samp>&rsquo;</dt>
5459 <dd><p>Enable energy levels extensions when set to 1. The default value is
5460 0 (disabled).
5461 </p>
5462 </dd>
5463 <dt> &lsquo;<samp>error_protection (<em>--protect</em>)</samp>&rsquo;</dt>
5464 <dd><p>Enable CRC error protection when set to 1. The default value is 0
5465 (disabled).
5466 </p>
5467 </dd>
5468 <dt> &lsquo;<samp>copyright (<em>--copyright</em>)</samp>&rsquo;</dt>
5469 <dd><p>Set MPEG audio copyright flag when set to 1. The default value is 0
5470 (disabled).
5471 </p>
5472 </dd>
5473 <dt> &lsquo;<samp>original (<em>--original</em>)</samp>&rsquo;</dt>
5474 <dd><p>Set MPEG audio original flag when set to 1. The default value is 0
5475 (disabled).
5476 </p>
5477 </dd>
5478 </dl>
5479
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>
5483
5484 <p>VisualOn AAC encoder.
5485 </p>
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>.
5489 </p>
5490 <p>This encoder is considered to be worse than the
5491 <a href="#aacenc">native experimental FFmpeg AAC encoder</a>, according to
5492 multiple sources.
5493 </p>
5494 <a name="Options-11"></a>
5495 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-11">13.9.1 Options</a></h3>
5496
5497 <p>The VisualOn AAC encoder only support encoding AAC-LC and up to 2
5498 channels. It is also CBR-only.
5499 </p>
5500 <dl compact="compact">
5501 <dt> &lsquo;<samp>b</samp>&rsquo;</dt>
5502 <dd><p>Set bit rate in bits/s.
5503 </p>
5504 </dd>
5505 </dl>
5506
5507 <a name="libvo_002damrwbenc"></a>
5508 <h2 class="section"><a href="ffplay-all.html#toc-libvo_002damrwbenc">13.10 libvo-amrwbenc</a></h2>
5509
5510 <p>VisualOn Adaptive Multi-Rate Wideband encoder.
5511 </p>
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>.
5515 </p>
5516 <p>This is a mono-only encoder. Officially it only supports 16000Hz sample
5517 rate, but you can override it by setting &lsquo;<samp>strict</samp>&rsquo; to
5518 &lsquo;<samp>unofficial</samp>&rsquo; or lower.
5519 </p>
5520 <a name="Options-23"></a>
5521 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-23">13.10.1 Options</a></h3>
5522
5523 <dl compact="compact">
5524 <dt> &lsquo;<samp>b</samp>&rsquo;</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.
5527 </p>
5528 <dl compact="compact">
5529 <dt> &lsquo;<samp>6600</samp>&rsquo;</dt>
5530 <dt> &lsquo;<samp>8850</samp>&rsquo;</dt>
5531 <dt> &lsquo;<samp>12650</samp>&rsquo;</dt>
5532 <dt> &lsquo;<samp>14250</samp>&rsquo;</dt>
5533 <dt> &lsquo;<samp>15850</samp>&rsquo;</dt>
5534 <dt> &lsquo;<samp>18250</samp>&rsquo;</dt>
5535 <dt> &lsquo;<samp>19850</samp>&rsquo;</dt>
5536 <dt> &lsquo;<samp>23050</samp>&rsquo;</dt>
5537 <dt> &lsquo;<samp>23850</samp>&rsquo;</dt>
5538 </dl>
5539
5540 </dd>
5541 <dt> &lsquo;<samp>dtx</samp>&rsquo;</dt>
5542 <dd><p>Allow discontinuous transmission (generate comfort noise) when set to 1. The
5543 default value is 0 (disabled).
5544 </p>
5545 </dd>
5546 </dl>
5547
5548 <a name="libopus-1"></a>
5549 <h2 class="section"><a href="ffplay-all.html#toc-libopus-1">13.11 libopus</a></h2>
5550
5551 <p>libopus Opus Interactive Audio Codec encoder wrapper.
5552 </p>
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>.
5556 </p>
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>
5559
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
5563 in parentheses.
5564 </p>
5565 <dl compact="compact">
5566 <dt> &lsquo;<samp>b (<em>bitrate</em>)</samp>&rsquo;</dt>
5567 <dd><p>Set the bit rate in bits/s.  FFmpeg&rsquo;s &lsquo;<samp>b</samp>&rsquo; option is
5568 expressed in bits/s, while <code>opusenc</code>&rsquo;s &lsquo;<samp>bitrate</samp>&rsquo; in
5569 kilobits/s.
5570 </p>
5571 </dd>
5572 <dt> &lsquo;<samp>vbr (<em>vbr</em>, <em>hard-cbr</em>, and <em>cvbr</em>)</samp>&rsquo;</dt>
5573 <dd><p>Set VBR mode. The FFmpeg &lsquo;<samp>vbr</samp>&rsquo; option has the following
5574 valid arguments, with the their <code>opusenc</code> equivalent options
5575 in parentheses:
5576 </p>
5577 <dl compact="compact">
5578 <dt> &lsquo;<samp>off (<em>hard-cbr</em>)</samp>&rsquo;</dt>
5579 <dd><p>Use constant bit rate encoding.
5580 </p>
5581 </dd>
5582 <dt> &lsquo;<samp>on (<em>vbr</em>)</samp>&rsquo;</dt>
5583 <dd><p>Use variable bit rate encoding (the default).
5584 </p>
5585 </dd>
5586 <dt> &lsquo;<samp>constrained (<em>cvbr</em>)</samp>&rsquo;</dt>
5587 <dd><p>Use constrained variable bit rate encoding.
5588 </p></dd>
5589 </dl>
5590
5591 </dd>
5592 <dt> &lsquo;<samp>compression_level (<em>comp</em>)</samp>&rsquo;</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.
5596 </p>
5597 </dd>
5598 <dt> &lsquo;<samp>frame_duration (<em>framesize</em>)</samp>&rsquo;</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.
5604 </p>
5605 </dd>
5606 <dt> &lsquo;<samp>packet_loss (<em>expect-loss</em>)</samp>&rsquo;</dt>
5607 <dd><p>Set expected packet loss percentage. The default is 0.
5608 </p>
5609 </dd>
5610 <dt> &lsquo;<samp>application (N.A.)</samp>&rsquo;</dt>
5611 <dd><p>Set intended application type. Valid options are listed below:
5612 </p>
5613 <dl compact="compact">
5614 <dt> &lsquo;<samp>voip</samp>&rsquo;</dt>
5615 <dd><p>Favor improved speech intelligibility.
5616 </p></dd>
5617 <dt> &lsquo;<samp>audio</samp>&rsquo;</dt>
5618 <dd><p>Favor faithfulness to the input (the default).
5619 </p></dd>
5620 <dt> &lsquo;<samp>lowdelay</samp>&rsquo;</dt>
5621 <dd><p>Restrict to only the lowest delay modes.
5622 </p></dd>
5623 </dl>
5624
5625 </dd>
5626 <dt> &lsquo;<samp>cutoff (N.A.)</samp>&rsquo;</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).
5631 </p>
5632 </dd>
5633 </dl>
5634
5635 <a name="libvorbis"></a>
5636 <h2 class="section"><a href="ffplay-all.html#toc-libvorbis">13.12 libvorbis</a></h2>
5637
5638 <p>libvorbis encoder wrapper.
5639 </p>
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>.
5643 </p>
5644 <a name="Options-32"></a>
5645 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-32">13.12.1 Options</a></h3>
5646
5647 <p>The following options are supported by the libvorbis wrapper. The
5648 <code>oggenc</code>-equivalent of the options are listed in parentheses.
5649 </p>
5650 <p>To get a more accurate and extensive documentation of the libvorbis
5651 options, consult the libvorbisenc&rsquo;s and <code>oggenc</code>&rsquo;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).
5654 </p>
5655 <dl compact="compact">
5656 <dt> &lsquo;<samp>b (<em>-b</em>)</samp>&rsquo;</dt>
5657 <dd><p>Set bitrate expressed in bits/s for ABR. <code>oggenc</code> &lsquo;<samp>-b</samp>&rsquo; is
5658 expressed in kilobits/s.
5659 </p>
5660 </dd>
5661 <dt> &lsquo;<samp>q (<em>-q</em>)</samp>&rsquo;</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 &lsquo;<samp>3.0</samp>&rsquo;.
5665 </p>
5666 <p>This option is valid only using the <code>ffmpeg</code> command-line tool.
5667 For library interface users, use &lsquo;<samp>global_quality</samp>&rsquo;.
5668 </p>
5669 </dd>
5670 <dt> &lsquo;<samp>cutoff (<em>--advanced-encode-option lowpass_frequency=N</em>)</samp>&rsquo;</dt>
5671 <dd><p>Set cutoff bandwidth in Hz, a value of 0 disables cutoff. <code>oggenc</code>&rsquo;s
5672 related option is expressed in kHz. The default value is &lsquo;<samp>0</samp>&rsquo; (cutoff
5673 disabled).
5674 </p>
5675 </dd>
5676 <dt> &lsquo;<samp>minrate (<em>-m</em>)</samp>&rsquo;</dt>
5677 <dd><p>Set minimum bitrate expressed in bits/s. <code>oggenc</code> &lsquo;<samp>-m</samp>&rsquo; is
5678 expressed in kilobits/s.
5679 </p>
5680 </dd>
5681 <dt> &lsquo;<samp>maxrate (<em>-M</em>)</samp>&rsquo;</dt>
5682 <dd><p>Set maximum bitrate expressed in bits/s. <code>oggenc</code> &lsquo;<samp>-M</samp>&rsquo; is
5683 expressed in kilobits/s. This only has effect on ABR mode.
5684 </p>
5685 </dd>
5686 <dt> &lsquo;<samp>iblock (<em>--advanced-encode-option impulse_noisetune=N</em>)</samp>&rsquo;</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.
5691 </p>
5692 </dd>
5693 </dl>
5694
5695 <a name="libwavpack"></a>
5696 <h2 class="section"><a href="ffplay-all.html#toc-libwavpack">13.13 libwavpack</a></h2>
5697
5698 <p>A wrapper providing WavPack encoding through libwavpack.
5699 </p>
5700 <p>Only lossless mode using 32-bit integer samples is supported currently.
5701 The &lsquo;<samp>compression_level</samp>&rsquo; option can be used to control speed vs.
5702 compression tradeoff, with the values mapped to libwavpack as follows:
5703 </p>
5704 <dl compact="compact">
5705 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
5706 <dd><p>Fast mode - corresponding to the wavpack &lsquo;<samp>-f</samp>&rsquo; option.
5707 </p>
5708 </dd>
5709 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
5710 <dd><p>Normal (default) settings.
5711 </p>
5712 </dd>
5713 <dt> &lsquo;<samp>2</samp>&rsquo;</dt>
5714 <dd><p>High quality - corresponding to the wavpack &lsquo;<samp>-h</samp>&rsquo; option.
5715 </p>
5716 </dd>
5717 <dt> &lsquo;<samp>3</samp>&rsquo;</dt>
5718 <dd><p>Very high quality - corresponding to the wavpack &lsquo;<samp>-hh</samp>&rsquo; option.
5719 </p>
5720 </dd>
5721 <dt> &lsquo;<samp>4-8</samp>&rsquo;</dt>
5722 <dd><p>Same as 3, but with extra processing enabled - corresponding to the wavpack
5723 &lsquo;<samp>-x</samp>&rsquo; option. I.e. 4 is the same as &lsquo;<samp>-x2</samp>&rsquo; and 8 is the same as
5724 &lsquo;<samp>-x6</samp>&rsquo;.
5725 </p>
5726 </dd>
5727 </dl>
5728
5729
5730 <a name="Video-Encoders"></a>
5731 <h1 class="chapter"><a href="ffplay-all.html#toc-Video-Encoders">14. Video Encoders</a></h1>
5732
5733 <p>A description of some of the currently available video encoders
5734 follows.
5735 </p>
5736 <a name="libtheora"></a>
5737 <h2 class="section"><a href="ffplay-all.html#toc-libtheora">14.1 libtheora</a></h2>
5738
5739 <p>libtheora Theora encoder wrapper.
5740 </p>
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>.
5744 </p>
5745 <p>For more informations about the libtheora project see
5746 <a href="http://www.theora.org/">http://www.theora.org/</a>.
5747 </p>
5748 <a name="Options-19"></a>
5749 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-19">14.1.1 Options</a></h3>
5750
5751 <p>The following global options are mapped to internal libtheora options
5752 which affect the quality and the bitrate of the encoded stream.
5753 </p>
5754 <dl compact="compact">
5755 <dt> &lsquo;<samp>b</samp>&rsquo;</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.
5758 </p>
5759 </dd>
5760 <dt> &lsquo;<samp>flags</samp>&rsquo;</dt>
5761 <dd><p>Used to enable constant quality mode (VBR) encoding through the
5762 &lsquo;<samp>qscale</samp>&rsquo; flag, and to enable the <code>pass1</code> and <code>pass2</code>
5763 modes.
5764 </p>
5765 </dd>
5766 <dt> &lsquo;<samp>g</samp>&rsquo;</dt>
5767 <dd><p>Set the GOP size.
5768 </p>
5769 </dd>
5770 <dt> &lsquo;<samp>global_quality</samp>&rsquo;</dt>
5771 <dd><p>Set the global quality as an integer in lambda units.
5772 </p>
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.
5778 </p>
5779 </dd>
5780 <dt> &lsquo;<samp>q</samp>&rsquo;</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.
5783 </p>
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].
5786 </p>
5787 <p>This option is valid only using the <code>ffmpeg</code> command-line
5788 tool. For library interface users, use &lsquo;<samp>global_quality</samp>&rsquo;.
5789 </p></dd>
5790 </dl>
5791
5792 <a name="Examples-28"></a>
5793 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-28">14.1.2 Examples</a></h3>
5794
5795 <ul>
5796 <li>
5797 Set maximum constant quality (VBR) encoding with <code>ffmpeg</code>:
5798 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -codec:v libtheora -q:v 10 OUTPUT.ogg
5799 </pre></td></tr></table>
5800
5801 </li><li>
5802 Use <code>ffmpeg</code> to convert a CBR 1000 kbps Theora video stream:
5803 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -codec:v libtheora -b:v 1000k OUTPUT.ogg
5804 </pre></td></tr></table>
5805 </li></ul>
5806
5807 <a name="libvpx"></a>
5808 <h2 class="section"><a href="ffplay-all.html#toc-libvpx">14.2 libvpx</a></h2>
5809
5810 <p>VP8 format supported through libvpx.
5811 </p>
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>.
5814 </p>
5815 <a name="Options-1"></a>
5816 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-1">14.2.1 Options</a></h3>
5817
5818 <p>Mapping from FFmpeg to libvpx options with conversion notes in parentheses.
5819 </p>
5820 <dl compact="compact">
5821 <dt> &lsquo;<samp>threads</samp>&rsquo;</dt>
5822 <dd><p>g_threads
5823 </p>
5824 </dd>
5825 <dt> &lsquo;<samp>profile</samp>&rsquo;</dt>
5826 <dd><p>g_profile
5827 </p>
5828 </dd>
5829 <dt> &lsquo;<samp>vb</samp>&rsquo;</dt>
5830 <dd><p>rc_target_bitrate
5831 </p>
5832 </dd>
5833 <dt> &lsquo;<samp>g</samp>&rsquo;</dt>
5834 <dd><p>kf_max_dist
5835 </p>
5836 </dd>
5837 <dt> &lsquo;<samp>keyint_min</samp>&rsquo;</dt>
5838 <dd><p>kf_min_dist
5839 </p>
5840 </dd>
5841 <dt> &lsquo;<samp>qmin</samp>&rsquo;</dt>
5842 <dd><p>rc_min_quantizer
5843 </p>
5844 </dd>
5845 <dt> &lsquo;<samp>qmax</samp>&rsquo;</dt>
5846 <dd><p>rc_max_quantizer
5847 </p>
5848 </dd>
5849 <dt> &lsquo;<samp>bufsize, vb</samp>&rsquo;</dt>
5850 <dd><p>rc_buf_sz
5851 <code>(bufsize * 1000 / vb)</code>
5852 </p>
5853 <p>rc_buf_optimal_sz
5854 <code>(bufsize * 1000 / vb * 5 / 6)</code>
5855 </p>
5856 </dd>
5857 <dt> &lsquo;<samp>rc_init_occupancy, vb</samp>&rsquo;</dt>
5858 <dd><p>rc_buf_initial_sz
5859 <code>(rc_init_occupancy * 1000 / vb)</code>
5860 </p>
5861 </dd>
5862 <dt> &lsquo;<samp>rc_buffer_aggressivity</samp>&rsquo;</dt>
5863 <dd><p>rc_undershoot_pct
5864 </p>
5865 </dd>
5866 <dt> &lsquo;<samp>skip_threshold</samp>&rsquo;</dt>
5867 <dd><p>rc_dropframe_thresh
5868 </p>
5869 </dd>
5870 <dt> &lsquo;<samp>qcomp</samp>&rsquo;</dt>
5871 <dd><p>rc_2pass_vbr_bias_pct
5872 </p>
5873 </dd>
5874 <dt> &lsquo;<samp>maxrate, vb</samp>&rsquo;</dt>
5875 <dd><p>rc_2pass_vbr_maxsection_pct
5876 <code>(maxrate * 100 / vb)</code>
5877 </p>
5878 </dd>
5879 <dt> &lsquo;<samp>minrate, vb</samp>&rsquo;</dt>
5880 <dd><p>rc_2pass_vbr_minsection_pct
5881 <code>(minrate * 100 / vb)</code>
5882 </p>
5883 </dd>
5884 <dt> &lsquo;<samp>minrate, maxrate, vb</samp>&rsquo;</dt>
5885 <dd><p><code>VPX_CBR</code>
5886 <code>(minrate == maxrate == vb)</code>
5887 </p>
5888 </dd>
5889 <dt> &lsquo;<samp>crf</samp>&rsquo;</dt>
5890 <dd><p><code>VPX_CQ</code>, <code>VP8E_SET_CQ_LEVEL</code>
5891 </p>
5892 </dd>
5893 <dt> &lsquo;<samp>quality</samp>&rsquo;</dt>
5894 <dd><dl compact="compact">
5895 <dt> &lsquo;<samp><var>best</var></samp>&rsquo;</dt>
5896 <dd><p><code>VPX_DL_BEST_QUALITY</code>
5897 </p></dd>
5898 <dt> &lsquo;<samp><var>good</var></samp>&rsquo;</dt>
5899 <dd><p><code>VPX_DL_GOOD_QUALITY</code>
5900 </p></dd>
5901 <dt> &lsquo;<samp><var>realtime</var></samp>&rsquo;</dt>
5902 <dd><p><code>VPX_DL_REALTIME</code>
5903 </p></dd>
5904 </dl>
5905
5906 </dd>
5907 <dt> &lsquo;<samp>speed</samp>&rsquo;</dt>
5908 <dd><p><code>VP8E_SET_CPUUSED</code>
5909 </p>
5910 </dd>
5911 <dt> &lsquo;<samp>nr</samp>&rsquo;</dt>
5912 <dd><p><code>VP8E_SET_NOISE_SENSITIVITY</code>
5913 </p>
5914 </dd>
5915 <dt> &lsquo;<samp>mb_threshold</samp>&rsquo;</dt>
5916 <dd><p><code>VP8E_SET_STATIC_THRESHOLD</code>
5917 </p>
5918 </dd>
5919 <dt> &lsquo;<samp>slices</samp>&rsquo;</dt>
5920 <dd><p><code>VP8E_SET_TOKEN_PARTITIONS</code>
5921 </p>
5922 </dd>
5923 <dt> &lsquo;<samp>max-intra-rate</samp>&rsquo;</dt>
5924 <dd><p><code>VP8E_SET_MAX_INTRA_BITRATE_PCT</code>
5925 </p>
5926 </dd>
5927 <dt> &lsquo;<samp>force_key_frames</samp>&rsquo;</dt>
5928 <dd><p><code>VPX_EFLAG_FORCE_KF</code>
5929 </p>
5930 </dd>
5931 <dt> &lsquo;<samp>Alternate reference frame related</samp>&rsquo;</dt>
5932 <dd><dl compact="compact">
5933 <dt> &lsquo;<samp>vp8flags altref</samp>&rsquo;</dt>
5934 <dd><p><code>VP8E_SET_ENABLEAUTOALTREF</code>
5935 </p></dd>
5936 <dt> &lsquo;<samp><var>arnr_max_frames</var></samp>&rsquo;</dt>
5937 <dd><p><code>VP8E_SET_ARNR_MAXFRAMES</code>
5938 </p></dd>
5939 <dt> &lsquo;<samp><var>arnr_type</var></samp>&rsquo;</dt>
5940 <dd><p><code>VP8E_SET_ARNR_TYPE</code>
5941 </p></dd>
5942 <dt> &lsquo;<samp><var>arnr_strength</var></samp>&rsquo;</dt>
5943 <dd><p><code>VP8E_SET_ARNR_STRENGTH</code>
5944 </p></dd>
5945 <dt> &lsquo;<samp><var>rc_lookahead</var></samp>&rsquo;</dt>
5946 <dd><p>g_lag_in_frames
5947 </p></dd>
5948 </dl>
5949
5950 </dd>
5951 <dt> &lsquo;<samp>vp8flags error_resilient</samp>&rsquo;</dt>
5952 <dd><p>g_error_resilient
5953 </p>
5954 </dd>
5955 </dl>
5956
5957 <p>For more information about libvpx see:
5958 <a href="http://www.webmproject.org/">http://www.webmproject.org/</a>
5959 </p>
5960 <a name="libx264"></a>
5961 <h2 class="section"><a href="ffplay-all.html#toc-libx264">14.3 libx264</a></h2>
5962
5963 <p>x264 H.264/MPEG-4 AVC encoder wrapper.
5964 </p>
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>.
5968 </p>
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).
5973 </p>
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 &lsquo;<samp>x264opts</samp>&rsquo; and &lsquo;<samp>x264-params</samp>&rsquo;
5977 private options allows to pass a list of key=value tuples as accepted
5978 by the libx264 <code>x264_param_parse</code> function.
5979 </p>
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>.
5982 </p>
5983 <a name="Options-10"></a>
5984 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-10">14.3.1 Options</a></h3>
5985
5986 <p>The following options are supported by the libx264 wrapper. The
5987 <code>x264</code>-equivalent options or values are listed in parentheses
5988 for easy migration.
5989 </p>
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>.
5994 </p>
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.
5998 </p>
5999 <dl compact="compact">
6000 <dt> &lsquo;<samp>b (<em>bitrate</em>)</samp>&rsquo;</dt>
6001 <dd><p>Set bitrate in bits/s. Note that FFmpeg&rsquo;s &lsquo;<samp>b</samp>&rsquo; option is
6002 expressed in bits/s, while <code>x264</code>&rsquo;s &lsquo;<samp>bitrate</samp>&rsquo; is in
6003 kilobits/s.
6004 </p>
6005 </dd>
6006 <dt> &lsquo;<samp>bf (<em>bframes</em>)</samp>&rsquo;</dt>
6007 <dt> &lsquo;<samp>g (<em>keyint</em>)</samp>&rsquo;</dt>
6008 <dt> &lsquo;<samp>qmax (<em>qpmax</em>)</samp>&rsquo;</dt>
6009 <dt> &lsquo;<samp>qmin (<em>qpmin</em>)</samp>&rsquo;</dt>
6010 <dt> &lsquo;<samp>qdiff (<em>qpstep</em>)</samp>&rsquo;</dt>
6011 <dt> &lsquo;<samp>qblur (<em>qblur</em>)</samp>&rsquo;</dt>
6012 <dt> &lsquo;<samp>qcomp (<em>qcomp</em>)</samp>&rsquo;</dt>
6013 <dt> &lsquo;<samp>refs (<em>ref</em>)</samp>&rsquo;</dt>
6014 <dt> &lsquo;<samp>sc_threshold (<em>scenecut</em>)</samp>&rsquo;</dt>
6015 <dt> &lsquo;<samp>trellis (<em>trellis</em>)</samp>&rsquo;</dt>
6016 <dt> &lsquo;<samp>nr  (<em>nr</em>)</samp>&rsquo;</dt>
6017 <dt> &lsquo;<samp>me_range (<em>merange</em>)</samp>&rsquo;</dt>
6018 <dt> &lsquo;<samp>me_method (<em>me</em>)</samp>&rsquo;</dt>
6019 <dd><p>Set motion estimation method. Possible values in the decreasing order
6020 of speed:
6021 </p>
6022 <dl compact="compact">
6023 <dt> &lsquo;<samp>dia (<em>dia</em>)</samp>&rsquo;</dt>
6024 <dt> &lsquo;<samp>epzs (<em>dia</em>)</samp>&rsquo;</dt>
6025 <dd><p>Diamond search with radius 1 (fastest). &lsquo;<samp>epzs</samp>&rsquo; is an alias for
6026 &lsquo;<samp>dia</samp>&rsquo;.
6027 </p></dd>
6028 <dt> &lsquo;<samp>hex (<em>hex</em>)</samp>&rsquo;</dt>
6029 <dd><p>Hexagonal search with radius 2.
6030 </p></dd>
6031 <dt> &lsquo;<samp>umh (<em>umh</em>)</samp>&rsquo;</dt>
6032 <dd><p>Uneven multi-hexagon search.
6033 </p></dd>
6034 <dt> &lsquo;<samp>esa (<em>esa</em>)</samp>&rsquo;</dt>
6035 <dd><p>Exhaustive search.
6036 </p></dd>
6037 <dt> &lsquo;<samp>tesa (<em>tesa</em>)</samp>&rsquo;</dt>
6038 <dd><p>Hadamard exhaustive search (slowest).
6039 </p></dd>
6040 </dl>
6041
6042 </dd>
6043 <dt> &lsquo;<samp>subq (<em>subme</em>)</samp>&rsquo;</dt>
6044 <dt> &lsquo;<samp>b_strategy (<em>b-adapt</em>)</samp>&rsquo;</dt>
6045 <dt> &lsquo;<samp>keyint_min (<em>min-keyint</em>)</samp>&rsquo;</dt>
6046 <dt> &lsquo;<samp>coder</samp>&rsquo;</dt>
6047 <dd><p>Set entropy encoder. Possible values:
6048 </p>
6049 <dl compact="compact">
6050 <dt> &lsquo;<samp>ac</samp>&rsquo;</dt>
6051 <dd><p>Enable CABAC.
6052 </p>
6053 </dd>
6054 <dt> &lsquo;<samp>vlc</samp>&rsquo;</dt>
6055 <dd><p>Enable CAVLC and disable CABAC. It generates the same effect as
6056 <code>x264</code>&rsquo;s &lsquo;<samp>--no-cabac</samp>&rsquo; option.
6057 </p></dd>
6058 </dl>
6059
6060 </dd>
6061 <dt> &lsquo;<samp>cmp</samp>&rsquo;</dt>
6062 <dd><p>Set full pixel motion estimation comparation algorithm. Possible values:
6063 </p>
6064 <dl compact="compact">
6065 <dt> &lsquo;<samp>chroma</samp>&rsquo;</dt>
6066 <dd><p>Enable chroma in motion estimation.
6067 </p>
6068 </dd>
6069 <dt> &lsquo;<samp>sad</samp>&rsquo;</dt>
6070 <dd><p>Ignore chroma in motion estimation. It generates the same effect as
6071 <code>x264</code>&rsquo;s &lsquo;<samp>--no-chroma-me</samp>&rsquo; option.
6072 </p></dd>
6073 </dl>
6074
6075 </dd>
6076 <dt> &lsquo;<samp>threads (<em>threads</em>)</samp>&rsquo;</dt>
6077 <dt> &lsquo;<samp>thread_type</samp>&rsquo;</dt>
6078 <dd><p>Set multithreading technique. Possible values:
6079 </p>
6080 <dl compact="compact">
6081 <dt> &lsquo;<samp>slice</samp>&rsquo;</dt>
6082 <dd><p>Slice-based multithreading. It generates the same effect as
6083 <code>x264</code>&rsquo;s &lsquo;<samp>--sliced-threads</samp>&rsquo; option.
6084 </p></dd>
6085 <dt> &lsquo;<samp>frame</samp>&rsquo;</dt>
6086 <dd><p>Frame-based multithreading.
6087 </p></dd>
6088 </dl>
6089
6090 </dd>
6091 <dt> &lsquo;<samp>flags</samp>&rsquo;</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>&rsquo;s &lsquo;<samp>--open-gop</samp>&rsquo; option.
6095 </p>
6096 </dd>
6097 <dt> &lsquo;<samp>rc_init_occupancy (<em>vbv-init</em>)</samp>&rsquo;</dt>
6098 <dt> &lsquo;<samp>preset (<em>preset</em>)</samp>&rsquo;</dt>
6099 <dd><p>Set the encoding preset.
6100 </p>
6101 </dd>
6102 <dt> &lsquo;<samp>tune (<em>tune</em>)</samp>&rsquo;</dt>
6103 <dd><p>Set tuning of the encoding params.
6104 </p>
6105 </dd>
6106 <dt> &lsquo;<samp>profile (<em>profile</em>)</samp>&rsquo;</dt>
6107 <dd><p>Set profile restrictions.
6108 </p>
6109 </dd>
6110 <dt> &lsquo;<samp>fastfirstpass</samp>&rsquo;</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>&rsquo;s
6113 &lsquo;<samp>--slow-firstpass</samp>&rsquo; option.
6114 </p>
6115 </dd>
6116 <dt> &lsquo;<samp>crf (<em>crf</em>)</samp>&rsquo;</dt>
6117 <dd><p>Set the quality for constant quality mode.
6118 </p>
6119 </dd>
6120 <dt> &lsquo;<samp>crf_max (<em>crf-max</em>)</samp>&rsquo;</dt>
6121 <dd><p>In CRF mode, prevents VBV from lowering quality beyond this point.
6122 </p>
6123 </dd>
6124 <dt> &lsquo;<samp>qp (<em>qp</em>)</samp>&rsquo;</dt>
6125 <dd><p>Set constant quantization rate control method parameter.
6126 </p>
6127 </dd>
6128 <dt> &lsquo;<samp>aq-mode (<em>aq-mode</em>)</samp>&rsquo;</dt>
6129 <dd><p>Set AQ method. Possible values:
6130 </p>
6131 <dl compact="compact">
6132 <dt> &lsquo;<samp>none (<em>0</em>)</samp>&rsquo;</dt>
6133 <dd><p>Disabled.
6134 </p>
6135 </dd>
6136 <dt> &lsquo;<samp>variance (<em>1</em>)</samp>&rsquo;</dt>
6137 <dd><p>Variance AQ (complexity mask).
6138 </p>
6139 </dd>
6140 <dt> &lsquo;<samp>autovariance (<em>2</em>)</samp>&rsquo;</dt>
6141 <dd><p>Auto-variance AQ (experimental).
6142 </p></dd>
6143 </dl>
6144
6145 </dd>
6146 <dt> &lsquo;<samp>aq-strength (<em>aq-strength</em>)</samp>&rsquo;</dt>
6147 <dd><p>Set AQ strength, reduce blocking and blurring in flat and textured areas.
6148 </p>
6149 </dd>
6150 <dt> &lsquo;<samp>psy</samp>&rsquo;</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>&rsquo;s &lsquo;<samp>--no-psy</samp>&rsquo; option.
6153 </p>
6154 </dd>
6155 <dt> &lsquo;<samp>psy-rd  (<em>psy-rd</em>)</samp>&rsquo;</dt>
6156 <dd><p>Set strength of psychovisual optimization, in
6157 <var>psy-rd</var>:<var>psy-trellis</var> format.
6158 </p>
6159 </dd>
6160 <dt> &lsquo;<samp>rc-lookahead (<em>rc-lookahead</em>)</samp>&rsquo;</dt>
6161 <dd><p>Set number of frames to look ahead for frametype and ratecontrol.
6162 </p>
6163 </dd>
6164 <dt> &lsquo;<samp>weightb</samp>&rsquo;</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>&rsquo;s &lsquo;<samp>--no-weightb</samp>&rsquo; option.
6167 </p>
6168 </dd>
6169 <dt> &lsquo;<samp>weightp (<em>weightp</em>)</samp>&rsquo;</dt>
6170 <dd><p>Set weighted prediction method for P-frames. Possible values:
6171 </p>
6172 <dl compact="compact">
6173 <dt> &lsquo;<samp>none (<em>0</em>)</samp>&rsquo;</dt>
6174 <dd><p>Disabled
6175 </p></dd>
6176 <dt> &lsquo;<samp>simple (<em>1</em>)</samp>&rsquo;</dt>
6177 <dd><p>Enable only weighted refs
6178 </p></dd>
6179 <dt> &lsquo;<samp>smart (<em>2</em>)</samp>&rsquo;</dt>
6180 <dd><p>Enable both weighted refs and duplicates
6181 </p></dd>
6182 </dl>
6183
6184 </dd>
6185 <dt> &lsquo;<samp>ssim (<em>ssim</em>)</samp>&rsquo;</dt>
6186 <dd><p>Enable calculation and printing SSIM stats after the encoding.
6187 </p>
6188 </dd>
6189 <dt> &lsquo;<samp>intra-refresh (<em>intra-refresh</em>)</samp>&rsquo;</dt>
6190 <dd><p>Enable the use of Periodic Intra Refresh instead of IDR frames when set
6191 to 1.
6192 </p>
6193 </dd>
6194 <dt> &lsquo;<samp>bluray-compat (<em>bluray-compat</em>)</samp>&rsquo;</dt>
6195 <dd><p>Configure the encoder to be compatible with the bluray standard.
6196 It is a shorthand for setting &quot;bluray-compat=1 force-cfr=1&quot;.
6197 </p>
6198 </dd>
6199 <dt> &lsquo;<samp>b-bias (<em>b-bias</em>)</samp>&rsquo;</dt>
6200 <dd><p>Set the influence on how often B-frames are used.
6201 </p>
6202 </dd>
6203 <dt> &lsquo;<samp>b-pyramid (<em>b-pyramid</em>)</samp>&rsquo;</dt>
6204 <dd><p>Set method for keeping of some B-frames as references. Possible values:
6205 </p>
6206 <dl compact="compact">
6207 <dt> &lsquo;<samp>none (<em>none</em>)</samp>&rsquo;</dt>
6208 <dd><p>Disabled.
6209 </p></dd>
6210 <dt> &lsquo;<samp>strict (<em>strict</em>)</samp>&rsquo;</dt>
6211 <dd><p>Strictly hierarchical pyramid.
6212 </p></dd>
6213 <dt> &lsquo;<samp>normal (<em>normal</em>)</samp>&rsquo;</dt>
6214 <dd><p>Non-strict (not Blu-ray compatible).
6215 </p></dd>
6216 </dl>
6217
6218 </dd>
6219 <dt> &lsquo;<samp>mixed-refs</samp>&rsquo;</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>&rsquo;s &lsquo;<samp>--no-mixed-refs</samp>&rsquo; option.
6223 </p>
6224 </dd>
6225 <dt> &lsquo;<samp>8x8dct</samp>&rsquo;</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>&rsquo;s &lsquo;<samp>--no-8x8dct</samp>&rsquo; option.
6229 </p>
6230 </dd>
6231 <dt> &lsquo;<samp>fast-pskip</samp>&rsquo;</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>&rsquo;s
6234 &lsquo;<samp>--no-fast-pskip</samp>&rsquo; option.
6235 </p>
6236 </dd>
6237 <dt> &lsquo;<samp>aud (<em>aud</em>)</samp>&rsquo;</dt>
6238 <dd><p>Enable use of access unit delimiters when set to 1.
6239 </p>
6240 </dd>
6241 <dt> &lsquo;<samp>mbtree</samp>&rsquo;</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>&rsquo;s
6244 &lsquo;<samp>--no-mbtree</samp>&rsquo; option.
6245 </p>
6246 </dd>
6247 <dt> &lsquo;<samp>deblock (<em>deblock</em>)</samp>&rsquo;</dt>
6248 <dd><p>Set loop filter parameters, in <var>alpha</var>:<var>beta</var> form.
6249 </p>
6250 </dd>
6251 <dt> &lsquo;<samp>cplxblur (<em>cplxblur</em>)</samp>&rsquo;</dt>
6252 <dd><p>Set fluctuations reduction in QP (before curve compression).
6253 </p>
6254 </dd>
6255 <dt> &lsquo;<samp>partitions (<em>partitions</em>)</samp>&rsquo;</dt>
6256 <dd><p>Set partitions to consider as a comma-separated list of. Possible
6257 values in the list:
6258 </p>
6259 <dl compact="compact">
6260 <dt> &lsquo;<samp>p8x8</samp>&rsquo;</dt>
6261 <dd><p>8x8 P-frame partition.
6262 </p></dd>
6263 <dt> &lsquo;<samp>p4x4</samp>&rsquo;</dt>
6264 <dd><p>4x4 P-frame partition.
6265 </p></dd>
6266 <dt> &lsquo;<samp>b8x8</samp>&rsquo;</dt>
6267 <dd><p>4x4 B-frame partition.
6268 </p></dd>
6269 <dt> &lsquo;<samp>i8x8</samp>&rsquo;</dt>
6270 <dd><p>8x8 I-frame partition.
6271 </p></dd>
6272 <dt> &lsquo;<samp>i4x4</samp>&rsquo;</dt>
6273 <dd><p>4x4 I-frame partition.
6274 (Enabling &lsquo;<samp>p4x4</samp>&rsquo; requires &lsquo;<samp>p8x8</samp>&rsquo; to be enabled. Enabling
6275 &lsquo;<samp>i8x8</samp>&rsquo; requires adaptive spatial transform (&lsquo;<samp>8x8dct</samp>&rsquo;
6276 option) to be enabled.)
6277 </p></dd>
6278 <dt> &lsquo;<samp>none (<em>none</em>)</samp>&rsquo;</dt>
6279 <dd><p>Do not consider any partitions.
6280 </p></dd>
6281 <dt> &lsquo;<samp>all (<em>all</em>)</samp>&rsquo;</dt>
6282 <dd><p>Consider every partition.
6283 </p></dd>
6284 </dl>
6285
6286 </dd>
6287 <dt> &lsquo;<samp>direct-pred (<em>direct</em>)</samp>&rsquo;</dt>
6288 <dd><p>Set direct MV prediction mode. Possible values:
6289 </p>
6290 <dl compact="compact">
6291 <dt> &lsquo;<samp>none (<em>none</em>)</samp>&rsquo;</dt>
6292 <dd><p>Disable MV prediction.
6293 </p></dd>
6294 <dt> &lsquo;<samp>spatial (<em>spatial</em>)</samp>&rsquo;</dt>
6295 <dd><p>Enable spatial predicting.
6296 </p></dd>
6297 <dt> &lsquo;<samp>temporal (<em>temporal</em>)</samp>&rsquo;</dt>
6298 <dd><p>Enable temporal predicting.
6299 </p></dd>
6300 <dt> &lsquo;<samp>auto (<em>auto</em>)</samp>&rsquo;</dt>
6301 <dd><p>Automatically decided.
6302 </p></dd>
6303 </dl>
6304
6305 </dd>
6306 <dt> &lsquo;<samp>slice-max-size (<em>slice-max-size</em>)</samp>&rsquo;</dt>
6307 <dd><p>Set the limit of the size of each slice in bytes. If not specified
6308 but RTP payload size (&lsquo;<samp>ps</samp>&rsquo;) is specified, that is used.
6309 </p>
6310 </dd>
6311 <dt> &lsquo;<samp>stats (<em>stats</em>)</samp>&rsquo;</dt>
6312 <dd><p>Set the file name for multi-pass stats.
6313 </p>
6314 </dd>
6315 <dt> &lsquo;<samp>nal-hrd (<em>nal-hrd</em>)</samp>&rsquo;</dt>
6316 <dd><p>Set signal HRD information (requires &lsquo;<samp>vbv-bufsize</samp>&rsquo; to be set).
6317 Possible values:
6318 </p>
6319 <dl compact="compact">
6320 <dt> &lsquo;<samp>none (<em>none</em>)</samp>&rsquo;</dt>
6321 <dd><p>Disable HRD information signaling.
6322 </p></dd>
6323 <dt> &lsquo;<samp>vbr (<em>vbr</em>)</samp>&rsquo;</dt>
6324 <dd><p>Variable bit rate.
6325 </p></dd>
6326 <dt> &lsquo;<samp>cbr (<em>cbr</em>)</samp>&rsquo;</dt>
6327 <dd><p>Constant bit rate (not allowed in MP4 container).
6328 </p></dd>
6329 </dl>
6330
6331 </dd>
6332 <dt> &lsquo;<samp>x264opts (N.A.)</samp>&rsquo;</dt>
6333 <dd><p>Set any x264 option, see <code>x264 --fullhelp</code> for a list.
6334 </p>
6335 <p>Argument is a list of <var>key</var>=<var>value</var> couples separated by
6336 &quot;:&quot;. In <var>filter</var> and <var>psy-rd</var> options that use &quot;:&quot; as a separator
6337 themselves, use &quot;,&quot; instead. They accept it as well since long ago but this
6338 is kept undocumented for some reason.
6339 </p>
6340 <p>For example to specify libx264 encoding options with <code>ffmpeg</code>:
6341 </p><table><tr><td>&nbsp;</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>
6343
6344 </dd>
6345 <dt> &lsquo;<samp>x264-params (N.A.)</samp>&rsquo;</dt>
6346 <dd><p>Override the x264 configuration using a :-separated list of key=value
6347 parameters.
6348 </p>
6349 <p>This option is functionally the same as the &lsquo;<samp>x264opts</samp>&rsquo;, but is
6350 duplicated for compability with the Libav fork.
6351 </p>
6352 <p>For example to specify libx264 encoding options with <code>ffmpeg</code>:
6353 </p><table><tr><td>&nbsp;</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>
6357 </dd>
6358 </dl>
6359
6360 <p>Encoding ffpresets for common usages are provided so they can be used with the
6361 general presets system (e.g. passing the &lsquo;<samp>pre</samp>&rsquo; option).
6362 </p>
6363 <a name="libxvid"></a>
6364 <h2 class="section"><a href="ffplay-all.html#toc-libxvid">14.4 libxvid</a></h2>
6365
6366 <p>Xvid MPEG-4 Part 2 encoder wrapper.
6367 </p>
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>.
6371 </p>
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.
6374 </p>
6375 <a name="Options-14"></a>
6376 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-14">14.4.1 Options</a></h3>
6377
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.
6382 </p>
6383 <dl compact="compact">
6384 <dt> &lsquo;<samp>b</samp>&rsquo;</dt>
6385 <dt> &lsquo;<samp>g</samp>&rsquo;</dt>
6386 <dt> &lsquo;<samp>qmin</samp>&rsquo;</dt>
6387 <dt> &lsquo;<samp>qmax</samp>&rsquo;</dt>
6388 <dt> &lsquo;<samp>mpeg_quant</samp>&rsquo;</dt>
6389 <dt> &lsquo;<samp>threads</samp>&rsquo;</dt>
6390 <dt> &lsquo;<samp>bf</samp>&rsquo;</dt>
6391 <dt> &lsquo;<samp>b_qfactor</samp>&rsquo;</dt>
6392 <dt> &lsquo;<samp>b_qoffset</samp>&rsquo;</dt>
6393 <dt> &lsquo;<samp>flags</samp>&rsquo;</dt>
6394 <dd><p>Set specific encoding flags. Possible values:
6395 </p>
6396 <dl compact="compact">
6397 <dt> &lsquo;<samp>mv4</samp>&rsquo;</dt>
6398 <dd><p>Use four motion vector by macroblock.
6399 </p>
6400 </dd>
6401 <dt> &lsquo;<samp>aic</samp>&rsquo;</dt>
6402 <dd><p>Enable high quality AC prediction.
6403 </p>
6404 </dd>
6405 <dt> &lsquo;<samp>gray</samp>&rsquo;</dt>
6406 <dd><p>Only encode grayscale.
6407 </p>
6408 </dd>
6409 <dt> &lsquo;<samp>gmc</samp>&rsquo;</dt>
6410 <dd><p>Enable the use of global motion compensation (GMC).
6411 </p>
6412 </dd>
6413 <dt> &lsquo;<samp>qpel</samp>&rsquo;</dt>
6414 <dd><p>Enable quarter-pixel motion compensation.
6415 </p>
6416 </dd>
6417 <dt> &lsquo;<samp>cgop</samp>&rsquo;</dt>
6418 <dd><p>Enable closed GOP.
6419 </p>
6420 </dd>
6421 <dt> &lsquo;<samp>global_header</samp>&rsquo;</dt>
6422 <dd><p>Place global headers in extradata instead of every keyframe.
6423 </p>
6424 </dd>
6425 </dl>
6426
6427 </dd>
6428 <dt> &lsquo;<samp>trellis</samp>&rsquo;</dt>
6429 <dt> &lsquo;<samp>me_method</samp>&rsquo;</dt>
6430 <dd><p>Set motion estimation method. Possible values in decreasing order of
6431 speed and increasing order of quality:
6432 </p>
6433 <dl compact="compact">
6434 <dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
6435 <dd><p>Use no motion estimation (default).
6436 </p>
6437 </dd>
6438 <dt> &lsquo;<samp>phods</samp>&rsquo;</dt>
6439 <dt> &lsquo;<samp>x1</samp>&rsquo;</dt>
6440 <dt> &lsquo;<samp>log</samp>&rsquo;</dt>
6441 <dd><p>Enable advanced diamond zonal search for 16x16 blocks and half-pixel
6442 refinement for 16x16 blocks. &lsquo;<samp>x1</samp>&rsquo; and &lsquo;<samp>log</samp>&rsquo; are aliases for
6443 &lsquo;<samp>phods</samp>&rsquo;.
6444 </p>
6445 </dd>
6446 <dt> &lsquo;<samp>epzs</samp>&rsquo;</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.
6450 </p>
6451 </dd>
6452 <dt> &lsquo;<samp>full</samp>&rsquo;</dt>
6453 <dd><p>Enable all of the things described above, plus extended 16x16 and 8x8
6454 blocks search.
6455 </p></dd>
6456 </dl>
6457
6458 </dd>
6459 <dt> &lsquo;<samp>mbd</samp>&rsquo;</dt>
6460 <dd><p>Set macroblock decision algorithm. Possible values in the increasing
6461 order of quality:
6462 </p>
6463 <dl compact="compact">
6464 <dt> &lsquo;<samp>simple</samp>&rsquo;</dt>
6465 <dd><p>Use macroblock comparing function algorithm (default).
6466 </p>
6467 </dd>
6468 <dt> &lsquo;<samp>bits</samp>&rsquo;</dt>
6469 <dd><p>Enable rate distortion-based half pixel and quarter pixel refinement for
6470 16x16 blocks.
6471 </p>
6472 </dd>
6473 <dt> &lsquo;<samp>rd</samp>&rsquo;</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.
6477 </p></dd>
6478 </dl>
6479
6480 </dd>
6481 <dt> &lsquo;<samp>lumi_aq</samp>&rsquo;</dt>
6482 <dd><p>Enable lumi masking adaptive quantization when set to 1. Default is 0
6483 (disabled).
6484 </p>
6485 </dd>
6486 <dt> &lsquo;<samp>variance_aq</samp>&rsquo;</dt>
6487 <dd><p>Enable variance adaptive quantization when set to 1. Default is 0
6488 (disabled).
6489 </p>
6490 <p>When combined with &lsquo;<samp>lumi_aq</samp>&rsquo;, 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
6493 effects.
6494 </p>
6495 </dd>
6496 <dt> &lsquo;<samp>ssim</samp>&rsquo;</dt>
6497 <dd><p>Set structural similarity (SSIM) displaying method. Possible values:
6498 </p>
6499 <dl compact="compact">
6500 <dt> &lsquo;<samp>off</samp>&rsquo;</dt>
6501 <dd><p>Disable displaying of SSIM information.
6502 </p>
6503 </dd>
6504 <dt> &lsquo;<samp>avg</samp>&rsquo;</dt>
6505 <dd><p>Output average SSIM at the end of encoding to stdout. The format of
6506 showing the average SSIM is:
6507 </p>
6508 <table><tr><td>&nbsp;</td><td><pre class="example">Average SSIM: %f
6509 </pre></td></tr></table>
6510
6511 <p>For users who are not familiar with C, %f means a float number, or
6512 a decimal (e.g. 0.939232).
6513 </p>
6514 </dd>
6515 <dt> &lsquo;<samp>frame</samp>&rsquo;</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
6518 is:
6519 </p>
6520 <table><tr><td>&nbsp;</td><td><pre class="example">       SSIM: avg: %1.3f min: %1.3f max: %1.3f
6521 </pre></td></tr></table>
6522
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).
6525 </p>
6526 </dd>
6527 </dl>
6528
6529 </dd>
6530 <dt> &lsquo;<samp>ssim_acc</samp>&rsquo;</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
6533 fastest.
6534 </p>
6535 </dd>
6536 </dl>
6537
6538 <a name="png"></a>
6539 <h2 class="section"><a href="ffplay-all.html#toc-png">14.5 png</a></h2>
6540
6541 <p>PNG image encoder.
6542 </p>
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>
6545
6546 <dl compact="compact">
6547 <dt> &lsquo;<samp>dpi <var>integer</var></samp>&rsquo;</dt>
6548 <dd><p>Set physical density of pixels, in dots per inch, unset by default
6549 </p></dd>
6550 <dt> &lsquo;<samp>dpm <var>integer</var></samp>&rsquo;</dt>
6551 <dd><p>Set physical density of pixels, in dots per meter, unset by default
6552 </p></dd>
6553 </dl>
6554
6555 <a name="ProRes"></a>
6556 <h2 class="section"><a href="ffplay-all.html#toc-ProRes">14.6 ProRes</a></h2>
6557
6558 <p>Apple ProRes encoder.
6559 </p>
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.
6562 </p>
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>
6565
6566 <dl compact="compact">
6567 <dt> &lsquo;<samp>profile <var>integer</var></samp>&rsquo;</dt>
6568 <dd><p>Select the ProRes profile to encode
6569 </p><dl compact="compact">
6570 <dt> &lsquo;<samp>proxy</samp>&rsquo;</dt>
6571 <dt> &lsquo;<samp>lt</samp>&rsquo;</dt>
6572 <dt> &lsquo;<samp>standard</samp>&rsquo;</dt>
6573 <dt> &lsquo;<samp>hq</samp>&rsquo;</dt>
6574 <dt> &lsquo;<samp>4444</samp>&rsquo;</dt>
6575 </dl>
6576
6577 </dd>
6578 <dt> &lsquo;<samp>quant_mat <var>integer</var></samp>&rsquo;</dt>
6579 <dd><p>Select quantization matrix.
6580 </p><dl compact="compact">
6581 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
6582 <dt> &lsquo;<samp>default</samp>&rsquo;</dt>
6583 <dt> &lsquo;<samp>proxy</samp>&rsquo;</dt>
6584 <dt> &lsquo;<samp>lt</samp>&rsquo;</dt>
6585 <dt> &lsquo;<samp>standard</samp>&rsquo;</dt>
6586 <dt> &lsquo;<samp>hq</samp>&rsquo;</dt>
6587 </dl>
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
6590 picked.
6591 </p>
6592 </dd>
6593 <dt> &lsquo;<samp>bits_per_mb <var>integer</var></samp>&rsquo;</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.
6596 </p>
6597 </dd>
6598 <dt> &lsquo;<samp>mbs_per_slice <var>integer</var></samp>&rsquo;</dt>
6599 <dd><p>Number of macroblocks in each slice (1-8); the default value (8)
6600 should be good in almost all situations.
6601 </p>
6602 </dd>
6603 <dt> &lsquo;<samp>vendor <var>string</var></samp>&rsquo;</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
6606 the Apple encoder.
6607 </p>
6608 </dd>
6609 <dt> &lsquo;<samp>alpha_bits <var>integer</var></samp>&rsquo;</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.
6613 </p>
6614 </dd>
6615 </dl>
6616
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>
6619
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.
6625 </p>
6626 <p>Setting a higher &lsquo;<samp>bits_per_mb</samp>&rsquo; limit will improve the speed.
6627 </p>
6628 <p>For the fastest encoding speed set the &lsquo;<samp>qscale</samp>&rsquo; parameter (4 is the
6629 recommended value) and do not set a size constraint.
6630 </p>
6631 <a name="Bitstream-Filters"></a>
6632 <h1 class="chapter"><a href="ffplay-all.html#toc-Bitstream-Filters">15. Bitstream Filters</a></h1>
6633
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>.
6637 </p>
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>.
6642 </p>
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.
6645 </p>
6646 <p>Below is a description of the currently available bitstream filters.
6647 </p>
6648 <a name="aac_005fadtstoasc"></a>
6649 <h2 class="section"><a href="ffplay-all.html#toc-aac_005fadtstoasc">15.1 aac_adtstoasc</a></h2>
6650
6651 <p>Convert MPEG-2/4 AAC ADTS to MPEG-4 Audio Specific Configuration
6652 bitstream filter.
6653 </p>
6654 <p>This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4
6655 ADTS header and removes the ADTS header.
6656 </p>
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.
6659 </p>
6660 <a name="chomp"></a>
6661 <h2 class="section"><a href="ffplay-all.html#toc-chomp">15.2 chomp</a></h2>
6662
6663 <p>Remove zero padding at the end of a packet.
6664 </p>
6665 <a name="dump_005fextra"></a>
6666 <h2 class="section"><a href="ffplay-all.html#toc-dump_005fextra">15.3 dump_extra</a></h2>
6667
6668 <p>Add extradata to the beginning of the filtered packets.
6669 </p>
6670 <p>The additional argument specifies which packets should be filtered.
6671 It accepts the values:
6672 </p><dl compact="compact">
6673 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
6674 <dd><p>add extradata to all key packets, but only if <var>local_header</var> is
6675 set in the &lsquo;<samp>flags2</samp>&rsquo; codec context field
6676 </p>
6677 </dd>
6678 <dt> &lsquo;<samp>k</samp>&rsquo;</dt>
6679 <dd><p>add extradata to all key packets
6680 </p>
6681 </dd>
6682 <dt> &lsquo;<samp>e</samp>&rsquo;</dt>
6683 <dd><p>add extradata to all packets
6684 </p></dd>
6685 </dl>
6686
6687 <p>If not specified it is assumed &lsquo;<samp>k</samp>&rsquo;.
6688 </p>
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>&nbsp;</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>
6695
6696 <a name="h264_005fmp4toannexb"></a>
6697 <h2 class="section"><a href="ffplay-all.html#toc-h264_005fmp4toannexb">15.4 h264_mp4toannexb</a></h2>
6698
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
6701 specification).
6702 </p>
6703 <p>This is required by some streaming formats, typically the MPEG-2
6704 transport stream format (&quot;mpegts&quot;).
6705 </p>
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:
6708 </p>
6709 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
6710 </pre></td></tr></table>
6711
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>
6714
6715 <a name="mjpeg2jpeg"></a>
6716 <h2 class="section"><a href="ffplay-all.html#toc-mjpeg2jpeg">15.6 mjpeg2jpeg</a></h2>
6717
6718 <p>Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
6719 </p>
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,
6722 e.g. by
6723 </p>
6724 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
6725 </pre></td></tr></table>
6726
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>:
6730 </p>
6731 <p>Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
6732 commented that &quot;MJPEG, or at least the MJPEG in AVIs having the
6733 MJPG fourcc, is restricted JPEG with a fixed &ndash; and *omitted* &ndash;
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&rsquo;t have any idea
6739 how to decompress the data. The exact table necessary is given in
6740 the OpenDML spec.&quot;
6741 </p>
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.
6745 </p>
6746 <table><tr><td>&nbsp;</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>
6750
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>
6753
6754 <a name="movsub"></a>
6755 <h2 class="section"><a href="ffplay-all.html#toc-movsub">15.8 movsub</a></h2>
6756
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>
6759
6760 <a name="noise-1"></a>
6761 <h2 class="section"><a href="ffplay-all.html#toc-noise-1">15.10 noise</a></h2>
6762
6763 <a name="remove_005fextra"></a>
6764 <h2 class="section"><a href="ffplay-all.html#toc-remove_005fextra">15.11 remove_extra</a></h2>
6765
6766 <a name="Format-Options"></a>
6767 <h1 class="chapter"><a href="ffplay-all.html#toc-Format-Options">16. Format Options</a></h1>
6768
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
6772 that component.
6773 </p>
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 &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API
6777 for programmatic use.
6778 </p>
6779 <p>The list of supported options follows:
6780 </p>
6781 <dl compact="compact">
6782 <dt> &lsquo;<samp>avioflags <var>flags</var> (<em>input/output</em>)</samp>&rsquo;</dt>
6783 <dd><p>Possible values:
6784 </p><dl compact="compact">
6785 <dt> &lsquo;<samp>direct</samp>&rsquo;</dt>
6786 <dd><p>Reduce buffering.
6787 </p></dd>
6788 </dl>
6789
6790 </dd>
6791 <dt> &lsquo;<samp>probesize <var>integer</var> (<em>input</em>)</samp>&rsquo;</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.
6796 </p>
6797 </dd>
6798 <dt> &lsquo;<samp>packetsize <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
6799 <dd><p>Set packet size.
6800 </p>
6801 </dd>
6802 <dt> &lsquo;<samp>fflags <var>flags</var> (<em>input/output</em>)</samp>&rsquo;</dt>
6803 <dd><p>Set format flags.
6804 </p>
6805 <p>Possible values:
6806 </p><dl compact="compact">
6807 <dt> &lsquo;<samp>ignidx</samp>&rsquo;</dt>
6808 <dd><p>Ignore index.
6809 </p></dd>
6810 <dt> &lsquo;<samp>genpts</samp>&rsquo;</dt>
6811 <dd><p>Generate PTS.
6812 </p></dd>
6813 <dt> &lsquo;<samp>nofillin</samp>&rsquo;</dt>
6814 <dd><p>Do not fill in missing values that can be exactly calculated.
6815 </p></dd>
6816 <dt> &lsquo;<samp>noparse</samp>&rsquo;</dt>
6817 <dd><p>Disable AVParsers, this needs <code>+nofillin</code> too.
6818 </p></dd>
6819 <dt> &lsquo;<samp>igndts</samp>&rsquo;</dt>
6820 <dd><p>Ignore DTS.
6821 </p></dd>
6822 <dt> &lsquo;<samp>discardcorrupt</samp>&rsquo;</dt>
6823 <dd><p>Discard corrupted frames.
6824 </p></dd>
6825 <dt> &lsquo;<samp>sortdts</samp>&rsquo;</dt>
6826 <dd><p>Try to interleave output packets by DTS.
6827 </p></dd>
6828 <dt> &lsquo;<samp>keepside</samp>&rsquo;</dt>
6829 <dd><p>Do not merge side data.
6830 </p></dd>
6831 <dt> &lsquo;<samp>latm</samp>&rsquo;</dt>
6832 <dd><p>Enable RTP MP4A-LATM payload.
6833 </p></dd>
6834 <dt> &lsquo;<samp>nobuffer</samp>&rsquo;</dt>
6835 <dd><p>Reduce the latency introduced by optional buffering
6836 </p></dd>
6837 </dl>
6838
6839 </dd>
6840 <dt> &lsquo;<samp>seek2any <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
6841 <dd><p>Allow seeking to non-keyframes on demuxer level when supported if set to 1.
6842 Default is 0.
6843 </p>
6844 </dd>
6845 <dt> &lsquo;<samp>analyzeduration <var>integer</var> (<em>input</em>)</samp>&rsquo;</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.
6849 </p>
6850 </dd>
6851 <dt> &lsquo;<samp>cryptokey <var>hexadecimal string</var> (<em>input</em>)</samp>&rsquo;</dt>
6852 <dd><p>Set decryption key.
6853 </p>
6854 </dd>
6855 <dt> &lsquo;<samp>indexmem <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
6856 <dd><p>Set max memory used for timestamp index (per stream).
6857 </p>
6858 </dd>
6859 <dt> &lsquo;<samp>rtbufsize <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
6860 <dd><p>Set max memory used for buffering real-time frames.
6861 </p>
6862 </dd>
6863 <dt> &lsquo;<samp>fdebug <var>flags</var> (<em>input/output</em>)</samp>&rsquo;</dt>
6864 <dd><p>Print specific debug info.
6865 </p>
6866 <p>Possible values:
6867 </p><dl compact="compact">
6868 <dt> &lsquo;<samp>ts</samp>&rsquo;</dt>
6869 </dl>
6870
6871 </dd>
6872 <dt> &lsquo;<samp>max_delay <var>integer</var> (<em>input/output</em>)</samp>&rsquo;</dt>
6873 <dd><p>Set maximum muxing or demuxing delay in microseconds.
6874 </p>
6875 </dd>
6876 <dt> &lsquo;<samp>fpsprobesize <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
6877 <dd><p>Set number of frames used to probe fps.
6878 </p>
6879 </dd>
6880 <dt> &lsquo;<samp>audio_preload <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
6881 <dd><p>Set microseconds by which audio packets should be interleaved earlier.
6882 </p>
6883 </dd>
6884 <dt> &lsquo;<samp>chunk_duration <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
6885 <dd><p>Set microseconds for each chunk.
6886 </p>
6887 </dd>
6888 <dt> &lsquo;<samp>chunk_size <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
6889 <dd><p>Set size in bytes for each chunk.
6890 </p>
6891 </dd>
6892 <dt> &lsquo;<samp>err_detect, f_err_detect <var>flags</var> (<em>input</em>)</samp>&rsquo;</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.
6895 </p>
6896 <p>Possible values:
6897 </p><dl compact="compact">
6898 <dt> &lsquo;<samp>crccheck</samp>&rsquo;</dt>
6899 <dd><p>Verify embedded CRCs.
6900 </p></dd>
6901 <dt> &lsquo;<samp>bitstream</samp>&rsquo;</dt>
6902 <dd><p>Detect bitstream specification deviations.
6903 </p></dd>
6904 <dt> &lsquo;<samp>buffer</samp>&rsquo;</dt>
6905 <dd><p>Detect improper bitstream length.
6906 </p></dd>
6907 <dt> &lsquo;<samp>explode</samp>&rsquo;</dt>
6908 <dd><p>Abort decoding on minor error detection.
6909 </p></dd>
6910 <dt> &lsquo;<samp>careful</samp>&rsquo;</dt>
6911 <dd><p>Consider things that violate the spec and have not been seen in the
6912 wild as errors.
6913 </p></dd>
6914 <dt> &lsquo;<samp>compliant</samp>&rsquo;</dt>
6915 <dd><p>Consider all spec non compliancies as errors.
6916 </p></dd>
6917 <dt> &lsquo;<samp>aggressive</samp>&rsquo;</dt>
6918 <dd><p>Consider things that a sane encoder should not do as an error.
6919 </p></dd>
6920 </dl>
6921
6922 </dd>
6923 <dt> &lsquo;<samp>use_wallclock_as_timestamps <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
6924 <dd><p>Use wallclock as timestamps.
6925 </p>
6926 </dd>
6927 <dt> &lsquo;<samp>avoid_negative_ts <var>integer</var> (<em>output</em>)</samp>&rsquo;</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.
6931 </p>
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.
6936 </p>
6937 <p>Also note that this affects only leading negative timestamps, and not
6938 non-monotonic negative timestamps.
6939 </p>
6940 </dd>
6941 <dt> &lsquo;<samp>skip_initial_bytes <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
6942 <dd><p>Set number of bytes to skip before reading header and frames if set to 1.
6943 Default is 0.
6944 </p>
6945 </dd>
6946 <dt> &lsquo;<samp>correct_ts_overflow <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
6947 <dd><p>Correct single timestamp overflows if set to 1. Default is 1.
6948 </p>
6949 </dd>
6950 <dt> &lsquo;<samp>flush_packets <var>integer</var> (<em>output</em>)</samp>&rsquo;</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.
6954 </p></dd>
6955 </dl>
6956
6957
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>
6961
6962 <p>Format stream specifiers allow selection of one or more streams that
6963 match specific properties.
6964 </p>
6965 <p>Possible forms of stream specifiers are:
6966 </p><dl compact="compact">
6967 <dt> &lsquo;<samp><var>stream_index</var></samp>&rsquo;</dt>
6968 <dd><p>Matches the stream with this index.
6969 </p>
6970 </dd>
6971 <dt> &lsquo;<samp><var>stream_type</var>[:<var>stream_index</var>]</samp>&rsquo;</dt>
6972 <dd><p><var>stream_type</var> is one of following: &rsquo;v&rsquo; for video, &rsquo;a&rsquo; for audio,
6973 &rsquo;s&rsquo; for subtitle, &rsquo;d&rsquo; for data, and &rsquo;t&rsquo; 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
6976 this type.
6977 </p>
6978 </dd>
6979 <dt> &lsquo;<samp>p:<var>program_id</var>[:<var>stream_index</var>]</samp>&rsquo;</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.
6983 </p>
6984 </dd>
6985 <dt> &lsquo;<samp>#<var>stream_id</var></samp>&rsquo;</dt>
6986 <dd><p>Matches the stream by a format-specific ID.
6987 </p></dd>
6988 </dl>
6989
6990 <p>The exact semantics of stream specifiers is defined by the
6991 <code>avformat_match_stream_specifier()</code> function declared in the
6992 &lsquo;<tt>libavformat/avformat.h</tt>&rsquo; header.
6993 </p>
6994 <a name="Demuxers"></a>
6995 <h1 class="chapter"><a href="ffplay-all.html#toc-Demuxers">17. Demuxers</a></h1>
6996
6997 <p>Demuxers are configured elements in FFmpeg that can read the
6998 multimedia streams from a particular type of file.
6999 </p>
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>.
7003 </p>
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>.
7008 </p>
7009 <p>The option <code>-formats</code> of the ff* tools will display the list of
7010 enabled demuxers.
7011 </p>
7012 <p>The description of some of the currently available demuxers follows.
7013 </p>
7014 <a name="applehttp"></a>
7015 <h2 class="section"><a href="ffplay-all.html#toc-applehttp">17.1 applehttp</a></h2>
7016
7017 <p>Apple HTTP Live Streaming demuxer.
7018 </p>
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 &rsquo;a&rsquo; or &rsquo;v&rsquo; 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 &quot;variant_bitrate&quot;.
7025 </p>
7026 <a name="asf"></a>
7027 <h2 class="section"><a href="ffplay-all.html#toc-asf">17.2 asf</a></h2>
7028
7029 <p>Advanced Systems Format demuxer.
7030 </p>
7031 <p>This demuxer is used to demux ASF files and MMS network streams.
7032 </p>
7033 <dl compact="compact">
7034 <dt> &lsquo;<samp>-no_resync_search <var>bool</var></samp>&rsquo;</dt>
7035 <dd><p>Do not try to resynchronize by looking for a certain optional start code.
7036 </p></dd>
7037 </dl>
7038
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>
7042
7043 <p>Virtual concatenation script demuxer.
7044 </p>
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
7047 together.
7048 </p>
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
7052 length.
7053 </p>
7054 <p>All files must have the same streams (same codecs, same time base, etc.).
7055 </p>
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
7060 each file.
7061 </p>
7062 <a name="Syntax-1"></a>
7063 <h3 class="subsection"><a href="ffplay-all.html#toc-Syntax-1">17.3.1 Syntax</a></h3>
7064
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 &rsquo;#&rsquo; are ignored. The
7067 following directive is recognized:
7068 </p>
7069 <dl compact="compact">
7070 <dt> &lsquo;<samp><code>file <var>path</var></code></samp>&rsquo;</dt>
7071 <dd><p>Path to a file to read; special characters and spaces must be escaped with
7072 backslash or single quotes.
7073 </p>
7074 <p>All subsequent directives apply to that file.
7075 </p>
7076 </dd>
7077 <dt> &lsquo;<samp><code>ffconcat version 1.0</code></samp>&rsquo;</dt>
7078 <dd><p>Identify the script type and version. It also sets the &lsquo;<samp>safe</samp>&rsquo; option
7079 to 1 if it was to its default -1.
7080 </p>
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
7083 line of the script.
7084 </p>
7085 </dd>
7086 <dt> &lsquo;<samp><code>duration <var>dur</var></code></samp>&rsquo;</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.
7090 </p>
7091 <p>If the duration is set for all files, then it is possible to seek in the
7092 whole concatenated video.
7093 </p>
7094 </dd>
7095 </dl>
7096
7097 <a name="Options-13"></a>
7098 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-13">17.3.2 Options</a></h3>
7099
7100 <p>This demuxer accepts the following option:
7101 </p>
7102 <dl compact="compact">
7103 <dt> &lsquo;<samp>safe</samp>&rsquo;</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
7108 component.
7109 </p>
7110 <p>If set to 0, any file name is accepted.
7111 </p>
7112 <p>The default is -1, it is equivalent to 1 if the format was automatically
7113 probed and 0 otherwise.
7114 </p>
7115 </dd>
7116 </dl>
7117
7118 <a name="flv"></a>
7119 <h2 class="section"><a href="ffplay-all.html#toc-flv">17.4 flv</a></h2>
7120
7121 <p>Adobe Flash Video Format demuxer.
7122 </p>
7123 <p>This demuxer is used to demux FLV files and RTMP network streams.
7124 </p>
7125 <dl compact="compact">
7126 <dt> &lsquo;<samp>-flv_metadata <var>bool</var></samp>&rsquo;</dt>
7127 <dd><p>Allocate the streams according to the onMetaData array content.
7128 </p></dd>
7129 </dl>
7130
7131 <a name="libgme"></a>
7132 <h2 class="section"><a href="ffplay-all.html#toc-libgme">17.5 libgme</a></h2>
7133
7134 <p>The Game Music Emu library is a collection of video game music file emulators.
7135 </p>
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.
7137 </p>
7138 <p>Some files have multiple tracks. The demuxer will pick the first track by
7139 default. The &lsquo;<samp>track_index</samp>&rsquo; 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.
7142 </p>
7143 <p>For very large files, the &lsquo;<samp>max_size</samp>&rsquo; option may have to be adjusted.
7144 </p>
7145 <a name="libquvi"></a>
7146 <h2 class="section"><a href="ffplay-all.html#toc-libquvi">17.6 libquvi</a></h2>
7147
7148 <p>Play media from Internet services using the quvi project.
7149 </p>
7150 <p>The demuxer accepts a &lsquo;<samp>format</samp>&rsquo; option to request a specific quality. It
7151 is by default set to <var>best</var>.
7152 </p>
7153 <p>See <a href="http://quvi.sourceforge.net/">http://quvi.sourceforge.net/</a> for more information.
7154 </p>
7155 <p>FFmpeg needs to be built with <code>--enable-libquvi</code> for this demuxer to be
7156 enabled.
7157 </p>
7158 <a name="image2-2"></a>
7159 <h2 class="section"><a href="ffplay-all.html#toc-image2-2">17.7 image2</a></h2>
7160
7161 <p>Image file demuxer.
7162 </p>
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>.
7166 </p>
7167 <p>The pattern may contain a suffix which is used to automatically
7168 determine the format of the images contained in the files.
7169 </p>
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.
7172 </p>
7173 <p>This demuxer accepts the following options:
7174 </p><dl compact="compact">
7175 <dt> &lsquo;<samp>framerate</samp>&rsquo;</dt>
7176 <dd><p>Set the frame rate for the video stream. It defaults to 25.
7177 </p></dd>
7178 <dt> &lsquo;<samp>loop</samp>&rsquo;</dt>
7179 <dd><p>If set to 1, loop over the input. Default value is 0.
7180 </p></dd>
7181 <dt> &lsquo;<samp>pattern_type</samp>&rsquo;</dt>
7182 <dd><p>Select the pattern type used to interpret the provided filename.
7183 </p>
7184 <p><var>pattern_type</var> accepts one of the following values.
7185 </p><dl compact="compact">
7186 <dt> &lsquo;<samp>sequence</samp>&rsquo;</dt>
7187 <dd><p>Select a sequence pattern type, used to specify a sequence of files
7188 indexed by sequential numbers.
7189 </p>
7190 <p>A sequence pattern may contain the string &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, which
7191 specifies the position of the characters representing a sequential
7192 number in each filename matched by the pattern. If the form
7193 &quot;%d0<var>N</var>d&quot; 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 &rsquo;%&rsquo; can be
7196 specified in the pattern with the string &quot;%%&quot;.
7197 </p>
7198 <p>If the sequence pattern contains &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, 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.
7203 </p>
7204 <p>For example the pattern &quot;img-%03d.bmp&quot; will match a sequence of
7205 filenames of the form &lsquo;<tt>img-001.bmp</tt>&rsquo;, &lsquo;<tt>img-002.bmp</tt>&rsquo;, ...,
7206 &lsquo;<tt>img-010.bmp</tt>&rsquo;, etc.; the pattern &quot;i%%m%%g-%d.jpg&quot; will match a
7207 sequence of filenames of the form &lsquo;<tt>i%m%g-1.jpg</tt>&rsquo;,
7208 &lsquo;<tt>i%m%g-2.jpg</tt>&rsquo;, ..., &lsquo;<tt>i%m%g-10.jpg</tt>&rsquo;, etc.
7209 </p>
7210 <p>Note that the pattern must not necessarily contain &quot;%d&quot; or
7211 &quot;%0<var>N</var>d&quot;, for example to convert a single image file
7212 &lsquo;<tt>img.jpeg</tt>&rsquo; you can employ the command:
7213 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i img.jpeg img.png
7214 </pre></td></tr></table>
7215
7216 </dd>
7217 <dt> &lsquo;<samp>glob</samp>&rsquo;</dt>
7218 <dd><p>Select a glob wildcard pattern type.
7219 </p>
7220 <p>The pattern is interpreted like a <code>glob()</code> pattern. This is only
7221 selectable if libavformat was compiled with globbing support.
7222 </p>
7223 </dd>
7224 <dt> &lsquo;<samp>glob_sequence <em>(deprecated, will be removed)</em></samp>&rsquo;</dt>
7225 <dd><p>Select a mixed glob wildcard/sequence pattern.
7226 </p>
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 &quot;%&quot;, the pattern is
7230 interpreted like a <code>glob()</code> pattern, otherwise it is interpreted
7231 like a sequence pattern.
7232 </p>
7233 <p>All glob special characters <code>%*?[]{}</code> must be prefixed
7234 with &quot;%&quot;. To escape a literal &quot;%&quot; you shall use &quot;%%&quot;.
7235 </p>
7236 <p>For example the pattern <code>foo-%*.jpeg</code> will match all the
7237 filenames prefixed by &quot;foo-&quot; and terminating with &quot;.jpeg&quot;, and
7238 <code>foo-%?%?%?.jpeg</code> will match all the filenames prefixed with
7239 &quot;foo-&quot;, followed by a sequence of three characters, and terminating
7240 with &quot;.jpeg&quot;.
7241 </p>
7242 <p>This pattern type is deprecated in favor of <var>glob</var> and
7243 <var>sequence</var>.
7244 </p></dd>
7245 </dl>
7246
7247 <p>Default value is <var>glob_sequence</var>.
7248 </p></dd>
7249 <dt> &lsquo;<samp>pixel_format</samp>&rsquo;</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.
7252 </p></dd>
7253 <dt> &lsquo;<samp>start_number</samp>&rsquo;</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.
7256 </p></dd>
7257 <dt> &lsquo;<samp>start_number_range</samp>&rsquo;</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
7260 is 5.
7261 </p></dd>
7262 <dt> &lsquo;<samp>ts_from_file</samp>&rsquo;</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.
7266 </p></dd>
7267 <dt> &lsquo;<samp>video_size</samp>&rsquo;</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.
7270 </p></dd>
7271 </dl>
7272
7273 <a name="Examples-88"></a>
7274 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-88">17.7.1 Examples</a></h3>
7275
7276 <ul>
7277 <li>
7278 Use <code>ffmpeg</code> for creating a video from the images in the file
7279 sequence &lsquo;<tt>img-001.jpeg</tt>&rsquo;, &lsquo;<tt>img-002.jpeg</tt>&rsquo;, ..., assuming an
7280 input frame rate of 10 frames per second:
7281 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
7282 </pre></td></tr></table>
7283
7284 </li><li>
7285 As above, but start by reading from a file with index 100 in the sequence:
7286 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
7287 </pre></td></tr></table>
7288
7289 </li><li>
7290 Read images matching the &quot;*.png&quot; glob pattern , that is all the files
7291 terminating with the &quot;.png&quot; suffix:
7292 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -framerate 10 -pattern_type glob -i &quot;*.png&quot; out.mkv
7293 </pre></td></tr></table>
7294 </li></ul>
7295
7296 <a name="mpegts-1"></a>
7297 <h2 class="section"><a href="ffplay-all.html#toc-mpegts-1">17.8 mpegts</a></h2>
7298
7299 <p>MPEG-2 transport stream demuxer.
7300 </p>
7301 <dl compact="compact">
7302 <dt> &lsquo;<samp>fix_teletext_pts</samp>&rsquo;</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.
7307 </p></dd>
7308 </dl>
7309
7310 <a name="rawvideo"></a>
7311 <h2 class="section"><a href="ffplay-all.html#toc-rawvideo">17.9 rawvideo</a></h2>
7312
7313 <p>Raw video demuxer.
7314 </p>
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.
7318 </p>
7319 <p>This demuxer accepts the following options:
7320 </p><dl compact="compact">
7321 <dt> &lsquo;<samp>framerate</samp>&rsquo;</dt>
7322 <dd><p>Set input video frame rate. Default value is 25.
7323 </p>
7324 </dd>
7325 <dt> &lsquo;<samp>pixel_format</samp>&rsquo;</dt>
7326 <dd><p>Set the input video pixel format. Default value is <code>yuv420p</code>.
7327 </p>
7328 </dd>
7329 <dt> &lsquo;<samp>video_size</samp>&rsquo;</dt>
7330 <dd><p>Set the input video size. This value must be specified explicitly.
7331 </p></dd>
7332 </dl>
7333
7334 <p>For example to read a rawvideo file &lsquo;<tt>input.raw</tt>&rsquo; 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
7337 the command:
7338 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
7339 </pre></td></tr></table>
7340
7341 <a name="sbg"></a>
7342 <h2 class="section"><a href="ffplay-all.html#toc-sbg">17.10 sbg</a></h2>
7343
7344 <p>SBaGen script demuxer.
7345 </p>
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>&nbsp;</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
7352 off: -
7353 NOW      == a
7354 +0:07:00 == b
7355 +0:14:00 == a
7356 +0:21:00 == b
7357 +0:30:00    off
7358 </pre></td></tr></table>
7359
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&rsquo;s clock accuracy, but if the user
7369 somehow pauses the playback or seeks, all times will be shifted accordingly.
7370 </p>
7371 <a name="tedcaptions"></a>
7372 <h2 class="section"><a href="ffplay-all.html#toc-tedcaptions">17.11 tedcaptions</a></h2>
7373
7374 <p>JSON captions used for <a href="http://www.ted.com/">TED Talks</a>.
7375 </p>
7376 <p>TED does not provide links to the captions, but they can be guessed from the
7377 page. The file &lsquo;<tt>tools/bookmarklets.html</tt>&rsquo; from the FFmpeg source tree
7378 contains a bookmarklet to expose them.
7379 </p>
7380 <p>This demuxer accepts the following option:
7381 </p><dl compact="compact">
7382 <dt> &lsquo;<samp>start_time</samp>&rsquo;</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.
7386 </p></dd>
7387 </dl>
7388
7389 <p>Example: convert the captions to a format most players understand:
7390 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
7391 </pre></td></tr></table>
7392
7393 <a name="Muxers"></a>
7394 <h1 class="chapter"><a href="ffplay-all.html#toc-Muxers">18. Muxers</a></h1>
7395
7396 <p>Muxers are configured elements in FFmpeg which allow writing
7397 multimedia streams to a particular type of file.
7398 </p>
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>.
7402 </p>
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>.
7407 </p>
7408 <p>The option <code>-formats</code> of the ff* tools will display the list of
7409 enabled muxers.
7410 </p>
7411 <p>A description of some of the currently available muxers follows.
7412 </p>
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>
7416
7417 <p>Audio Interchange File Format muxer.
7418 </p>
7419 <p>It accepts the following options:
7420 </p>
7421 <dl compact="compact">
7422 <dt> &lsquo;<samp>write_id3v2</samp>&rsquo;</dt>
7423 <dd><p>Enable ID3v2 tags writing when set to 1. Default is 0 (disabled).
7424 </p>
7425 </dd>
7426 <dt> &lsquo;<samp>id3v2_version</samp>&rsquo;</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.
7429 </p>
7430 </dd>
7431 </dl>
7432
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>
7436
7437 <p>CRC (Cyclic Redundancy Check) testing format.
7438 </p>
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
7442 CRC.
7443 </p>
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.
7447 </p>
7448 <p>For example to compute the CRC of the input, and store it in the file
7449 &lsquo;<tt>out.crc</tt>&rsquo;:
7450 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f crc out.crc
7451 </pre></td></tr></table>
7452
7453 <p>You can print the CRC to stdout with the command:
7454 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f crc -
7455 </pre></td></tr></table>
7456
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>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
7462 </pre></td></tr></table>
7463
7464 <p>See also the <a href="#framecrc">framecrc</a> muxer.
7465 </p>
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>
7469
7470 <p>Per-packet CRC (Cyclic Redundancy Check) testing format.
7471 </p>
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
7475 CRC.
7476 </p>
7477 <p>The output of the muxer consists of a line for each audio and video
7478 packet of the form:
7479 </p><table><tr><td>&nbsp;</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>
7481
7482 <p><var>CRC</var> is a hexadecimal number 0-padded to 8 digits containing the
7483 CRC of the packet.
7484 </p>
7485 <p>For example to compute the CRC of the audio and video frames in
7486 &lsquo;<tt>INPUT</tt>&rsquo;, converted to raw audio and video packets, and store it
7487 in the file &lsquo;<tt>out.crc</tt>&rsquo;:
7488 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f framecrc out.crc
7489 </pre></td></tr></table>
7490
7491 <p>To print the information to stdout, use the command:
7492 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f framecrc -
7493 </pre></td></tr></table>
7494
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>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
7502 </pre></td></tr></table>
7503
7504 <p>See also the <a href="#crc">crc</a> muxer.
7505 </p>
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>
7509
7510 <p>Per-packet MD5 testing format.
7511 </p>
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
7515 hash.
7516 </p>
7517 <p>The output of the muxer consists of a line for each audio and video
7518 packet of the form:
7519 </p><table><tr><td>&nbsp;</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>
7521
7522 <p><var>MD5</var> is a hexadecimal number representing the computed MD5 hash
7523 for the packet.
7524 </p>
7525 <p>For example to compute the MD5 of the audio and video frames in
7526 &lsquo;<tt>INPUT</tt>&rsquo;, converted to raw audio and video packets, and store it
7527 in the file &lsquo;<tt>out.md5</tt>&rsquo;:
7528 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f framemd5 out.md5
7529 </pre></td></tr></table>
7530
7531 <p>To print the information to stdout, use the command:
7532 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f framemd5 -
7533 </pre></td></tr></table>
7534
7535 <p>See also the <a href="#md5">md5</a> muxer.
7536 </p>
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>
7540
7541 <p>Animated GIF muxer.
7542 </p>
7543 <p>It accepts the following options:
7544 </p>
7545 <dl compact="compact">
7546 <dt> &lsquo;<samp>loop</samp>&rsquo;</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).
7549 </p>
7550 </dd>
7551 <dt> &lsquo;<samp>final_delay</samp>&rsquo;</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.
7556 </p></dd>
7557 </dl>
7558
7559 <p>For example, to encode a gif looping 10 times, with a 5 seconds delay between
7560 the loops:
7561 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -loop 10 -final_delay 500 out.gif
7562 </pre></td></tr></table>
7563
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>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -c:v gif -f image2 &quot;out%d.gif&quot;
7567 </pre></td></tr></table>
7568
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.
7571 </p>
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>
7575
7576 <p>Apple HTTP Live Streaming muxer that segments MPEG-TS according to
7577 the HTTP Live Streaming specification.
7578 </p>
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
7582 a .ts extension.
7583 </p>
7584 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.nut out.m3u8
7585 </pre></td></tr></table>
7586
7587 <dl compact="compact">
7588 <dt> &lsquo;<samp>-hls_time <var>seconds</var></samp>&rsquo;</dt>
7589 <dd><p>Set the segment length in seconds.
7590 </p></dd>
7591 <dt> &lsquo;<samp>-hls_list_size <var>size</var></samp>&rsquo;</dt>
7592 <dd><p>Set the maximum number of playlist entries.
7593 </p></dd>
7594 <dt> &lsquo;<samp>-hls_wrap <var>wrap</var></samp>&rsquo;</dt>
7595 <dd><p>Set the number after which index wraps.
7596 </p></dd>
7597 <dt> &lsquo;<samp>-start_number <var>number</var></samp>&rsquo;</dt>
7598 <dd><p>Start the sequence from <var>number</var>.
7599 </p></dd>
7600 </dl>
7601
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>
7605
7606 <p>ICO file muxer.
7607 </p>
7608 <p>Microsoft&rsquo;s icon file format (ICO) has some strict limitations that should be noted:
7609 </p>
7610 <ul>
7611 <li>
7612 Size cannot exceed 256 pixels in any dimension
7613
7614 </li><li>
7615 Only BMP and PNG images can be stored
7616
7617 </li><li>
7618 If a BMP image is used, it must be one of the following pixel formats:
7619 <table><tr><td>&nbsp;</td><td><pre class="example">BMP Bit Depth      FFmpeg Pixel Format
7620 1bit               pal8
7621 4bit               pal8
7622 8bit               pal8
7623 16bit              rgb555le
7624 24bit              bgr24
7625 32bit              bgra
7626 </pre></td></tr></table>
7627
7628 </li><li>
7629 If a BMP image is used, it must use the BITMAPINFOHEADER DIB header
7630
7631 </li><li>
7632 If a PNG image is used, it must use the rgba pixel format
7633 </li></ul>
7634
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>
7638
7639 <p>Image file muxer.
7640 </p>
7641 <p>The image file muxer writes video frames to image files.
7642 </p>
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 &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, this string
7646 specifies the position of the characters representing a numbering in
7647 the filenames. If the form &quot;%0<var>N</var>d&quot; is used, the string
7648 representing the number in each filename is 0-padded to <var>N</var>
7649 digits. The literal character &rsquo;%&rsquo; can be specified in the pattern with
7650 the string &quot;%%&quot;.
7651 </p>
7652 <p>If the pattern contains &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, the first filename of
7653 the file list specified will contain the number 1, all the following
7654 numbers will be sequential.
7655 </p>
7656 <p>The pattern may contain a suffix which is used to automatically
7657 determine the format of the image files to write.
7658 </p>
7659 <p>For example the pattern &quot;img-%03d.bmp&quot; will specify a sequence of
7660 filenames of the form &lsquo;<tt>img-001.bmp</tt>&rsquo;, &lsquo;<tt>img-002.bmp</tt>&rsquo;, ...,
7661 &lsquo;<tt>img-010.bmp</tt>&rsquo;, etc.
7662 The pattern &quot;img%%-%d.jpg&quot; will specify a sequence of filenames of the
7663 form &lsquo;<tt>img%-1.jpg</tt>&rsquo;, &lsquo;<tt>img%-2.jpg</tt>&rsquo;, ..., &lsquo;<tt>img%-10.jpg</tt>&rsquo;,
7664 etc.
7665 </p>
7666 <p>The following example shows how to use <code>ffmpeg</code> for creating a
7667 sequence of files &lsquo;<tt>img-001.jpeg</tt>&rsquo;, &lsquo;<tt>img-002.jpeg</tt>&rsquo;, ...,
7668 taking one image every second from the input video:
7669 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -vsync 1 -r 1 -f image2 'img-%03d.jpeg'
7670 </pre></td></tr></table>
7671
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>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -vsync 1 -r 1 'img-%03d.jpeg'
7677 </pre></td></tr></table>
7678
7679 <p>Note also that the pattern must not necessarily contain &quot;%d&quot; or
7680 &quot;%0<var>N</var>d&quot;, for example to create a single image file
7681 &lsquo;<tt>img.jpeg</tt>&rsquo; from the input video you can employ the command:
7682 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
7683 </pre></td></tr></table>
7684
7685 <dl compact="compact">
7686 <dt> &lsquo;<samp>start_number <var>number</var></samp>&rsquo;</dt>
7687 <dd><p>Start the sequence from <var>number</var>. Default value is 1. Must be a
7688 non-negative number.
7689 </p>
7690 </dd>
7691 <dt> &lsquo;<samp>-update <var>number</var></samp>&rsquo;</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
7694 images.
7695 </p>
7696 </dd>
7697 </dl>
7698
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 &rsquo;.Y&rsquo; file. The muxer will automatically open the
7703 &rsquo;.U&rsquo; and &rsquo;.V&rsquo; files as required.
7704 </p>
7705 <a name="matroska"></a>
7706 <h2 class="section"><a href="ffplay-all.html#toc-matroska">18.9 matroska</a></h2>
7707
7708 <p>Matroska container muxer.
7709 </p>
7710 <p>This muxer implements the matroska and webm container specs.
7711 </p>
7712 <p>The recognized metadata settings in this muxer are:
7713 </p>
7714 <dl compact="compact">
7715 <dt> &lsquo;<samp>title=<var>title name</var></samp>&rsquo;</dt>
7716 <dd><p>Name provided to a single track
7717 </p></dd>
7718 </dl>
7719
7720 <dl compact="compact">
7721 <dt> &lsquo;<samp>language=<var>language name</var></samp>&rsquo;</dt>
7722 <dd><p>Specifies the language of the track in the Matroska languages form
7723 </p></dd>
7724 </dl>
7725
7726 <dl compact="compact">
7727 <dt> &lsquo;<samp>stereo_mode=<var>mode</var></samp>&rsquo;</dt>
7728 <dd><p>Stereo 3D video layout of two views in a single video track
7729 </p><dl compact="compact">
7730 <dt> &lsquo;<samp>mono</samp>&rsquo;</dt>
7731 <dd><p>video is not stereo
7732 </p></dd>
7733 <dt> &lsquo;<samp>left_right</samp>&rsquo;</dt>
7734 <dd><p>Both views are arranged side by side, Left-eye view is on the left
7735 </p></dd>
7736 <dt> &lsquo;<samp>bottom_top</samp>&rsquo;</dt>
7737 <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is at bottom
7738 </p></dd>
7739 <dt> &lsquo;<samp>top_bottom</samp>&rsquo;</dt>
7740 <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is on top
7741 </p></dd>
7742 <dt> &lsquo;<samp>checkerboard_rl</samp>&rsquo;</dt>
7743 <dd><p>Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
7744 </p></dd>
7745 <dt> &lsquo;<samp>checkerboard_lr</samp>&rsquo;</dt>
7746 <dd><p>Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
7747 </p></dd>
7748 <dt> &lsquo;<samp>row_interleaved_rl</samp>&rsquo;</dt>
7749 <dd><p>Each view is constituted by a row based interleaving, Right-eye view is first row
7750 </p></dd>
7751 <dt> &lsquo;<samp>row_interleaved_lr</samp>&rsquo;</dt>
7752 <dd><p>Each view is constituted by a row based interleaving, Left-eye view is first row
7753 </p></dd>
7754 <dt> &lsquo;<samp>col_interleaved_rl</samp>&rsquo;</dt>
7755 <dd><p>Both views are arranged in a column based interleaving manner, Right-eye view is first column
7756 </p></dd>
7757 <dt> &lsquo;<samp>col_interleaved_lr</samp>&rsquo;</dt>
7758 <dd><p>Both views are arranged in a column based interleaving manner, Left-eye view is first column
7759 </p></dd>
7760 <dt> &lsquo;<samp>anaglyph_cyan_red</samp>&rsquo;</dt>
7761 <dd><p>All frames are in anaglyph format viewable through red-cyan filters
7762 </p></dd>
7763 <dt> &lsquo;<samp>right_left</samp>&rsquo;</dt>
7764 <dd><p>Both views are arranged side by side, Right-eye view is on the left
7765 </p></dd>
7766 <dt> &lsquo;<samp>anaglyph_green_magenta</samp>&rsquo;</dt>
7767 <dd><p>All frames are in anaglyph format viewable through green-magenta filters
7768 </p></dd>
7769 <dt> &lsquo;<samp>block_lr</samp>&rsquo;</dt>
7770 <dd><p>Both eyes laced in one Block, Left-eye view is first
7771 </p></dd>
7772 <dt> &lsquo;<samp>block_rl</samp>&rsquo;</dt>
7773 <dd><p>Both eyes laced in one Block, Right-eye view is first
7774 </p></dd>
7775 </dl>
7776 </dd>
7777 </dl>
7778
7779 <p>For example a 3D WebM clip can be created using the following command line:
7780 </p><table><tr><td>&nbsp;</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>
7782
7783 <p>This muxer supports the following options:
7784 </p>
7785 <dl compact="compact">
7786 <dt> &lsquo;<samp>reserve_index_space</samp>&rsquo;</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 &ndash; e.g.  streaming where seeking is possible but slow &ndash; it is useful to put the
7791 index at the beginning of the file.
7792 </p>
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.
7797 </p>
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.
7800 </p>
7801 </dd>
7802 </dl>
7803
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>
7807
7808 <p>MD5 testing format.
7809 </p>
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
7813 hash.
7814 </p>
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.
7818 </p>
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 &lsquo;<tt>out.md5</tt>&rsquo;:
7821 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f md5 out.md5
7822 </pre></td></tr></table>
7823
7824 <p>You can print the MD5 to stdout with the command:
7825 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f md5 -
7826 </pre></td></tr></table>
7827
7828 <p>See also the <a href="#framemd5">framemd5</a> muxer.
7829 </p>
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>
7832
7833 <p>MOV/MP4/ISMV (Smooth Streaming) muxer.
7834 </p>
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.
7848 </p>
7849 <p>Fragmentation is enabled by setting one of the AVOptions that define
7850 how to cut the file into fragments:
7851 </p>
7852 <dl compact="compact">
7853 <dt> &lsquo;<samp>-moov_size <var>bytes</var></samp>&rsquo;</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.
7856 </p></dd>
7857 <dt> &lsquo;<samp>-movflags frag_keyframe</samp>&rsquo;</dt>
7858 <dd><p>Start a new fragment at each video keyframe.
7859 </p></dd>
7860 <dt> &lsquo;<samp>-frag_duration <var>duration</var></samp>&rsquo;</dt>
7861 <dd><p>Create fragments that are <var>duration</var> microseconds long.
7862 </p></dd>
7863 <dt> &lsquo;<samp>-frag_size <var>size</var></samp>&rsquo;</dt>
7864 <dd><p>Create fragments that contain up to <var>size</var> bytes of payload data.
7865 </p></dd>
7866 <dt> &lsquo;<samp>-movflags frag_custom</samp>&rsquo;</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>.)
7871 </p></dd>
7872 <dt> &lsquo;<samp>-min_frag_duration <var>duration</var></samp>&rsquo;</dt>
7873 <dd><p>Don&rsquo;t create fragments that are shorter than <var>duration</var> microseconds long.
7874 </p></dd>
7875 </dl>
7876
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.
7881 </p>
7882 <p>Additionally, the way the output file is written can be adjusted
7883 through a few other options:
7884 </p>
7885 <dl compact="compact">
7886 <dt> &lsquo;<samp>-movflags empty_moov</samp>&rsquo;</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
7892 a zero duration.
7893 </p>
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.
7896 </p></dd>
7897 <dt> &lsquo;<samp>-movflags separate_moof</samp>&rsquo;</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.
7902 </p>
7903 <p>This option is implicitly set when writing ismv (Smooth Streaming) files.
7904 </p></dd>
7905 <dt> &lsquo;<samp>-movflags faststart</samp>&rsquo;</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.
7909 </p></dd>
7910 <dt> &lsquo;<samp>-movflags rtphint</samp>&rsquo;</dt>
7911 <dd><p>Add RTP hinting tracks to the output file.
7912 </p></dd>
7913 </dl>
7914
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>&nbsp;</td><td><pre class="example">ffmpeg -re <var>&lt;normal input/transcoding options&gt;</var> -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1)
7918 </pre></td></tr></table>
7919
7920 <a name="mp3"></a>
7921 <h2 class="section"><a href="ffplay-all.html#toc-mp3">18.12 mp3</a></h2>
7922
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.
7927 </p>
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
7930 of VBR files.
7931 </p>
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.
7938 </p>
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.
7942 </p>
7943 <p>Examples:
7944 </p>
7945 <p>Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
7946 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
7947 </pre></td></tr></table>
7948
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>&nbsp;</td><td><pre class="example">ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
7952 -metadata:s:v title=&quot;Album cover&quot; -metadata:s:v comment=&quot;Cover (Front)&quot; out.mp3
7953 </pre></td></tr></table>
7954
7955 <a name="mpegts"></a>
7956 <h2 class="section"><a href="ffplay-all.html#toc-mpegts">18.13 mpegts</a></h2>
7957
7958 <p>MPEG transport stream muxer.
7959 </p>
7960 <p>This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
7961 </p>
7962 <p>The muxer options are:
7963 </p>
7964 <dl compact="compact">
7965 <dt> &lsquo;<samp>-mpegts_original_network_id <var>number</var></samp>&rsquo;</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.
7969 </p></dd>
7970 <dt> &lsquo;<samp>-mpegts_transport_stream_id <var>number</var></samp>&rsquo;</dt>
7971 <dd><p>Set the transport_stream_id (default 0x0001). This identifies a
7972 transponder in DVB.
7973 </p></dd>
7974 <dt> &lsquo;<samp>-mpegts_service_id <var>number</var></samp>&rsquo;</dt>
7975 <dd><p>Set the service_id (default 0x0001) also known as program in DVB.
7976 </p></dd>
7977 <dt> &lsquo;<samp>-mpegts_pmt_start_pid <var>number</var></samp>&rsquo;</dt>
7978 <dd><p>Set the first PID for PMT (default 0x1000, max 0x1f00).
7979 </p></dd>
7980 <dt> &lsquo;<samp>-mpegts_start_pid <var>number</var></samp>&rsquo;</dt>
7981 <dd><p>Set the first PID for data packets (default 0x0100, max 0x0f00).
7982 </p></dd>
7983 <dt> &lsquo;<samp>-mpegts_m2ts_mode <var>number</var></samp>&rsquo;</dt>
7984 <dd><p>Enable m2ts mode if set to 1. Default value is -1 which disables m2ts mode.
7985 </p></dd>
7986 <dt> &lsquo;<samp>-muxrate <var>number</var></samp>&rsquo;</dt>
7987 <dd><p>Set muxrate.
7988 </p></dd>
7989 <dt> &lsquo;<samp>-pes_payload_size <var>number</var></samp>&rsquo;</dt>
7990 <dd><p>Set minimum PES packet payload in bytes.
7991 </p></dd>
7992 <dt> &lsquo;<samp>-mpegts_flags <var>flags</var></samp>&rsquo;</dt>
7993 <dd><p>Set flags (see below).
7994 </p></dd>
7995 <dt> &lsquo;<samp>-mpegts_copyts <var>number</var></samp>&rsquo;</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.
7998 </p></dd>
7999 <dt> &lsquo;<samp>-tables_version <var>number</var></samp>&rsquo;</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>&nbsp;</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
8006 ...
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
8010 ...
8011 </pre></td></tr></table>
8012 </dd>
8013 </dl>
8014
8015 <p>Option mpegts_flags may take a set of such flags:
8016 </p>
8017 <dl compact="compact">
8018 <dt> &lsquo;<samp>resend_headers</samp>&rsquo;</dt>
8019 <dd><p>Reemit PAT/PMT before writing the next packet.
8020 </p></dd>
8021 <dt> &lsquo;<samp>latm</samp>&rsquo;</dt>
8022 <dd><p>Use LATM packetization for AAC.
8023 </p></dd>
8024 </dl>
8025
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 &quot;FFmpeg&quot; and the default for
8029 <code>service_name</code> is &quot;Service01&quot;.
8030 </p>
8031 <table><tr><td>&nbsp;</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=&quot;Some provider&quot; \
8038      -metadata service_name=&quot;Some Channel&quot; \
8039      -y out.ts
8040 </pre></td></tr></table>
8041
8042 <a name="null-1"></a>
8043 <h2 class="section"><a href="ffplay-all.html#toc-null-1">18.14 null</a></h2>
8044
8045 <p>Null muxer.
8046 </p>
8047 <p>This muxer does not generate any output file, it is mainly useful for
8048 testing or benchmarking purposes.
8049 </p>
8050 <p>For example to benchmark decoding with <code>ffmpeg</code> you can use the
8051 command:
8052 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -benchmark -i INPUT -f null out.null
8053 </pre></td></tr></table>
8054
8055 <p>Note that the above command does not read or write the &lsquo;<tt>out.null</tt>&rsquo;
8056 file, but specifying the output file is required by the <code>ffmpeg</code>
8057 syntax.
8058 </p>
8059 <p>Alternatively you can write the command as:
8060 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -benchmark -i INPUT -f null -
8061 </pre></td></tr></table>
8062
8063 <a name="ogg"></a>
8064 <h2 class="section"><a href="ffplay-all.html#toc-ogg">18.15 ogg</a></h2>
8065
8066 <p>Ogg container muxer.
8067 </p>
8068 <dl compact="compact">
8069 <dt> &lsquo;<samp>-page_duration <var>duration</var></samp>&rsquo;</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
8076 overhead.
8077 </p></dd>
8078 </dl>
8079
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>
8082
8083 <p>Basic stream segmenter.
8084 </p>
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>.
8088 </p>
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>.
8093 </p>
8094 <p>Every segment starts with a keyframe of the selected reference stream,
8095 which is set through the &lsquo;<samp>reference_stream</samp>&rsquo; option.
8096 </p>
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
8101 time.
8102 </p>
8103 <p>The segment muxer works best with a single constant frame rate video.
8104 </p>
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
8109 files.
8110 </p>
8111 <p>The segment muxer supports the following options:
8112 </p>
8113 <dl compact="compact">
8114 <dt> &lsquo;<samp>reference_stream <var>specifier</var></samp>&rsquo;</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 &ldquo;Stream
8118 specifiers&rdquo; chapter in the ffmpeg manual) which specifies the
8119 reference stream. The default value is <code>auto</code>.
8120 </p>
8121 </dd>
8122 <dt> &lsquo;<samp>segment_format <var>format</var></samp>&rsquo;</dt>
8123 <dd><p>Override the inner container format, by default it is guessed by the filename
8124 extension.
8125 </p>
8126 </dd>
8127 <dt> &lsquo;<samp>segment_list <var>name</var></samp>&rsquo;</dt>
8128 <dd><p>Generate also a listfile named <var>name</var>. If not specified no
8129 listfile is generated.
8130 </p>
8131 </dd>
8132 <dt> &lsquo;<samp>segment_list_flags <var>flags</var></samp>&rsquo;</dt>
8133 <dd><p>Set flags affecting the segment list generation.
8134 </p>
8135 <p>It currently supports the following flags:
8136 </p><dl compact="compact">
8137 <dt> &lsquo;<samp>cache</samp>&rsquo;</dt>
8138 <dd><p>Allow caching (only affects M3U8 list files).
8139 </p>
8140 </dd>
8141 <dt> &lsquo;<samp>live</samp>&rsquo;</dt>
8142 <dd><p>Allow live-friendly file generation.
8143 </p></dd>
8144 </dl>
8145
8146 </dd>
8147 <dt> &lsquo;<samp>segment_list_size <var>size</var></samp>&rsquo;</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
8150 value is 0.
8151 </p>
8152 </dd>
8153 <dt> &lsquo;<samp>segment_list_entry_prefix <var>prefix</var></samp>&rsquo;</dt>
8154 <dd><p>Set <var>prefix</var> to prepend to the name of each entry filename. By
8155 default no prefix is applied.
8156 </p>
8157 </dd>
8158 <dt> &lsquo;<samp>segment_list_type <var>type</var></samp>&rsquo;</dt>
8159 <dd><p>Specify the format for the segment list file.
8160 </p>
8161 <p>The following values are recognized:
8162 </p><dl compact="compact">
8163 <dt> &lsquo;<samp>flat</samp>&rsquo;</dt>
8164 <dd><p>Generate a flat list for the created segments, one segment per line.
8165 </p>
8166 </dd>
8167 <dt> &lsquo;<samp>csv, ext</samp>&rsquo;</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>&nbsp;</td><td><pre class="example"><var>segment_filename</var>,<var>segment_start_time</var>,<var>segment_end_time</var>
8171 </pre></td></tr></table>
8172
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.
8176 </p>
8177 <p><var>segment_start_time</var> and <var>segment_end_time</var> specify
8178 the segment start and end time expressed in seconds.
8179 </p>
8180 <p>A list file with the suffix <code>&quot;.csv&quot;</code> or <code>&quot;.ext&quot;</code> will
8181 auto-select this format.
8182 </p>
8183 <p>&lsquo;<samp>ext</samp>&rsquo; is deprecated in favor or &lsquo;<samp>csv</samp>&rsquo;.
8184 </p>
8185 </dd>
8186 <dt> &lsquo;<samp>ffconcat</samp>&rsquo;</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.
8189 </p>
8190 <p>A list file with the suffix <code>&quot;.ffcat&quot;</code> or <code>&quot;.ffconcat&quot;</code> will
8191 auto-select this format.
8192 </p>
8193 </dd>
8194 <dt> &lsquo;<samp>m3u8</samp>&rsquo;</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>.
8197 </p>
8198 <p>A list file with the suffix <code>&quot;.m3u8&quot;</code> will auto-select this format.
8199 </p></dd>
8200 </dl>
8201
8202 <p>If not specified the type is guessed from the list file name suffix.
8203 </p>
8204 </dd>
8205 <dt> &lsquo;<samp>segment_time <var>time</var></samp>&rsquo;</dt>
8206 <dd><p>Set segment duration to <var>time</var>, the value must be a duration
8207 specification. Default value is &quot;2&quot;. See also the
8208 &lsquo;<samp>segment_times</samp>&rsquo; option.
8209 </p>
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.
8213 </p>
8214 </dd>
8215 <dt> &lsquo;<samp>segment_time_delta <var>delta</var></samp>&rsquo;</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 &quot;0&quot;.
8218 </p>
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>&nbsp;</td><td><pre class="example">PTS &gt;= start_time - time_delta
8222 </pre></td></tr></table>
8223
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.
8227 </p>
8228 <p>In particular may be used in combination with the &lsquo;<tt>ffmpeg</tt>&rsquo; 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>.
8235 </p>
8236 </dd>
8237 <dt> &lsquo;<samp>segment_times <var>times</var></samp>&rsquo;</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 &lsquo;<samp>segment_time</samp>&rsquo; option.
8241 </p>
8242 </dd>
8243 <dt> &lsquo;<samp>segment_frames <var>frames</var></samp>&rsquo;</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.
8246 </p>
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.
8250 </p>
8251 </dd>
8252 <dt> &lsquo;<samp>segment_wrap <var>limit</var></samp>&rsquo;</dt>
8253 <dd><p>Wrap around segment index once it reaches <var>limit</var>.
8254 </p>
8255 </dd>
8256 <dt> &lsquo;<samp>segment_start_number <var>number</var></samp>&rsquo;</dt>
8257 <dd><p>Set the sequence number of the first segment. Defaults to <code>0</code>.
8258 </p>
8259 </dd>
8260 <dt> &lsquo;<samp>reset_timestamps <var>1|0</var></samp>&rsquo;</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.
8265 </p>
8266 </dd>
8267 <dt> &lsquo;<samp>initial_offset <var>offset</var></samp>&rsquo;</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.
8270 </p></dd>
8271 </dl>
8272
8273 <a name="Examples-81"></a>
8274 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-81">18.16.1 Examples</a></h3>
8275
8276 <ul>
8277 <li>
8278 To remux the content of file &lsquo;<tt>in.mkv</tt>&rsquo; to a list of segments
8279 &lsquo;<tt>out-000.nut</tt>&rsquo;, &lsquo;<tt>out-001.nut</tt>&rsquo;, etc., and write the list of
8280 generated segments to &lsquo;<tt>out.list</tt>&rsquo;:
8281 <table><tr><td>&nbsp;</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>
8283
8284 </li><li>
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>&nbsp;</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>
8289
8290 </li><li>
8291 As the example above, but use the <code>ffmpeg</code> &lsquo;<samp>force_key_frames</samp>&rsquo;
8292 option to force key frames in the input at the specified location, together
8293 with the segment option &lsquo;<samp>segment_time_delta</samp>&rsquo; to account for
8294 possible roundings operated when setting key frame times.
8295 <table><tr><td>&nbsp;</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
8299 required.
8300 </p>
8301 </li><li>
8302 Segment the input file by splitting the input file according to the
8303 frame numbers sequence specified with the &lsquo;<samp>segment_frames</samp>&rsquo; option:
8304 <table><tr><td>&nbsp;</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>
8306
8307 </li><li>
8308 To convert the &lsquo;<tt>in.mkv</tt>&rsquo; to TS segments using the <code>libx264</code>
8309 and <code>libfaac</code> encoders:
8310 <table><tr><td>&nbsp;</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>
8312
8313 </li><li>
8314 Segment the input file, and create an M3U8 live playlist (can be used
8315 as live HLS source):
8316 <table><tr><td>&nbsp;</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>
8319 </li></ul>
8320
8321 <a name="tee"></a>
8322 <h2 class="section"><a href="ffplay-all.html#toc-tee">18.17 tee</a></h2>
8323
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.
8327 </p>
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.
8333 </p>
8334 <p>The slave outputs are specified in the file name given to the muxer,
8335 separated by &rsquo;|&rsquo;. If any of the slave name contains the &rsquo;|&rsquo; separator,
8336 leading or trailing spaces or any special character, it must be
8337 escaped (see the &ldquo;Quoting and escaping&rdquo; section in the ffmpeg-utils
8338 manual).
8339 </p>
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 &rsquo;:&rsquo;, between square brackets. If
8342 the options values contain a special character or the &rsquo;:&rsquo; separator, they
8343 must be escaped; note that this is a second level escaping.
8344 </p>
8345 <p>The following special options are also recognized:
8346 </p><dl compact="compact">
8347 <dt> &lsquo;<samp>f</samp>&rsquo;</dt>
8348 <dd><p>Specify the format name. Useful if it cannot be guessed from the
8349 output name suffix.
8350 </p>
8351 </dd>
8352 <dt> &lsquo;<samp>bsfs[/<var>spec</var>]</samp>&rsquo;</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.
8358 </p>
8359 <p>Several bitstream filters can be specified, separated by &quot;,&quot;.
8360 </p>
8361 </dd>
8362 <dt> &lsquo;<samp>select</samp>&rsquo;</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.
8366 </p></dd>
8367 </dl>
8368
8369 <p>Some examples follow.
8370 </p><ul>
8371 <li>
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>&nbsp;</td><td><pre class="example">ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
8375   &quot;archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/&quot;
8376 </pre></td></tr></table>
8377
8378 </li><li>
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 &lsquo;<tt>out.aac</tt>&rsquo; in order to make it contain only
8384 audio packets.
8385 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac -strict experimental
8386        -f tee &quot;[bsfs/v=dump_extra]out.ts|[movflags=+faststart]out.mp4|[select=a]out.aac&quot;
8387 </pre></td></tr></table>
8388 </li></ul>
8389
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 &lsquo;<samp>global_header</samp>&rsquo; flag.
8393 </p>
8394 <a name="Metadata"></a>
8395 <h1 class="chapter"><a href="ffplay-all.html#toc-Metadata">19. Metadata</a></h1>
8396
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.
8399 </p>
8400 <p>The file format is as follows:
8401 </p><ol>
8402 <li>
8403 A file consists of a header and a number of metadata tags divided into sections,
8404 each on its own line.
8405
8406 </li><li>
8407 The header is a &rsquo;;FFMETADATA&rsquo; string, followed by a version number (now 1).
8408
8409 </li><li>
8410 Metadata tags are of the form &rsquo;key=value&rsquo;
8411
8412 </li><li>
8413 Immediately after header follows global metadata
8414
8415 </li><li>
8416 After global metadata there may be sections with per-stream/per-chapter
8417 metadata.
8418
8419 </li><li>
8420 A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
8421 brackets (&rsquo;[&rsquo;, &rsquo;]&rsquo;) and ends with next section or end of file.
8422
8423 </li><li>
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 &rsquo;TIMEBASE=num/den&rsquo;, where num and
8426 den are integers. If the timebase is missing then start/end times are assumed to
8427 be in milliseconds.
8428 Next a chapter section must contain chapter start and end times in form
8429 &rsquo;START=num&rsquo;, &rsquo;END=num&rsquo;, where num is a positive integer.
8430
8431 </li><li>
8432 Empty lines and lines starting with &rsquo;;&rsquo; or &rsquo;#&rsquo; are ignored.
8433
8434 </li><li>
8435 Metadata keys or values containing special characters (&rsquo;=&rsquo;, &rsquo;;&rsquo;, &rsquo;#&rsquo;, &rsquo;\&rsquo; and a
8436 newline) must be escaped with a backslash &rsquo;\&rsquo;.
8437
8438 </li><li>
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 &rsquo;foo &rsquo;, value is &rsquo; bar&rsquo;).
8441 </li></ol>
8442
8443 <p>A ffmetadata file might look like this:
8444 </p><table><tr><td>&nbsp;</td><td><pre class="example">;FFMETADATA1
8445 title=bike\\shed
8446 ;this is a comment
8447 artist=FFmpeg troll team
8448
8449 [CHAPTER]
8450 TIMEBASE=1/1000
8451 START=0
8452 #chapter ends at 0:01:00
8453 END=60000
8454 title=chapter \#1
8455 [STREAM]
8456 title=multi\
8457 line
8458 </pre></td></tr></table>
8459
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.
8463 </p>
8464 <p>Extracting an ffmetadata file with &lsquo;<tt>ffmpeg</tt>&rsquo; goes as follows:
8465 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
8466 </pre></td></tr></table>
8467
8468 <p>Reinserting edited metadata information from the FFMETADATAFILE file can
8469 be done as:
8470 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
8471 </pre></td></tr></table>
8472
8473 <a name="Protocols"></a>
8474 <h1 class="chapter"><a href="ffplay-all.html#toc-Protocols">20. Protocols</a></h1>
8475
8476 <p>Protocols are configured elements in FFmpeg that enable access to
8477 resources that require specific protocols.
8478 </p>
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 &quot;&ndash;list-protocols&quot;.
8482 </p>
8483 <p>You can disable all the protocols using the configure option
8484 &quot;&ndash;disable-protocols&quot;, and selectively enable a protocol using the
8485 option &quot;&ndash;enable-protocol=<var>PROTOCOL</var>&quot;, or you can disable a
8486 particular protocol using the option
8487 &quot;&ndash;disable-protocol=<var>PROTOCOL</var>&quot;.
8488 </p>
8489 <p>The option &quot;-protocols&quot; of the ff* tools will display the list of
8490 supported protocols.
8491 </p>
8492 <p>A description of the currently available protocols follows.
8493 </p>
8494 <a name="bluray"></a>
8495 <h2 class="section"><a href="ffplay-all.html#toc-bluray">20.1 bluray</a></h2>
8496
8497 <p>Read BluRay playlist.
8498 </p>
8499 <p>The accepted options are:
8500 </p><dl compact="compact">
8501 <dt> &lsquo;<samp>angle</samp>&rsquo;</dt>
8502 <dd><p>BluRay angle
8503 </p>
8504 </dd>
8505 <dt> &lsquo;<samp>chapter</samp>&rsquo;</dt>
8506 <dd><p>Start chapter (1...N)
8507 </p>
8508 </dd>
8509 <dt> &lsquo;<samp>playlist</samp>&rsquo;</dt>
8510 <dd><p>Playlist to read (BDMV/PLAYLIST/?????.mpls)
8511 </p>
8512 </dd>
8513 </dl>
8514
8515 <p>Examples:
8516 </p>
8517 <p>Read longest playlist from BluRay mounted to /mnt/bluray:
8518 </p><table><tr><td>&nbsp;</td><td><pre class="example">bluray:/mnt/bluray
8519 </pre></td></tr></table>
8520
8521 <p>Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2:
8522 </p><table><tr><td>&nbsp;</td><td><pre class="example">-playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
8523 </pre></td></tr></table>
8524
8525 <a name="cache"></a>
8526 <h2 class="section"><a href="ffplay-all.html#toc-cache">20.2 cache</a></h2>
8527
8528 <p>Caching wrapper for input stream.
8529 </p>
8530 <p>Cache the input stream to temporary file. It brings seeking capability to live streams.
8531 </p>
8532 <table><tr><td>&nbsp;</td><td><pre class="example">cache:<var>URL</var>
8533 </pre></td></tr></table>
8534
8535 <a name="concat-1"></a>
8536 <h2 class="section"><a href="ffplay-all.html#toc-concat-1">20.3 concat</a></h2>
8537
8538 <p>Physical concatenation protocol.
8539 </p>
8540 <p>Allow to read and seek from many resource in sequence as if they were
8541 a unique resource.
8542 </p>
8543 <p>A URL accepted by this protocol has the syntax:
8544 </p><table><tr><td>&nbsp;</td><td><pre class="example">concat:<var>URL1</var>|<var>URL2</var>|...|<var>URLN</var>
8545 </pre></td></tr></table>
8546
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
8549 protocol.
8550 </p>
8551 <p>For example to read a sequence of files &lsquo;<tt>split1.mpeg</tt>&rsquo;,
8552 &lsquo;<tt>split2.mpeg</tt>&rsquo;, &lsquo;<tt>split3.mpeg</tt>&rsquo; with <code>ffplay</code> use the
8553 command:
8554 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
8555 </pre></td></tr></table>
8556
8557 <p>Note that you may need to escape the character &quot;|&quot; which is special for
8558 many shells.
8559 </p>
8560 <a name="crypto"></a>
8561 <h2 class="section"><a href="ffplay-all.html#toc-crypto">20.4 crypto</a></h2>
8562
8563 <p>AES-encrypted stream reading protocol.
8564 </p>
8565 <p>The accepted options are:
8566 </p><dl compact="compact">
8567 <dt> &lsquo;<samp>key</samp>&rsquo;</dt>
8568 <dd><p>Set the AES decryption key binary block from given hexadecimal representation.
8569 </p>
8570 </dd>
8571 <dt> &lsquo;<samp>iv</samp>&rsquo;</dt>
8572 <dd><p>Set the AES decryption initialization vector binary block from given hexadecimal representation.
8573 </p></dd>
8574 </dl>
8575
8576 <p>Accepted URL formats:
8577 </p><table><tr><td>&nbsp;</td><td><pre class="example">crypto:<var>URL</var>
8578 crypto+<var>URL</var>
8579 </pre></td></tr></table>
8580
8581 <a name="data"></a>
8582 <h2 class="section"><a href="ffplay-all.html#toc-data">20.5 data</a></h2>
8583
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>.
8585 </p>
8586 <p>For example, to convert a GIF file given inline with <code>ffmpeg</code>:
8587 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i &quot;data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=&quot; smiley.png
8588 </pre></td></tr></table>
8589
8590 <a name="file"></a>
8591 <h2 class="section"><a href="ffplay-all.html#toc-file">20.6 file</a></h2>
8592
8593 <p>File access protocol.
8594 </p>
8595 <p>Allow to read from or read to a file.
8596 </p>
8597 <p>For example to read from a file &lsquo;<tt>input.mpeg</tt>&rsquo; with <code>ffmpeg</code>
8598 use the command:
8599 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i file:input.mpeg output.mpeg
8600 </pre></td></tr></table>
8601
8602 <p>The ff* tools default to the file protocol, that is a resource
8603 specified with the name &quot;FILE.mpeg&quot; is interpreted as the URL
8604 &quot;file:FILE.mpeg&quot;.
8605 </p>
8606 <p>This protocol accepts the following options:
8607 </p>
8608 <dl compact="compact">
8609 <dt> &lsquo;<samp>truncate</samp>&rsquo;</dt>
8610 <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
8611 truncating. Default value is 1.
8612 </p>
8613 </dd>
8614 <dt> &lsquo;<samp>blocksize</samp>&rsquo;</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.
8619 </p></dd>
8620 </dl>
8621
8622 <a name="ftp"></a>
8623 <h2 class="section"><a href="ffplay-all.html#toc-ftp">20.7 ftp</a></h2>
8624
8625 <p>FTP (File Transfer Protocol).
8626 </p>
8627 <p>Allow to read from or write to remote resources using FTP protocol.
8628 </p>
8629 <p>Following syntax is required.
8630 </p><table><tr><td>&nbsp;</td><td><pre class="example">ftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
8631 </pre></td></tr></table>
8632
8633 <p>This protocol accepts the following options.
8634 </p>
8635 <dl compact="compact">
8636 <dt> &lsquo;<samp>timeout</samp>&rsquo;</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
8639 not specified.
8640 </p>
8641 </dd>
8642 <dt> &lsquo;<samp>ftp-anonymous-password</samp>&rsquo;</dt>
8643 <dd><p>Password used when login as anonymous user. Typically an e-mail address
8644 should be used.
8645 </p>
8646 </dd>
8647 <dt> &lsquo;<samp>ftp-write-seekable</samp>&rsquo;</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.
8651 </p></dd>
8652 </dl>
8653
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.
8658 </p>
8659 <a name="gopher"></a>
8660 <h2 class="section"><a href="ffplay-all.html#toc-gopher">20.8 gopher</a></h2>
8661
8662 <p>Gopher protocol.
8663 </p>
8664 <a name="hls-2"></a>
8665 <h2 class="section"><a href="ffplay-all.html#toc-hls-2">20.9 hls</a></h2>
8666
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
8670 file protocol.
8671 The nested protocol is declared by specifying
8672 &quot;+<var>proto</var>&quot; after the hls URI scheme name, where <var>proto</var>
8673 is either &quot;file&quot; or &quot;http&quot;.
8674 </p>
8675 <table><tr><td>&nbsp;</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>
8678
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
8682 m3u8 files.
8683 </p>
8684 <a name="http"></a>
8685 <h2 class="section"><a href="ffplay-all.html#toc-http">20.10 http</a></h2>
8686
8687 <p>HTTP (Hyper Text Transfer Protocol).
8688 </p>
8689 <p>This protocol accepts the following options.
8690 </p>
8691 <dl compact="compact">
8692 <dt> &lsquo;<samp>seekable</samp>&rsquo;</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
8696 value is -1.
8697 </p>
8698 </dd>
8699 <dt> &lsquo;<samp>chunked_post</samp>&rsquo;</dt>
8700 <dd><p>If set to 1 use chunked transfer-encoding for posts, default is 1.
8701 </p>
8702 </dd>
8703 <dt> &lsquo;<samp>headers</samp>&rsquo;</dt>
8704 <dd><p>Set custom HTTP headers, can override built in default headers. The
8705 value must be a string encoding the headers.
8706 </p>
8707 </dd>
8708 <dt> &lsquo;<samp>content_type</samp>&rsquo;</dt>
8709 <dd><p>Force a content type.
8710 </p>
8711 </dd>
8712 <dt> &lsquo;<samp>user-agent</samp>&rsquo;</dt>
8713 <dd><p>Override User-Agent header. If not specified the protocol will use a
8714 string describing the libavformat build.
8715 </p>
8716 </dd>
8717 <dt> &lsquo;<samp>multiple_requests</samp>&rsquo;</dt>
8718 <dd><p>Use persistent connections if set to 1. By default it is 0.
8719 </p>
8720 </dd>
8721 <dt> &lsquo;<samp>post_data</samp>&rsquo;</dt>
8722 <dd><p>Set custom HTTP post data.
8723 </p>
8724 </dd>
8725 <dt> &lsquo;<samp>timeout</samp>&rsquo;</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
8728 not specified.
8729 </p>
8730 </dd>
8731 <dt> &lsquo;<samp>mime_type</samp>&rsquo;</dt>
8732 <dd><p>Set MIME type.
8733 </p>
8734 </dd>
8735 <dt> &lsquo;<samp>icy</samp>&rsquo;</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 &lsquo;<samp>icy_metadata_headers</samp>&rsquo; and &lsquo;<samp>icy_metadata_packet</samp>&rsquo; options.
8739 The default is 0.
8740 </p>
8741 </dd>
8742 <dt> &lsquo;<samp>icy_metadata_headers</samp>&rsquo;</dt>
8743 <dd><p>If the server supports ICY metadata, this contains the ICY specific HTTP reply
8744 headers, separated with newline characters.
8745 </p>
8746 </dd>
8747 <dt> &lsquo;<samp>icy_metadata_packet</samp>&rsquo;</dt>
8748 <dd><p>If the server supports ICY metadata, and &lsquo;<samp>icy</samp>&rsquo; was set to 1, this
8749 contains the last non-empty metadata packet sent by the server.
8750 </p>
8751 </dd>
8752 <dt> &lsquo;<samp>cookies</samp>&rsquo;</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.
8756 </p></dd>
8757 </dl>
8758
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>
8761
8762 <p>Some HTTP requests will be denied unless cookie values are passed in with the
8763 request. The &lsquo;<samp>cookies</samp>&rsquo; 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
8767 by a newline.
8768 </p>
8769 <p>The required syntax to play a stream specifying a cookie is:
8770 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay -cookies &quot;nlqptid=nltid=tsn; path=/; domain=somedomain.com;&quot; http://somedomain.com/somestream.m3u8
8771 </pre></td></tr></table>
8772
8773 <a name="mmst"></a>
8774 <h2 class="section"><a href="ffplay-all.html#toc-mmst">20.11 mmst</a></h2>
8775
8776 <p>MMS (Microsoft Media Server) protocol over TCP.
8777 </p>
8778 <a name="mmsh"></a>
8779 <h2 class="section"><a href="ffplay-all.html#toc-mmsh">20.12 mmsh</a></h2>
8780
8781 <p>MMS (Microsoft Media Server) protocol over HTTP.
8782 </p>
8783 <p>The required syntax is:
8784 </p><table><tr><td>&nbsp;</td><td><pre class="example">mmsh://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
8785 </pre></td></tr></table>
8786
8787 <a name="md5-2"></a>
8788 <h2 class="section"><a href="ffplay-all.html#toc-md5-2">20.13 md5</a></h2>
8789
8790 <p>MD5 output protocol.
8791 </p>
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.
8795 </p>
8796 <p>Some examples follow.
8797 </p><table><tr><td>&nbsp;</td><td><pre class="example"># Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
8798 ffmpeg -i input.flv -f avi -y md5:output.avi.md5
8799
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>
8803
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.
8806 </p>
8807 <a name="pipe"></a>
8808 <h2 class="section"><a href="ffplay-all.html#toc-pipe">20.14 pipe</a></h2>
8809
8810 <p>UNIX pipe access protocol.
8811 </p>
8812 <p>Allow to read and write from UNIX pipes.
8813 </p>
8814 <p>The accepted syntax is:
8815 </p><table><tr><td>&nbsp;</td><td><pre class="example">pipe:[<var>number</var>]
8816 </pre></td></tr></table>
8817
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.
8822 </p>
8823 <p>For example to read from stdin with <code>ffmpeg</code>:
8824 </p><table><tr><td>&nbsp;</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>
8828
8829 <p>For writing to stdout with <code>ffmpeg</code>:
8830 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i test.wav -f avi pipe:1 | cat &gt; test.avi
8831 # ...this is the same as...
8832 ffmpeg -i test.wav -f avi pipe: | cat &gt; test.avi
8833 </pre></td></tr></table>
8834
8835 <p>This protocol accepts the following options:
8836 </p>
8837 <dl compact="compact">
8838 <dt> &lsquo;<samp>blocksize</samp>&rsquo;</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.
8843 </p></dd>
8844 </dl>
8845
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.
8848 </p>
8849 <a name="rtmp"></a>
8850 <h2 class="section"><a href="ffplay-all.html#toc-rtmp">20.15 rtmp</a></h2>
8851
8852 <p>Real-Time Messaging Protocol.
8853 </p>
8854 <p>The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
8855 content across a TCP/IP network.
8856 </p>
8857 <p>The required syntax is:
8858 </p><table><tr><td>&nbsp;</td><td><pre class="example">rtmp://[<var>username</var>:<var>password</var>@]<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>instance</var>][/<var>playpath</var>]
8859 </pre></td></tr></table>
8860
8861 <p>The accepted parameters are:
8862 </p><dl compact="compact">
8863 <dt> &lsquo;<samp>username</samp>&rsquo;</dt>
8864 <dd><p>An optional username (mostly for publishing).
8865 </p>
8866 </dd>
8867 <dt> &lsquo;<samp>password</samp>&rsquo;</dt>
8868 <dd><p>An optional password (mostly for publishing).
8869 </p>
8870 </dd>
8871 <dt> &lsquo;<samp>server</samp>&rsquo;</dt>
8872 <dd><p>The address of the RTMP server.
8873 </p>
8874 </dd>
8875 <dt> &lsquo;<samp>port</samp>&rsquo;</dt>
8876 <dd><p>The number of the TCP port to use (by default is 1935).
8877 </p>
8878 </dd>
8879 <dt> &lsquo;<samp>app</samp>&rsquo;</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. &lsquo;<tt>/ondemand/</tt>&rsquo;, &lsquo;<tt>/flash/live/</tt>&rsquo;, etc.). You can override
8883 the value parsed from the URI through the <code>rtmp_app</code> option, too.
8884 </p>
8885 </dd>
8886 <dt> &lsquo;<samp>playpath</samp>&rsquo;</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 &quot;mp4:&quot;. You
8889 can override the value parsed from the URI through the <code>rtmp_playpath</code>
8890 option, too.
8891 </p>
8892 </dd>
8893 <dt> &lsquo;<samp>listen</samp>&rsquo;</dt>
8894 <dd><p>Act as a server, listening for an incoming connection.
8895 </p>
8896 </dd>
8897 <dt> &lsquo;<samp>timeout</samp>&rsquo;</dt>
8898 <dd><p>Maximum time to wait for the incoming connection. Implies listen.
8899 </p></dd>
8900 </dl>
8901
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> &lsquo;<samp>rtmp_app</samp>&rsquo;</dt>
8906 <dd><p>Name of application to connect on the RTMP server. This option
8907 overrides the parameter specified in the URI.
8908 </p>
8909 </dd>
8910 <dt> &lsquo;<samp>rtmp_buffer</samp>&rsquo;</dt>
8911 <dd><p>Set the client buffer time in milliseconds. The default is 3000.
8912 </p>
8913 </dd>
8914 <dt> &lsquo;<samp>rtmp_conn</samp>&rsquo;</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 &rsquo;N&rsquo; 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.
8925 </p>
8926 </dd>
8927 <dt> &lsquo;<samp>rtmp_flashver</samp>&rsquo;</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 &lt;libavformat version&gt;).)
8931 </p>
8932 </dd>
8933 <dt> &lsquo;<samp>rtmp_flush_interval</samp>&rsquo;</dt>
8934 <dd><p>Number of packets flushed in the same request (RTMPT only). The default
8935 is 10.
8936 </p>
8937 </dd>
8938 <dt> &lsquo;<samp>rtmp_live</samp>&rsquo;</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>.
8945 </p>
8946 </dd>
8947 <dt> &lsquo;<samp>rtmp_pageurl</samp>&rsquo;</dt>
8948 <dd><p>URL of the web page in which the media was embedded. By default no
8949 value will be sent.
8950 </p>
8951 </dd>
8952 <dt> &lsquo;<samp>rtmp_playpath</samp>&rsquo;</dt>
8953 <dd><p>Stream identifier to play or to publish. This option overrides the
8954 parameter specified in the URI.
8955 </p>
8956 </dd>
8957 <dt> &lsquo;<samp>rtmp_subscribe</samp>&rsquo;</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
8960 is set to live.
8961 </p>
8962 </dd>
8963 <dt> &lsquo;<samp>rtmp_swfhash</samp>&rsquo;</dt>
8964 <dd><p>SHA256 hash of the decompressed SWF file (32 bytes).
8965 </p>
8966 </dd>
8967 <dt> &lsquo;<samp>rtmp_swfsize</samp>&rsquo;</dt>
8968 <dd><p>Size of the decompressed SWF file, required for SWFVerification.
8969 </p>
8970 </dd>
8971 <dt> &lsquo;<samp>rtmp_swfurl</samp>&rsquo;</dt>
8972 <dd><p>URL of the SWF player for the media. By default no value will be sent.
8973 </p>
8974 </dd>
8975 <dt> &lsquo;<samp>rtmp_swfverify</samp>&rsquo;</dt>
8976 <dd><p>URL to player swf file, compute hash/size automatically.
8977 </p>
8978 </dd>
8979 <dt> &lsquo;<samp>rtmp_tcurl</samp>&rsquo;</dt>
8980 <dd><p>URL of the target stream. Defaults to proto://host[:port]/app.
8981 </p>
8982 </dd>
8983 </dl>
8984
8985 <p>For example to read with <code>ffplay</code> a multimedia resource named
8986 &quot;sample&quot; from the application &quot;vod&quot; from an RTMP server &quot;myserver&quot;:
8987 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay rtmp://myserver/vod/sample
8988 </pre></td></tr></table>
8989
8990 <p>To publish to a password protected server, passing the playpath and
8991 app names separately:
8992 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i &lt;input&gt; -f flv -rtmp_playpath some/long/path -rtmp_app long/app/name rtmp://username:password@myserver/
8993 </pre></td></tr></table>
8994
8995 <a name="rtmpe"></a>
8996 <h2 class="section"><a href="ffplay-all.html#toc-rtmpe">20.16 rtmpe</a></h2>
8997
8998 <p>Encrypted Real-Time Messaging Protocol.
8999 </p>
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
9003 a pair of RC4 keys.
9004 </p>
9005 <a name="rtmps"></a>
9006 <h2 class="section"><a href="ffplay-all.html#toc-rtmps">20.17 rtmps</a></h2>
9007
9008 <p>Real-Time Messaging Protocol over a secure SSL connection.
9009 </p>
9010 <p>The Real-Time Messaging Protocol (RTMPS) is used for streaming
9011 multimedia content across an encrypted connection.
9012 </p>
9013 <a name="rtmpt"></a>
9014 <h2 class="section"><a href="ffplay-all.html#toc-rtmpt">20.18 rtmpt</a></h2>
9015
9016 <p>Real-Time Messaging Protocol tunneled through HTTP.
9017 </p>
9018 <p>The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used
9019 for streaming multimedia content within HTTP requests to traverse
9020 firewalls.
9021 </p>
9022 <a name="rtmpte"></a>
9023 <h2 class="section"><a href="ffplay-all.html#toc-rtmpte">20.19 rtmpte</a></h2>
9024
9025 <p>Encrypted Real-Time Messaging Protocol tunneled through HTTP.
9026 </p>
9027 <p>The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE)
9028 is used for streaming multimedia content within HTTP requests to traverse
9029 firewalls.
9030 </p>
9031 <a name="rtmpts"></a>
9032 <h2 class="section"><a href="ffplay-all.html#toc-rtmpts">20.20 rtmpts</a></h2>
9033
9034 <p>Real-Time Messaging Protocol tunneled through HTTPS.
9035 </p>
9036 <p>The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used
9037 for streaming multimedia content within HTTPS requests to traverse
9038 firewalls.
9039 </p>
9040 <a name="libssh"></a>
9041 <h2 class="section"><a href="ffplay-all.html#toc-libssh">20.21 libssh</a></h2>
9042
9043 <p>Secure File Transfer Protocol via libssh
9044 </p>
9045 <p>Allow to read from or write to remote resources using SFTP protocol.
9046 </p>
9047 <p>Following syntax is required.
9048 </p>
9049 <table><tr><td>&nbsp;</td><td><pre class="example">sftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
9050 </pre></td></tr></table>
9051
9052 <p>This protocol accepts the following options.
9053 </p>
9054 <dl compact="compact">
9055 <dt> &lsquo;<samp>timeout</samp>&rsquo;</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
9058 is not specified.
9059 </p>
9060 </dd>
9061 <dt> &lsquo;<samp>truncate</samp>&rsquo;</dt>
9062 <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
9063 truncating. Default value is 1.
9064 </p>
9065 </dd>
9066 </dl>
9067
9068 <p>Example: Play a file stored on remote server.
9069 </p>
9070 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay sftp://user:password@server_address:22/home/user/resource.mpeg
9071 </pre></td></tr></table>
9072
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>
9075
9076 <p>Real-Time Messaging Protocol and its variants supported through
9077 librtmp.
9078 </p>
9079 <p>Requires the presence of the librtmp headers and library during
9080 configuration. You need to explicitly configure the build with
9081 &quot;&ndash;enable-librtmp&quot;. If enabled this will replace the native RTMP
9082 protocol.
9083 </p>
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).
9088 </p>
9089 <p>The required syntax is:
9090 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>rtmp_proto</var>://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>] <var>options</var>
9091 </pre></td></tr></table>
9092
9093 <p>where <var>rtmp_proto</var> is one of the strings &quot;rtmp&quot;, &quot;rtmpt&quot;, &quot;rtmpe&quot;,
9094 &quot;rtmps&quot;, &quot;rtmpte&quot;, &quot;rtmpts&quot; 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>.
9099 </p>
9100 <p>See the librtmp manual page (man 3 librtmp) for more information.
9101 </p>
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>&nbsp;</td><td><pre class="example">ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
9105 </pre></td></tr></table>
9106
9107 <p>To play the same stream using <code>ffplay</code>:
9108 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay &quot;rtmp://myserver/live/mystream live=1&quot;
9109 </pre></td></tr></table>
9110
9111 <a name="rtp"></a>
9112 <h2 class="section"><a href="ffplay-all.html#toc-rtp">20.23 rtp</a></h2>
9113
9114 <p>Real-time Transport Protocol.
9115 </p>
9116 <p>The required syntax for an RTP URL is:
9117 rtp://<var>hostname</var>[:<var>port</var>][?<var>option</var>=<var>val</var>...]
9118 </p>
9119 <p><var>port</var> specifies the RTP port to use.
9120 </p>
9121 <p>The following URL options are supported:
9122 </p>
9123 <dl compact="compact">
9124 <dt> &lsquo;<samp>ttl=<var>n</var></samp>&rsquo;</dt>
9125 <dd><p>Set the TTL (Time-To-Live) value (for multicast only).
9126 </p>
9127 </dd>
9128 <dt> &lsquo;<samp>rtcpport=<var>n</var></samp>&rsquo;</dt>
9129 <dd><p>Set the remote RTCP port to <var>n</var>.
9130 </p>
9131 </dd>
9132 <dt> &lsquo;<samp>localrtpport=<var>n</var></samp>&rsquo;</dt>
9133 <dd><p>Set the local RTP port to <var>n</var>.
9134 </p>
9135 </dd>
9136 <dt> &lsquo;<samp>localrtcpport=<var>n</var>'</samp>&rsquo;</dt>
9137 <dd><p>Set the local RTCP port to <var>n</var>.
9138 </p>
9139 </dd>
9140 <dt> &lsquo;<samp>pkt_size=<var>n</var></samp>&rsquo;</dt>
9141 <dd><p>Set max packet size (in bytes) to <var>n</var>.
9142 </p>
9143 </dd>
9144 <dt> &lsquo;<samp>connect=0|1</samp>&rsquo;</dt>
9145 <dd><p>Do a <code>connect()</code> on the UDP socket (if set to 1) or not (if set
9146 to 0).
9147 </p>
9148 </dd>
9149 <dt> &lsquo;<samp>sources=<var>ip</var>[,<var>ip</var>]</samp>&rsquo;</dt>
9150 <dd><p>List allowed source IP addresses.
9151 </p>
9152 </dd>
9153 <dt> &lsquo;<samp>block=<var>ip</var>[,<var>ip</var>]</samp>&rsquo;</dt>
9154 <dd><p>List disallowed (blocked) source IP addresses.
9155 </p>
9156 </dd>
9157 <dt> &lsquo;<samp>write_to_source=0|1</samp>&rsquo;</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).
9160 </p>
9161 </dd>
9162 <dt> &lsquo;<samp>localport=<var>n</var></samp>&rsquo;</dt>
9163 <dd><p>Set the local RTP port to <var>n</var>.
9164 </p>
9165 <p>This is a deprecated option. Instead, &lsquo;<samp>localrtpport</samp>&rsquo; should be
9166 used.
9167 </p>
9168 </dd>
9169 </dl>
9170
9171 <p>Important notes:
9172 </p>
9173 <ol>
9174 <li>
9175 If &lsquo;<samp>rtcpport</samp>&rsquo; is not set the RTCP port will be set to the RTP
9176 port value plus 1.
9177
9178 </li><li>
9179 If &lsquo;<samp>localrtpport</samp>&rsquo; (the local RTP port) is not set any available
9180 port will be used for the local RTP and RTCP ports.
9181
9182 </li><li>
9183 If &lsquo;<samp>localrtcpport</samp>&rsquo; (the local RTCP port) is not set it will be
9184 set to the the local RTP port value plus 1.
9185 </li></ol>
9186
9187 <a name="rtsp"></a>
9188 <h2 class="section"><a href="ffplay-all.html#toc-rtsp">20.24 rtsp</a></h2>
9189
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).
9194 </p>
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&rsquo;s
9197 <a href="http://github.com/revmischa/rtsp-server">RTSP server</a>).
9198 </p>
9199 <p>The required syntax for a RTSP url is:
9200 </p><table><tr><td>&nbsp;</td><td><pre class="example">rtsp://<var>hostname</var>[:<var>port</var>]/<var>path</var>
9201 </pre></td></tr></table>
9202
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>),
9205 are supported:
9206 </p>
9207 <p>Flags for <code>rtsp_transport</code>:
9208 </p>
9209 <dl compact="compact">
9210 <dt> &lsquo;<samp>udp</samp>&rsquo;</dt>
9211 <dd><p>Use UDP as lower transport protocol.
9212 </p>
9213 </dd>
9214 <dt> &lsquo;<samp>tcp</samp>&rsquo;</dt>
9215 <dd><p>Use TCP (interleaving within the RTSP control channel) as lower
9216 transport protocol.
9217 </p>
9218 </dd>
9219 <dt> &lsquo;<samp>udp_multicast</samp>&rsquo;</dt>
9220 <dd><p>Use UDP multicast as lower transport protocol.
9221 </p>
9222 </dd>
9223 <dt> &lsquo;<samp>http</samp>&rsquo;</dt>
9224 <dd><p>Use HTTP tunneling as lower transport protocol, which is useful for
9225 passing proxies.
9226 </p></dd>
9227 </dl>
9228
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.
9232 </p>
9233 <p>Flags for <code>rtsp_flags</code>:
9234 </p>
9235 <dl compact="compact">
9236 <dt> &lsquo;<samp>filter_src</samp>&rsquo;</dt>
9237 <dd><p>Accept packets only from negotiated peer address and port.
9238 </p></dd>
9239 <dt> &lsquo;<samp>listen</samp>&rsquo;</dt>
9240 <dd><p>Act as a server, listening for an incoming connection.
9241 </p></dd>
9242 </dl>
9243
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).
9248 </p>
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>.
9253 </p>
9254 <p>Example command lines:
9255 </p>
9256 <p>To watch a stream over UDP, with a max reordering delay of 0.5 seconds:
9257 </p>
9258 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
9259 </pre></td></tr></table>
9260
9261 <p>To watch a stream tunneled over HTTP:
9262 </p>
9263 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -rtsp_transport http rtsp://server/video.mp4
9264 </pre></td></tr></table>
9265
9266 <p>To send a stream in realtime to a RTSP server, for others to watch:
9267 </p>
9268 <table><tr><td>&nbsp;</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>
9270
9271 <p>To receive a stream in realtime:
9272 </p>
9273 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp <var>output</var>
9274 </pre></td></tr></table>
9275
9276 <dl compact="compact">
9277 <dt> &lsquo;<samp>stimeout</samp>&rsquo;</dt>
9278 <dd><p>Socket IO timeout in micro seconds.
9279 </p></dd>
9280 </dl>
9281
9282 <a name="sap"></a>
9283 <h2 class="section"><a href="ffplay-all.html#toc-sap">20.25 sap</a></h2>
9284
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.
9289 </p>
9290 <a name="Muxer"></a>
9291 <h3 class="subsection"><a href="ffplay-all.html#toc-Muxer">20.25.1 Muxer</a></h3>
9292
9293 <p>The syntax for a SAP url given to the muxer is:
9294 </p><table><tr><td>&nbsp;</td><td><pre class="example">sap://<var>destination</var>[:<var>port</var>][?<var>options</var>]
9295 </pre></td></tr></table>
9296
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>&amp;</code>-separated list. The following options
9300 are supported:
9301 </p>
9302 <dl compact="compact">
9303 <dt> &lsquo;<samp>announce_addr=<var>address</var></samp>&rsquo;</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.
9308 </p>
9309 </dd>
9310 <dt> &lsquo;<samp>announce_port=<var>port</var></samp>&rsquo;</dt>
9311 <dd><p>Specify the port to send the announcements on, defaults to
9312 9875 if not specified.
9313 </p>
9314 </dd>
9315 <dt> &lsquo;<samp>ttl=<var>ttl</var></samp>&rsquo;</dt>
9316 <dd><p>Specify the time to live value for the announcements and RTP packets,
9317 defaults to 255.
9318 </p>
9319 </dd>
9320 <dt> &lsquo;<samp>same_port=<var>0|1</var></samp>&rsquo;</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
9326 on unique ports.
9327 </p></dd>
9328 </dl>
9329
9330 <p>Example command lines follow.
9331 </p>
9332 <p>To broadcast a stream on the local subnet, for watching in VLC:
9333 </p>
9334 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255?same_port=1
9335 </pre></td></tr></table>
9336
9337 <p>Similarly, for watching in <code>ffplay</code>:
9338 </p>
9339 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255
9340 </pre></td></tr></table>
9341
9342 <p>And for watching in <code>ffplay</code>, over IPv6:
9343 </p>
9344 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://[ff0e::1:2:3:4]
9345 </pre></td></tr></table>
9346
9347 <a name="Demuxer"></a>
9348 <h3 class="subsection"><a href="ffplay-all.html#toc-Demuxer">20.25.2 Demuxer</a></h3>
9349
9350 <p>The syntax for a SAP url given to the demuxer is:
9351 </p><table><tr><td>&nbsp;</td><td><pre class="example">sap://[<var>address</var>][:<var>port</var>]
9352 </pre></td></tr></table>
9353
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.
9357 </p>
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.
9360 </p>
9361 <p>Example command lines follow.
9362 </p>
9363 <p>To play back the first stream announced on the normal SAP multicast address:
9364 </p>
9365 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay sap://
9366 </pre></td></tr></table>
9367
9368 <p>To play back the first stream announced on one the default IPv6 SAP multicast address:
9369 </p>
9370 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay sap://[ff0e::2:7ffe]
9371 </pre></td></tr></table>
9372
9373 <a name="sctp"></a>
9374 <h2 class="section"><a href="ffplay-all.html#toc-sctp">20.26 sctp</a></h2>
9375
9376 <p>Stream Control Transmission Protocol.
9377 </p>
9378 <p>The accepted URL syntax is:
9379 </p><table><tr><td>&nbsp;</td><td><pre class="example">sctp://<var>host</var>:<var>port</var>[?<var>options</var>]
9380 </pre></td></tr></table>
9381
9382 <p>The protocol accepts the following options:
9383 </p><dl compact="compact">
9384 <dt> &lsquo;<samp>listen</samp>&rsquo;</dt>
9385 <dd><p>If set to any value, listen for an incoming connection. Outgoing connection is done by default.
9386 </p>
9387 </dd>
9388 <dt> &lsquo;<samp>max_streams</samp>&rsquo;</dt>
9389 <dd><p>Set the maximum number of streams. By default no limit is set.
9390 </p></dd>
9391 </dl>
9392
9393 <a name="srtp"></a>
9394 <h2 class="section"><a href="ffplay-all.html#toc-srtp">20.27 srtp</a></h2>
9395
9396 <p>Secure Real-time Transport Protocol.
9397 </p>
9398 <p>The accepted options are:
9399 </p><dl compact="compact">
9400 <dt> &lsquo;<samp>srtp_in_suite</samp>&rsquo;</dt>
9401 <dt> &lsquo;<samp>srtp_out_suite</samp>&rsquo;</dt>
9402 <dd><p>Select input and output encoding suites.
9403 </p>
9404 <p>Supported values:
9405 </p><dl compact="compact">
9406 <dt> &lsquo;<samp>AES_CM_128_HMAC_SHA1_80</samp>&rsquo;</dt>
9407 <dt> &lsquo;<samp>SRTP_AES128_CM_HMAC_SHA1_80</samp>&rsquo;</dt>
9408 <dt> &lsquo;<samp>AES_CM_128_HMAC_SHA1_32</samp>&rsquo;</dt>
9409 <dt> &lsquo;<samp>SRTP_AES128_CM_HMAC_SHA1_32</samp>&rsquo;</dt>
9410 </dl>
9411
9412 </dd>
9413 <dt> &lsquo;<samp>srtp_in_params</samp>&rsquo;</dt>
9414 <dt> &lsquo;<samp>srtp_out_params</samp>&rsquo;</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.
9419 </p></dd>
9420 </dl>
9421
9422 <a name="tcp"></a>
9423 <h2 class="section"><a href="ffplay-all.html#toc-tcp">20.28 tcp</a></h2>
9424
9425 <p>Trasmission Control Protocol.
9426 </p>
9427 <p>The required syntax for a TCP url is:
9428 </p><table><tr><td>&nbsp;</td><td><pre class="example">tcp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
9429 </pre></td></tr></table>
9430
9431 <dl compact="compact">
9432 <dt> &lsquo;<samp>listen</samp>&rsquo;</dt>
9433 <dd><p>Listen for an incoming connection
9434 </p>
9435 </dd>
9436 <dt> &lsquo;<samp>timeout=<var>microseconds</var></samp>&rsquo;</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.
9440 </p>
9441 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> tcp://<var>hostname</var>:<var>port</var>?listen
9442 ffplay tcp://<var>hostname</var>:<var>port</var>
9443 </pre></td></tr></table>
9444
9445 </dd>
9446 </dl>
9447
9448 <a name="tls"></a>
9449 <h2 class="section"><a href="ffplay-all.html#toc-tls">20.29 tls</a></h2>
9450
9451 <p>Transport Layer Security (TLS) / Secure Sockets Layer (SSL)
9452 </p>
9453 <p>The required syntax for a TLS/SSL url is:
9454 </p><table><tr><td>&nbsp;</td><td><pre class="example">tls://<var>hostname</var>:<var>port</var>[?<var>options</var>]
9455 </pre></td></tr></table>
9456
9457 <p>The following parameters can be set via command line options
9458 (or in code via <code>AVOption</code>s):
9459 </p>
9460 <dl compact="compact">
9461 <dt> &lsquo;<samp>ca_file, cafile=<var>filename</var></samp>&rsquo;</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.
9467 </p>
9468 </dd>
9469 <dt> &lsquo;<samp>tls_verify=<var>1|0</var></samp>&rsquo;</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.)
9476 </p>
9477 <p>This is disabled by default since it requires a CA database to be
9478 provided by the caller in many cases.
9479 </p>
9480 </dd>
9481 <dt> &lsquo;<samp>cert_file, cert=<var>filename</var></samp>&rsquo;</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
9485 setups.)
9486 </p>
9487 </dd>
9488 <dt> &lsquo;<samp>key_file, key=<var>filename</var></samp>&rsquo;</dt>
9489 <dd><p>A file containing the private key for the certificate.
9490 </p>
9491 </dd>
9492 <dt> &lsquo;<samp>listen=<var>1|0</var></samp>&rsquo;</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.
9495 </p>
9496 </dd>
9497 </dl>
9498
9499 <p>Example command lines:
9500 </p>
9501 <p>To create a TLS/SSL server that serves an input stream.
9502 </p>
9503 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> tls://<var>hostname</var>:<var>port</var>?listen&amp;cert=<var>server.crt</var>&amp;key=<var>server.key</var>
9504 </pre></td></tr></table>
9505
9506 <p>To play back a stream from the TLS/SSL server using <code>ffplay</code>:
9507 </p>
9508 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay tls://<var>hostname</var>:<var>port</var>
9509 </pre></td></tr></table>
9510
9511 <a name="udp"></a>
9512 <h2 class="section"><a href="ffplay-all.html#toc-udp">20.30 udp</a></h2>
9513
9514 <p>User Datagram Protocol.
9515 </p>
9516 <p>The required syntax for a UDP url is:
9517 </p><table><tr><td>&nbsp;</td><td><pre class="example">udp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
9518 </pre></td></tr></table>
9519
9520 <p><var>options</var> contains a list of &amp;-separated options of the form <var>key</var>=<var>val</var>.
9521 </p>
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.
9526 </p>
9527 <p>The list of supported options follows.
9528 </p>
9529 <dl compact="compact">
9530 <dt> &lsquo;<samp>buffer_size=<var>size</var></samp>&rsquo;</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.
9533 </p>
9534 </dd>
9535 <dt> &lsquo;<samp>localport=<var>port</var></samp>&rsquo;</dt>
9536 <dd><p>Override the local UDP port to bind with.
9537 </p>
9538 </dd>
9539 <dt> &lsquo;<samp>localaddr=<var>addr</var></samp>&rsquo;</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.
9543 </p>
9544 </dd>
9545 <dt> &lsquo;<samp>pkt_size=<var>size</var></samp>&rsquo;</dt>
9546 <dd><p>Set the size in bytes of UDP packets.
9547 </p>
9548 </dd>
9549 <dt> &lsquo;<samp>reuse=<var>1|0</var></samp>&rsquo;</dt>
9550 <dd><p>Explicitly allow or disallow reusing UDP sockets.
9551 </p>
9552 </dd>
9553 <dt> &lsquo;<samp>ttl=<var>ttl</var></samp>&rsquo;</dt>
9554 <dd><p>Set the time to live value (for multicast only).
9555 </p>
9556 </dd>
9557 <dt> &lsquo;<samp>connect=<var>1|0</var></samp>&rsquo;</dt>
9558 <dd><p>Initialize the UDP socket with <code>connect()</code>. In this case, the
9559 destination address can&rsquo;t be changed with ff_udp_set_remote_url later.
9560 If the destination address isn&rsquo;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 &quot;destination
9564 unreachable&quot; is received.
9565 For receiving, this gives the benefit of only receiving packets from
9566 the specified peer address/port.
9567 </p>
9568 </dd>
9569 <dt> &lsquo;<samp>sources=<var>address</var>[,<var>address</var>]</samp>&rsquo;</dt>
9570 <dd><p>Only receive packets sent to the multicast group from one of the
9571 specified sender IP addresses.
9572 </p>
9573 </dd>
9574 <dt> &lsquo;<samp>block=<var>address</var>[,<var>address</var>]</samp>&rsquo;</dt>
9575 <dd><p>Ignore packets sent to the multicast group from the specified
9576 sender IP addresses.
9577 </p>
9578 </dd>
9579 <dt> &lsquo;<samp>fifo_size=<var>units</var></samp>&rsquo;</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.
9582 </p>
9583 </dd>
9584 <dt> &lsquo;<samp>overrun_nonfatal=<var>1|0</var></samp>&rsquo;</dt>
9585 <dd><p>Survive in case of UDP receiving circular buffer overrun. Default
9586 value is 0.
9587 </p>
9588 </dd>
9589 <dt> &lsquo;<samp>timeout=<var>microseconds</var></samp>&rsquo;</dt>
9590 <dd><p>In read mode: if no data arrived in more than this time interval, raise error.
9591 </p></dd>
9592 </dl>
9593
9594 <p>Some usage examples of the UDP protocol with <code>ffmpeg</code> follow.
9595 </p>
9596 <p>To stream over UDP to a remote endpoint:
9597 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> udp://<var>hostname</var>:<var>port</var>
9598 </pre></td></tr></table>
9599
9600 <p>To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer:
9601 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i <var>input</var> -f mpegts udp://<var>hostname</var>:<var>port</var>?pkt_size=188&amp;buffer_size=65535
9602 </pre></td></tr></table>
9603
9604 <p>To receive over UDP from a remote endpoint:
9605 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i udp://[<var>multicast-address</var>]:<var>port</var>
9606 </pre></td></tr></table>
9607
9608 <a name="unix"></a>
9609 <h2 class="section"><a href="ffplay-all.html#toc-unix">20.31 unix</a></h2>
9610
9611 <p>Unix local socket
9612 </p>
9613 <p>The required syntax for a Unix socket URL is:
9614 </p>
9615 <table><tr><td>&nbsp;</td><td><pre class="example">unix://<var>filepath</var>
9616 </pre></td></tr></table>
9617
9618 <p>The following parameters can be set via command line options
9619 (or in code via <code>AVOption</code>s):
9620 </p>
9621 <dl compact="compact">
9622 <dt> &lsquo;<samp>timeout</samp>&rsquo;</dt>
9623 <dd><p>Timeout in ms.
9624 </p></dd>
9625 <dt> &lsquo;<samp>listen</samp>&rsquo;</dt>
9626 <dd><p>Create the Unix socket in listening mode.
9627 </p></dd>
9628 </dl>
9629
9630 <a name="Device-Options"></a>
9631 <h1 class="chapter"><a href="ffplay-all.html#toc-Device-Options">21. Device Options</a></h1>
9632
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
9637 manual).
9638 </p>
9639 <p>In addition each input or output device may support so-called private
9640 options, which are specific for that component.
9641 </p>
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 &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API
9645 for programmatic use.
9646 </p>
9647
9648 <a name="Input-Devices"></a>
9649 <h1 class="chapter"><a href="ffplay-all.html#toc-Input-Devices">22. Input Devices</a></h1>
9650
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.
9653 </p>
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 &quot;&ndash;list-indevs&quot;.
9657 </p>
9658 <p>You can disable all the input devices using the configure option
9659 &quot;&ndash;disable-indevs&quot;, and selectively enable an input device using the
9660 option &quot;&ndash;enable-indev=<var>INDEV</var>&quot;, or you can disable a particular
9661 input device using the option &quot;&ndash;disable-indev=<var>INDEV</var>&quot;.
9662 </p>
9663 <p>The option &quot;-formats&quot; of the ff* tools will display the list of
9664 supported input devices (amongst the demuxers).
9665 </p>
9666 <p>A description of the currently available input devices follows.
9667 </p>
9668 <a name="alsa-1"></a>
9669 <h2 class="section"><a href="ffplay-all.html#toc-alsa-1">22.1 alsa</a></h2>
9670
9671 <p>ALSA (Advanced Linux Sound Architecture) input device.
9672 </p>
9673 <p>To enable this input device during configuration you need libasound
9674 installed on your system.
9675 </p>
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.
9678 </p>
9679 <p>An ALSA identifier has the syntax:
9680 </p><table><tr><td>&nbsp;</td><td><pre class="example">hw:<var>CARD</var>[,<var>DEV</var>[,<var>SUBDEV</var>]]
9681 </pre></td></tr></table>
9682
9683 <p>where the <var>DEV</var> and <var>SUBDEV</var> components are optional.
9684 </p>
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
9687 (-1 means any).
9688 </p>
9689 <p>To see the list of cards currently recognized by your system check the
9690 files &lsquo;<tt>/proc/asound/cards</tt>&rsquo; and &lsquo;<tt>/proc/asound/devices</tt>&rsquo;.
9691 </p>
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>&nbsp;</td><td><pre class="example">ffmpeg -f alsa -i hw:0 alsaout.wav
9695 </pre></td></tr></table>
9696
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>
9699 </p>
9700 <a name="bktr"></a>
9701 <h2 class="section"><a href="ffplay-all.html#toc-bktr">22.2 bktr</a></h2>
9702
9703 <p>BSD video input device.
9704 </p>
9705 <a name="dshow"></a>
9706 <h2 class="section"><a href="ffplay-all.html#toc-dshow">22.3 dshow</a></h2>
9707
9708 <p>Windows DirectShow input device.
9709 </p>
9710 <p>DirectShow support is enabled when FFmpeg is built with the mingw-w64 project.
9711 Currently only audio and video devices are supported.
9712 </p>
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.
9715 </p>
9716 <p>The input name should be in the format:
9717 </p>
9718 <table><tr><td>&nbsp;</td><td><pre class="example"><var>TYPE</var>=<var>NAME</var>[:<var>TYPE</var>=<var>NAME</var>]
9719 </pre></td></tr></table>
9720
9721 <p>where <var>TYPE</var> can be either <var>audio</var> or <var>video</var>,
9722 and <var>NAME</var> is the device&rsquo;s name.
9723 </p>
9724 <a name="Options-18"></a>
9725 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-18">22.3.1 Options</a></h3>
9726
9727 <p>If no options are specified, the device&rsquo;s defaults are used.
9728 If the device does not support the requested options, it will
9729 fail to open.
9730 </p>
9731 <dl compact="compact">
9732 <dt> &lsquo;<samp>video_size</samp>&rsquo;</dt>
9733 <dd><p>Set the video size in the captured video.
9734 </p>
9735 </dd>
9736 <dt> &lsquo;<samp>framerate</samp>&rsquo;</dt>
9737 <dd><p>Set the frame rate in the captured video.
9738 </p>
9739 </dd>
9740 <dt> &lsquo;<samp>sample_rate</samp>&rsquo;</dt>
9741 <dd><p>Set the sample rate (in Hz) of the captured audio.
9742 </p>
9743 </dd>
9744 <dt> &lsquo;<samp>sample_size</samp>&rsquo;</dt>
9745 <dd><p>Set the sample size (in bits) of the captured audio.
9746 </p>
9747 </dd>
9748 <dt> &lsquo;<samp>channels</samp>&rsquo;</dt>
9749 <dd><p>Set the number of channels in the captured audio.
9750 </p>
9751 </dd>
9752 <dt> &lsquo;<samp>list_devices</samp>&rsquo;</dt>
9753 <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of devices and exit.
9754 </p>
9755 </dd>
9756 <dt> &lsquo;<samp>list_options</samp>&rsquo;</dt>
9757 <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of selected device&rsquo;s options
9758 and exit.
9759 </p>
9760 </dd>
9761 <dt> &lsquo;<samp>video_device_number</samp>&rsquo;</dt>
9762 <dd><p>Set video device number for devices with same name (starts at 0,
9763 defaults to 0).
9764 </p>
9765 </dd>
9766 <dt> &lsquo;<samp>audio_device_number</samp>&rsquo;</dt>
9767 <dd><p>Set audio device number for devices with same name (starts at 0,
9768 defaults to 0).
9769 </p>
9770 </dd>
9771 <dt> &lsquo;<samp>pixel_format</samp>&rsquo;</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.
9774 </p>
9775 </dd>
9776 <dt> &lsquo;<samp>audio_buffer_size</samp>&rsquo;</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&rsquo;s
9780 default buffer size (typically some multiple of 500ms).
9781 Setting this value too low can degrade performance.
9782 See also
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>
9784 </p>
9785 </dd>
9786 </dl>
9787
9788 <a name="Examples-71"></a>
9789 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-71">22.3.2 Examples</a></h3>
9790
9791 <ul>
9792 <li>
9793 Print the list of DirectShow supported devices and exit:
9794 <table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -list_devices true -f dshow -i dummy
9795 </pre></td></tr></table>
9796
9797 </li><li>
9798 Open video device <var>Camera</var>:
9799 <table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -f dshow -i video=&quot;Camera&quot;
9800 </pre></td></tr></table>
9801
9802 </li><li>
9803 Open second video device with name <var>Camera</var>:
9804 <table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -f dshow -video_device_number 1 -i video=&quot;Camera&quot;
9805 </pre></td></tr></table>
9806
9807 </li><li>
9808 Open video device <var>Camera</var> and audio device <var>Microphone</var>:
9809 <table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -f dshow -i video=&quot;Camera&quot;:audio=&quot;Microphone&quot;
9810 </pre></td></tr></table>
9811
9812 </li><li>
9813 Print the list of supported options in selected device and exit:
9814 <table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -list_options true -f dshow -i video=&quot;Camera&quot;
9815 </pre></td></tr></table>
9816
9817 </li></ul>
9818
9819 <a name="dv1394"></a>
9820 <h2 class="section"><a href="ffplay-all.html#toc-dv1394">22.4 dv1394</a></h2>
9821
9822 <p>Linux DV 1394 input device.
9823 </p>
9824 <a name="fbdev-1"></a>
9825 <h2 class="section"><a href="ffplay-all.html#toc-fbdev-1">22.5 fbdev</a></h2>
9826
9827 <p>Linux framebuffer input device.
9828 </p>
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 &lsquo;<tt>/dev/fb0</tt>&rsquo;.
9833 </p>
9834 <p>For more detailed information read the file
9835 Documentation/fb/framebuffer.txt included in the Linux source tree.
9836 </p>
9837 <p>To record from the framebuffer device &lsquo;<tt>/dev/fb0</tt>&rsquo; with
9838 <code>ffmpeg</code>:
9839 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
9840 </pre></td></tr></table>
9841
9842 <p>You can take a single screenshot image with the command:
9843 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f fbdev -frames:v 1 -r 1 -i /dev/fb0 screenshot.jpeg
9844 </pre></td></tr></table>
9845
9846 <p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
9847 </p>
9848 <a name="iec61883"></a>
9849 <h2 class="section"><a href="ffplay-all.html#toc-iec61883">22.6 iec61883</a></h2>
9850
9851 <p>FireWire DV/HDV input device using libiec61883.
9852 </p>
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.
9856 </p>
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.
9861 </p>
9862 <p>Specify the FireWire port to be used as input file, or &quot;auto&quot;
9863 to choose the first port connected.
9864 </p>
9865 <a name="Options-5"></a>
9866 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-5">22.6.1 Options</a></h3>
9867
9868 <dl compact="compact">
9869 <dt> &lsquo;<samp>dvtype</samp>&rsquo;</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 &lsquo;<samp>auto</samp>&rsquo;, &lsquo;<samp>dv</samp>&rsquo; and &lsquo;<samp>hdv</samp>&rsquo; are supported.
9875 </p>
9876 </dd>
9877 <dt> &lsquo;<samp>dvbuffer</samp>&rsquo;</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.
9881 </p>
9882 </dd>
9883 <dt> &lsquo;<samp>dvguid</samp>&rsquo;</dt>
9884 <dd><p>Select the capture device by specifying it&rsquo;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.
9889 </p>
9890 </dd>
9891 </dl>
9892
9893 <a name="Examples-37"></a>
9894 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-37">22.6.2 Examples</a></h3>
9895
9896 <ul>
9897 <li>
9898 Grab and show the input of a FireWire DV/HDV device.
9899 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f iec61883 -i auto
9900 </pre></td></tr></table>
9901
9902 </li><li>
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>&nbsp;</td><td><pre class="example">ffmpeg -f iec61883 -i auto -hdvbuffer 100000 out.mpg
9906 </pre></td></tr></table>
9907
9908 </li></ul>
9909
9910 <a name="jack"></a>
9911 <h2 class="section"><a href="ffplay-all.html#toc-jack">22.7 jack</a></h2>
9912
9913 <p>JACK input device.
9914 </p>
9915 <p>To enable this input device during configuration you need libjack
9916 installed on your system.
9917 </p>
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
9923 device.
9924 </p>
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.
9927 </p>
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>.
9931 </p>
9932 <p>To list the JACK clients and their properties you can invoke the command
9933 <code>jack_lsp</code>.
9934 </p>
9935 <p>Follows an example which shows how to capture a JACK readable client
9936 with <code>ffmpeg</code>.
9937 </p><table><tr><td>&nbsp;</td><td><pre class="example"># Create a JACK writable client with name &quot;ffmpeg&quot;.
9938 $ ffmpeg -f jack -i ffmpeg -y out.wav
9939
9940 # Start the sample jack_metro readable client.
9941 $ jack_metro -b 120 -d 0.2 -f 4000
9942
9943 # List the current JACK clients.
9944 $ jack_lsp -c
9945 system:capture_1
9946 system:capture_2
9947 system:playback_1
9948 system:playback_2
9949 ffmpeg:input_1
9950 metro:120_bpm
9951
9952 # Connect metro to the ffmpeg writable client.
9953 $ jack_connect metro:120_bpm ffmpeg:input_1
9954 </pre></td></tr></table>
9955
9956 <p>For more information read:
9957 <a href="http://jackaudio.org/">http://jackaudio.org/</a>
9958 </p>
9959 <a name="lavfi"></a>
9960 <h2 class="section"><a href="ffplay-all.html#toc-lavfi">22.8 lavfi</a></h2>
9961
9962 <p>Libavfilter input virtual device.
9963 </p>
9964 <p>This input device reads data from the open output pads of a libavfilter
9965 filtergraph.
9966 </p>
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 &lsquo;<samp>graph</samp>&rsquo;.
9971 </p>
9972 <a name="Options-31"></a>
9973 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-31">22.8.1 Options</a></h3>
9974
9975 <dl compact="compact">
9976 <dt> &lsquo;<samp>graph</samp>&rsquo;</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 &quot;out<var>N</var>&quot;, 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 &quot;out0&quot;
9982 label, but all the others need to be specified explicitly.
9983 </p>
9984 <p>If not specified defaults to the filename specified for the input
9985 device.
9986 </p>
9987 </dd>
9988 <dt> &lsquo;<samp>graph_file</samp>&rsquo;</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>.
9992 </p>
9993 </dd>
9994 </dl>
9995
9996 <a name="Examples-87"></a>
9997 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-87">22.8.2 Examples</a></h3>
9998
9999 <ul>
10000 <li>
10001 Create a color video stream and play it back with <code>ffplay</code>:
10002 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f lavfi -graph &quot;color=c=pink [out0]&quot; dummy
10003 </pre></td></tr></table>
10004
10005 </li><li>
10006 As the previous example, but use filename for specifying the graph
10007 description, and omit the &quot;out0&quot; label:
10008 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f lavfi color=c=pink
10009 </pre></td></tr></table>
10010
10011 </li><li>
10012 Create three different video test filtered sources and play them:
10013 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f lavfi -graph &quot;testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]&quot; test3
10014 </pre></td></tr></table>
10015
10016 </li><li>
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>&nbsp;</td><td><pre class="example">ffplay -f lavfi &quot;amovie=test.wav&quot;
10020 </pre></td></tr></table>
10021
10022 </li><li>
10023 Read an audio stream and a video stream and play it back with
10024 <code>ffplay</code>:
10025 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f lavfi &quot;movie=test.avi[out0];amovie=test.wav[out1]&quot;
10026 </pre></td></tr></table>
10027
10028 </li></ul>
10029
10030 <a name="libdc1394"></a>
10031 <h2 class="section"><a href="ffplay-all.html#toc-libdc1394">22.9 libdc1394</a></h2>
10032
10033 <p>IIDC1394 input device, based on libdc1394 and libraw1394.
10034 </p>
10035 <a name="openal"></a>
10036 <h2 class="section"><a href="ffplay-all.html#toc-openal">22.10 openal</a></h2>
10037
10038 <p>The OpenAL input device provides audio capture on all systems with a
10039 working OpenAL 1.1 implementation.
10040 </p>
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>.
10044 </p>
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.
10050 </p>
10051 <p>An incomplete list of OpenAL implementations follows:
10052 </p>
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>.
10058 </p></dd>
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>.
10064 </p></dd>
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>
10068 </p></dd>
10069 </dl>
10070
10071 <p>This device allows to capture from an audio input device handled
10072 through OpenAL.
10073 </p>
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>.
10078 </p>
10079 <a name="Options-26"></a>
10080 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-26">22.10.1 Options</a></h3>
10081
10082 <dl compact="compact">
10083 <dt> &lsquo;<samp>channels</samp>&rsquo;</dt>
10084 <dd><p>Set the number of channels in the captured audio. Only the values
10085 &lsquo;<samp>1</samp>&rsquo; (monaural) and &lsquo;<samp>2</samp>&rsquo; (stereo) are currently supported.
10086 Defaults to &lsquo;<samp>2</samp>&rsquo;.
10087 </p>
10088 </dd>
10089 <dt> &lsquo;<samp>sample_size</samp>&rsquo;</dt>
10090 <dd><p>Set the sample size (in bits) of the captured audio. Only the values
10091 &lsquo;<samp>8</samp>&rsquo; and &lsquo;<samp>16</samp>&rsquo; are currently supported. Defaults to
10092 &lsquo;<samp>16</samp>&rsquo;.
10093 </p>
10094 </dd>
10095 <dt> &lsquo;<samp>sample_rate</samp>&rsquo;</dt>
10096 <dd><p>Set the sample rate (in Hz) of the captured audio.
10097 Defaults to &lsquo;<samp>44.1k</samp>&rsquo;.
10098 </p>
10099 </dd>
10100 <dt> &lsquo;<samp>list_devices</samp>&rsquo;</dt>
10101 <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of devices and exit.
10102 Defaults to &lsquo;<samp>false</samp>&rsquo;.
10103 </p>
10104 </dd>
10105 </dl>
10106
10107 <a name="Examples-74"></a>
10108 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-74">22.10.2 Examples</a></h3>
10109
10110 <p>Print the list of OpenAL supported devices and exit:
10111 </p><table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -list_devices true -f openal -i dummy out.ogg
10112 </pre></td></tr></table>
10113
10114 <p>Capture from the OpenAL device &lsquo;<tt>DR-BT101 via PulseAudio</tt>&rsquo;:
10115 </p><table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
10116 </pre></td></tr></table>
10117
10118 <p>Capture from the default device (note the empty string &rdquo; as filename):
10119 </p><table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -f openal -i '' out.ogg
10120 </pre></td></tr></table>
10121
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>&nbsp;</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.
10128 </p>
10129 <a name="oss"></a>
10130 <h2 class="section"><a href="ffplay-all.html#toc-oss">22.11 oss</a></h2>
10131
10132 <p>Open Sound System input device.
10133 </p>
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 &lsquo;<tt>/dev/dsp</tt>&rsquo;.
10137 </p>
10138 <p>For example to grab from &lsquo;<tt>/dev/dsp</tt>&rsquo; using <code>ffmpeg</code> use the
10139 command:
10140 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
10141 </pre></td></tr></table>
10142
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>
10145 </p>
10146 <a name="pulse-1"></a>
10147 <h2 class="section"><a href="ffplay-all.html#toc-pulse-1">22.12 pulse</a></h2>
10148
10149 <p>PulseAudio input device.
10150 </p>
10151 <p>To enable this output device you need to configure FFmpeg with <code>--enable-libpulse</code>.
10152 </p>
10153 <p>The filename to provide to the input device is a source device or the
10154 string &quot;default&quot;
10155 </p>
10156 <p>To list the PulseAudio source devices and their properties you can invoke
10157 the command <code>pactl list sources</code>.
10158 </p>
10159 <p>More information about PulseAudio can be found on <a href="http://www.pulseaudio.org">http://www.pulseaudio.org</a>.
10160 </p>
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> &lsquo;<samp>server</samp>&rsquo;</dt>
10165 <dd><p>Connect to a specific PulseAudio server, specified by an IP address.
10166 Default server is used when not provided.
10167 </p>
10168 </dd>
10169 <dt> &lsquo;<samp>name</samp>&rsquo;</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.
10172 </p>
10173 </dd>
10174 <dt> &lsquo;<samp>stream_name</samp>&rsquo;</dt>
10175 <dd><p>Specify the stream name PulseAudio will use when showing active streams,
10176 by default it is &quot;record&quot;.
10177 </p>
10178 </dd>
10179 <dt> &lsquo;<samp>sample_rate</samp>&rsquo;</dt>
10180 <dd><p>Specify the samplerate in Hz, by default 48kHz is used.
10181 </p>
10182 </dd>
10183 <dt> &lsquo;<samp>channels</samp>&rsquo;</dt>
10184 <dd><p>Specify the channels in use, by default 2 (stereo) is set.
10185 </p>
10186 </dd>
10187 <dt> &lsquo;<samp>frame_size</samp>&rsquo;</dt>
10188 <dd><p>Specify the number of bytes per frame, by default it is set to 1024.
10189 </p>
10190 </dd>
10191 <dt> &lsquo;<samp>fragment_size</samp>&rsquo;</dt>
10192 <dd><p>Specify the minimal buffering fragment in PulseAudio, it will affect the
10193 audio latency. By default it is unset.
10194 </p></dd>
10195 </dl>
10196
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>&nbsp;</td><td><pre class="example">ffmpeg -f pulse -i default /tmp/pulse.wav
10201 </pre></td></tr></table>
10202
10203 <a name="sndio-1"></a>
10204 <h2 class="section"><a href="ffplay-all.html#toc-sndio-1">22.13 sndio</a></h2>
10205
10206 <p>sndio input device.
10207 </p>
10208 <p>To enable this input device during configuration you need libsndio
10209 installed on your system.
10210 </p>
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 &lsquo;<tt>/dev/audio0</tt>&rsquo;.
10214 </p>
10215 <p>For example to grab from &lsquo;<tt>/dev/audio0</tt>&rsquo; using <code>ffmpeg</code> use the
10216 command:
10217 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
10218 </pre></td></tr></table>
10219
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>
10222
10223 <p>Video4Linux2 input video device.
10224 </p>
10225 <p>&quot;v4l2&quot; can be used as alias for &quot;video4linux2&quot;.
10226 </p>
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.
10230 </p>
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 &lsquo;<tt>/dev/video<var>N</var></tt>&rsquo;, where <var>N</var> is a number associated to
10235 the device.
10236 </p>
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>.
10242 </p>
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 &lsquo;<samp>-timestamps abs</samp>&rsquo; or &lsquo;<samp>-ts abs</samp>&rsquo; option can be used to force
10248 conversion into the real time clock.
10249 </p>
10250 <p>Some usage examples of the video4linux2 device with <code>ffmpeg</code>
10251 and <code>ffplay</code>:
10252 </p><ul>
10253 <li>
10254 Grab and show the input of a video4linux2 device:
10255 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
10256 </pre></td></tr></table>
10257
10258 </li><li>
10259 Grab and record the input of a video4linux2 device, leave the
10260 frame rate and size as previously set:
10261 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
10262 </pre></td></tr></table>
10263 </li></ul>
10264
10265 <p>For more information about Video4Linux, check <a href="http://linuxtv.org/">http://linuxtv.org/</a>.
10266 </p>
10267 <a name="Options-2"></a>
10268 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-2">22.14.1 Options</a></h3>
10269
10270 <dl compact="compact">
10271 <dt> &lsquo;<samp>standard</samp>&rsquo;</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 &lsquo;<samp>list_standards</samp>&rsquo;
10274 option.
10275 </p>
10276 </dd>
10277 <dt> &lsquo;<samp>channel</samp>&rsquo;</dt>
10278 <dd><p>Set the input channel number. Default to -1, which means using the
10279 previously selected channel.
10280 </p>
10281 </dd>
10282 <dt> &lsquo;<samp>video_size</samp>&rsquo;</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.
10285 </p>
10286 </dd>
10287 <dt> &lsquo;<samp>pixel_format</samp>&rsquo;</dt>
10288 <dd><p>Select the pixel format (only valid for raw video input).
10289 </p>
10290 </dd>
10291 <dt> &lsquo;<samp>input_format</samp>&rsquo;</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
10294 available.
10295 </p>
10296 </dd>
10297 <dt> &lsquo;<samp>framerate</samp>&rsquo;</dt>
10298 <dd><p>Set the preferred video frame rate.
10299 </p>
10300 </dd>
10301 <dt> &lsquo;<samp>list_formats</samp>&rsquo;</dt>
10302 <dd><p>List available formats (supported pixel formats, codecs, and frame
10303 sizes) and exit.
10304 </p>
10305 <p>Available values are:
10306 </p><dl compact="compact">
10307 <dt> &lsquo;<samp>all</samp>&rsquo;</dt>
10308 <dd><p>Show all available (compressed and non-compressed) formats.
10309 </p>
10310 </dd>
10311 <dt> &lsquo;<samp>raw</samp>&rsquo;</dt>
10312 <dd><p>Show only raw video (non-compressed) formats.
10313 </p>
10314 </dd>
10315 <dt> &lsquo;<samp>compressed</samp>&rsquo;</dt>
10316 <dd><p>Show only compressed formats.
10317 </p></dd>
10318 </dl>
10319
10320 </dd>
10321 <dt> &lsquo;<samp>list_standards</samp>&rsquo;</dt>
10322 <dd><p>List supported standards and exit.
10323 </p>
10324 <p>Available values are:
10325 </p><dl compact="compact">
10326 <dt> &lsquo;<samp>all</samp>&rsquo;</dt>
10327 <dd><p>Show all supported standards.
10328 </p></dd>
10329 </dl>
10330
10331 </dd>
10332 <dt> &lsquo;<samp>timestamps, ts</samp>&rsquo;</dt>
10333 <dd><p>Set type of timestamps for grabbed frames.
10334 </p>
10335 <p>Available values are:
10336 </p><dl compact="compact">
10337 <dt> &lsquo;<samp>default</samp>&rsquo;</dt>
10338 <dd><p>Use timestamps from the kernel.
10339 </p>
10340 </dd>
10341 <dt> &lsquo;<samp>abs</samp>&rsquo;</dt>
10342 <dd><p>Use absolute timestamps (wall clock).
10343 </p>
10344 </dd>
10345 <dt> &lsquo;<samp>mono2abs</samp>&rsquo;</dt>
10346 <dd><p>Force conversion from monotonic to absolute timestamps.
10347 </p></dd>
10348 </dl>
10349
10350 <p>Default value is <code>default</code>.
10351 </p></dd>
10352 </dl>
10353
10354 <a name="vfwcap"></a>
10355 <h2 class="section"><a href="ffplay-all.html#toc-vfwcap">22.15 vfwcap</a></h2>
10356
10357 <p>VfW (Video for Windows) capture input device.
10358 </p>
10359 <p>The filename passed as input is the capture driver number, ranging from
10360 0 to 9. You may use &quot;list&quot; as filename to print a list of drivers. Any
10361 other filename will be interpreted as device number 0.
10362 </p>
10363 <a name="x11grab"></a>
10364 <h2 class="section"><a href="ffplay-all.html#toc-x11grab">22.16 x11grab</a></h2>
10365
10366 <p>X11 video input device.
10367 </p>
10368 <p>This device allows to capture a region of an X11 display.
10369 </p>
10370 <p>The filename passed as input has the syntax:
10371 </p><table><tr><td>&nbsp;</td><td><pre class="example">[<var>hostname</var>]:<var>display_number</var>.<var>screen_number</var>[+<var>x_offset</var>,<var>y_offset</var>]
10372 </pre></td></tr></table>
10373
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 &quot;localhost&quot;. The environment variable
10377 <code>DISPLAY</code> contains the default display name.
10378 </p>
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
10381 default to 0.
10382 </p>
10383 <p>Check the X11 documentation (e.g. man X) for more detailed information.
10384 </p>
10385 <p>Use the <code>dpyinfo</code> program for getting basic information about the
10386 properties of your X11 display (e.g. grep for &quot;name&quot; or &quot;dimensions&quot;).
10387 </p>
10388 <p>For example to grab from &lsquo;<tt>:0.0</tt>&rsquo; using <code>ffmpeg</code>:
10389 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0 out.mpg
10390 </pre></td></tr></table>
10391
10392 <p>Grab at position <code>10,20</code>:
10393 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
10394 </pre></td></tr></table>
10395
10396 <a name="Options-20"></a>
10397 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-20">22.16.1 Options</a></h3>
10398
10399 <dl compact="compact">
10400 <dt> &lsquo;<samp>draw_mouse</samp>&rsquo;</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>.
10403 </p>
10404 </dd>
10405 <dt> &lsquo;<samp>follow_mouse</samp>&rsquo;</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>.
10408 </p>
10409 <p>When it is specified with &quot;centered&quot;, 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.
10413 </p>
10414 <p>For example:
10415 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f x11grab -follow_mouse centered -framerate 25 -video_size cif -i :0.0 out.mpg
10416 </pre></td></tr></table>
10417
10418 <p>To follow only when the mouse pointer reaches within 100 pixels to edge:
10419 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f x11grab -follow_mouse 100 -framerate 25 -video_size cif -i :0.0 out.mpg
10420 </pre></td></tr></table>
10421
10422 </dd>
10423 <dt> &lsquo;<samp>framerate</samp>&rsquo;</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>.
10426 </p>
10427 </dd>
10428 <dt> &lsquo;<samp>show_region</samp>&rsquo;</dt>
10429 <dd><p>Show grabbed region on screen.
10430 </p>
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.
10434 </p>
10435 <p>For example:
10436 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f x11grab -show_region 1 -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
10437 </pre></td></tr></table>
10438
10439 <p>With <var>follow_mouse</var>:
10440 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f x11grab -follow_mouse centered -show_region 1 -framerate 25 -video_size cif -i :0.0 out.mpg
10441 </pre></td></tr></table>
10442
10443 </dd>
10444 <dt> &lsquo;<samp>video_size</samp>&rsquo;</dt>
10445 <dd><p>Set the video frame size. Default value is <code>vga</code>.
10446 </p></dd>
10447 </dl>
10448
10449 <a name="Output-Devices"></a>
10450 <h1 class="chapter"><a href="ffplay-all.html#toc-Output-Devices">23. Output Devices</a></h1>
10451
10452 <p>Output devices are configured elements in FFmpeg that can write
10453 multimedia data to an output device attached to your system.
10454 </p>
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 &quot;&ndash;list-outdevs&quot;.
10458 </p>
10459 <p>You can disable all the output devices using the configure option
10460 &quot;&ndash;disable-outdevs&quot;, and selectively enable an output device using the
10461 option &quot;&ndash;enable-outdev=<var>OUTDEV</var>&quot;, or you can disable a particular
10462 input device using the option &quot;&ndash;disable-outdev=<var>OUTDEV</var>&quot;.
10463 </p>
10464 <p>The option &quot;-formats&quot; of the ff* tools will display the list of
10465 enabled output devices (amongst the muxers).
10466 </p>
10467 <p>A description of the currently available output devices follows.
10468 </p>
10469 <a name="alsa"></a>
10470 <h2 class="section"><a href="ffplay-all.html#toc-alsa">23.1 alsa</a></h2>
10471
10472 <p>ALSA (Advanced Linux Sound Architecture) output device.
10473 </p>
10474 <a name="Examples-33"></a>
10475 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-33">23.1.1 Examples</a></h3>
10476
10477 <ul>
10478 <li>
10479 Play a file on default ALSA device:
10480 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f alsa default
10481 </pre></td></tr></table>
10482
10483 </li><li>
10484 Play a file on soundcard 1, audio device 7:
10485 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f alsa hw:1,7
10486 </pre></td></tr></table>
10487 </li></ul>
10488
10489 <a name="caca"></a>
10490 <h2 class="section"><a href="ffplay-all.html#toc-caca">23.2 caca</a></h2>
10491
10492 <p>CACA output device.
10493 </p>
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.
10497 </p>
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.
10501 </p>
10502 <p>For more information about libcaca, check:
10503 <a href="http://caca.zoy.org/wiki/libcaca">http://caca.zoy.org/wiki/libcaca</a>
10504 </p>
10505 <a name="Options-4"></a>
10506 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-4">23.2.1 Options</a></h3>
10507
10508 <dl compact="compact">
10509 <dt> &lsquo;<samp>window_title</samp>&rsquo;</dt>
10510 <dd><p>Set the CACA window title, if not specified default to the filename
10511 specified for the output device.
10512 </p>
10513 </dd>
10514 <dt> &lsquo;<samp>window_size</samp>&rsquo;</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.
10518 </p>
10519 </dd>
10520 <dt> &lsquo;<samp>driver</samp>&rsquo;</dt>
10521 <dd><p>Set display driver.
10522 </p>
10523 </dd>
10524 <dt> &lsquo;<samp>algorithm</samp>&rsquo;</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>.
10529 </p>
10530 </dd>
10531 <dt> &lsquo;<samp>antialias</samp>&rsquo;</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>.
10535 </p>
10536 </dd>
10537 <dt> &lsquo;<samp>charset</samp>&rsquo;</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>.
10540 </p>
10541 </dd>
10542 <dt> &lsquo;<samp>color</samp>&rsquo;</dt>
10543 <dd><p>Set color to be used when rendering text.
10544 The accepted values are listed with <code>-list_dither colors</code>.
10545 </p>
10546 </dd>
10547 <dt> &lsquo;<samp>list_drivers</samp>&rsquo;</dt>
10548 <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of available drivers and exit.
10549 </p>
10550 </dd>
10551 <dt> &lsquo;<samp>list_dither</samp>&rsquo;</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>.
10555 </p></dd>
10556 </dl>
10557
10558 <a name="Examples-56"></a>
10559 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-56">23.2.2 Examples</a></h3>
10560
10561 <ul>
10562 <li>
10563 The following command shows the <code>ffmpeg</code> output is an
10564 CACA window, forcing its size to 80x25:
10565 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -vcodec rawvideo -pix_fmt rgb24 -window_size 80x25 -f caca -
10566 </pre></td></tr></table>
10567
10568 </li><li>
10569 Show the list of available drivers and exit:
10570 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_drivers true -
10571 </pre></td></tr></table>
10572
10573 </li><li>
10574 Show the list of available dither colors and exit:
10575 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_dither colors -
10576 </pre></td></tr></table>
10577 </li></ul>
10578
10579 <a name="fbdev"></a>
10580 <h2 class="section"><a href="ffplay-all.html#toc-fbdev">23.3 fbdev</a></h2>
10581
10582 <p>Linux framebuffer output device.
10583 </p>
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 &lsquo;<tt>/dev/fb0</tt>&rsquo;.
10588 </p>
10589 <p>For more detailed information read the file
10590 &lsquo;<tt>Documentation/fb/framebuffer.txt</tt>&rsquo; included in the Linux source tree.
10591 </p>
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> &lsquo;<samp>xoffset</samp>&rsquo;</dt>
10596 <dt> &lsquo;<samp>yoffset</samp>&rsquo;</dt>
10597 <dd><p>Set x/y coordinate of top left corner. Default is 0.
10598 </p></dd>
10599 </dl>
10600
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 &lsquo;<tt>/dev/fb0</tt>&rsquo;.
10604 Required pixel format depends on current framebuffer settings.
10605 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i INPUT -vcodec rawvideo -pix_fmt bgra -f fbdev /dev/fb0
10606 </pre></td></tr></table>
10607
10608 <p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
10609 </p>
10610 <a name="oss-1"></a>
10611 <h2 class="section"><a href="ffplay-all.html#toc-oss-1">23.4 oss</a></h2>
10612
10613 <p>OSS (Open Sound System) output device.
10614 </p>
10615 <a name="pulse"></a>
10616 <h2 class="section"><a href="ffplay-all.html#toc-pulse">23.5 pulse</a></h2>
10617
10618 <p>PulseAudio output device.
10619 </p>
10620 <p>To enable this output device you need to configure FFmpeg with <code>--enable-libpulse</code>.
10621 </p>
10622 <p>More information about PulseAudio can be found on <a href="http://www.pulseaudio.org">http://www.pulseaudio.org</a>
10623 </p>
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> &lsquo;<samp>server</samp>&rsquo;</dt>
10628 <dd><p>Connect to a specific PulseAudio server, specified by an IP address.
10629 Default server is used when not provided.
10630 </p>
10631 </dd>
10632 <dt> &lsquo;<samp>name</samp>&rsquo;</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.
10635 </p>
10636 </dd>
10637 <dt> &lsquo;<samp>stream_name</samp>&rsquo;</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.
10640 </p>
10641 </dd>
10642 <dt> &lsquo;<samp>device</samp>&rsquo;</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>.
10645 </p>
10646 </dd>
10647 <dt> &lsquo;<samp>buffer_size</samp>&rsquo;</dt>
10648 <dt> &lsquo;<samp>buffer_duration</samp>&rsquo;</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.
10651 </p>
10652 <p>&lsquo;<samp>buffer_size</samp>&rsquo; specifies size in bytes while
10653 &lsquo;<samp>buffer_duration</samp>&rsquo; specifies duration in milliseconds.
10654 </p>
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.
10660 </p></dd>
10661 </dl>
10662
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>&nbsp;</td><td><pre class="example">ffmpeg  -i INPUT -f pulse &quot;stream name&quot;
10667 </pre></td></tr></table>
10668
10669 <a name="sdl"></a>
10670 <h2 class="section"><a href="ffplay-all.html#toc-sdl">23.6 sdl</a></h2>
10671
10672 <p>SDL (Simple DirectMedia Layer) output device.
10673 </p>
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.
10677 </p>
10678 <p>To enable this output device you need libsdl installed on your system
10679 when configuring your build.
10680 </p>
10681 <p>For more information about SDL, check:
10682 <a href="http://www.libsdl.org/">http://www.libsdl.org/</a>
10683 </p>
10684 <a name="Options-12"></a>
10685 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-12">23.6.1 Options</a></h3>
10686
10687 <dl compact="compact">
10688 <dt> &lsquo;<samp>window_title</samp>&rsquo;</dt>
10689 <dd><p>Set the SDL window title, if not specified default to the filename
10690 specified for the output device.
10691 </p>
10692 </dd>
10693 <dt> &lsquo;<samp>icon_title</samp>&rsquo;</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>.
10696 </p>
10697 </dd>
10698 <dt> &lsquo;<samp>window_size</samp>&rsquo;</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.
10703 </p>
10704 </dd>
10705 <dt> &lsquo;<samp>window_fullscreen</samp>&rsquo;</dt>
10706 <dd><p>Set fullscreen mode when non-zero value is provided.
10707 Default value is zero.
10708 </p></dd>
10709 </dl>
10710
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>
10713
10714 <p>The window created by the device can be controlled through the
10715 following interactive commands.
10716 </p>
10717 <dl compact="compact">
10718 <dt> &lt;q, ESC&gt;</dt>
10719 <dd><p>Quit the device immediately.
10720 </p></dd>
10721 </dl>
10722
10723 <a name="Examples-82"></a>
10724 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-82">23.6.3 Examples</a></h3>
10725
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>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -vcodec rawvideo -pix_fmt yuv420p -window_size qcif -f sdl &quot;SDL output&quot;
10729 </pre></td></tr></table>
10730
10731 <a name="sndio"></a>
10732 <h2 class="section"><a href="ffplay-all.html#toc-sndio">23.7 sndio</a></h2>
10733
10734 <p>sndio audio output device.
10735 </p>
10736 <a name="xv"></a>
10737 <h2 class="section"><a href="ffplay-all.html#toc-xv">23.8 xv</a></h2>
10738
10739 <p>XV (XVideo) output device.
10740 </p>
10741 <p>This output device allows to show a video stream in a X Window System
10742 window.
10743 </p>
10744 <a name="Options-3"></a>
10745 <h3 class="subsection"><a href="ffplay-all.html#toc-Options-3">23.8.1 Options</a></h3>
10746
10747 <dl compact="compact">
10748 <dt> &lsquo;<samp>display_name</samp>&rsquo;</dt>
10749 <dd><p>Specify the hardware display name, which determines the display and
10750 communications domain to be used.
10751 </p>
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>]].
10754 </p>
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.
10759 </p>
10760 <p>If unspecified, it defaults to the value of the DISPLAY environment
10761 variable.
10762 </p>
10763 <p>For example, <code>dual-headed:0.1</code> would specify screen 1 of display
10764 0 on the machine named &ldquo;dual-headed&rdquo;.
10765 </p>
10766 <p>Check the X11 specification for more detailed information about the
10767 display name format.
10768 </p>
10769 </dd>
10770 <dt> &lsquo;<samp>window_size</samp>&rsquo;</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.
10774 </p>
10775 </dd>
10776 <dt> &lsquo;<samp>window_x</samp>&rsquo;</dt>
10777 <dt> &lsquo;<samp>window_y</samp>&rsquo;</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.
10780 </p>
10781 </dd>
10782 <dt> &lsquo;<samp>window_title</samp>&rsquo;</dt>
10783 <dd><p>Set the window title, if not specified default to the filename
10784 specified for the output device.
10785 </p></dd>
10786 </dl>
10787
10788 <p>For more information about XVideo see <a href="http://www.x.org/">http://www.x.org/</a>.
10789 </p>
10790 <a name="Examples-48"></a>
10791 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-48">23.8.2 Examples</a></h3>
10792
10793 <ul>
10794 <li>
10795 Decode, display and encode video input with <code>ffmpeg</code> at the
10796 same time:
10797 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT OUTPUT -f xv display
10798 </pre></td></tr></table>
10799
10800 </li><li>
10801 Decode and display the input video to multiple X11 windows:
10802 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f xv normal -vf negate -f xv negated
10803 </pre></td></tr></table>
10804 </li></ul>
10805
10806 <a name="Resampler-Options"></a>
10807 <h1 class="chapter"><a href="ffplay-all.html#toc-Resampler-Options">24. Resampler Options</a></h1>
10808
10809 <p>The audio resampler supports the following named options.
10810 </p>
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 &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API for
10815 programmatic use.
10816 </p>
10817 <dl compact="compact">
10818 <dt> &lsquo;<samp>ich, in_channel_count</samp>&rsquo;</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 &lsquo;<samp>in_channel_layout</samp>&rsquo; is set.
10822 </p>
10823 </dd>
10824 <dt> &lsquo;<samp>och, out_channel_count</samp>&rsquo;</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 &lsquo;<samp>out_channel_layout</samp>&rsquo; is set.
10828 </p>
10829 </dd>
10830 <dt> &lsquo;<samp>uch, used_channel_count</samp>&rsquo;</dt>
10831 <dd><p>Set the number of used input channels. Default value is 0. This option is
10832 only used for special remapping.
10833 </p>
10834 </dd>
10835 <dt> &lsquo;<samp>isr, in_sample_rate</samp>&rsquo;</dt>
10836 <dd><p>Set the input sample rate. Default value is 0.
10837 </p>
10838 </dd>
10839 <dt> &lsquo;<samp>osr, out_sample_rate</samp>&rsquo;</dt>
10840 <dd><p>Set the output sample rate. Default value is 0.
10841 </p>
10842 </dd>
10843 <dt> &lsquo;<samp>isf, in_sample_fmt</samp>&rsquo;</dt>
10844 <dd><p>Specify the input sample format. It is set by default to <code>none</code>.
10845 </p>
10846 </dd>
10847 <dt> &lsquo;<samp>osf, out_sample_fmt</samp>&rsquo;</dt>
10848 <dd><p>Specify the output sample format. It is set by default to <code>none</code>.
10849 </p>
10850 </dd>
10851 <dt> &lsquo;<samp>tsf, internal_sample_fmt</samp>&rsquo;</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.
10854 </p>
10855 </dd>
10856 <dt> &lsquo;<samp>icl, in_channel_layout</samp>&rsquo;</dt>
10857 <dt> &lsquo;<samp>ocl, out_channel_layout</samp>&rsquo;</dt>
10858 <dd><p>Set the input/output channel layout.
10859 </p>
10860 <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)channel layout syntax</a>
10861 for the required syntax.
10862 </p>
10863 </dd>
10864 <dt> &lsquo;<samp>clev, center_mix_level</samp>&rsquo;</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].
10867 </p>
10868 </dd>
10869 <dt> &lsquo;<samp>slev, surround_mix_level</samp>&rsquo;</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].
10872 </p>
10873 </dd>
10874 <dt> &lsquo;<samp>lfe_mix_level</samp>&rsquo;</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].
10878 </p>
10879 </dd>
10880 <dt> &lsquo;<samp>rmvol, rematrix_volume</samp>&rsquo;</dt>
10881 <dd><p>Set rematrix volume. Default value is 1.0.
10882 </p>
10883 </dd>
10884 <dt> &lsquo;<samp>rematrix_maxval</samp>&rsquo;</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.
10888 </p>
10889 </dd>
10890 <dt> &lsquo;<samp>flags, swr_flags</samp>&rsquo;</dt>
10891 <dd><p>Set flags used by the converter. Default value is 0.
10892 </p>
10893 <p>It supports the following individual flags:
10894 </p><dl compact="compact">
10895 <dt> &lsquo;<samp>res</samp>&rsquo;</dt>
10896 <dd><p>force resampling, this flag forces resampling to be used even when the
10897 input and output sample rates match.
10898 </p></dd>
10899 </dl>
10900
10901 </dd>
10902 <dt> &lsquo;<samp>dither_scale</samp>&rsquo;</dt>
10903 <dd><p>Set the dither scale. Default value is 1.
10904 </p>
10905 </dd>
10906 <dt> &lsquo;<samp>dither_method</samp>&rsquo;</dt>
10907 <dd><p>Set dither method. Default value is 0.
10908 </p>
10909 <p>Supported values:
10910 </p><dl compact="compact">
10911 <dt> &lsquo;<samp>rectangular</samp>&rsquo;</dt>
10912 <dd><p>select rectangular dither
10913 </p></dd>
10914 <dt> &lsquo;<samp>triangular</samp>&rsquo;</dt>
10915 <dd><p>select triangular dither
10916 </p></dd>
10917 <dt> &lsquo;<samp>triangular_hp</samp>&rsquo;</dt>
10918 <dd><p>select triangular dither with high pass
10919 </p></dd>
10920 <dt> &lsquo;<samp>lipshitz</samp>&rsquo;</dt>
10921 <dd><p>select lipshitz noise shaping dither
10922 </p></dd>
10923 <dt> &lsquo;<samp>shibata</samp>&rsquo;</dt>
10924 <dd><p>select shibata noise shaping dither
10925 </p></dd>
10926 <dt> &lsquo;<samp>low_shibata</samp>&rsquo;</dt>
10927 <dd><p>select low shibata noise shaping dither
10928 </p></dd>
10929 <dt> &lsquo;<samp>high_shibata</samp>&rsquo;</dt>
10930 <dd><p>select high shibata noise shaping dither
10931 </p></dd>
10932 <dt> &lsquo;<samp>f_weighted</samp>&rsquo;</dt>
10933 <dd><p>select f-weighted noise shaping dither
10934 </p></dd>
10935 <dt> &lsquo;<samp>modified_e_weighted</samp>&rsquo;</dt>
10936 <dd><p>select modified-e-weighted noise shaping dither
10937 </p></dd>
10938 <dt> &lsquo;<samp>improved_e_weighted</samp>&rsquo;</dt>
10939 <dd><p>select improved-e-weighted noise shaping dither
10940 </p>
10941 </dd>
10942 </dl>
10943
10944 </dd>
10945 <dt> &lsquo;<samp>resampler</samp>&rsquo;</dt>
10946 <dd><p>Set resampling engine. Default value is swr.
10947 </p>
10948 <p>Supported values:
10949 </p><dl compact="compact">
10950 <dt> &lsquo;<samp>swr</samp>&rsquo;</dt>
10951 <dd><p>select the native SW Resampler; filter options precision and cheby are not
10952 applicable in this case.
10953 </p></dd>
10954 <dt> &lsquo;<samp>soxr</samp>&rsquo;</dt>
10955 <dd><p>select the SoX Resampler (where available); compensation, and filter options
10956 filter_size, phase_shift, filter_type &amp; kaiser_beta, are not applicable in this
10957 case.
10958 </p></dd>
10959 </dl>
10960
10961 </dd>
10962 <dt> &lsquo;<samp>filter_size</samp>&rsquo;</dt>
10963 <dd><p>For swr only, set resampling filter size, default value is 32.
10964 </p>
10965 </dd>
10966 <dt> &lsquo;<samp>phase_shift</samp>&rsquo;</dt>
10967 <dd><p>For swr only, set resampling phase shift, default value is 10, and must be in
10968 the interval [0,30].
10969 </p>
10970 </dd>
10971 <dt> &lsquo;<samp>linear_interp</samp>&rsquo;</dt>
10972 <dd><p>Use Linear Interpolation if set to 1, default value is 0.
10973 </p>
10974 </dd>
10975 <dt> &lsquo;<samp>cutoff</samp>&rsquo;</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).
10979 </p>
10980 </dd>
10981 <dt> &lsquo;<samp>precision</samp>&rsquo;</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&rsquo;s &rsquo;High Quality&rsquo;; a
10985 value of 28 gives SoX&rsquo;s &rsquo;Very High Quality&rsquo;.
10986 </p>
10987 </dd>
10988 <dt> &lsquo;<samp>cheby</samp>&rsquo;</dt>
10989 <dd><p>For soxr only, selects passband rolloff none (Chebyshev) &amp; higher-precision
10990 approximation for &rsquo;irrational&rsquo; ratios. Default value is 0.
10991 </p>
10992 </dd>
10993 <dt> &lsquo;<samp>async</samp>&rsquo;</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.
11000 </p>
11001 </dd>
11002 <dt> &lsquo;<samp>first_pts</samp>&rsquo;</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&rsquo;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.
11009 </p>
11010 </dd>
11011 <dt> &lsquo;<samp>min_comp</samp>&rsquo;</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 (&lsquo;<samp>min_comp</samp>&rsquo; = <code>FLT_MAX</code>).
11017 </p>
11018 </dd>
11019 <dt> &lsquo;<samp>min_hard_comp</samp>&rsquo;</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 &lsquo;<samp>min_comp</samp>&rsquo;.
11025 The default is 0.1.
11026 </p>
11027 </dd>
11028 <dt> &lsquo;<samp>comp_duration</samp>&rsquo;</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.
11032 </p>
11033 </dd>
11034 <dt> &lsquo;<samp>max_soft_comp</samp>&rsquo;</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
11037 is 0.
11038 </p>
11039 </dd>
11040 <dt> &lsquo;<samp>matrix_encoding</samp>&rsquo;</dt>
11041 <dd><p>Select matrixed stereo encoding.
11042 </p>
11043 <p>It accepts the following values:
11044 </p><dl compact="compact">
11045 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
11046 <dd><p>select none
11047 </p></dd>
11048 <dt> &lsquo;<samp>dolby</samp>&rsquo;</dt>
11049 <dd><p>select Dolby
11050 </p></dd>
11051 <dt> &lsquo;<samp>dplii</samp>&rsquo;</dt>
11052 <dd><p>select Dolby Pro Logic II
11053 </p></dd>
11054 </dl>
11055
11056 <p>Default value is <code>none</code>.
11057 </p>
11058 </dd>
11059 <dt> &lsquo;<samp>filter_type</samp>&rsquo;</dt>
11060 <dd><p>For swr only, select resampling filter type. This only affects resampling
11061 operations.
11062 </p>
11063 <p>It accepts the following values:
11064 </p><dl compact="compact">
11065 <dt> &lsquo;<samp>cubic</samp>&rsquo;</dt>
11066 <dd><p>select cubic
11067 </p></dd>
11068 <dt> &lsquo;<samp>blackman_nuttall</samp>&rsquo;</dt>
11069 <dd><p>select Blackman Nuttall Windowed Sinc
11070 </p></dd>
11071 <dt> &lsquo;<samp>kaiser</samp>&rsquo;</dt>
11072 <dd><p>select Kaiser Windowed Sinc
11073 </p></dd>
11074 </dl>
11075
11076 </dd>
11077 <dt> &lsquo;<samp>kaiser_beta</samp>&rsquo;</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.
11080 </p>
11081 </dd>
11082 <dt> &lsquo;<samp>output_sample_bits</samp>&rsquo;</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&rsquo;s not used.
11085 </p>
11086 </dd>
11087 </dl>
11088
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>
11092
11093 <p>The video scaler supports the following named options.
11094 </p>
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 &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API.
11098 </p>
11099 <dl compact="compact">
11100 <dd>
11101 <p><a name="sws_005fflags"></a>
11102 </p></dd>
11103 <dt> &lsquo;<samp>sws_flags</samp>&rsquo;</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.
11106 </p>
11107 <p>It accepts the following values:
11108 </p><dl compact="compact">
11109 <dt> &lsquo;<samp>fast_bilinear</samp>&rsquo;</dt>
11110 <dd><p>Select fast bilinear scaling algorithm.
11111 </p>
11112 </dd>
11113 <dt> &lsquo;<samp>bilinear</samp>&rsquo;</dt>
11114 <dd><p>Select bilinear scaling algorithm.
11115 </p>
11116 </dd>
11117 <dt> &lsquo;<samp>bicubic</samp>&rsquo;</dt>
11118 <dd><p>Select bicubic scaling algorithm.
11119 </p>
11120 </dd>
11121 <dt> &lsquo;<samp>experimental</samp>&rsquo;</dt>
11122 <dd><p>Select experimental scaling algorithm.
11123 </p>
11124 </dd>
11125 <dt> &lsquo;<samp>neighbor</samp>&rsquo;</dt>
11126 <dd><p>Select nearest neighbor rescaling algorithm.
11127 </p>
11128 </dd>
11129 <dt> &lsquo;<samp>area</samp>&rsquo;</dt>
11130 <dd><p>Select averaging area rescaling algorithm.
11131 </p>
11132 </dd>
11133 <dt> &lsquo;<samp>bicubiclin</samp>&rsquo;</dt>
11134 <dd><p>Select bicubic scaling algorithm for the luma component, bilinear for
11135 chroma components.
11136 </p>
11137 </dd>
11138 <dt> &lsquo;<samp>gauss</samp>&rsquo;</dt>
11139 <dd><p>Select Gaussian rescaling algorithm.
11140 </p>
11141 </dd>
11142 <dt> &lsquo;<samp>sinc</samp>&rsquo;</dt>
11143 <dd><p>Select sinc rescaling algorithm.
11144 </p>
11145 </dd>
11146 <dt> &lsquo;<samp>lanczos</samp>&rsquo;</dt>
11147 <dd><p>Select lanczos rescaling algorithm.
11148 </p>
11149 </dd>
11150 <dt> &lsquo;<samp>spline</samp>&rsquo;</dt>
11151 <dd><p>Select natural bicubic spline rescaling algorithm.
11152 </p>
11153 </dd>
11154 <dt> &lsquo;<samp>print_info</samp>&rsquo;</dt>
11155 <dd><p>Enable printing/debug logging.
11156 </p>
11157 </dd>
11158 <dt> &lsquo;<samp>accurate_rnd</samp>&rsquo;</dt>
11159 <dd><p>Enable accurate rounding.
11160 </p>
11161 </dd>
11162 <dt> &lsquo;<samp>full_chroma_int</samp>&rsquo;</dt>
11163 <dd><p>Enable full chroma interpolation.
11164 </p>
11165 </dd>
11166 <dt> &lsquo;<samp>full_chroma_inp</samp>&rsquo;</dt>
11167 <dd><p>Select full chroma input.
11168 </p>
11169 </dd>
11170 <dt> &lsquo;<samp>bitexact</samp>&rsquo;</dt>
11171 <dd><p>Enable bitexact output.
11172 </p></dd>
11173 </dl>
11174
11175 </dd>
11176 <dt> &lsquo;<samp>srcw</samp>&rsquo;</dt>
11177 <dd><p>Set source width.
11178 </p>
11179 </dd>
11180 <dt> &lsquo;<samp>srch</samp>&rsquo;</dt>
11181 <dd><p>Set source height.
11182 </p>
11183 </dd>
11184 <dt> &lsquo;<samp>dstw</samp>&rsquo;</dt>
11185 <dd><p>Set destination width.
11186 </p>
11187 </dd>
11188 <dt> &lsquo;<samp>dsth</samp>&rsquo;</dt>
11189 <dd><p>Set destination height.
11190 </p>
11191 </dd>
11192 <dt> &lsquo;<samp>src_format</samp>&rsquo;</dt>
11193 <dd><p>Set source pixel format (must be expressed as an integer).
11194 </p>
11195 </dd>
11196 <dt> &lsquo;<samp>dst_format</samp>&rsquo;</dt>
11197 <dd><p>Set destination pixel format (must be expressed as an integer).
11198 </p>
11199 </dd>
11200 <dt> &lsquo;<samp>src_range</samp>&rsquo;</dt>
11201 <dd><p>Select source range.
11202 </p>
11203 </dd>
11204 <dt> &lsquo;<samp>dst_range</samp>&rsquo;</dt>
11205 <dd><p>Select destination range.
11206 </p>
11207 </dd>
11208 <dt> &lsquo;<samp>param0, param1</samp>&rsquo;</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.
11212 </p>
11213 </dd>
11214 <dt> &lsquo;<samp>sws_dither</samp>&rsquo;</dt>
11215 <dd><p>Set the dithering algorithm. Accepts one of the following
11216 values. Default value is &lsquo;<samp>auto</samp>&rsquo;.
11217 </p>
11218 <dl compact="compact">
11219 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
11220 <dd><p>automatic choice
11221 </p>
11222 </dd>
11223 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
11224 <dd><p>no dithering
11225 </p>
11226 </dd>
11227 <dt> &lsquo;<samp>bayer</samp>&rsquo;</dt>
11228 <dd><p>bayer dither
11229 </p>
11230 </dd>
11231 <dt> &lsquo;<samp>ed</samp>&rsquo;</dt>
11232 <dd><p>error diffusion dither
11233 </p></dd>
11234 </dl>
11235
11236 </dd>
11237 </dl>
11238
11239 <a name="Filtering-Introduction"></a>
11240 <h1 class="chapter"><a href="ffplay-all.html#toc-Filtering-Introduction">26. Filtering Introduction</a></h1>
11241
11242 <p>Filtering in FFmpeg is enabled through the libavfilter library.
11243 </p>
11244 <p>In libavfilter, a filter can have multiple inputs and multiple
11245 outputs.
11246 To illustrate the sorts of things that are possible, we consider the
11247 following filtergraph.
11248 </p>
11249 <table><tr><td>&nbsp;</td><td><pre class="example">                [main]
11250 input --&gt; split ---------------------&gt; overlay --&gt; output
11251             |                             ^
11252             |[tmp]                  [flip]|
11253             +-----&gt; crop --&gt; vflip -------+
11254 </pre></td></tr></table>
11255
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:
11260 </p>
11261 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -vf &quot;split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2&quot; OUTPUT
11262 </pre></td></tr></table>
11263
11264 <p>The result will be that in output the top half of the video is mirrored
11265 onto the bottom half.
11266 </p>
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>.
11274 </p>
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.
11281 </p>
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
11284 by a colon.
11285 </p>
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
11288 output.
11289 </p>
11290
11291 <a name="graph2dot"></a>
11292 <h1 class="chapter"><a href="ffplay-all.html#toc-graph2dot">27. graph2dot</a></h1>
11293
11294 <p>The &lsquo;<tt>graph2dot</tt>&rsquo; program included in the FFmpeg &lsquo;<tt>tools</tt>&rsquo;
11295 directory can be used to parse a filtergraph description and issue a
11296 corresponding textual representation in the dot language.
11297 </p>
11298 <p>Invoke the command:
11299 </p><table><tr><td>&nbsp;</td><td><pre class="example">graph2dot -h
11300 </pre></td></tr></table>
11301
11302 <p>to see how to use &lsquo;<tt>graph2dot</tt>&rsquo;.
11303 </p>
11304 <p>You can then pass the dot description to the &lsquo;<tt>dot</tt>&rsquo; program (from
11305 the graphviz suite of programs) and obtain a graphical representation
11306 of the filtergraph.
11307 </p>
11308 <p>For example the sequence of commands:
11309 </p><table><tr><td>&nbsp;</td><td><pre class="example">echo <var>GRAPH_DESCRIPTION</var> | \
11310 tools/graph2dot -o graph.tmp &amp;&amp; \
11311 dot -Tpng graph.tmp -o graph.png &amp;&amp; \
11312 display graph.png
11313 </pre></td></tr></table>
11314
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>&nbsp;</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>&nbsp;</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.
11326 </p>
11327
11328 <a name="Filtergraph-description"></a>
11329 <h1 class="chapter"><a href="ffplay-all.html#toc-Filtergraph-description">28. Filtergraph description</a></h1>
11330
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.
11336 </p>
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.
11340 </p>
11341 <p>A filter with no input pads is called a &quot;source&quot;, a filter with no
11342 output pads is called a &quot;sink&quot;.
11343 </p>
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>
11347
11348 <p>A filtergraph can be represented using a textual representation, which is
11349 recognized by the &lsquo;<samp>-filter</samp>&rsquo;/&lsquo;<samp>-vf</samp>&rsquo; and &lsquo;<samp>-filter_complex</samp>&rsquo;
11350 options in <code>ffmpeg</code> and &lsquo;<samp>-vf</samp>&rsquo; in <code>ffplay</code>, and by the
11351 <code>avfilter_graph_parse()</code>/<code>avfilter_graph_parse2()</code> function defined in
11352 &lsquo;<tt>libavfilter/avfilter.h</tt>&rsquo;.
11353 </p>
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 &quot;,&quot;-separated filter descriptions.
11357 </p>
11358 <p>A filtergraph consists of a sequence of filterchains. A sequence of
11359 filterchains is represented by a list of &quot;;&quot;-separated filterchain
11360 descriptions.
11361 </p>
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>]
11364 </p>
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 &quot;=<var>arguments</var>&quot;.
11370 </p>
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:
11373 </p><ul>
11374 <li>
11375 A &rsquo;:&rsquo;-separated list of <var>key=value</var> pairs.
11376
11377 </li><li>
11378 A &rsquo;:&rsquo;-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 &ndash; &lsquo;<samp>type</samp>&rsquo;, &lsquo;<samp>start_frame</samp>&rsquo; and
11381 &lsquo;<samp>nb_frames</samp>&rsquo;. Then the parameter list <var>in:0:30</var> means that the value
11382 <var>in</var> is assigned to the option &lsquo;<samp>type</samp>&rsquo;, <var>0</var> to
11383 &lsquo;<samp>start_frame</samp>&rsquo; and <var>30</var> to &lsquo;<samp>nb_frames</samp>&rsquo;.
11384
11385 </li><li>
11386 A &rsquo;:&rsquo;-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.
11390
11391 </li></ul>
11392
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
11395 &rsquo;|&rsquo;.
11396 </p>
11397 <p>The list of arguments can be quoted using the character &quot;&rsquo;&quot; as initial
11398 and ending mark, and the character &rsquo;\&rsquo; 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 &quot;[]=;,&quot;) is encountered.
11402 </p>
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.
11410 </p>
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
11413 created.
11414 </p>
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>&nbsp;</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 &quot;L1&quot;, the first input pad of overlay is labelled &quot;L2&quot;, and the second
11423 output pad of split is linked to the second input pad of overlay,
11424 which are both unlabelled.
11425 </p>
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.
11429 </p>
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.
11435 </p>
11436 <p>Follows a BNF description for the filtergraph syntax:
11437 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>NAME</var>             ::= sequence of alphanumeric characters and '_'
11438 <var>LINKLABEL</var>        ::= &quot;[&quot; <var>NAME</var> &quot;]&quot;
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> [&quot;=&quot; <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>
11445
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>
11448
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>&nbsp;</td><td><pre class="example">this is a 'string': may contain one, or more, special characters
11455 </pre></td></tr></table>
11456
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>&nbsp;</td><td><pre class="example">text=this is a \'string\'\: may contain one, or more, special characters
11460 </pre></td></tr></table>
11461
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>&nbsp;</td><td><pre class="example">drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
11466 </pre></td></tr></table>
11467
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>&nbsp;</td><td><pre class="example">-vf &quot;drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters&quot;
11474 </pre></td></tr></table>
11475
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>&nbsp;</td><td><pre class="example">Caesar: tu quoque, Brute, fili mi
11479 </pre></td></tr></table>
11480
11481 <p>Can be quoted in the filter arguments as:
11482 </p><table><tr><td>&nbsp;</td><td><pre class="example">text='Caesar: tu quoque, Brute, fili mi'
11483 </pre></td></tr></table>
11484
11485 <p>And finally inserted in a filtergraph like:
11486 </p><table><tr><td>&nbsp;</td><td><pre class="example">drawtext=text=\'Caesar: tu quoque\, Brute\, fili mi\'
11487 </pre></td></tr></table>
11488
11489 <p>See the &ldquo;Quoting and escaping&rdquo; section in the ffmpeg-utils manual
11490 for more information about the escaping and quoting rules adopted by
11491 FFmpeg.
11492 </p>
11493 <a name="Timeline-editing"></a>
11494 <h1 class="chapter"><a href="ffplay-all.html#toc-Timeline-editing">29. Timeline editing</a></h1>
11495
11496 <p>Some filters support a generic &lsquo;<samp>enable</samp>&rsquo; 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.
11501 </p>
11502 <p>The expression accepts the following values:
11503 </p><dl compact="compact">
11504 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
11505 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
11506 </p>
11507 </dd>
11508 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
11509 <dd><p>sequential number of the input frame, starting from 0
11510 </p>
11511 </dd>
11512 <dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
11513 <dd><p>the position in the file of the input frame, NAN if unknown
11514 </p></dd>
11515 </dl>
11516
11517 <p>Additionally, these filters support an &lsquo;<samp>enable</samp>&rsquo; command that can be used
11518 to re-define the expression.
11519 </p>
11520 <p>Like any other filtering option, the &lsquo;<samp>enable</samp>&rsquo; option follows the same
11521 rules.
11522 </p>
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>&nbsp;</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>
11528
11529
11530 <a name="Audio-Filters"></a>
11531 <h1 class="chapter"><a href="ffplay-all.html#toc-Audio-Filters">30. Audio Filters</a></h1>
11532
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
11536 build.
11537 </p>
11538 <p>Below is a description of the currently available audio filters.
11539 </p>
11540 <a name="aconvert"></a>
11541 <h2 class="section"><a href="ffplay-all.html#toc-aconvert">30.1 aconvert</a></h2>
11542
11543 <p>Convert the input audio format to the specified formats.
11544 </p>
11545 <p><em>This filter is deprecated. Use <a href="#aformat">aformat</a> instead.</em>
11546 </p>
11547 <p>The filter accepts a string of the form:
11548 &quot;<var>sample_format</var>:<var>channel_layout</var>&quot;.
11549 </p>
11550 <p><var>sample_format</var> specifies the sample format, and can be a string or the
11551 corresponding numeric value defined in &lsquo;<tt>libavutil/samplefmt.h</tt>&rsquo;. Use &rsquo;p&rsquo;
11552 suffix for a planar sample format.
11553 </p>
11554 <p><var>channel_layout</var> specifies the channel layout, and can be a string
11555 or the corresponding number value defined in &lsquo;<tt>libavutil/channel_layout.h</tt>&rsquo;.
11556 </p>
11557 <p>The special parameter &quot;auto&quot;, signifies that the filter will
11558 automatically select the output format depending on the output filter.
11559 </p>
11560 <a name="Examples-47"></a>
11561 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-47">30.1.1 Examples</a></h3>
11562
11563 <ul>
11564 <li>
11565 Convert input to float, planar, stereo:
11566 <table><tr><td>&nbsp;</td><td><pre class="example">aconvert=fltp:stereo
11567 </pre></td></tr></table>
11568
11569 </li><li>
11570 Convert input to unsigned 8-bit, automatically select out channel layout:
11571 <table><tr><td>&nbsp;</td><td><pre class="example">aconvert=u8:auto
11572 </pre></td></tr></table>
11573 </li></ul>
11574
11575 <a name="adelay"></a>
11576 <h2 class="section"><a href="ffplay-all.html#toc-adelay">30.2 adelay</a></h2>
11577
11578 <p>Delay one or more audio channels.
11579 </p>
11580 <p>Samples in delayed channel are filled with silence.
11581 </p>
11582 <p>The filter accepts the following option:
11583 </p>
11584 <dl compact="compact">
11585 <dt> &lsquo;<samp>delays</samp>&rsquo;</dt>
11586 <dd><p>Set list of delays in milliseconds for each channel separated by &rsquo;|&rsquo;.
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.
11590 </p></dd>
11591 </dl>
11592
11593 <a name="Examples-41"></a>
11594 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-41">30.2.1 Examples</a></h3>
11595
11596 <ul>
11597 <li>
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>&nbsp;</td><td><pre class="example">adelay=1500|0|500
11601 </pre></td></tr></table>
11602 </li></ul>
11603
11604 <a name="aecho"></a>
11605 <h2 class="section"><a href="ffplay-all.html#toc-aecho">30.3 aecho</a></h2>
11606
11607 <p>Apply echoing to the input audio.
11608 </p>
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.
11616 </p>
11617 <p>A description of the accepted parameters follows.
11618 </p>
11619 <dl compact="compact">
11620 <dt> &lsquo;<samp>in_gain</samp>&rsquo;</dt>
11621 <dd><p>Set input gain of reflected signal. Default is <code>0.6</code>.
11622 </p>
11623 </dd>
11624 <dt> &lsquo;<samp>out_gain</samp>&rsquo;</dt>
11625 <dd><p>Set output gain of reflected signal. Default is <code>0.3</code>.
11626 </p>
11627 </dd>
11628 <dt> &lsquo;<samp>delays</samp>&rsquo;</dt>
11629 <dd><p>Set list of time intervals in milliseconds between original signal and reflections
11630 separated by &rsquo;|&rsquo;. Allowed range for each <code>delay</code> is <code>(0 - 90000.0]</code>.
11631 Default is <code>1000</code>.
11632 </p>
11633 </dd>
11634 <dt> &lsquo;<samp>decays</samp>&rsquo;</dt>
11635 <dd><p>Set list of loudnesses of reflected signals separated by &rsquo;|&rsquo;.
11636 Allowed range for each <code>decay</code> is <code>(0 - 1.0]</code>.
11637 Default is <code>0.5</code>.
11638 </p></dd>
11639 </dl>
11640
11641 <a name="Examples-19"></a>
11642 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-19">30.3.1 Examples</a></h3>
11643
11644 <ul>
11645 <li>
11646 Make it sound as if there are twice as many instruments as are actually playing:
11647 <table><tr><td>&nbsp;</td><td><pre class="example">aecho=0.8:0.88:60:0.4
11648 </pre></td></tr></table>
11649
11650 </li><li>
11651 If delay is very short, then it sound like a (metallic) robot playing music:
11652 <table><tr><td>&nbsp;</td><td><pre class="example">aecho=0.8:0.88:6:0.4
11653 </pre></td></tr></table>
11654
11655 </li><li>
11656 A longer delay will sound like an open air concert in the mountains:
11657 <table><tr><td>&nbsp;</td><td><pre class="example">aecho=0.8:0.9:1000:0.3
11658 </pre></td></tr></table>
11659
11660 </li><li>
11661 Same as above but with one more mountain:
11662 <table><tr><td>&nbsp;</td><td><pre class="example">aecho=0.8:0.9:1000|1800:0.3|0.25
11663 </pre></td></tr></table>
11664 </li></ul>
11665
11666 <a name="aeval"></a>
11667 <h2 class="section"><a href="ffplay-all.html#toc-aeval">30.4 aeval</a></h2>
11668
11669 <p>Modify an audio signal according to the specified expressions.
11670 </p>
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.
11673 </p>
11674 <p>This filter accepts the following options:
11675 </p>
11676 <dl compact="compact">
11677 <dt> &lsquo;<samp>exprs</samp>&rsquo;</dt>
11678 <dd><p>Set the &rsquo;|&rsquo;-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
11681 output channels.
11682 </p>
11683 </dd>
11684 <dt> &lsquo;<samp>channel_layout, c</samp>&rsquo;</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 &lsquo;<samp>same</samp>&rsquo;, it will
11687 use by default the same input channel layout.
11688 </p></dd>
11689 </dl>
11690
11691 <p>Each expression in <var>exprs</var> can contain the following constants and functions:
11692 </p>
11693 <dl compact="compact">
11694 <dt> &lsquo;<samp>ch</samp>&rsquo;</dt>
11695 <dd><p>channel number of the current expression
11696 </p>
11697 </dd>
11698 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
11699 <dd><p>number of the evaluated sample, starting from 0
11700 </p>
11701 </dd>
11702 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
11703 <dd><p>sample rate
11704 </p>
11705 </dd>
11706 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
11707 <dd><p>time of the evaluated sample expressed in seconds
11708 </p>
11709 </dd>
11710 <dt> &lsquo;<samp>nb_in_channels</samp>&rsquo;</dt>
11711 <dt> &lsquo;<samp>nb_out_channels</samp>&rsquo;</dt>
11712 <dd><p>input and output number of channels
11713 </p>
11714 </dd>
11715 <dt> &lsquo;<samp>val(CH)</samp>&rsquo;</dt>
11716 <dd><p>the value of input channel with number <var>CH</var>
11717 </p></dd>
11718 </dl>
11719
11720 <p>Note: this filter is slow. For faster processing you should use a
11721 dedicated filter.
11722 </p>
11723 <a name="Examples-34"></a>
11724 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-34">30.4.1 Examples</a></h3>
11725
11726 <ul>
11727 <li>
11728 Half volume:
11729 <table><tr><td>&nbsp;</td><td><pre class="example">aeval=val(ch)/2:c=same
11730 </pre></td></tr></table>
11731
11732 </li><li>
11733 Invert phase of the second channel:
11734 <table><tr><td>&nbsp;</td><td><pre class="example">eval=val(0)|-val(1)
11735 </pre></td></tr></table>
11736 </li></ul>
11737
11738 <a name="afade"></a>
11739 <h2 class="section"><a href="ffplay-all.html#toc-afade">30.5 afade</a></h2>
11740
11741 <p>Apply fade-in/out effect to input audio.
11742 </p>
11743 <p>A description of the accepted parameters follows.
11744 </p>
11745 <dl compact="compact">
11746 <dt> &lsquo;<samp>type, t</samp>&rsquo;</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>.
11749 </p>
11750 </dd>
11751 <dt> &lsquo;<samp>start_sample, ss</samp>&rsquo;</dt>
11752 <dd><p>Specify the number of the start sample for starting to apply the fade
11753 effect. Default is 0.
11754 </p>
11755 </dd>
11756 <dt> &lsquo;<samp>nb_samples, ns</samp>&rsquo;</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.
11761 </p>
11762 </dd>
11763 <dt> &lsquo;<samp>start_time, st</samp>&rsquo;</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>&nbsp;</td><td><pre class="example">[-]HH[:MM[:SS[.m...]]]
11767 [-]S+[.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.
11771 </p>
11772 </dd>
11773 <dt> &lsquo;<samp>duration, d</samp>&rsquo;</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>&nbsp;</td><td><pre class="example">[-]HH[:MM[:SS[.m...]]]
11777 [-]S+[.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.
11784 </p>
11785 </dd>
11786 <dt> &lsquo;<samp>curve</samp>&rsquo;</dt>
11787 <dd><p>Set curve for fade transition.
11788 </p>
11789 <p>It accepts the following values:
11790 </p><dl compact="compact">
11791 <dt> &lsquo;<samp>tri</samp>&rsquo;</dt>
11792 <dd><p>select triangular, linear slope (default)
11793 </p></dd>
11794 <dt> &lsquo;<samp>qsin</samp>&rsquo;</dt>
11795 <dd><p>select quarter of sine wave
11796 </p></dd>
11797 <dt> &lsquo;<samp>hsin</samp>&rsquo;</dt>
11798 <dd><p>select half of sine wave
11799 </p></dd>
11800 <dt> &lsquo;<samp>esin</samp>&rsquo;</dt>
11801 <dd><p>select exponential sine wave
11802 </p></dd>
11803 <dt> &lsquo;<samp>log</samp>&rsquo;</dt>
11804 <dd><p>select logarithmic
11805 </p></dd>
11806 <dt> &lsquo;<samp>par</samp>&rsquo;</dt>
11807 <dd><p>select inverted parabola
11808 </p></dd>
11809 <dt> &lsquo;<samp>qua</samp>&rsquo;</dt>
11810 <dd><p>select quadratic
11811 </p></dd>
11812 <dt> &lsquo;<samp>cub</samp>&rsquo;</dt>
11813 <dd><p>select cubic
11814 </p></dd>
11815 <dt> &lsquo;<samp>squ</samp>&rsquo;</dt>
11816 <dd><p>select square root
11817 </p></dd>
11818 <dt> &lsquo;<samp>cbr</samp>&rsquo;</dt>
11819 <dd><p>select cubic root
11820 </p></dd>
11821 </dl>
11822 </dd>
11823 </dl>
11824
11825 <a name="Examples-24"></a>
11826 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-24">30.5.1 Examples</a></h3>
11827
11828 <ul>
11829 <li>
11830 Fade in first 15 seconds of audio:
11831 <table><tr><td>&nbsp;</td><td><pre class="example">afade=t=in:ss=0:d=15
11832 </pre></td></tr></table>
11833
11834 </li><li>
11835 Fade out last 25 seconds of a 900 seconds audio:
11836 <table><tr><td>&nbsp;</td><td><pre class="example">afade=t=out:st=875:d=25
11837 </pre></td></tr></table>
11838 </li></ul>
11839
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>
11843
11844 <p>Set output format constraints for the input audio. The framework will
11845 negotiate the most appropriate format to minimize conversions.
11846 </p>
11847 <p>The filter accepts the following named parameters:
11848 </p><dl compact="compact">
11849 <dt> &lsquo;<samp>sample_fmts</samp>&rsquo;</dt>
11850 <dd><p>A &rsquo;|&rsquo;-separated list of requested sample formats.
11851 </p>
11852 </dd>
11853 <dt> &lsquo;<samp>sample_rates</samp>&rsquo;</dt>
11854 <dd><p>A &rsquo;|&rsquo;-separated list of requested sample rates.
11855 </p>
11856 </dd>
11857 <dt> &lsquo;<samp>channel_layouts</samp>&rsquo;</dt>
11858 <dd><p>A &rsquo;|&rsquo;-separated list of requested channel layouts.
11859 </p>
11860 <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)channel layout syntax</a>
11861 for the required syntax.
11862 </p></dd>
11863 </dl>
11864
11865 <p>If a parameter is omitted, all values are allowed.
11866 </p>
11867 <p>For example to force the output to either unsigned 8-bit or signed 16-bit stereo:
11868 </p><table><tr><td>&nbsp;</td><td><pre class="example">aformat=sample_fmts=u8|s16:channel_layouts=stereo
11869 </pre></td></tr></table>
11870
11871 <a name="allpass"></a>
11872 <h2 class="section"><a href="ffplay-all.html#toc-allpass">30.7 allpass</a></h2>
11873
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&rsquo;s frequency to phase relationship
11877 without changing its frequency to amplitude relationship.
11878 </p>
11879 <p>The filter accepts the following options:
11880 </p>
11881 <dl compact="compact">
11882 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
11883 <dd><p>Set frequency in Hz.
11884 </p>
11885 </dd>
11886 <dt> &lsquo;<samp>width_type</samp>&rsquo;</dt>
11887 <dd><p>Set method to specify band-width of filter.
11888 </p><dl compact="compact">
11889 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
11890 <dd><p>Hz
11891 </p></dd>
11892 <dt> &lsquo;<samp>q</samp>&rsquo;</dt>
11893 <dd><p>Q-Factor
11894 </p></dd>
11895 <dt> &lsquo;<samp>o</samp>&rsquo;</dt>
11896 <dd><p>octave
11897 </p></dd>
11898 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
11899 <dd><p>slope
11900 </p></dd>
11901 </dl>
11902
11903 </dd>
11904 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
11905 <dd><p>Specify the band-width of a filter in width_type units.
11906 </p></dd>
11907 </dl>
11908
11909 <a name="amerge"></a>
11910 <h2 class="section"><a href="ffplay-all.html#toc-amerge">30.8 amerge</a></h2>
11911
11912 <p>Merge two or more audio streams into a single multi-channel stream.
11913 </p>
11914 <p>The filter accepts the following options:
11915 </p>
11916 <dl compact="compact">
11917 <dt> &lsquo;<samp>inputs</samp>&rsquo;</dt>
11918 <dd><p>Set the number of inputs. Default is 2.
11919 </p>
11920 </dd>
11921 </dl>
11922
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
11929 channels.
11930 </p>
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).
11935 </p>
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.
11939 </p>
11940 <p>All inputs must have the same sample rate, and format.
11941 </p>
11942 <p>If inputs do not have the same duration, the output will stop with the
11943 shortest.
11944 </p>
11945 <a name="Examples-62"></a>
11946 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-62">30.8.1 Examples</a></h3>
11947
11948 <ul>
11949 <li>
11950 Merge two mono files into a stereo stream:
11951 <table><tr><td>&nbsp;</td><td><pre class="example">amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
11952 </pre></td></tr></table>
11953
11954 </li><li>
11955 Multiple merges assuming 1 video stream and 6 audio streams in &lsquo;<tt>input.mkv</tt>&rsquo;:
11956 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i input.mkv -filter_complex &quot;[0:1][0:2][0:3][0:4][0:5][0:6] amerge=inputs=6&quot; -c:a pcm_s16le output.mkv
11957 </pre></td></tr></table>
11958 </li></ul>
11959
11960 <a name="amix"></a>
11961 <h2 class="section"><a href="ffplay-all.html#toc-amix">30.9 amix</a></h2>
11962
11963 <p>Mixes multiple audio inputs into a single output.
11964 </p>
11965 <p>For example
11966 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
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.
11970 </p>
11971 <p>The filter accepts the following named parameters:
11972 </p><dl compact="compact">
11973 <dt> &lsquo;<samp>inputs</samp>&rsquo;</dt>
11974 <dd><p>Number of inputs. If unspecified, it defaults to 2.
11975 </p>
11976 </dd>
11977 <dt> &lsquo;<samp>duration</samp>&rsquo;</dt>
11978 <dd><p>How to determine the end-of-stream.
11979 </p><dl compact="compact">
11980 <dt> &lsquo;<samp>longest</samp>&rsquo;</dt>
11981 <dd><p>Duration of longest input. (default)
11982 </p>
11983 </dd>
11984 <dt> &lsquo;<samp>shortest</samp>&rsquo;</dt>
11985 <dd><p>Duration of shortest input.
11986 </p>
11987 </dd>
11988 <dt> &lsquo;<samp>first</samp>&rsquo;</dt>
11989 <dd><p>Duration of first input.
11990 </p>
11991 </dd>
11992 </dl>
11993
11994 </dd>
11995 <dt> &lsquo;<samp>dropout_transition</samp>&rsquo;</dt>
11996 <dd><p>Transition time, in seconds, for volume renormalization when an input
11997 stream ends. The default value is 2 seconds.
11998 </p>
11999 </dd>
12000 </dl>
12001
12002 <a name="anull"></a>
12003 <h2 class="section"><a href="ffplay-all.html#toc-anull">30.10 anull</a></h2>
12004
12005 <p>Pass the audio source unchanged to the output.
12006 </p>
12007 <a name="apad"></a>
12008 <h2 class="section"><a href="ffplay-all.html#toc-apad">30.11 apad</a></h2>
12009
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.
12012 </p>
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.
12016 </p>
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.
12019 </p>
12020 <p>A description of the accepted parameters follows.
12021 </p>
12022 <dl compact="compact">
12023 <dt> &lsquo;<samp>in_gain</samp>&rsquo;</dt>
12024 <dd><p>Set input gain. Default is 0.4.
12025 </p>
12026 </dd>
12027 <dt> &lsquo;<samp>out_gain</samp>&rsquo;</dt>
12028 <dd><p>Set output gain. Default is 0.74
12029 </p>
12030 </dd>
12031 <dt> &lsquo;<samp>delay</samp>&rsquo;</dt>
12032 <dd><p>Set delay in milliseconds. Default is 3.0.
12033 </p>
12034 </dd>
12035 <dt> &lsquo;<samp>decay</samp>&rsquo;</dt>
12036 <dd><p>Set decay. Default is 0.4.
12037 </p>
12038 </dd>
12039 <dt> &lsquo;<samp>speed</samp>&rsquo;</dt>
12040 <dd><p>Set modulation speed in Hz. Default is 0.5.
12041 </p>
12042 </dd>
12043 <dt> &lsquo;<samp>type</samp>&rsquo;</dt>
12044 <dd><p>Set modulation type. Default is triangular.
12045 </p>
12046 <p>It accepts the following values:
12047 </p><dl compact="compact">
12048 <dt> &lsquo;<samp>triangular, t</samp>&rsquo;</dt>
12049 <dt> &lsquo;<samp>sinusoidal, s</samp>&rsquo;</dt>
12050 </dl>
12051 </dd>
12052 </dl>
12053
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>
12057
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.
12061 </p>
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.
12065 </p>
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 &quot;:&quot;. See the
12070 ffmpeg-resampler manual for the complete list of supported options.
12071 </p>
12072 <a name="Examples-22"></a>
12073 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-22">30.13.1 Examples</a></h3>
12074
12075 <ul>
12076 <li>
12077 Resample the input audio to 44100Hz:
12078 <table><tr><td>&nbsp;</td><td><pre class="example">aresample=44100
12079 </pre></td></tr></table>
12080
12081 </li><li>
12082 Stretch/squeeze samples to the given timestamps, with a maximum of 1000
12083 samples per second compensation:
12084 <table><tr><td>&nbsp;</td><td><pre class="example">aresample=async=1000
12085 </pre></td></tr></table>
12086 </li></ul>
12087
12088 <a name="asetnsamples"></a>
12089 <h2 class="section"><a href="ffplay-all.html#toc-asetnsamples">30.14 asetnsamples</a></h2>
12090
12091 <p>Set the number of samples per each output audio frame.
12092 </p>
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
12095 signal its end.
12096 </p>
12097 <p>The filter accepts the following options:
12098 </p>
12099 <dl compact="compact">
12100 <dt> &lsquo;<samp>nb_out_samples, n</samp>&rsquo;</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.
12104 </p>
12105 </dd>
12106 <dt> &lsquo;<samp>pad, p</samp>&rsquo;</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.
12110 </p></dd>
12111 </dl>
12112
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>&nbsp;</td><td><pre class="example">asetnsamples=n=1234:p=0
12116 </pre></td></tr></table>
12117
12118 <a name="asetrate"></a>
12119 <h2 class="section"><a href="ffplay-all.html#toc-asetrate">30.15 asetrate</a></h2>
12120
12121 <p>Set the sample rate without altering the PCM data.
12122 This will result in a change of speed and pitch.
12123 </p>
12124 <p>The filter accepts the following options:
12125 </p>
12126 <dl compact="compact">
12127 <dt> &lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
12128 <dd><p>Set the output sample rate. Default is 44100 Hz.
12129 </p></dd>
12130 </dl>
12131
12132 <a name="ashowinfo"></a>
12133 <h2 class="section"><a href="ffplay-all.html#toc-ashowinfo">30.16 ashowinfo</a></h2>
12134
12135 <p>Show a line containing various information for each input audio frame.
12136 The input audio is not modified.
12137 </p>
12138 <p>The shown line contains a sequence of key/value pairs of the form
12139 <var>key</var>:<var>value</var>.
12140 </p>
12141 <p>A description of each shown parameter follows:
12142 </p>
12143 <dl compact="compact">
12144 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
12145 <dd><p>sequential number of the input frame, starting from 0
12146 </p>
12147 </dd>
12148 <dt> &lsquo;<samp>pts</samp>&rsquo;</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>.
12151 </p>
12152 </dd>
12153 <dt> &lsquo;<samp>pts_time</samp>&rsquo;</dt>
12154 <dd><p>presentation timestamp of the input frame in seconds
12155 </p>
12156 </dd>
12157 <dt> &lsquo;<samp>pos</samp>&rsquo;</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)
12160 </p>
12161 </dd>
12162 <dt> &lsquo;<samp>fmt</samp>&rsquo;</dt>
12163 <dd><p>sample format
12164 </p>
12165 </dd>
12166 <dt> &lsquo;<samp>chlayout</samp>&rsquo;</dt>
12167 <dd><p>channel layout
12168 </p>
12169 </dd>
12170 <dt> &lsquo;<samp>rate</samp>&rsquo;</dt>
12171 <dd><p>sample rate for the audio frame
12172 </p>
12173 </dd>
12174 <dt> &lsquo;<samp>nb_samples</samp>&rsquo;</dt>
12175 <dd><p>number of samples (per channel) in the frame
12176 </p>
12177 </dd>
12178 <dt> &lsquo;<samp>checksum</samp>&rsquo;</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.
12181 </p>
12182 </dd>
12183 <dt> &lsquo;<samp>plane_checksums</samp>&rsquo;</dt>
12184 <dd><p>A list of Adler-32 checksums for each data plane.
12185 </p></dd>
12186 </dl>
12187
12188 <a name="astats"></a>
12189 <h2 class="section"><a href="ffplay-all.html#toc-astats">30.17 astats</a></h2>
12190
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.
12194 </p>
12195 <p>The filter accepts the following option:
12196 </p><dl compact="compact">
12197 <dt> &lsquo;<samp>length</samp>&rsquo;</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>.
12200 </p></dd>
12201 </dl>
12202
12203 <p>A description of each shown parameter follows:
12204 </p>
12205 <dl compact="compact">
12206 <dt> &lsquo;<samp>DC offset</samp>&rsquo;</dt>
12207 <dd><p>Mean amplitude displacement from zero.
12208 </p>
12209 </dd>
12210 <dt> &lsquo;<samp>Min level</samp>&rsquo;</dt>
12211 <dd><p>Minimal sample level.
12212 </p>
12213 </dd>
12214 <dt> &lsquo;<samp>Max level</samp>&rsquo;</dt>
12215 <dd><p>Maximal sample level.
12216 </p>
12217 </dd>
12218 <dt> &lsquo;<samp>Peak level dB</samp>&rsquo;</dt>
12219 <dt> &lsquo;<samp>RMS level dB</samp>&rsquo;</dt>
12220 <dd><p>Standard peak and RMS level measured in dBFS.
12221 </p>
12222 </dd>
12223 <dt> &lsquo;<samp>RMS peak dB</samp>&rsquo;</dt>
12224 <dt> &lsquo;<samp>RMS trough dB</samp>&rsquo;</dt>
12225 <dd><p>Peak and trough values for RMS level measured over a short window.
12226 </p>
12227 </dd>
12228 <dt> &lsquo;<samp>Crest factor</samp>&rsquo;</dt>
12229 <dd><p>Standard ratio of peak to RMS level (note: not in dB).
12230 </p>
12231 </dd>
12232 <dt> &lsquo;<samp>Flat factor</samp>&rsquo;</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>).
12235 </p>
12236 </dd>
12237 <dt> &lsquo;<samp>Peak count</samp>&rsquo;</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>.
12240 </p></dd>
12241 </dl>
12242
12243 <a name="astreamsync"></a>
12244 <h2 class="section"><a href="ffplay-all.html#toc-astreamsync">30.18 astreamsync</a></h2>
12245
12246 <p>Forward two audio streams and control the order the buffers are forwarded.
12247 </p>
12248 <p>The filter accepts the following options:
12249 </p>
12250 <dl compact="compact">
12251 <dt> &lsquo;<samp>expr, e</samp>&rsquo;</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:
12256 </p>
12257 <dl compact="compact">
12258 <dt> <var>b1 b2</var></dt>
12259 <dd><p>number of buffers forwarded so far on each stream
12260 </p></dd>
12261 <dt> <var>s1 s2</var></dt>
12262 <dd><p>number of samples forwarded so far on each stream
12263 </p></dd>
12264 <dt> <var>t1 t2</var></dt>
12265 <dd><p>current timestamp of each stream
12266 </p></dd>
12267 </dl>
12268
12269 <p>The default value is <code>t1-t2</code>, which means to always forward the stream
12270 that has a smaller timestamp.
12271 </p></dd>
12272 </dl>
12273
12274 <a name="Examples-46"></a>
12275 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-46">30.18.1 Examples</a></h3>
12276
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>&nbsp;</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] ;
12281 [a2] [b2] amerge
12282 </pre></td></tr></table>
12283
12284 <a name="asyncts"></a>
12285 <h2 class="section"><a href="ffplay-all.html#toc-asyncts">30.19 asyncts</a></h2>
12286
12287 <p>Synchronize audio data with timestamps by squeezing/stretching it and/or
12288 dropping samples/adding silence when needed.
12289 </p>
12290 <p>This filter is not built by default, please use <a href="#aresample">aresample</a> to do squeezing/stretching.
12291 </p>
12292 <p>The filter accepts the following named parameters:
12293 </p><dl compact="compact">
12294 <dt> &lsquo;<samp>compensate</samp>&rsquo;</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.
12297 </p>
12298 </dd>
12299 <dt> &lsquo;<samp>min_delta</samp>&rsquo;</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.
12303 </p>
12304 </dd>
12305 <dt> &lsquo;<samp>max_comp</samp>&rsquo;</dt>
12306 <dd><p>Maximum compensation in samples per second. Relevant only with compensate=1.
12307 Default value 500.
12308 </p>
12309 </dd>
12310 <dt> &lsquo;<samp>first_pts</samp>&rsquo;</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&rsquo;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.
12317 </p>
12318 </dd>
12319 </dl>
12320
12321 <a name="atempo"></a>
12322 <h2 class="section"><a href="ffplay-all.html#toc-atempo">30.20 atempo</a></h2>
12323
12324 <p>Adjust audio tempo.
12325 </p>
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.
12329 </p>
12330 <a name="Examples-60"></a>
12331 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-60">30.20.1 Examples</a></h3>
12332
12333 <ul>
12334 <li>
12335 Slow down audio to 80% tempo:
12336 <table><tr><td>&nbsp;</td><td><pre class="example">atempo=0.8
12337 </pre></td></tr></table>
12338
12339 </li><li>
12340 To speed up audio to 125% tempo:
12341 <table><tr><td>&nbsp;</td><td><pre class="example">atempo=1.25
12342 </pre></td></tr></table>
12343 </li></ul>
12344
12345 <a name="atrim"></a>
12346 <h2 class="section"><a href="ffplay-all.html#toc-atrim">30.21 atrim</a></h2>
12347
12348 <p>Trim the input so that the output contains one continuous subpart of the input.
12349 </p>
12350 <p>This filter accepts the following options:
12351 </p><dl compact="compact">
12352 <dt> &lsquo;<samp>start</samp>&rsquo;</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.
12355 </p>
12356 </dd>
12357 <dt> &lsquo;<samp>end</samp>&rsquo;</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.
12361 </p>
12362 </dd>
12363 <dt> &lsquo;<samp>start_pts</samp>&rsquo;</dt>
12364 <dd><p>Same as <var>start</var>, except this option sets the start timestamp in samples
12365 instead of seconds.
12366 </p>
12367 </dd>
12368 <dt> &lsquo;<samp>end_pts</samp>&rsquo;</dt>
12369 <dd><p>Same as <var>end</var>, except this option sets the end timestamp in samples instead
12370 of seconds.
12371 </p>
12372 </dd>
12373 <dt> &lsquo;<samp>duration</samp>&rsquo;</dt>
12374 <dd><p>Specify maximum duration of the output.
12375 </p>
12376 </dd>
12377 <dt> &lsquo;<samp>start_sample</samp>&rsquo;</dt>
12378 <dd><p>Number of the first sample that should be passed to output.
12379 </p>
12380 </dd>
12381 <dt> &lsquo;<samp>end_sample</samp>&rsquo;</dt>
12382 <dd><p>Number of the first sample that should be dropped.
12383 </p></dd>
12384 </dl>
12385
12386 <p>&lsquo;<samp>start</samp>&rsquo;, &lsquo;<samp>end</samp>&rsquo;, &lsquo;<samp>duration</samp>&rsquo; are expressed as time
12387 duration specifications, check the &quot;Time duration&quot; section in the
12388 ffmpeg-utils manual.
12389 </p>
12390 <p>Note that the first two sets of the start/end options and the &lsquo;<samp>duration</samp>&rsquo;
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
12396 atrim filter.
12397 </p>
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
12401 filters.
12402 </p>
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.
12405 </p>
12406 <p>Examples:
12407 </p><ul>
12408 <li>
12409 drop everything except the second minute of input
12410 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -af atrim=60:120
12411 </pre></td></tr></table>
12412
12413 </li><li>
12414 keep only the first 1000 samples
12415 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -af atrim=end_sample=1000
12416 </pre></td></tr></table>
12417
12418 </li></ul>
12419
12420 <a name="bandpass"></a>
12421 <h2 class="section"><a href="ffplay-all.html#toc-bandpass">30.22 bandpass</a></h2>
12422
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).
12428 </p>
12429 <p>The filter accepts the following options:
12430 </p>
12431 <dl compact="compact">
12432 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
12433 <dd><p>Set the filter&rsquo;s central frequency. Default is <code>3000</code>.
12434 </p>
12435 </dd>
12436 <dt> &lsquo;<samp>csg</samp>&rsquo;</dt>
12437 <dd><p>Constant skirt gain if set to 1. Defaults to 0.
12438 </p>
12439 </dd>
12440 <dt> &lsquo;<samp>width_type</samp>&rsquo;</dt>
12441 <dd><p>Set method to specify band-width of filter.
12442 </p><dl compact="compact">
12443 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
12444 <dd><p>Hz
12445 </p></dd>
12446 <dt> &lsquo;<samp>q</samp>&rsquo;</dt>
12447 <dd><p>Q-Factor
12448 </p></dd>
12449 <dt> &lsquo;<samp>o</samp>&rsquo;</dt>
12450 <dd><p>octave
12451 </p></dd>
12452 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
12453 <dd><p>slope
12454 </p></dd>
12455 </dl>
12456
12457 </dd>
12458 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
12459 <dd><p>Specify the band-width of a filter in width_type units.
12460 </p></dd>
12461 </dl>
12462
12463 <a name="bandreject"></a>
12464 <h2 class="section"><a href="ffplay-all.html#toc-bandreject">30.23 bandreject</a></h2>
12465
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).
12469 </p>
12470 <p>The filter accepts the following options:
12471 </p>
12472 <dl compact="compact">
12473 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
12474 <dd><p>Set the filter&rsquo;s central frequency. Default is <code>3000</code>.
12475 </p>
12476 </dd>
12477 <dt> &lsquo;<samp>width_type</samp>&rsquo;</dt>
12478 <dd><p>Set method to specify band-width of filter.
12479 </p><dl compact="compact">
12480 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
12481 <dd><p>Hz
12482 </p></dd>
12483 <dt> &lsquo;<samp>q</samp>&rsquo;</dt>
12484 <dd><p>Q-Factor
12485 </p></dd>
12486 <dt> &lsquo;<samp>o</samp>&rsquo;</dt>
12487 <dd><p>octave
12488 </p></dd>
12489 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
12490 <dd><p>slope
12491 </p></dd>
12492 </dl>
12493
12494 </dd>
12495 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
12496 <dd><p>Specify the band-width of a filter in width_type units.
12497 </p></dd>
12498 </dl>
12499
12500 <a name="bass"></a>
12501 <h2 class="section"><a href="ffplay-all.html#toc-bass">30.24 bass</a></h2>
12502
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&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
12506 </p>
12507 <p>The filter accepts the following options:
12508 </p>
12509 <dl compact="compact">
12510 <dt> &lsquo;<samp>gain, g</samp>&rsquo;</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.
12514 </p>
12515 </dd>
12516 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
12517 <dd><p>Set the filter&rsquo;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.
12520 </p>
12521 </dd>
12522 <dt> &lsquo;<samp>width_type</samp>&rsquo;</dt>
12523 <dd><p>Set method to specify band-width of filter.
12524 </p><dl compact="compact">
12525 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
12526 <dd><p>Hz
12527 </p></dd>
12528 <dt> &lsquo;<samp>q</samp>&rsquo;</dt>
12529 <dd><p>Q-Factor
12530 </p></dd>
12531 <dt> &lsquo;<samp>o</samp>&rsquo;</dt>
12532 <dd><p>octave
12533 </p></dd>
12534 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
12535 <dd><p>slope
12536 </p></dd>
12537 </dl>
12538
12539 </dd>
12540 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
12541 <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
12542 </p></dd>
12543 </dl>
12544
12545 <a name="biquad"></a>
12546 <h2 class="section"><a href="ffplay-all.html#toc-biquad">30.25 biquad</a></h2>
12547
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.
12551 </p>
12552 <a name="channelmap"></a>
12553 <h2 class="section"><a href="ffplay-all.html#toc-channelmap">30.26 channelmap</a></h2>
12554
12555 <p>Remap input channels to new locations.
12556 </p>
12557 <p>This filter accepts the following named parameters:
12558 </p><dl compact="compact">
12559 <dt> &lsquo;<samp>channel_layout</samp>&rsquo;</dt>
12560 <dd><p>Channel layout of the output stream.
12561 </p>
12562 </dd>
12563 <dt> &lsquo;<samp>map</samp>&rsquo;</dt>
12564 <dd><p>Map channels from input to output. The argument is a &rsquo;|&rsquo;-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.
12571 </p></dd>
12572 </dl>
12573
12574 <p>If no mapping is present, the filter will implicitly map input channels to
12575 output channels preserving index.
12576 </p>
12577 <p>For example, assuming a 5.1+downmix input MOV file
12578 </p><table><tr><td>&nbsp;</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
12581 the input.
12582 </p>
12583 <p>To fix a 5.1 WAV improperly encoded in AAC&rsquo;s native channel order
12584 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:channel_layout=5.1' out.wav
12585 </pre></td></tr></table>
12586
12587 <a name="channelsplit"></a>
12588 <h2 class="section"><a href="ffplay-all.html#toc-channelsplit">30.27 channelsplit</a></h2>
12589
12590 <p>Split each channel in input audio stream into a separate output stream.
12591 </p>
12592 <p>This filter accepts the following named parameters:
12593 </p><dl compact="compact">
12594 <dt> &lsquo;<samp>channel_layout</samp>&rsquo;</dt>
12595 <dd><p>Channel layout of the input stream. Default is &quot;stereo&quot;.
12596 </p></dd>
12597 </dl>
12598
12599 <p>For example, assuming a stereo input MP3 file
12600 </p><table><tr><td>&nbsp;</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.
12604 </p>
12605 <p>To split a 5.1 WAV file into per-channel files
12606 </p><table><tr><td>&nbsp;</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]'
12610 side_right.wav
12611 </pre></td></tr></table>
12612
12613 <a name="compand"></a>
12614 <h2 class="section"><a href="ffplay-all.html#toc-compand">30.28 compand</a></h2>
12615
12616 <p>Compress or expand audio dynamic range.
12617 </p>
12618 <p>A description of the accepted options follows.
12619 </p>
12620 <dl compact="compact">
12621 <dt> &lsquo;<samp>attacks</samp>&rsquo;</dt>
12622 <dt> &lsquo;<samp>decays</samp>&rsquo;</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 &lsquo;<samp>attacks</samp>&rsquo; refers to increase of volume and &lsquo;<samp>decays</samp>&rsquo; 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>
12631 seconds.
12632 </p>
12633 </dd>
12634 <dt> &lsquo;<samp>points</samp>&rsquo;</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>.
12639 </p>
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>.
12644 </p>
12645 </dd>
12646 <dt> &lsquo;<samp>soft-knee</samp>&rsquo;</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>.
12649 </p>
12650 </dd>
12651 <dt> &lsquo;<samp>gain</samp>&rsquo;</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>.
12655 </p>
12656 </dd>
12657 <dt> &lsquo;<samp>volume</samp>&rsquo;</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>.
12663 </p>
12664 </dd>
12665 <dt> &lsquo;<samp>delay</samp>&rsquo;</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
12670 reactive mode.
12671 </p></dd>
12672 </dl>
12673
12674 <a name="Examples-15"></a>
12675 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-15">30.28.1 Examples</a></h3>
12676 <ul>
12677 <li>
12678 Make music with both quiet and loud passages suitable for listening
12679 in a noisy environment:
12680 <table><tr><td>&nbsp;</td><td><pre class="example">compand=.3 .3:1 1:-90/-60 -60/-40 -40/-30 -20/-20:6:0:-90:0.2
12681 </pre></td></tr></table>
12682
12683 </li><li>
12684 Noise-gate for when the noise is at a lower level than the signal:
12685 <table><tr><td>&nbsp;</td><td><pre class="example">compand=.1 .1:.2 .2:-900/-900 -50.1/-900 -50/-50:.01:0:-90:.1
12686 </pre></td></tr></table>
12687
12688 </li><li>
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>&nbsp;</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>
12693 </li></ul>
12694
12695 <a name="earwax"></a>
12696 <h2 class="section"><a href="ffplay-all.html#toc-earwax">30.29 earwax</a></h2>
12697
12698 <p>Make audio easier to listen to on headphones.
12699 </p>
12700 <p>This filter adds &lsquo;cues&rsquo; 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).
12704 </p>
12705 <p>Ported from SoX.
12706 </p>
12707 <a name="equalizer"></a>
12708 <h2 class="section"><a href="ffplay-all.html#toc-equalizer">30.30 equalizer</a></h2>
12709
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.
12714 </p>
12715 <p>In order to produce complex equalisation curves, this filter can
12716 be given several times, each with a different central frequency.
12717 </p>
12718 <p>The filter accepts the following options:
12719 </p>
12720 <dl compact="compact">
12721 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
12722 <dd><p>Set the filter&rsquo;s central frequency in Hz.
12723 </p>
12724 </dd>
12725 <dt> &lsquo;<samp>width_type</samp>&rsquo;</dt>
12726 <dd><p>Set method to specify band-width of filter.
12727 </p><dl compact="compact">
12728 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
12729 <dd><p>Hz
12730 </p></dd>
12731 <dt> &lsquo;<samp>q</samp>&rsquo;</dt>
12732 <dd><p>Q-Factor
12733 </p></dd>
12734 <dt> &lsquo;<samp>o</samp>&rsquo;</dt>
12735 <dd><p>octave
12736 </p></dd>
12737 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
12738 <dd><p>slope
12739 </p></dd>
12740 </dl>
12741
12742 </dd>
12743 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
12744 <dd><p>Specify the band-width of a filter in width_type units.
12745 </p>
12746 </dd>
12747 <dt> &lsquo;<samp>gain, g</samp>&rsquo;</dt>
12748 <dd><p>Set the required gain or attenuation in dB.
12749 Beware of clipping when using a positive gain.
12750 </p></dd>
12751 </dl>
12752
12753 <a name="highpass"></a>
12754 <h2 class="section"><a href="ffplay-all.html#toc-highpass">30.31 highpass</a></h2>
12755
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).
12759 </p>
12760 <p>The filter accepts the following options:
12761 </p>
12762 <dl compact="compact">
12763 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
12764 <dd><p>Set frequency in Hz. Default is 3000.
12765 </p>
12766 </dd>
12767 <dt> &lsquo;<samp>poles, p</samp>&rsquo;</dt>
12768 <dd><p>Set number of poles. Default is 2.
12769 </p>
12770 </dd>
12771 <dt> &lsquo;<samp>width_type</samp>&rsquo;</dt>
12772 <dd><p>Set method to specify band-width of filter.
12773 </p><dl compact="compact">
12774 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
12775 <dd><p>Hz
12776 </p></dd>
12777 <dt> &lsquo;<samp>q</samp>&rsquo;</dt>
12778 <dd><p>Q-Factor
12779 </p></dd>
12780 <dt> &lsquo;<samp>o</samp>&rsquo;</dt>
12781 <dd><p>octave
12782 </p></dd>
12783 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
12784 <dd><p>slope
12785 </p></dd>
12786 </dl>
12787
12788 </dd>
12789 <dt> &lsquo;<samp>width, w</samp>&rsquo;</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.
12793 </p></dd>
12794 </dl>
12795
12796 <a name="join"></a>
12797 <h2 class="section"><a href="ffplay-all.html#toc-join">30.32 join</a></h2>
12798
12799 <p>Join multiple input streams into one multi-channel stream.
12800 </p>
12801 <p>The filter accepts the following named parameters:
12802 </p><dl compact="compact">
12803 <dt> &lsquo;<samp>inputs</samp>&rsquo;</dt>
12804 <dd><p>Number of input streams. Defaults to 2.
12805 </p>
12806 </dd>
12807 <dt> &lsquo;<samp>channel_layout</samp>&rsquo;</dt>
12808 <dd><p>Desired output channel layout. Defaults to stereo.
12809 </p>
12810 </dd>
12811 <dt> &lsquo;<samp>map</samp>&rsquo;</dt>
12812 <dd><p>Map channels from inputs to output. The argument is a &rsquo;|&rsquo;-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
12817 channel.
12818 </p></dd>
12819 </dl>
12820
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.
12824 </p>
12825 <p>E.g. to join 3 inputs (with properly set channel layouts)
12826 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
12827 </pre></td></tr></table>
12828
12829 <p>To build a 5.1 output from 6 single-channel streams:
12830 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
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'
12832 out
12833 </pre></td></tr></table>
12834
12835 <a name="ladspa"></a>
12836 <h2 class="section"><a href="ffplay-all.html#toc-ladspa">30.33 ladspa</a></h2>
12837
12838 <p>Load a LADSPA (Linux Audio Developer&rsquo;s Simple Plugin API) plugin.
12839 </p>
12840 <p>To enable compilation of this filter you need to configure FFmpeg with
12841 <code>--enable-ladspa</code>.
12842 </p>
12843 <dl compact="compact">
12844 <dt> &lsquo;<samp>file, f</samp>&rsquo;</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: &lsquo;<tt>HOME/.ladspa/lib/</tt>&rsquo;, &lsquo;<tt>/usr/local/lib/ladspa/</tt>&rsquo;,
12850 &lsquo;<tt>/usr/lib/ladspa/</tt>&rsquo;.
12851 </p>
12852 </dd>
12853 <dt> &lsquo;<samp>plugin, p</samp>&rsquo;</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.
12857 </p>
12858 </dd>
12859 <dt> &lsquo;<samp>controls, c</samp>&rsquo;</dt>
12860 <dd><p>Set the &rsquo;|&rsquo; 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 &lsquo;<samp>controls</samp>&rsquo; is set to <code>help</code>, all available controls and
12867 their valid ranges are printed.
12868 </p>
12869 </dd>
12870 <dt> &lsquo;<samp>sample_rate, s</samp>&rsquo;</dt>
12871 <dd><p>Specify the sample rate, default to 44100. Only used if plugin have
12872 zero inputs.
12873 </p>
12874 </dd>
12875 <dt> &lsquo;<samp>nb_samples, n</samp>&rsquo;</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.
12878 </p>
12879 </dd>
12880 <dt> &lsquo;<samp>duration, d</samp>&rsquo;</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 &quot;Time duration&quot;
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.
12889 </p>
12890 </dd>
12891 </dl>
12892
12893 <a name="Examples-9"></a>
12894 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-9">30.33.1 Examples</a></h3>
12895
12896 <ul>
12897 <li>
12898 List all available plugins within amp (LADSPA example plugin) library:
12899 <table><tr><td>&nbsp;</td><td><pre class="example">ladspa=file=amp
12900 </pre></td></tr></table>
12901
12902 </li><li>
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>&nbsp;</td><td><pre class="example">ladspa=f=vcf:p=vcf_notch:c=help
12906 </pre></td></tr></table>
12907
12908 </li><li>
12909 Simulate low quality audio equipment using <code>Computer Music Toolkit</code> (CMT)
12910 plugin library:
12911 <table><tr><td>&nbsp;</td><td><pre class="example">ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12
12912 </pre></td></tr></table>
12913
12914 </li><li>
12915 Add reverberation to the audio using TAP-plugins
12916 (Tom&rsquo;s Audio Processing plugins):
12917 <table><tr><td>&nbsp;</td><td><pre class="example">ladspa=file=tap_reverb:tap_reverb
12918 </pre></td></tr></table>
12919
12920 </li><li>
12921 Generate white noise, with 0.2 amplitude:
12922 <table><tr><td>&nbsp;</td><td><pre class="example">ladspa=file=cmt:noise_source_white:c=c0=.2
12923 </pre></td></tr></table>
12924
12925 </li><li>
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>&nbsp;</td><td><pre class="example">ladspa=file=caps:Click:c=c1=20'
12929 </pre></td></tr></table>
12930
12931 </li><li>
12932 Apply <code>C* Eq10X2 - Stereo 10-band equaliser</code> effect:
12933 <table><tr><td>&nbsp;</td><td><pre class="example">ladspa=caps:Eq10X2:c=c0=-48|c9=-24|c3=12|c4=2
12934 </pre></td></tr></table>
12935 </li></ul>
12936
12937 <a name="Commands-3"></a>
12938 <h3 class="subsection"><a href="ffplay-all.html#toc-Commands-3">30.33.2 Commands</a></h3>
12939
12940 <p>This filter supports the following commands:
12941 </p><dl compact="compact">
12942 <dt> &lsquo;<samp>cN</samp>&rsquo;</dt>
12943 <dd><p>Modify the <var>N</var>-th control value.
12944 </p>
12945 <p>If the specified value is not valid, it is ignored and prior one is kept.
12946 </p></dd>
12947 </dl>
12948
12949 <a name="lowpass"></a>
12950 <h2 class="section"><a href="ffplay-all.html#toc-lowpass">30.34 lowpass</a></h2>
12951
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).
12955 </p>
12956 <p>The filter accepts the following options:
12957 </p>
12958 <dl compact="compact">
12959 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
12960 <dd><p>Set frequency in Hz. Default is 500.
12961 </p>
12962 </dd>
12963 <dt> &lsquo;<samp>poles, p</samp>&rsquo;</dt>
12964 <dd><p>Set number of poles. Default is 2.
12965 </p>
12966 </dd>
12967 <dt> &lsquo;<samp>width_type</samp>&rsquo;</dt>
12968 <dd><p>Set method to specify band-width of filter.
12969 </p><dl compact="compact">
12970 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
12971 <dd><p>Hz
12972 </p></dd>
12973 <dt> &lsquo;<samp>q</samp>&rsquo;</dt>
12974 <dd><p>Q-Factor
12975 </p></dd>
12976 <dt> &lsquo;<samp>o</samp>&rsquo;</dt>
12977 <dd><p>octave
12978 </p></dd>
12979 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
12980 <dd><p>slope
12981 </p></dd>
12982 </dl>
12983
12984 </dd>
12985 <dt> &lsquo;<samp>width, w</samp>&rsquo;</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.
12989 </p></dd>
12990 </dl>
12991
12992 <a name="pan"></a>
12993 <h2 class="section"><a href="ffplay-all.html#toc-pan">30.35 pan</a></h2>
12994
12995 <p>Mix channels with specific gain levels. The filter accepts the output
12996 channel layout followed by a set of channels definitions.
12997 </p>
12998 <p>This filter is also designed to remap efficiently the channels of an audio
12999 stream.
13000 </p>
13001 <p>The filter accepts parameters of the form:
13002 &quot;<var>l</var>:<var>outdef</var>:<var>outdef</var>:...&quot;
13003 </p>
13004 <dl compact="compact">
13005 <dt> &lsquo;<samp>l</samp>&rsquo;</dt>
13006 <dd><p>output channel layout or number of channels
13007 </p>
13008 </dd>
13009 <dt> &lsquo;<samp>outdef</samp>&rsquo;</dt>
13010 <dd><p>output channel specification, of the form:
13011 &quot;<var>out_name</var>=[<var>gain</var>*]<var>in_name</var>[+[<var>gain</var>*]<var>in_name</var>...]&quot;
13012 </p>
13013 </dd>
13014 <dt> &lsquo;<samp>out_name</samp>&rsquo;</dt>
13015 <dd><p>output channel to define, either a channel name (FL, FR, etc.) or a channel
13016 number (c0, c1, etc.)
13017 </p>
13018 </dd>
13019 <dt> &lsquo;<samp>gain</samp>&rsquo;</dt>
13020 <dd><p>multiplicative coefficient for the channel, 1 leaving the volume unchanged
13021 </p>
13022 </dd>
13023 <dt> &lsquo;<samp>in_name</samp>&rsquo;</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
13026 </p></dd>
13027 </dl>
13028
13029 <p>If the &lsquo;=&rsquo; in a channel specification is replaced by &lsquo;&lt;&rsquo;, then the gains for
13030 that specification will be renormalized so that the total is 1, thus
13031 avoiding clipping noise.
13032 </p>
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>
13035
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>&nbsp;</td><td><pre class="example">pan=1:c0=0.9*c0+0.1*c1
13039 </pre></td></tr></table>
13040
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>&nbsp;</td><td><pre class="example">pan=stereo: FL &lt; FL + 0.5*FC + 0.6*BL + 0.6*SL : FR &lt; FR + 0.5*FC + 0.6*BR + 0.6*SR
13044 </pre></td></tr></table>
13045
13046 <p>Note that <code>ffmpeg</code> integrates a default down-mix (and up-mix) system
13047 that should be preferred (see &quot;-ac&quot; option) unless you have very specific
13048 needs.
13049 </p>
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>
13052
13053 <p>The channel remapping will be effective if, and only if:
13054 </p>
13055 <ul>
13056 <li> gain coefficients are zeroes or ones,
13057 </li><li> only one input per channel output,
13058 </li></ul>
13059
13060 <p>If all these conditions are satisfied, the filter will notify the user (&quot;Pure
13061 channel mapping detected&quot;), and use an optimized and lossless method to do the
13062 remapping.
13063 </p>
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>&nbsp;</td><td><pre class="example">pan=&quot;stereo: c0=FL : c1=FR&quot;
13067 </pre></td></tr></table>
13068
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>&nbsp;</td><td><pre class="example">pan=&quot;5.1: c0=c1 : c1=c0 : c2=c2 : c3=c3 : c4=c4 : c5=c5&quot;
13072 </pre></td></tr></table>
13073
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>&nbsp;</td><td><pre class="example">pan=&quot;stereo:c1=c1&quot;
13077 </pre></td></tr></table>
13078
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>&nbsp;</td><td><pre class="example">pan=&quot;stereo: c0=FR : c1=FR&quot;
13082 </pre></td></tr></table>
13083
13084 <a name="replaygain"></a>
13085 <h2 class="section"><a href="ffplay-all.html#toc-replaygain">30.36 replaygain</a></h2>
13086
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>.
13090 </p>
13091 <a name="resample"></a>
13092 <h2 class="section"><a href="ffplay-all.html#toc-resample">30.37 resample</a></h2>
13093
13094 <p>Convert the audio sample format, sample rate and channel layout. This filter is
13095 not meant to be used directly.
13096 </p>
13097 <a name="silencedetect"></a>
13098 <h2 class="section"><a href="ffplay-all.html#toc-silencedetect">30.38 silencedetect</a></h2>
13099
13100 <p>Detect silence in an audio stream.
13101 </p>
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.
13105 </p>
13106 <p>The printed times and duration are expressed in seconds.
13107 </p>
13108 <p>The filter accepts the following options:
13109 </p>
13110 <dl compact="compact">
13111 <dt> &lsquo;<samp>duration, d</samp>&rsquo;</dt>
13112 <dd><p>Set silence duration until notification (default is 2 seconds).
13113 </p>
13114 </dd>
13115 <dt> &lsquo;<samp>noise, n</samp>&rsquo;</dt>
13116 <dd><p>Set noise tolerance. Can be specified in dB (in case &quot;dB&quot; is appended to the
13117 specified value) or amplitude ratio. Default is -60dB, or 0.001.
13118 </p></dd>
13119 </dl>
13120
13121 <a name="Examples-64"></a>
13122 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-64">30.38.1 Examples</a></h3>
13123
13124 <ul>
13125 <li>
13126 Detect 5 seconds of silence with -50dB noise tolerance:
13127 <table><tr><td>&nbsp;</td><td><pre class="example">silencedetect=n=-50dB:d=5
13128 </pre></td></tr></table>
13129
13130 </li><li>
13131 Complete example with <code>ffmpeg</code> to detect silence with 0.0001 noise
13132 tolerance in &lsquo;<tt>silence.mp3</tt>&rsquo;:
13133 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
13134 </pre></td></tr></table>
13135 </li></ul>
13136
13137 <a name="treble"></a>
13138 <h2 class="section"><a href="ffplay-all.html#toc-treble">30.39 treble</a></h2>
13139
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&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
13143 </p>
13144 <p>The filter accepts the following options:
13145 </p>
13146 <dl compact="compact">
13147 <dt> &lsquo;<samp>gain, g</samp>&rsquo;</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.
13151 </p>
13152 </dd>
13153 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
13154 <dd><p>Set the filter&rsquo;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.
13157 </p>
13158 </dd>
13159 <dt> &lsquo;<samp>width_type</samp>&rsquo;</dt>
13160 <dd><p>Set method to specify band-width of filter.
13161 </p><dl compact="compact">
13162 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
13163 <dd><p>Hz
13164 </p></dd>
13165 <dt> &lsquo;<samp>q</samp>&rsquo;</dt>
13166 <dd><p>Q-Factor
13167 </p></dd>
13168 <dt> &lsquo;<samp>o</samp>&rsquo;</dt>
13169 <dd><p>octave
13170 </p></dd>
13171 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
13172 <dd><p>slope
13173 </p></dd>
13174 </dl>
13175
13176 </dd>
13177 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
13178 <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
13179 </p></dd>
13180 </dl>
13181
13182 <a name="volume"></a>
13183 <h2 class="section"><a href="ffplay-all.html#toc-volume">30.40 volume</a></h2>
13184
13185 <p>Adjust the input audio volume.
13186 </p>
13187 <p>The filter accepts the following options:
13188 </p>
13189 <dl compact="compact">
13190 <dt> &lsquo;<samp>volume</samp>&rsquo;</dt>
13191 <dd><p>Expresses how the audio volume will be increased or decreased.
13192 </p>
13193 <p>Output values are clipped to the maximum value.
13194 </p>
13195 <p>The output audio volume is given by the relation:
13196 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>output_volume</var> = <var>volume</var> * <var>input_volume</var>
13197 </pre></td></tr></table>
13198
13199 <p>Default value for <var>volume</var> is 1.0.
13200 </p>
13201 </dd>
13202 <dt> &lsquo;<samp>precision</samp>&rsquo;</dt>
13203 <dd><p>Set the mathematical precision.
13204 </p>
13205 <p>This determines which input sample formats will be allowed, which affects the
13206 precision of the volume scaling.
13207 </p>
13208 <dl compact="compact">
13209 <dt> &lsquo;<samp>fixed</samp>&rsquo;</dt>
13210 <dd><p>8-bit fixed-point; limits input sample format to U8, S16, and S32.
13211 </p></dd>
13212 <dt> &lsquo;<samp>float</samp>&rsquo;</dt>
13213 <dd><p>32-bit floating-point; limits input sample format to FLT. (default)
13214 </p></dd>
13215 <dt> &lsquo;<samp>double</samp>&rsquo;</dt>
13216 <dd><p>64-bit floating-point; limits input sample format to DBL.
13217 </p></dd>
13218 </dl>
13219 </dd>
13220 </dl>
13221
13222 <a name="Examples-80"></a>
13223 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-80">30.40.1 Examples</a></h3>
13224
13225 <ul>
13226 <li>
13227 Halve the input audio volume:
13228 <table><tr><td>&nbsp;</td><td><pre class="example">volume=volume=0.5
13229 volume=volume=1/2
13230 volume=volume=-6.0206dB
13231 </pre></td></tr></table>
13232
13233 <p>In all the above example the named key for &lsquo;<samp>volume</samp>&rsquo; can be
13234 omitted, for example like in:
13235 </p><table><tr><td>&nbsp;</td><td><pre class="example">volume=0.5
13236 </pre></td></tr></table>
13237
13238 </li><li>
13239 Increase input audio power by 6 decibels using fixed-point precision:
13240 <table><tr><td>&nbsp;</td><td><pre class="example">volume=volume=6dB:precision=fixed
13241 </pre></td></tr></table>
13242 </li></ul>
13243
13244 <a name="volumedetect"></a>
13245 <h2 class="section"><a href="ffplay-all.html#toc-volumedetect">30.41 volumedetect</a></h2>
13246
13247 <p>Detect the volume of the input video.
13248 </p>
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.
13251 </p>
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
13255 the samples).
13256 </p>
13257 <p>All volumes are in decibels relative to the maximum PCM value.
13258 </p>
13259 <a name="Examples-55"></a>
13260 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-55">30.41.1 Examples</a></h3>
13261
13262 <p>Here is an excerpt of the output:
13263 </p><table><tr><td>&nbsp;</td><td><pre class="example">[Parsed_volumedetect_0 &nbsp;0xa23120] mean_volume: -27 dB
13264 [Parsed_volumedetect_0 &nbsp;0xa23120] max_volume: -4 dB
13265 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_4db: 6
13266 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_5db: 62
13267 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_6db: 286
13268 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_7db: 1042
13269 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_8db: 2551
13270 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_9db: 4609
13271 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_10db: 8409
13272 </pre></td></tr></table>
13273
13274 <p>It means that:
13275 </p><ul>
13276 <li>
13277 The mean square energy is approximately -27 dB, or 10^-2.7.
13278 </li><li>
13279 The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB.
13280 </li><li>
13281 There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc.
13282 </li></ul>
13283
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.
13286 </p>
13287
13288 <a name="Audio-Sources"></a>
13289 <h1 class="chapter"><a href="ffplay-all.html#toc-Audio-Sources">31. Audio Sources</a></h1>
13290
13291 <p>Below is a description of the currently available audio sources.
13292 </p>
13293 <a name="abuffer"></a>
13294 <h2 class="section"><a href="ffplay-all.html#toc-abuffer">31.1 abuffer</a></h2>
13295
13296 <p>Buffer audio frames, and make them available to the filter chain.
13297 </p>
13298 <p>This source is mainly intended for a programmatic use, in particular
13299 through the interface defined in &lsquo;<tt>libavfilter/asrc_abuffer.h</tt>&rsquo;.
13300 </p>
13301 <p>It accepts the following named parameters:
13302 </p>
13303 <dl compact="compact">
13304 <dt> &lsquo;<samp>time_base</samp>&rsquo;</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.
13307 </p>
13308 </dd>
13309 <dt> &lsquo;<samp>sample_rate</samp>&rsquo;</dt>
13310 <dd><p>The sample rate of the incoming audio buffers.
13311 </p>
13312 </dd>
13313 <dt> &lsquo;<samp>sample_fmt</samp>&rsquo;</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 &lsquo;<tt>libavutil/samplefmt.h</tt>&rsquo;
13317 </p>
13318 </dd>
13319 <dt> &lsquo;<samp>channel_layout</samp>&rsquo;</dt>
13320 <dd><p>The channel layout of the incoming audio buffers.
13321 Either a channel layout name from channel_layout_map in
13322 &lsquo;<tt>libavutil/channel_layout.c</tt>&rsquo; or its corresponding integer representation
13323 from the AV_CH_LAYOUT_* macros in &lsquo;<tt>libavutil/channel_layout.h</tt>&rsquo;
13324 </p>
13325 </dd>
13326 <dt> &lsquo;<samp>channels</samp>&rsquo;</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.
13330 </p>
13331 </dd>
13332 </dl>
13333
13334 <a name="Examples-27"></a>
13335 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-27">31.1.1 Examples</a></h3>
13336
13337 <table><tr><td>&nbsp;</td><td><pre class="example">abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
13338 </pre></td></tr></table>
13339
13340 <p>will instruct the source to accept planar 16bit signed stereo at 44100Hz.
13341 Since the sample format with name &quot;s16p&quot; corresponds to the number
13342 6 and the &quot;stereo&quot; channel layout corresponds to the value 0x3, this is
13343 equivalent to:
13344 </p><table><tr><td>&nbsp;</td><td><pre class="example">abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
13345 </pre></td></tr></table>
13346
13347 <a name="aevalsrc"></a>
13348 <h2 class="section"><a href="ffplay-all.html#toc-aevalsrc">31.2 aevalsrc</a></h2>
13349
13350 <p>Generate an audio signal specified by an expression.
13351 </p>
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
13354 audio signal.
13355 </p>
13356 <p>This source accepts the following options:
13357 </p>
13358 <dl compact="compact">
13359 <dt> &lsquo;<samp>exprs</samp>&rsquo;</dt>
13360 <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. In case the
13361 &lsquo;<samp>channel_layout</samp>&rsquo; 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.
13364 </p>
13365 </dd>
13366 <dt> &lsquo;<samp>channel_layout, c</samp>&rsquo;</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.
13369 </p>
13370 </dd>
13371 <dt> &lsquo;<samp>duration, d</samp>&rsquo;</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
13376 complete frame.
13377 </p>
13378 <p>If not specified, or the expressed duration is negative, the audio is
13379 supposed to be generated forever.
13380 </p>
13381 </dd>
13382 <dt> &lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
13383 <dd><p>Set the number of samples per channel per each output frame,
13384 default to 1024.
13385 </p>
13386 </dd>
13387 <dt> &lsquo;<samp>sample_rate, s</samp>&rsquo;</dt>
13388 <dd><p>Specify the sample rate, default to 44100.
13389 </p></dd>
13390 </dl>
13391
13392 <p>Each expression in <var>exprs</var> can contain the following constants:
13393 </p>
13394 <dl compact="compact">
13395 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
13396 <dd><p>number of the evaluated sample, starting from 0
13397 </p>
13398 </dd>
13399 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
13400 <dd><p>time of the evaluated sample expressed in seconds, starting from 0
13401 </p>
13402 </dd>
13403 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
13404 <dd><p>sample rate
13405 </p>
13406 </dd>
13407 </dl>
13408
13409 <a name="Examples-78"></a>
13410 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-78">31.2.1 Examples</a></h3>
13411
13412 <ul>
13413 <li>
13414 Generate silence:
13415 <table><tr><td>&nbsp;</td><td><pre class="example">aevalsrc=0
13416 </pre></td></tr></table>
13417
13418 </li><li>
13419 Generate a sin signal with frequency of 440 Hz, set sample rate to
13420 8000 Hz:
13421 <table><tr><td>&nbsp;</td><td><pre class="example">aevalsrc=&quot;sin(440*2*PI*t):s=8000&quot;
13422 </pre></td></tr></table>
13423
13424 </li><li>
13425 Generate a two channels signal, specify the channel layout (Front
13426 Center + Back Center) explicitly:
13427 <table><tr><td>&nbsp;</td><td><pre class="example">aevalsrc=&quot;sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC&quot;
13428 </pre></td></tr></table>
13429
13430 </li><li>
13431 Generate white noise:
13432 <table><tr><td>&nbsp;</td><td><pre class="example">aevalsrc=&quot;-2+random(0)&quot;
13433 </pre></td></tr></table>
13434
13435 </li><li>
13436 Generate an amplitude modulated signal:
13437 <table><tr><td>&nbsp;</td><td><pre class="example">aevalsrc=&quot;sin(10*2*PI*t)*sin(880*2*PI*t)&quot;
13438 </pre></td></tr></table>
13439
13440 </li><li>
13441 Generate 2.5 Hz binaural beats on a 360 Hz carrier:
13442 <table><tr><td>&nbsp;</td><td><pre class="example">aevalsrc=&quot;0.1*sin(2*PI*(360-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)&quot;
13443 </pre></td></tr></table>
13444
13445 </li></ul>
13446
13447 <a name="anullsrc"></a>
13448 <h2 class="section"><a href="ffplay-all.html#toc-anullsrc">31.3 anullsrc</a></h2>
13449
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
13453 synth filter).
13454 </p>
13455 <p>This source accepts the following options:
13456 </p>
13457 <dl compact="compact">
13458 <dt> &lsquo;<samp>channel_layout, cl</samp>&rsquo;</dt>
13459 <dd>
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 &quot;stereo&quot;.
13463 </p>
13464 <p>Check the channel_layout_map definition in
13465 &lsquo;<tt>libavutil/channel_layout.c</tt>&rsquo; for the mapping between strings and
13466 channel layout values.
13467 </p>
13468 </dd>
13469 <dt> &lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
13470 <dd><p>Specify the sample rate, and defaults to 44100.
13471 </p>
13472 </dd>
13473 <dt> &lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
13474 <dd><p>Set the number of samples per requested frames.
13475 </p>
13476 </dd>
13477 </dl>
13478
13479 <a name="Examples-84"></a>
13480 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-84">31.3.1 Examples</a></h3>
13481
13482 <ul>
13483 <li>
13484 Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO.
13485 <table><tr><td>&nbsp;</td><td><pre class="example">anullsrc=r=48000:cl=4
13486 </pre></td></tr></table>
13487
13488 </li><li>
13489 Do the same operation with a more obvious syntax:
13490 <table><tr><td>&nbsp;</td><td><pre class="example">anullsrc=r=48000:cl=mono
13491 </pre></td></tr></table>
13492 </li></ul>
13493
13494 <p>All the parameters need to be explicitly defined.
13495 </p>
13496 <a name="flite"></a>
13497 <h2 class="section"><a href="ffplay-all.html#toc-flite">31.4 flite</a></h2>
13498
13499 <p>Synthesize a voice utterance using the libflite library.
13500 </p>
13501 <p>To enable compilation of this filter you need to configure FFmpeg with
13502 <code>--enable-libflite</code>.
13503 </p>
13504 <p>Note that the flite library is not thread-safe.
13505 </p>
13506 <p>The filter accepts the following options:
13507 </p>
13508 <dl compact="compact">
13509 <dt> &lsquo;<samp>list_voices</samp>&rsquo;</dt>
13510 <dd><p>If set to 1, list the names of the available voices and exit
13511 immediately. Default value is 0.
13512 </p>
13513 </dd>
13514 <dt> &lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
13515 <dd><p>Set the maximum number of samples per frame. Default value is 512.
13516 </p>
13517 </dd>
13518 <dt> &lsquo;<samp>textfile</samp>&rsquo;</dt>
13519 <dd><p>Set the filename containing the text to speak.
13520 </p>
13521 </dd>
13522 <dt> &lsquo;<samp>text</samp>&rsquo;</dt>
13523 <dd><p>Set the text to speak.
13524 </p>
13525 </dd>
13526 <dt> &lsquo;<samp>voice, v</samp>&rsquo;</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.
13529 </p></dd>
13530 </dl>
13531
13532 <a name="Examples-85"></a>
13533 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-85">31.4.1 Examples</a></h3>
13534
13535 <ul>
13536 <li>
13537 Read from file &lsquo;<tt>speech.txt</tt>&rsquo;, and synthetize the text using the
13538 standard flite voice:
13539 <table><tr><td>&nbsp;</td><td><pre class="example">flite=textfile=speech.txt
13540 </pre></td></tr></table>
13541
13542 </li><li>
13543 Read the specified text selecting the <code>slt</code> voice:
13544 <table><tr><td>&nbsp;</td><td><pre class="example">flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
13545 </pre></td></tr></table>
13546
13547 </li><li>
13548 Input text to ffmpeg:
13549 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f lavfi -i flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
13550 </pre></td></tr></table>
13551
13552 </li><li>
13553 Make &lsquo;<tt>ffplay</tt>&rsquo; speak the specified text, using <code>flite</code> and
13554 the <code>lavfi</code> device:
13555 <table><tr><td>&nbsp;</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>
13557 </li></ul>
13558
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>
13561 </p>
13562 <a name="sine"></a>
13563 <h2 class="section"><a href="ffplay-all.html#toc-sine">31.5 sine</a></h2>
13564
13565 <p>Generate an audio signal made of a sine wave with amplitude 1/8.
13566 </p>
13567 <p>The audio signal is bit-exact.
13568 </p>
13569 <p>The filter accepts the following options:
13570 </p>
13571 <dl compact="compact">
13572 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
13573 <dd><p>Set the carrier frequency. Default is 440 Hz.
13574 </p>
13575 </dd>
13576 <dt> &lsquo;<samp>beep_factor, b</samp>&rsquo;</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.
13579 </p>
13580 </dd>
13581 <dt> &lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
13582 <dd><p>Specify the sample rate, default is 44100.
13583 </p>
13584 </dd>
13585 <dt> &lsquo;<samp>duration, d</samp>&rsquo;</dt>
13586 <dd><p>Specify the duration of the generated audio stream.
13587 </p>
13588 </dd>
13589 <dt> &lsquo;<samp>samples_per_frame</samp>&rsquo;</dt>
13590 <dd><p>Set the number of samples per output frame, default is 1024.
13591 </p></dd>
13592 </dl>
13593
13594 <a name="Examples-32"></a>
13595 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-32">31.5.1 Examples</a></h3>
13596
13597 <ul>
13598 <li>
13599 Generate a simple 440 Hz sine wave:
13600 <table><tr><td>&nbsp;</td><td><pre class="example">sine
13601 </pre></td></tr></table>
13602
13603 </li><li>
13604 Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds:
13605 <table><tr><td>&nbsp;</td><td><pre class="example">sine=220:4:d=5
13606 sine=f=220:b=4:d=5
13607 sine=frequency=220:beep_factor=4:duration=5
13608 </pre></td></tr></table>
13609
13610 </li></ul>
13611
13612
13613 <a name="Audio-Sinks"></a>
13614 <h1 class="chapter"><a href="ffplay-all.html#toc-Audio-Sinks">32. Audio Sinks</a></h1>
13615
13616 <p>Below is a description of the currently available audio sinks.
13617 </p>
13618 <a name="abuffersink"></a>
13619 <h2 class="section"><a href="ffplay-all.html#toc-abuffersink">32.1 abuffersink</a></h2>
13620
13621 <p>Buffer audio frames, and make them available to the end of filter chain.
13622 </p>
13623 <p>This sink is mainly intended for programmatic use, in particular
13624 through the interface defined in &lsquo;<tt>libavfilter/buffersink.h</tt>&rsquo;
13625 or the options system.
13626 </p>
13627 <p>It accepts a pointer to an AVABufferSinkContext structure, which
13628 defines the incoming buffers&rsquo; formats, to be passed as the opaque
13629 parameter to <code>avfilter_init_filter</code> for initialization.
13630 </p>
13631 <a name="anullsink"></a>
13632 <h2 class="section"><a href="ffplay-all.html#toc-anullsink">32.2 anullsink</a></h2>
13633
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
13636 tools.
13637 </p>
13638
13639 <a name="Video-Filters"></a>
13640 <h1 class="chapter"><a href="ffplay-all.html#toc-Video-Filters">33. Video Filters</a></h1>
13641
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
13645 build.
13646 </p>
13647 <p>Below is a description of the currently available video filters.
13648 </p>
13649 <a name="alphaextract"></a>
13650 <h2 class="section"><a href="ffplay-all.html#toc-alphaextract">33.1 alphaextract</a></h2>
13651
13652 <p>Extract the alpha component from the input as a grayscale video. This
13653 is especially useful with the <var>alphamerge</var> filter.
13654 </p>
13655 <a name="alphamerge"></a>
13656 <h2 class="section"><a href="ffplay-all.html#toc-alphamerge">33.2 alphamerge</a></h2>
13657
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&rsquo;t support an alpha
13662 channel.
13663 </p>
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>&nbsp;</td><td><pre class="example">movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
13667 </pre></td></tr></table>
13668
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&rsquo;re trying to apply an image as an
13673 overlay to a video stream, consider the <var>overlay</var> filter instead.
13674 </p>
13675 <a name="ass"></a>
13676 <h2 class="section"><a href="ffplay-all.html#toc-ass">33.3 ass</a></h2>
13677
13678 <p>Same as the <a href="#subtitles">subtitles</a> filter, except that it doesn&rsquo;t require libavcodec
13679 and libavformat to work. On the other hand, it is limited to ASS (Advanced
13680 Substation Alpha) subtitles files.
13681 </p>
13682 <a name="bbox"></a>
13683 <h2 class="section"><a href="ffplay-all.html#toc-bbox">33.4 bbox</a></h2>
13684
13685 <p>Compute the bounding box for the non-black pixels in the input frame
13686 luminance plane.
13687 </p>
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
13691 log.
13692 </p>
13693 <p>The filter accepts the following option:
13694 </p>
13695 <dl compact="compact">
13696 <dt> &lsquo;<samp>min_val</samp>&rsquo;</dt>
13697 <dd><p>Set the minimal luminance value. Default is <code>16</code>.
13698 </p></dd>
13699 </dl>
13700
13701 <a name="blackdetect"></a>
13702 <h2 class="section"><a href="ffplay-all.html#toc-blackdetect">33.5 blackdetect</a></h2>
13703
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.
13708 </p>
13709 <p>In order to display the output lines, you need to set the loglevel at
13710 least to the AV_LOG_INFO value.
13711 </p>
13712 <p>The filter accepts the following options:
13713 </p>
13714 <dl compact="compact">
13715 <dt> &lsquo;<samp>black_min_duration, d</samp>&rsquo;</dt>
13716 <dd><p>Set the minimum detected black duration expressed in seconds. It must
13717 be a non-negative floating point number.
13718 </p>
13719 <p>Default value is 2.0.
13720 </p>
13721 </dd>
13722 <dt> &lsquo;<samp>picture_black_ratio_th, pic_th</samp>&rsquo;</dt>
13723 <dd><p>Set the threshold for considering a picture &quot;black&quot;.
13724 Express the minimum value for the ratio:
13725 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>nb_black_pixels</var> / <var>nb_pixels</var>
13726 </pre></td></tr></table>
13727
13728 <p>for which a picture is considered black.
13729 Default value is 0.98.
13730 </p>
13731 </dd>
13732 <dt> &lsquo;<samp>pixel_black_th, pix_th</samp>&rsquo;</dt>
13733 <dd><p>Set the threshold for considering a pixel &quot;black&quot;.
13734 </p>
13735 <p>The threshold expresses the maximum pixel luminance value for which a
13736 pixel is considered &quot;black&quot;. The provided value is scaled according to
13737 the following equation:
13738 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>absolute_threshold</var> = <var>luminance_minimum_value</var> + <var>pixel_black_th</var> * <var>luminance_range_size</var>
13739 </pre></td></tr></table>
13740
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.
13744 </p>
13745 <p>Default value is 0.10.
13746 </p></dd>
13747 </dl>
13748
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>&nbsp;</td><td><pre class="example">blackdetect=d=2:pix_th=0.00
13752 </pre></td></tr></table>
13753
13754 <a name="blackframe"></a>
13755 <h2 class="section"><a href="ffplay-all.html#toc-blackframe">33.6 blackframe</a></h2>
13756
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.
13761 </p>
13762 <p>In order to display the output lines, you need to set the loglevel at
13763 least to the AV_LOG_INFO value.
13764 </p>
13765 <p>The filter accepts the following options:
13766 </p>
13767 <dl compact="compact">
13768 <dt> &lsquo;<samp>amount</samp>&rsquo;</dt>
13769 <dd><p>Set the percentage of the pixels that have to be below the threshold, defaults
13770 to <code>98</code>.
13771 </p>
13772 </dd>
13773 <dt> &lsquo;<samp>threshold, thresh</samp>&rsquo;</dt>
13774 <dd><p>Set the threshold below which a pixel value is considered black, defaults to
13775 <code>32</code>.
13776 </p>
13777 </dd>
13778 </dl>
13779
13780 <a name="blend"></a>
13781 <h2 class="section"><a href="ffplay-all.html#toc-blend">33.7 blend</a></h2>
13782
13783 <p>Blend two video frames into each other.
13784 </p>
13785 <p>It takes two input streams and outputs one stream, the first input is the
13786 &quot;top&quot; layer and second input is &quot;bottom&quot; layer.
13787 Output terminates when shortest input terminates.
13788 </p>
13789 <p>A description of the accepted options follows.
13790 </p>
13791 <dl compact="compact">
13792 <dt> &lsquo;<samp>c0_mode</samp>&rsquo;</dt>
13793 <dt> &lsquo;<samp>c1_mode</samp>&rsquo;</dt>
13794 <dt> &lsquo;<samp>c2_mode</samp>&rsquo;</dt>
13795 <dt> &lsquo;<samp>c3_mode</samp>&rsquo;</dt>
13796 <dt> &lsquo;<samp>all_mode</samp>&rsquo;</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>.
13799 </p>
13800 <p>Available values for component modes are:
13801 </p><dl compact="compact">
13802 <dt> &lsquo;<samp>addition</samp>&rsquo;</dt>
13803 <dt> &lsquo;<samp>and</samp>&rsquo;</dt>
13804 <dt> &lsquo;<samp>average</samp>&rsquo;</dt>
13805 <dt> &lsquo;<samp>burn</samp>&rsquo;</dt>
13806 <dt> &lsquo;<samp>darken</samp>&rsquo;</dt>
13807 <dt> &lsquo;<samp>difference</samp>&rsquo;</dt>
13808 <dt> &lsquo;<samp>divide</samp>&rsquo;</dt>
13809 <dt> &lsquo;<samp>dodge</samp>&rsquo;</dt>
13810 <dt> &lsquo;<samp>exclusion</samp>&rsquo;</dt>
13811 <dt> &lsquo;<samp>hardlight</samp>&rsquo;</dt>
13812 <dt> &lsquo;<samp>lighten</samp>&rsquo;</dt>
13813 <dt> &lsquo;<samp>multiply</samp>&rsquo;</dt>
13814 <dt> &lsquo;<samp>negation</samp>&rsquo;</dt>
13815 <dt> &lsquo;<samp>normal</samp>&rsquo;</dt>
13816 <dt> &lsquo;<samp>or</samp>&rsquo;</dt>
13817 <dt> &lsquo;<samp>overlay</samp>&rsquo;</dt>
13818 <dt> &lsquo;<samp>phoenix</samp>&rsquo;</dt>
13819 <dt> &lsquo;<samp>pinlight</samp>&rsquo;</dt>
13820 <dt> &lsquo;<samp>reflect</samp>&rsquo;</dt>
13821 <dt> &lsquo;<samp>screen</samp>&rsquo;</dt>
13822 <dt> &lsquo;<samp>softlight</samp>&rsquo;</dt>
13823 <dt> &lsquo;<samp>subtract</samp>&rsquo;</dt>
13824 <dt> &lsquo;<samp>vividlight</samp>&rsquo;</dt>
13825 <dt> &lsquo;<samp>xor</samp>&rsquo;</dt>
13826 </dl>
13827
13828 </dd>
13829 <dt> &lsquo;<samp>c0_opacity</samp>&rsquo;</dt>
13830 <dt> &lsquo;<samp>c1_opacity</samp>&rsquo;</dt>
13831 <dt> &lsquo;<samp>c2_opacity</samp>&rsquo;</dt>
13832 <dt> &lsquo;<samp>c3_opacity</samp>&rsquo;</dt>
13833 <dt> &lsquo;<samp>all_opacity</samp>&rsquo;</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.
13836 </p>
13837 </dd>
13838 <dt> &lsquo;<samp>c0_expr</samp>&rsquo;</dt>
13839 <dt> &lsquo;<samp>c1_expr</samp>&rsquo;</dt>
13840 <dt> &lsquo;<samp>c2_expr</samp>&rsquo;</dt>
13841 <dt> &lsquo;<samp>c3_expr</samp>&rsquo;</dt>
13842 <dt> &lsquo;<samp>all_expr</samp>&rsquo;</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.
13845 </p>
13846 <p>The expressions can use the following variables:
13847 </p>
13848 <dl compact="compact">
13849 <dt> &lsquo;<samp>N</samp>&rsquo;</dt>
13850 <dd><p>The sequential number of the filtered frame, starting from <code>0</code>.
13851 </p>
13852 </dd>
13853 <dt> &lsquo;<samp>X</samp>&rsquo;</dt>
13854 <dt> &lsquo;<samp>Y</samp>&rsquo;</dt>
13855 <dd><p>the coordinates of the current sample
13856 </p>
13857 </dd>
13858 <dt> &lsquo;<samp>W</samp>&rsquo;</dt>
13859 <dt> &lsquo;<samp>H</samp>&rsquo;</dt>
13860 <dd><p>the width and height of currently filtered plane
13861 </p>
13862 </dd>
13863 <dt> &lsquo;<samp>SW</samp>&rsquo;</dt>
13864 <dt> &lsquo;<samp>SH</samp>&rsquo;</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.
13869 </p>
13870 </dd>
13871 <dt> &lsquo;<samp>T</samp>&rsquo;</dt>
13872 <dd><p>Time of the current frame, expressed in seconds.
13873 </p>
13874 </dd>
13875 <dt> &lsquo;<samp>TOP, A</samp>&rsquo;</dt>
13876 <dd><p>Value of pixel component at current location for first video frame (top layer).
13877 </p>
13878 </dd>
13879 <dt> &lsquo;<samp>BOTTOM, B</samp>&rsquo;</dt>
13880 <dd><p>Value of pixel component at current location for second video frame (bottom layer).
13881 </p></dd>
13882 </dl>
13883
13884 </dd>
13885 <dt> &lsquo;<samp>shortest</samp>&rsquo;</dt>
13886 <dd><p>Force termination when the shortest input terminates. Default is <code>0</code>.
13887 </p></dd>
13888 <dt> &lsquo;<samp>repeatlast</samp>&rsquo;</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>.
13892 </p></dd>
13893 </dl>
13894
13895 <a name="Examples-54"></a>
13896 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-54">33.7.1 Examples</a></h3>
13897
13898 <ul>
13899 <li>
13900 Apply transition from bottom layer to top layer in first 10 seconds:
13901 <table><tr><td>&nbsp;</td><td><pre class="example">blend=all_expr='A*(if(gte(T,10),1,T/10))+B*(1-(if(gte(T,10),1,T/10)))'
13902 </pre></td></tr></table>
13903
13904 </li><li>
13905 Apply 1x1 checkerboard effect:
13906 <table><tr><td>&nbsp;</td><td><pre class="example">blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
13907 </pre></td></tr></table>
13908
13909 </li><li>
13910 Apply uncover left effect:
13911 <table><tr><td>&nbsp;</td><td><pre class="example">blend=all_expr='if(gte(N*SW+X,W),A,B)'
13912 </pre></td></tr></table>
13913
13914 </li><li>
13915 Apply uncover down effect:
13916 <table><tr><td>&nbsp;</td><td><pre class="example">blend=all_expr='if(gte(Y-N*SH,0),A,B)'
13917 </pre></td></tr></table>
13918
13919 </li><li>
13920 Apply uncover up-left effect:
13921 <table><tr><td>&nbsp;</td><td><pre class="example">blend=all_expr='if(gte(T*SH*40+Y,H)*gte((T*40*SW+X)*W/H,W),A,B)'
13922 </pre></td></tr></table>
13923 </li></ul>
13924
13925 <a name="boxblur"></a>
13926 <h2 class="section"><a href="ffplay-all.html#toc-boxblur">33.8 boxblur</a></h2>
13927
13928 <p>Apply boxblur algorithm to the input video.
13929 </p>
13930 <p>The filter accepts the following options:
13931 </p>
13932 <dl compact="compact">
13933 <dt> &lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
13934 <dt> &lsquo;<samp>luma_power, lp</samp>&rsquo;</dt>
13935 <dt> &lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
13936 <dt> &lsquo;<samp>chroma_power, cp</samp>&rsquo;</dt>
13937 <dt> &lsquo;<samp>alpha_radius, ar</samp>&rsquo;</dt>
13938 <dt> &lsquo;<samp>alpha_power, ap</samp>&rsquo;</dt>
13939 </dl>
13940
13941 <p>A description of the accepted options follows.
13942 </p>
13943 <dl compact="compact">
13944 <dt> &lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
13945 <dt> &lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
13946 <dt> &lsquo;<samp>alpha_radius, ar</samp>&rsquo;</dt>
13947 <dd><p>Set an expression for the box radius in pixels used for blurring the
13948 corresponding input plane.
13949 </p>
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
13953 planes.
13954 </p>
13955 <p>Default value for &lsquo;<samp>luma_radius</samp>&rsquo; is &quot;2&quot;. If not specified,
13956 &lsquo;<samp>chroma_radius</samp>&rsquo; and &lsquo;<samp>alpha_radius</samp>&rsquo; default to the
13957 corresponding value set for &lsquo;<samp>luma_radius</samp>&rsquo;.
13958 </p>
13959 <p>The expressions can contain the following constants:
13960 </p><dl compact="compact">
13961 <dt> &lsquo;<samp>w</samp>&rsquo;</dt>
13962 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
13963 <dd><p>the input width and height in pixels
13964 </p>
13965 </dd>
13966 <dt> &lsquo;<samp>cw</samp>&rsquo;</dt>
13967 <dt> &lsquo;<samp>ch</samp>&rsquo;</dt>
13968 <dd><p>the input chroma image width and height in pixels
13969 </p>
13970 </dd>
13971 <dt> &lsquo;<samp>hsub</samp>&rsquo;</dt>
13972 <dt> &lsquo;<samp>vsub</samp>&rsquo;</dt>
13973 <dd><p>horizontal and vertical chroma subsample values. For example for the
13974 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
13975 </p></dd>
13976 </dl>
13977
13978 </dd>
13979 <dt> &lsquo;<samp>luma_power, lp</samp>&rsquo;</dt>
13980 <dt> &lsquo;<samp>chroma_power, cp</samp>&rsquo;</dt>
13981 <dt> &lsquo;<samp>alpha_power, ap</samp>&rsquo;</dt>
13982 <dd><p>Specify how many times the boxblur filter is applied to the
13983 corresponding plane.
13984 </p>
13985 <p>Default value for &lsquo;<samp>luma_power</samp>&rsquo; is 2. If not specified,
13986 &lsquo;<samp>chroma_power</samp>&rsquo; and &lsquo;<samp>alpha_power</samp>&rsquo; default to the
13987 corresponding value set for &lsquo;<samp>luma_power</samp>&rsquo;.
13988 </p>
13989 <p>A value of 0 will disable the effect.
13990 </p></dd>
13991 </dl>
13992
13993 <a name="Examples-4"></a>
13994 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-4">33.8.1 Examples</a></h3>
13995
13996 <ul>
13997 <li>
13998 Apply a boxblur filter with luma, chroma, and alpha radius
13999 set to 2:
14000 <table><tr><td>&nbsp;</td><td><pre class="example">boxblur=luma_radius=2:luma_power=1
14001 boxblur=2:1
14002 </pre></td></tr></table>
14003
14004 </li><li>
14005 Set luma radius to 2, alpha and chroma radius to 0:
14006 <table><tr><td>&nbsp;</td><td><pre class="example">boxblur=2:1:cr=0:ar=0
14007 </pre></td></tr></table>
14008
14009 </li><li>
14010 Set luma and chroma radius to a fraction of the video dimension:
14011 <table><tr><td>&nbsp;</td><td><pre class="example">boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1
14012 </pre></td></tr></table>
14013 </li></ul>
14014
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.
14018 </p>
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.
14021 </p>
14022 <p>A positive adjustment value shifts the balance towards the primary color, a negative
14023 value towards the complementary color.
14024 </p>
14025 <p>The filter accepts the following options:
14026 </p>
14027 <dl compact="compact">
14028 <dt> &lsquo;<samp>rs</samp>&rsquo;</dt>
14029 <dt> &lsquo;<samp>gs</samp>&rsquo;</dt>
14030 <dt> &lsquo;<samp>bs</samp>&rsquo;</dt>
14031 <dd><p>Adjust red, green and blue shadows (darkest pixels).
14032 </p>
14033 </dd>
14034 <dt> &lsquo;<samp>rm</samp>&rsquo;</dt>
14035 <dt> &lsquo;<samp>gm</samp>&rsquo;</dt>
14036 <dt> &lsquo;<samp>bm</samp>&rsquo;</dt>
14037 <dd><p>Adjust red, green and blue midtones (medium pixels).
14038 </p>
14039 </dd>
14040 <dt> &lsquo;<samp>rh</samp>&rsquo;</dt>
14041 <dt> &lsquo;<samp>gh</samp>&rsquo;</dt>
14042 <dt> &lsquo;<samp>bh</samp>&rsquo;</dt>
14043 <dd><p>Adjust red, green and blue highlights (brightest pixels).
14044 </p>
14045 <p>Allowed ranges for options are <code>[-1.0, 1.0]</code>. Defaults are <code>0</code>.
14046 </p></dd>
14047 </dl>
14048
14049 <a name="Examples-89"></a>
14050 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-89">33.9.1 Examples</a></h3>
14051
14052 <ul>
14053 <li>
14054 Add red color cast to shadows:
14055 <table><tr><td>&nbsp;</td><td><pre class="example">colorbalance=rs=.3
14056 </pre></td></tr></table>
14057 </li></ul>
14058
14059 <a name="colorchannelmixer"></a>
14060 <h2 class="section"><a href="ffplay-all.html#toc-colorchannelmixer">33.10 colorchannelmixer</a></h2>
14061
14062 <p>Adjust video input frames by re-mixing color channels.
14063 </p>
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>&nbsp;</td><td><pre class="example"><var>red</var>=<var>red</var>*<var>rr</var> + <var>blue</var>*<var>rb</var> + <var>green</var>*<var>rg</var> + <var>alpha</var>*<var>ra</var>
14068 </pre></td></tr></table>
14069
14070 <p>The filter accepts the following options:
14071 </p>
14072 <dl compact="compact">
14073 <dt> &lsquo;<samp>rr</samp>&rsquo;</dt>
14074 <dt> &lsquo;<samp>rg</samp>&rsquo;</dt>
14075 <dt> &lsquo;<samp>rb</samp>&rsquo;</dt>
14076 <dt> &lsquo;<samp>ra</samp>&rsquo;</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>.
14079 </p>
14080 </dd>
14081 <dt> &lsquo;<samp>gr</samp>&rsquo;</dt>
14082 <dt> &lsquo;<samp>gg</samp>&rsquo;</dt>
14083 <dt> &lsquo;<samp>gb</samp>&rsquo;</dt>
14084 <dt> &lsquo;<samp>ga</samp>&rsquo;</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>.
14087 </p>
14088 </dd>
14089 <dt> &lsquo;<samp>br</samp>&rsquo;</dt>
14090 <dt> &lsquo;<samp>bg</samp>&rsquo;</dt>
14091 <dt> &lsquo;<samp>bb</samp>&rsquo;</dt>
14092 <dt> &lsquo;<samp>ba</samp>&rsquo;</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>.
14095 </p>
14096 </dd>
14097 <dt> &lsquo;<samp>ar</samp>&rsquo;</dt>
14098 <dt> &lsquo;<samp>ag</samp>&rsquo;</dt>
14099 <dt> &lsquo;<samp>ab</samp>&rsquo;</dt>
14100 <dt> &lsquo;<samp>aa</samp>&rsquo;</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>.
14103 </p>
14104 <p>Allowed ranges for options are <code>[-2.0, 2.0]</code>.
14105 </p></dd>
14106 </dl>
14107
14108 <a name="Examples-65"></a>
14109 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-65">33.10.1 Examples</a></h3>
14110
14111 <ul>
14112 <li>
14113 Convert source to grayscale:
14114 <table><tr><td>&nbsp;</td><td><pre class="example">colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
14115 </pre></td></tr></table>
14116 </li><li>
14117 Simulate sepia tones:
14118 <table><tr><td>&nbsp;</td><td><pre class="example">colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131
14119 </pre></td></tr></table>
14120 </li></ul>
14121
14122 <a name="colormatrix"></a>
14123 <h2 class="section"><a href="ffplay-all.html#toc-colormatrix">33.11 colormatrix</a></h2>
14124
14125 <p>Convert color matrix.
14126 </p>
14127 <p>The filter accepts the following options:
14128 </p>
14129 <dl compact="compact">
14130 <dt> &lsquo;<samp>src</samp>&rsquo;</dt>
14131 <dt> &lsquo;<samp>dst</samp>&rsquo;</dt>
14132 <dd><p>Specify the source and destination color matrix. Both values must be
14133 specified.
14134 </p>
14135 <p>The accepted values are:
14136 </p><dl compact="compact">
14137 <dt> &lsquo;<samp>bt709</samp>&rsquo;</dt>
14138 <dd><p>BT.709
14139 </p>
14140 </dd>
14141 <dt> &lsquo;<samp>bt601</samp>&rsquo;</dt>
14142 <dd><p>BT.601
14143 </p>
14144 </dd>
14145 <dt> &lsquo;<samp>smpte240m</samp>&rsquo;</dt>
14146 <dd><p>SMPTE-240M
14147 </p>
14148 </dd>
14149 <dt> &lsquo;<samp>fcc</samp>&rsquo;</dt>
14150 <dd><p>FCC
14151 </p></dd>
14152 </dl>
14153 </dd>
14154 </dl>
14155
14156 <p>For example to convert from BT.601 to SMPTE-240M, use the command:
14157 </p><table><tr><td>&nbsp;</td><td><pre class="example">colormatrix=bt601:smpte240m
14158 </pre></td></tr></table>
14159
14160 <a name="copy"></a>
14161 <h2 class="section"><a href="ffplay-all.html#toc-copy">33.12 copy</a></h2>
14162
14163 <p>Copy the input source unchanged to the output. Mainly useful for
14164 testing purposes.
14165 </p>
14166 <a name="crop"></a>
14167 <h2 class="section"><a href="ffplay-all.html#toc-crop">33.13 crop</a></h2>
14168
14169 <p>Crop the input video to given dimensions.
14170 </p>
14171 <p>The filter accepts the following options:
14172 </p>
14173 <dl compact="compact">
14174 <dt> &lsquo;<samp>w, out_w</samp>&rsquo;</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
14177 configuration.
14178 </p>
14179 </dd>
14180 <dt> &lsquo;<samp>h, out_h</samp>&rsquo;</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
14183 configuration.
14184 </p>
14185 </dd>
14186 <dt> &lsquo;<samp>x</samp>&rsquo;</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.
14190 </p>
14191 </dd>
14192 <dt> &lsquo;<samp>y</samp>&rsquo;</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.
14196 </p>
14197 </dd>
14198 <dt> &lsquo;<samp>keep_aspect</samp>&rsquo;</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.
14202 </p></dd>
14203 </dl>
14204
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:
14207 </p>
14208 <dl compact="compact">
14209 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
14210 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
14211 <dd><p>the computed values for <var>x</var> and <var>y</var>. They are evaluated for
14212 each new frame.
14213 </p>
14214 </dd>
14215 <dt> &lsquo;<samp>in_w</samp>&rsquo;</dt>
14216 <dt> &lsquo;<samp>in_h</samp>&rsquo;</dt>
14217 <dd><p>the input width and height
14218 </p>
14219 </dd>
14220 <dt> &lsquo;<samp>iw</samp>&rsquo;</dt>
14221 <dt> &lsquo;<samp>ih</samp>&rsquo;</dt>
14222 <dd><p>same as <var>in_w</var> and <var>in_h</var>
14223 </p>
14224 </dd>
14225 <dt> &lsquo;<samp>out_w</samp>&rsquo;</dt>
14226 <dt> &lsquo;<samp>out_h</samp>&rsquo;</dt>
14227 <dd><p>the output (cropped) width and height
14228 </p>
14229 </dd>
14230 <dt> &lsquo;<samp>ow</samp>&rsquo;</dt>
14231 <dt> &lsquo;<samp>oh</samp>&rsquo;</dt>
14232 <dd><p>same as <var>out_w</var> and <var>out_h</var>
14233 </p>
14234 </dd>
14235 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
14236 <dd><p>same as <var>iw</var> / <var>ih</var>
14237 </p>
14238 </dd>
14239 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
14240 <dd><p>input sample aspect ratio
14241 </p>
14242 </dd>
14243 <dt> &lsquo;<samp>dar</samp>&rsquo;</dt>
14244 <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
14245 </p>
14246 </dd>
14247 <dt> &lsquo;<samp>hsub</samp>&rsquo;</dt>
14248 <dt> &lsquo;<samp>vsub</samp>&rsquo;</dt>
14249 <dd><p>horizontal and vertical chroma subsample values. For example for the
14250 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
14251 </p>
14252 </dd>
14253 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
14254 <dd><p>the number of input frame, starting from 0
14255 </p>
14256 </dd>
14257 <dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
14258 <dd><p>the position in the file of the input frame, NAN if unknown
14259 </p>
14260 </dd>
14261 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
14262 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
14263 </p>
14264 </dd>
14265 </dl>
14266
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>.
14271 </p>
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.
14276 </p>
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>.
14279 </p>
14280 <a name="Examples-8"></a>
14281 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-8">33.13.1 Examples</a></h3>
14282
14283 <ul>
14284 <li>
14285 Crop area with size 100x100 at position (12,34).
14286 <table><tr><td>&nbsp;</td><td><pre class="example">crop=100:100:12:34
14287 </pre></td></tr></table>
14288
14289 <p>Using named options, the example above becomes:
14290 </p><table><tr><td>&nbsp;</td><td><pre class="example">crop=w=100:h=100:x=12:y=34
14291 </pre></td></tr></table>
14292
14293 </li><li>
14294 Crop the central input area with size 100x100:
14295 <table><tr><td>&nbsp;</td><td><pre class="example">crop=100:100
14296 </pre></td></tr></table>
14297
14298 </li><li>
14299 Crop the central input area with size 2/3 of the input video:
14300 <table><tr><td>&nbsp;</td><td><pre class="example">crop=2/3*in_w:2/3*in_h
14301 </pre></td></tr></table>
14302
14303 </li><li>
14304 Crop the input video central square:
14305 <table><tr><td>&nbsp;</td><td><pre class="example">crop=out_w=in_h
14306 crop=in_h
14307 </pre></td></tr></table>
14308
14309 </li><li>
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>&nbsp;</td><td><pre class="example">crop=in_w-100:in_h-100:100:100
14314 </pre></td></tr></table>
14315
14316 </li><li>
14317 Crop 10 pixels from the left and right borders, and 20 pixels from
14318 the top and bottom borders
14319 <table><tr><td>&nbsp;</td><td><pre class="example">crop=in_w-2*10:in_h-2*20
14320 </pre></td></tr></table>
14321
14322 </li><li>
14323 Keep only the bottom right quarter of the input image:
14324 <table><tr><td>&nbsp;</td><td><pre class="example">crop=in_w/2:in_h/2:in_w/2:in_h/2
14325 </pre></td></tr></table>
14326
14327 </li><li>
14328 Crop height for getting Greek harmony:
14329 <table><tr><td>&nbsp;</td><td><pre class="example">crop=in_w:1/PHI*in_w
14330 </pre></td></tr></table>
14331
14332 </li><li>
14333 Appply trembling effect:
14334 <table><tr><td>&nbsp;</td><td><pre class="example">crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(n/7)
14335 </pre></td></tr></table>
14336
14337 </li><li>
14338 Apply erratic camera effect depending on timestamp:
14339 <table><tr><td>&nbsp;</td><td><pre class="example">crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(t*10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t*13)&quot;
14340 </pre></td></tr></table>
14341
14342 </li><li>
14343 Set x depending on the value of y:
14344 <table><tr><td>&nbsp;</td><td><pre class="example">crop=in_w/2:in_h/2:y:10+10*sin(n/10)
14345 </pre></td></tr></table>
14346 </li></ul>
14347
14348 <a name="cropdetect"></a>
14349 <h2 class="section"><a href="ffplay-all.html#toc-cropdetect">33.14 cropdetect</a></h2>
14350
14351 <p>Auto-detect crop size.
14352 </p>
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.
14356 </p>
14357 <p>The filter accepts the following options:
14358 </p>
14359 <dl compact="compact">
14360 <dt> &lsquo;<samp>limit</samp>&rsquo;</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.
14364 </p>
14365 </dd>
14366 <dt> &lsquo;<samp>round</samp>&rsquo;</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.
14371 </p>
14372 </dd>
14373 <dt> &lsquo;<samp>reset_count, reset</samp>&rsquo;</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.
14377 </p>
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
14380 playback.
14381 </p></dd>
14382 </dl>
14383
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>
14387
14388 <p>Apply color adjustments using curves.
14389 </p>
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
14394 the output frame.
14395 </p>
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 &quot;adjusted&quot; to its own value, which means no change to the image.
14399 </p>
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.
14406 </p>
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.
14410 </p>
14411 <p>The filter accepts the following options:
14412 </p>
14413 <dl compact="compact">
14414 <dt> &lsquo;<samp>preset</samp>&rsquo;</dt>
14415 <dd><p>Select one of the available color presets. This option can be used in addition
14416 to the &lsquo;<samp>r</samp>&rsquo;, &lsquo;<samp>g</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; 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> &lsquo;<samp>none</samp>&rsquo;</dt>
14421 <dt> &lsquo;<samp>color_negative</samp>&rsquo;</dt>
14422 <dt> &lsquo;<samp>cross_process</samp>&rsquo;</dt>
14423 <dt> &lsquo;<samp>darker</samp>&rsquo;</dt>
14424 <dt> &lsquo;<samp>increase_contrast</samp>&rsquo;</dt>
14425 <dt> &lsquo;<samp>lighter</samp>&rsquo;</dt>
14426 <dt> &lsquo;<samp>linear_contrast</samp>&rsquo;</dt>
14427 <dt> &lsquo;<samp>medium_contrast</samp>&rsquo;</dt>
14428 <dt> &lsquo;<samp>negative</samp>&rsquo;</dt>
14429 <dt> &lsquo;<samp>strong_contrast</samp>&rsquo;</dt>
14430 <dt> &lsquo;<samp>vintage</samp>&rsquo;</dt>
14431 </dl>
14432 <p>Default is <code>none</code>.
14433 </p></dd>
14434 <dt> &lsquo;<samp>master, m</samp>&rsquo;</dt>
14435 <dd><p>Set the master key points. These points will define a second pass mapping. It
14436 is sometimes called a &quot;luminance&quot; or &quot;value&quot; mapping. It can be used with
14437 &lsquo;<samp>r</samp>&rsquo;, &lsquo;<samp>g</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; or &lsquo;<samp>all</samp>&rsquo; since it acts like a
14438 post-processing LUT.
14439 </p></dd>
14440 <dt> &lsquo;<samp>red, r</samp>&rsquo;</dt>
14441 <dd><p>Set the key points for the red component.
14442 </p></dd>
14443 <dt> &lsquo;<samp>green, g</samp>&rsquo;</dt>
14444 <dd><p>Set the key points for the green component.
14445 </p></dd>
14446 <dt> &lsquo;<samp>blue, b</samp>&rsquo;</dt>
14447 <dd><p>Set the key points for the blue component.
14448 </p></dd>
14449 <dt> &lsquo;<samp>all</samp>&rsquo;</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 &lsquo;<samp>all</samp>&rsquo; setting.
14454 </p></dd>
14455 <dt> &lsquo;<samp>psfile</samp>&rsquo;</dt>
14456 <dd><p>Specify a Photoshop curves file (<code>.asv</code>) to import the settings from.
14457 </p></dd>
14458 </dl>
14459
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>.
14462 </p>
14463 <a name="Examples-75"></a>
14464 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-75">33.15.1 Examples</a></h3>
14465
14466 <ul>
14467 <li>
14468 Increase slightly the middle level of blue:
14469 <table><tr><td>&nbsp;</td><td><pre class="example">curves=blue='0.5/0.58'
14470 </pre></td></tr></table>
14471
14472 </li><li>
14473 Vintage effect:
14474 <table><tr><td>&nbsp;</td><td><pre class="example">curves=r='0/0.11 .42/.51 1/0.95':g='0.50/0.48':b='0/0.22 .49/.44 1/0.8'
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>
14480 </p></dd>
14481 <dt> <var>green</var></dt>
14482 <dd><p><code>(0;0) (0.50;0.48) (1;1)</code>
14483 </p></dd>
14484 <dt> <var>blue</var></dt>
14485 <dd><p><code>(0;0.22) (0.49;0.44) (1;0.80)</code>
14486 </p></dd>
14487 </dl>
14488
14489 </li><li>
14490 The previous example can also be achieved with the associated built-in preset:
14491 <table><tr><td>&nbsp;</td><td><pre class="example">curves=preset=vintage
14492 </pre></td></tr></table>
14493
14494 </li><li>
14495 Or simply:
14496 <table><tr><td>&nbsp;</td><td><pre class="example">curves=vintage
14497 </pre></td></tr></table>
14498
14499 </li><li>
14500 Use a Photoshop preset and redefine the points of the green component:
14501 <table><tr><td>&nbsp;</td><td><pre class="example">curves=psfile='MyCurvesPresets/purple.asv':green='0.45/0.53'
14502 </pre></td></tr></table>
14503 </li></ul>
14504
14505 <a name="dctdnoiz"></a>
14506 <h2 class="section"><a href="ffplay-all.html#toc-dctdnoiz">33.16 dctdnoiz</a></h2>
14507
14508 <p>Denoise frames using 2D DCT (frequency domain filtering).
14509 </p>
14510 <p>This filter is not designed for real time and can be extremely slow.
14511 </p>
14512 <p>The filter accepts the following options:
14513 </p>
14514 <dl compact="compact">
14515 <dt> &lsquo;<samp>sigma, s</samp>&rsquo;</dt>
14516 <dd><p>Set the noise sigma constant.
14517 </p>
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.
14520 </p>
14521 <p>If you need a more advanced filtering, see &lsquo;<samp>expr</samp>&rsquo;.
14522 </p>
14523 <p>Default is <code>0</code>.
14524 </p>
14525 </dd>
14526 <dt> &lsquo;<samp>overlap</samp>&rsquo;</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.
14530 </p>
14531 <p>If the overlapping value doesn&rsquo;t allow to process the whole input width or
14532 height, a warning will be displayed and according borders won&rsquo;t be denoised.
14533 </p>
14534 <p>Default value is <code>15</code>.
14535 </p>
14536 </dd>
14537 <dt> &lsquo;<samp>expr, e</samp>&rsquo;</dt>
14538 <dd><p>Set the coefficient factor expression.
14539 </p>
14540 <p>For each coefficient of a DCT block, this expression will be evaluated as a
14541 multiplier value for the coefficient.
14542 </p>
14543 <p>If this is option is set, the &lsquo;<samp>sigma</samp>&rsquo; option will be ignored.
14544 </p>
14545 <p>The absolute value of the coefficient can be accessed through the <var>c</var>
14546 variable.
14547 </p></dd>
14548 </dl>
14549
14550 <a name="Examples-20"></a>
14551 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-20">33.16.1 Examples</a></h3>
14552
14553 <p>Apply a denoise with a &lsquo;<samp>sigma</samp>&rsquo; of <code>4.5</code>:
14554 </p><table><tr><td>&nbsp;</td><td><pre class="example">dctdnoiz=4.5
14555 </pre></td></tr></table>
14556
14557 <p>The same operation can be achieved using the expression system:
14558 </p><table><tr><td>&nbsp;</td><td><pre class="example">dctdnoiz=e='gte(c, 4.5*3)'
14559 </pre></td></tr></table>
14560
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>
14564
14565 <p>Drop duplicated frames at regular intervals.
14566 </p>
14567 <p>The filter accepts the following options:
14568 </p>
14569 <dl compact="compact">
14570 <dt> &lsquo;<samp>cycle</samp>&rsquo;</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>.
14574 </p>
14575 </dd>
14576 <dt> &lsquo;<samp>dupthresh</samp>&rsquo;</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>
14580 </p>
14581 </dd>
14582 <dt> &lsquo;<samp>scthresh</samp>&rsquo;</dt>
14583 <dd><p>Set scene change threshold. Default is <code>15</code>.
14584 </p>
14585 </dd>
14586 <dt> &lsquo;<samp>blockx</samp>&rsquo;</dt>
14587 <dt> &lsquo;<samp>blocky</samp>&rsquo;</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>.
14591 </p>
14592 </dd>
14593 <dt> &lsquo;<samp>ppsrc</samp>&rsquo;</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
14599 <code>0</code>.
14600 </p>
14601 </dd>
14602 <dt> &lsquo;<samp>chroma</samp>&rsquo;</dt>
14603 <dd><p>Set whether or not chroma is considered in the metric calculations. Default is
14604 <code>1</code>.
14605 </p></dd>
14606 </dl>
14607
14608 <a name="delogo"></a>
14609 <h2 class="section"><a href="ffplay-all.html#toc-delogo">33.18 delogo</a></h2>
14610
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).
14614 </p>
14615 <p>This filter accepts the following options:
14616 </p><dl compact="compact">
14617 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
14618 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
14619 <dd><p>Specify the top left corner coordinates of the logo. They must be
14620 specified.
14621 </p>
14622 </dd>
14623 <dt> &lsquo;<samp>w</samp>&rsquo;</dt>
14624 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
14625 <dd><p>Specify the width and height of the logo to clear. They must be
14626 specified.
14627 </p>
14628 </dd>
14629 <dt> &lsquo;<samp>band, t</samp>&rsquo;</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.
14632 </p>
14633 </dd>
14634 <dt> &lsquo;<samp>show</samp>&rsquo;</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.
14638 </p>
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.
14643 </p>
14644 </dd>
14645 </dl>
14646
14647 <a name="Examples-44"></a>
14648 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-44">33.18.1 Examples</a></h3>
14649
14650 <ul>
14651 <li>
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>&nbsp;</td><td><pre class="example">delogo=x=0:y=0:w=100:h=77:band=10
14655 </pre></td></tr></table>
14656
14657 </li></ul>
14658
14659 <a name="deshake"></a>
14660 <h2 class="section"><a href="ffplay-all.html#toc-deshake">33.19 deshake</a></h2>
14661
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.
14665 </p>
14666 <p>The filter accepts the following options:
14667 </p>
14668 <dl compact="compact">
14669 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
14670 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
14671 <dt> &lsquo;<samp>w</samp>&rsquo;</dt>
14672 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
14673 <dd><p>Specify a rectangular area where to limit the search for motion
14674 vectors.
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
14679 box.
14680 </p>
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.
14683 </p>
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.
14687 </p>
14688 <p>Default - search the whole frame.
14689 </p>
14690 </dd>
14691 <dt> &lsquo;<samp>rx</samp>&rsquo;</dt>
14692 <dt> &lsquo;<samp>ry</samp>&rsquo;</dt>
14693 <dd><p>Specify the maximum extent of movement in x and y directions in the
14694 range 0-64 pixels. Default 16.
14695 </p>
14696 </dd>
14697 <dt> &lsquo;<samp>edge</samp>&rsquo;</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> &lsquo;<samp>blank, 0</samp>&rsquo;</dt>
14702 <dd><p>Fill zeroes at blank locations
14703 </p></dd>
14704 <dt> &lsquo;<samp>original, 1</samp>&rsquo;</dt>
14705 <dd><p>Original image at blank locations
14706 </p></dd>
14707 <dt> &lsquo;<samp>clamp, 2</samp>&rsquo;</dt>
14708 <dd><p>Extruded edge value at blank locations
14709 </p></dd>
14710 <dt> &lsquo;<samp>mirror, 3</samp>&rsquo;</dt>
14711 <dd><p>Mirrored edge at blank locations
14712 </p></dd>
14713 </dl>
14714 <p>Default value is &lsquo;<samp>mirror</samp>&rsquo;.
14715 </p>
14716 </dd>
14717 <dt> &lsquo;<samp>blocksize</samp>&rsquo;</dt>
14718 <dd><p>Specify the blocksize to use for motion search. Range 4-128 pixels,
14719 default 8.
14720 </p>
14721 </dd>
14722 <dt> &lsquo;<samp>contrast</samp>&rsquo;</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.
14726 </p>
14727 </dd>
14728 <dt> &lsquo;<samp>search</samp>&rsquo;</dt>
14729 <dd><p>Specify the search strategy. Available values are:
14730 </p><dl compact="compact">
14731 <dt> &lsquo;<samp>exhaustive, 0</samp>&rsquo;</dt>
14732 <dd><p>Set exhaustive search
14733 </p></dd>
14734 <dt> &lsquo;<samp>less, 1</samp>&rsquo;</dt>
14735 <dd><p>Set less exhaustive search.
14736 </p></dd>
14737 </dl>
14738 <p>Default value is &lsquo;<samp>exhaustive</samp>&rsquo;.
14739 </p>
14740 </dd>
14741 <dt> &lsquo;<samp>filename</samp>&rsquo;</dt>
14742 <dd><p>If set then a detailed log of the motion search is written to the
14743 specified file.
14744 </p>
14745 </dd>
14746 <dt> &lsquo;<samp>opencl</samp>&rsquo;</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.
14749 </p>
14750 </dd>
14751 </dl>
14752
14753 <a name="drawbox"></a>
14754 <h2 class="section"><a href="ffplay-all.html#toc-drawbox">33.20 drawbox</a></h2>
14755
14756 <p>Draw a colored box on the input image.
14757 </p>
14758 <p>This filter accepts the following options:
14759 </p>
14760 <dl compact="compact">
14761 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
14762 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
14763 <dd><p>The expressions which specify the top left corner coordinates of the box. Default to 0.
14764 </p>
14765 </dd>
14766 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
14767 <dt> &lsquo;<samp>height, h</samp>&rsquo;</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.
14770 </p>
14771 </dd>
14772 <dt> &lsquo;<samp>color, c</samp>&rsquo;</dt>
14773 <dd><p>Specify the color of the box to write. For the general syntax of this option,
14774 check the &quot;Color&quot; 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.
14777 </p>
14778 </dd>
14779 <dt> &lsquo;<samp>thickness, t</samp>&rsquo;</dt>
14780 <dd><p>The expression which sets the thickness of the box edge. Default value is <code>3</code>.
14781 </p>
14782 <p>See below for the list of accepted constants.
14783 </p></dd>
14784 </dl>
14785
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:
14788 </p>
14789 <dl compact="compact">
14790 <dt> &lsquo;<samp>dar</samp>&rsquo;</dt>
14791 <dd><p>The input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>.
14792 </p>
14793 </dd>
14794 <dt> &lsquo;<samp>hsub</samp>&rsquo;</dt>
14795 <dt> &lsquo;<samp>vsub</samp>&rsquo;</dt>
14796 <dd><p>horizontal and vertical chroma subsample values. For example for the
14797 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
14798 </p>
14799 </dd>
14800 <dt> &lsquo;<samp>in_h, ih</samp>&rsquo;</dt>
14801 <dt> &lsquo;<samp>in_w, iw</samp>&rsquo;</dt>
14802 <dd><p>The input width and height.
14803 </p>
14804 </dd>
14805 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
14806 <dd><p>The input sample aspect ratio.
14807 </p>
14808 </dd>
14809 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
14810 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
14811 <dd><p>The x and y offset coordinates where the box is drawn.
14812 </p>
14813 </dd>
14814 <dt> &lsquo;<samp>w</samp>&rsquo;</dt>
14815 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
14816 <dd><p>The width and height of the drawn box.
14817 </p>
14818 </dd>
14819 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
14820 <dd><p>The thickness of the drawn box.
14821 </p>
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>.
14824 </p>
14825 </dd>
14826 </dl>
14827
14828 <a name="Examples-86"></a>
14829 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-86">33.20.1 Examples</a></h3>
14830
14831 <ul>
14832 <li>
14833 Draw a black box around the edge of the input image:
14834 <table><tr><td>&nbsp;</td><td><pre class="example">drawbox
14835 </pre></td></tr></table>
14836
14837 </li><li>
14838 Draw a box with color red and an opacity of 50%:
14839 <table><tr><td>&nbsp;</td><td><pre class="example">drawbox=10:20:200:60:red@0.5
14840 </pre></td></tr></table>
14841
14842 <p>The previous example can be specified as:
14843 </p><table><tr><td>&nbsp;</td><td><pre class="example">drawbox=x=10:y=20:w=200:h=60:color=red@0.5
14844 </pre></td></tr></table>
14845
14846 </li><li>
14847 Fill the box with pink color:
14848 <table><tr><td>&nbsp;</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>
14850
14851 </li><li>
14852 Draw a 2-pixel red 2.40:1 mask:
14853 <table><tr><td>&nbsp;</td><td><pre class="example">drawbox=x=-t:y=0.5*(ih-iw/2.4)-t:w=iw+t*2:h=iw/2.4+t*2:t=2:c=red
14854 </pre></td></tr></table>
14855 </li></ul>
14856
14857 <a name="drawgrid"></a>
14858 <h2 class="section"><a href="ffplay-all.html#toc-drawgrid">33.21 drawgrid</a></h2>
14859
14860 <p>Draw a grid on the input image.
14861 </p>
14862 <p>This filter accepts the following options:
14863 </p>
14864 <dl compact="compact">
14865 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
14866 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
14867 <dd><p>The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0.
14868 </p>
14869 </dd>
14870 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
14871 <dt> &lsquo;<samp>height, h</samp>&rsquo;</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.
14875 </p>
14876 </dd>
14877 <dt> &lsquo;<samp>color, c</samp>&rsquo;</dt>
14878 <dd><p>Specify the color of the grid. For the general syntax of this option,
14879 check the &quot;Color&quot; 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.
14882 </p>
14883 </dd>
14884 <dt> &lsquo;<samp>thickness, t</samp>&rsquo;</dt>
14885 <dd><p>The expression which sets the thickness of the grid line. Default value is <code>1</code>.
14886 </p>
14887 <p>See below for the list of accepted constants.
14888 </p></dd>
14889 </dl>
14890
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:
14893 </p>
14894 <dl compact="compact">
14895 <dt> &lsquo;<samp>dar</samp>&rsquo;</dt>
14896 <dd><p>The input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>.
14897 </p>
14898 </dd>
14899 <dt> &lsquo;<samp>hsub</samp>&rsquo;</dt>
14900 <dt> &lsquo;<samp>vsub</samp>&rsquo;</dt>
14901 <dd><p>horizontal and vertical chroma subsample values. For example for the
14902 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
14903 </p>
14904 </dd>
14905 <dt> &lsquo;<samp>in_h, ih</samp>&rsquo;</dt>
14906 <dt> &lsquo;<samp>in_w, iw</samp>&rsquo;</dt>
14907 <dd><p>The input grid cell width and height.
14908 </p>
14909 </dd>
14910 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
14911 <dd><p>The input sample aspect ratio.
14912 </p>
14913 </dd>
14914 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
14915 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
14916 <dd><p>The x and y coordinates of some point of grid intersection (meant to configure offset).
14917 </p>
14918 </dd>
14919 <dt> &lsquo;<samp>w</samp>&rsquo;</dt>
14920 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
14921 <dd><p>The width and height of the drawn cell.
14922 </p>
14923 </dd>
14924 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
14925 <dd><p>The thickness of the drawn cell.
14926 </p>
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>.
14929 </p>
14930 </dd>
14931 </dl>
14932
14933 <a name="Examples-36"></a>
14934 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-36">33.21.1 Examples</a></h3>
14935
14936 <ul>
14937 <li>
14938 Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an opacity of 50%:
14939 <table><tr><td>&nbsp;</td><td><pre class="example">drawgrid=width=100:height=100:thickness=2:color=red@0.5
14940 </pre></td></tr></table>
14941
14942 </li><li>
14943 Draw a white 3x3 grid with an opacity of 50%:
14944 <table><tr><td>&nbsp;</td><td><pre class="example">drawgrid=w=iw/3:h=ih/3:t=2:c=white@0.5
14945 </pre></td></tr></table>
14946 </li></ul>
14947
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>
14951
14952 <p>Draw text string or text from specified file on top of video using the
14953 libfreetype library.
14954 </p>
14955 <p>To enable compilation of this filter you need to configure FFmpeg with
14956 <code>--enable-libfreetype</code>.
14957 </p>
14958 <a name="Syntax"></a>
14959 <h3 class="subsection"><a href="ffplay-all.html#toc-Syntax">33.22.1 Syntax</a></h3>
14960
14961 <p>The description of the accepted parameters follows.
14962 </p>
14963 <dl compact="compact">
14964 <dt> &lsquo;<samp>box</samp>&rsquo;</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.
14968 </p>
14969 </dd>
14970 <dt> &lsquo;<samp>boxcolor</samp>&rsquo;</dt>
14971 <dd><p>The color to be used for drawing box around text. For the syntax of this
14972 option, check the &quot;Color&quot; section in the ffmpeg-utils manual.
14973 </p>
14974 <p>The default value of <var>boxcolor</var> is &quot;white&quot;.
14975 </p>
14976 </dd>
14977 <dt> &lsquo;<samp>expansion</samp>&rsquo;</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
14981 below for details.
14982 </p>
14983 </dd>
14984 <dt> &lsquo;<samp>fix_bounds</samp>&rsquo;</dt>
14985 <dd><p>If true, check and fix text coords to avoid clipping.
14986 </p>
14987 </dd>
14988 <dt> &lsquo;<samp>fontcolor</samp>&rsquo;</dt>
14989 <dd><p>The color to be used for drawing fonts. For the syntax of this option, check
14990 the &quot;Color&quot; section in the ffmpeg-utils manual.
14991 </p>
14992 <p>The default value of <var>fontcolor</var> is &quot;black&quot;.
14993 </p>
14994 </dd>
14995 <dt> &lsquo;<samp>fontfile</samp>&rsquo;</dt>
14996 <dd><p>The font file to be used for drawing text. Path must be included.
14997 This parameter is mandatory.
14998 </p>
14999 </dd>
15000 <dt> &lsquo;<samp>fontsize</samp>&rsquo;</dt>
15001 <dd><p>The font size to be used for drawing text.
15002 The default value of <var>fontsize</var> is 16.
15003 </p>
15004 </dd>
15005 <dt> &lsquo;<samp>ft_load_flags</samp>&rsquo;</dt>
15006 <dd><p>Flags to be used for loading the fonts.
15007 </p>
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>
15026 </dl>
15027
15028 <p>Default value is &quot;render&quot;.
15029 </p>
15030 <p>For more information consult the documentation for the FT_LOAD_*
15031 libfreetype flags.
15032 </p>
15033 </dd>
15034 <dt> &lsquo;<samp>shadowcolor</samp>&rsquo;</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 &quot;Color&quot; section in the ffmpeg-utils manual.
15037 </p>
15038 <p>The default value of <var>shadowcolor</var> is &quot;black&quot;.
15039 </p>
15040 </dd>
15041 <dt> &lsquo;<samp>shadowx</samp>&rsquo;</dt>
15042 <dt> &lsquo;<samp>shadowy</samp>&rsquo;</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 &quot;0&quot;.
15046 </p>
15047 </dd>
15048 <dt> &lsquo;<samp>start_number</samp>&rsquo;</dt>
15049 <dd><p>The starting frame number for the n/frame_num variable. The default value
15050 is &quot;0&quot;.
15051 </p>
15052 </dd>
15053 <dt> &lsquo;<samp>tabsize</samp>&rsquo;</dt>
15054 <dd><p>The size in number of spaces to use for rendering the tab.
15055 Default value is 4.
15056 </p>
15057 </dd>
15058 <dt> &lsquo;<samp>timecode</samp>&rsquo;</dt>
15059 <dd><p>Set the initial timecode representation in &quot;hh:mm:ss[:;.]ff&quot;
15060 format. It can be used with or without text parameter. <var>timecode_rate</var>
15061 option must be specified.
15062 </p>
15063 </dd>
15064 <dt> &lsquo;<samp>timecode_rate, rate, r</samp>&rsquo;</dt>
15065 <dd><p>Set the timecode frame rate (timecode only).
15066 </p>
15067 </dd>
15068 <dt> &lsquo;<samp>text</samp>&rsquo;</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>.
15073 </p>
15074 </dd>
15075 <dt> &lsquo;<samp>textfile</samp>&rsquo;</dt>
15076 <dd><p>A text file containing text to be drawn. The text must be a sequence
15077 of UTF-8 encoded characters.
15078 </p>
15079 <p>This parameter is mandatory if no text string is specified with the
15080 parameter <var>text</var>.
15081 </p>
15082 <p>If both <var>text</var> and <var>textfile</var> are specified, an error is thrown.
15083 </p>
15084 </dd>
15085 <dt> &lsquo;<samp>reload</samp>&rsquo;</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.
15088 </p>
15089 </dd>
15090 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
15091 <dt> &lsquo;<samp>y</samp>&rsquo;</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
15094 output image.
15095 </p>
15096 <p>The default value of <var>x</var> and <var>y</var> is &quot;0&quot;.
15097 </p>
15098 <p>See below for the list of accepted constants and functions.
15099 </p></dd>
15100 </dl>
15101
15102 <p>The parameters for <var>x</var> and <var>y</var> are expressions containing the
15103 following constants and functions:
15104 </p>
15105 <dl compact="compact">
15106 <dt> &lsquo;<samp>dar</samp>&rsquo;</dt>
15107 <dd><p>input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>
15108 </p>
15109 </dd>
15110 <dt> &lsquo;<samp>hsub</samp>&rsquo;</dt>
15111 <dt> &lsquo;<samp>vsub</samp>&rsquo;</dt>
15112 <dd><p>horizontal and vertical chroma subsample values. For example for the
15113 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
15114 </p>
15115 </dd>
15116 <dt> &lsquo;<samp>line_h, lh</samp>&rsquo;</dt>
15117 <dd><p>the height of each text line
15118 </p>
15119 </dd>
15120 <dt> &lsquo;<samp>main_h, h, H</samp>&rsquo;</dt>
15121 <dd><p>the input height
15122 </p>
15123 </dd>
15124 <dt> &lsquo;<samp>main_w, w, W</samp>&rsquo;</dt>
15125 <dd><p>the input width
15126 </p>
15127 </dd>
15128 <dt> &lsquo;<samp>max_glyph_a, ascent</samp>&rsquo;</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
15131 glyphs.
15132 It is a positive value, due to the grid&rsquo;s orientation with the Y axis
15133 upwards.
15134 </p>
15135 </dd>
15136 <dt> &lsquo;<samp>max_glyph_d, descent</samp>&rsquo;</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&rsquo;s orientation, with the Y axis
15140 upwards.
15141 </p>
15142 </dd>
15143 <dt> &lsquo;<samp>max_glyph_h</samp>&rsquo;</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>.
15147 </p>
15148 </dd>
15149 <dt> &lsquo;<samp>max_glyph_w</samp>&rsquo;</dt>
15150 <dd><p>maximum glyph width, that is the maximum width for all the glyphs
15151 contained in the rendered text
15152 </p>
15153 </dd>
15154 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
15155 <dd><p>the number of input frame, starting from 0
15156 </p>
15157 </dd>
15158 <dt> &lsquo;<samp>rand(min, max)</samp>&rsquo;</dt>
15159 <dd><p>return a random number included between <var>min</var> and <var>max</var>
15160 </p>
15161 </dd>
15162 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
15163 <dd><p>input sample aspect ratio
15164 </p>
15165 </dd>
15166 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
15167 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
15168 </p>
15169 </dd>
15170 <dt> &lsquo;<samp>text_h, th</samp>&rsquo;</dt>
15171 <dd><p>the height of the rendered text
15172 </p>
15173 </dd>
15174 <dt> &lsquo;<samp>text_w, tw</samp>&rsquo;</dt>
15175 <dd><p>the width of the rendered text
15176 </p>
15177 </dd>
15178 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
15179 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
15180 <dd><p>the x and y offset coordinates where the text is drawn.
15181 </p>
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>.
15184 </p></dd>
15185 </dl>
15186
15187 <p>If libavfilter was built with <code>--enable-fontconfig</code>, then
15188 &lsquo;<samp>fontfile</samp>&rsquo; can be a fontconfig pattern or omitted.
15189 </p>
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>
15193
15194 <p>If &lsquo;<samp>expansion</samp>&rsquo; 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.
15198 </p>
15199 <p>If &lsquo;<samp>expansion</samp>&rsquo; is set to <code>none</code>, the text is printed verbatim.
15200 </p>
15201 <p>If &lsquo;<samp>expansion</samp>&rsquo; is set to <code>normal</code> (which is the default),
15202 the following expansion mechanism is used.
15203 </p>
15204 <p>The backslash character &rsquo;\&rsquo;, followed by any character, always expands to
15205 the second character.
15206 </p>
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 &rsquo;:&rsquo;.
15209 If the arguments contain special characters or delimiters (&rsquo;:&rsquo; or &rsquo;}&rsquo;),
15210 they should be escaped.
15211 </p>
15212 <p>Note that they probably must also be escaped as the value for the
15213 &lsquo;<samp>text</samp>&rsquo; 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
15216 problems.
15217 </p>
15218 <p>The following functions are available:
15219 </p>
15220 <dl compact="compact">
15221 <dt> <code>expr, e</code></dt>
15222 <dd><p>The expression evaluation result.
15223 </p>
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
15229 value.
15230 </p>
15231 </dd>
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.
15235 </p>
15236 </dd>
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.
15240 </p>
15241 </dd>
15242 <dt> <code>metadata</code></dt>
15243 <dd><p>Frame metadata. It must take one argument specifying metadata key.
15244 </p>
15245 </dd>
15246 <dt> <code>n, frame_num</code></dt>
15247 <dd><p>The frame number, starting from 0.
15248 </p>
15249 </dd>
15250 <dt> <code>pict_type</code></dt>
15251 <dd><p>A 1 character description of the current picture type.
15252 </p>
15253 </dd>
15254 <dt> <code>pts</code></dt>
15255 <dd><p>The timestamp of the current frame, in seconds, with microsecond accuracy.
15256 </p>
15257 </dd>
15258 </dl>
15259
15260 <a name="Examples-58"></a>
15261 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-58">33.22.3 Examples</a></h3>
15262
15263 <ul>
15264 <li>
15265 Draw &quot;Test Text&quot; with font FreeSerif, using the default values for the
15266 optional parameters.
15267
15268 <table><tr><td>&nbsp;</td><td><pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'&quot;
15269 </pre></td></tr></table>
15270
15271 </li><li>
15272 Draw &rsquo;Test Text&rsquo; 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
15275 opacity of 20%.
15276
15277 <table><tr><td>&nbsp;</td><td><pre class="example">drawtext=&quot;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&quot;
15279 </pre></td></tr></table>
15280
15281 <p>Note that the double quotes are not necessary if spaces are not used
15282 within the parameter list.
15283 </p>
15284 </li><li>
15285 Show the text at the center of the video frame:
15286 <table><tr><td>&nbsp;</td><td><pre class="example">drawtext=&quot;fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h-line_h)/2&quot;
15287 </pre></td></tr></table>
15288
15289 </li><li>
15290 Show a text line sliding from right to left in the last row of the video
15291 frame. The file &lsquo;<tt>LONG_LINE</tt>&rsquo; is assumed to contain a single line
15292 with no newlines.
15293 <table><tr><td>&nbsp;</td><td><pre class="example">drawtext=&quot;fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t&quot;
15294 </pre></td></tr></table>
15295
15296 </li><li>
15297 Show the content of file &lsquo;<tt>CREDITS</tt>&rsquo; off the bottom of the frame and scroll up.
15298 <table><tr><td>&nbsp;</td><td><pre class="example">drawtext=&quot;fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t&quot;
15299 </pre></td></tr></table>
15300
15301 </li><li>
15302 Draw a single green letter &quot;g&quot;, at the center of the input video.
15303 The glyph baseline is placed at half screen height.
15304 <table><tr><td>&nbsp;</td><td><pre class="example">drawtext=&quot;fontsize=60:fontfile=FreeSerif.ttf:fontcolor=green:text=g:x=(w-max_glyph_w)/2:y=h/2-ascent&quot;
15305 </pre></td></tr></table>
15306
15307 </li><li>
15308 Show text for 1 second every 3 seconds:
15309 <table><tr><td>&nbsp;</td><td><pre class="example">drawtext=&quot;fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:enable=lt(mod(t\,3)\,1):text='blink'&quot;
15310 </pre></td></tr></table>
15311
15312 </li><li>
15313 Use fontconfig to set the font. Note that the colons need to be escaped.
15314 <table><tr><td>&nbsp;</td><td><pre class="example">drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg'
15315 </pre></td></tr></table>
15316
15317 </li><li>
15318 Print the date of a real-time encoding (see strftime(3)):
15319 <table><tr><td>&nbsp;</td><td><pre class="example">drawtext='fontfile=FreeSans.ttf:text=%{localtime:%a %b %d %Y}'
15320 </pre></td></tr></table>
15321
15322 </li></ul>
15323
15324 <p>For more information about libfreetype, check:
15325 <a href="http://www.freetype.org/">http://www.freetype.org/</a>.
15326 </p>
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>.
15329 </p>
15330 <a name="edgedetect"></a>
15331 <h2 class="section"><a href="ffplay-all.html#toc-edgedetect">33.23 edgedetect</a></h2>
15332
15333 <p>Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
15334 </p>
15335 <p>The filter accepts the following options:
15336 </p>
15337 <dl compact="compact">
15338 <dt> &lsquo;<samp>low</samp>&rsquo;</dt>
15339 <dt> &lsquo;<samp>high</samp>&rsquo;</dt>
15340 <dd><p>Set low and high threshold values used by the Canny thresholding
15341 algorithm.
15342 </p>
15343 <p>The high threshold selects the &quot;strong&quot; edge pixels, which are then
15344 connected through 8-connectivity with the &quot;weak&quot; edge pixels selected
15345 by the low threshold.
15346 </p>
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>.
15349 </p>
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>.
15352 </p></dd>
15353 </dl>
15354
15355 <p>Example:
15356 </p><table><tr><td>&nbsp;</td><td><pre class="example">edgedetect=low=0.1:high=0.4
15357 </pre></td></tr></table>
15358
15359 <a name="extractplanes"></a>
15360 <h2 class="section"><a href="ffplay-all.html#toc-extractplanes">33.24 extractplanes</a></h2>
15361
15362 <p>Extract color channel components from input video stream into
15363 separate grayscale video streams.
15364 </p>
15365 <p>The filter accepts the following option:
15366 </p>
15367 <dl compact="compact">
15368 <dt> &lsquo;<samp>planes</samp>&rsquo;</dt>
15369 <dd><p>Set plane(s) to extract.
15370 </p>
15371 <p>Available values for planes are:
15372 </p><dl compact="compact">
15373 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
15374 <dt> &lsquo;<samp>u</samp>&rsquo;</dt>
15375 <dt> &lsquo;<samp>v</samp>&rsquo;</dt>
15376 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
15377 <dt> &lsquo;<samp>r</samp>&rsquo;</dt>
15378 <dt> &lsquo;<samp>g</samp>&rsquo;</dt>
15379 <dt> &lsquo;<samp>b</samp>&rsquo;</dt>
15380 </dl>
15381
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.
15385 </p></dd>
15386 </dl>
15387
15388 <a name="Examples-70"></a>
15389 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-70">33.24.1 Examples</a></h3>
15390
15391 <ul>
15392 <li>
15393 Extract luma, u and v color channel component from input video frame
15394 into 3 grayscale outputs:
15395 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i video.avi -filter_complex 'extractplanes=y+u+v[y][u][v]' -map '[y]' y.avi -map '[u]' u.avi -map '[v]' v.avi
15396 </pre></td></tr></table>
15397 </li></ul>
15398
15399 <a name="elbg"></a>
15400 <h2 class="section"><a href="ffplay-all.html#toc-elbg">33.25 elbg</a></h2>
15401
15402 <p>Apply a posterize effect using the ELBG (Enhanced LBG) algorithm.
15403 </p>
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.
15407 </p>
15408 <p>This filter accepts the following options.
15409 </p>
15410 <dl compact="compact">
15411 <dt> &lsquo;<samp>codebook_length, l</samp>&rsquo;</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.
15414 </p>
15415 </dd>
15416 <dt> &lsquo;<samp>nb_steps, n</samp>&rsquo;</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.
15420 </p>
15421 </dd>
15422 <dt> &lsquo;<samp>seed, s</samp>&rsquo;</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.
15426 </p></dd>
15427 </dl>
15428
15429 <a name="fade"></a>
15430 <h2 class="section"><a href="ffplay-all.html#toc-fade">33.26 fade</a></h2>
15431
15432 <p>Apply fade-in/out effect to input video.
15433 </p>
15434 <p>This filter accepts the following options:
15435 </p>
15436 <dl compact="compact">
15437 <dt> &lsquo;<samp>type, t</samp>&rsquo;</dt>
15438 <dd><p>The effect type &ndash; can be either &quot;in&quot; for fade-in, or &quot;out&quot; for a fade-out
15439 effect.
15440 Default is <code>in</code>.
15441 </p>
15442 </dd>
15443 <dt> &lsquo;<samp>start_frame, s</samp>&rsquo;</dt>
15444 <dd><p>Specify the number of the start frame for starting to apply the fade
15445 effect. Default is 0.
15446 </p>
15447 </dd>
15448 <dt> &lsquo;<samp>nb_frames, n</samp>&rsquo;</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 &lsquo;<samp>color</samp>&rsquo;.
15453 Default is 25.
15454 </p>
15455 </dd>
15456 <dt> &lsquo;<samp>alpha</samp>&rsquo;</dt>
15457 <dd><p>If set to 1, fade only alpha channel, if one exists on the input.
15458 Default value is 0.
15459 </p>
15460 </dd>
15461 <dt> &lsquo;<samp>start_time, st</samp>&rsquo;</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.
15465 </p>
15466 </dd>
15467 <dt> &lsquo;<samp>duration, d</samp>&rsquo;</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 &lsquo;<samp>color</samp>&rsquo;.
15472 If both duration and nb_frames are specified, duration is used. Default is 0.
15473 </p>
15474 </dd>
15475 <dt> &lsquo;<samp>color, c</samp>&rsquo;</dt>
15476 <dd><p>Specify the color of the fade. Default is &quot;black&quot;.
15477 </p></dd>
15478 </dl>
15479
15480 <a name="Examples-3"></a>
15481 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-3">33.26.1 Examples</a></h3>
15482
15483 <ul>
15484 <li>
15485 Fade in first 30 frames of video:
15486 <table><tr><td>&nbsp;</td><td><pre class="example">fade=in:0:30
15487 </pre></td></tr></table>
15488
15489 <p>The command above is equivalent to:
15490 </p><table><tr><td>&nbsp;</td><td><pre class="example">fade=t=in:s=0:n=30
15491 </pre></td></tr></table>
15492
15493 </li><li>
15494 Fade out last 45 frames of a 200-frame video:
15495 <table><tr><td>&nbsp;</td><td><pre class="example">fade=out:155:45
15496 fade=type=out:start_frame=155:nb_frames=45
15497 </pre></td></tr></table>
15498
15499 </li><li>
15500 Fade in first 25 frames and fade out last 25 frames of a 1000-frame video:
15501 <table><tr><td>&nbsp;</td><td><pre class="example">fade=in:0:25, fade=out:975:25
15502 </pre></td></tr></table>
15503
15504 </li><li>
15505 Make first 5 frames yellow, then fade in from frame 5-24:
15506 <table><tr><td>&nbsp;</td><td><pre class="example">fade=in:5:20:color=yellow
15507 </pre></td></tr></table>
15508
15509 </li><li>
15510 Fade in alpha over first 25 frames of video:
15511 <table><tr><td>&nbsp;</td><td><pre class="example">fade=in:0:25:alpha=1
15512 </pre></td></tr></table>
15513
15514 </li><li>
15515 Make first 5.5 seconds black, then fade in for 0.5 seconds:
15516 <table><tr><td>&nbsp;</td><td><pre class="example">fade=t=in:st=5.5:d=0.5
15517 </pre></td></tr></table>
15518
15519 </li></ul>
15520
15521 <a name="field"></a>
15522 <h2 class="section"><a href="ffplay-all.html#toc-field">33.27 field</a></h2>
15523
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
15526 non-interlaced.
15527 </p>
15528 <p>The filter accepts the following options:
15529 </p>
15530 <dl compact="compact">
15531 <dt> &lsquo;<samp>type</samp>&rsquo;</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>).
15535 </p></dd>
15536 </dl>
15537
15538 <a name="fieldmatch"></a>
15539 <h2 class="section"><a href="ffplay-all.html#toc-fieldmatch">33.28 fieldmatch</a></h2>
15540
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.
15545 </p>
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.
15552 </p>
15553 <p>In addition to the various configuration options, <code>fieldmatch</code> can take an
15554 optional second stream, activated through the &lsquo;<samp>ppsrc</samp>&rsquo; 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.
15560 </p>
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.
15565 </p>
15566 <p>The filter accepts the following options:
15567 </p>
15568 <dl compact="compact">
15569 <dt> &lsquo;<samp>order</samp>&rsquo;</dt>
15570 <dd><p>Specify the assumed field order of the input stream. Available values are:
15571 </p>
15572 <dl compact="compact">
15573 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
15574 <dd><p>Auto detect parity (use FFmpeg&rsquo;s internal parity value).
15575 </p></dd>
15576 <dt> &lsquo;<samp>bff</samp>&rsquo;</dt>
15577 <dd><p>Assume bottom field first.
15578 </p></dd>
15579 <dt> &lsquo;<samp>tff</samp>&rsquo;</dt>
15580 <dd><p>Assume top field first.
15581 </p></dd>
15582 </dl>
15583
15584 <p>Note that it is sometimes recommended not to trust the parity announced by the
15585 stream.
15586 </p>
15587 <p>Default value is <var>auto</var>.
15588 </p>
15589 </dd>
15590 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
15591 <dd><p>Set the matching mode or strategy to use. &lsquo;<samp>pc</samp>&rsquo; mode is the safest in the
15592 sense that it won&rsquo;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, &lsquo;<samp>pcn_ub</samp>&rsquo; 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 &lsquo;<samp>pc</samp>&rsquo; and &lsquo;<samp>pcn_ub</samp>&rsquo; 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.
15600 </p>
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.
15602 </p>
15603 <p>Available values are:
15604 </p>
15605 <dl compact="compact">
15606 <dt> &lsquo;<samp>pc</samp>&rsquo;</dt>
15607 <dd><p>2-way matching (p/c)
15608 </p></dd>
15609 <dt> &lsquo;<samp>pc_n</samp>&rsquo;</dt>
15610 <dd><p>2-way matching, and trying 3rd match if still combed (p/c + n)
15611 </p></dd>
15612 <dt> &lsquo;<samp>pc_u</samp>&rsquo;</dt>
15613 <dd><p>2-way matching, and trying 3rd match (same order) if still combed (p/c + u)
15614 </p></dd>
15615 <dt> &lsquo;<samp>pc_n_ub</samp>&rsquo;</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)
15618 </p></dd>
15619 <dt> &lsquo;<samp>pcn</samp>&rsquo;</dt>
15620 <dd><p>3-way matching (p/c/n)
15621 </p></dd>
15622 <dt> &lsquo;<samp>pcn_ub</samp>&rsquo;</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)
15625 </p></dd>
15626 </dl>
15627
15628 <p>The parenthesis at the end indicate the matches that would be used for that
15629 mode assuming &lsquo;<samp>order</samp>&rsquo;=<var>tff</var> (and &lsquo;<samp>field</samp>&rsquo; on <var>auto</var> or
15630 <var>top</var>).
15631 </p>
15632 <p>In terms of speed &lsquo;<samp>pc</samp>&rsquo; mode is by far the fastest and &lsquo;<samp>pcn_ub</samp>&rsquo; is
15633 the slowest.
15634 </p>
15635 <p>Default value is <var>pc_n</var>.
15636 </p>
15637 </dd>
15638 <dt> &lsquo;<samp>ppsrc</samp>&rsquo;</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 &lsquo;<samp>clip2</samp>&rsquo; feature from
15642 VFM/TFM.
15643 </p>
15644 <p>Default value is <code>0</code> (disabled).
15645 </p>
15646 </dd>
15647 <dt> &lsquo;<samp>field</samp>&rsquo;</dt>
15648 <dd><p>Set the field to match from. It is recommended to set this to the same value as
15649 &lsquo;<samp>order</samp>&rsquo; 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:
15652 </p>
15653 <dl compact="compact">
15654 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
15655 <dd><p>Automatic (same value as &lsquo;<samp>order</samp>&rsquo;).
15656 </p></dd>
15657 <dt> &lsquo;<samp>bottom</samp>&rsquo;</dt>
15658 <dd><p>Match from the bottom field.
15659 </p></dd>
15660 <dt> &lsquo;<samp>top</samp>&rsquo;</dt>
15661 <dd><p>Match from the top field.
15662 </p></dd>
15663 </dl>
15664
15665 <p>Default value is <var>auto</var>.
15666 </p>
15667 </dd>
15668 <dt> &lsquo;<samp>mchroma</samp>&rsquo;</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.
15674 </p>
15675 <p>Default value is <code>1</code>.
15676 </p>
15677 </dd>
15678 <dt> &lsquo;<samp>y0</samp>&rsquo;</dt>
15679 <dt> &lsquo;<samp>y1</samp>&rsquo;</dt>
15680 <dd><p>These define an exclusion band which excludes the lines between &lsquo;<samp>y0</samp>&rsquo; and
15681 &lsquo;<samp>y1</samp>&rsquo; 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. &lsquo;<samp>y0</samp>&rsquo; sets the starting scan line and
15684 &lsquo;<samp>y1</samp>&rsquo; sets the ending line; all lines in between &lsquo;<samp>y0</samp>&rsquo; and
15685 &lsquo;<samp>y1</samp>&rsquo; (including &lsquo;<samp>y0</samp>&rsquo; and &lsquo;<samp>y1</samp>&rsquo;) will be ignored. Setting
15686 &lsquo;<samp>y0</samp>&rsquo; and &lsquo;<samp>y1</samp>&rsquo; to the same value will disable the feature.
15687 &lsquo;<samp>y0</samp>&rsquo; and &lsquo;<samp>y1</samp>&rsquo; defaults to <code>0</code>.
15688 </p>
15689 </dd>
15690 <dt> &lsquo;<samp>scthresh</samp>&rsquo;</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 &lsquo;<samp>combmatch</samp>&rsquo;=<var>sc</var>.  The range for
15694 &lsquo;<samp>scthresh</samp>&rsquo; is <code>[0.0, 100.0]</code>.
15695 </p>
15696 <p>Default value is <code>12.0</code>.
15697 </p>
15698 </dd>
15699 <dt> &lsquo;<samp>combmatch</samp>&rsquo;</dt>
15700 <dd><p>When &lsquo;<samp>combatch</samp>&rsquo; 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:
15703 </p>
15704 <dl compact="compact">
15705 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
15706 <dd><p>No final matching based on combed scores.
15707 </p></dd>
15708 <dt> &lsquo;<samp>sc</samp>&rsquo;</dt>
15709 <dd><p>Combed scores are only used when a scene change is detected.
15710 </p></dd>
15711 <dt> &lsquo;<samp>full</samp>&rsquo;</dt>
15712 <dd><p>Use combed scores all the time.
15713 </p></dd>
15714 </dl>
15715
15716 <p>Default is <var>sc</var>.
15717 </p>
15718 </dd>
15719 <dt> &lsquo;<samp>combdbg</samp>&rsquo;</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 &lsquo;<samp>micout</samp>&rsquo; in TFM/VFM vocabulary.
15722 Available values are:
15723 </p>
15724 <dl compact="compact">
15725 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
15726 <dd><p>No forced calculation.
15727 </p></dd>
15728 <dt> &lsquo;<samp>pcn</samp>&rsquo;</dt>
15729 <dd><p>Force p/c/n calculations.
15730 </p></dd>
15731 <dt> &lsquo;<samp>pcnub</samp>&rsquo;</dt>
15732 <dd><p>Force p/c/n/u/b calculations.
15733 </p></dd>
15734 </dl>
15735
15736 <p>Default value is <var>none</var>.
15737 </p>
15738 </dd>
15739 <dt> &lsquo;<samp>cthresh</samp>&rsquo;</dt>
15740 <dd><p>This is the area combing threshold used for combed frame detection. This
15741 essentially controls how &quot;strong&quot; or &quot;visible&quot; 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>.
15747 </p>
15748 <p>Default value is <code>9</code>.
15749 </p>
15750 </dd>
15751 <dt> &lsquo;<samp>chroma</samp>&rsquo;</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 &lsquo;<samp>chroma</samp>&rsquo;=<var>0</var> is usually more reliable, except for the case
15756 where there is chroma only combing in the source.
15757 </p>
15758 <p>Default value is <code>0</code>.
15759 </p>
15760 </dd>
15761 <dt> &lsquo;<samp>blockx</samp>&rsquo;</dt>
15762 <dt> &lsquo;<samp>blocky</samp>&rsquo;</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 &lsquo;<samp>combpel</samp>&rsquo; pixels are required to be detected as combed for a frame to be
15766 declared combed. See the &lsquo;<samp>combpel</samp>&rsquo; parameter description for more info.
15767 Possible values are any number that is a power of 2 starting at 4 and going up
15768 to 512.
15769 </p>
15770 <p>Default value is <code>16</code>.
15771 </p>
15772 </dd>
15773 <dt> &lsquo;<samp>combpel</samp>&rsquo;</dt>
15774 <dd><p>The number of combed pixels inside any of the &lsquo;<samp>blocky</samp>&rsquo; by
15775 &lsquo;<samp>blockx</samp>&rsquo; size blocks on the frame for the frame to be detected as
15776 combed. While &lsquo;<samp>cthresh</samp>&rsquo; controls how &quot;visible&quot; the combing must be, this
15777 setting controls &quot;how much&quot; combing there must be in any localized area (a
15778 window defined by the &lsquo;<samp>blockx</samp>&rsquo; and &lsquo;<samp>blocky</samp>&rsquo; 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 &lsquo;<samp>MI</samp>&rsquo; in TFM/VFM vocabulary.
15782 </p>
15783 <p>Default value is <code>80</code>.
15784 </p></dd>
15785 </dl>
15786
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>
15790
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>
15793
15794 <p>We assume the following telecined stream:
15795 </p>
15796 <table><tr><td>&nbsp;</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>
15799
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.
15802 </p>
15803 <p>When <code>fieldmatch</code> is configured to run a matching from bottom
15804 (&lsquo;<samp>field</samp>&rsquo;=<var>bottom</var>) this is how this input stream get transformed:
15805 </p>
15806 <table><tr><td>&nbsp;</td><td><pre class="example">Input stream:
15807                 T     1 2 2 3 4
15808                 B     1 2 3 4 4   &lt;-- matching reference
15809
15810 Matches:              c c n n c
15811
15812 Output stream:
15813                 T     1 2 3 4 4
15814                 B     1 2 3 4 4
15815 </pre></td></tr></table>
15816
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.
15820 </p>
15821 <p>The same operation now matching from top fields (&lsquo;<samp>field</samp>&rsquo;=<var>top</var>)
15822 looks like this:
15823 </p>
15824 <table><tr><td>&nbsp;</td><td><pre class="example">Input stream:
15825                 T     1 2 2 3 4   &lt;-- matching reference
15826                 B     1 2 3 4 4
15827
15828 Matches:              c c p p c
15829
15830 Output stream:
15831                 T     1 2 2 3 4
15832                 B     1 2 2 3 4
15833 </pre></td></tr></table>
15834
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:
15837 </p>
15838 <ul>
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
15842 </li></ul>
15843
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>
15846
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 &rsquo;x&rsquo; is placed above and below each matched fields.
15851 </p>
15852 <p>With bottom matching (&lsquo;<samp>field</samp>&rsquo;=<var>bottom</var>):
15853 </p><table><tr><td>&nbsp;</td><td><pre class="example">Match:           c         p           n          b          u
15854
15855                  x       x               x        x          x
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
15858                  x         x           x        x              x
15859
15860 Output frames:
15861                  2          1          2          2          2
15862                  2          2          2          1          3
15863 </pre></td></tr></table>
15864
15865 <p>With top matching (&lsquo;<samp>field</samp>&rsquo;=<var>top</var>):
15866 </p><table><tr><td>&nbsp;</td><td><pre class="example">Match:           c         p           n          b          u
15867
15868                  x         x           x        x              x
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
15871                  x       x               x        x          x
15872
15873 Output frames:
15874                  2          2          2          1          2
15875                  2          1          3          2          2
15876 </pre></td></tr></table>
15877
15878 <a name="Examples-52"></a>
15879 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-52">33.28.2 Examples</a></h3>
15880
15881 <p>Simple IVTC of a top field first telecined stream:
15882 </p><table><tr><td>&nbsp;</td><td><pre class="example">fieldmatch=order=tff:combmatch=none, decimate
15883 </pre></td></tr></table>
15884
15885 <p>Advanced IVTC, with fallback on <a href="#yadif">yadif</a> for still combed frames:
15886 </p><table><tr><td>&nbsp;</td><td><pre class="example">fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
15887 </pre></td></tr></table>
15888
15889 <a name="fieldorder"></a>
15890 <h2 class="section"><a href="ffplay-all.html#toc-fieldorder">33.29 fieldorder</a></h2>
15891
15892 <p>Transform the field order of the input video.
15893 </p>
15894 <p>This filter accepts the following options:
15895 </p>
15896 <dl compact="compact">
15897 <dt> &lsquo;<samp>order</samp>&rsquo;</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.
15900 </p></dd>
15901 </dl>
15902
15903 <p>Default value is &lsquo;<samp>tff</samp>&rsquo;.
15904 </p>
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.
15908 </p>
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.
15912 </p>
15913 <p>This filter is very useful when converting to or from PAL DV material,
15914 which is bottom field first.
15915 </p>
15916 <p>For example:
15917 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.vob -vf &quot;fieldorder=bff&quot; out.dv
15918 </pre></td></tr></table>
15919
15920 <a name="fifo"></a>
15921 <h2 class="section"><a href="ffplay-all.html#toc-fifo">33.30 fifo</a></h2>
15922
15923 <p>Buffer input images and send them when they are requested.
15924 </p>
15925 <p>This filter is mainly useful when auto-inserted by the libavfilter
15926 framework.
15927 </p>
15928 <p>The filter does not take parameters.
15929 </p>
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>
15933
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
15936 the next filter.
15937 </p>
15938 <p>This filter accepts the following parameters:
15939 </p><dl compact="compact">
15940 <dt> &lsquo;<samp>pix_fmts</samp>&rsquo;</dt>
15941 <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, for example
15942 &quot;pix_fmts=yuv420p|monow|rgb24&quot;.
15943 </p>
15944 </dd>
15945 </dl>
15946
15947 <a name="Examples-57"></a>
15948 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-57">33.31.1 Examples</a></h3>
15949
15950 <ul>
15951 <li>
15952 Convert the input video to the format <var>yuv420p</var>
15953 <table><tr><td>&nbsp;</td><td><pre class="example">format=pix_fmts=yuv420p
15954 </pre></td></tr></table>
15955
15956 <p>Convert the input video to any of the formats in the list
15957 </p><table><tr><td>&nbsp;</td><td><pre class="example">format=pix_fmts=yuv420p|yuv444p|yuv410p
15958 </pre></td></tr></table>
15959 </li></ul>
15960
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>
15964
15965 <p>Convert the video to specified constant frame rate by duplicating or dropping
15966 frames as necessary.
15967 </p>
15968 <p>This filter accepts the following named parameters:
15969 </p><dl compact="compact">
15970 <dt> &lsquo;<samp>fps</samp>&rsquo;</dt>
15971 <dd><p>Desired output frame rate. The default is <code>25</code>.
15972 </p>
15973 </dd>
15974 <dt> &lsquo;<samp>round</samp>&rsquo;</dt>
15975 <dd><p>Rounding method.
15976 </p>
15977 <p>Possible values are:
15978 </p><dl compact="compact">
15979 <dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
15980 <dd><p>zero round towards 0
15981 </p></dd>
15982 <dt> &lsquo;<samp>inf</samp>&rsquo;</dt>
15983 <dd><p>round away from 0
15984 </p></dd>
15985 <dt> &lsquo;<samp>down</samp>&rsquo;</dt>
15986 <dd><p>round towards -infinity
15987 </p></dd>
15988 <dt> &lsquo;<samp>up</samp>&rsquo;</dt>
15989 <dd><p>round towards +infinity
15990 </p></dd>
15991 <dt> &lsquo;<samp>near</samp>&rsquo;</dt>
15992 <dd><p>round to nearest
15993 </p></dd>
15994 </dl>
15995 <p>The default is <code>near</code>.
15996 </p>
15997 </dd>
15998 <dt> &lsquo;<samp>start_time</samp>&rsquo;</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&rsquo;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.
16005 </p>
16006 </dd>
16007 </dl>
16008
16009 <p>Alternatively, the options can be specified as a flat string:
16010 <var>fps</var>[:<var>round</var>].
16011 </p>
16012 <p>See also the <a href="#setpts">setpts</a> filter.
16013 </p>
16014 <a name="Examples-25"></a>
16015 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-25">33.32.1 Examples</a></h3>
16016
16017 <ul>
16018 <li>
16019 A typical usage in order to set the fps to 25:
16020 <table><tr><td>&nbsp;</td><td><pre class="example">fps=fps=25
16021 </pre></td></tr></table>
16022
16023 </li><li>
16024 Sets the fps to 24, using abbreviation and rounding method to round to nearest:
16025 <table><tr><td>&nbsp;</td><td><pre class="example">fps=fps=film:round=near
16026 </pre></td></tr></table>
16027 </li></ul>
16028
16029 <a name="framestep"></a>
16030 <h2 class="section"><a href="ffplay-all.html#toc-framestep">33.33 framestep</a></h2>
16031
16032 <p>Select one frame every N-th frame.
16033 </p>
16034 <p>This filter accepts the following option:
16035 </p><dl compact="compact">
16036 <dt> &lsquo;<samp>step</samp>&rsquo;</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>.
16039 </p></dd>
16040 </dl>
16041
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>
16045
16046 <p>Apply a frei0r effect to the input video.
16047 </p>
16048 <p>To enable compilation of this filter you need to install the frei0r
16049 header and configure FFmpeg with <code>--enable-frei0r</code>.
16050 </p>
16051 <p>This filter accepts the following options:
16052 </p>
16053 <dl compact="compact">
16054 <dt> &lsquo;<samp>filter_name</samp>&rsquo;</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 &lsquo;<tt>HOME/.frei0r-1/lib/</tt>&rsquo;, &lsquo;<tt>/usr/local/lib/frei0r-1/</tt>&rsquo;,
16060 &lsquo;<tt>/usr/lib/frei0r-1/</tt>&rsquo;.
16061 </p>
16062 </dd>
16063 <dt> &lsquo;<samp>filter_params</samp>&rsquo;</dt>
16064 <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r effect.
16065 </p>
16066 </dd>
16067 </dl>
16068
16069 <p>A frei0r effect parameter can be a boolean (whose values are specified
16070 with &quot;y&quot; and &quot;n&quot;), 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 &quot;Color&quot;
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.
16075 </p>
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.
16078 </p>
16079 <a name="Examples-12"></a>
16080 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-12">33.34.1 Examples</a></h3>
16081
16082 <ul>
16083 <li>
16084 Apply the distort0r effect, set the first two double parameters:
16085 <table><tr><td>&nbsp;</td><td><pre class="example">frei0r=filter_name=distort0r:filter_params=0.5|0.01
16086 </pre></td></tr></table>
16087
16088 </li><li>
16089 Apply the colordistance effect, take a color as first parameter:
16090 <table><tr><td>&nbsp;</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>
16094
16095 </li><li>
16096 Apply the perspective effect, specify the top left and top right image
16097 positions:
16098 <table><tr><td>&nbsp;</td><td><pre class="example">frei0r=perspective:0.2/0.2|0.8/0.2
16099 </pre></td></tr></table>
16100 </li></ul>
16101
16102 <p>For more information see:
16103 <a href="http://frei0r.dyne.org">http://frei0r.dyne.org</a>
16104 </p>
16105 <a name="geq"></a>
16106 <h2 class="section"><a href="ffplay-all.html#toc-geq">33.35 geq</a></h2>
16107
16108 <p>The filter accepts the following options:
16109 </p>
16110 <dl compact="compact">
16111 <dt> &lsquo;<samp>lum_expr, lum</samp>&rsquo;</dt>
16112 <dd><p>Set the luminance expression.
16113 </p></dd>
16114 <dt> &lsquo;<samp>cb_expr, cb</samp>&rsquo;</dt>
16115 <dd><p>Set the chrominance blue expression.
16116 </p></dd>
16117 <dt> &lsquo;<samp>cr_expr, cr</samp>&rsquo;</dt>
16118 <dd><p>Set the chrominance red expression.
16119 </p></dd>
16120 <dt> &lsquo;<samp>alpha_expr, a</samp>&rsquo;</dt>
16121 <dd><p>Set the alpha expression.
16122 </p></dd>
16123 <dt> &lsquo;<samp>red_expr, r</samp>&rsquo;</dt>
16124 <dd><p>Set the red expression.
16125 </p></dd>
16126 <dt> &lsquo;<samp>green_expr, g</samp>&rsquo;</dt>
16127 <dd><p>Set the green expression.
16128 </p></dd>
16129 <dt> &lsquo;<samp>blue_expr, b</samp>&rsquo;</dt>
16130 <dd><p>Set the blue expression.
16131 </p></dd>
16132 </dl>
16133
16134 <p>The colorspace is selected according to the specified options. If one
16135 of the &lsquo;<samp>lum_expr</samp>&rsquo;, &lsquo;<samp>cb_expr</samp>&rsquo;, or &lsquo;<samp>cr_expr</samp>&rsquo;
16136 options is specified, the filter will automatically select a YCbCr
16137 colorspace. If one of the &lsquo;<samp>red_expr</samp>&rsquo;, &lsquo;<samp>green_expr</samp>&rsquo;, or
16138 &lsquo;<samp>blue_expr</samp>&rsquo; options is specified, it will select an RGB
16139 colorspace.
16140 </p>
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.
16145 </p>
16146 <p>The expressions can use the following variables and functions:
16147 </p>
16148 <dl compact="compact">
16149 <dt> &lsquo;<samp>N</samp>&rsquo;</dt>
16150 <dd><p>The sequential number of the filtered frame, starting from <code>0</code>.
16151 </p>
16152 </dd>
16153 <dt> &lsquo;<samp>X</samp>&rsquo;</dt>
16154 <dt> &lsquo;<samp>Y</samp>&rsquo;</dt>
16155 <dd><p>The coordinates of the current sample.
16156 </p>
16157 </dd>
16158 <dt> &lsquo;<samp>W</samp>&rsquo;</dt>
16159 <dt> &lsquo;<samp>H</samp>&rsquo;</dt>
16160 <dd><p>The width and height of the image.
16161 </p>
16162 </dd>
16163 <dt> &lsquo;<samp>SW</samp>&rsquo;</dt>
16164 <dt> &lsquo;<samp>SH</samp>&rsquo;</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.
16169 </p>
16170 </dd>
16171 <dt> &lsquo;<samp>T</samp>&rsquo;</dt>
16172 <dd><p>Time of the current frame, expressed in seconds.
16173 </p>
16174 </dd>
16175 <dt> &lsquo;<samp>p(x, y)</samp>&rsquo;</dt>
16176 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the current
16177 plane.
16178 </p>
16179 </dd>
16180 <dt> &lsquo;<samp>lum(x, y)</samp>&rsquo;</dt>
16181 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the luminance
16182 plane.
16183 </p>
16184 </dd>
16185 <dt> &lsquo;<samp>cb(x, y)</samp>&rsquo;</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.
16188 </p>
16189 </dd>
16190 <dt> &lsquo;<samp>cr(x, y)</samp>&rsquo;</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.
16193 </p>
16194 </dd>
16195 <dt> &lsquo;<samp>r(x, y)</samp>&rsquo;</dt>
16196 <dt> &lsquo;<samp>g(x, y)</samp>&rsquo;</dt>
16197 <dt> &lsquo;<samp>b(x, y)</samp>&rsquo;</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.
16200 </p>
16201 </dd>
16202 <dt> &lsquo;<samp>alpha(x, y)</samp>&rsquo;</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.
16205 </p></dd>
16206 </dl>
16207
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.
16210 </p>
16211 <a name="Examples-79"></a>
16212 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-79">33.35.1 Examples</a></h3>
16213
16214 <ul>
16215 <li>
16216 Flip the image horizontally:
16217 <table><tr><td>&nbsp;</td><td><pre class="example">geq=p(W-X\,Y)
16218 </pre></td></tr></table>
16219
16220 </li><li>
16221 Generate a bidimensional sine wave, with angle <code>PI/3</code> and a
16222 wavelength of 100 pixels:
16223 <table><tr><td>&nbsp;</td><td><pre class="example">geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X-50*T) + sin(PI/3)*Y)):128:128
16224 </pre></td></tr></table>
16225
16226 </li><li>
16227 Generate a fancy enigmatic moving light:
16228 <table><tr><td>&nbsp;</td><td><pre class="example">nullsrc=s=256x256,geq=random(1)/hypot(X-cos(N*0.07)*W/2-W/2\,Y-sin(N*0.09)*H/2-H/2)^2*1000000*sin(N*0.02):128:128
16229 </pre></td></tr></table>
16230
16231 </li><li>
16232 Generate a quick emboss effect:
16233 <table><tr><td>&nbsp;</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>
16235
16236 </li><li>
16237 Modify RGB components depending on pixel position:
16238 <table><tr><td>&nbsp;</td><td><pre class="example">geq=r='X/W*r(X,Y)':g='(1-X/W)*g(X,Y)':b='(H-Y)/H*b(X,Y)'
16239 </pre></td></tr></table>
16240 </li></ul>
16241
16242 <a name="gradfun"></a>
16243 <h2 class="section"><a href="ffplay-all.html#toc-gradfun">33.36 gradfun</a></h2>
16244
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
16248 dither them.
16249 </p>
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.
16253 </p>
16254 <p>This filter accepts the following options:
16255 </p>
16256 <dl compact="compact">
16257 <dt> &lsquo;<samp>strength</samp>&rsquo;</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
16261 range.
16262 </p>
16263 </dd>
16264 <dt> &lsquo;<samp>radius</samp>&rsquo;</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.
16269 </p>
16270 </dd>
16271 </dl>
16272
16273 <p>Alternatively, the options can be specified as a flat string:
16274 <var>strength</var>[:<var>radius</var>]
16275 </p>
16276 <a name="Examples-72"></a>
16277 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-72">33.36.1 Examples</a></h3>
16278
16279 <ul>
16280 <li>
16281 Apply the filter with a <code>3.5</code> strength and radius of <code>8</code>:
16282 <table><tr><td>&nbsp;</td><td><pre class="example">gradfun=3.5:8
16283 </pre></td></tr></table>
16284
16285 </li><li>
16286 Specify radius, omitting the strength (which will fall-back to the default
16287 value):
16288 <table><tr><td>&nbsp;</td><td><pre class="example">gradfun=radius=8
16289 </pre></td></tr></table>
16290
16291 </li></ul>
16292
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>
16296
16297 <p>Apply a Hald CLUT to a video stream.
16298 </p>
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.
16301 </p>
16302 <p>The filter accepts the following options:
16303 </p>
16304 <dl compact="compact">
16305 <dt> &lsquo;<samp>shortest</samp>&rsquo;</dt>
16306 <dd><p>Force termination when the shortest input terminates. Default is <code>0</code>.
16307 </p></dd>
16308 <dt> &lsquo;<samp>repeatlast</samp>&rsquo;</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>.
16312 </p></dd>
16313 </dl>
16314
16315 <p><code>haldclut</code> also has the same interpolation options as <a href="#lut3d">lut3d</a> (both
16316 filters share the same internals).
16317 </p>
16318 <p>More information about the Hald CLUT can be found on Eskil Steenberg&rsquo;s website
16319 (Hald CLUT author) at <a href="http://www.quelsolaar.com/technology/clut.html">http://www.quelsolaar.com/technology/clut.html</a>.
16320 </p>
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>
16323
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>
16326
16327 <p>Generate an identity Hald CLUT stream altered with various effects:
16328 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f lavfi -i <a href="#haldclutsrc">haldclutsrc</a>=8 -vf &quot;hue=H=2*PI*t:s=sin(2*PI*t)+1, curves=cross_process&quot; -t 10 -c:v ffv1 clut.nut
16329 </pre></td></tr></table>
16330
16331 <p>Note: make sure you use a lossless codec.
16332 </p>
16333 <p>Then use it with <code>haldclut</code> to apply it on some random stream:
16334 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f lavfi -i mandelbrot -i clut.nut -filter_complex '[0][1] haldclut' -t 20 mandelclut.mkv
16335 </pre></td></tr></table>
16336
16337 <p>The Hald CLUT will be applied to the 10 first seconds (duration of
16338 &lsquo;<tt>clut.nut</tt>&rsquo;), then the latest picture of that CLUT stream will be applied
16339 to the remaining frames of the <code>mandelbrot</code> stream.
16340 </p>
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>
16343
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.
16349 </p>
16350 <p>Typically, the following generated Hald CLUT will be supported by the
16351 <code>haldclut</code> filter:
16352 </p>
16353 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f lavfi -i <a href="#haldclutsrc">haldclutsrc</a>=8 -vf &quot;
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&quot; -frames:v 1 clut.png
16358 </pre></td></tr></table>
16359
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
16362 the color changes.
16363 </p>
16364 <p>Then, the effect of this Hald CLUT can be visualized with:
16365 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay input.mkv -vf &quot;movie=clut.png, [in] haldclut&quot;
16366 </pre></td></tr></table>
16367
16368 <a name="hflip"></a>
16369 <h2 class="section"><a href="ffplay-all.html#toc-hflip">33.38 hflip</a></h2>
16370
16371 <p>Flip the input video horizontally.
16372 </p>
16373 <p>For example to horizontally flip the input video with <code>ffmpeg</code>:
16374 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -vf &quot;hflip&quot; out.avi
16375 </pre></td></tr></table>
16376
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
16380 per-frame basis.
16381 </p>
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 &quot;automatically adjusting contrast filter&quot;. This filter is
16386 useful only for correcting degraded or poorly captured source
16387 video.
16388 </p>
16389 <p>The filter accepts the following options:
16390 </p>
16391 <dl compact="compact">
16392 <dt> &lsquo;<samp>strength</samp>&rsquo;</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.
16397 </p>
16398 </dd>
16399 <dt> &lsquo;<samp>intensity</samp>&rsquo;</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.
16404 </p>
16405 </dd>
16406 <dt> &lsquo;<samp>antibanding</samp>&rsquo;</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>.
16411 </p></dd>
16412 </dl>
16413
16414 <a name="histogram"></a>
16415 <h2 class="section"><a href="ffplay-all.html#toc-histogram">33.40 histogram</a></h2>
16416
16417 <p>Compute and draw a color distribution histogram for the input video.
16418 </p>
16419 <p>The computed histogram is a representation of distribution of color components
16420 in an image.
16421 </p>
16422 <p>The filter accepts the following options:
16423 </p>
16424 <dl compact="compact">
16425 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
16426 <dd><p>Set histogram mode.
16427 </p>
16428 <p>It accepts the following values:
16429 </p><dl compact="compact">
16430 <dt> &lsquo;<samp>levels</samp>&rsquo;</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.
16435 </p>
16436 </dd>
16437 <dt> &lsquo;<samp>color</samp>&rsquo;</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.
16449 </p>
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.
16458 </p>
16459 </dd>
16460 <dt> &lsquo;<samp>color2</samp>&rsquo;</dt>
16461 <dd><p>chroma values in vectorscope, similar as <code>color</code> but actual chroma values
16462 are displayed.
16463 </p>
16464 </dd>
16465 <dt> &lsquo;<samp>waveform</samp>&rsquo;</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.
16469 </p></dd>
16470 </dl>
16471 <p>Default value is <code>levels</code>.
16472 </p>
16473 </dd>
16474 <dt> &lsquo;<samp>level_height</samp>&rsquo;</dt>
16475 <dd><p>Set height of level in <code>levels</code>. Default value is <code>200</code>.
16476 Allowed range is [50, 2048].
16477 </p>
16478 </dd>
16479 <dt> &lsquo;<samp>scale_height</samp>&rsquo;</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].
16482 </p>
16483 </dd>
16484 <dt> &lsquo;<samp>step</samp>&rsquo;</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].
16488 </p>
16489 </dd>
16490 <dt> &lsquo;<samp>waveform_mode</samp>&rsquo;</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>.
16493 </p>
16494 </dd>
16495 <dt> &lsquo;<samp>waveform_mirror</samp>&rsquo;</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).
16500 </p>
16501 </dd>
16502 <dt> &lsquo;<samp>display_mode</samp>&rsquo;</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> &lsquo;<samp>parade</samp>&rsquo;</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.
16511 </p>
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
16519 three waveforms.
16520 </p>
16521 </dd>
16522 <dt> &lsquo;<samp>overlay</samp>&rsquo;</dt>
16523 <dd><p>Presents information that&rsquo;s identical to that in the <code>parade</code>, except
16524 that the graphs representing color components are superimposed directly
16525 over one another.
16526 </p>
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,
16530 or blacks.
16531 </p></dd>
16532 </dl>
16533 <p>Default is <code>parade</code>.
16534 </p>
16535 </dd>
16536 <dt> &lsquo;<samp>levels_mode</samp>&rsquo;</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>.
16539 </p></dd>
16540 </dl>
16541
16542 <a name="Examples-16"></a>
16543 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-16">33.40.1 Examples</a></h3>
16544
16545 <ul>
16546 <li>
16547 Calculate and draw histogram:
16548 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -i input -vf histogram
16549 </pre></td></tr></table>
16550
16551 </li></ul>
16552
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>
16556
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.
16560 </p>
16561 <p>It accepts the following optional parameters:
16562 </p>
16563 <dl compact="compact">
16564 <dt> &lsquo;<samp>luma_spatial</samp>&rsquo;</dt>
16565 <dd><p>a non-negative float number which specifies spatial luma strength,
16566 defaults to 4.0
16567 </p>
16568 </dd>
16569 <dt> &lsquo;<samp>chroma_spatial</samp>&rsquo;</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
16572 </p>
16573 </dd>
16574 <dt> &lsquo;<samp>luma_tmp</samp>&rsquo;</dt>
16575 <dd><p>a float number which specifies luma temporal strength, defaults to
16576 6.0*<var>luma_spatial</var>/4.0
16577 </p>
16578 </dd>
16579 <dt> &lsquo;<samp>chroma_tmp</samp>&rsquo;</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>
16582 </p></dd>
16583 </dl>
16584
16585 <a name="hue"></a>
16586 <h2 class="section"><a href="ffplay-all.html#toc-hue">33.42 hue</a></h2>
16587
16588 <p>Modify the hue and/or the saturation of the input.
16589 </p>
16590 <p>This filter accepts the following options:
16591 </p>
16592 <dl compact="compact">
16593 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
16594 <dd><p>Specify the hue angle as a number of degrees. It accepts an expression,
16595 and defaults to &quot;0&quot;.
16596 </p>
16597 </dd>
16598 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
16599 <dd><p>Specify the saturation in the [-10,10] range. It accepts an expression and
16600 defaults to &quot;1&quot;.
16601 </p>
16602 </dd>
16603 <dt> &lsquo;<samp>H</samp>&rsquo;</dt>
16604 <dd><p>Specify the hue angle as a number of radians. It accepts an
16605 expression, and defaults to &quot;0&quot;.
16606 </p>
16607 </dd>
16608 <dt> &lsquo;<samp>b</samp>&rsquo;</dt>
16609 <dd><p>Specify the brightness in the [-10,10] range. It accepts an expression and
16610 defaults to &quot;0&quot;.
16611 </p></dd>
16612 </dl>
16613
16614 <p>&lsquo;<samp>h</samp>&rsquo; and &lsquo;<samp>H</samp>&rsquo; are mutually exclusive, and can&rsquo;t be
16615 specified at the same time.
16616 </p>
16617 <p>The &lsquo;<samp>b</samp>&rsquo;, &lsquo;<samp>h</samp>&rsquo;, &lsquo;<samp>H</samp>&rsquo; and &lsquo;<samp>s</samp>&rsquo; option values are
16618 expressions containing the following constants:
16619 </p>
16620 <dl compact="compact">
16621 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
16622 <dd><p>frame count of the input frame starting from 0
16623 </p>
16624 </dd>
16625 <dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
16626 <dd><p>presentation timestamp of the input frame expressed in time base units
16627 </p>
16628 </dd>
16629 <dt> &lsquo;<samp>r</samp>&rsquo;</dt>
16630 <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
16631 </p>
16632 </dd>
16633 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
16634 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
16635 </p>
16636 </dd>
16637 <dt> &lsquo;<samp>tb</samp>&rsquo;</dt>
16638 <dd><p>time base of the input video
16639 </p></dd>
16640 </dl>
16641
16642 <a name="Examples-51"></a>
16643 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-51">33.42.1 Examples</a></h3>
16644
16645 <ul>
16646 <li>
16647 Set the hue to 90 degrees and the saturation to 1.0:
16648 <table><tr><td>&nbsp;</td><td><pre class="example">hue=h=90:s=1
16649 </pre></td></tr></table>
16650
16651 </li><li>
16652 Same command but expressing the hue in radians:
16653 <table><tr><td>&nbsp;</td><td><pre class="example">hue=H=PI/2:s=1
16654 </pre></td></tr></table>
16655
16656 </li><li>
16657 Rotate hue and make the saturation swing between 0
16658 and 2 over a period of 1 second:
16659 <table><tr><td>&nbsp;</td><td><pre class="example">hue=&quot;H=2*PI*t: s=sin(2*PI*t)+1&quot;
16660 </pre></td></tr></table>
16661
16662 </li><li>
16663 Apply a 3 seconds saturation fade-in effect starting at 0:
16664 <table><tr><td>&nbsp;</td><td><pre class="example">hue=&quot;s=min(t/3\,1)&quot;
16665 </pre></td></tr></table>
16666
16667 <p>The general fade-in expression can be written as:
16668 </p><table><tr><td>&nbsp;</td><td><pre class="example">hue=&quot;s=min(0\, max((t-START)/DURATION\, 1))&quot;
16669 </pre></td></tr></table>
16670
16671 </li><li>
16672 Apply a 3 seconds saturation fade-out effect starting at 5 seconds:
16673 <table><tr><td>&nbsp;</td><td><pre class="example">hue=&quot;s=max(0\, min(1\, (8-t)/3))&quot;
16674 </pre></td></tr></table>
16675
16676 <p>The general fade-out expression can be written as:
16677 </p><table><tr><td>&nbsp;</td><td><pre class="example">hue=&quot;s=max(0\, min(1\, (START+DURATION-t)/DURATION))&quot;
16678 </pre></td></tr></table>
16679
16680 </li></ul>
16681
16682 <a name="Commands"></a>
16683 <h3 class="subsection"><a href="ffplay-all.html#toc-Commands">33.42.2 Commands</a></h3>
16684
16685 <p>This filter supports the following commands:
16686 </p><dl compact="compact">
16687 <dt> &lsquo;<samp>b</samp>&rsquo;</dt>
16688 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
16689 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
16690 <dt> &lsquo;<samp>H</samp>&rsquo;</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.
16693 </p>
16694 <p>If the specified expression is not valid, it is kept at its current
16695 value.
16696 </p></dd>
16697 </dl>
16698
16699 <a name="idet"></a>
16700 <h2 class="section"><a href="ffplay-all.html#toc-idet">33.43 idet</a></h2>
16701
16702 <p>Detect video interlacing type.
16703 </p>
16704 <p>This filter tries to detect if the input is interlaced or progressive,
16705 top or bottom field first.
16706 </p>
16707 <p>The filter accepts the following options:
16708 </p>
16709 <dl compact="compact">
16710 <dt> &lsquo;<samp>intl_thres</samp>&rsquo;</dt>
16711 <dd><p>Set interlacing threshold.
16712 </p></dd>
16713 <dt> &lsquo;<samp>prog_thres</samp>&rsquo;</dt>
16714 <dd><p>Set progressive threshold.
16715 </p></dd>
16716 </dl>
16717
16718 <a name="il"></a>
16719 <h2 class="section"><a href="ffplay-all.html#toc-il">33.44 il</a></h2>
16720
16721 <p>Deinterleave or interleave fields.
16722 </p>
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.
16728 </p>
16729 <p>The filter accepts the following options:
16730 </p>
16731 <dl compact="compact">
16732 <dt> &lsquo;<samp>luma_mode, l</samp>&rsquo;</dt>
16733 <dt> &lsquo;<samp>chroma_mode, c</samp>&rsquo;</dt>
16734 <dt> &lsquo;<samp>alpha_mode, a</samp>&rsquo;</dt>
16735 <dd><p>Available values for <var>luma_mode</var>, <var>chroma_mode</var> and
16736 <var>alpha_mode</var> are:
16737 </p>
16738 <dl compact="compact">
16739 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
16740 <dd><p>Do nothing.
16741 </p>
16742 </dd>
16743 <dt> &lsquo;<samp>deinterleave, d</samp>&rsquo;</dt>
16744 <dd><p>Deinterleave fields, placing one above the other.
16745 </p>
16746 </dd>
16747 <dt> &lsquo;<samp>interleave, i</samp>&rsquo;</dt>
16748 <dd><p>Interleave fields. Reverse the effect of deinterleaving.
16749 </p></dd>
16750 </dl>
16751 <p>Default value is <code>none</code>.
16752 </p>
16753 </dd>
16754 <dt> &lsquo;<samp>luma_swap, ls</samp>&rsquo;</dt>
16755 <dt> &lsquo;<samp>chroma_swap, cs</samp>&rsquo;</dt>
16756 <dt> &lsquo;<samp>alpha_swap, as</samp>&rsquo;</dt>
16757 <dd><p>Swap luma/chroma/alpha fields. Exchange even &amp; odd lines. Default value is <code>0</code>.
16758 </p></dd>
16759 </dl>
16760
16761 <a name="interlace"></a>
16762 <h2 class="section"><a href="ffplay-all.html#toc-interlace">33.45 interlace</a></h2>
16763
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.
16767 </p>
16768 <table><tr><td>&nbsp;</td><td><pre class="example">   Original        Original             New Frame
16769    Frame 'j'      Frame 'j+1'             (tff)
16770   ==========      ===========       ==================
16771     Line 0  --------------------&gt;    Frame 'j' Line 0
16772     Line 1          Line 1  ----&gt;   Frame 'j+1' Line 1
16773     Line 2 ---------------------&gt;    Frame 'j' Line 2
16774     Line 3          Line 3  ----&gt;   Frame 'j+1' Line 3
16775      ...             ...                   ...
16776 New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on
16777 </pre></td></tr></table>
16778
16779 <p>It accepts the following optional parameters:
16780 </p>
16781 <dl compact="compact">
16782 <dt> &lsquo;<samp>scan</samp>&rsquo;</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.
16785 </p>
16786 </dd>
16787 <dt> &lsquo;<samp>lowpass</samp>&rsquo;</dt>
16788 <dd><p>Enable (default) or disable the vertical lowpass filter to avoid twitter
16789 interlacing and reduce moire patterns.
16790 </p></dd>
16791 </dl>
16792
16793 <a name="kerndeint"></a>
16794 <h2 class="section"><a href="ffplay-all.html#toc-kerndeint">33.46 kerndeint</a></h2>
16795
16796 <p>Deinterlace input video by applying Donald Graft&rsquo;s adaptive kernel
16797 deinterling. Work on interlaced parts of a video to produce
16798 progressive frames.
16799 </p>
16800 <p>The description of the accepted parameters follows.
16801 </p>
16802 <dl compact="compact">
16803 <dt> &lsquo;<samp>thresh</samp>&rsquo;</dt>
16804 <dd><p>Set the threshold which affects the filter&rsquo;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.
16808 </p>
16809 </dd>
16810 <dt> &lsquo;<samp>map</samp>&rsquo;</dt>
16811 <dd><p>Paint pixels exceeding the threshold value to white if set to 1.
16812 Default is 0.
16813 </p>
16814 </dd>
16815 <dt> &lsquo;<samp>order</samp>&rsquo;</dt>
16816 <dd><p>Set the fields order. Swap fields if set to 1, leave fields alone if
16817 0. Default is 0.
16818 </p>
16819 </dd>
16820 <dt> &lsquo;<samp>sharp</samp>&rsquo;</dt>
16821 <dd><p>Enable additional sharpening if set to 1. Default is 0.
16822 </p>
16823 </dd>
16824 <dt> &lsquo;<samp>twoway</samp>&rsquo;</dt>
16825 <dd><p>Enable twoway sharpening if set to 1. Default is 0.
16826 </p></dd>
16827 </dl>
16828
16829 <a name="Examples-50"></a>
16830 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-50">33.46.1 Examples</a></h3>
16831
16832 <ul>
16833 <li>
16834 Apply default values:
16835 <table><tr><td>&nbsp;</td><td><pre class="example">kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
16836 </pre></td></tr></table>
16837
16838 </li><li>
16839 Enable additional sharpening:
16840 <table><tr><td>&nbsp;</td><td><pre class="example">kerndeint=sharp=1
16841 </pre></td></tr></table>
16842
16843 </li><li>
16844 Paint processed pixels in white:
16845 <table><tr><td>&nbsp;</td><td><pre class="example">kerndeint=map=1
16846 </pre></td></tr></table>
16847 </li></ul>
16848
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>
16852
16853 <p>Apply a 3D LUT to an input video.
16854 </p>
16855 <p>The filter accepts the following options:
16856 </p>
16857 <dl compact="compact">
16858 <dt> &lsquo;<samp>file</samp>&rsquo;</dt>
16859 <dd><p>Set the 3D LUT file name.
16860 </p>
16861 <p>Currently supported formats:
16862 </p><dl compact="compact">
16863 <dt> &lsquo;<samp>3dl</samp>&rsquo;</dt>
16864 <dd><p>AfterEffects
16865 </p></dd>
16866 <dt> &lsquo;<samp>cube</samp>&rsquo;</dt>
16867 <dd><p>Iridas
16868 </p></dd>
16869 <dt> &lsquo;<samp>dat</samp>&rsquo;</dt>
16870 <dd><p>DaVinci
16871 </p></dd>
16872 <dt> &lsquo;<samp>m3d</samp>&rsquo;</dt>
16873 <dd><p>Pandora
16874 </p></dd>
16875 </dl>
16876 </dd>
16877 <dt> &lsquo;<samp>interp</samp>&rsquo;</dt>
16878 <dd><p>Select interpolation mode.
16879 </p>
16880 <p>Available values are:
16881 </p>
16882 <dl compact="compact">
16883 <dt> &lsquo;<samp>nearest</samp>&rsquo;</dt>
16884 <dd><p>Use values from the nearest defined point.
16885 </p></dd>
16886 <dt> &lsquo;<samp>trilinear</samp>&rsquo;</dt>
16887 <dd><p>Interpolate values using the 8 points defining a cube.
16888 </p></dd>
16889 <dt> &lsquo;<samp>tetrahedral</samp>&rsquo;</dt>
16890 <dd><p>Interpolate values using a tetrahedron.
16891 </p></dd>
16892 </dl>
16893 </dd>
16894 </dl>
16895
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>
16898
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.
16901 </p>
16902 <p><var>lutyuv</var> applies a lookup table to a YUV input video, <var>lutrgb</var>
16903 to an RGB input video.
16904 </p>
16905 <p>These filters accept the following options:
16906 </p><dl compact="compact">
16907 <dt> &lsquo;<samp>c0</samp>&rsquo;</dt>
16908 <dd><p>set first pixel component expression
16909 </p></dd>
16910 <dt> &lsquo;<samp>c1</samp>&rsquo;</dt>
16911 <dd><p>set second pixel component expression
16912 </p></dd>
16913 <dt> &lsquo;<samp>c2</samp>&rsquo;</dt>
16914 <dd><p>set third pixel component expression
16915 </p></dd>
16916 <dt> &lsquo;<samp>c3</samp>&rsquo;</dt>
16917 <dd><p>set fourth pixel component expression, corresponds to the alpha component
16918 </p>
16919 </dd>
16920 <dt> &lsquo;<samp>r</samp>&rsquo;</dt>
16921 <dd><p>set red component expression
16922 </p></dd>
16923 <dt> &lsquo;<samp>g</samp>&rsquo;</dt>
16924 <dd><p>set green component expression
16925 </p></dd>
16926 <dt> &lsquo;<samp>b</samp>&rsquo;</dt>
16927 <dd><p>set blue component expression
16928 </p></dd>
16929 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
16930 <dd><p>alpha component expression
16931 </p>
16932 </dd>
16933 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
16934 <dd><p>set Y/luminance component expression
16935 </p></dd>
16936 <dt> &lsquo;<samp>u</samp>&rsquo;</dt>
16937 <dd><p>set U/Cb component expression
16938 </p></dd>
16939 <dt> &lsquo;<samp>v</samp>&rsquo;</dt>
16940 <dd><p>set V/Cr component expression
16941 </p></dd>
16942 </dl>
16943
16944 <p>Each of them specifies the expression to use for computing the lookup table for
16945 the corresponding pixel component values.
16946 </p>
16947 <p>The exact component associated to each of the <var>c*</var> options depends on the
16948 format in input.
16949 </p>
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.
16952 </p>
16953 <p>The expressions can contain the following constants and functions:
16954 </p>
16955 <dl compact="compact">
16956 <dt> &lsquo;<samp>w</samp>&rsquo;</dt>
16957 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
16958 <dd><p>the input width and height
16959 </p>
16960 </dd>
16961 <dt> &lsquo;<samp>val</samp>&rsquo;</dt>
16962 <dd><p>input value for the pixel component
16963 </p>
16964 </dd>
16965 <dt> &lsquo;<samp>clipval</samp>&rsquo;</dt>
16966 <dd><p>the input value clipped in the <var>minval</var>-<var>maxval</var> range
16967 </p>
16968 </dd>
16969 <dt> &lsquo;<samp>maxval</samp>&rsquo;</dt>
16970 <dd><p>maximum value for the pixel component
16971 </p>
16972 </dd>
16973 <dt> &lsquo;<samp>minval</samp>&rsquo;</dt>
16974 <dd><p>minimum value for the pixel component
16975 </p>
16976 </dd>
16977 <dt> &lsquo;<samp>negval</samp>&rsquo;</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 &quot;maxval-clipval+minval&quot;
16981 </p>
16982 </dd>
16983 <dt> &lsquo;<samp>clip(val)</samp>&rsquo;</dt>
16984 <dd><p>the computed value in <var>val</var> clipped in the
16985 <var>minval</var>-<var>maxval</var> range
16986 </p>
16987 </dd>
16988 <dt> &lsquo;<samp>gammaval(gamma)</samp>&rsquo;</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
16991 expression
16992 &quot;pow((clipval-minval)/(maxval-minval)\,<var>gamma</var>)*(maxval-minval)+minval&quot;
16993 </p>
16994 </dd>
16995 </dl>
16996
16997 <p>All expressions default to &quot;val&quot;.
16998 </p>
16999 <a name="Examples-14"></a>
17000 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-14">33.48.1 Examples</a></h3>
17001
17002 <ul>
17003 <li>
17004 Negate input video:
17005 <table><tr><td>&nbsp;</td><td><pre class="example">lutrgb=&quot;r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val&quot;
17006 lutyuv=&quot;y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val&quot;
17007 </pre></td></tr></table>
17008
17009 <p>The above is the same as:
17010 </p><table><tr><td>&nbsp;</td><td><pre class="example">lutrgb=&quot;r=negval:g=negval:b=negval&quot;
17011 lutyuv=&quot;y=negval:u=negval:v=negval&quot;
17012 </pre></td></tr></table>
17013
17014 </li><li>
17015 Negate luminance:
17016 <table><tr><td>&nbsp;</td><td><pre class="example">lutyuv=y=negval
17017 </pre></td></tr></table>
17018
17019 </li><li>
17020 Remove chroma components, turns the video into a graytone image:
17021 <table><tr><td>&nbsp;</td><td><pre class="example">lutyuv=&quot;u=128:v=128&quot;
17022 </pre></td></tr></table>
17023
17024 </li><li>
17025 Apply a luma burning effect:
17026 <table><tr><td>&nbsp;</td><td><pre class="example">lutyuv=&quot;y=2*val&quot;
17027 </pre></td></tr></table>
17028
17029 </li><li>
17030 Remove green and blue components:
17031 <table><tr><td>&nbsp;</td><td><pre class="example">lutrgb=&quot;g=0:b=0&quot;
17032 </pre></td></tr></table>
17033
17034 </li><li>
17035 Set a constant alpha channel value on input:
17036 <table><tr><td>&nbsp;</td><td><pre class="example">format=rgba,lutrgb=a=&quot;maxval-minval/2&quot;
17037 </pre></td></tr></table>
17038
17039 </li><li>
17040 Correct luminance gamma by a 0.5 factor:
17041 <table><tr><td>&nbsp;</td><td><pre class="example">lutyuv=y=gammaval(0.5)
17042 </pre></td></tr></table>
17043
17044 </li><li>
17045 Discard least significant bits of luma:
17046 <table><tr><td>&nbsp;</td><td><pre class="example">lutyuv=y='bitand(val, 128+64+32)'
17047 </pre></td></tr></table>
17048 </li></ul>
17049
17050 <a name="mergeplanes"></a>
17051 <h2 class="section"><a href="ffplay-all.html#toc-mergeplanes">33.49 mergeplanes</a></h2>
17052
17053 <p>Merge color channel components from several video streams.
17054 </p>
17055 <p>The filter accepts up to 4 input streams, and merge selected input
17056 planes to the output video.
17057 </p>
17058 <p>This filter accepts the following options:
17059 </p><dl compact="compact">
17060 <dt> &lsquo;<samp>mapping</samp>&rsquo;</dt>
17061 <dd><p>Set input to output plane mapping. Default is <code>0</code>.
17062 </p>
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]]]. &rsquo;Aa&rsquo; describes the
17065 mapping for the first plane of the output stream. &rsquo;A&rsquo; sets the number of
17066 the input stream to use (from 0 to 3), and &rsquo;a&rsquo; the plane number of the
17067 corresponding input to use (from 0 to 3). The rest of the mappings is
17068 similar, &rsquo;Bb&rsquo; describes the mapping for the output stream second
17069 plane, &rsquo;Cc&rsquo; describes the mapping for the output stream third plane and
17070 &rsquo;Dd&rsquo; describes the mapping for the output stream fourth plane.
17071 </p>
17072 </dd>
17073 <dt> &lsquo;<samp>format</samp>&rsquo;</dt>
17074 <dd><p>Set output pixel format. Default is <code>yuva444p</code>.
17075 </p></dd>
17076 </dl>
17077
17078 <a name="Examples-67"></a>
17079 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-67">33.49.1 Examples</a></h3>
17080
17081 <ul>
17082 <li>
17083 Merge three gray video streams of same width and height into single video stream:
17084 <table><tr><td>&nbsp;</td><td><pre class="example">[a0][a1][a2]mergeplanes=0x001020:yuv444p
17085 </pre></td></tr></table>
17086
17087 </li><li>
17088 Merge 1st yuv444p stream and 2nd gray video stream into yuva444p video stream:
17089 <table><tr><td>&nbsp;</td><td><pre class="example">[a0][a1]mergeplanes=0x00010210:yuva444p
17090 </pre></td></tr></table>
17091
17092 </li><li>
17093 Swap Y and A plane in yuva444p stream:
17094 <table><tr><td>&nbsp;</td><td><pre class="example">format=yuva444p,mergeplanes=0x03010200:yuva444p
17095 </pre></td></tr></table>
17096
17097 </li><li>
17098 Swap U and V plane in yuv420p stream:
17099 <table><tr><td>&nbsp;</td><td><pre class="example">format=yuv420p,mergeplanes=0x000201:yuv420p
17100 </pre></td></tr></table>
17101
17102 </li><li>
17103 Cast a rgb24 clip to yuv444p:
17104 <table><tr><td>&nbsp;</td><td><pre class="example">format=rgb24,mergeplanes=0x000102:yuv444p
17105 </pre></td></tr></table>
17106 </li></ul>
17107
17108 <a name="mcdeint"></a>
17109 <h2 class="section"><a href="ffplay-all.html#toc-mcdeint">33.50 mcdeint</a></h2>
17110
17111 <p>Apply motion-compensation deinterlacing.
17112 </p>
17113 <p>It needs one field per frame as input and must thus be used together
17114 with yadif=1/3 or equivalent.
17115 </p>
17116 <p>This filter accepts the following options:
17117 </p><dl compact="compact">
17118 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
17119 <dd><p>Set the deinterlacing mode.
17120 </p>
17121 <p>It accepts one of the following values:
17122 </p><dl compact="compact">
17123 <dt> &lsquo;<samp>fast</samp>&rsquo;</dt>
17124 <dt> &lsquo;<samp>medium</samp>&rsquo;</dt>
17125 <dt> &lsquo;<samp>slow</samp>&rsquo;</dt>
17126 <dd><p>use iterative motion estimation
17127 </p></dd>
17128 <dt> &lsquo;<samp>extra_slow</samp>&rsquo;</dt>
17129 <dd><p>like &lsquo;<samp>slow</samp>&rsquo;, but use multiple reference frames.
17130 </p></dd>
17131 </dl>
17132 <p>Default value is &lsquo;<samp>fast</samp>&rsquo;.
17133 </p>
17134 </dd>
17135 <dt> &lsquo;<samp>parity</samp>&rsquo;</dt>
17136 <dd><p>Set the picture field parity assumed for the input video. It must be
17137 one of the following values:
17138 </p>
17139 <dl compact="compact">
17140 <dt> &lsquo;<samp>0, tff</samp>&rsquo;</dt>
17141 <dd><p>assume top field first
17142 </p></dd>
17143 <dt> &lsquo;<samp>1, bff</samp>&rsquo;</dt>
17144 <dd><p>assume bottom field first
17145 </p></dd>
17146 </dl>
17147
17148 <p>Default value is &lsquo;<samp>bff</samp>&rsquo;.
17149 </p>
17150 </dd>
17151 <dt> &lsquo;<samp>qp</samp>&rsquo;</dt>
17152 <dd><p>Set per-block quantization parameter (QP) used by the internal
17153 encoder.
17154 </p>
17155 <p>Higher values should result in a smoother motion vector field but less
17156 optimal individual vectors. Default value is 1.
17157 </p></dd>
17158 </dl>
17159
17160 <a name="mp"></a>
17161 <h2 class="section"><a href="ffplay-all.html#toc-mp">33.51 mp</a></h2>
17162
17163 <p>Apply an MPlayer filter to the input video.
17164 </p>
17165 <p>This filter provides a wrapper around some of the filters of
17166 MPlayer/MEncoder.
17167 </p>
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.
17172 </p>
17173 <p>The filter accepts the parameters:
17174 <var>filter_name</var>[:=]<var>filter_params</var>
17175 </p>
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
17178 the named filter.
17179 </p>
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>
17189 </dl>
17190
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 &quot;VIDEO FILTERS&quot; section in the MPlayer manual.
17194 </p>
17195 <a name="Examples-7"></a>
17196 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-7">33.51.1 Examples</a></h3>
17197
17198 <ul>
17199 <li>
17200 Adjust gamma, brightness, contrast:
17201 <table><tr><td>&nbsp;</td><td><pre class="example">mp=eq2=1.0:2:0.5
17202 </pre></td></tr></table>
17203 </li></ul>
17204
17205 <p>See also mplayer(1), <a href="http://www.mplayerhq.hu/">http://www.mplayerhq.hu/</a>.
17206 </p>
17207 <a name="mpdecimate"></a>
17208 <h2 class="section"><a href="ffplay-all.html#toc-mpdecimate">33.52 mpdecimate</a></h2>
17209
17210 <p>Drop frames that do not differ greatly from the previous frame in
17211 order to reduce frame rate.
17212 </p>
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.
17216 </p>
17217 <p>A description of the accepted options follows.
17218 </p>
17219 <dl compact="compact">
17220 <dt> &lsquo;<samp>max</samp>&rsquo;</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.
17225 </p>
17226 <p>Default value is 0.
17227 </p>
17228 </dd>
17229 <dt> &lsquo;<samp>hi</samp>&rsquo;</dt>
17230 <dt> &lsquo;<samp>lo</samp>&rsquo;</dt>
17231 <dt> &lsquo;<samp>frac</samp>&rsquo;</dt>
17232 <dd><p>Set the dropping threshold values.
17233 </p>
17234 <p>Values for &lsquo;<samp>hi</samp>&rsquo; and &lsquo;<samp>lo</samp>&rsquo; 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.
17238 </p>
17239 <p>A frame is a candidate for dropping if no 8x8 blocks differ by more
17240 than a threshold of &lsquo;<samp>hi</samp>&rsquo;, and if no more than &lsquo;<samp>frac</samp>&rsquo; blocks (1
17241 meaning the whole image) differ by more than a threshold of &lsquo;<samp>lo</samp>&rsquo;.
17242 </p>
17243 <p>Default value for &lsquo;<samp>hi</samp>&rsquo; is 64*12, default value for &lsquo;<samp>lo</samp>&rsquo; is
17244 64*5, and default value for &lsquo;<samp>frac</samp>&rsquo; is 0.33.
17245 </p></dd>
17246 </dl>
17247
17248
17249 <a name="negate"></a>
17250 <h2 class="section"><a href="ffplay-all.html#toc-negate">33.53 negate</a></h2>
17251
17252 <p>Negate input video.
17253 </p>
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.
17256 </p>
17257 <a name="noformat"></a>
17258 <h2 class="section"><a href="ffplay-all.html#toc-noformat">33.54 noformat</a></h2>
17259
17260 <p>Force libavfilter not to use any of the specified pixel formats for the
17261 input to the next filter.
17262 </p>
17263 <p>This filter accepts the following parameters:
17264 </p><dl compact="compact">
17265 <dt> &lsquo;<samp>pix_fmts</samp>&rsquo;</dt>
17266 <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, for example
17267 &quot;pix_fmts=yuv420p|monow|rgb24&quot;.
17268 </p>
17269 </dd>
17270 </dl>
17271
17272 <a name="Examples-53"></a>
17273 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-53">33.54.1 Examples</a></h3>
17274
17275 <ul>
17276 <li>
17277 Force libavfilter to use a format different from <var>yuv420p</var> for the
17278 input to the vflip filter:
17279 <table><tr><td>&nbsp;</td><td><pre class="example">noformat=pix_fmts=yuv420p,vflip
17280 </pre></td></tr></table>
17281
17282 </li><li>
17283 Convert the input video to any of the formats not contained in the list:
17284 <table><tr><td>&nbsp;</td><td><pre class="example">noformat=yuv420p|yuv444p|yuv410p
17285 </pre></td></tr></table>
17286 </li></ul>
17287
17288 <a name="noise"></a>
17289 <h2 class="section"><a href="ffplay-all.html#toc-noise">33.55 noise</a></h2>
17290
17291 <p>Add noise on video input frame.
17292 </p>
17293 <p>The filter accepts the following options:
17294 </p>
17295 <dl compact="compact">
17296 <dt> &lsquo;<samp>all_seed</samp>&rsquo;</dt>
17297 <dt> &lsquo;<samp>c0_seed</samp>&rsquo;</dt>
17298 <dt> &lsquo;<samp>c1_seed</samp>&rsquo;</dt>
17299 <dt> &lsquo;<samp>c2_seed</samp>&rsquo;</dt>
17300 <dt> &lsquo;<samp>c3_seed</samp>&rsquo;</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>.
17303 </p>
17304 </dd>
17305 <dt> &lsquo;<samp>all_strength, alls</samp>&rsquo;</dt>
17306 <dt> &lsquo;<samp>c0_strength, c0s</samp>&rsquo;</dt>
17307 <dt> &lsquo;<samp>c1_strength, c1s</samp>&rsquo;</dt>
17308 <dt> &lsquo;<samp>c2_strength, c2s</samp>&rsquo;</dt>
17309 <dt> &lsquo;<samp>c3_strength, c3s</samp>&rsquo;</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].
17312 </p>
17313 </dd>
17314 <dt> &lsquo;<samp>all_flags, allf</samp>&rsquo;</dt>
17315 <dt> &lsquo;<samp>c0_flags, c0f</samp>&rsquo;</dt>
17316 <dt> &lsquo;<samp>c1_flags, c1f</samp>&rsquo;</dt>
17317 <dt> &lsquo;<samp>c2_flags, c2f</samp>&rsquo;</dt>
17318 <dt> &lsquo;<samp>c3_flags, c3f</samp>&rsquo;</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> &lsquo;<samp>a</samp>&rsquo;</dt>
17323 <dd><p>averaged temporal noise (smoother)
17324 </p></dd>
17325 <dt> &lsquo;<samp>p</samp>&rsquo;</dt>
17326 <dd><p>mix random noise with a (semi)regular pattern
17327 </p></dd>
17328 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
17329 <dd><p>temporal noise (noise pattern changes between frames)
17330 </p></dd>
17331 <dt> &lsquo;<samp>u</samp>&rsquo;</dt>
17332 <dd><p>uniform noise (gaussian otherwise)
17333 </p></dd>
17334 </dl>
17335 </dd>
17336 </dl>
17337
17338 <a name="Examples-17"></a>
17339 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-17">33.55.1 Examples</a></h3>
17340
17341 <p>Add temporal and uniform noise to input video:
17342 </p><table><tr><td>&nbsp;</td><td><pre class="example">noise=alls=20:allf=t+u
17343 </pre></td></tr></table>
17344
17345 <a name="null"></a>
17346 <h2 class="section"><a href="ffplay-all.html#toc-null">33.56 null</a></h2>
17347
17348 <p>Pass the video source unchanged to the output.
17349 </p>
17350 <a name="ocv"></a>
17351 <h2 class="section"><a href="ffplay-all.html#toc-ocv">33.57 ocv</a></h2>
17352
17353 <p>Apply video transform using libopencv.
17354 </p>
17355 <p>To enable this filter install libopencv library and headers and
17356 configure FFmpeg with <code>--enable-libopencv</code>.
17357 </p>
17358 <p>This filter accepts the following parameters:
17359 </p>
17360 <dl compact="compact">
17361 <dt> &lsquo;<samp>filter_name</samp>&rsquo;</dt>
17362 <dd><p>The name of the libopencv filter to apply.
17363 </p>
17364 </dd>
17365 <dt> &lsquo;<samp>filter_params</samp>&rsquo;</dt>
17366 <dd><p>The parameters to pass to the libopencv filter. If not specified the default
17367 values are assumed.
17368 </p>
17369 </dd>
17370 </dl>
17371
17372 <p>Refer to the official libopencv documentation for more precise
17373 information:
17374 <a href="http://opencv.willowgarage.com/documentation/c/image_filtering.html">http://opencv.willowgarage.com/documentation/c/image_filtering.html</a>
17375 </p>
17376 <p>Follows the list of supported libopencv filters.
17377 </p>
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>
17381
17382 <p>Dilate an image by using a specific structuring element.
17383 This filter corresponds to the libopencv function <code>cvDilate</code>.
17384 </p>
17385 <p>It accepts the parameters: <var>struct_el</var>|<var>nb_iterations</var>.
17386 </p>
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>
17389 </p>
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 &quot;rect&quot;, &quot;cross&quot;, &quot;ellipse&quot;, &quot;custom&quot;.
17394 </p>
17395 <p>If the value for <var>shape</var> is &quot;custom&quot;, it must be followed by a
17396 string of the form &quot;=<var>filename</var>&quot;. 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.
17401 </p>
17402 <p>The default value for <var>struct_el</var> is &quot;3x3+0x0/rect&quot;.
17403 </p>
17404 <p><var>nb_iterations</var> specifies the number of times the transform is
17405 applied to the image, and defaults to 1.
17406 </p>
17407 <p>Follow some example:
17408 </p><table><tr><td>&nbsp;</td><td><pre class="example"># use the default values
17409 ocv=dilate
17410
17411 # dilate using a structuring element with a 5x5 cross, iterate two times
17412 ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
17413
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:
17416 #   *
17417 #  ***
17418 # *****
17419 #  ***
17420 #   *
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>
17424
17425 <a name="erode"></a>
17426 <h3 class="subsection"><a href="ffplay-all.html#toc-erode">33.57.2 erode</a></h3>
17427
17428 <p>Erode an image by using a specific structuring element.
17429 This filter corresponds to the libopencv function <code>cvErode</code>.
17430 </p>
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.
17433 </p>
17434 <a name="smooth"></a>
17435 <h3 class="subsection"><a href="ffplay-all.html#toc-smooth">33.57.3 smooth</a></h3>
17436
17437 <p>Smooth the input video.
17438 </p>
17439 <p>The filter takes the following parameters:
17440 <var>type</var>|<var>param1</var>|<var>param2</var>|<var>param3</var>|<var>param4</var>.
17441 </p>
17442 <p><var>type</var> is the type of smooth filter to apply, and can be one of
17443 the following values: &quot;blur&quot;, &quot;blur_no_scale&quot;, &quot;median&quot;, &quot;gaussian&quot;,
17444 &quot;bilateral&quot;. The default value is &quot;gaussian&quot;.
17445 </p>
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.
17450 </p>
17451 <p>The default value for <var>param1</var> is 3, the default value for the
17452 other parameters is 0.
17453 </p>
17454 <p>These parameters correspond to the parameters assigned to the
17455 libopencv function <code>cvSmooth</code>.
17456 </p>
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>
17460
17461 <p>Overlay one video on top of another.
17462 </p>
17463 <p>It takes two inputs and one output, the first input is the &quot;main&quot;
17464 video on which the second input is overlayed.
17465 </p>
17466 <p>This filter accepts the following parameters:
17467 </p>
17468 <p>A description of the accepted options follows.
17469 </p>
17470 <dl compact="compact">
17471 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
17472 <dt> &lsquo;<samp>y</samp>&rsquo;</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 &quot;0&quot; 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).
17477 </p>
17478 </dd>
17479 <dt> &lsquo;<samp>eval</samp>&rsquo;</dt>
17480 <dd><p>Set when the expressions for &lsquo;<samp>x</samp>&rsquo;, and &lsquo;<samp>y</samp>&rsquo; are evaluated.
17481 </p>
17482 <p>It accepts the following values:
17483 </p><dl compact="compact">
17484 <dt> &lsquo;<samp>init</samp>&rsquo;</dt>
17485 <dd><p>only evaluate expressions once during the filter initialization or
17486 when a command is processed
17487 </p>
17488 </dd>
17489 <dt> &lsquo;<samp>frame</samp>&rsquo;</dt>
17490 <dd><p>evaluate expressions for each incoming frame
17491 </p></dd>
17492 </dl>
17493
17494 <p>Default value is &lsquo;<samp>frame</samp>&rsquo;.
17495 </p>
17496 </dd>
17497 <dt> &lsquo;<samp>shortest</samp>&rsquo;</dt>
17498 <dd><p>If set to 1, force the output to terminate when the shortest input
17499 terminates. Default value is 0.
17500 </p>
17501 </dd>
17502 <dt> &lsquo;<samp>format</samp>&rsquo;</dt>
17503 <dd><p>Set the format for the output video.
17504 </p>
17505 <p>It accepts the following values:
17506 </p><dl compact="compact">
17507 <dt> &lsquo;<samp>yuv420</samp>&rsquo;</dt>
17508 <dd><p>force YUV420 output
17509 </p>
17510 </dd>
17511 <dt> &lsquo;<samp>yuv444</samp>&rsquo;</dt>
17512 <dd><p>force YUV444 output
17513 </p>
17514 </dd>
17515 <dt> &lsquo;<samp>rgb</samp>&rsquo;</dt>
17516 <dd><p>force RGB output
17517 </p></dd>
17518 </dl>
17519
17520 <p>Default value is &lsquo;<samp>yuv420</samp>&rsquo;.
17521 </p>
17522 </dd>
17523 <dt> &lsquo;<samp>rgb <em>(deprecated)</em></samp>&rsquo;</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 &lsquo;<samp>format</samp>&rsquo; instead.
17527 </p>
17528 </dd>
17529 <dt> &lsquo;<samp>repeatlast</samp>&rsquo;</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.
17533 </p></dd>
17534 </dl>
17535
17536 <p>The &lsquo;<samp>x</samp>&rsquo;, and &lsquo;<samp>y</samp>&rsquo; expressions can contain the following
17537 parameters.
17538 </p>
17539 <dl compact="compact">
17540 <dt> &lsquo;<samp>main_w, W</samp>&rsquo;</dt>
17541 <dt> &lsquo;<samp>main_h, H</samp>&rsquo;</dt>
17542 <dd><p>main input width and height
17543 </p>
17544 </dd>
17545 <dt> &lsquo;<samp>overlay_w, w</samp>&rsquo;</dt>
17546 <dt> &lsquo;<samp>overlay_h, h</samp>&rsquo;</dt>
17547 <dd><p>overlay input width and height
17548 </p>
17549 </dd>
17550 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
17551 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
17552 <dd><p>the computed values for <var>x</var> and <var>y</var>. They are evaluated for
17553 each new frame.
17554 </p>
17555 </dd>
17556 <dt> &lsquo;<samp>hsub</samp>&rsquo;</dt>
17557 <dt> &lsquo;<samp>vsub</samp>&rsquo;</dt>
17558 <dd><p>horizontal and vertical chroma subsample values of the output
17559 format. For example for the pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and
17560 <var>vsub</var> is 1.
17561 </p>
17562 </dd>
17563 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
17564 <dd><p>the number of input frame, starting from 0
17565 </p>
17566 </dd>
17567 <dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
17568 <dd><p>the position in the file of the input frame, NAN if unknown
17569 </p>
17570 </dd>
17571 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
17572 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
17573 </p></dd>
17574 </dl>
17575
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 &lsquo;<samp>eval</samp>&rsquo; is set to &lsquo;<samp>init</samp>&rsquo;.
17579 </p>
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.
17585 </p>
17586 <p>You can chain together more overlays but you should test the
17587 efficiency of such approach.
17588 </p>
17589 <a name="Commands-2"></a>
17590 <h3 class="subsection"><a href="ffplay-all.html#toc-Commands-2">33.58.1 Commands</a></h3>
17591
17592 <p>This filter supports the following commands:
17593 </p><dl compact="compact">
17594 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
17595 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
17596 <dd><p>Modify the x and y of the overlay input.
17597 The command accepts the same syntax of the corresponding option.
17598 </p>
17599 <p>If the specified expression is not valid, it is kept at its current
17600 value.
17601 </p></dd>
17602 </dl>
17603
17604 <a name="Examples-73"></a>
17605 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-73">33.58.2 Examples</a></h3>
17606
17607 <ul>
17608 <li>
17609 Draw the overlay at 10 pixels from the bottom right corner of the main
17610 video:
17611 <table><tr><td>&nbsp;</td><td><pre class="example">overlay=main_w-overlay_w-10:main_h-overlay_h-10
17612 </pre></td></tr></table>
17613
17614 <p>Using named options the example above becomes:
17615 </p><table><tr><td>&nbsp;</td><td><pre class="example">overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10
17616 </pre></td></tr></table>
17617
17618 </li><li>
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>&nbsp;</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>
17623
17624 </li><li>
17625 Insert 2 different transparent PNG logos (second logo on bottom
17626 right corner) using the <code>ffmpeg</code> tool:
17627 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i input -i logo1 -i logo2 -filter_complex 'overlay=x=10:y=H-h-10,overlay=x=W-w-10:y=H-h-10' output
17628 </pre></td></tr></table>
17629
17630 </li><li>
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>&nbsp;</td><td><pre class="example">color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
17634 </pre></td></tr></table>
17635
17636 </li><li>
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>&nbsp;</td><td><pre class="example">ffplay input.avi -vf 'split[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w'
17640 </pre></td></tr></table>
17641
17642 <p>The above command is the same as:
17643 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay input.avi -vf 'split[b], pad=iw*2[src], [b]deshake, [src]overlay=w'
17644 </pre></td></tr></table>
17645
17646 </li><li>
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>&nbsp;</td><td><pre class="example">overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
17650 </pre></td></tr></table>
17651
17652 </li><li>
17653 Compose output by putting two input videos side to side:
17654 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i left.avi -i right.avi -filter_complex &quot;
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]
17660 &quot;
17661 </pre></td></tr></table>
17662
17663 </li><li>
17664 Chain several overlays in cascade:
17665 <table><tr><td>&nbsp;</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>
17672
17673 </li></ul>
17674
17675 <a name="owdenoise"></a>
17676 <h2 class="section"><a href="ffplay-all.html#toc-owdenoise">33.59 owdenoise</a></h2>
17677
17678 <p>Apply Overcomplete Wavelet denoiser.
17679 </p>
17680 <p>The filter accepts the following options:
17681 </p>
17682 <dl compact="compact">
17683 <dt> &lsquo;<samp>depth</samp>&rsquo;</dt>
17684 <dd><p>Set depth.
17685 </p>
17686 <p>Larger depth values will denoise lower frequency components more, but
17687 slow down filtering.
17688 </p>
17689 <p>Must be an int in the range 8-16, default is <code>8</code>.
17690 </p>
17691 </dd>
17692 <dt> &lsquo;<samp>luma_strength, ls</samp>&rsquo;</dt>
17693 <dd><p>Set luma strength.
17694 </p>
17695 <p>Must be a double value in the range 0-1000, default is <code>1.0</code>.
17696 </p>
17697 </dd>
17698 <dt> &lsquo;<samp>chroma_strength, cs</samp>&rsquo;</dt>
17699 <dd><p>Set chroma strength.
17700 </p>
17701 <p>Must be a double value in the range 0-1000, default is <code>1.0</code>.
17702 </p></dd>
17703 </dl>
17704
17705 <a name="pad"></a>
17706 <h2 class="section"><a href="ffplay-all.html#toc-pad">33.60 pad</a></h2>
17707
17708 <p>Add paddings to the input image, and place the original input at the
17709 given coordinates <var>x</var>, <var>y</var>.
17710 </p>
17711 <p>This filter accepts the following parameters:
17712 </p>
17713 <dl compact="compact">
17714 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
17715 <dt> &lsquo;<samp>height, h</samp>&rsquo;</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.
17719 </p>
17720 <p>The <var>width</var> expression can reference the value set by the
17721 <var>height</var> expression, and vice versa.
17722 </p>
17723 <p>The default value of <var>width</var> and <var>height</var> is 0.
17724 </p>
17725 </dd>
17726 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
17727 <dt> &lsquo;<samp>y</samp>&rsquo;</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
17730 image.
17731 </p>
17732 <p>The <var>x</var> expression can reference the value set by the <var>y</var>
17733 expression, and vice versa.
17734 </p>
17735 <p>The default value of <var>x</var> and <var>y</var> is 0.
17736 </p>
17737 </dd>
17738 <dt> &lsquo;<samp>color</samp>&rsquo;</dt>
17739 <dd><p>Specify the color of the padded area. For the syntax of this option,
17740 check the &quot;Color&quot; section in the ffmpeg-utils manual.
17741 </p>
17742 <p>The default value of <var>color</var> is &quot;black&quot;.
17743 </p></dd>
17744 </dl>
17745
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:
17748 </p>
17749 <dl compact="compact">
17750 <dt> &lsquo;<samp>in_w</samp>&rsquo;</dt>
17751 <dt> &lsquo;<samp>in_h</samp>&rsquo;</dt>
17752 <dd><p>the input video width and height
17753 </p>
17754 </dd>
17755 <dt> &lsquo;<samp>iw</samp>&rsquo;</dt>
17756 <dt> &lsquo;<samp>ih</samp>&rsquo;</dt>
17757 <dd><p>same as <var>in_w</var> and <var>in_h</var>
17758 </p>
17759 </dd>
17760 <dt> &lsquo;<samp>out_w</samp>&rsquo;</dt>
17761 <dt> &lsquo;<samp>out_h</samp>&rsquo;</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
17764 </p>
17765 </dd>
17766 <dt> &lsquo;<samp>ow</samp>&rsquo;</dt>
17767 <dt> &lsquo;<samp>oh</samp>&rsquo;</dt>
17768 <dd><p>same as <var>out_w</var> and <var>out_h</var>
17769 </p>
17770 </dd>
17771 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
17772 <dt> &lsquo;<samp>y</samp>&rsquo;</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
17775 </p>
17776 </dd>
17777 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
17778 <dd><p>same as <var>iw</var> / <var>ih</var>
17779 </p>
17780 </dd>
17781 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
17782 <dd><p>input sample aspect ratio
17783 </p>
17784 </dd>
17785 <dt> &lsquo;<samp>dar</samp>&rsquo;</dt>
17786 <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
17787 </p>
17788 </dd>
17789 <dt> &lsquo;<samp>hsub</samp>&rsquo;</dt>
17790 <dt> &lsquo;<samp>vsub</samp>&rsquo;</dt>
17791 <dd><p>horizontal and vertical chroma subsample values. For example for the
17792 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
17793 </p></dd>
17794 </dl>
17795
17796 <a name="Examples-63"></a>
17797 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-63">33.60.1 Examples</a></h3>
17798
17799 <ul>
17800 <li>
17801 Add paddings with color &quot;violet&quot; to the input video. Output video
17802 size is 640x480, the top-left corner of the input video is placed at
17803 column 0, row 40:
17804 <table><tr><td>&nbsp;</td><td><pre class="example">pad=640:480:0:40:violet
17805 </pre></td></tr></table>
17806
17807 <p>The example above is equivalent to the following command:
17808 </p><table><tr><td>&nbsp;</td><td><pre class="example">pad=width=640:height=480:x=0:y=40:color=violet
17809 </pre></td></tr></table>
17810
17811 </li><li>
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>&nbsp;</td><td><pre class="example">pad=&quot;3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2&quot;
17815 </pre></td></tr></table>
17816
17817 </li><li>
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>&nbsp;</td><td><pre class="example">pad=&quot;max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2&quot;
17822 </pre></td></tr></table>
17823
17824 </li><li>
17825 Pad the input to get a final w/h ratio of 16:9:
17826 <table><tr><td>&nbsp;</td><td><pre class="example">pad=&quot;ih*16/9:ih:(ow-iw)/2:(oh-ih)/2&quot;
17827 </pre></td></tr></table>
17828
17829 </li><li>
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>&nbsp;</td><td><pre class="example">(ih * X / ih) * sar = output_dar
17834 X = output_dar / sar
17835 </pre></td></tr></table>
17836
17837 <p>Thus the previous example needs to be modified to:
17838 </p><table><tr><td>&nbsp;</td><td><pre class="example">pad=&quot;ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2&quot;
17839 </pre></td></tr></table>
17840
17841 </li><li>
17842 Double output size and put the input video in the bottom-right
17843 corner of the output padded area:
17844 <table><tr><td>&nbsp;</td><td><pre class="example">pad=&quot;2*iw:2*ih:ow-iw:oh-ih&quot;
17845 </pre></td></tr></table>
17846 </li></ul>
17847
17848 <a name="perspective"></a>
17849 <h2 class="section"><a href="ffplay-all.html#toc-perspective">33.61 perspective</a></h2>
17850
17851 <p>Correct perspective of video not recorded perpendicular to the screen.
17852 </p>
17853 <p>A description of the accepted parameters follows.
17854 </p>
17855 <dl compact="compact">
17856 <dt> &lsquo;<samp>x0</samp>&rsquo;</dt>
17857 <dt> &lsquo;<samp>y0</samp>&rsquo;</dt>
17858 <dt> &lsquo;<samp>x1</samp>&rsquo;</dt>
17859 <dt> &lsquo;<samp>y1</samp>&rsquo;</dt>
17860 <dt> &lsquo;<samp>x2</samp>&rsquo;</dt>
17861 <dt> &lsquo;<samp>y2</samp>&rsquo;</dt>
17862 <dt> &lsquo;<samp>x3</samp>&rsquo;</dt>
17863 <dt> &lsquo;<samp>y3</samp>&rsquo;</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.
17866 </p>
17867 <p>The expressions can use the following variables:
17868 </p>
17869 <dl compact="compact">
17870 <dt> &lsquo;<samp>W</samp>&rsquo;</dt>
17871 <dt> &lsquo;<samp>H</samp>&rsquo;</dt>
17872 <dd><p>the width and height of video frame.
17873 </p></dd>
17874 </dl>
17875
17876 </dd>
17877 <dt> &lsquo;<samp>interpolation</samp>&rsquo;</dt>
17878 <dd><p>Set interpolation for perspective correction.
17879 </p>
17880 <p>It accepts the following values:
17881 </p><dl compact="compact">
17882 <dt> &lsquo;<samp>linear</samp>&rsquo;</dt>
17883 <dt> &lsquo;<samp>cubic</samp>&rsquo;</dt>
17884 </dl>
17885
17886 <p>Default value is &lsquo;<samp>linear</samp>&rsquo;.
17887 </p></dd>
17888 </dl>
17889
17890 <a name="phase"></a>
17891 <h2 class="section"><a href="ffplay-all.html#toc-phase">33.62 phase</a></h2>
17892
17893 <p>Delay interlaced video by one field time so that the field order changes.
17894 </p>
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.
17897 </p>
17898 <p>A description of the accepted parameters follows.
17899 </p>
17900 <dl compact="compact">
17901 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
17902 <dd><p>Set phase mode.
17903 </p>
17904 <p>It accepts the following values:
17905 </p><dl compact="compact">
17906 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
17907 <dd><p>Capture field order top-first, transfer bottom-first.
17908 Filter will delay the bottom field.
17909 </p>
17910 </dd>
17911 <dt> &lsquo;<samp>b</samp>&rsquo;</dt>
17912 <dd><p>Capture field order bottom-first, transfer top-first.
17913 Filter will delay the top field.
17914 </p>
17915 </dd>
17916 <dt> &lsquo;<samp>p</samp>&rsquo;</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.
17920 </p>
17921 </dd>
17922 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
17923 <dd><p>Capture field order determined automatically by field flags, transfer
17924 opposite.
17925 Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>b</samp>&rsquo; modes on a frame by frame
17926 basis using field flags. If no field information is available,
17927 then this works just like &lsquo;<samp>u</samp>&rsquo;.
17928 </p>
17929 </dd>
17930 <dt> &lsquo;<samp>u</samp>&rsquo;</dt>
17931 <dd><p>Capture unknown or varying, transfer opposite.
17932 Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>b</samp>&rsquo; on a frame by frame basis by
17933 analyzing the images and selecting the alternative that produces best
17934 match between the fields.
17935 </p>
17936 </dd>
17937 <dt> &lsquo;<samp>T</samp>&rsquo;</dt>
17938 <dd><p>Capture top-first, transfer unknown or varying.
17939 Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis.
17940 </p>
17941 </dd>
17942 <dt> &lsquo;<samp>B</samp>&rsquo;</dt>
17943 <dd><p>Capture bottom-first, transfer unknown or varying.
17944 Filter selects among &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis.
17945 </p>
17946 </dd>
17947 <dt> &lsquo;<samp>A</samp>&rsquo;</dt>
17948 <dd><p>Capture determined by field flags, transfer unknown or varying.
17949 Filter selects among &lsquo;<samp>t</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using field flags and
17950 image analysis. If no field information is available, then this works just
17951 like &lsquo;<samp>U</samp>&rsquo;. This is the default mode.
17952 </p>
17953 </dd>
17954 <dt> &lsquo;<samp>U</samp>&rsquo;</dt>
17955 <dd><p>Both capture and transfer unknown or varying.
17956 Filter selects among &lsquo;<samp>t</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis only.
17957 </p></dd>
17958 </dl>
17959 </dd>
17960 </dl>
17961
17962 <a name="pixdesctest"></a>
17963 <h2 class="section"><a href="ffplay-all.html#toc-pixdesctest">33.63 pixdesctest</a></h2>
17964
17965 <p>Pixel format descriptor test filter, mainly useful for internal
17966 testing. The output video should be equal to the input video.
17967 </p>
17968 <p>For example:
17969 </p><table><tr><td>&nbsp;</td><td><pre class="example">format=monow, pixdesctest
17970 </pre></td></tr></table>
17971
17972 <p>can be used to test the monowhite pixel format descriptor definition.
17973 </p>
17974 <a name="pp"></a>
17975 <h2 class="section"><a href="ffplay-all.html#toc-pp">33.64 pp</a></h2>
17976
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 &rsquo;/&rsquo; and can be disabled by prepending a &rsquo;-&rsquo;.
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.
17982 </p>
17983 <p>The filters accept the following options:
17984 </p>
17985 <dl compact="compact">
17986 <dt> &lsquo;<samp>subfilters</samp>&rsquo;</dt>
17987 <dd><p>Set postprocessing subfilters string.
17988 </p></dd>
17989 </dl>
17990
17991 <p>All subfilters share common options to determine their scope:
17992 </p>
17993 <dl compact="compact">
17994 <dt> &lsquo;<samp>a/autoq</samp>&rsquo;</dt>
17995 <dd><p>Honor the quality commands for this subfilter.
17996 </p>
17997 </dd>
17998 <dt> &lsquo;<samp>c/chrom</samp>&rsquo;</dt>
17999 <dd><p>Do chrominance filtering, too (default).
18000 </p>
18001 </dd>
18002 <dt> &lsquo;<samp>y/nochrom</samp>&rsquo;</dt>
18003 <dd><p>Do luminance filtering only (no chrominance).
18004 </p>
18005 </dd>
18006 <dt> &lsquo;<samp>n/noluma</samp>&rsquo;</dt>
18007 <dd><p>Do chrominance filtering only (no luminance).
18008 </p></dd>
18009 </dl>
18010
18011 <p>These options can be appended after the subfilter name, separated by a &rsquo;|&rsquo;.
18012 </p>
18013 <p>Available subfilters are:
18014 </p>
18015 <dl compact="compact">
18016 <dt> &lsquo;<samp>hb/hdeblock[|difference[|flatness]]</samp>&rsquo;</dt>
18017 <dd><p>Horizontal deblocking filter
18018 </p><dl compact="compact">
18019 <dt> &lsquo;<samp>difference</samp>&rsquo;</dt>
18020 <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
18021 </p></dd>
18022 <dt> &lsquo;<samp>flatness</samp>&rsquo;</dt>
18023 <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
18024 </p></dd>
18025 </dl>
18026
18027 </dd>
18028 <dt> &lsquo;<samp>vb/vdeblock[|difference[|flatness]]</samp>&rsquo;</dt>
18029 <dd><p>Vertical deblocking filter
18030 </p><dl compact="compact">
18031 <dt> &lsquo;<samp>difference</samp>&rsquo;</dt>
18032 <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
18033 </p></dd>
18034 <dt> &lsquo;<samp>flatness</samp>&rsquo;</dt>
18035 <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
18036 </p></dd>
18037 </dl>
18038
18039 </dd>
18040 <dt> &lsquo;<samp>ha/hadeblock[|difference[|flatness]]</samp>&rsquo;</dt>
18041 <dd><p>Accurate horizontal deblocking filter
18042 </p><dl compact="compact">
18043 <dt> &lsquo;<samp>difference</samp>&rsquo;</dt>
18044 <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
18045 </p></dd>
18046 <dt> &lsquo;<samp>flatness</samp>&rsquo;</dt>
18047 <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
18048 </p></dd>
18049 </dl>
18050
18051 </dd>
18052 <dt> &lsquo;<samp>va/vadeblock[|difference[|flatness]]</samp>&rsquo;</dt>
18053 <dd><p>Accurate vertical deblocking filter
18054 </p><dl compact="compact">
18055 <dt> &lsquo;<samp>difference</samp>&rsquo;</dt>
18056 <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
18057 </p></dd>
18058 <dt> &lsquo;<samp>flatness</samp>&rsquo;</dt>
18059 <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
18060 </p></dd>
18061 </dl>
18062 </dd>
18063 </dl>
18064
18065 <p>The horizontal and vertical deblocking filters share the difference and
18066 flatness values so you cannot set different horizontal and vertical
18067 thresholds.
18068 </p>
18069 <dl compact="compact">
18070 <dt> &lsquo;<samp>h1/x1hdeblock</samp>&rsquo;</dt>
18071 <dd><p>Experimental horizontal deblocking filter
18072 </p>
18073 </dd>
18074 <dt> &lsquo;<samp>v1/x1vdeblock</samp>&rsquo;</dt>
18075 <dd><p>Experimental vertical deblocking filter
18076 </p>
18077 </dd>
18078 <dt> &lsquo;<samp>dr/dering</samp>&rsquo;</dt>
18079 <dd><p>Deringing filter
18080 </p>
18081 </dd>
18082 <dt> &lsquo;<samp>tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer</samp>&rsquo;</dt>
18083 <dd><dl compact="compact">
18084 <dt> &lsquo;<samp>threshold1</samp>&rsquo;</dt>
18085 <dd><p>larger -&gt; stronger filtering
18086 </p></dd>
18087 <dt> &lsquo;<samp>threshold2</samp>&rsquo;</dt>
18088 <dd><p>larger -&gt; stronger filtering
18089 </p></dd>
18090 <dt> &lsquo;<samp>threshold3</samp>&rsquo;</dt>
18091 <dd><p>larger -&gt; stronger filtering
18092 </p></dd>
18093 </dl>
18094
18095 </dd>
18096 <dt> &lsquo;<samp>al/autolevels[:f/fullyrange], automatic brightness / contrast correction</samp>&rsquo;</dt>
18097 <dd><dl compact="compact">
18098 <dt> &lsquo;<samp>f/fullyrange</samp>&rsquo;</dt>
18099 <dd><p>Stretch luminance to <code>0-255</code>.
18100 </p></dd>
18101 </dl>
18102
18103 </dd>
18104 <dt> &lsquo;<samp>lb/linblenddeint</samp>&rsquo;</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.
18107 </p>
18108 </dd>
18109 <dt> &lsquo;<samp>li/linipoldeint</samp>&rsquo;</dt>
18110 <dd><p>Linear interpolating deinterlacing filter that deinterlaces the given block by
18111 linearly interpolating every second line.
18112 </p>
18113 </dd>
18114 <dt> &lsquo;<samp>ci/cubicipoldeint</samp>&rsquo;</dt>
18115 <dd><p>Cubic interpolating deinterlacing filter deinterlaces the given block by
18116 cubically interpolating every second line.
18117 </p>
18118 </dd>
18119 <dt> &lsquo;<samp>md/mediandeint</samp>&rsquo;</dt>
18120 <dd><p>Median deinterlacing filter that deinterlaces the given block by applying a
18121 median filter to every second line.
18122 </p>
18123 </dd>
18124 <dt> &lsquo;<samp>fd/ffmpegdeint</samp>&rsquo;</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.
18127 </p>
18128 </dd>
18129 <dt> &lsquo;<samp>l5/lowpass5</samp>&rsquo;</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.
18132 </p>
18133 </dd>
18134 <dt> &lsquo;<samp>fq/forceQuant[|quantizer]</samp>&rsquo;</dt>
18135 <dd><p>Overrides the quantizer table from the input with the constant quantizer you
18136 specify.
18137 </p><dl compact="compact">
18138 <dt> &lsquo;<samp>quantizer</samp>&rsquo;</dt>
18139 <dd><p>Quantizer to use
18140 </p></dd>
18141 </dl>
18142
18143 </dd>
18144 <dt> &lsquo;<samp>de/default</samp>&rsquo;</dt>
18145 <dd><p>Default pp filter combination (<code>hb|a,vb|a,dr|a</code>)
18146 </p>
18147 </dd>
18148 <dt> &lsquo;<samp>fa/fast</samp>&rsquo;</dt>
18149 <dd><p>Fast pp filter combination (<code>h1|a,v1|a,dr|a</code>)
18150 </p>
18151 </dd>
18152 <dt> &lsquo;<samp>ac</samp>&rsquo;</dt>
18153 <dd><p>High quality pp filter combination (<code>ha|a|128|7,va|a,dr|a</code>)
18154 </p></dd>
18155 </dl>
18156
18157 <a name="Examples-26"></a>
18158 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-26">33.64.1 Examples</a></h3>
18159
18160 <ul>
18161 <li>
18162 Apply horizontal and vertical deblocking, deringing and automatic
18163 brightness/contrast:
18164 <table><tr><td>&nbsp;</td><td><pre class="example">pp=hb/vb/dr/al
18165 </pre></td></tr></table>
18166
18167 </li><li>
18168 Apply default filters without brightness/contrast correction:
18169 <table><tr><td>&nbsp;</td><td><pre class="example">pp=de/-al
18170 </pre></td></tr></table>
18171
18172 </li><li>
18173 Apply default filters and temporal denoiser:
18174 <table><tr><td>&nbsp;</td><td><pre class="example">pp=default/tmpnoise|1|2|3
18175 </pre></td></tr></table>
18176
18177 </li><li>
18178 Apply deblocking on luminance only, and switch vertical deblocking on or off
18179 automatically depending on available CPU time:
18180 <table><tr><td>&nbsp;</td><td><pre class="example">pp=hb|y/vb|a
18181 </pre></td></tr></table>
18182 </li></ul>
18183
18184 <a name="psnr"></a>
18185 <h2 class="section"><a href="ffplay-all.html#toc-psnr">33.65 psnr</a></h2>
18186
18187 <p>Obtain the average, maximum and minimum PSNR (Peak Signal to Noise
18188 Ratio) between two input videos.
18189 </p>
18190 <p>This filter takes in input two input videos, the first input is
18191 considered the &quot;main&quot; source and is passed unchanged to the
18192 output. The second input is used as a &quot;reference&quot; video for computing
18193 the PSNR.
18194 </p>
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.
18198 </p>
18199 <p>The obtained average PSNR is printed through the logging system.
18200 </p>
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:
18204 </p>
18205 <table><tr><td>&nbsp;</td><td><pre class="example">PSNR = 10*log10(MAX^2/MSE)
18206 </pre></td></tr></table>
18207
18208 <p>Where MAX is the average of the maximum values of each component of the
18209 image.
18210 </p>
18211 <p>The description of the accepted parameters follows.
18212 </p>
18213 <dl compact="compact">
18214 <dt> &lsquo;<samp>stats_file, f</samp>&rsquo;</dt>
18215 <dd><p>If specified the filter will use the named file to save the PSNR of
18216 each individual frame.
18217 </p></dd>
18218 </dl>
18219
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
18222 couple of frames.
18223 </p>
18224 <p>A description of each shown parameter follows:
18225 </p>
18226 <dl compact="compact">
18227 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
18228 <dd><p>sequential number of the input frame, starting from 1
18229 </p>
18230 </dd>
18231 <dt> &lsquo;<samp>mse_avg</samp>&rsquo;</dt>
18232 <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
18233 frames, averaged over all the image components.
18234 </p>
18235 </dd>
18236 <dt> &lsquo;<samp>mse_y, mse_u, mse_v, mse_r, mse_g, mse_g, mse_a</samp>&rsquo;</dt>
18237 <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
18238 frames for the component specified by the suffix.
18239 </p>
18240 </dd>
18241 <dt> &lsquo;<samp>psnr_y, psnr_u, psnr_v, psnr_r, psnr_g, psnr_b, psnr_a</samp>&rsquo;</dt>
18242 <dd><p>Peak Signal to Noise ratio of the compared frames for the component
18243 specified by the suffix.
18244 </p></dd>
18245 </dl>
18246
18247 <p>For example:
18248 </p><table><tr><td>&nbsp;</td><td><pre class="example">movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
18249 [main][ref] psnr=&quot;stats_file=stats.log&quot; [out]
18250 </pre></td></tr></table>
18251
18252 <p>On this example the input file being processed is compared with the
18253 reference file &lsquo;<tt>ref_movie.mpg</tt>&rsquo;. The PSNR of each individual frame
18254 is stored in &lsquo;<tt>stats.log</tt>&rsquo;.
18255 </p>
18256 <a name="pullup"></a>
18257 <h2 class="section"><a href="ffplay-all.html#toc-pullup">33.66 pullup</a></h2>
18258
18259 <p>Pulldown reversal (inverse telecine) filter, capable of handling mixed
18260 hard-telecine, 24000/1001 fps progressive, and 30000/1001 fps progressive
18261 content.
18262 </p>
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.
18267 </p>
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.
18271 </p>
18272 <p>The filter accepts the following options:
18273 </p>
18274 <dl compact="compact">
18275 <dt> &lsquo;<samp>jl</samp>&rsquo;</dt>
18276 <dt> &lsquo;<samp>jr</samp>&rsquo;</dt>
18277 <dt> &lsquo;<samp>jt</samp>&rsquo;</dt>
18278 <dt> &lsquo;<samp>jb</samp>&rsquo;</dt>
18279 <dd><p>These options set the amount of &quot;junk&quot; 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.
18283 </p>
18284 </dd>
18285 <dt> &lsquo;<samp>sb</samp>&rsquo;</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>.
18293 </p>
18294 </dd>
18295 <dt> &lsquo;<samp>mp</samp>&rsquo;</dt>
18296 <dd><p>Set the metric plane to use. It accepts the following values:
18297 </p><dl compact="compact">
18298 <dt> &lsquo;<samp>l</samp>&rsquo;</dt>
18299 <dd><p>Use luma plane.
18300 </p>
18301 </dd>
18302 <dt> &lsquo;<samp>u</samp>&rsquo;</dt>
18303 <dd><p>Use chroma blue plane.
18304 </p>
18305 </dd>
18306 <dt> &lsquo;<samp>v</samp>&rsquo;</dt>
18307 <dd><p>Use chroma red plane.
18308 </p></dd>
18309 </dl>
18310
18311 <p>This option may be set to use chroma plane instead of the default luma plane
18312 for doing filter&rsquo;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 &lsquo;<samp>mp</samp>&rsquo; to a chroma plane is to reduce CPU
18316 load and make pullup usable in realtime on slow machines.
18317 </p></dd>
18318 </dl>
18319
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>&nbsp;</td><td><pre class="example">ffmpeg -i input -vf pullup -r 24000/1001 ...
18324 </pre></td></tr></table>
18325
18326 <a name="removelogo"></a>
18327 <h2 class="section"><a href="ffplay-all.html#toc-removelogo">33.67 removelogo</a></h2>
18328
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.
18332 </p>
18333 <p>The filter accepts the following options:
18334 </p>
18335 <dl compact="compact">
18336 <dt> &lsquo;<samp>filename, f</samp>&rsquo;</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.
18340 </p></dd>
18341 </dl>
18342
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.
18350 </p>
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.
18357 </p>
18358 <a name="rotate"></a>
18359 <h2 class="section"><a href="ffplay-all.html#toc-rotate">33.68 rotate</a></h2>
18360
18361 <p>Rotate video by an arbitrary angle expressed in radians.
18362 </p>
18363 <p>The filter accepts the following options:
18364 </p>
18365 <p>A description of the optional parameters follows.
18366 </p><dl compact="compact">
18367 <dt> &lsquo;<samp>angle, a</samp>&rsquo;</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 &quot;0&quot;.
18371 </p>
18372 <p>This expression is evaluated for each frame.
18373 </p>
18374 </dd>
18375 <dt> &lsquo;<samp>out_w, ow</samp>&rsquo;</dt>
18376 <dd><p>Set the output width expression, default value is &quot;iw&quot;.
18377 This expression is evaluated just once during configuration.
18378 </p>
18379 </dd>
18380 <dt> &lsquo;<samp>out_h, oh</samp>&rsquo;</dt>
18381 <dd><p>Set the output height expression, default value is &quot;ih&quot;.
18382 This expression is evaluated just once during configuration.
18383 </p>
18384 </dd>
18385 <dt> &lsquo;<samp>bilinear</samp>&rsquo;</dt>
18386 <dd><p>Enable bilinear interpolation if set to 1, a value of 0 disables
18387 it. Default value is 1.
18388 </p>
18389 </dd>
18390 <dt> &lsquo;<samp>fillcolor, c</samp>&rsquo;</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 &quot;Color&quot; section in the
18393 ffmpeg-utils manual. If the special value &quot;none&quot; is selected then no
18394 background is printed (useful for example if the background is never shown).
18395 </p>
18396 <p>Default value is &quot;black&quot;.
18397 </p></dd>
18398 </dl>
18399
18400 <p>The expressions for the angle and the output size can contain the
18401 following constants and functions:
18402 </p>
18403 <dl compact="compact">
18404 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
18405 <dd><p>sequential number of the input frame, starting from 0. It is always NAN
18406 before the first frame is filtered.
18407 </p>
18408 </dd>
18409 <dt> &lsquo;<samp>t</samp>&rsquo;</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.
18412 </p>
18413 </dd>
18414 <dt> &lsquo;<samp>hsub</samp>&rsquo;</dt>
18415 <dt> &lsquo;<samp>vsub</samp>&rsquo;</dt>
18416 <dd><p>horizontal and vertical chroma subsample values. For example for the
18417 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
18418 </p>
18419 </dd>
18420 <dt> &lsquo;<samp>in_w, iw</samp>&rsquo;</dt>
18421 <dt> &lsquo;<samp>in_h, ih</samp>&rsquo;</dt>
18422 <dd><p>the input video width and heigth
18423 </p>
18424 </dd>
18425 <dt> &lsquo;<samp>out_w, ow</samp>&rsquo;</dt>
18426 <dt> &lsquo;<samp>out_h, oh</samp>&rsquo;</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
18429 </p>
18430 </dd>
18431 <dt> &lsquo;<samp>rotw(a)</samp>&rsquo;</dt>
18432 <dt> &lsquo;<samp>roth(a)</samp>&rsquo;</dt>
18433 <dd><p>the minimal width/height required for completely containing the input
18434 video rotated by <var>a</var> radians.
18435 </p>
18436 <p>These are only available when computing the &lsquo;<samp>out_w</samp>&rsquo; and
18437 &lsquo;<samp>out_h</samp>&rsquo; expressions.
18438 </p></dd>
18439 </dl>
18440
18441 <a name="Examples-61"></a>
18442 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-61">33.68.1 Examples</a></h3>
18443
18444 <ul>
18445 <li>
18446 Rotate the input by PI/6 radians clockwise:
18447 <table><tr><td>&nbsp;</td><td><pre class="example">rotate=PI/6
18448 </pre></td></tr></table>
18449
18450 </li><li>
18451 Rotate the input by PI/6 radians counter-clockwise:
18452 <table><tr><td>&nbsp;</td><td><pre class="example">rotate=-PI/6
18453 </pre></td></tr></table>
18454
18455 </li><li>
18456 Apply a constant rotation with period T, starting from an angle of PI/3:
18457 <table><tr><td>&nbsp;</td><td><pre class="example">rotate=PI/3+2*PI*t/T
18458 </pre></td></tr></table>
18459
18460 </li><li>
18461 Make the input video rotation oscillating with a period of T
18462 seconds and an amplitude of A radians:
18463 <table><tr><td>&nbsp;</td><td><pre class="example">rotate=A*sin(2*PI/T*t)
18464 </pre></td></tr></table>
18465
18466 </li><li>
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>&nbsp;</td><td><pre class="example">rotate='2*PI*t:ow=hypot(iw,ih):oh=ow'
18470 </pre></td></tr></table>
18471
18472 </li><li>
18473 Rotate the video, reduce the output size so that no background is ever
18474 shown:
18475 <table><tr><td>&nbsp;</td><td><pre class="example">rotate=2*PI*t:ow='min(iw,ih)/sqrt(2)':oh=ow:c=none
18476 </pre></td></tr></table>
18477 </li></ul>
18478
18479 <a name="Commands-1"></a>
18480 <h3 class="subsection"><a href="ffplay-all.html#toc-Commands-1">33.68.2 Commands</a></h3>
18481
18482 <p>The filter supports the following commands:
18483 </p>
18484 <dl compact="compact">
18485 <dt> &lsquo;<samp>a, angle</samp>&rsquo;</dt>
18486 <dd><p>Set the angle expression.
18487 The command accepts the same syntax of the corresponding option.
18488 </p>
18489 <p>If the specified expression is not valid, it is kept at its current
18490 value.
18491 </p></dd>
18492 </dl>
18493
18494 <a name="sab"></a>
18495 <h2 class="section"><a href="ffplay-all.html#toc-sab">33.69 sab</a></h2>
18496
18497 <p>Apply Shape Adaptive Blur.
18498 </p>
18499 <p>The filter accepts the following options:
18500 </p>
18501 <dl compact="compact">
18502 <dt> &lsquo;<samp>luma_radius, lr</samp>&rsquo;</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.
18506 </p>
18507 </dd>
18508 <dt> &lsquo;<samp>luma_pre_filter_radius, lpfr</samp>&rsquo;</dt>
18509 <dd><p>Set luma pre-filter radius, must be a value in the 0.1-2.0 range, default
18510 value is 1.0.
18511 </p>
18512 </dd>
18513 <dt> &lsquo;<samp>luma_strength, ls</samp>&rsquo;</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.
18516 </p>
18517 </dd>
18518 <dt> &lsquo;<samp>chroma_radius, cr</samp>&rsquo;</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
18521 processing.
18522 </p>
18523 </dd>
18524 <dt> &lsquo;<samp>chroma_pre_filter_radius, cpfr</samp>&rsquo;</dt>
18525 <dd><p>Set chroma pre-filter radius, must be a value in the 0.1-2.0 range.
18526 </p>
18527 </dd>
18528 <dt> &lsquo;<samp>chroma_strength, cs</samp>&rsquo;</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.
18531 </p></dd>
18532 </dl>
18533
18534 <p>Each chroma option value, if not explicitly specified, is set to the
18535 corresponding luma option value.
18536 </p>
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>
18540
18541 <p>Scale (resize) the input video, using the libswscale library.
18542 </p>
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.
18545 </p>
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
18548 requested format.
18549 </p>
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.
18554 </p>
18555 <p>See <a href="ffmpeg-scaler.html#scaler_005foptions">(ffmpeg-scaler)scaler_options</a> for
18556 the complete list of scaler options.
18557 </p>
18558 <dl compact="compact">
18559 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
18560 <dt> &lsquo;<samp>height, h</samp>&rsquo;</dt>
18561 <dd><p>Set the output video dimension expression. Default value is the input
18562 dimension.
18563 </p>
18564 <p>If the value is 0, the input width is used for the output.
18565 </p>
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
18569 used
18570 </p>
18571 <p>See below for the list of accepted constants for use in the dimension
18572 expression.
18573 </p>
18574 </dd>
18575 <dt> &lsquo;<samp>interl</samp>&rsquo;</dt>
18576 <dd><p>Set the interlacing mode. It accepts the following values:
18577 </p>
18578 <dl compact="compact">
18579 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
18580 <dd><p>Force interlaced aware scaling.
18581 </p>
18582 </dd>
18583 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
18584 <dd><p>Do not apply interlaced scaling.
18585 </p>
18586 </dd>
18587 <dt> &lsquo;<samp>-1</samp>&rsquo;</dt>
18588 <dd><p>Select interlaced aware scaling depending on whether the source frames
18589 are flagged as interlaced or not.
18590 </p></dd>
18591 </dl>
18592
18593 <p>Default value is &lsquo;<samp>0</samp>&rsquo;.
18594 </p>
18595 </dd>
18596 <dt> &lsquo;<samp>flags</samp>&rsquo;</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
18600 the default flags.
18601 </p>
18602 </dd>
18603 <dt> &lsquo;<samp>size, s</samp>&rsquo;</dt>
18604 <dd><p>Set the video size. For the syntax of this option, check the &quot;Video size&quot;
18605 section in the ffmpeg-utils manual.
18606 </p>
18607 </dd>
18608 <dt> &lsquo;<samp>in_color_matrix</samp>&rsquo;</dt>
18609 <dt> &lsquo;<samp>out_color_matrix</samp>&rsquo;</dt>
18610 <dd><p>Set in/output YCbCr color space type.
18611 </p>
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.
18614 </p>
18615 <p>If not specified, the color space type depends on the pixel format.
18616 </p>
18617 <p>Possible values:
18618 </p>
18619 <dl compact="compact">
18620 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
18621 <dd><p>Choose automatically.
18622 </p>
18623 </dd>
18624 <dt> &lsquo;<samp>bt709</samp>&rsquo;</dt>
18625 <dd><p>Format conforming to International Telecommunication Union (ITU)
18626 Recommendation BT.709.
18627 </p>
18628 </dd>
18629 <dt> &lsquo;<samp>fcc</samp>&rsquo;</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).
18632 </p>
18633 </dd>
18634 <dt> &lsquo;<samp>bt601</samp>&rsquo;</dt>
18635 <dd><p>Set color space conforming to:
18636 </p>
18637 <ul>
18638 <li>
18639 ITU Radiocommunication Sector (ITU-R) Recommendation BT.601
18640
18641 </li><li>
18642 ITU-R Rec. BT.470-6 (1998) Systems B, B1, and G
18643
18644 </li><li>
18645 Society of Motion Picture and Television Engineers (SMPTE) ST 170:2004
18646
18647 </li></ul>
18648
18649 </dd>
18650 <dt> &lsquo;<samp>smpte240m</samp>&rsquo;</dt>
18651 <dd><p>Set color space conforming to SMPTE ST 240:1999.
18652 </p></dd>
18653 </dl>
18654
18655 </dd>
18656 <dt> &lsquo;<samp>in_range</samp>&rsquo;</dt>
18657 <dt> &lsquo;<samp>out_range</samp>&rsquo;</dt>
18658 <dd><p>Set in/output YCbCr sample range.
18659 </p>
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:
18663 </p>
18664 <dl compact="compact">
18665 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
18666 <dd><p>Choose automatically.
18667 </p>
18668 </dd>
18669 <dt> &lsquo;<samp>jpeg/full/pc</samp>&rsquo;</dt>
18670 <dd><p>Set full range (0-255 in case of 8-bit luma).
18671 </p>
18672 </dd>
18673 <dt> &lsquo;<samp>mpeg/tv</samp>&rsquo;</dt>
18674 <dd><p>Set &quot;MPEG&quot; range (16-235 in case of 8-bit luma).
18675 </p></dd>
18676 </dl>
18677
18678 </dd>
18679 <dt> &lsquo;<samp>force_original_aspect_ratio</samp>&rsquo;</dt>
18680 <dd><p>Enable decreasing or increasing output video width or height if necessary to
18681 keep the original aspect ratio. Possible values:
18682 </p>
18683 <dl compact="compact">
18684 <dt> &lsquo;<samp>disable</samp>&rsquo;</dt>
18685 <dd><p>Scale the video as specified and disable this feature.
18686 </p>
18687 </dd>
18688 <dt> &lsquo;<samp>decrease</samp>&rsquo;</dt>
18689 <dd><p>The output video dimensions will automatically be decreased if needed.
18690 </p>
18691 </dd>
18692 <dt> &lsquo;<samp>increase</samp>&rsquo;</dt>
18693 <dd><p>The output video dimensions will automatically be increased if needed.
18694 </p>
18695 </dd>
18696 </dl>
18697
18698 <p>One useful instance of this option is that when you know a specific device&rsquo;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
18703 1280x533.
18704 </p>
18705 <p>Please note that this is a different thing than specifying -1 for &lsquo;<samp>w</samp>&rsquo;
18706 or &lsquo;<samp>h</samp>&rsquo;, you still need to specify the output resolution for this option
18707 to work.
18708 </p>
18709 </dd>
18710 </dl>
18711
18712 <p>The values of the &lsquo;<samp>w</samp>&rsquo; and &lsquo;<samp>h</samp>&rsquo; options are expressions
18713 containing the following constants:
18714 </p>
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
18719 </p>
18720 </dd>
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>
18724 </p>
18725 </dd>
18726 <dt> <var>out_w</var></dt>
18727 <dt> <var>out_h</var></dt>
18728 <dd><p>the output (scaled) width and height
18729 </p>
18730 </dd>
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>
18734 </p>
18735 </dd>
18736 <dt> <var>a</var></dt>
18737 <dd><p>same as <var>iw</var> / <var>ih</var>
18738 </p>
18739 </dd>
18740 <dt> <var>sar</var></dt>
18741 <dd><p>input sample aspect ratio
18742 </p>
18743 </dd>
18744 <dt> <var>dar</var></dt>
18745 <dd><p>input display aspect ratio. Calculated from <code>(iw / ih) * sar</code>.
18746 </p>
18747 </dd>
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 &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
18752 </p>
18753 </dd>
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 &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
18758 </p></dd>
18759 </dl>
18760
18761 <a name="Examples-1"></a>
18762 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-1">33.70.2 Examples</a></h3>
18763
18764 <ul>
18765 <li>
18766 Scale the input video to a size of 200x100:
18767 <table><tr><td>&nbsp;</td><td><pre class="example">scale=w=200:h=100
18768 </pre></td></tr></table>
18769
18770 <p>This is equivalent to:
18771 </p><table><tr><td>&nbsp;</td><td><pre class="example">scale=200:100
18772 </pre></td></tr></table>
18773
18774 <p>or:
18775 </p><table><tr><td>&nbsp;</td><td><pre class="example">scale=200x100
18776 </pre></td></tr></table>
18777
18778 </li><li>
18779 Specify a size abbreviation for the output size:
18780 <table><tr><td>&nbsp;</td><td><pre class="example">scale=qcif
18781 </pre></td></tr></table>
18782
18783 <p>which can also be written as:
18784 </p><table><tr><td>&nbsp;</td><td><pre class="example">scale=size=qcif
18785 </pre></td></tr></table>
18786
18787 </li><li>
18788 Scale the input to 2x:
18789 <table><tr><td>&nbsp;</td><td><pre class="example">scale=w=2*iw:h=2*ih
18790 </pre></td></tr></table>
18791
18792 </li><li>
18793 The above is the same as:
18794 <table><tr><td>&nbsp;</td><td><pre class="example">scale=2*in_w:2*in_h
18795 </pre></td></tr></table>
18796
18797 </li><li>
18798 Scale the input to 2x with forced interlaced scaling:
18799 <table><tr><td>&nbsp;</td><td><pre class="example">scale=2*iw:2*ih:interl=1
18800 </pre></td></tr></table>
18801
18802 </li><li>
18803 Scale the input to half size:
18804 <table><tr><td>&nbsp;</td><td><pre class="example">scale=w=iw/2:h=ih/2
18805 </pre></td></tr></table>
18806
18807 </li><li>
18808 Increase the width, and set the height to the same size:
18809 <table><tr><td>&nbsp;</td><td><pre class="example">scale=3/2*iw:ow
18810 </pre></td></tr></table>
18811
18812 </li><li>
18813 Seek for Greek harmony:
18814 <table><tr><td>&nbsp;</td><td><pre class="example">scale=iw:1/PHI*iw
18815 scale=ih*PHI:ih
18816 </pre></td></tr></table>
18817
18818 </li><li>
18819 Increase the height, and set the width to 3/2 of the height:
18820 <table><tr><td>&nbsp;</td><td><pre class="example">scale=w=3/2*oh:h=3/5*ih
18821 </pre></td></tr></table>
18822
18823 </li><li>
18824 Increase the size, but make the size a multiple of the chroma
18825 subsample values:
18826 <table><tr><td>&nbsp;</td><td><pre class="example">scale=&quot;trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub&quot;
18827 </pre></td></tr></table>
18828
18829 </li><li>
18830 Increase the width to a maximum of 500 pixels, keep the same input
18831 aspect ratio:
18832 <table><tr><td>&nbsp;</td><td><pre class="example">scale=w='min(500\, iw*3/2):h=-1'
18833 </pre></td></tr></table>
18834 </li></ul>
18835
18836 <a name="separatefields"></a>
18837 <h2 class="section"><a href="ffplay-all.html#toc-separatefields">33.71 separatefields</a></h2>
18838
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.
18842 </p>
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.
18846 </p>
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>
18849
18850 <p>The <code>setdar</code> filter sets the Display Aspect Ratio for the filter
18851 output video.
18852 </p>
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>&nbsp;</td><td><pre class="example"><var>DAR</var> = <var>HORIZONTAL_RESOLUTION</var> / <var>VERTICAL_RESOLUTION</var> * <var>SAR</var>
18856 </pre></td></tr></table>
18857
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 &quot;setdar&quot; or a &quot;setsar&quot; filter is
18862 applied.
18863 </p>
18864 <p>The <code>setsar</code> filter sets the Sample (aka Pixel) Aspect Ratio for
18865 the filter output video.
18866 </p>
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
18869 above.
18870 </p>
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 &quot;setsar&quot; or a &quot;setdar&quot; filter is applied.
18874 </p>
18875 <p>The filters accept the following options:
18876 </p>
18877 <dl compact="compact">
18878 <dt> &lsquo;<samp>r, ratio, dar (<code>setdar</code> only), sar (<code>setsar</code> only)</samp>&rsquo;</dt>
18879 <dd><p>Set the aspect ratio used by the filter.
18880 </p>
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 &quot;0&quot;.
18885 In case the form &quot;<var>num</var>:<var>den</var>&quot; is used, the <code>:</code> character
18886 should be escaped.
18887 </p>
18888 </dd>
18889 <dt> &lsquo;<samp>max</samp>&rsquo;</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>.
18893 </p>
18894 </dd>
18895 </dl>
18896
18897 <p>The parameter <var>sar</var> is an expression containing
18898 the following constants:
18899 </p>
18900 <dl compact="compact">
18901 <dt> &lsquo;<samp>E, PI, PHI</samp>&rsquo;</dt>
18902 <dd><p>the corresponding mathematical approximated values for e
18903 (euler number), pi (greek PI), phi (golden ratio)
18904 </p>
18905 </dd>
18906 <dt> &lsquo;<samp>w, h</samp>&rsquo;</dt>
18907 <dd><p>the input width and height
18908 </p>
18909 </dd>
18910 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
18911 <dd><p>same as <var>w</var> / <var>h</var>
18912 </p>
18913 </dd>
18914 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
18915 <dd><p>input sample aspect ratio
18916 </p>
18917 </dd>
18918 <dt> &lsquo;<samp>dar</samp>&rsquo;</dt>
18919 <dd><p>input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>
18920 </p>
18921 </dd>
18922 <dt> &lsquo;<samp>hsub, vsub</samp>&rsquo;</dt>
18923 <dd><p>horizontal and vertical chroma subsample values. For example for the
18924 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
18925 </p></dd>
18926 </dl>
18927
18928 <a name="Examples-91"></a>
18929 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-91">33.72.1 Examples</a></h3>
18930
18931 <ul>
18932 <li>
18933 To change the display aspect ratio to 16:9, specify one of the following:
18934 <table><tr><td>&nbsp;</td><td><pre class="example">setdar=dar=1.77777
18935 setdar=dar=16/9
18936 setdar=dar=1.77777
18937 </pre></td></tr></table>
18938
18939 </li><li>
18940 To change the sample aspect ratio to 10:11, specify:
18941 <table><tr><td>&nbsp;</td><td><pre class="example">setsar=sar=10/11
18942 </pre></td></tr></table>
18943
18944 </li><li>
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>&nbsp;</td><td><pre class="example">setdar=ratio=16/9:max=1000
18948 </pre></td></tr></table>
18949
18950 </li></ul>
18951
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>
18955
18956 <p>Force field for the output video frame.
18957 </p>
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>).
18962 </p>
18963 <p>The filter accepts the following options:
18964 </p>
18965 <dl compact="compact">
18966 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
18967 <dd><p>Available values are:
18968 </p>
18969 <dl compact="compact">
18970 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
18971 <dd><p>Keep the same field property.
18972 </p>
18973 </dd>
18974 <dt> &lsquo;<samp>bff</samp>&rsquo;</dt>
18975 <dd><p>Mark the frame as bottom-field-first.
18976 </p>
18977 </dd>
18978 <dt> &lsquo;<samp>tff</samp>&rsquo;</dt>
18979 <dd><p>Mark the frame as top-field-first.
18980 </p>
18981 </dd>
18982 <dt> &lsquo;<samp>prog</samp>&rsquo;</dt>
18983 <dd><p>Mark the frame as progressive.
18984 </p></dd>
18985 </dl>
18986 </dd>
18987 </dl>
18988
18989 <a name="showinfo"></a>
18990 <h2 class="section"><a href="ffplay-all.html#toc-showinfo">33.74 showinfo</a></h2>
18991
18992 <p>Show a line containing various information for each input video frame.
18993 The input video is not modified.
18994 </p>
18995 <p>The shown line contains a sequence of key/value pairs of the form
18996 <var>key</var>:<var>value</var>.
18997 </p>
18998 <p>A description of each shown parameter follows:
18999 </p>
19000 <dl compact="compact">
19001 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
19002 <dd><p>sequential number of the input frame, starting from 0
19003 </p>
19004 </dd>
19005 <dt> &lsquo;<samp>pts</samp>&rsquo;</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.
19008 </p>
19009 </dd>
19010 <dt> &lsquo;<samp>pts_time</samp>&rsquo;</dt>
19011 <dd><p>Presentation TimeStamp of the input frame, expressed as a number of
19012 seconds
19013 </p>
19014 </dd>
19015 <dt> &lsquo;<samp>pos</samp>&rsquo;</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)
19018 </p>
19019 </dd>
19020 <dt> &lsquo;<samp>fmt</samp>&rsquo;</dt>
19021 <dd><p>pixel format name
19022 </p>
19023 </dd>
19024 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
19025 <dd><p>sample aspect ratio of the input frame, expressed in the form
19026 <var>num</var>/<var>den</var>
19027 </p>
19028 </dd>
19029 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
19030 <dd><p>size of the input frame. For the syntax of this option, check the &quot;Video size&quot;
19031 section in the ffmpeg-utils manual.
19032 </p>
19033 </dd>
19034 <dt> &lsquo;<samp>i</samp>&rsquo;</dt>
19035 <dd><p>interlaced mode (&quot;P&quot; for &quot;progressive&quot;, &quot;T&quot; for top field first, &quot;B&quot;
19036 for bottom field first)
19037 </p>
19038 </dd>
19039 <dt> &lsquo;<samp>iskey</samp>&rsquo;</dt>
19040 <dd><p>1 if the frame is a key frame, 0 otherwise
19041 </p>
19042 </dd>
19043 <dt> &lsquo;<samp>type</samp>&rsquo;</dt>
19044 <dd><p>picture type of the input frame (&quot;I&quot; for an I-frame, &quot;P&quot; for a
19045 P-frame, &quot;B&quot; for a B-frame, &quot;?&quot; 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 &lsquo;<tt>libavutil/avutil.h</tt>&rsquo;.
19049 </p>
19050 </dd>
19051 <dt> &lsquo;<samp>checksum</samp>&rsquo;</dt>
19052 <dd><p>Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame
19053 </p>
19054 </dd>
19055 <dt> &lsquo;<samp>plane_checksum</samp>&rsquo;</dt>
19056 <dd><p>Adler-32 checksum (printed in hexadecimal) of each plane of the input frame,
19057 expressed in the form &quot;[<var>c0</var> <var>c1</var> <var>c2</var> <var>c3</var>]&quot;
19058 </p></dd>
19059 </dl>
19060
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>
19064
19065 <p>Blur the input video without impacting the outlines.
19066 </p>
19067 <p>The filter accepts the following options:
19068 </p>
19069 <dl compact="compact">
19070 <dt> &lsquo;<samp>luma_radius, lr</samp>&rsquo;</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.
19074 </p>
19075 </dd>
19076 <dt> &lsquo;<samp>luma_strength, ls</samp>&rsquo;</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.
19081 </p>
19082 </dd>
19083 <dt> &lsquo;<samp>luma_threshold, lt</samp>&rsquo;</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.
19089 </p>
19090 </dd>
19091 <dt> &lsquo;<samp>chroma_radius, cr</samp>&rsquo;</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.
19095 </p>
19096 </dd>
19097 <dt> &lsquo;<samp>chroma_strength, cs</samp>&rsquo;</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.
19102 </p>
19103 </dd>
19104 <dt> &lsquo;<samp>chroma_threshold, ct</samp>&rsquo;</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.
19110 </p></dd>
19111 </dl>
19112
19113 <p>If a chroma option is not explicitly set, the corresponding luma value
19114 is set.
19115 </p>
19116 <a name="stereo3d"></a>
19117 <h2 class="section"><a href="ffplay-all.html#toc-stereo3d">33.76 stereo3d</a></h2>
19118
19119 <p>Convert between different stereoscopic image formats.
19120 </p>
19121 <p>The filters accept the following options:
19122 </p>
19123 <dl compact="compact">
19124 <dt> &lsquo;<samp>in</samp>&rsquo;</dt>
19125 <dd><p>Set stereoscopic image format of input.
19126 </p>
19127 <p>Available values for input image formats are:
19128 </p><dl compact="compact">
19129 <dt> &lsquo;<samp>sbsl</samp>&rsquo;</dt>
19130 <dd><p>side by side parallel (left eye left, right eye right)
19131 </p>
19132 </dd>
19133 <dt> &lsquo;<samp>sbsr</samp>&rsquo;</dt>
19134 <dd><p>side by side crosseye (right eye left, left eye right)
19135 </p>
19136 </dd>
19137 <dt> &lsquo;<samp>sbs2l</samp>&rsquo;</dt>
19138 <dd><p>side by side parallel with half width resolution
19139 (left eye left, right eye right)
19140 </p>
19141 </dd>
19142 <dt> &lsquo;<samp>sbs2r</samp>&rsquo;</dt>
19143 <dd><p>side by side crosseye with half width resolution
19144 (right eye left, left eye right)
19145 </p>
19146 </dd>
19147 <dt> &lsquo;<samp>abl</samp>&rsquo;</dt>
19148 <dd><p>above-below (left eye above, right eye below)
19149 </p>
19150 </dd>
19151 <dt> &lsquo;<samp>abr</samp>&rsquo;</dt>
19152 <dd><p>above-below (right eye above, left eye below)
19153 </p>
19154 </dd>
19155 <dt> &lsquo;<samp>ab2l</samp>&rsquo;</dt>
19156 <dd><p>above-below with half height resolution
19157 (left eye above, right eye below)
19158 </p>
19159 </dd>
19160 <dt> &lsquo;<samp>ab2r</samp>&rsquo;</dt>
19161 <dd><p>above-below with half height resolution
19162 (right eye above, left eye below)
19163 </p>
19164 </dd>
19165 <dt> &lsquo;<samp>al</samp>&rsquo;</dt>
19166 <dd><p>alternating frames (left eye first, right eye second)
19167 </p>
19168 </dd>
19169 <dt> &lsquo;<samp>ar</samp>&rsquo;</dt>
19170 <dd><p>alternating frames (right eye first, left eye second)
19171 </p>
19172 <p>Default value is &lsquo;<samp>sbsl</samp>&rsquo;.
19173 </p></dd>
19174 </dl>
19175
19176 </dd>
19177 <dt> &lsquo;<samp>out</samp>&rsquo;</dt>
19178 <dd><p>Set stereoscopic image format of output.
19179 </p>
19180 <p>Available values for output image formats are all the input formats as well as:
19181 </p><dl compact="compact">
19182 <dt> &lsquo;<samp>arbg</samp>&rsquo;</dt>
19183 <dd><p>anaglyph red/blue gray
19184 (red filter on left eye, blue filter on right eye)
19185 </p>
19186 </dd>
19187 <dt> &lsquo;<samp>argg</samp>&rsquo;</dt>
19188 <dd><p>anaglyph red/green gray
19189 (red filter on left eye, green filter on right eye)
19190 </p>
19191 </dd>
19192 <dt> &lsquo;<samp>arcg</samp>&rsquo;</dt>
19193 <dd><p>anaglyph red/cyan gray
19194 (red filter on left eye, cyan filter on right eye)
19195 </p>
19196 </dd>
19197 <dt> &lsquo;<samp>arch</samp>&rsquo;</dt>
19198 <dd><p>anaglyph red/cyan half colored
19199 (red filter on left eye, cyan filter on right eye)
19200 </p>
19201 </dd>
19202 <dt> &lsquo;<samp>arcc</samp>&rsquo;</dt>
19203 <dd><p>anaglyph red/cyan color
19204 (red filter on left eye, cyan filter on right eye)
19205 </p>
19206 </dd>
19207 <dt> &lsquo;<samp>arcd</samp>&rsquo;</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)
19210 </p>
19211 </dd>
19212 <dt> &lsquo;<samp>agmg</samp>&rsquo;</dt>
19213 <dd><p>anaglyph green/magenta gray
19214 (green filter on left eye, magenta filter on right eye)
19215 </p>
19216 </dd>
19217 <dt> &lsquo;<samp>agmh</samp>&rsquo;</dt>
19218 <dd><p>anaglyph green/magenta half colored
19219 (green filter on left eye, magenta filter on right eye)
19220 </p>
19221 </dd>
19222 <dt> &lsquo;<samp>agmc</samp>&rsquo;</dt>
19223 <dd><p>anaglyph green/magenta colored
19224 (green filter on left eye, magenta filter on right eye)
19225 </p>
19226 </dd>
19227 <dt> &lsquo;<samp>agmd</samp>&rsquo;</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)
19230 </p>
19231 </dd>
19232 <dt> &lsquo;<samp>aybg</samp>&rsquo;</dt>
19233 <dd><p>anaglyph yellow/blue gray
19234 (yellow filter on left eye, blue filter on right eye)
19235 </p>
19236 </dd>
19237 <dt> &lsquo;<samp>aybh</samp>&rsquo;</dt>
19238 <dd><p>anaglyph yellow/blue half colored
19239 (yellow filter on left eye, blue filter on right eye)
19240 </p>
19241 </dd>
19242 <dt> &lsquo;<samp>aybc</samp>&rsquo;</dt>
19243 <dd><p>anaglyph yellow/blue colored
19244 (yellow filter on left eye, blue filter on right eye)
19245 </p>
19246 </dd>
19247 <dt> &lsquo;<samp>aybd</samp>&rsquo;</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)
19250 </p>
19251 </dd>
19252 <dt> &lsquo;<samp>irl</samp>&rsquo;</dt>
19253 <dd><p>interleaved rows (left eye has top row, right eye starts on next row)
19254 </p>
19255 </dd>
19256 <dt> &lsquo;<samp>irr</samp>&rsquo;</dt>
19257 <dd><p>interleaved rows (right eye has top row, left eye starts on next row)
19258 </p>
19259 </dd>
19260 <dt> &lsquo;<samp>ml</samp>&rsquo;</dt>
19261 <dd><p>mono output (left eye only)
19262 </p>
19263 </dd>
19264 <dt> &lsquo;<samp>mr</samp>&rsquo;</dt>
19265 <dd><p>mono output (right eye only)
19266 </p></dd>
19267 </dl>
19268
19269 <p>Default value is &lsquo;<samp>arcd</samp>&rsquo;.
19270 </p></dd>
19271 </dl>
19272
19273 <a name="Examples-77"></a>
19274 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-77">33.76.1 Examples</a></h3>
19275
19276 <ul>
19277 <li>
19278 Convert input video from side by side parallel to anaglyph yellow/blue dubois:
19279 <table><tr><td>&nbsp;</td><td><pre class="example">stereo3d=sbsl:aybd
19280 </pre></td></tr></table>
19281
19282 </li><li>
19283 Convert input video from above bellow (left eye above, right eye below) to side by side crosseye.
19284 <table><tr><td>&nbsp;</td><td><pre class="example">stereo3d=abl:sbsr
19285 </pre></td></tr></table>
19286 </li></ul>
19287
19288 <a name="spp"></a>
19289 <h2 class="section"><a href="ffplay-all.html#toc-spp">33.77 spp</a></h2>
19290
19291 <p>Apply a simple postprocessing filter that compresses and decompresses the image
19292 at several (or - in the case of &lsquo;<samp>quality</samp>&rsquo; level <code>6</code> - all) shifts
19293 and average the results.
19294 </p>
19295 <p>The filter accepts the following options:
19296 </p>
19297 <dl compact="compact">
19298 <dt> &lsquo;<samp>quality</samp>&rsquo;</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
19303 <code>3</code>.
19304 </p>
19305 </dd>
19306 <dt> &lsquo;<samp>qp</samp>&rsquo;</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).
19309 </p>
19310 </dd>
19311 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
19312 <dd><p>Set thresholding mode. Available modes are:
19313 </p>
19314 <dl compact="compact">
19315 <dt> &lsquo;<samp>hard</samp>&rsquo;</dt>
19316 <dd><p>Set hard thresholding (default).
19317 </p></dd>
19318 <dt> &lsquo;<samp>soft</samp>&rsquo;</dt>
19319 <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
19320 </p></dd>
19321 </dl>
19322
19323 </dd>
19324 <dt> &lsquo;<samp>use_bframe_qp</samp>&rsquo;</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).
19328 </p></dd>
19329 </dl>
19330
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>
19334
19335 <p>Draw subtitles on top of input video using the libass library.
19336 </p>
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.
19341 </p>
19342 <p>The filter accepts the following options:
19343 </p>
19344 <dl compact="compact">
19345 <dt> &lsquo;<samp>filename, f</samp>&rsquo;</dt>
19346 <dd><p>Set the filename of the subtitle file to read. It must be specified.
19347 </p>
19348 </dd>
19349 <dt> &lsquo;<samp>original_size</samp>&rsquo;</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 &quot;Video size&quot; 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
19354 changed.
19355 </p>
19356 </dd>
19357 <dt> &lsquo;<samp>charenc</samp>&rsquo;</dt>
19358 <dd><p>Set subtitles input character encoding. <code>subtitles</code> filter only. Only
19359 useful if not UTF-8.
19360 </p></dd>
19361 </dl>
19362
19363 <p>If the first key is not specified, it is assumed that the first value
19364 specifies the &lsquo;<samp>filename</samp>&rsquo;.
19365 </p>
19366 <p>For example, to render the file &lsquo;<tt>sub.srt</tt>&rsquo; on top of the input
19367 video, use the command:
19368 </p><table><tr><td>&nbsp;</td><td><pre class="example">subtitles=sub.srt
19369 </pre></td></tr></table>
19370
19371 <p>which is equivalent to:
19372 </p><table><tr><td>&nbsp;</td><td><pre class="example">subtitles=filename=sub.srt
19373 </pre></td></tr></table>
19374
19375 <a name="super2xsai"></a>
19376 <h2 class="section"><a href="ffplay-all.html#toc-super2xsai">33.79 super2xsai</a></h2>
19377
19378 <p>Scale the input by 2x and smooth using the Super2xSaI (Scale and
19379 Interpolate) pixel art scaling algorithm.
19380 </p>
19381 <p>Useful for enlarging pixel art images without reducing sharpness.
19382 </p>
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 &amp; V plane.
19386 </p>
19387 <a name="telecine"></a>
19388 <h2 class="section"><a href="ffplay-all.html#toc-telecine">33.81 telecine</a></h2>
19389
19390 <p>Apply telecine process to the video.
19391 </p>
19392 <p>This filter accepts the following options:
19393 </p>
19394 <dl compact="compact">
19395 <dt> &lsquo;<samp>first_field</samp>&rsquo;</dt>
19396 <dd><dl compact="compact">
19397 <dt> &lsquo;<samp>top, t</samp>&rsquo;</dt>
19398 <dd><p>top field first
19399 </p></dd>
19400 <dt> &lsquo;<samp>bottom, b</samp>&rsquo;</dt>
19401 <dd><p>bottom field first
19402 The default value is <code>top</code>.
19403 </p></dd>
19404 </dl>
19405
19406 </dd>
19407 <dt> &lsquo;<samp>pattern</samp>&rsquo;</dt>
19408 <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
19409 The default value is <code>23</code>.
19410 </p></dd>
19411 </dl>
19412
19413 <table><tr><td>&nbsp;</td><td><pre class="example">Some typical patterns:
19414
19415 NTSC output (30i):
19416 27.5p: 32222
19417 24p: 23 (classic)
19418 24p: 2332 (preferred)
19419 20p: 33
19420 18p: 334
19421 16p: 3444
19422
19423 PAL output (25i):
19424 27.5p: 12222
19425 24p: 222222222223 (&quot;Euro pulldown&quot;)
19426 16.67p: 33
19427 16p: 33333334
19428 </pre></td></tr></table>
19429
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.
19433 </p>
19434 <p>The filter accepts the following options:
19435 </p>
19436 <dl compact="compact">
19437 <dt> &lsquo;<samp>n</samp>&rsquo;</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>.
19441 </p></dd>
19442 </dl>
19443
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.
19446 </p>
19447 <a name="Examples-30"></a>
19448 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-30">33.82.1 Examples</a></h3>
19449
19450 <ul>
19451 <li>
19452 Extract one picture each 50 frames:
19453 <table><tr><td>&nbsp;</td><td><pre class="example">thumbnail=50
19454 </pre></td></tr></table>
19455
19456 </li><li>
19457 Complete example of a thumbnail creation with <code>ffmpeg</code>:
19458 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
19459 </pre></td></tr></table>
19460 </li></ul>
19461
19462 <a name="tile"></a>
19463 <h2 class="section"><a href="ffplay-all.html#toc-tile">33.83 tile</a></h2>
19464
19465 <p>Tile several successive frames together.
19466 </p>
19467 <p>The filter accepts the following options:
19468 </p>
19469 <dl compact="compact">
19470 <dt> &lsquo;<samp>layout</samp>&rsquo;</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 &quot;Video size&quot; section in the ffmpeg-utils manual.
19473 </p>
19474 </dd>
19475 <dt> &lsquo;<samp>nb_frames</samp>&rsquo;</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.
19479 </p>
19480 </dd>
19481 <dt> &lsquo;<samp>margin</samp>&rsquo;</dt>
19482 <dd><p>Set the outer border margin in pixels.
19483 </p>
19484 </dd>
19485 <dt> &lsquo;<samp>padding</samp>&rsquo;</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.
19489 </p>
19490 </dd>
19491 <dt> &lsquo;<samp>color</samp>&rsquo;</dt>
19492 <dd><p>Specify the color of the unused areaFor the syntax of this option, check the
19493 &quot;Color&quot; section in the ffmpeg-utils manual. The default value of <var>color</var>
19494 is &quot;black&quot;.
19495 </p></dd>
19496 </dl>
19497
19498 <a name="Examples-11"></a>
19499 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-11">33.83.1 Examples</a></h3>
19500
19501 <ul>
19502 <li>
19503 Produce 8x8 PNG tiles of all keyframes (&lsquo;<samp>-skip_frame nokey</samp>&rsquo;) in a movie:
19504 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
19505 </pre></td></tr></table>
19506 <p>The &lsquo;<samp>-vsync 0</samp>&rsquo; is necessary to prevent <code>ffmpeg</code> from
19507 duplicating each output frame to accomodate the originally detected frame
19508 rate.
19509 </p>
19510 </li><li>
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>&nbsp;</td><td><pre class="example">tile=3x2:nb_frames=5:padding=7:margin=2
19515 </pre></td></tr></table>
19516 </li></ul>
19517
19518 <a name="tinterlace"></a>
19519 <h2 class="section"><a href="ffplay-all.html#toc-tinterlace">33.84 tinterlace</a></h2>
19520
19521 <p>Perform various types of temporal field interlacing.
19522 </p>
19523 <p>Frames are counted starting from 1, so the first input frame is
19524 considered odd.
19525 </p>
19526 <p>The filter accepts the following options:
19527 </p>
19528 <dl compact="compact">
19529 <dt> &lsquo;<samp>mode</samp>&rsquo;</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.
19532 </p>
19533 <p>Available values are:
19534 </p>
19535 <dl compact="compact">
19536 <dt> &lsquo;<samp>merge, 0</samp>&rsquo;</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.
19539 </p>
19540 </dd>
19541 <dt> &lsquo;<samp>drop_odd, 1</samp>&rsquo;</dt>
19542 <dd><p>Only output even frames, odd frames are dropped, generating a frame with
19543 unchanged height at half frame rate.
19544 </p>
19545 </dd>
19546 <dt> &lsquo;<samp>drop_even, 2</samp>&rsquo;</dt>
19547 <dd><p>Only output odd frames, even frames are dropped, generating a frame with
19548 unchanged height at half frame rate.
19549 </p>
19550 </dd>
19551 <dt> &lsquo;<samp>pad, 3</samp>&rsquo;</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.
19554 </p>
19555 </dd>
19556 <dt> &lsquo;<samp>interleave_top, 4</samp>&rsquo;</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.
19559 </p>
19560 </dd>
19561 <dt> &lsquo;<samp>interleave_bottom, 5</samp>&rsquo;</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.
19564 </p>
19565 </dd>
19566 <dt> &lsquo;<samp>interlacex2, 6</samp>&rsquo;</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.
19572 </p></dd>
19573 </dl>
19574
19575 <p>Numeric values are deprecated but are accepted for backward
19576 compatibility reasons.
19577 </p>
19578 <p>Default mode is <code>merge</code>.
19579 </p>
19580 </dd>
19581 <dt> &lsquo;<samp>flags</samp>&rsquo;</dt>
19582 <dd><p>Specify flags influencing the filter process.
19583 </p>
19584 <p>Available value for <var>flags</var> is:
19585 </p>
19586 <dl compact="compact">
19587 <dt> &lsquo;<samp>low_pass_filter, vlfp</samp>&rsquo;</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 &rsquo;twitter&rsquo; and Moire
19592 patterning.
19593 </p>
19594 <p>Vertical low-pass filtering can only be enabled for &lsquo;<samp>mode</samp>&rsquo;
19595 <var>interleave_top</var> and <var>interleave_bottom</var>.
19596 </p>
19597 </dd>
19598 </dl>
19599 </dd>
19600 </dl>
19601
19602 <a name="transpose"></a>
19603 <h2 class="section"><a href="ffplay-all.html#toc-transpose">33.85 transpose</a></h2>
19604
19605 <p>Transpose rows with columns in the input video and optionally flip it.
19606 </p>
19607 <p>This filter accepts the following options:
19608 </p>
19609 <dl compact="compact">
19610 <dt> &lsquo;<samp>dir</samp>&rsquo;</dt>
19611 <dd><p>Specify the transposition direction.
19612 </p>
19613 <p>Can assume the following values:
19614 </p><dl compact="compact">
19615 <dt> &lsquo;<samp>0, 4, cclock_flip</samp>&rsquo;</dt>
19616 <dd><p>Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
19617 </p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     L.l
19618 . . -&gt;  . .
19619 l.r     R.r
19620 </pre></td></tr></table>
19621
19622 </dd>
19623 <dt> &lsquo;<samp>1, 5, clock</samp>&rsquo;</dt>
19624 <dd><p>Rotate by 90 degrees clockwise, that is:
19625 </p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     l.L
19626 . . -&gt;  . .
19627 l.r     r.R
19628 </pre></td></tr></table>
19629
19630 </dd>
19631 <dt> &lsquo;<samp>2, 6, cclock</samp>&rsquo;</dt>
19632 <dd><p>Rotate by 90 degrees counterclockwise, that is:
19633 </p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     R.r
19634 . . -&gt;  . .
19635 l.r     L.l
19636 </pre></td></tr></table>
19637
19638 </dd>
19639 <dt> &lsquo;<samp>3, 7, clock_flip</samp>&rsquo;</dt>
19640 <dd><p>Rotate by 90 degrees clockwise and vertically flip, that is:
19641 </p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     r.R
19642 . . -&gt;  . .
19643 l.r     l.L
19644 </pre></td></tr></table>
19645 </dd>
19646 </dl>
19647
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.
19651 </p>
19652 <p>Numerical values are deprecated, and should be dropped in favor of
19653 symbolic constants.
19654 </p>
19655 </dd>
19656 <dt> &lsquo;<samp>passthrough</samp>&rsquo;</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> &lsquo;<samp>none</samp>&rsquo;</dt>
19661 <dd><p>Always apply transposition.
19662 </p></dd>
19663 <dt> &lsquo;<samp>portrait</samp>&rsquo;</dt>
19664 <dd><p>Preserve portrait geometry (when <var>height</var> &gt;= <var>width</var>).
19665 </p></dd>
19666 <dt> &lsquo;<samp>landscape</samp>&rsquo;</dt>
19667 <dd><p>Preserve landscape geometry (when <var>width</var> &gt;= <var>height</var>).
19668 </p></dd>
19669 </dl>
19670
19671 <p>Default value is <code>none</code>.
19672 </p></dd>
19673 </dl>
19674
19675 <p>For example to rotate by 90 degrees clockwise and preserve portrait
19676 layout:
19677 </p><table><tr><td>&nbsp;</td><td><pre class="example">transpose=dir=1:passthrough=portrait
19678 </pre></td></tr></table>
19679
19680 <p>The command above can also be specified as:
19681 </p><table><tr><td>&nbsp;</td><td><pre class="example">transpose=1:portrait
19682 </pre></td></tr></table>
19683
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.
19687 </p>
19688 <p>This filter accepts the following options:
19689 </p><dl compact="compact">
19690 <dt> &lsquo;<samp>start</samp>&rsquo;</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.
19693 </p>
19694 </dd>
19695 <dt> &lsquo;<samp>end</samp>&rsquo;</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.
19699 </p>
19700 </dd>
19701 <dt> &lsquo;<samp>start_pts</samp>&rsquo;</dt>
19702 <dd><p>Same as <var>start</var>, except this option sets the start timestamp in timebase
19703 units instead of seconds.
19704 </p>
19705 </dd>
19706 <dt> &lsquo;<samp>end_pts</samp>&rsquo;</dt>
19707 <dd><p>Same as <var>end</var>, except this option sets the end timestamp in timebase units
19708 instead of seconds.
19709 </p>
19710 </dd>
19711 <dt> &lsquo;<samp>duration</samp>&rsquo;</dt>
19712 <dd><p>Specify maximum duration of the output.
19713 </p>
19714 </dd>
19715 <dt> &lsquo;<samp>start_frame</samp>&rsquo;</dt>
19716 <dd><p>Number of the first frame that should be passed to output.
19717 </p>
19718 </dd>
19719 <dt> &lsquo;<samp>end_frame</samp>&rsquo;</dt>
19720 <dd><p>Number of the first frame that should be dropped.
19721 </p></dd>
19722 </dl>
19723
19724 <p>&lsquo;<samp>start</samp>&rsquo;, &lsquo;<samp>end</samp>&rsquo;, &lsquo;<samp>duration</samp>&rsquo; are expressed as time
19725 duration specifications, check the &quot;Time duration&quot; section in the
19726 ffmpeg-utils manual.
19727 </p>
19728 <p>Note that the first two sets of the start/end options and the &lsquo;<samp>duration</samp>&rsquo;
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.
19733 </p>
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
19737 filters.
19738 </p>
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.
19741 </p>
19742 <p>Examples:
19743 </p><ul>
19744 <li>
19745 drop everything except the second minute of input
19746 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -vf trim=60:120
19747 </pre></td></tr></table>
19748
19749 </li><li>
19750 keep only the first second
19751 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -vf trim=duration=1
19752 </pre></td></tr></table>
19753
19754 </li></ul>
19755
19756
19757 <a name="unsharp"></a>
19758 <h2 class="section"><a href="ffplay-all.html#toc-unsharp">33.87 unsharp</a></h2>
19759
19760 <p>Sharpen or blur the input video.
19761 </p>
19762 <p>It accepts the following parameters:
19763 </p>
19764 <dl compact="compact">
19765 <dt> &lsquo;<samp>luma_msize_x, lx</samp>&rsquo;</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.
19768 </p>
19769 </dd>
19770 <dt> &lsquo;<samp>luma_msize_y, ly</samp>&rsquo;</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.
19773 </p>
19774 </dd>
19775 <dt> &lsquo;<samp>luma_amount, la</samp>&rsquo;</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.
19778 </p>
19779 <p>Negative values will blur the input video, while positive values will
19780 sharpen it, a value of zero will disable the effect.
19781 </p>
19782 <p>Default value is 1.0.
19783 </p>
19784 </dd>
19785 <dt> &lsquo;<samp>chroma_msize_x, cx</samp>&rsquo;</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.
19788 </p>
19789 </dd>
19790 <dt> &lsquo;<samp>chroma_msize_y, cy</samp>&rsquo;</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.
19793 </p>
19794 </dd>
19795 <dt> &lsquo;<samp>chroma_amount, ca</samp>&rsquo;</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.
19798 </p>
19799 <p>Negative values will blur the input video, while positive values will
19800 sharpen it, a value of zero will disable the effect.
19801 </p>
19802 <p>Default value is 0.0.
19803 </p>
19804 </dd>
19805 <dt> &lsquo;<samp>opencl</samp>&rsquo;</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.
19808 </p>
19809 </dd>
19810 </dl>
19811
19812 <p>All parameters are optional and default to the equivalent of the
19813 string &rsquo;5:5:1.0:5:5:0.0&rsquo;.
19814 </p>
19815 <a name="Examples-6"></a>
19816 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-6">33.87.1 Examples</a></h3>
19817
19818 <ul>
19819 <li>
19820 Apply strong luma sharpen effect:
19821 <table><tr><td>&nbsp;</td><td><pre class="example">unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
19822 </pre></td></tr></table>
19823
19824 </li><li>
19825 Apply strong blur of both luma and chroma parameters:
19826 <table><tr><td>&nbsp;</td><td><pre class="example">unsharp=7:7:-2:7:7:-2
19827 </pre></td></tr></table>
19828 </li></ul>
19829
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>
19833
19834 <p>Analyze video stabilization/deshaking. Perform pass 1 of 2, see
19835 <a href="#vidstabtransform">vidstabtransform</a> for pass 2.
19836 </p>
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.
19840 </p>
19841 <p>To enable compilation of this filter you need to configure FFmpeg with
19842 <code>--enable-libvidstab</code>.
19843 </p>
19844 <p>This filter accepts the following options:
19845 </p>
19846 <dl compact="compact">
19847 <dt> &lsquo;<samp>result</samp>&rsquo;</dt>
19848 <dd><p>Set the path to the file used to write the transforms information.
19849 Default value is &lsquo;<tt>transforms.trf</tt>&rsquo;.
19850 </p>
19851 </dd>
19852 <dt> &lsquo;<samp>shakiness</samp>&rsquo;</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.
19856 </p>
19857 </dd>
19858 <dt> &lsquo;<samp>accuracy</samp>&rsquo;</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.
19862 </p>
19863 </dd>
19864 <dt> &lsquo;<samp>stepsize</samp>&rsquo;</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.
19867 </p>
19868 </dd>
19869 <dt> &lsquo;<samp>mincontrast</samp>&rsquo;</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
19872 value is 0.3.
19873 </p>
19874 </dd>
19875 <dt> &lsquo;<samp>tripod</samp>&rsquo;</dt>
19876 <dd><p>Set reference frame number for tripod mode.
19877 </p>
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.
19882 </p>
19883 <p>If set to 0, it is disabled. The frames are counted starting from 1.
19884 </p>
19885 </dd>
19886 <dt> &lsquo;<samp>show</samp>&rsquo;</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
19889 visualization.
19890 </p></dd>
19891 </dl>
19892
19893 <a name="Examples-5"></a>
19894 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-5">33.88.1 Examples</a></h3>
19895
19896 <ul>
19897 <li>
19898 Use default values:
19899 <table><tr><td>&nbsp;</td><td><pre class="example">vidstabdetect
19900 </pre></td></tr></table>
19901
19902 </li><li>
19903 Analyze strongly shaky movie and put the results in file
19904 &lsquo;<tt>mytransforms.trf</tt>&rsquo;:
19905 <table><tr><td>&nbsp;</td><td><pre class="example">vidstabdetect=shakiness=10:accuracy=15:result=&quot;mytransforms.trf&quot;
19906 </pre></td></tr></table>
19907
19908 </li><li>
19909 Visualize the result of internal transformations in the resulting
19910 video:
19911 <table><tr><td>&nbsp;</td><td><pre class="example">vidstabdetect=show=1
19912 </pre></td></tr></table>
19913
19914 </li><li>
19915 Analyze a video with medium shakiness using <code>ffmpeg</code>:
19916 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i input -vf vidstabdetect=shakiness=5:show=1 dummy.avi
19917 </pre></td></tr></table>
19918 </li></ul>
19919
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>
19923
19924 <p>Video stabilization/deshaking: pass 2 of 2,
19925 see <a href="#vidstabdetect">vidstabdetect</a> for pass 1.
19926 </p>
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.
19932 </p>
19933 <p>To enable compilation of this filter you need to configure FFmpeg with
19934 <code>--enable-libvidstab</code>.
19935 </p>
19936 <p>This filter accepts the following options:
19937 </p>
19938 <dl compact="compact">
19939 <dt> &lsquo;<samp>input</samp>&rsquo;</dt>
19940 <dd><p>path to the file used to read the transforms (default: &lsquo;<tt>transforms.trf</tt>&rsquo;)
19941 </p>
19942 </dd>
19943 <dt> &lsquo;<samp>smoothing</samp>&rsquo;</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).
19949 </p>
19950 </dd>
19951 <dt> &lsquo;<samp>maxshift</samp>&rsquo;</dt>
19952 <dd><p>maximal number of pixels to translate frames (default: -1 no limit)
19953 </p>
19954 </dd>
19955 <dt> &lsquo;<samp>maxangle</samp>&rsquo;</dt>
19956 <dd><p>maximal angle in radians (degree*PI/180) to rotate frames (default: -1
19957 no limit)
19958 </p>
19959 </dd>
19960 <dt> &lsquo;<samp>crop</samp>&rsquo;</dt>
19961 <dd><p>How to deal with borders that may be visible due to movement
19962 compensation. Available values are:
19963 </p>
19964 <dl compact="compact">
19965 <dt> &lsquo;<samp>keep</samp>&rsquo;</dt>
19966 <dd><p>keep image information from previous frame (default)
19967 </p></dd>
19968 <dt> &lsquo;<samp>black</samp>&rsquo;</dt>
19969 <dd><p>fill the border black
19970 </p></dd>
19971 </dl>
19972
19973 </dd>
19974 <dt> &lsquo;<samp>invert</samp>&rsquo;</dt>
19975 <dd><dl compact="compact">
19976 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
19977 <dd><p>keep transforms normal (default)
19978 </p></dd>
19979 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
19980 <dd><p>invert transforms
19981 </p></dd>
19982 </dl>
19983
19984 </dd>
19985 <dt> &lsquo;<samp>relative</samp>&rsquo;</dt>
19986 <dd><p>consider transforms as
19987 </p><dl compact="compact">
19988 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
19989 <dd><p>absolute
19990 </p></dd>
19991 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
19992 <dd><p>relative to previous frame (default)
19993 </p></dd>
19994 </dl>
19995
19996 </dd>
19997 <dt> &lsquo;<samp>zoom</samp>&rsquo;</dt>
19998 <dd><p>percentage to zoom (default: 0)
19999 </p><dl compact="compact">
20000 <dt> &lsquo;<samp>&gt;0</samp>&rsquo;</dt>
20001 <dd><p>zoom in
20002 </p></dd>
20003 <dt> &lsquo;<samp>&lt;0</samp>&rsquo;</dt>
20004 <dd><p>zoom out
20005 </p></dd>
20006 </dl>
20007
20008 </dd>
20009 <dt> &lsquo;<samp>optzoom</samp>&rsquo;</dt>
20010 <dd><p>set optimal zooming to avoid borders
20011 </p><dl compact="compact">
20012 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
20013 <dd><p>disabled
20014 </p></dd>
20015 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
20016 <dd><p>optimal static zoom value is determined (only very strong movements will lead to visible borders) (default)
20017 </p></dd>
20018 <dt> &lsquo;<samp>2</samp>&rsquo;</dt>
20019 <dd><p>optimal adaptive zoom value is determined (no borders will be visible)
20020 </p></dd>
20021 </dl>
20022 <p>Note that the value given at zoom is added to the one calculated
20023 here.
20024 </p>
20025 </dd>
20026 <dt> &lsquo;<samp>interpol</samp>&rsquo;</dt>
20027 <dd><p>type of interpolation
20028 </p>
20029 <p>Available values are:
20030 </p><dl compact="compact">
20031 <dt> &lsquo;<samp>no</samp>&rsquo;</dt>
20032 <dd><p>no interpolation
20033 </p></dd>
20034 <dt> &lsquo;<samp>linear</samp>&rsquo;</dt>
20035 <dd><p>linear only horizontal
20036 </p></dd>
20037 <dt> &lsquo;<samp>bilinear</samp>&rsquo;</dt>
20038 <dd><p>linear in both directions (default)
20039 </p></dd>
20040 <dt> &lsquo;<samp>bicubic</samp>&rsquo;</dt>
20041 <dd><p>cubic in both directions (slow)
20042 </p></dd>
20043 </dl>
20044
20045 </dd>
20046 <dt> &lsquo;<samp>tripod</samp>&rsquo;</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> &lsquo;<samp>0</samp>&rsquo;</dt>
20052 <dd><p>off (default)
20053 </p></dd>
20054 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
20055 <dd><p>virtual tripod mode: equivalent to <code>relative=0:smoothing=0</code>
20056 </p></dd>
20057 </dl>
20058
20059 </dd>
20060 </dl>
20061
20062 <a name="Examples-10"></a>
20063 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-10">33.89.1 Examples</a></h3>
20064
20065 <ul>
20066 <li>
20067 typical call with default default values:
20068  (note the unsharp filter which is always recommended)
20069 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i inp.mpeg -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4 inp_stabilized.mpeg
20070 </pre></td></tr></table>
20071
20072 </li><li>
20073 zoom in a bit more and load transform data from a given file
20074 <table><tr><td>&nbsp;</td><td><pre class="example">vidstabtransform=zoom=5:input=&quot;mytransforms.trf&quot;
20075 </pre></td></tr></table>
20076
20077 </li><li>
20078 smoothen the video even more
20079 <table><tr><td>&nbsp;</td><td><pre class="example">vidstabtransform=smoothing=30
20080 </pre></td></tr></table>
20081
20082 </li></ul>
20083
20084 <a name="vflip"></a>
20085 <h2 class="section"><a href="ffplay-all.html#toc-vflip">33.90 vflip</a></h2>
20086
20087 <p>Flip the input video vertically.
20088 </p>
20089 <p>For example, to vertically flip a video with <code>ffmpeg</code>:
20090 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -vf &quot;vflip&quot; out.avi
20091 </pre></td></tr></table>
20092
20093 <a name="vignette"></a>
20094 <h2 class="section"><a href="ffplay-all.html#toc-vignette">33.91 vignette</a></h2>
20095
20096 <p>Make or reverse a natural vignetting effect.
20097 </p>
20098 <p>The filter accepts the following options:
20099 </p>
20100 <dl compact="compact">
20101 <dt> &lsquo;<samp>angle, a</samp>&rsquo;</dt>
20102 <dd><p>Set lens angle expression as a number of radians.
20103 </p>
20104 <p>The value is clipped in the <code>[0,PI/2]</code> range.
20105 </p>
20106 <p>Default value: <code>&quot;PI/5&quot;</code>
20107 </p>
20108 </dd>
20109 <dt> &lsquo;<samp>x0</samp>&rsquo;</dt>
20110 <dt> &lsquo;<samp>y0</samp>&rsquo;</dt>
20111 <dd><p>Set center coordinates expressions. Respectively <code>&quot;w/2&quot;</code> and <code>&quot;h/2&quot;</code>
20112 by default.
20113 </p>
20114 </dd>
20115 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
20116 <dd><p>Set forward/backward mode.
20117 </p>
20118 <p>Available modes are:
20119 </p><dl compact="compact">
20120 <dt> &lsquo;<samp>forward</samp>&rsquo;</dt>
20121 <dd><p>The larger the distance from the central point, the darker the image becomes.
20122 </p>
20123 </dd>
20124 <dt> &lsquo;<samp>backward</samp>&rsquo;</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 &lsquo;<samp>angle</samp>&rsquo; and other settings (yet). It can
20128 also be used to create a burning effect.
20129 </p></dd>
20130 </dl>
20131
20132 <p>Default value is &lsquo;<samp>forward</samp>&rsquo;.
20133 </p>
20134 </dd>
20135 <dt> &lsquo;<samp>eval</samp>&rsquo;</dt>
20136 <dd><p>Set evaluation mode for the expressions (&lsquo;<samp>angle</samp>&rsquo;, &lsquo;<samp>x0</samp>&rsquo;, &lsquo;<samp>y0</samp>&rsquo;).
20137 </p>
20138 <p>It accepts the following values:
20139 </p><dl compact="compact">
20140 <dt> &lsquo;<samp>init</samp>&rsquo;</dt>
20141 <dd><p>Evaluate expressions only once during the filter initialization.
20142 </p>
20143 </dd>
20144 <dt> &lsquo;<samp>frame</samp>&rsquo;</dt>
20145 <dd><p>Evaluate expressions for each incoming frame. This is way slower than the
20146 &lsquo;<samp>init</samp>&rsquo; mode since it requires all the scalers to be re-computed, but it
20147 allows advanced dynamic expressions.
20148 </p></dd>
20149 </dl>
20150
20151 <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
20152 </p>
20153 </dd>
20154 <dt> &lsquo;<samp>dither</samp>&rsquo;</dt>
20155 <dd><p>Set dithering to reduce the circular banding effects. Default is <code>1</code>
20156 (enabled).
20157 </p>
20158 </dd>
20159 <dt> &lsquo;<samp>aspect</samp>&rsquo;</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.
20163 </p>
20164 <p>Default is <code>1/1</code>.
20165 </p></dd>
20166 </dl>
20167
20168 <a name="Expressions"></a>
20169 <h3 class="subsection"><a href="ffplay-all.html#toc-Expressions">33.91.1 Expressions</a></h3>
20170
20171 <p>The &lsquo;<samp>alpha</samp>&rsquo;, &lsquo;<samp>x0</samp>&rsquo; and &lsquo;<samp>y0</samp>&rsquo; expressions can contain the
20172 following parameters.
20173 </p>
20174 <dl compact="compact">
20175 <dt> &lsquo;<samp>w</samp>&rsquo;</dt>
20176 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
20177 <dd><p>input width and height
20178 </p>
20179 </dd>
20180 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
20181 <dd><p>the number of input frame, starting from 0
20182 </p>
20183 </dd>
20184 <dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
20185 <dd><p>the PTS (Presentation TimeStamp) time of the filtered video frame, expressed in
20186 <var>TB</var> units, NAN if undefined
20187 </p>
20188 </dd>
20189 <dt> &lsquo;<samp>r</samp>&rsquo;</dt>
20190 <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
20191 </p>
20192 </dd>
20193 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
20194 <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
20195 expressed in seconds, NAN if undefined
20196 </p>
20197 </dd>
20198 <dt> &lsquo;<samp>tb</samp>&rsquo;</dt>
20199 <dd><p>time base of the input video
20200 </p></dd>
20201 </dl>
20202
20203
20204 <a name="Examples-45"></a>
20205 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-45">33.91.2 Examples</a></h3>
20206
20207 <ul>
20208 <li>
20209 Apply simple strong vignetting effect:
20210 <table><tr><td>&nbsp;</td><td><pre class="example">vignette=PI/4
20211 </pre></td></tr></table>
20212
20213 </li><li>
20214 Make a flickering vignetting:
20215 <table><tr><td>&nbsp;</td><td><pre class="example">vignette='PI/4+random(1)*PI/50':eval=frame
20216 </pre></td></tr></table>
20217
20218 </li></ul>
20219
20220 <a name="w3fdif"></a>
20221 <h2 class="section"><a href="ffplay-all.html#toc-w3fdif">33.92 w3fdif</a></h2>
20222
20223 <p>Deinterlace the input video (&quot;w3fdif&quot; stands for &quot;Weston 3 Field
20224 Deinterlacing Filter&quot;).
20225 </p>
20226 <p>Based on the process described by Martin Weston for BBC R&amp;D, and
20227 implemented based on the de-interlace algorithm written by Jim
20228 Easterbrook for BBC R&amp;D, the Weston 3 field deinterlacing filter
20229 uses filter coefficients calculated by BBC R&amp;D.
20230 </p>
20231 <p>There are two sets of filter coefficients, so called &quot;simple&quot;:
20232 and &quot;complex&quot;. Which set of filter coefficients is used can
20233 be set by passing an optional parameter:
20234 </p>
20235 <dl compact="compact">
20236 <dt> &lsquo;<samp>filter</samp>&rsquo;</dt>
20237 <dd><p>Set the interlacing filter coefficients. Accepts one of the following values:
20238 </p>
20239 <dl compact="compact">
20240 <dt> &lsquo;<samp>simple</samp>&rsquo;</dt>
20241 <dd><p>Simple filter coefficient set.
20242 </p></dd>
20243 <dt> &lsquo;<samp>complex</samp>&rsquo;</dt>
20244 <dd><p>More-complex filter coefficient set.
20245 </p></dd>
20246 </dl>
20247 <p>Default value is &lsquo;<samp>complex</samp>&rsquo;.
20248 </p>
20249 </dd>
20250 <dt> &lsquo;<samp>deint</samp>&rsquo;</dt>
20251 <dd><p>Specify which frames to deinterlace. Accept one of the following values:
20252 </p>
20253 <dl compact="compact">
20254 <dt> &lsquo;<samp>all</samp>&rsquo;</dt>
20255 <dd><p>Deinterlace all frames,
20256 </p></dd>
20257 <dt> &lsquo;<samp>interlaced</samp>&rsquo;</dt>
20258 <dd><p>Only deinterlace frames marked as interlaced.
20259 </p></dd>
20260 </dl>
20261
20262 <p>Default value is &lsquo;<samp>all</samp>&rsquo;.
20263 </p></dd>
20264 </dl>
20265
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>
20269
20270 <p>Deinterlace the input video (&quot;yadif&quot; means &quot;yet another deinterlacing
20271 filter&quot;).
20272 </p>
20273 <p>This filter accepts the following options:
20274 </p>
20275
20276 <dl compact="compact">
20277 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
20278 <dd><p>The interlacing mode to adopt, accepts one of the following values:
20279 </p>
20280 <dl compact="compact">
20281 <dt> &lsquo;<samp>0, send_frame</samp>&rsquo;</dt>
20282 <dd><p>output 1 frame for each frame
20283 </p></dd>
20284 <dt> &lsquo;<samp>1, send_field</samp>&rsquo;</dt>
20285 <dd><p>output 1 frame for each field
20286 </p></dd>
20287 <dt> &lsquo;<samp>2, send_frame_nospatial</samp>&rsquo;</dt>
20288 <dd><p>like <code>send_frame</code> but skip spatial interlacing check
20289 </p></dd>
20290 <dt> &lsquo;<samp>3, send_field_nospatial</samp>&rsquo;</dt>
20291 <dd><p>like <code>send_field</code> but skip spatial interlacing check
20292 </p></dd>
20293 </dl>
20294
20295 <p>Default value is <code>send_frame</code>.
20296 </p>
20297 </dd>
20298 <dt> &lsquo;<samp>parity</samp>&rsquo;</dt>
20299 <dd><p>The picture field parity assumed for the input interlaced video, accepts one of
20300 the following values:
20301 </p>
20302 <dl compact="compact">
20303 <dt> &lsquo;<samp>0, tff</samp>&rsquo;</dt>
20304 <dd><p>assume top field first
20305 </p></dd>
20306 <dt> &lsquo;<samp>1, bff</samp>&rsquo;</dt>
20307 <dd><p>assume bottom field first
20308 </p></dd>
20309 <dt> &lsquo;<samp>-1, auto</samp>&rsquo;</dt>
20310 <dd><p>enable automatic detection
20311 </p></dd>
20312 </dl>
20313
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.
20317 </p>
20318 </dd>
20319 <dt> &lsquo;<samp>deint</samp>&rsquo;</dt>
20320 <dd><p>Specify which frames to deinterlace. Accept one of the following
20321 values:
20322 </p>
20323 <dl compact="compact">
20324 <dt> &lsquo;<samp>0, all</samp>&rsquo;</dt>
20325 <dd><p>deinterlace all frames
20326 </p></dd>
20327 <dt> &lsquo;<samp>1, interlaced</samp>&rsquo;</dt>
20328 <dd><p>only deinterlace frames marked as interlaced
20329 </p></dd>
20330 </dl>
20331
20332 <p>Default value is <code>all</code>.
20333 </p></dd>
20334 </dl>
20335
20336
20337 <a name="Video-Sources"></a>
20338 <h1 class="chapter"><a href="ffplay-all.html#toc-Video-Sources">34. Video Sources</a></h1>
20339
20340 <p>Below is a description of the currently available video sources.
20341 </p>
20342 <a name="buffer"></a>
20343 <h2 class="section"><a href="ffplay-all.html#toc-buffer">34.1 buffer</a></h2>
20344
20345 <p>Buffer video frames, and make them available to the filter chain.
20346 </p>
20347 <p>This source is mainly intended for a programmatic use, in particular
20348 through the interface defined in &lsquo;<tt>libavfilter/vsrc_buffer.h</tt>&rsquo;.
20349 </p>
20350 <p>This source accepts the following options:
20351 </p>
20352 <dl compact="compact">
20353 <dt> &lsquo;<samp>video_size</samp>&rsquo;</dt>
20354 <dd><p>Specify the size (width and height) of the buffered video frames. For the
20355 syntax of this option, check the &quot;Video size&quot; section in the ffmpeg-utils
20356 manual.
20357 </p>
20358 </dd>
20359 <dt> &lsquo;<samp>width</samp>&rsquo;</dt>
20360 <dd><p>Input video width.
20361 </p>
20362 </dd>
20363 <dt> &lsquo;<samp>height</samp>&rsquo;</dt>
20364 <dd><p>Input video height.
20365 </p>
20366 </dd>
20367 <dt> &lsquo;<samp>pix_fmt</samp>&rsquo;</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
20370 name.
20371 </p>
20372 </dd>
20373 <dt> &lsquo;<samp>time_base</samp>&rsquo;</dt>
20374 <dd><p>Specify the timebase assumed by the timestamps of the buffered frames.
20375 </p>
20376 </dd>
20377 <dt> &lsquo;<samp>frame_rate</samp>&rsquo;</dt>
20378 <dd><p>Specify the frame rate expected for the video stream.
20379 </p>
20380 </dd>
20381 <dt> &lsquo;<samp>pixel_aspect, sar</samp>&rsquo;</dt>
20382 <dd><p>Specify the sample aspect ratio assumed by the video frames.
20383 </p>
20384 </dd>
20385 <dt> &lsquo;<samp>sws_param</samp>&rsquo;</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.
20389 </p></dd>
20390 </dl>
20391
20392 <p>For example:
20393 </p><table><tr><td>&nbsp;</td><td><pre class="example">buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
20394 </pre></td></tr></table>
20395
20396 <p>will instruct the source to accept video frames with size 320x240 and
20397 with format &quot;yuv410p&quot;, assuming 1/24 as the timestamps timebase and
20398 square pixels (1:1 sample aspect ratio).
20399 Since the pixel format with name &quot;yuv410p&quot; corresponds to the number 6
20400 (check the enum AVPixelFormat definition in &lsquo;<tt>libavutil/pixfmt.h</tt>&rsquo;),
20401 this example corresponds to:
20402 </p><table><tr><td>&nbsp;</td><td><pre class="example">buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
20403 </pre></td></tr></table>
20404
20405 <p>Alternatively, the options can be specified as a flat string, but this
20406 syntax is deprecated:
20407 </p>
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>]
20409 </p>
20410 <a name="cellauto"></a>
20411 <h2 class="section"><a href="ffplay-all.html#toc-cellauto">34.2 cellauto</a></h2>
20412
20413 <p>Create a pattern generated by an elementary cellular automaton.
20414 </p>
20415 <p>The initial state of the cellular automaton can be defined through the
20416 &lsquo;<samp>filename</samp>&rsquo;, and &lsquo;<samp>pattern</samp>&rsquo; options. If such options are
20417 not specified an initial state is created randomly.
20418 </p>
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 &lsquo;<samp>scroll</samp>&rsquo; option.
20422 </p>
20423 <p>This source accepts the following options:
20424 </p>
20425 <dl compact="compact">
20426 <dt> &lsquo;<samp>filename, f</samp>&rsquo;</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.
20432 </p>
20433 </dd>
20434 <dt> &lsquo;<samp>pattern, p</samp>&rsquo;</dt>
20435 <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
20436 the specified string.
20437 </p>
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.
20441 </p>
20442 </dd>
20443 <dt> &lsquo;<samp>rate, r</samp>&rsquo;</dt>
20444 <dd><p>Set the video rate, that is the number of frames generated per second.
20445 Default is 25.
20446 </p>
20447 </dd>
20448 <dt> &lsquo;<samp>random_fill_ratio, ratio</samp>&rsquo;</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
20451 1/PHI.
20452 </p>
20453 <p>This option is ignored when a file or a pattern is specified.
20454 </p>
20455 </dd>
20456 <dt> &lsquo;<samp>random_seed, seed</samp>&rsquo;</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
20460 effort basis.
20461 </p>
20462 </dd>
20463 <dt> &lsquo;<samp>rule</samp>&rsquo;</dt>
20464 <dd><p>Set the cellular automaton rule, it is a number ranging from 0 to 255.
20465 Default value is 110.
20466 </p>
20467 </dd>
20468 <dt> &lsquo;<samp>size, s</samp>&rsquo;</dt>
20469 <dd><p>Set the size of the output video. For the syntax of this option, check
20470 the &quot;Video size&quot; section in the ffmpeg-utils manual.
20471 </p>
20472 <p>If &lsquo;<samp>filename</samp>&rsquo; or &lsquo;<samp>pattern</samp>&rsquo; 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.
20475 </p>
20476 <p>If &lsquo;<samp>size</samp>&rsquo; is set, it must contain the width of the specified
20477 pattern string, and the specified pattern will be centered in the
20478 larger row.
20479 </p>
20480 <p>If a filename or a pattern string is not specified, the size value
20481 defaults to &quot;320x518&quot; (used for a randomly generated initial state).
20482 </p>
20483 </dd>
20484 <dt> &lsquo;<samp>scroll</samp>&rsquo;</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.
20488 Defaults to 1.
20489 </p>
20490 </dd>
20491 <dt> &lsquo;<samp>start_full, full</samp>&rsquo;</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.
20495 </p>
20496 </dd>
20497 <dt> &lsquo;<samp>stitch</samp>&rsquo;</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.
20500 </p></dd>
20501 </dl>
20502
20503 <a name="Examples-38"></a>
20504 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-38">34.2.1 Examples</a></h3>
20505
20506 <ul>
20507 <li>
20508 Read the initial state from &lsquo;<tt>pattern</tt>&rsquo;, and specify an output of
20509 size 200x400.
20510 <table><tr><td>&nbsp;</td><td><pre class="example">cellauto=f=pattern:s=200x400
20511 </pre></td></tr></table>
20512
20513 </li><li>
20514 Generate a random initial row with a width of 200 cells, with a fill
20515 ratio of 2/3:
20516 <table><tr><td>&nbsp;</td><td><pre class="example">cellauto=ratio=2/3:s=200x200
20517 </pre></td></tr></table>
20518
20519 </li><li>
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>&nbsp;</td><td><pre class="example">cellauto=p=@:s=100x400:full=0:rule=18
20523 </pre></td></tr></table>
20524
20525 </li><li>
20526 Specify a more elaborated initial pattern:
20527 <table><tr><td>&nbsp;</td><td><pre class="example">cellauto=p='@@ @ @@':s=100x400:full=0:rule=18
20528 </pre></td></tr></table>
20529
20530 </li></ul>
20531
20532 <a name="mandelbrot"></a>
20533 <h2 class="section"><a href="ffplay-all.html#toc-mandelbrot">34.3 mandelbrot</a></h2>
20534
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>.
20537 </p>
20538 <p>This source accepts the following options:
20539 </p>
20540 <dl compact="compact">
20541 <dt> &lsquo;<samp>end_pts</samp>&rsquo;</dt>
20542 <dd><p>Set the terminal pts value. Default value is 400.
20543 </p>
20544 </dd>
20545 <dt> &lsquo;<samp>end_scale</samp>&rsquo;</dt>
20546 <dd><p>Set the terminal scale value.
20547 Must be a floating point value. Default value is 0.3.
20548 </p>
20549 </dd>
20550 <dt> &lsquo;<samp>inner</samp>&rsquo;</dt>
20551 <dd><p>Set the inner coloring mode, that is the algorithm used to draw the
20552 Mandelbrot fractal internal region.
20553 </p>
20554 <p>It shall assume one of the following values:
20555 </p><dl compact="compact">
20556 <dt> &lsquo;<samp>black</samp>&rsquo;</dt>
20557 <dd><p>Set black mode.
20558 </p></dd>
20559 <dt> &lsquo;<samp>convergence</samp>&rsquo;</dt>
20560 <dd><p>Show time until convergence.
20561 </p></dd>
20562 <dt> &lsquo;<samp>mincol</samp>&rsquo;</dt>
20563 <dd><p>Set color based on point closest to the origin of the iterations.
20564 </p></dd>
20565 <dt> &lsquo;<samp>period</samp>&rsquo;</dt>
20566 <dd><p>Set period mode.
20567 </p></dd>
20568 </dl>
20569
20570 <p>Default value is <var>mincol</var>.
20571 </p>
20572 </dd>
20573 <dt> &lsquo;<samp>bailout</samp>&rsquo;</dt>
20574 <dd><p>Set the bailout value. Default value is 10.0.
20575 </p>
20576 </dd>
20577 <dt> &lsquo;<samp>maxiter</samp>&rsquo;</dt>
20578 <dd><p>Set the maximum of iterations performed by the rendering
20579 algorithm. Default value is 7189.
20580 </p>
20581 </dd>
20582 <dt> &lsquo;<samp>outer</samp>&rsquo;</dt>
20583 <dd><p>Set outer coloring mode.
20584 It shall assume one of following values:
20585 </p><dl compact="compact">
20586 <dt> &lsquo;<samp>iteration_count</samp>&rsquo;</dt>
20587 <dd><p>Set iteration cound mode.
20588 </p></dd>
20589 <dt> &lsquo;<samp>normalized_iteration_count</samp>&rsquo;</dt>
20590 <dd><p>set normalized iteration count mode.
20591 </p></dd>
20592 </dl>
20593 <p>Default value is <var>normalized_iteration_count</var>.
20594 </p>
20595 </dd>
20596 <dt> &lsquo;<samp>rate, r</samp>&rsquo;</dt>
20597 <dd><p>Set frame rate, expressed as number of frames per second. Default
20598 value is &quot;25&quot;.
20599 </p>
20600 </dd>
20601 <dt> &lsquo;<samp>size, s</samp>&rsquo;</dt>
20602 <dd><p>Set frame size. For the syntax of this option, check the &quot;Video
20603 size&quot; section in the ffmpeg-utils manual. Default value is &quot;640x480&quot;.
20604 </p>
20605 </dd>
20606 <dt> &lsquo;<samp>start_scale</samp>&rsquo;</dt>
20607 <dd><p>Set the initial scale value. Default value is 3.0.
20608 </p>
20609 </dd>
20610 <dt> &lsquo;<samp>start_x</samp>&rsquo;</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.
20613 </p>
20614 </dd>
20615 <dt> &lsquo;<samp>start_y</samp>&rsquo;</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.
20618 </p></dd>
20619 </dl>
20620
20621 <a name="mptestsrc"></a>
20622 <h2 class="section"><a href="ffplay-all.html#toc-mptestsrc">34.4 mptestsrc</a></h2>
20623
20624 <p>Generate various test patterns, as generated by the MPlayer test filter.
20625 </p>
20626 <p>The size of the generated video is fixed, and is 256x256.
20627 This source is useful in particular for testing encoding features.
20628 </p>
20629 <p>This source accepts the following options:
20630 </p>
20631 <dl compact="compact">
20632 <dt> &lsquo;<samp>rate, r</samp>&rsquo;</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
20637 &quot;25&quot;.
20638 </p>
20639 </dd>
20640 <dt> &lsquo;<samp>duration, d</samp>&rsquo;</dt>
20641 <dd><p>Set the video duration of the sourced video. The accepted syntax is:
20642 </p><table><tr><td>&nbsp;</td><td><pre class="example">[-]HH:MM:SS[.m...]
20643 [-]S+[.m...]
20644 </pre></td></tr></table>
20645 <p>See also the function <code>av_parse_time()</code>.
20646 </p>
20647 <p>If not specified, or the expressed duration is negative, the video is
20648 supposed to be generated forever.
20649 </p>
20650 </dd>
20651 <dt> &lsquo;<samp>test, t</samp>&rsquo;</dt>
20652 <dd>
20653 <p>Set the number or the name of the test to perform. Supported tests are:
20654 </p><dl compact="compact">
20655 <dt> &lsquo;<samp>dc_luma</samp>&rsquo;</dt>
20656 <dt> &lsquo;<samp>dc_chroma</samp>&rsquo;</dt>
20657 <dt> &lsquo;<samp>freq_luma</samp>&rsquo;</dt>
20658 <dt> &lsquo;<samp>freq_chroma</samp>&rsquo;</dt>
20659 <dt> &lsquo;<samp>amp_luma</samp>&rsquo;</dt>
20660 <dt> &lsquo;<samp>amp_chroma</samp>&rsquo;</dt>
20661 <dt> &lsquo;<samp>cbp</samp>&rsquo;</dt>
20662 <dt> &lsquo;<samp>mv</samp>&rsquo;</dt>
20663 <dt> &lsquo;<samp>ring1</samp>&rsquo;</dt>
20664 <dt> &lsquo;<samp>ring2</samp>&rsquo;</dt>
20665 <dt> &lsquo;<samp>all</samp>&rsquo;</dt>
20666 </dl>
20667
20668 <p>Default value is &quot;all&quot;, which will cycle through the list of all tests.
20669 </p></dd>
20670 </dl>
20671
20672 <p>For example the following:
20673 </p><table><tr><td>&nbsp;</td><td><pre class="example">testsrc=t=dc_luma
20674 </pre></td></tr></table>
20675
20676 <p>will generate a &quot;dc_luma&quot; test pattern.
20677 </p>
20678 <a name="frei0r_005fsrc"></a>
20679 <h2 class="section"><a href="ffplay-all.html#toc-frei0r_005fsrc">34.5 frei0r_src</a></h2>
20680
20681 <p>Provide a frei0r source.
20682 </p>
20683 <p>To enable compilation of this filter you need to install the frei0r
20684 header and configure FFmpeg with <code>--enable-frei0r</code>.
20685 </p>
20686 <p>This source accepts the following options:
20687 </p>
20688 <dl compact="compact">
20689 <dt> &lsquo;<samp>size</samp>&rsquo;</dt>
20690 <dd><p>The size of the video to generate. For the syntax of this option, check the
20691 &quot;Video size&quot; section in the ffmpeg-utils manual.
20692 </p>
20693 </dd>
20694 <dt> &lsquo;<samp>framerate</samp>&rsquo;</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.
20697 </p>
20698 </dd>
20699 <dt> &lsquo;<samp>filter_name</samp>&rsquo;</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
20702 the video filters.
20703 </p>
20704 </dd>
20705 <dt> &lsquo;<samp>filter_params</samp>&rsquo;</dt>
20706 <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r source.
20707 </p>
20708 </dd>
20709 </dl>
20710
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>&nbsp;</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>
20715
20716 <a name="life"></a>
20717 <h2 class="section"><a href="ffplay-all.html#toc-life">34.6 life</a></h2>
20718
20719 <p>Generate a life pattern.
20720 </p>
20721 <p>This source is based on a generalization of John Conway&rsquo;s life game.
20722 </p>
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.
20727 </p>
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 &lsquo;<samp>rule</samp>&rsquo; option allows to specify
20731 the rule to adopt.
20732 </p>
20733 <p>This source accepts the following options:
20734 </p>
20735 <dl compact="compact">
20736 <dt> &lsquo;<samp>filename, f</samp>&rsquo;</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.
20740 </p>
20741 <p>If this option is not specified, the initial grid is generated
20742 randomly.
20743 </p>
20744 </dd>
20745 <dt> &lsquo;<samp>rate, r</samp>&rsquo;</dt>
20746 <dd><p>Set the video rate, that is the number of frames generated per second.
20747 Default is 25.
20748 </p>
20749 </dd>
20750 <dt> &lsquo;<samp>random_fill_ratio, ratio</samp>&rsquo;</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.
20754 </p>
20755 </dd>
20756 <dt> &lsquo;<samp>random_seed, seed</samp>&rsquo;</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
20760 effort basis.
20761 </p>
20762 </dd>
20763 <dt> &lsquo;<samp>rule</samp>&rsquo;</dt>
20764 <dd><p>Set the life rule.
20765 </p>
20766 <p>A rule can be specified with a code of the kind &quot;S<var>NS</var>/B<var>NB</var>&quot;,
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 &quot;born&quot;).
20771 &quot;s&quot; and &quot;b&quot; can be used in place of &quot;S&quot; and &quot;B&quot;, respectively.
20772 </p>
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 &quot;borning&quot; new cells. Higher order bits encode for an
20777 higher number of neighbor cells.
20778 For example the number 6153 = <code>(12&lt;&lt;9)+9</code> specifies a stay alive
20779 rule of 12 and a born rule of 9, which corresponds to &quot;S23/B03&quot;.
20780 </p>
20781 <p>Default value is &quot;S23/B3&quot;, which is the original Conway&rsquo;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
20784 a dead cell.
20785 </p>
20786 </dd>
20787 <dt> &lsquo;<samp>size, s</samp>&rsquo;</dt>
20788 <dd><p>Set the size of the output video. For the syntax of this option, check the
20789 &quot;Video size&quot; section in the ffmpeg-utils manual.
20790 </p>
20791 <p>If &lsquo;<samp>filename</samp>&rsquo; is specified, the size is set by default to the
20792 same size of the input file. If &lsquo;<samp>size</samp>&rsquo; 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.
20795 </p>
20796 <p>If a filename is not specified, the size value defaults to &quot;320x240&quot;
20797 (used for a randomly generated initial grid).
20798 </p>
20799 </dd>
20800 <dt> &lsquo;<samp>stitch</samp>&rsquo;</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.
20803 </p>
20804 </dd>
20805 <dt> &lsquo;<samp>mold</samp>&rsquo;</dt>
20806 <dd><p>Set cell mold speed. If set, a dead cell will go from &lsquo;<samp>death_color</samp>&rsquo; to
20807 &lsquo;<samp>mold_color</samp>&rsquo; with a step of &lsquo;<samp>mold</samp>&rsquo;. &lsquo;<samp>mold</samp>&rsquo; can have a
20808 value from 0 to 255.
20809 </p>
20810 </dd>
20811 <dt> &lsquo;<samp>life_color</samp>&rsquo;</dt>
20812 <dd><p>Set the color of living (or new born) cells.
20813 </p>
20814 </dd>
20815 <dt> &lsquo;<samp>death_color</samp>&rsquo;</dt>
20816 <dd><p>Set the color of dead cells. If &lsquo;<samp>mold</samp>&rsquo; is set, this is the first color
20817 used to represent a dead cell.
20818 </p>
20819 </dd>
20820 <dt> &lsquo;<samp>mold_color</samp>&rsquo;</dt>
20821 <dd><p>Set mold color, for definitely dead and moldy cells.
20822 </p>
20823 <p>For the syntax of these 3 color options, check the &quot;Color&quot; section in the
20824 ffmpeg-utils manual.
20825 </p></dd>
20826 </dl>
20827
20828 <a name="Examples-21"></a>
20829 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-21">34.6.1 Examples</a></h3>
20830
20831 <ul>
20832 <li>
20833 Read a grid from &lsquo;<tt>pattern</tt>&rsquo;, and center it on a grid of size
20834 300x300 pixels:
20835 <table><tr><td>&nbsp;</td><td><pre class="example">life=f=pattern:s=300x300
20836 </pre></td></tr></table>
20837
20838 </li><li>
20839 Generate a random grid of size 200x200, with a fill ratio of 2/3:
20840 <table><tr><td>&nbsp;</td><td><pre class="example">life=ratio=2/3:s=200x200
20841 </pre></td></tr></table>
20842
20843 </li><li>
20844 Specify a custom rule for evolving a randomly generated grid:
20845 <table><tr><td>&nbsp;</td><td><pre class="example">life=rule=S14/B34
20846 </pre></td></tr></table>
20847
20848 </li><li>
20849 Full example with slow death effect (mold) using <code>ffplay</code>:
20850 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f lavfi life=s=300x200:mold=10:r=60:ratio=0.1:death_color=#C83232:life_color=#00ff00,scale=1200:800:flags=16
20851 </pre></td></tr></table>
20852 </li></ul>
20853
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>
20863
20864 <p>The <code>color</code> source provides an uniformly colored input.
20865 </p>
20866 <p>The <code>haldclutsrc</code> source provides an identity Hald CLUT. See also
20867 <a href="#haldclut">haldclut</a> filter.
20868 </p>
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.
20872 </p>
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.
20876 </p>
20877 <p>The <code>smptebars</code> source generates a color bars pattern, based on
20878 the SMPTE Engineering Guideline EG 1-1990.
20879 </p>
20880 <p>The <code>smptehdbars</code> source generates a color bars pattern, based on
20881 the SMPTE RP 219-2002.
20882 </p>
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.
20886 </p>
20887 <p>The sources accept the following options:
20888 </p>
20889 <dl compact="compact">
20890 <dt> &lsquo;<samp>color, c</samp>&rsquo;</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 &quot;Color&quot; section in the
20893 ffmpeg-utils manual.
20894 </p>
20895 </dd>
20896 <dt> &lsquo;<samp>level</samp>&rsquo;</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.
20901 </p>
20902 </dd>
20903 <dt> &lsquo;<samp>size, s</samp>&rsquo;</dt>
20904 <dd><p>Specify the size of the sourced video. For the syntax of this option, check the
20905 &quot;Video size&quot; section in the ffmpeg-utils manual. The default value is
20906 &quot;320x240&quot;.
20907 </p>
20908 <p>This option is not available with the <code>haldclutsrc</code> filter.
20909 </p>
20910 </dd>
20911 <dt> &lsquo;<samp>rate, r</samp>&rsquo;</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
20916 &quot;25&quot;.
20917 </p>
20918 </dd>
20919 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
20920 <dd><p>Set the sample aspect ratio of the sourced video.
20921 </p>
20922 </dd>
20923 <dt> &lsquo;<samp>duration, d</samp>&rsquo;</dt>
20924 <dd><p>Set the video duration of the sourced video. The accepted syntax is:
20925 </p><table><tr><td>&nbsp;</td><td><pre class="example">[-]HH[:MM[:SS[.m...]]]
20926 [-]S+[.m...]
20927 </pre></td></tr></table>
20928 <p>See also the function <code>av_parse_time()</code>.
20929 </p>
20930 <p>If not specified, or the expressed duration is negative, the video is
20931 supposed to be generated forever.
20932 </p>
20933 </dd>
20934 <dt> &lsquo;<samp>decimals, n</samp>&rsquo;</dt>
20935 <dd><p>Set the number of decimals to show in the timestamp, only available in the
20936 <code>testsrc</code> source.
20937 </p>
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.
20941 </p></dd>
20942 </dl>
20943
20944 <p>For example the following:
20945 </p><table><tr><td>&nbsp;</td><td><pre class="example">testsrc=duration=5.3:size=qcif:rate=10
20946 </pre></td></tr></table>
20947
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.
20950 </p>
20951 <p>The following graph description will generate a red source
20952 with an opacity of 0.2, with size &quot;qcif&quot; and a frame rate of 10
20953 frames per second.
20954 </p><table><tr><td>&nbsp;</td><td><pre class="example">color=c=red@0.2:s=qcif:r=10
20955 </pre></td></tr></table>
20956
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>&nbsp;</td><td><pre class="example">nullsrc=s=256x256, geq=random(1)*255:128:128
20961 </pre></td></tr></table>
20962
20963 <a name="Commands-4"></a>
20964 <h3 class="subsection"><a href="ffplay-all.html#toc-Commands-4">34.7.1 Commands</a></h3>
20965
20966 <p>The <code>color</code> source supports the following commands:
20967 </p>
20968 <dl compact="compact">
20969 <dt> &lsquo;<samp>c, color</samp>&rsquo;</dt>
20970 <dd><p>Set the color of the created image. Accepts the same syntax of the
20971 corresponding &lsquo;<samp>color</samp>&rsquo; option.
20972 </p></dd>
20973 </dl>
20974
20975
20976 <a name="Video-Sinks"></a>
20977 <h1 class="chapter"><a href="ffplay-all.html#toc-Video-Sinks">35. Video Sinks</a></h1>
20978
20979 <p>Below is a description of the currently available video sinks.
20980 </p>
20981 <a name="buffersink"></a>
20982 <h2 class="section"><a href="ffplay-all.html#toc-buffersink">35.1 buffersink</a></h2>
20983
20984 <p>Buffer video frames, and make them available to the end of the filter
20985 graph.
20986 </p>
20987 <p>This sink is mainly intended for a programmatic use, in particular
20988 through the interface defined in &lsquo;<tt>libavfilter/buffersink.h</tt>&rsquo;
20989 or the options system.
20990 </p>
20991 <p>It accepts a pointer to an AVBufferSinkContext structure, which
20992 defines the incoming buffers&rsquo; formats, to be passed as the opaque
20993 parameter to <code>avfilter_init_filter</code> for initialization.
20994 </p>
20995 <a name="nullsink"></a>
20996 <h2 class="section"><a href="ffplay-all.html#toc-nullsink">35.2 nullsink</a></h2>
20997
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
21000 tools.
21001 </p>
21002
21003 <a name="Multimedia-Filters"></a>
21004 <h1 class="chapter"><a href="ffplay-all.html#toc-Multimedia-Filters">36. Multimedia Filters</a></h1>
21005
21006 <p>Below is a description of the currently available multimedia filters.
21007 </p>
21008 <a name="avectorscope"></a>
21009 <h2 class="section"><a href="ffplay-all.html#toc-avectorscope">36.1 avectorscope</a></h2>
21010
21011 <p>Convert input audio to a video output, representing the audio vector
21012 scope.
21013 </p>
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.
21020 </p>
21021 <p>The filter accepts the following options:
21022 </p>
21023 <dl compact="compact">
21024 <dt> &lsquo;<samp>mode, m</samp>&rsquo;</dt>
21025 <dd><p>Set the vectorscope mode.
21026 </p>
21027 <p>Available values are:
21028 </p><dl compact="compact">
21029 <dt> &lsquo;<samp>lissajous</samp>&rsquo;</dt>
21030 <dd><p>Lissajous rotated by 45 degrees.
21031 </p>
21032 </dd>
21033 <dt> &lsquo;<samp>lissajous_xy</samp>&rsquo;</dt>
21034 <dd><p>Same as above but not rotated.
21035 </p></dd>
21036 </dl>
21037
21038 <p>Default value is &lsquo;<samp>lissajous</samp>&rsquo;.
21039 </p>
21040 </dd>
21041 <dt> &lsquo;<samp>size, s</samp>&rsquo;</dt>
21042 <dd><p>Set the video size for the output. For the syntax of this option, check the &quot;Video size&quot;
21043 section in the ffmpeg-utils manual. Default value is <code>400x400</code>.
21044 </p>
21045 </dd>
21046 <dt> &lsquo;<samp>rate, r</samp>&rsquo;</dt>
21047 <dd><p>Set the output frame rate. Default value is <code>25</code>.
21048 </p>
21049 </dd>
21050 <dt> &lsquo;<samp>rc</samp>&rsquo;</dt>
21051 <dt> &lsquo;<samp>gc</samp>&rsquo;</dt>
21052 <dt> &lsquo;<samp>bc</samp>&rsquo;</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>.
21055 </p>
21056 </dd>
21057 <dt> &lsquo;<samp>rf</samp>&rsquo;</dt>
21058 <dt> &lsquo;<samp>gf</samp>&rsquo;</dt>
21059 <dt> &lsquo;<samp>bf</samp>&rsquo;</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>.
21062 </p>
21063 </dd>
21064 <dt> &lsquo;<samp>zoom</samp>&rsquo;</dt>
21065 <dd><p>Set the zoom factor. Default value is <code>1</code>. Allowed range is <code>[1, 10]</code>.
21066 </p></dd>
21067 </dl>
21068
21069 <a name="Examples"></a>
21070 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples">36.1.1 Examples</a></h3>
21071
21072 <ul>
21073 <li>
21074 Complete example using <code>ffplay</code>:
21075 <table><tr><td>&nbsp;</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>
21078 </li></ul>
21079
21080 <a name="concat-2"></a>
21081 <h2 class="section"><a href="ffplay-all.html#toc-concat-2">36.2 concat</a></h2>
21082
21083 <p>Concatenate audio and video streams, joining them together one after the
21084 other.
21085 </p>
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.
21089 </p>
21090 <p>The filter accepts the following options:
21091 </p>
21092 <dl compact="compact">
21093 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
21094 <dd><p>Set the number of segments. Default is 2.
21095 </p>
21096 </dd>
21097 <dt> &lsquo;<samp>v</samp>&rsquo;</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.
21100 </p>
21101 </dd>
21102 <dt> &lsquo;<samp>a</samp>&rsquo;</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.
21105 </p>
21106 </dd>
21107 <dt> &lsquo;<samp>unsafe</samp>&rsquo;</dt>
21108 <dd><p>Activate unsafe mode: do not fail if segments have a different format.
21109 </p>
21110 </dd>
21111 </dl>
21112
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.
21115 </p>
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
21118 segment, etc.
21119 </p>
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.
21126 </p>
21127 <p>For this filter to work correctly, all segments must start at timestamp 0.
21128 </p>
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.
21134 </p>
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.
21137 </p>
21138 <a name="Examples-40"></a>
21139 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-40">36.2.1 Examples</a></h3>
21140
21141 <ul>
21142 <li>
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>&nbsp;</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>
21150
21151 </li><li>
21152 Concatenate two parts, handling audio and video separately, using the
21153 (a)movie sources, and adjusting the resolution:
21154 <table><tr><td>&nbsp;</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.
21160 </p>
21161 </li></ul>
21162
21163 <a name="ebur128"></a>
21164 <h2 class="section"><a href="ffplay-all.html#toc-ebur128">36.3 ebur128</a></h2>
21165
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>).
21170 </p>
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).
21177 </p>
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>.
21180 </p>
21181 <p>The filter accepts the following options:
21182 </p>
21183 <dl compact="compact">
21184 <dt> &lsquo;<samp>video</samp>&rsquo;</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>.
21188 </p>
21189 </dd>
21190 <dt> &lsquo;<samp>size</samp>&rsquo;</dt>
21191 <dd><p>Set the video size. This option is for video only. For the syntax of this
21192 option, check the &quot;Video size&quot; section in the ffmpeg-utils manual. Default
21193 and minimum resolution is <code>640x480</code>.
21194 </p>
21195 </dd>
21196 <dt> &lsquo;<samp>meter</samp>&rsquo;</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.
21200 </p>
21201 </dd>
21202 <dt> &lsquo;<samp>metadata</samp>&rsquo;</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>.
21206 </p>
21207 <p>Default is <code>0</code>.
21208 </p>
21209 </dd>
21210 <dt> &lsquo;<samp>framelog</samp>&rsquo;</dt>
21211 <dd><p>Force the frame logging level.
21212 </p>
21213 <p>Available values are:
21214 </p><dl compact="compact">
21215 <dt> &lsquo;<samp>info</samp>&rsquo;</dt>
21216 <dd><p>information logging level
21217 </p></dd>
21218 <dt> &lsquo;<samp>verbose</samp>&rsquo;</dt>
21219 <dd><p>verbose logging level
21220 </p></dd>
21221 </dl>
21222
21223 <p>By default, the logging level is set to <var>info</var>. If the &lsquo;<samp>video</samp>&rsquo; or
21224 the &lsquo;<samp>metadata</samp>&rsquo; options are set, it switches to <var>verbose</var>.
21225 </p></dd>
21226 </dl>
21227
21228 <a name="Examples-18"></a>
21229 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-18">36.3.1 Examples</a></h3>
21230
21231 <ul>
21232 <li>
21233 Real-time graph using <code>ffplay</code>, with a EBU scale meter +18:
21234 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f lavfi -i &quot;amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]&quot;
21235 </pre></td></tr></table>
21236
21237 </li><li>
21238 Run an analysis with <code>ffmpeg</code>:
21239 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -nostats -i input.mp3 -filter_complex ebur128 -f null -
21240 </pre></td></tr></table>
21241 </li></ul>
21242
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>
21245
21246 <p>Temporally interleave frames from several inputs.
21247 </p>
21248 <p><code>interleave</code> works with video inputs, <code>ainterleave</code> with audio.
21249 </p>
21250 <p>These filters read frames from several inputs and send the oldest
21251 queued frame to the output.
21252 </p>
21253 <p>Input streams must have a well defined, monotonically increasing frame
21254 timestamp values.
21255 </p>
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.
21259 </p>
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.
21264 </p>
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.
21268 </p>
21269 <p>These filters accept the following options:
21270 </p>
21271 <dl compact="compact">
21272 <dt> &lsquo;<samp>nb_inputs, n</samp>&rsquo;</dt>
21273 <dd><p>Set the number of different inputs, it is 2 by default.
21274 </p></dd>
21275 </dl>
21276
21277 <a name="Examples-35"></a>
21278 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-35">36.4.1 Examples</a></h3>
21279
21280 <ul>
21281 <li>
21282 Interleave frames belonging to different streams using <code>ffmpeg</code>:
21283 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i bambi.avi -i pr0n.mkv -filter_complex &quot;[0:v][1:v] interleave&quot; out.avi
21284 </pre></td></tr></table>
21285
21286 </li><li>
21287 Add flickering blur effect:
21288 <table><tr><td>&nbsp;</td><td><pre class="example">select='if(gt(random(0), 0.2), 1, 2)':n=2 [tmp], boxblur=2:2, [tmp] interleave
21289 </pre></td></tr></table>
21290 </li></ul>
21291
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>
21294
21295 <p>Set read/write permissions for the output frames.
21296 </p>
21297 <p>These filters are mainly aimed at developers to test direct path in the
21298 following filter in the filtergraph.
21299 </p>
21300 <p>The filters accept the following options:
21301 </p>
21302 <dl compact="compact">
21303 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
21304 <dd><p>Select the permissions mode.
21305 </p>
21306 <p>It accepts the following values:
21307 </p><dl compact="compact">
21308 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
21309 <dd><p>Do nothing. This is the default.
21310 </p></dd>
21311 <dt> &lsquo;<samp>ro</samp>&rsquo;</dt>
21312 <dd><p>Set all the output frames read-only.
21313 </p></dd>
21314 <dt> &lsquo;<samp>rw</samp>&rsquo;</dt>
21315 <dd><p>Set all the output frames directly writable.
21316 </p></dd>
21317 <dt> &lsquo;<samp>toggle</samp>&rsquo;</dt>
21318 <dd><p>Make the frame read-only if writable, and writable if read-only.
21319 </p></dd>
21320 <dt> &lsquo;<samp>random</samp>&rsquo;</dt>
21321 <dd><p>Set each output frame read-only or writable randomly.
21322 </p></dd>
21323 </dl>
21324
21325 </dd>
21326 <dt> &lsquo;<samp>seed</samp>&rsquo;</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
21330 basis.
21331 </p></dd>
21332 </dl>
21333
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.
21338 </p>
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>
21341
21342 <p>Select frames to pass in output.
21343 </p>
21344 <p>This filter accepts the following options:
21345 </p>
21346 <dl compact="compact">
21347 <dt> &lsquo;<samp>expr, e</samp>&rsquo;</dt>
21348 <dd><p>Set expression, which is evaluated for each input frame.
21349 </p>
21350 <p>If the expression is evaluated to zero, the frame is discarded.
21351 </p>
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.
21355 </p>
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.
21358 </p>
21359 </dd>
21360 <dt> &lsquo;<samp>outputs, n</samp>&rsquo;</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.
21363 </p></dd>
21364 </dl>
21365
21366 <p>The expression can contain the following constants:
21367 </p>
21368 <dl compact="compact">
21369 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
21370 <dd><p>the sequential number of the filtered frame, starting from 0
21371 </p>
21372 </dd>
21373 <dt> &lsquo;<samp>selected_n</samp>&rsquo;</dt>
21374 <dd><p>the sequential number of the selected frame, starting from 0
21375 </p>
21376 </dd>
21377 <dt> &lsquo;<samp>prev_selected_n</samp>&rsquo;</dt>
21378 <dd><p>the sequential number of the last selected frame, NAN if undefined
21379 </p>
21380 </dd>
21381 <dt> &lsquo;<samp>TB</samp>&rsquo;</dt>
21382 <dd><p>timebase of the input timestamps
21383 </p>
21384 </dd>
21385 <dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
21386 <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
21387 expressed in <var>TB</var> units, NAN if undefined
21388 </p>
21389 </dd>
21390 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
21391 <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
21392 expressed in seconds, NAN if undefined
21393 </p>
21394 </dd>
21395 <dt> &lsquo;<samp>prev_pts</samp>&rsquo;</dt>
21396 <dd><p>the PTS of the previously filtered video frame, NAN if undefined
21397 </p>
21398 </dd>
21399 <dt> &lsquo;<samp>prev_selected_pts</samp>&rsquo;</dt>
21400 <dd><p>the PTS of the last previously filtered video frame, NAN if undefined
21401 </p>
21402 </dd>
21403 <dt> &lsquo;<samp>prev_selected_t</samp>&rsquo;</dt>
21404 <dd><p>the PTS of the last previously selected video frame, NAN if undefined
21405 </p>
21406 </dd>
21407 <dt> &lsquo;<samp>start_pts</samp>&rsquo;</dt>
21408 <dd><p>the PTS of the first video frame in the video, NAN if undefined
21409 </p>
21410 </dd>
21411 <dt> &lsquo;<samp>start_t</samp>&rsquo;</dt>
21412 <dd><p>the time of the first video frame in the video, NAN if undefined
21413 </p>
21414 </dd>
21415 <dt> &lsquo;<samp>pict_type <em>(video only)</em></samp>&rsquo;</dt>
21416 <dd><p>the type of the filtered frame, can assume one of the following
21417 values:
21418 </p><dl compact="compact">
21419 <dt> &lsquo;<samp>I</samp>&rsquo;</dt>
21420 <dt> &lsquo;<samp>P</samp>&rsquo;</dt>
21421 <dt> &lsquo;<samp>B</samp>&rsquo;</dt>
21422 <dt> &lsquo;<samp>S</samp>&rsquo;</dt>
21423 <dt> &lsquo;<samp>SI</samp>&rsquo;</dt>
21424 <dt> &lsquo;<samp>SP</samp>&rsquo;</dt>
21425 <dt> &lsquo;<samp>BI</samp>&rsquo;</dt>
21426 </dl>
21427
21428 </dd>
21429 <dt> &lsquo;<samp>interlace_type <em>(video only)</em></samp>&rsquo;</dt>
21430 <dd><p>the frame interlace type, can assume one of the following values:
21431 </p><dl compact="compact">
21432 <dt> &lsquo;<samp>PROGRESSIVE</samp>&rsquo;</dt>
21433 <dd><p>the frame is progressive (not interlaced)
21434 </p></dd>
21435 <dt> &lsquo;<samp>TOPFIRST</samp>&rsquo;</dt>
21436 <dd><p>the frame is top-field-first
21437 </p></dd>
21438 <dt> &lsquo;<samp>BOTTOMFIRST</samp>&rsquo;</dt>
21439 <dd><p>the frame is bottom-field-first
21440 </p></dd>
21441 </dl>
21442
21443 </dd>
21444 <dt> &lsquo;<samp>consumed_sample_n <em>(audio only)</em></samp>&rsquo;</dt>
21445 <dd><p>the number of selected samples before the current frame
21446 </p>
21447 </dd>
21448 <dt> &lsquo;<samp>samples_n <em>(audio only)</em></samp>&rsquo;</dt>
21449 <dd><p>the number of samples in the current frame
21450 </p>
21451 </dd>
21452 <dt> &lsquo;<samp>sample_rate <em>(audio only)</em></samp>&rsquo;</dt>
21453 <dd><p>the input sample rate
21454 </p>
21455 </dd>
21456 <dt> &lsquo;<samp>key</samp>&rsquo;</dt>
21457 <dd><p>1 if the filtered frame is a key-frame, 0 otherwise
21458 </p>
21459 </dd>
21460 <dt> &lsquo;<samp>pos</samp>&rsquo;</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)
21463 </p>
21464 </dd>
21465 <dt> &lsquo;<samp>scene <em>(video only)</em></samp>&rsquo;</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)
21469 </p>
21470 </dd>
21471 </dl>
21472
21473 <p>The default value of the select expression is &quot;1&quot;.
21474 </p>
21475 <a name="Examples-76"></a>
21476 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-76">36.6.1 Examples</a></h3>
21477
21478 <ul>
21479 <li>
21480 Select all frames in input:
21481 <table><tr><td>&nbsp;</td><td><pre class="example">select
21482 </pre></td></tr></table>
21483
21484 <p>The example above is the same as:
21485 </p><table><tr><td>&nbsp;</td><td><pre class="example">select=1
21486 </pre></td></tr></table>
21487
21488 </li><li>
21489 Skip all frames:
21490 <table><tr><td>&nbsp;</td><td><pre class="example">select=0
21491 </pre></td></tr></table>
21492
21493 </li><li>
21494 Select only I-frames:
21495 <table><tr><td>&nbsp;</td><td><pre class="example">select='eq(pict_type\,I)'
21496 </pre></td></tr></table>
21497
21498 </li><li>
21499 Select one frame every 100:
21500 <table><tr><td>&nbsp;</td><td><pre class="example">select='not(mod(n\,100))'
21501 </pre></td></tr></table>
21502
21503 </li><li>
21504 Select only frames contained in the 10-20 time interval:
21505 <table><tr><td>&nbsp;</td><td><pre class="example">select=between(t\,10\,20)
21506 </pre></td></tr></table>
21507
21508 </li><li>
21509 Select only I frames contained in the 10-20 time interval:
21510 <table><tr><td>&nbsp;</td><td><pre class="example">select=between(t\,10\,20)*eq(pict_type\,I)
21511 </pre></td></tr></table>
21512
21513 </li><li>
21514 Select frames with a minimum distance of 10 seconds:
21515 <table><tr><td>&nbsp;</td><td><pre class="example">select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
21516 </pre></td></tr></table>
21517
21518 </li><li>
21519 Use aselect to select only audio frames with samples number &gt; 100:
21520 <table><tr><td>&nbsp;</td><td><pre class="example">aselect='gt(samples_n\,100)'
21521 </pre></td></tr></table>
21522
21523 </li><li>
21524 Create a mosaic of the first scenes:
21525 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png
21526 </pre></td></tr></table>
21527
21528 <p>Comparing <var>scene</var> against a value between 0.3 and 0.5 is generally a sane
21529 choice.
21530 </p>
21531 </li><li>
21532 Send even and odd frames to separate outputs, and compose them:
21533 <table><tr><td>&nbsp;</td><td><pre class="example">select=n=2:e='mod(n, 2)+1' [odd][even]; [odd] pad=h=2*ih [tmp]; [tmp][even] overlay=y=h
21534 </pre></td></tr></table>
21535 </li></ul>
21536
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>
21539
21540 <p>Send commands to filters in the filtergraph.
21541 </p>
21542 <p>These filters read commands to be sent to other filters in the
21543 filtergraph.
21544 </p>
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.
21548 </p>
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.
21552 </p>
21553 <p>These filters accept the following options:
21554 </p><dl compact="compact">
21555 <dt> &lsquo;<samp>commands, c</samp>&rsquo;</dt>
21556 <dd><p>Set the commands to be read and sent to the other filters.
21557 </p></dd>
21558 <dt> &lsquo;<samp>filename, f</samp>&rsquo;</dt>
21559 <dd><p>Set the filename of the commands to be read and sent to the other
21560 filters.
21561 </p></dd>
21562 </dl>
21563
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>
21566
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
21571 interval.
21572 </p>
21573 <p>An interval is specified by the following syntax:
21574 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>START</var>[-<var>END</var>] <var>COMMANDS</var>;
21575 </pre></td></tr></table>
21576
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.
21579 </p>
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
21583 <var>END</var>.
21584 </p>
21585 <p><var>COMMANDS</var> consists of a sequence of one or more command
21586 specifications, separated by &quot;,&quot;, relating to that interval.  The
21587 syntax of a command specification is given by:
21588 </p><table><tr><td>&nbsp;</td><td><pre class="example">[<var>FLAGS</var>] <var>TARGET</var> <var>COMMAND</var> <var>ARG</var>
21589 </pre></td></tr></table>
21590
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 &quot;+&quot; or &quot;|&quot; and
21594 enclosed between &quot;[&quot; and &quot;]&quot;.
21595 </p>
21596 <p>The following flags are recognized:
21597 </p><dl compact="compact">
21598 <dt> &lsquo;<samp>enter</samp>&rsquo;</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
21602 current is.
21603 </p>
21604 </dd>
21605 <dt> &lsquo;<samp>leave</samp>&rsquo;</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
21609 current is not.
21610 </p></dd>
21611 </dl>
21612
21613 <p>If <var>FLAGS</var> is not specified, a default value of <code>[enter]</code> is
21614 assumed.
21615 </p>
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.
21618 </p>
21619 <p><var>COMMAND</var> specifies the name of the command for the target filter.
21620 </p>
21621 <p><var>ARG</var> is optional and specifies the optional list of argument for
21622 the given <var>COMMAND</var>.
21623 </p>
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.
21627 </p>
21628 <p>A simplified BNF description of the commands specification syntax
21629 follows:
21630 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>COMMAND_FLAG</var>  ::= &quot;enter&quot; | &quot;leave&quot;
21631 <var>COMMAND_FLAGS</var> ::= <var>COMMAND_FLAG</var> [(+|&quot;|&quot;)<var>COMMAND_FLAG</var>]
21632 <var>COMMAND</var>       ::= [&quot;[&quot; <var>COMMAND_FLAGS</var> &quot;]&quot;] <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>
21637
21638 <a name="Examples-39"></a>
21639 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-39">36.7.2 Examples</a></h3>
21640
21641 <ul>
21642 <li>
21643 Specify audio tempo change at second 4:
21644 <table><tr><td>&nbsp;</td><td><pre class="example">asendcmd=c='4.0 atempo tempo 1.5',atempo
21645 </pre></td></tr></table>
21646
21647 </li><li>
21648 Specify a list of drawtext and hue commands in a file.
21649 <table><tr><td>&nbsp;</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=';
21652
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',
21656           [leave] hue s 1,
21657           [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color';
21658
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>
21662
21663 <p>A filtergraph allowing to read and process the above command list
21664 stored in a file &lsquo;<tt>test.cmd</tt>&rsquo;, can be specified with:
21665 </p><table><tr><td>&nbsp;</td><td><pre class="example">sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue
21666 </pre></td></tr></table>
21667 </li></ul>
21668
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>
21672
21673 <p>Change the PTS (presentation timestamp) of the input frames.
21674 </p>
21675 <p><code>setpts</code> works on video frames, <code>asetpts</code> on audio frames.
21676 </p>
21677 <p>This filter accepts the following options:
21678 </p>
21679 <dl compact="compact">
21680 <dt> &lsquo;<samp>expr</samp>&rsquo;</dt>
21681 <dd><p>The expression which is evaluated for each frame to construct its timestamp.
21682 </p>
21683 </dd>
21684 </dl>
21685
21686 <p>The expression is evaluated through the eval API and can contain the following
21687 constants:
21688 </p>
21689 <dl compact="compact">
21690 <dt> &lsquo;<samp>FRAME_RATE</samp>&rsquo;</dt>
21691 <dd><p>frame rate, only defined for constant frame-rate video
21692 </p>
21693 </dd>
21694 <dt> &lsquo;<samp>PTS</samp>&rsquo;</dt>
21695 <dd><p>the presentation timestamp in input
21696 </p>
21697 </dd>
21698 <dt> &lsquo;<samp>N</samp>&rsquo;</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.
21701 </p>
21702 </dd>
21703 <dt> &lsquo;<samp>NB_CONSUMED_SAMPLES</samp>&rsquo;</dt>
21704 <dd><p>the number of consumed samples, not including the current frame (only
21705 audio)
21706 </p>
21707 </dd>
21708 <dt> &lsquo;<samp>NB_SAMPLES, S</samp>&rsquo;</dt>
21709 <dd><p>the number of samples in the current frame (only audio)
21710 </p>
21711 </dd>
21712 <dt> &lsquo;<samp>SAMPLE_RATE, SR</samp>&rsquo;</dt>
21713 <dd><p>audio sample rate
21714 </p>
21715 </dd>
21716 <dt> &lsquo;<samp>STARTPTS</samp>&rsquo;</dt>
21717 <dd><p>the PTS of the first frame
21718 </p>
21719 </dd>
21720 <dt> &lsquo;<samp>STARTT</samp>&rsquo;</dt>
21721 <dd><p>the time in seconds of the first frame
21722 </p>
21723 </dd>
21724 <dt> &lsquo;<samp>INTERLACED</samp>&rsquo;</dt>
21725 <dd><p>tell if the current frame is interlaced
21726 </p>
21727 </dd>
21728 <dt> &lsquo;<samp>T</samp>&rsquo;</dt>
21729 <dd><p>the time in seconds of the current frame
21730 </p>
21731 </dd>
21732 <dt> &lsquo;<samp>POS</samp>&rsquo;</dt>
21733 <dd><p>original position in the file of the frame, or undefined if undefined
21734 for the current frame
21735 </p>
21736 </dd>
21737 <dt> &lsquo;<samp>PREV_INPTS</samp>&rsquo;</dt>
21738 <dd><p>previous input PTS
21739 </p>
21740 </dd>
21741 <dt> &lsquo;<samp>PREV_INT</samp>&rsquo;</dt>
21742 <dd><p>previous input time in seconds
21743 </p>
21744 </dd>
21745 <dt> &lsquo;<samp>PREV_OUTPTS</samp>&rsquo;</dt>
21746 <dd><p>previous output PTS
21747 </p>
21748 </dd>
21749 <dt> &lsquo;<samp>PREV_OUTT</samp>&rsquo;</dt>
21750 <dd><p>previous output time in seconds
21751 </p>
21752 </dd>
21753 <dt> &lsquo;<samp>RTCTIME</samp>&rsquo;</dt>
21754 <dd><p>wallclock (RTC) time in microseconds. This is deprecated, use time(0)
21755 instead.
21756 </p>
21757 </dd>
21758 <dt> &lsquo;<samp>RTCSTART</samp>&rsquo;</dt>
21759 <dd><p>wallclock (RTC) time at the start of the movie in microseconds
21760 </p>
21761 </dd>
21762 <dt> &lsquo;<samp>TB</samp>&rsquo;</dt>
21763 <dd><p>timebase of the input timestamps
21764 </p>
21765 </dd>
21766 </dl>
21767
21768 <a name="Examples-42"></a>
21769 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-42">36.8.1 Examples</a></h3>
21770
21771 <ul>
21772 <li>
21773 Start counting PTS from zero
21774 <table><tr><td>&nbsp;</td><td><pre class="example">setpts=PTS-STARTPTS
21775 </pre></td></tr></table>
21776
21777 </li><li>
21778 Apply fast motion effect:
21779 <table><tr><td>&nbsp;</td><td><pre class="example">setpts=0.5*PTS
21780 </pre></td></tr></table>
21781
21782 </li><li>
21783 Apply slow motion effect:
21784 <table><tr><td>&nbsp;</td><td><pre class="example">setpts=2.0*PTS
21785 </pre></td></tr></table>
21786
21787 </li><li>
21788 Set fixed rate of 25 frames per second:
21789 <table><tr><td>&nbsp;</td><td><pre class="example">setpts=N/(25*TB)
21790 </pre></td></tr></table>
21791
21792 </li><li>
21793 Set fixed rate 25 fps with some jitter:
21794 <table><tr><td>&nbsp;</td><td><pre class="example">setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
21795 </pre></td></tr></table>
21796
21797 </li><li>
21798 Apply an offset of 10 seconds to the input PTS:
21799 <table><tr><td>&nbsp;</td><td><pre class="example">setpts=PTS+10/TB
21800 </pre></td></tr></table>
21801
21802 </li><li>
21803 Generate timestamps from a &quot;live source&quot; and rebase onto the current timebase:
21804 <table><tr><td>&nbsp;</td><td><pre class="example">setpts='(RTCTIME - RTCSTART) / (TB * 1000000)'
21805 </pre></td></tr></table>
21806
21807 </li><li>
21808 Generate timestamps by counting samples:
21809 <table><tr><td>&nbsp;</td><td><pre class="example">asetpts=N/SR/TB
21810 </pre></td></tr></table>
21811
21812 </li></ul>
21813
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>
21816
21817 <p>Set the timebase to use for the output frames timestamps.
21818 It is mainly useful for testing timebase configuration.
21819 </p>
21820 <p>This filter accepts the following options:
21821 </p>
21822 <dl compact="compact">
21823 <dt> &lsquo;<samp>expr, tb</samp>&rsquo;</dt>
21824 <dd><p>The expression which is evaluated into the output timebase.
21825 </p>
21826 </dd>
21827 </dl>
21828
21829 <p>The value for &lsquo;<samp>tb</samp>&rsquo; is an arithmetic expression representing a
21830 rational. The expression can contain the constants &quot;AVTB&quot; (the default
21831 timebase), &quot;intb&quot; (the input timebase) and &quot;sr&quot; (the sample rate,
21832 audio only). Default value is &quot;intb&quot;.
21833 </p>
21834 <a name="Examples-68"></a>
21835 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-68">36.9.1 Examples</a></h3>
21836
21837 <ul>
21838 <li>
21839 Set the timebase to 1/25:
21840 <table><tr><td>&nbsp;</td><td><pre class="example">settb=expr=1/25
21841 </pre></td></tr></table>
21842
21843 </li><li>
21844 Set the timebase to 1/10:
21845 <table><tr><td>&nbsp;</td><td><pre class="example">settb=expr=0.1
21846 </pre></td></tr></table>
21847
21848 </li><li>
21849 Set the timebase to 1001/1000:
21850 <table><tr><td>&nbsp;</td><td><pre class="example">settb=1+0.001
21851 </pre></td></tr></table>
21852
21853 </li><li>
21854 Set the timebase to 2*intb:
21855 <table><tr><td>&nbsp;</td><td><pre class="example">settb=2*intb
21856 </pre></td></tr></table>
21857
21858 </li><li>
21859 Set the default timebase value:
21860 <table><tr><td>&nbsp;</td><td><pre class="example">settb=AVTB
21861 </pre></td></tr></table>
21862 </li></ul>
21863
21864 <a name="showspectrum"></a>
21865 <h2 class="section"><a href="ffplay-all.html#toc-showspectrum">36.10 showspectrum</a></h2>
21866
21867 <p>Convert input audio to a video output, representing the audio frequency
21868 spectrum.
21869 </p>
21870 <p>The filter accepts the following options:
21871 </p>
21872 <dl compact="compact">
21873 <dt> &lsquo;<samp>size, s</samp>&rsquo;</dt>
21874 <dd><p>Specify the video size for the output. For the syntax of this option, check
21875 the &quot;Video size&quot; section in the ffmpeg-utils manual. Default value is
21876 <code>640x512</code>.
21877 </p>
21878 </dd>
21879 <dt> &lsquo;<samp>slide</samp>&rsquo;</dt>
21880 <dd><p>Specify if the spectrum should slide along the window. Default value is
21881 <code>0</code>.
21882 </p>
21883 </dd>
21884 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
21885 <dd><p>Specify display mode.
21886 </p>
21887 <p>It accepts the following values:
21888 </p><dl compact="compact">
21889 <dt> &lsquo;<samp>combined</samp>&rsquo;</dt>
21890 <dd><p>all channels are displayed in the same row
21891 </p></dd>
21892 <dt> &lsquo;<samp>separate</samp>&rsquo;</dt>
21893 <dd><p>all channels are displayed in separate rows
21894 </p></dd>
21895 </dl>
21896
21897 <p>Default value is &lsquo;<samp>combined</samp>&rsquo;.
21898 </p>
21899 </dd>
21900 <dt> &lsquo;<samp>color</samp>&rsquo;</dt>
21901 <dd><p>Specify display color mode.
21902 </p>
21903 <p>It accepts the following values:
21904 </p><dl compact="compact">
21905 <dt> &lsquo;<samp>channel</samp>&rsquo;</dt>
21906 <dd><p>each channel is displayed in a separate color
21907 </p></dd>
21908 <dt> &lsquo;<samp>intensity</samp>&rsquo;</dt>
21909 <dd><p>each channel is is displayed using the same color scheme
21910 </p></dd>
21911 </dl>
21912
21913 <p>Default value is &lsquo;<samp>channel</samp>&rsquo;.
21914 </p>
21915 </dd>
21916 <dt> &lsquo;<samp>scale</samp>&rsquo;</dt>
21917 <dd><p>Specify scale used for calculating intensity color values.
21918 </p>
21919 <p>It accepts the following values:
21920 </p><dl compact="compact">
21921 <dt> &lsquo;<samp>lin</samp>&rsquo;</dt>
21922 <dd><p>linear
21923 </p></dd>
21924 <dt> &lsquo;<samp>sqrt</samp>&rsquo;</dt>
21925 <dd><p>square root, default
21926 </p></dd>
21927 <dt> &lsquo;<samp>cbrt</samp>&rsquo;</dt>
21928 <dd><p>cubic root
21929 </p></dd>
21930 <dt> &lsquo;<samp>log</samp>&rsquo;</dt>
21931 <dd><p>logarithmic
21932 </p></dd>
21933 </dl>
21934
21935 <p>Default value is &lsquo;<samp>sqrt</samp>&rsquo;.
21936 </p>
21937 </dd>
21938 <dt> &lsquo;<samp>saturation</samp>&rsquo;</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>.
21943 </p>
21944 </dd>
21945 <dt> &lsquo;<samp>win_func</samp>&rsquo;</dt>
21946 <dd><p>Set window function.
21947 </p>
21948 <p>It accepts the following values:
21949 </p><dl compact="compact">
21950 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
21951 <dd><p>No samples pre-processing (do not expect this to be faster)
21952 </p></dd>
21953 <dt> &lsquo;<samp>hann</samp>&rsquo;</dt>
21954 <dd><p>Hann window
21955 </p></dd>
21956 <dt> &lsquo;<samp>hamming</samp>&rsquo;</dt>
21957 <dd><p>Hamming window
21958 </p></dd>
21959 <dt> &lsquo;<samp>blackman</samp>&rsquo;</dt>
21960 <dd><p>Blackman window
21961 </p></dd>
21962 </dl>
21963
21964 <p>Default value is <code>hann</code>.
21965 </p></dd>
21966 </dl>
21967
21968 <p>The usage is very similar to the showwaves filter; see the examples in that
21969 section.
21970 </p>
21971 <a name="Examples-2"></a>
21972 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-2">36.10.1 Examples</a></h3>
21973
21974 <ul>
21975 <li>
21976 Large window with logarithmic color scaling:
21977 <table><tr><td>&nbsp;</td><td><pre class="example">showspectrum=s=1280x480:scale=log
21978 </pre></td></tr></table>
21979
21980 </li><li>
21981 Complete example for a colored and sliding spectrum per channel using <code>ffplay</code>:
21982 <table><tr><td>&nbsp;</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>
21985 </li></ul>
21986
21987 <a name="showwaves"></a>
21988 <h2 class="section"><a href="ffplay-all.html#toc-showwaves">36.11 showwaves</a></h2>
21989
21990 <p>Convert input audio to a video output, representing the samples waves.
21991 </p>
21992 <p>The filter accepts the following options:
21993 </p>
21994 <dl compact="compact">
21995 <dt> &lsquo;<samp>size, s</samp>&rsquo;</dt>
21996 <dd><p>Specify the video size for the output. For the syntax of this option, check
21997 the &quot;Video size&quot; section in the ffmpeg-utils manual. Default value
21998 is &quot;600x240&quot;.
21999 </p>
22000 </dd>
22001 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
22002 <dd><p>Set display mode.
22003 </p>
22004 <p>Available values are:
22005 </p><dl compact="compact">
22006 <dt> &lsquo;<samp>point</samp>&rsquo;</dt>
22007 <dd><p>Draw a point for each sample.
22008 </p>
22009 </dd>
22010 <dt> &lsquo;<samp>line</samp>&rsquo;</dt>
22011 <dd><p>Draw a vertical line for each sample.
22012 </p></dd>
22013 </dl>
22014
22015 <p>Default value is <code>point</code>.
22016 </p>
22017 </dd>
22018 <dt> &lsquo;<samp>n</samp>&rsquo;</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.
22023 </p>
22024 </dd>
22025 <dt> &lsquo;<samp>rate, r</samp>&rsquo;</dt>
22026 <dd><p>Set the (approximate) output frame rate. This is done by setting the
22027 option <var>n</var>. Default value is &quot;25&quot;.
22028 </p>
22029 </dd>
22030 </dl>
22031
22032 <a name="Examples-90"></a>
22033 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-90">36.11.1 Examples</a></h3>
22034
22035 <ul>
22036 <li>
22037 Output the input file audio and the corresponding video representation
22038 at the same time:
22039 <table><tr><td>&nbsp;</td><td><pre class="example">amovie=a.mp3,asplit[out0],showwaves[out1]
22040 </pre></td></tr></table>
22041
22042 </li><li>
22043 Create a synthetic signal and show it with showwaves, forcing a
22044 frame rate of 30 frames per second:
22045 <table><tr><td>&nbsp;</td><td><pre class="example">aevalsrc=sin(1*2*PI*t)*sin(880*2*PI*t):cos(2*PI*200*t),asplit[out0],showwaves=r=30[out1]
22046 </pre></td></tr></table>
22047 </li></ul>
22048
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>
22051
22052 <p>Split input into several identical outputs.
22053 </p>
22054 <p><code>asplit</code> works with audio input, <code>split</code> with video.
22055 </p>
22056 <p>The filter accepts a single parameter which specifies the number of outputs. If
22057 unspecified, it defaults to 2.
22058 </p>
22059 <a name="Examples-83"></a>
22060 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-83">36.12.1 Examples</a></h3>
22061
22062 <ul>
22063 <li>
22064 Create two separate outputs from the same input:
22065 <table><tr><td>&nbsp;</td><td><pre class="example">[in] split [out0][out1]
22066 </pre></td></tr></table>
22067
22068 </li><li>
22069 To create 3 or more outputs, you need to specify the number of
22070 outputs, like in:
22071 <table><tr><td>&nbsp;</td><td><pre class="example">[in] asplit=3 [out0][out1][out2]
22072 </pre></td></tr></table>
22073
22074 </li><li>
22075 Create two separate outputs from the same input, one cropped and
22076 one padded:
22077 <table><tr><td>&nbsp;</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>
22081
22082 </li><li>
22083 Create 5 copies of the input audio with <code>ffmpeg</code>:
22084 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT
22085 </pre></td></tr></table>
22086 </li></ul>
22087
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>
22090
22091 <p>Receive commands sent through a libzmq client, and forward them to
22092 filters in the filtergraph.
22093 </p>
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
22096 audio filters.
22097 </p>
22098 <p>To enable these filters you need to install the libzmq library and
22099 headers and configure FFmpeg with <code>--enable-libzmq</code>.
22100 </p>
22101 <p>For more information about libzmq see:
22102 <a href="http://www.zeromq.org/">http://www.zeromq.org/</a>
22103 </p>
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 &lsquo;<samp>bind_address</samp>&rsquo; option.
22107 </p>
22108 <p>The received message must be in the form:
22109 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>TARGET</var> <var>COMMAND</var> [<var>ARG</var>]
22110 </pre></td></tr></table>
22111
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.
22114 </p>
22115 <p><var>COMMAND</var> specifies the name of the command for the target filter.
22116 </p>
22117 <p><var>ARG</var> is optional and specifies the optional argument list for the
22118 given <var>COMMAND</var>.
22119 </p>
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>&nbsp;</td><td><pre class="example"><var>ERROR_CODE</var> <var>ERROR_REASON</var>
22124 <var>MESSAGE</var>
22125 </pre></td></tr></table>
22126
22127 <p><var>MESSAGE</var> is optional.
22128 </p>
22129 <a name="Examples-29"></a>
22130 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-29">36.13.1 Examples</a></h3>
22131
22132 <p>Look at &lsquo;<tt>tools/zmqsend</tt>&rsquo; for an example of a zmq client which can
22133 be used to send commands processed by these filters.
22134 </p>
22135 <p>Consider the following filtergraph generated by <code>ffplay</code>
22136 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay -dumpgraph 1 -f lavfi &quot;
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 &quot;
22142 </pre></td></tr></table>
22143
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>&nbsp;</td><td><pre class="example">echo Parsed_color_0 c yellow | tools/zmqsend
22147 </pre></td></tr></table>
22148
22149 <p>To change the right side:
22150 </p><table><tr><td>&nbsp;</td><td><pre class="example">echo Parsed_color_1 c pink | tools/zmqsend
22151 </pre></td></tr></table>
22152
22153
22154 <a name="Multimedia-Sources"></a>
22155 <h1 class="chapter"><a href="ffplay-all.html#toc-Multimedia-Sources">37. Multimedia Sources</a></h1>
22156
22157 <p>Below is a description of the currently available multimedia sources.
22158 </p>
22159 <a name="amovie"></a>
22160 <h2 class="section"><a href="ffplay-all.html#toc-amovie">37.1 amovie</a></h2>
22161
22162 <p>This is the same as <a href="#movie">movie</a> source, except it selects an audio
22163 stream by default.
22164 </p>
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>
22168
22169 <p>Read audio and/or video stream(s) from a movie container.
22170 </p>
22171 <p>This filter accepts the following options:
22172 </p>
22173 <dl compact="compact">
22174 <dt> &lsquo;<samp>filename</samp>&rsquo;</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).
22177 </p>
22178 </dd>
22179 <dt> &lsquo;<samp>format_name, f</samp>&rsquo;</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.
22183 </p>
22184 </dd>
22185 <dt> &lsquo;<samp>seek_point, sp</samp>&rsquo;</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 &quot;0&quot;.
22190 </p>
22191 </dd>
22192 <dt> &lsquo;<samp>streams, s</samp>&rsquo;</dt>
22193 <dd><p>Specifies the streams to read. Several streams can be specified,
22194 separated by &quot;+&quot;. The source will then have as many outputs, in the
22195 same order. The syntax is explained in the &ldquo;Stream specifiers&rdquo;
22196 section in the ffmpeg manual. Two special names, &quot;dv&quot; and &quot;da&quot; specify
22197 respectively the default (best suited) video and audio stream. Default
22198 is &quot;dv&quot;, or &quot;da&quot; if the filter is called as &quot;amovie&quot;.
22199 </p>
22200 </dd>
22201 <dt> &lsquo;<samp>stream_index, si</samp>&rsquo;</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 &quot;-1&quot;. Deprecated. If the filter is called &quot;amovie&quot;, it will select
22205 audio instead of video.
22206 </p>
22207 </dd>
22208 <dt> &lsquo;<samp>loop</samp>&rsquo;</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 &quot;1&quot;.
22212 </p>
22213 <p>Note that when the movie is looped the source timestamps are not
22214 changed, so it will generate non monotonically increasing timestamps.
22215 </p></dd>
22216 </dl>
22217
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>&nbsp;</td><td><pre class="example">input -----------&gt; deltapts0 --&gt; overlay --&gt; output
22221                                     ^
22222                                     |
22223 movie --&gt; scale--&gt; deltapts1 -------+
22224 </pre></td></tr></table>
22225
22226 <a name="Examples-69"></a>
22227 <h3 class="subsection"><a href="ffplay-all.html#toc-Examples-69">37.2.1 Examples</a></h3>
22228
22229 <ul>
22230 <li>
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 &quot;in&quot;:
22233 <table><tr><td>&nbsp;</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>
22237
22238 </li><li>
22239 Read from a video4linux2 device, and overlay it on top of the input
22240 labelled as &quot;in&quot;:
22241 <table><tr><td>&nbsp;</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>
22245
22246 </li><li>
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 &quot;video&quot; and the audio is
22249 connected to the pad named &quot;audio&quot;:
22250 <table><tr><td>&nbsp;</td><td><pre class="example">movie=dvd.vob:s=v:0+#0x81 [video] [audio]
22251 </pre></td></tr></table>
22252 </li></ul>
22253
22254
22255 <a name="See-Also"></a>
22256 <h1 class="chapter"><a href="ffplay-all.html#toc-See-Also">38. See Also</a></h1>
22257
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>
22269 </p>
22270
22271 <a name="Authors"></a>
22272 <h1 class="chapter"><a href="ffplay-all.html#toc-Authors">39. Authors</a></h1>
22273
22274 <p>The FFmpeg developers.
22275 </p>
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>.
22280 </p>
22281 <p>Maintainers for the specific components are listed in the file
22282 &lsquo;<tt>MAINTAINERS</tt>&rsquo; in the source code tree.
22283 </p>
22284
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>